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
This commit is contained in:
Mark Spencer
2004-11-23 17:58:59 +00:00
parent d92e62d4d4
commit 5e650c8260
3 changed files with 174 additions and 0 deletions

View File

@@ -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;