diff options
author | Mark Spencer <markster@digium.com> | 2004-11-23 17:58:59 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2004-11-23 17:58:59 +0000 |
commit | 5e650c826016d69b1c821e386ab5a7d3d998281c (patch) | |
tree | cc06062d8a0ac18ce183e652435cb0d12fa271aa /config.c | |
parent | d92e62d4d4053c0a25da6b13d4cbe9df5448d971 (diff) |
Build out "multi" version of realtime config (directory and realtime extensions will need this)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4324 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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; |