diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-11-23 17:58:59 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-11-23 17:58:59 +0000 |
commit | f53a4499ef0913a196808e53319cd619e8e2b153 (patch) | |
tree | cc06062d8a0ac18ce183e652435cb0d12fa271aa /config.c | |
parent | 594ee6f42d8a25421c2b5e42f37d09224e0a8596 (diff) |
Build out "multi" version of realtime config (directory and realtime extensions will need this)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4324 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'config.c')
-rwxr-xr-x | config.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -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; |