Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • set.c

    r06b5893 r88eaf4b  
    2929char *SET_INVALID = "nee";
    3030
    31 set_t *set_add( set_t **head, const char *key, const char *def, set_eval eval, void *data )
     31set_t *set_add( set_t **head, char *key, char *def, set_eval eval, void *data )
    3232{
    3333        set_t *s = set_find( head, key );
     
    6363}
    6464
    65 set_t *set_find( set_t **head, const char *key )
     65set_t *set_find( set_t **head, char *key )
    6666{
    6767        set_t *s = *head;
     
    7878}
    7979
    80 char *set_getstr( set_t **head, const char *key )
     80char *set_getstr( set_t **head, char *key )
    8181{
    8282        set_t *s = set_find( head, key );
     
    8888}
    8989
    90 int set_getint( set_t **head, const char *key )
     90int set_getint( set_t **head, char *key )
    9191{
    9292        char *s = set_getstr( head, key );
     
    102102}
    103103
    104 int set_getbool( set_t **head, const char *key )
     104int set_getbool( set_t **head, char *key )
    105105{
    106106        char *s = set_getstr( head, key );
     
    112112}
    113113
    114 int set_isvisible( set_t *set )
    115 {
    116         /* the default value is not stored in value, only in def */
    117         return !( ( set->flags & SET_HIDDEN ) ||
    118                   ( ( set->flags & SET_HIDDEN_DEFAULT ) &&
    119                     ( set->value == NULL ) ) );
    120 }
    121 
    122 int set_setstr( set_t **head, const char *key, char *value )
     114int set_setstr( set_t **head, char *key, char *value )
    123115{
    124116        set_t *s = set_find( head, key );
     
    159151}
    160152
    161 int set_setint( set_t **head, const char *key, int value )
     153int set_setint( set_t **head, char *key, int value )
    162154{
    163155        char s[24];     /* Not quite 128-bit clean eh? ;-) */
     
    167159}
    168160
    169 void set_del( set_t **head, const char *key )
     161void set_del( set_t **head, char *key )
    170162{
    171163        set_t *s = *head, *t = NULL;
     
    192184}
    193185
    194 int set_reset( set_t **head, const char *key )
     186int set_reset( set_t **head, char *key )
    195187{
    196188        set_t *s;
     
    221213{
    222214        return is_bool( value ) ? value : SET_INVALID;
    223 }
    224 
    225 char *set_eval_list( set_t *set, char *value )
    226 {
    227         GSList *options = set->eval_data, *opt;
    228        
    229         for( opt = options; opt; opt = opt->next )
    230                 if( strcmp( value, opt->data ) == 0 )
    231                         return value;
    232        
    233         /* TODO: It'd be nice to show the user a list of allowed values,
    234                  but we don't have enough context here to do that. May
    235                  want to fix that. */
    236        
    237         return NULL;
    238215}
    239216
Note: See TracChangeset for help on using the changeset viewer.