Changes in set.c [88eaf4b:06b5893]
Legend:
- Unmodified
- Added
- Removed
-
set.c
r88eaf4b r06b5893 29 29 char *SET_INVALID = "nee"; 30 30 31 set_t *set_add( set_t **head, c har *key,char *def, set_eval eval, void *data )31 set_t *set_add( set_t **head, const char *key, const char *def, set_eval eval, void *data ) 32 32 { 33 33 set_t *s = set_find( head, key ); … … 63 63 } 64 64 65 set_t *set_find( set_t **head, c har *key )65 set_t *set_find( set_t **head, const char *key ) 66 66 { 67 67 set_t *s = *head; … … 78 78 } 79 79 80 char *set_getstr( set_t **head, c har *key )80 char *set_getstr( set_t **head, const char *key ) 81 81 { 82 82 set_t *s = set_find( head, key ); … … 88 88 } 89 89 90 int set_getint( set_t **head, c har *key )90 int set_getint( set_t **head, const char *key ) 91 91 { 92 92 char *s = set_getstr( head, key ); … … 102 102 } 103 103 104 int set_getbool( set_t **head, c har *key )104 int set_getbool( set_t **head, const char *key ) 105 105 { 106 106 char *s = set_getstr( head, key ); … … 112 112 } 113 113 114 int set_setstr( set_t **head, char *key, char *value ) 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 ) 115 123 { 116 124 set_t *s = set_find( head, key ); … … 151 159 } 152 160 153 int set_setint( set_t **head, c har *key, int value )161 int set_setint( set_t **head, const char *key, int value ) 154 162 { 155 163 char s[24]; /* Not quite 128-bit clean eh? ;-) */ … … 159 167 } 160 168 161 void set_del( set_t **head, c har *key )169 void set_del( set_t **head, const char *key ) 162 170 { 163 171 set_t *s = *head, *t = NULL; … … 184 192 } 185 193 186 int set_reset( set_t **head, c har *key )194 int set_reset( set_t **head, const char *key ) 187 195 { 188 196 set_t *s; … … 213 221 { 214 222 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; 215 238 } 216 239
Note: See TracChangeset
for help on using the changeset viewer.