mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-16 23:08:32 +00:00
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:
18
config.c
18
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;
|
||||
|
||||
Reference in New Issue
Block a user