aboutsummaryrefslogtreecommitdiffstats
path: root/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'config.c')
-rwxr-xr-xconfig.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/config.c b/config.c
index 111145c7b..06fd123e5 100755
--- a/config.c
+++ b/config.c
@@ -54,6 +54,12 @@ void ast_destroy_realtime(struct ast_variable *v)
}
}
+void ast_category_destroy(struct ast_category *cat)
+{
+ ast_destroy_realtime(cat->root);
+ free(cat);
+}
+
void ast_destroy(struct ast_config *ast)
{
struct ast_category *cat, *catn;
@@ -591,6 +597,18 @@ struct ast_config *ast_load(char *configfile)
return __ast_load(configfile, NULL, &tmpc, &last, 0);
}
+void ast_category_append(struct ast_config *config, struct ast_category *cat)
+{
+ struct ast_category *prev = NULL;
+ cat->next = NULL;
+ if (config->root) {
+ prev = config->root;
+ while(prev->next) prev = prev->next;
+ prev->next = cat;
+ } else
+ config->root = cat;
+}
+
char *ast_category_browse(struct ast_config *config, char *prev)
{
struct ast_category *cat;