- Timestamp:
- Feb 19, 2013, 8:29:04 PM (11 years ago)
- Branches:
- master, release-1.10
- Children:
- 5001a3d
- Parents:
- 06e04a9
- git-author:
- David Benjamin <davidben@mit.edu> (06/09/12 16:07:20)
- git-committer:
- David Benjamin <davidben@mit.edu> (02/19/13 20:29:04)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
owl.h
r06e04a9 r353719a 235 235 char *name; 236 236 int type; /* OWL_VARIABLE_* */ 237 GValue gval_default;237 char *default_str; /* the default value as a string */ 238 238 const char *validsettings; /* documentation of valid settings */ 239 239 char *summary; /* summary of usage */ 240 240 char *description; /* detailed description */ 241 241 GValue val; /* current value */ 242 GClosure *validate_fn;243 /* returns 1 if newval is valid */244 GClosure *set_fn;245 /* sets the variable to a value246 * of the appropriate type.247 * unless documented, this248 * should make a copy.249 * returns 0 on success. */250 242 GClosure *set_fromstring_fn; 251 243 /* sets the variable to a value … … 254 246 * should make a copy. 255 247 * returns 0 on success. */ 256 GClosure *get_fn; 248 GClosure *get_tostring_fn; 249 /* converts val to a string; 250 * caller must free the result */ 251 252 /* These are only valid for OWL_VARIABLE_{INT,BOOL,STRING} */ 253 GCallback get_fn; 257 254 /* returns a reference to the current value. 258 255 * WARNING: this approach is hard to make 259 256 * thread-safe... */ 260 GC losure *get_tostring_fn;261 /* converts val to a string;262 * caller must free the result */ 263 GClosure *delete_fn;264 /* frees val as needed */265 GClosure *get_default_fn; 266 /* return the default value, as set at creation time */ 267 257 GCallback validate_fn; 258 /* returns 1 if newval is valid */ 259 GCallback set_fn; 260 /* sets the variable to a value 261 * of the appropriate type. 262 * unless documented, this 263 * should make a copy. 264 * returns 0 on success. */ 268 265 } owl_variable; 269 266 270 267 typedef struct _owl_variable_init_params { 271 c har *name;268 const char *name; 272 269 int type; /* OWL_VARIABLE_* */ 273 void *pval_default; /* for types other andstring */274 int ival_default; /* for types int and bool */270 const char *pval_default; /* for string */ 271 int ival_default; /* for types int and bool */ 275 272 const char *validsettings; /* documentation of valid settings */ 276 c har *summary; /* summary of usage */277 c har *description;/* detailed description */273 const char *summary; /* summary of usage */ 274 const char *description; /* detailed description */ 278 275 void *val; /* current value */ 279 276 GCallback validate_fn; … … 298 295 /* converts val to a string; 299 296 * caller must free the result */ 300 GCallback delete_fn;301 /* frees val as needed */302 GCallback get_default_fn;303 /* return the default value as set at creation time */304 297 } owl_variable_init_params; 305 298
Note: See TracChangeset
for help on using the changeset viewer.