static char *runjob = NULL;
static int background = 1;
static void init_reload(void);
-
+static CONFIG *config;
+
/* Globals Exported */
DIRRES *director; /* Director resource */
int FDConnectTimeout;
extern RES_TABLE resources[];
extern RES **res_head;
extern RES_ITEM job_items[];
+extern int res_all_size;
#if defined(_MSC_VER)
extern "C" { // work around visual compiler mangling variables
configfile = bstrdup(CONFIG_FILE);
}
- parse_config(configfile);
+ config = new_config_parser();
+ config->init(configfile, NULL, M_ERROR_TERM, (void *)&res_all, res_all_size,
+ r_first, r_last, resources, res_head);
+ config->parse_config();
if (init_crypto() != 0) {
Jmsg((JCR *)NULL, M_ERROR_TERM, 0, _("Cryptography library initialization failed.\n"));
exit(1);
}
already_here = true;
+ debug_level = 0; /* turn off debug */
stop_watchdog();
generate_daemon_event(NULL, "Exit");
unload_plugins();
if (debug_level > 5) {
print_memory_pool_stats();
}
- free_config_resources();
+ config->free_resources();
+ free(config);
+ config = NULL;
term_ua_server();
term_msg(); /* terminate message handler */
cleanup_crypto();
}
Dmsg1(100, "Reload_config njobs=%d\n", njobs);
- reload_table[table].res_table = save_config_resources();
+ reload_table[table].res_table = config->save_resources();
Dmsg1(100, "Saved old config in table %d\n", table);
ok = parse_config(configfile, 0, M_ERROR); /* no exit on error */
Jmsg(NULL, M_ERROR, 0, _("Please correct configuration file: %s\n"), configfile);
Jmsg(NULL, M_ERROR, 0, _("Resetting previous configuration.\n"));
}
- reload_table[rtable].res_table = save_config_resources();
+ reload_table[rtable].res_table = config->save_resources();
/* Now restore old resoure values */
int num = r_last - r_first + 1;
RES **res_tab = reload_table[table].res_table;