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