aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/config.h
diff options
context:
space:
mode:
authorjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-12 00:24:36 +0000
committerjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-12 00:24:36 +0000
commit3847faed34e077909c3f00497c61104740240e0d (patch)
tree58614e54e5084df515faf84b5358b3c10bc0fe95 /include/asterisk/config.h
parent509fcae4803f1ffe0bbb6269b6ae26be6f8babe6 (diff)
Requested changes from Pari, reviewed by Russell.
Added ability to retrieve list of categories in a config file. Added ability to retrieve the content of a particular category. Added ability to empty a context. Created new action to create a new file. Updated delete action to allow deletion by line number with respect to category. Added new action insert to add new variable to category at specified line. Updated action newcat to allow new category to be inserted in file above another existing category. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@103331 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/config.h')
-rw-r--r--include/asterisk/config.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/asterisk/config.h b/include/asterisk/config.h
index fe9d49d30..4757d5126 100644
--- a/include/asterisk/config.h
+++ b/include/asterisk/config.h
@@ -254,7 +254,18 @@ const char *ast_config_option(struct ast_config *cfg, const char *cat, const cha
struct ast_category *ast_category_new(const char *name, const char *in_file, int lineno);
void ast_category_append(struct ast_config *config, struct ast_category *cat);
+
+/*!
+ * \brief Inserts new category
+ * \param config which config to use
+ * \param cat newly created category to insert
+ * \param match which category to insert above
+ * This function is used to insert a new category above another category
+ * matching the match parameter.
+ */
+void ast_category_insert(struct ast_config *config, struct ast_category *cat, const char *match);
int ast_category_delete(struct ast_config *cfg, const char *category);
+int ast_category_empty(struct ast_config *cfg, const char *category);
void ast_category_destroy(struct ast_category *cat);
struct ast_variable *ast_category_detach_variables(struct ast_category *cat);
void ast_category_rename(struct ast_category *cat, const char *name);
@@ -264,7 +275,8 @@ struct ast_config_include *ast_include_new(struct ast_config *conf, const char *
struct ast_config_include *ast_include_find(struct ast_config *conf, const char *included_file);
void ast_include_rename(struct ast_config *conf, const char *from_file, const char *to_file);
void ast_variable_append(struct ast_category *category, struct ast_variable *variable);
-int ast_variable_delete(struct ast_category *category, const char *variable, const char *match);
+void ast_variable_insert(struct ast_category *category, struct ast_variable *variable, const char *line);
+int ast_variable_delete(struct ast_category *category, const char *variable, const char *match, const char *line);
int ast_variable_update(struct ast_category *category, const char *variable,
const char *value, const char *match, unsigned int object);