- config.c: reformatting
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Thu, 1 Jan 2015 19:49:22 +0000 (19:49 +0000)
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Thu, 1 Jan 2015 19:49:22 +0000 (19:49 +0000)
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/trunk@5270 82007160-df01-0410-b94d-b575c5fd34c7

src/config.c

index d464f7ad53675c818879a593c4d8e1af814fa3bd..8eba7986a0dd55f5da3edcda1d5b86f47446826b 100644 (file)
 
 #include "setup.h"
 
-
 #include <stdio.h>
 #include <errno.h>
 #include <string.h>
 
 #include "config.h"
+#include "config-parser.h"
 #include "malloc.h"
 #include "log.h"
 #include "scan.h"
 #include "firedns.h"
 
 extern FILE *yyin;
-extern int yyparse(void);
-
-void config_setup(void);
-void config_init(void);
-
-
 
 struct OptionsConf *OptionsItem = NULL;
 struct IRCConf *IRCItem = NULL;
@@ -53,31 +47,6 @@ list_t *UserItemList = NULL;
 list_t *ScannerItemList = NULL;
 
 
-/* Rehash or load new configuration from filename, via flex/bison parser */
-void
-config_load(const char *filename)
-{
-  config_init();
-  config_setup();  /* Setup/clear current configuration */
-
-  log_printf("CONFIG -> Loading %s", filename);
-
-  if ((yyin = fopen(filename, "r")) == NULL)
-  {
-    log_printf("CONFIG -> Error opening %s: %s", filename, strerror(errno));
-    exit(EXIT_FAILURE);
-  }
-
-  yyparse();
-
-  scan_init();     /* Initialize the scanners once we have the configuration */
-  command_init();  /* Initialize the command queue */
-  stats_init();    /* Initialize stats (UPTIME) */
-  firedns_init();  /* Initialize adns */
-
-  fclose(yyin);
-}
-
 /* Malloc and initialize configuration data to NULL */
 void
 config_init(void)
@@ -128,6 +97,31 @@ config_setup(void)
   OptionsItem->scanlog = NULL;
 }
 
+/* Rehash or load new configuration from filename, via flex/bison parser */
+void
+config_load(const char *filename)
+{
+  config_init();
+  config_setup();  /* Setup/clear current configuration */
+
+  log_printf("CONFIG -> Loading %s", filename);
+
+  if ((yyin = fopen(filename, "r")) == NULL)
+  {
+    log_printf("CONFIG -> Error opening %s: %s", filename, strerror(errno));
+    exit(EXIT_FAILURE);
+  }
+
+  yyparse();
+
+  scan_init();     /* Initialize the scanners once we have the configuration */
+  command_init();  /* Initialize the command queue */
+  stats_init();    /* Initialize stats (UPTIME) */
+  firedns_init();  /* Initialize adns */
+
+  fclose(yyin);
+}
+
 void
 yyerror(const char *str)
 {