mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
This code was in team/murf/bug8684-trunk; it should fix bug 8684 in trunk. I didn't add it to 1.4 yet, because it's not entirely clear to me if this is a bug fix or an enhancement. A lot of files were affected by small changes like ast_variable_new getting an added arg, for the file name the var was defined in; ast_category_new gets added args of filename and lineno; ast_category and ast_variable structures now record file and lineno for each entry; a list of all #include and #execs in a config file (or any of its inclusions are now kept in the ast_config struct; at save time, each entry is put back into its proper file of origin, in order. #include and #exec directives are folded in properly. Headers indicating that the file was generated, are generated also for each included file. Some changes to main/manager.c to take care of file renaming, via the UpdateConfig command. Multiple inclusions of the same file are handled by exploding these into multiple include files, uniquely named. There's probably more, but I can't remember it right now.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -305,9 +305,8 @@ static int add_cfg_entry(void *arg, int argc, char **argv, char **columnNames);
|
||||
* \retval NULL if an error occurred
|
||||
* \see add_cfg_entry()
|
||||
*/
|
||||
static struct ast_config * config_handler(const char *database,
|
||||
const char *table, const char *file,
|
||||
struct ast_config *cfg, struct ast_flags flags);
|
||||
static struct ast_config * config_handler(const char *database, const char *table, const char *file,
|
||||
struct ast_config *cfg, struct ast_flags flags, const char *suggested_incl);
|
||||
|
||||
/*!
|
||||
* \brief Helper function to parse a va_list object into 2 dynamic arrays of
|
||||
@@ -736,7 +735,7 @@ static int add_cfg_entry(void *arg, int argc, char **argv, char **columnNames)
|
||||
args = arg;
|
||||
|
||||
if (!args->cat_name || strcmp(args->cat_name, argv[RES_SQLITE_CONFIG_CATEGORY])) {
|
||||
args->cat = ast_category_new(argv[RES_SQLITE_CONFIG_CATEGORY]);
|
||||
args->cat = ast_category_new(argv[RES_SQLITE_CONFIG_CATEGORY], "", 99999);
|
||||
|
||||
if (!args->cat) {
|
||||
ast_log(LOG_WARNING, "Unable to allocate category\n");
|
||||
@@ -755,7 +754,7 @@ static int add_cfg_entry(void *arg, int argc, char **argv, char **columnNames)
|
||||
}
|
||||
|
||||
var = ast_variable_new(argv[RES_SQLITE_CONFIG_VAR_NAME],
|
||||
argv[RES_SQLITE_CONFIG_VAR_VAL]);
|
||||
argv[RES_SQLITE_CONFIG_VAR_VAL], "");
|
||||
|
||||
if (!var) {
|
||||
ast_log(LOG_WARNING, "Unable to allocate variable");
|
||||
@@ -767,8 +766,8 @@ static int add_cfg_entry(void *arg, int argc, char **argv, char **columnNames)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct ast_config *config_handler(const char *database,
|
||||
const char *table, const char *file, struct ast_config *cfg, struct ast_flags flags)
|
||||
static struct ast_config *config_handler(const char *database, const char *table, const char *file,
|
||||
struct ast_config *cfg, struct ast_flags flags, const char *suggested_incl)
|
||||
{
|
||||
struct cfg_entry_args args;
|
||||
char *errormsg;
|
||||
@@ -856,7 +855,7 @@ static int add_rt_cfg_entry(void *arg, int argc, char **argv, char **columnNames
|
||||
if (!argv[i])
|
||||
continue;
|
||||
|
||||
if (!(var = ast_variable_new(columnNames[i], argv[i])))
|
||||
if (!(var = ast_variable_new(columnNames[i], argv[i], "")))
|
||||
return 1;
|
||||
|
||||
if (!args->var)
|
||||
@@ -990,7 +989,7 @@ static int add_rt_multi_cfg_entry(void *arg, int argc, char **argv, char **colum
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!(cat = ast_category_new(cat_name))) {
|
||||
if (!(cat = ast_category_new(cat_name, "", 99999))) {
|
||||
ast_log(LOG_WARNING, "Unable to allocate category\n");
|
||||
return 1;
|
||||
}
|
||||
@@ -1001,7 +1000,7 @@ static int add_rt_multi_cfg_entry(void *arg, int argc, char **argv, char **colum
|
||||
if (!argv[i] || !strcmp(args->initfield, columnNames[i]))
|
||||
continue;
|
||||
|
||||
if (!(var = ast_variable_new(columnNames[i], argv[i]))) {
|
||||
if (!(var = ast_variable_new(columnNames[i], argv[i], ""))) {
|
||||
ast_log(LOG_WARNING, "Unable to allocate variable\n");
|
||||
return 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user