From 07cbc4d1b2b6e3a78376d7e42c7a7636a6cd33d7 Mon Sep 17 00:00:00 2001 From: pk910 Date: Wed, 16 Jul 2014 09:43:37 +0200 Subject: [PATCH] fixed compilation (added temporary ircd_config.h) --- .gitignore | 1 + autogen.sh | 0 ircd.conf | 5 ++++ src/Makefile.am | 2 +- src/ircd_client.c | 2 +- src/{config.c => ircd_config.c} | 6 ++--- src/ircd_config.h | 48 +++++++++++++++++++++++++++++++++ src/ircd_sock.c | 2 +- src/main.c | 2 +- src/version.sh | 0 10 files changed, 61 insertions(+), 7 deletions(-) mode change 100644 => 100755 autogen.sh create mode 100644 ircd.conf rename src/{config.c => ircd_config.c} (98%) create mode 100644 src/ircd_config.h mode change 100644 => 100755 src/version.sh diff --git a/.gitignore b/.gitignore index 946fb4a..fe1ca31 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ config.log config.status config.sub configure +compile depcomp install-sh libtool diff --git a/autogen.sh b/autogen.sh old mode 100644 new mode 100755 diff --git a/ircd.conf b/ircd.conf new file mode 100644 index 0000000..e3ea6aa --- /dev/null +++ b/ircd.conf @@ -0,0 +1,5 @@ + +"port" { + "port" 6667; +} + diff --git a/src/Makefile.am b/src/Makefile.am index 976d039..3e10b56 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -13,7 +13,7 @@ checkversion: nextircd_SOURCES = \ version.c \ tools.c \ - config.c \ + ircd_config.c \ ircd_sock.c \ ircd_client.c \ main.c diff --git a/src/ircd_client.c b/src/ircd_client.c index 9ef6451..57bfb3f 100644 --- a/src/ircd_client.c +++ b/src/ircd_client.c @@ -19,7 +19,7 @@ #include "ircd_sock.h" #include "struct_connection.h" #include "struct_auth.h" -#include "config.h" +#include "ircd_config.h" #include "version.h" #include diff --git a/src/config.c b/src/ircd_config.c similarity index 98% rename from src/config.c rename to src/ircd_config.c index f7a82af..9e3184b 100644 --- a/src/config.c +++ b/src/ircd_config.c @@ -1,4 +1,4 @@ -/* config.c - NextIRCd +/* ircd_config.c - NextIRCd * Copyright (C) 2012-2013 Philipp Kreil (pk910) * * This program is free software: you can redistribute it and/or modify @@ -19,7 +19,7 @@ #include #include #include -#include "config.h" +#include "ircd_config.h" #include "tools.h" static char *config_file = "ircd.conf"; @@ -87,7 +87,7 @@ static char *parse_config_recursive(struct ConfigEntry *centry, char *buffer, st struct ConfigEntry *new_entry = malloc(sizeof(*new_entry)); if (!new_entry) return buffer; new_entry->name = strdup(cbuf); - buffer = parse_config_recursive(new_entry, buffer, 0); + buffer = parse_config_recursive(new_entry, buffer, configfile); if(centry) { if(sub_entrys) new_entry->next = sub_entrys; diff --git a/src/ircd_config.h b/src/ircd_config.h new file mode 100644 index 0000000..0b01871 --- /dev/null +++ b/src/ircd_config.h @@ -0,0 +1,48 @@ +/* ircd_config.h - NextIRCd + * Copyright (C) 2012-2013 Philipp Kreil (pk910) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef _ircd_config_h +#define _ircd_config_h + +struct GlobalConfig; +struct ConfigPortObject; + +#define CONFRELOAD_CALLBACK(NAME) void NAME() +typedef CONFRELOAD_CALLBACK(confreload_callback_t); + +extern struct GlobalConfig global_config; + +struct GlobalConfig { + struct ConfigPortObject *ports; + +}; + +struct ConfigPortObject { + unsigned int port : 16; + unsigned int secure : 1; + unsigned int server : 1; + unsigned int ip4only : 1; + unsigned int ip6only : 1; + char *bind_addr; + + struct ConfigPortObject *next; +}; + +void init_config(char *configfile); +void reload_config(); + +#endif diff --git a/src/ircd_sock.c b/src/ircd_sock.c index 91674b4..602282a 100644 --- a/src/ircd_sock.c +++ b/src/ircd_sock.c @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -#include "config.h" +#include "ircd_config.h" #include "ircd_sock.h" #include "ircd_client.h" #include "struct_connection.h" diff --git a/src/main.c b/src/main.c index fefe88b..848023a 100644 --- a/src/main.c +++ b/src/main.c @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -#include "config.h" +#include "ircd_config.h" #include "ircd_sock.h" #include "IOHandler/IOHandler.h" #include "IOHandler/IOLog.h" diff --git a/src/version.sh b/src/version.sh old mode 100644 new mode 100755 -- 2.20.1