src/server/daemon/configmanager.c

changeset 19
d680536f8c2f
parent 18
73aacbf6e492
child 21
627b09ee74e4
--- a/src/server/daemon/configmanager.c	Mon Jan 16 14:06:52 2012 +0100
+++ b/src/server/daemon/configmanager.c	Sat Jan 21 16:37:35 2012 +0100
@@ -33,8 +33,26 @@
 
 #include "configmanager.h"
 
-
+ServerConfiguration *current_config = NULL;
 
 void init_configuration_manager() {
-    
+    /* init parser */
+    init_server_config_parser();
 }
+
+int cfgmgr_load_config() {
+    ServerConfiguration *config = load_server_conf("conf/server.conf");
+    if(config == NULL) {
+        fprintf(stderr, "Cannot load server.conf\n");
+        return -1;
+    }
+
+    current_config = config;
+    return 0;
+}
+
+ServerConfiguration *cfgmgr_get_server_config() {
+    return current_config;
+}
+
+

mercurial