comparison th_config.h @ 138:3e221c16b087

Improvements in configuration file handing.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 02 Nov 2010 21:46:16 +0200
parents ffe8bbd429fa
children 0db02b8d2d11
comparison
equal deleted inserted replaced
137:fad8c31e41e6 138:3e221c16b087
24 ITEM_STRING, 24 ITEM_STRING,
25 ITEM_INT, 25 ITEM_INT,
26 ITEM_UINT, 26 ITEM_UINT,
27 ITEM_BOOL, 27 ITEM_BOOL,
28 ITEM_FLOAT, 28 ITEM_FLOAT,
29 ITEM_HEX_TRIPLET 29 ITEM_HEX_TRIPLET,
30
31 ITEM_STRING_LIST,
32 ITEM_HEX_TRIPLET_LIST
30 }; 33 };
31 34
32 35
33 typedef struct _cfgitem_t { 36 typedef struct _cfgitem_t {
34 int type; 37 int type;
35 char *name; 38 char *name;
36 union { 39 union {
37 void *data;
38 int *val_int; 40 int *val_int;
39 unsigned int *val_uint; 41 unsigned int *val_uint;
40 char *val_str; 42 char **val_str;
41 BOOL *val_bool; 43 BOOL *val_bool;
44
45 void *data;
46 qlist_t **list;
42 struct _cfgitem_t *section; 47 struct _cfgitem_t *section;
43 }; 48 };
44 49
45 struct _cfgitem_t *next, *prev; 50 struct _cfgitem_t *next, *prev;
46 } cfgitem_t; 51 } cfgitem_t;
59 int th_cfg_add_string(cfgitem_t **cfg, char *name, char **data, char *itemDef); 64 int th_cfg_add_string(cfgitem_t **cfg, char *name, char **data, char *itemDef);
60 int th_cfg_add_bool(cfgitem_t **cfg, char *name, BOOL *data, BOOL itemDef); 65 int th_cfg_add_bool(cfgitem_t **cfg, char *name, BOOL *data, BOOL itemDef);
61 int th_cfg_add_float(cfgitem_t **cfg, char *name, float *data, float itemDef); 66 int th_cfg_add_float(cfgitem_t **cfg, char *name, float *data, float itemDef);
62 int th_cfg_add_hexvalue(cfgitem_t **cfg, char *name, int *data, int itemDef); 67 int th_cfg_add_hexvalue(cfgitem_t **cfg, char *name, int *data, int itemDef);
63 68
69 int th_cfg_add_string_list(cfgitem_t **cfg, char *name, qlist_t **list);
64 70
65 #ifdef __cplusplus 71 #ifdef __cplusplus
66 } 72 }
67 #endif 73 #endif
68 #endif /* _TH_CONFIG_H */ 74 #endif /* _TH_CONFIG_H */