comparison th_config.h @ 708:a34715d51ea4

Add support for deallocator function in th_cfg_free() for freeing the values.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 27 Apr 2020 00:44:15 +0300
parents 1092eb33bd59
children 4ca6a3b30fe8
comparison
equal deleted inserted replaced
707:57d30f49fe1e 708:a34715d51ea4
61 61
62 // 62 //
63 // Functions 63 // Functions
64 // 64 //
65 int th_cfg_read(th_ioctx *fh, th_cfgitem_t *cfg /*, TODO XXX const int flags (for controlling things like "error out on unknown items or ignore" etc */); 65 int th_cfg_read(th_ioctx *fh, th_cfgitem_t *cfg /*, TODO XXX const int flags (for controlling things like "error out on unknown items or ignore" etc */);
66 void th_cfg_free(th_cfgitem_t *cfg); 66 void th_cfg_free(th_cfgitem_t *cfg, void (*freefunc)(th_cfgitem_t *));
67 int th_cfg_write(th_ioctx *fh, const th_cfgitem_t *cfg); 67 int th_cfg_write(th_ioctx *fh, const th_cfgitem_t *cfg);
68 68
69 int th_cfg_add_comment(th_cfgitem_t **cfg, const char *comment); 69 int th_cfg_add_comment(th_cfgitem_t **cfg, const char *comment);
70 int th_cfg_add_section(th_cfgitem_t **cfg, const char *name, th_cfgitem_t *sect); 70 int th_cfg_add_section(th_cfgitem_t **cfg, const char *name, th_cfgitem_t *sect);
71 71