Changeset 5486:3f3a5a9eca72 in roaraudio
- Timestamp:
- 04/29/12 09:16:50 (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/universal/helloworld.c
r5483 r5486 29 29 static int hw_init (struct roar_dl_librarypara * para) { 30 30 const char * text = "Hello world!"; 31 struct roar_keyval * arg; 32 33 (void)para; // We ignore all parameters passed to us. 31 struct roar_keyval * cur; 32 size_t i; 34 33 35 34 if ( para != NULL && para->argv != NULL ) { 36 arg = roar_keyval_lookup(para->argv, "text", para->argc, 0); 37 if ( arg != NULL && arg->value != NULL ) 38 text = arg->value; 35 for (i = 0; i < para->argc; i++) { 36 cur = &(para->argv[i]); 37 if ( cur->key != NULL && !strcmp(cur->key, "text") ) { 38 if ( cur->value != NULL ) { 39 text = cur->value; 40 } else if ( (i+1) < para->argc && para->argv[i+1].key == NULL ) { 41 text = para->argv[i+1].value; 42 i++; 43 } 44 } 45 } 39 46 } 40 47
Note: See TracChangeset
for help on using the changeset viewer.