/* Load site-specific configuration */
syslog(LOG_INFO, "Loading citadel.config");
- get_config();
+ initialize_config_system();
validate_config();
syslog(LOG_INFO, "Acquiring control record");
/* Do system-dependent stuff */
sysdep_master_cleanup();
+
+ /* Close the configuration system */
+ shutdown_config_system();
/* Close databases */
syslog(LOG_INFO, "Closing databases\n");
#include "config.h"
#include "ctdl_module.h"
-struct config config;
+struct config config; // legacy configuration
+HashList *ctdlconfig = NULL; // new configuration
#define STR_NOT_EMPTY(CFG_FIELDNAME) if (IsEmptyStr(config.CFG_FIELDNAME)) \
syslog(LOG_EMERG, "configuration setting "#CFG_FIELDNAME" is empty, but must not - check your config!");
* Called during the initialization of Citadel server.
* It verifies the system's integrity and reads citadel.config into memory.
*/
-void get_config(void) {
+void initialize_config_system(void) {
FILE *cfp;
int rv;
+/*
+ * Called when Citadel server is shutting down.
+ * Clears out the config hash table.
+ */
+void shutdown_config_system(void)
+{
+ DeleteHash(&ctdlconfig);
+}
+
+
+
+
+
+
+
+
+/**********************************************************************/
+
+
+
+
+
+
+
+
+
+
void CtdlGetSysConfigBackend(long msgnum, void *userdata) {
config_msgnum = msgnum;
}
/*
- * Copyright (c) 1987-2012 by the citadel.org team
+ * Copyright (c) 1987-2015 by the citadel.org team
*
- * This program is open source software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3.
+ * This program is open source software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*/
#include "serv_extensions.h"
#include "citadel_dirs.h"
-
-void get_config(void);
+void initialize_config_system(void);
+void shutdown_config_system(void);
void put_config(void);
char *CtdlGetSysConfig(char *sysconfname);
* Note that if the previous version was 0 then this is a new installation running for the first time.
*/
void update_config(void) {
- get_config();
if (CitControl.MM_hosted_upgrade_level < 606) {
config.c_rfc822_strict_from = 0;