convert most of the option_*'s to a single ast_flags structure. Also, fix some

formatting, remove some unnecessary casts, and other little code cleanups.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2005-12-04 20:40:46 +00:00
parent b6b32ebd91
commit ec05153ac4
35 changed files with 208 additions and 180 deletions

View File

@@ -1618,23 +1618,17 @@ static int pbx_load_module(void)
cfg = ast_config_load(config);
if (cfg) {
/* Use existing config to populate the PBX table */
static_config = ast_true(ast_variable_retrieve(cfg, "general",
"static"));
write_protect_config = ast_true(ast_variable_retrieve(cfg, "general",
"writeprotect"));
autofallthrough_config = ast_true(ast_variable_retrieve(cfg, "general",
"autofallthrough"));
clearglobalvars_config = ast_true(ast_variable_retrieve(cfg, "general",
"clearglobalvars"));
option_priority_jumping = !ast_false(ast_variable_retrieve(cfg, "general",
"priorityjumping"));
static_config = ast_true(ast_variable_retrieve(cfg, "general", "static"));
write_protect_config = ast_true(ast_variable_retrieve(cfg, "general", "writeprotect"));
autofallthrough_config = ast_true(ast_variable_retrieve(cfg, "general", "autofallthrough"));
clearglobalvars_config = ast_true(ast_variable_retrieve(cfg, "general", "clearglobalvars"));
ast_set2_flag(&ast_options, !ast_false(ast_variable_retrieve(cfg, "general", "priorityjumping")), AST_OPT_FLAG_PRIORITY_JUMPING);
v = ast_variable_browse(cfg, "globals");
while(v) {
for (; v; v = v->next) {
memset(realvalue, 0, sizeof(realvalue));
pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);
pbx_builtin_setvar_helper(NULL, v->name, realvalue);
v = v->next;
}
cxt = ast_category_browse(cfg, NULL);
while(cxt) {
@@ -1736,7 +1730,7 @@ static int pbx_load_module(void)
if (plus)
ipri += atoi(plus);
lastpri = ipri;
if(!option_dontwarn) {
if (!ast_opt_dont_warn) {
if (!strcmp(realext, "_."))
ast_log(LOG_WARNING, "The use of '_.' for an extension is strongly discouraged and can have unexpected behavior. Please use '_X.' instead at line %d\n", v->lineno);
}