Changeset 2480:99aad69c8dd8 in roaraudio


Ignore:
Timestamp:
08/23/09 00:47:15 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

read config from $ROAR_OPTIONS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/config.c

    r2478 r2480  
    5050 struct roar_libroar_config * config = roar_libroar_get_config_ptr(); 
    5151 static int inited = 0; 
     52 char * k, * v, * next; 
    5253 
    5354 if ( !inited ) { 
     55  next = getenv("ROAR_OPTIONS"); 
     56 
     57  while (next != NULL) { 
     58   k = next; 
     59   next = strstr(next, " "); 
     60   if ( next != NULL ) { 
     61    *next = 0; 
     62     next++; 
     63   } 
     64 
     65   if ( (v = strstr(k, ":")) != NULL ) { 
     66    *v = 0; 
     67     v++; 
     68   } 
     69 
     70   if ( !strcmp(k, "workaround") ) { 
     71    if ( !strcmp(v, "use-execed") ) { 
     72     config->workaround.workarounds |= ROAR_LIBROAR_CONFIG_WAS_USE_EXECED; 
     73    } else { 
     74     ROAR_WARN("roar_libroar_get_config(void): Unknown workaround option: %s", v); 
     75    } 
     76   } else { 
     77    ROAR_WARN("roar_libroar_get_config(void): Unknown option: %s", k); 
     78   } 
     79  } 
     80 
    5481  inited++; 
    5582 } 
Note: See TracChangeset for help on using the changeset viewer.