From 6e9b41b16333c091caaaa7daba532bc79b4246f0 Mon Sep 17 00:00:00 2001 From: michael Date: Thu, 1 Jan 2015 19:49:22 +0000 Subject: [PATCH] - config.c: reformatting git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/trunk@5270 82007160-df01-0410-b94d-b575c5fd34c7 --- src/config.c | 58 +++++++++++++++++++++++----------------------------- 1 file changed, 26 insertions(+), 32 deletions(-) diff --git a/src/config.c b/src/config.c index d464f7a..8eba798 100644 --- a/src/config.c +++ b/src/config.c @@ -23,12 +23,12 @@ #include "setup.h" - #include #include #include #include "config.h" +#include "config-parser.h" #include "malloc.h" #include "log.h" #include "scan.h" @@ -38,12 +38,6 @@ #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) { -- 2.30.2