Changeset 5483:39ed701a5718 in roaraudio for plugins


Ignore:
Timestamp:
04/25/12 09:47:04 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

support setting a non-default greeting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/universal/helloworld.c

    r5440 r5483  
    2828// A simple function printing our message. 
    2929static int hw_init (struct roar_dl_librarypara * para) { 
     30 const char * text = "Hello world!"; 
     31 struct roar_keyval * arg; 
     32 
    3033 (void)para; // We ignore all parameters passed to us. 
    3134 
    32  roar_vio_printf(roar_stdout, "Hello world!\n"); 
     35 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; 
     39 } 
     40 
     41 roar_vio_printf(roar_stdout, "%s\n", text); 
    3342 
    3443 return 0; 
Note: See TracChangeset for help on using the changeset viewer.