Mercurial > hg > th-libs
diff th_config.h @ 15:4adf7093060c
Sync.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 30 Oct 2010 17:48:40 +0300 |
parents | e467b3586e4d |
children | 0cea9c0cfce7 |
line wrap: on
line diff
--- a/th_config.h Sat Oct 30 17:47:41 2010 +0300 +++ b/th_config.h Sat Oct 30 17:48:40 2010 +0300 @@ -31,9 +31,16 @@ typedef struct _cfgitem_t { + int type; char *name; - int type; - void *data; + union { + void *data; + int *val_int; + unsigned int *val_uint; + char *val_str; + BOOL *val_bool; + struct _cfgitem_t *section; + }; BOOL (*validate)(struct _cfgitem_t *); struct _cfgitem_t *next, *prev; @@ -53,6 +60,8 @@ int th_config_add_string(cfgitem_t **cfg, char *name, BOOL (*validate)(cfgitem_t *), char **data, char *itemDef); int th_config_add_bool(cfgitem_t **cfg, char *name, BOOL (*validate)(cfgitem_t *), BOOL *data, BOOL itemDef); int th_config_add_float(cfgitem_t **cfg, char *name, BOOL (*validate)(cfgitem_t *), float *data, float itemDef); +int th_config_add_hexvalue(cfgitem_t **cfg, char *name, BOOL (*validate)(cfgitem_t *), int *data, int itemDef); + #ifdef __cplusplus }