Loading include/cutils/config_utils.h +3 −0 Original line number Original line Diff line number Diff line Loading @@ -54,6 +54,9 @@ const char* config_str(cnode *root, const char *name, const char *_default); /* add a named child to a config node (or modify it if it already exists) */ /* add a named child to a config node (or modify it if it already exists) */ void config_set(cnode *root, const char *name, const char *value); void config_set(cnode *root, const char *name, const char *value); /* free a config node tree */ void config_free(cnode *root); #ifdef __cplusplus #ifdef __cplusplus } } #endif #endif Loading libcutils/config_utils.c +12 −0 Original line number Original line Diff line number Diff line Loading @@ -315,3 +315,15 @@ void config_load_file(cnode *root, const char *fn) data = load_file(fn, 0); data = load_file(fn, 0); config_load(root, data); config_load(root, data); } } void config_free(cnode *root) { cnode *cur = root->first_child; while (cur) { cnode *prev = cur; config_free(cur); cur = cur->next; free(prev); } } Loading
include/cutils/config_utils.h +3 −0 Original line number Original line Diff line number Diff line Loading @@ -54,6 +54,9 @@ const char* config_str(cnode *root, const char *name, const char *_default); /* add a named child to a config node (or modify it if it already exists) */ /* add a named child to a config node (or modify it if it already exists) */ void config_set(cnode *root, const char *name, const char *value); void config_set(cnode *root, const char *name, const char *value); /* free a config node tree */ void config_free(cnode *root); #ifdef __cplusplus #ifdef __cplusplus } } #endif #endif Loading
libcutils/config_utils.c +12 −0 Original line number Original line Diff line number Diff line Loading @@ -315,3 +315,15 @@ void config_load_file(cnode *root, const char *fn) data = load_file(fn, 0); data = load_file(fn, 0); config_load(root, data); config_load(root, data); } } void config_free(cnode *root) { cnode *cur = root->first_child; while (cur) { cnode *prev = cur; config_free(cur); cur = cur->next; free(prev); } }