summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJeff Peeler <jpeeler@digium.com>2008-02-12 00:24:36 +0000
committerJeff Peeler <jpeeler@digium.com>2008-02-12 00:24:36 +0000
commit16a14a4cd87db56f138399a5097647f6890f6037 (patch)
tree58614e54e5084df515faf84b5358b3c10bc0fe95 /include
parent3f99a1b4bf1fa569c9a0c201a327508eb9ad94a4 (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: https://origsvn.digium.com/svn/asterisk/trunk@103331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include')
-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);