First pass at in-place file manipulation via manager

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@37936 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2006-07-19 13:28:38 +00:00
parent db0b142b06
commit 837910062b
6 changed files with 317 additions and 18 deletions

View File

@@ -45,7 +45,7 @@ struct ast_variable {
char stuff[0];
};
typedef struct ast_config *config_load_func(const char *database, const char *table, const char *configfile, struct ast_config *config);
typedef struct ast_config *config_load_func(const char *database, const char *table, const char *configfile, struct ast_config *config, int withcomments);
typedef struct ast_variable *realtime_var_get(const char *database, const char *table, va_list ap);
typedef struct ast_config *realtime_multi_get(const char *database, const char *table, va_list ap);
typedef int realtime_update(const char *database, const char *table, const char *keyfield, const char *entity, va_list ap);
@@ -66,6 +66,7 @@ struct ast_config_engine {
* Returns NULL on error, or an ast_config data structure on success
*/
struct ast_config *ast_config_load(const char *filename);
struct ast_config *ast_config_load_with_comments(const char *filename);
/*! \brief Destroys a config
* \param config pointer to config data structure
@@ -181,11 +182,12 @@ void ast_category_rename(struct ast_category *cat, const char *name);
struct ast_variable *ast_variable_new(const char *name, const char *value);
void ast_variable_append(struct ast_category *category, struct ast_variable *variable);
int ast_variable_delete(struct ast_config *cfg, char *category, char *variable, char *value);
int ast_variable_delete(struct ast_category *category, char *variable);
int ast_variable_update(struct ast_category *category, char *variable, char *value);
int config_text_file_save(const char *filename, const struct ast_config *cfg, const char *generator);
struct ast_config *ast_config_internal_load(const char *configfile, struct ast_config *cfg);
struct ast_config *ast_config_internal_load(const char *configfile, struct ast_config *cfg, int withcomments);
#if defined(__cplusplus) || defined(c_plusplus)
}

View File

@@ -54,6 +54,7 @@
#define EVENT_FLAG_COMMAND (1 << 4) /* Ability to read/set commands */
#define EVENT_FLAG_AGENT (1 << 5) /* Ability to read/set agent info */
#define EVENT_FLAG_USER (1 << 6) /* Ability to read/set user info */
#define EVENT_FLAG_CONFIG (1 << 7) /* Ability to modify configurations */
/* Export manager structures */
#define AST_MAX_MANHEADERS 80