From ec05153ac4e80313e89a0326bfefe17a4ae21f9c Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Sun, 4 Dec 2005 20:40:46 +0000 Subject: 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 --- pbx/pbx_config.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'pbx/pbx_config.c') diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c index 1bcb2f515..f9267737a 100644 --- a/pbx/pbx_config.c +++ b/pbx/pbx_config.c @@ -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); } -- cgit v1.2.3