Changeset 3218:8748b21b361b in roaraudio


Ignore:
Timestamp:
01/24/10 06:36:44 (10 years ago)
Author:
phi
Branch:
default
Message:

option to set authfile

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • include/libroar/config.h

    r3136 r3218  
    9292 } codecs; 
    9393 struct roar_audio_info info; 
     94 char * authfile; 
    9495}; 
    9596 
  • libroar/config.c

    r3136 r3218  
    4141struct roar_libroar_config * roar_libroar_get_config_ptr(void) { 
    4242 static struct roar_libroar_config config; 
    43  static int inited = 0; 
     43 static int    inited = 0; 
     44 static char   authfile[1024]; 
     45 char        * home = getenv("HOME"); 
    4446 
    4547 if ( !inited ) { 
    4648  memset(&config, 0, sizeof(config)); 
    4749 
    48   config.server = NULL; 
     50  config.server   = NULL; 
     51  config.authfile = NULL; 
     52 
     53  if ( home != NULL ) { 
     54   snprintf(authfile, 1023, "%s/.roarauth", home); 
     55   authfile[1023]  = 0; 
     56   config.authfile = authfile; 
     57  } 
    4958 
    5059  inited++; 
     
    233242   if ( roar_libroar_get_server() == NULL ) 
    234243    roar_libroar_set_server(v); 
     244  } else if ( !strcmp(k, "set-authfile") ) { 
     245   strncpy(confi->authfile, v, 1023); 
     246   confi->authfile[1023] = 0; 
    235247  } else { 
    236248   ROAR_WARN("roar_libroar_config_parse(*): Unknown option: %s", k); 
Note: See TracChangeset for help on using the changeset viewer.