diff --git a/include/macros.h b/include/macros.h deleted file mode 100644 index 7ed4cc5c7..000000000 --- a/include/macros.h +++ /dev/null @@ -1,25 +0,0 @@ -/************************************************************************ - * Unreal Internet Relay Chat Daemon, include/macros.h - * Copyright (c) 2004 Dominick Meglio & The UnrealIRCd Team - * - * 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 1, 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, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * $Id$ - */ - -#include "setup.h" - -/* Calculate the size of an array */ -#define ARRAY_SIZEOF(x) (sizeof((x))/sizeof((x)[0])) diff --git a/include/struct.h b/include/struct.h index 7fabcd273..69425e737 100644 --- a/include/struct.h +++ b/include/struct.h @@ -233,6 +233,9 @@ typedef OperPermission (*OperClassEntryEvalCallback)(OperClassACLEntryVar* varia #define elementsof(x) (sizeof(x)/sizeof(x[0])) +/* Calculate the size of an array */ +#define ARRAY_SIZEOF(x) (sizeof((x))/sizeof((x)[0])) + /* ** flags for bootup options (command line flags) */ diff --git a/include/unrealircd.h b/include/unrealircd.h index 5cf65556d..33a644d2c 100644 --- a/include/unrealircd.h +++ b/include/unrealircd.h @@ -3,25 +3,36 @@ * (that is publicly exposed anyway). */ #include "config.h" +#include +#ifdef USE_LIBCURL + #include +#endif #include "struct.h" #include "common.h" #include "sys.h" #include "numeric.h" #include "msg.h" +#include "mempool.h" #include "proto.h" #include "inet.h" #include "channel.h" #include #include +#include #include #include #include +#ifdef GLOBH + #include +#endif #ifdef _WIN32 -#include -#include + #include + #include + #undef GLOBH +#else + #include #endif #include #include "h.h" -#ifdef _WIN32 +#include "url.h" #include "version.h" -#endif diff --git a/src/Makefile.in b/src/Makefile.in index 6f2d1aa8f..cc7442e75 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -43,7 +43,7 @@ INCLUDES = ../include/auth.h ../include/channel.h \ ../include/class.h ../include/common.h ../include/config.h ../include/dbuf.h \ ../include/dynconf.h ../include/fdlist.h ../include/h.h \ ../include/hash.h ../include/inet.h ../include/ircsprintf.h \ - ../include/license.h ../include/macros.h \ + ../include/license.h \ ../include/modules.h ../include/modversion.h ../include/msg.h \ ../include/numeric.h ../include/proto.h \ ../include/resource.h ../include/setup.h \ diff --git a/src/api-command.c b/src/api-command.c index 67cfe3555..94467f1e5 100644 --- a/src/api-command.c +++ b/src/api-command.c @@ -17,12 +17,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "msg.h" -#include "h.h" -#include +#include "unrealircd.h" int CommandExists(char *name) { diff --git a/src/api-isupport.c b/src/api-isupport.c index 4e872d556..71478bae0 100644 --- a/src/api-isupport.c +++ b/src/api-isupport.c @@ -18,26 +18,9 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * $Id$ */ -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "numeric.h" -#include "msg.h" -#include "channel.h" -#include "version.h" -#include -#include -#include -#include -#include -#include -#include -#include "h.h" -#include "proto.h" +#include "unrealircd.h" Isupport *Isupports; /* List of ISUPPORT (005) tokens */ #define MAXISUPPORTLINES 10 diff --git a/src/channel.c b/src/channel.c index 4bbe1ebef..32eed7789 100644 --- a/src/channel.c +++ b/src/channel.c @@ -1,67 +1,32 @@ /* Unreal Internet Relay Chat Daemon, src/channel.c - * Copyright (C) 1990 Jarkko Oikarinen and - * University of Oulu, Co Center + * (C) Copyright 1990 Jarkko Oikarinen and + * University of Oulu, Co Center + * (C) Copyright 1999-present The UnrealIRCd team * - * 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 1, or (at your option) - * any later version. + * 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 1, 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. + * 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, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -/* - * 23 Jun 1999 - * Changing unsigned int modes to long - * --- Sts - 28 May 1999 - Incorporated twilight mode system -*/ -/* -- Jto -- 09 Jul 1990 - * Bug fix + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* -- Jto -- 03 Jun 1990 - * Moved m_channel() and related functions from s_msg.c to here - * Many changes to start changing into string channels... - */ - -/* -- Jto -- 24 May 1990 - * Moved is_full() from list.c - */ - -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "numeric.h" -#include "channel.h" -#include "msg.h" /* For TOK_*** and MSG_*** strings */ -#include "hash.h" /* For CHANNELHASHSIZE */ -#include "h.h" -#include "proto.h" -#include "modules.h" -#include - -ID_Copyright - ("(C) 1990 University of Oulu, Computing Center and Jarkko Oikarinen"); +#include "unrealircd.h" long opermode = 0; aChannel *channel = NullChn; -extern char backupbuf[]; -extern ircstats IRCstats; -/* - * some buffers for rebuilding channel/nick lists with ,'s - */ +/* some buffers for rebuilding channel/nick lists with comma's */ static char nickbuf[BUFSIZE], buf[BUFSIZE]; MODVAR char modebuf[BUFSIZE], parabuf[BUFSIZE]; -#define MODESYS_LINKOK /* We do this for a TEST */ aCtab cFlagTab[] = { {MODE_LIMIT, 'l', 1, 1}, {MODE_VOICE, 'v', 1, 1}, diff --git a/src/cloak.c b/src/cloak.c index cf3e53cb0..e836970f2 100644 --- a/src/cloak.c +++ b/src/cloak.c @@ -15,17 +15,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "numeric.h" -#include "msg.h" -#include "ircsprintf.h" -#include "channel.h" -#include -#include -#include -#include "h.h" +#include "unrealircd.h" /* mode = 0, just use strlcpy, 1 = Realloc new and return new pointer */ char *make_virthost(aClient *sptr, char *curr, char *new, int mode) diff --git a/src/conf_preprocessor.c b/src/conf_preprocessor.c index 063b263fd..88312438b 100644 --- a/src/conf_preprocessor.c +++ b/src/conf_preprocessor.c @@ -1,4 +1,3 @@ -#include "unrealircd.h" /* UnrealIRCd configuration preprocessor * (C) Copyright 2019 Bram Matthys ("Syzop") and the UnrealIRCd team * License: GPLv2 @@ -7,6 +6,8 @@ * it will certainly look like it, hence the name. */ +#include "unrealircd.h" + extern ConfigFile *conf; NameValueList *config_defines = NULL; /**< List of @defines, only valid during configuration reading */ diff --git a/src/crashreport.c b/src/crashreport.c index 2f4632ed0..fbc40b3cb 100644 --- a/src/crashreport.c +++ b/src/crashreport.c @@ -3,13 +3,13 @@ * * GPLv2 */ + #include "unrealircd.h" #ifndef _WIN32 #include #else extern void StartUnrealAgain(void); #endif - #include "version.h" extern char *getosname(void); diff --git a/src/dbuf.c b/src/dbuf.c index 47b1f432e..76e161593 100644 --- a/src/dbuf.c +++ b/src/dbuf.c @@ -17,14 +17,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include -#include -#include -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "h.h" -#include "mempool.h" +#include "unrealircd.h" static mp_pool_t *dbuf_bufpool = NULL; diff --git a/src/events.c b/src/events.c index 295398bd9..9de6ceeae 100644 --- a/src/events.c +++ b/src/events.c @@ -20,25 +20,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "numeric.h" -#include "msg.h" -#include "channel.h" -#include "version.h" -#include "proto.h" -#include -#include -#include -#include -#include -#ifdef _WIN32 -#include -#endif -#include -#include "h.h" -#include "modules.h" +#include "unrealircd.h" ID_Copyright("(C) Carsten Munk 2001"); diff --git a/src/extbans.c b/src/extbans.c index 7bf7c0325..e59eef79f 100644 --- a/src/extbans.c +++ b/src/extbans.c @@ -20,24 +20,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "numeric.h" -#include "msg.h" -#include "proto.h" -#include "channel.h" -#include "version.h" -#include -#include -#include -#include -#include -#ifdef _WIN32 -#include -#endif -#include -#include "h.h" +#include "unrealircd.h" Extban MODVAR ExtBan_Table[EXTBANTABLESZ]; /* this should be fastest */ unsigned MODVAR short ExtBan_highest = 0; diff --git a/src/extcmodes.c b/src/extcmodes.c index dbd037f8c..41d957ace 100644 --- a/src/extcmodes.c +++ b/src/extcmodes.c @@ -20,24 +20,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "numeric.h" -#include "msg.h" -#include "proto.h" -#include "channel.h" -#include "version.h" -#include -#include -#include -#include -#include -#ifdef _WIN32 -#include -#endif -#include -#include "h.h" +#include "unrealircd.h" /* Channel parameter to slot# mapping */ MODVAR unsigned char param_to_slot_mapping[256]; diff --git a/src/fdlist.c b/src/fdlist.c index 0e25f6ac4..d8c3549cd 100644 --- a/src/fdlist.c +++ b/src/fdlist.c @@ -17,24 +17,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "h.h" -#include "config.h" -#include "fdlist.h" -#include "proto.h" -#include -#ifdef UNISTDH -#include -#endif -#include -#include -#include -#ifdef _WIN32 -#include -#endif -#include +#include "unrealircd.h" /* new FD management code, based on mowgli.eventloop from atheme, hammered into Unreal by * me, nenolod. diff --git a/src/hash.c b/src/hash.c index 001f86f2a..878b14b8f 100644 --- a/src/hash.c +++ b/src/hash.c @@ -17,15 +17,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include -#include -#include "numeric.h" -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "hash.h" -#include "h.h" -#include "proto.h" +#include "unrealircd.h" ID_Copyright("(C) 1991 Darren Reed"); ID_Notes("2.10 7/3/93"); diff --git a/src/ircd.c b/src/ircd.c index 416a9fb61..5a5447083 100644 --- a/src/ircd.c +++ b/src/ircd.c @@ -1,7 +1,7 @@ /************************************************************************ * Unreal Internet Relay Chat Daemon, src/ircd.c - * Copyright (C) 1990 Jarkko Oikarinen and - * University of Oulu, Computing Center + * Copyright (C) 1989-1990 Jarkko Oikarinen and + * University of Oulu, Computing Center * * 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 @@ -18,55 +18,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* ircd.c 2.48 3/9/94 (C) 1988 University of Oulu, Computing Center and Jarkko Oikarinen */ +#include "unrealircd.h" -#include "config.h" -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "numeric.h" -#include "msg.h" -#include "mempool.h" -#include -#include -#include -#include -#include -#ifndef _WIN32 -#include -#include -#include -#include -#else -#include -#include -#endif -#ifdef HPUX -#define _KERNEL /* HPUX has the world's worst headers... */ -#endif -#ifndef _WIN32 -#include -#endif -#ifdef HPUX -#undef _KERNEL -#endif -#include -#ifdef HAVE_PSSTRINGS -#include -#endif -#ifdef HAVE_PSTAT -#include -#endif -#include "h.h" -#include "fdlist.h" -#include "version.h" -#include "proto.h" -#ifdef USE_LIBCURL -#include -#endif -ID_Copyright - ("(C) 1988 University of Oulu, Computing Center and Jarkko Oikarinen"); -ID_Notes("2.48 3/9/94"); #ifdef __FreeBSD__ char *malloc_options = "h" MALLOC_FLAGS_EXTRA; #endif diff --git a/src/list.c b/src/list.c index c6e95703e..ec351c0f7 100644 --- a/src/list.c +++ b/src/list.c @@ -18,36 +18,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* -- Jto -- 20 Jun 1990 - * extern void free() fixed as suggested by - * gruner@informatik.tu-muenchen.de - */ +#include "unrealircd.h" -/* -- Jto -- 03 Jun 1990 - * Added chname initialization... - */ - -/* -- Jto -- 24 May 1990 - * Moved is_full() to channel.c - */ - -/* -- Jto -- 10 May 1990 - * Added #include - * Changed memset(xx,0,yy) into bzero(xx,yy) - */ - -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "h.h" -#include "proto.h" -#include "numeric.h" -#ifdef DBMALLOC -#include "malloc.h" -#endif -#include "mempool.h" -#include -#include void free_link(Link *); Link *make_link(); extern ircstats IRCstats; diff --git a/src/mempool.c b/src/mempool.c index 5e4129a2a..307331811 100644 --- a/src/mempool.c +++ b/src/mempool.c @@ -36,14 +36,7 @@ * \version $Id: mempool.c 1967 2013-05-08 14:33:22Z michael $ */ -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "h.h" -#include "proto.h" -#include "numeric.h" -#include "mempool.h" -#include +#include "unrealircd.h" /** Returns floor(log2(u64)). If u64 is 0, (incorrectly) returns 0. */ static int diff --git a/src/moddata.c b/src/moddata.c index 4b1080565..15c20e01d 100644 --- a/src/moddata.c +++ b/src/moddata.c @@ -20,28 +20,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "numeric.h" -#include "msg.h" -#include "proto.h" -#include "channel.h" -#include "version.h" -#include -#include -#include -#include -#include -#ifdef _WIN32 -#include -#endif -#include -#include "h.h" - -#ifndef MAX -#define MAX(x,y) ((x) > (y) ? (x) : (y)) -#endif +#include "unrealircd.h" MODVAR ModDataInfo *MDInfo = NULL; diff --git a/src/modules.c b/src/modules.c index edec343a5..be014e3fd 100644 --- a/src/modules.c +++ b/src/modules.c @@ -18,43 +18,24 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * $Id$ */ -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "numeric.h" -#include "msg.h" -#include "channel.h" -#include "version.h" -#include -#include -#include -#include -#include -#include +#define UNREALCORE +#include "unrealircd.h" #ifdef _WIN32 -#include #define RTLD_NOW 0 -const char *our_dlerror(void); #elif defined(HPUX) #include #define RTLD_NOW BIND_IMMEDIATE #else #include #endif -#include #ifndef _WIN32 #include #endif -#include "h.h" -#include "proto.h" #ifndef RTLD_NOW #define RTLD_NOW RTLD_LAZY #endif -#define UNREALCORE #include "modversion.h" Hook *Hooks[MAXHOOKTYPES]; diff --git a/src/modules/Makefile.in b/src/modules/Makefile.in index 8beab6079..9b5a46d7b 100644 --- a/src/modules/Makefile.in +++ b/src/modules/Makefile.in @@ -26,7 +26,7 @@ INCLUDES = ../include/auth.h ../include/channel.h \ ../include/class.h ../include/common.h ../include/config.h ../include/dbuf.h \ ../include/dynconf.h ../include/fdlist.h ../include/h.h \ ../include/hash.h ../include/inet.h ../include/ircsprintf.h \ - ../include/license.h ../include/macros.h \ + ../include/license.h \ ../include/modules.h ../include/modversion.h ../include/msg.h \ ../include/numeric.h ../include/proto.h ../include/res.h \ ../include/resource.h ../include/setup.h \ diff --git a/src/modules/chanmodes/Makefile.in b/src/modules/chanmodes/Makefile.in index 65053461f..832eaf4db 100644 --- a/src/modules/chanmodes/Makefile.in +++ b/src/modules/chanmodes/Makefile.in @@ -23,7 +23,7 @@ INCLUDES = ../../include/auth.h ../../include/channel.h \ ../../include/class.h ../../include/common.h ../../include/config.h ../../include/dbuf.h \ ../../include/dynconf.h ../../include/fdlist.h ../../include/h.h \ ../../include/hash.h ../../include/inet.h ../../include/ircsprintf.h \ - ../../include/license.h ../../include/macros.h \ + ../../include/license.h \ ../../include/modules.h ../../include/modversion.h ../../include/msg.h \ ../../include/numeric.h ../../include/proto.h ../../include/res.h \ ../../include/resource.h ../../include/setup.h \ diff --git a/src/modules/extbans/Makefile.in b/src/modules/extbans/Makefile.in index 21a1e2675..061e2e0d8 100644 --- a/src/modules/extbans/Makefile.in +++ b/src/modules/extbans/Makefile.in @@ -23,7 +23,7 @@ INCLUDES = ../../include/auth.h ../../include/channel.h \ ../../include/class.h ../../include/common.h ../../include/config.h ../../include/dbuf.h \ ../../include/dynconf.h ../../include/fdlist.h ../../include/h.h \ ../../include/hash.h ../../include/inet.h ../../include/ircsprintf.h \ - ../../include/license.h ../../include/macros.h \ + ../../include/license.h \ ../../include/modules.h ../../include/modversion.h ../../include/msg.h \ ../../include/numeric.h ../../include/proto.h ../../include/res.h \ ../../include/resource.h ../../include/setup.h \ diff --git a/src/modules/snomasks/Makefile.in b/src/modules/snomasks/Makefile.in index 937050715..0134f72f5 100644 --- a/src/modules/snomasks/Makefile.in +++ b/src/modules/snomasks/Makefile.in @@ -23,7 +23,7 @@ INCLUDES = ../../include/auth.h ../../include/channel.h \ ../../include/class.h ../../include/common.h ../../include/config.h ../../include/dbuf.h \ ../../include/dynconf.h ../../include/fdlist.h ../../include/h.h \ ../../include/hash.h ../../include/inet.h ../../include/ircsprintf.h \ - ../../include/license.h ../../include/macros.h \ + ../../include/license.h \ ../../include/modules.h ../../include/modversion.h ../../include/msg.h \ ../../include/numeric.h ../../include/proto.h ../../include/res.h \ ../../include/resource.h ../../include/setup.h \ diff --git a/src/modules/third/Makefile.in b/src/modules/third/Makefile.in index df3fe0596..485ed7e9f 100644 --- a/src/modules/third/Makefile.in +++ b/src/modules/third/Makefile.in @@ -23,7 +23,7 @@ INCLUDES = ../../include/auth.h ../../include/channel.h \ ../../include/class.h ../../include/common.h ../../include/config.h ../../include/dbuf.h \ ../../include/dynconf.h ../../include/fdlist.h ../../include/h.h \ ../../include/hash.h ../../include/inet.h ../../include/ircsprintf.h \ - ../../include/license.h ../../include/macros.h \ + ../../include/license.h \ ../../include/modules.h ../../include/modversion.h ../../include/msg.h \ ../../include/numeric.h ../../include/proto.h ../../include/res.h \ ../../include/resource.h ../../include/setup.h \ diff --git a/src/modules/usermodes/Makefile.in b/src/modules/usermodes/Makefile.in index b78940af8..bd1997210 100644 --- a/src/modules/usermodes/Makefile.in +++ b/src/modules/usermodes/Makefile.in @@ -23,7 +23,7 @@ INCLUDES = ../../include/auth.h ../../include/channel.h \ ../../include/class.h ../../include/common.h ../../include/config.h ../../include/dbuf.h \ ../../include/dynconf.h ../../include/fdlist.h ../../include/h.h \ ../../include/hash.h ../../include/inet.h ../../include/ircsprintf.h \ - ../../include/license.h ../../include/macros.h \ + ../../include/license.h \ ../../include/modules.h ../../include/modversion.h ../../include/msg.h \ ../../include/numeric.h ../../include/proto.h ../../include/res.h \ ../../include/resource.h ../../include/setup.h \ diff --git a/src/operclass.c b/src/operclass.c index 2674cde04..908a17a6f 100644 --- a/src/operclass.c +++ b/src/operclass.c @@ -1,21 +1,9 @@ -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "numeric.h" -#include "msg.h" -#include "proto.h" -#include "channel.h" -#include "version.h" -#include -#include -#include -#include -#include -#ifdef _WIN32 -#include -#endif -#include -#include "h.h" +/** Oper classes code. + * (C) Copyright 2015-present tmcarthur and the UnrealIRCd team + * License: GPLv2 + */ + +#include "unrealircd.h" typedef struct _operClass_PathNode OperClass_PathNode; typedef struct _operClass_CallbackNode OperClass_CallbackNode; diff --git a/src/packet.c b/src/packet.c index 3ad0ae5e6..d522ee798 100644 --- a/src/packet.c +++ b/src/packet.c @@ -1,7 +1,8 @@ /************************************************************************ * Unreal Internet Relay Chat Daemon, src/packet.c - * Copyright (C) 1990 Jarkko Oikarinen and - * University of Oulu, Computing Center + * Copyright (C) 1988-1990 Jarkko Oikarinen and + * University of Oulu, Computing Center + * Copyright (C) 1999-present UnrealIRCd team * * 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 @@ -18,15 +19,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "msg.h" -#include "h.h" -#include -ID_Copyright - ("(C) 1988 University of Oulu, Computing Center and Jarkko Oikarinen"); -ID_Notes("2.12 1/30/94"); +#include "unrealircd.h" aCommand *CommandHash[256]; /* one per letter */ diff --git a/src/parse.c b/src/parse.c index 71c540391..ad6adcc73 100644 --- a/src/parse.c +++ b/src/parse.c @@ -24,11 +24,7 @@ /* parse.c 2.33 1/30/94 (C) 1988 University of Oulu, Computing Center and Jarkko Oikarinen */ -#include -#include "struct.h" -#include "common.h" - -#undef RAWDEBUG +#include "unrealircd.h" char backupbuf[8192]; diff --git a/src/random.c b/src/random.c index ed821be72..cedbf18c3 100644 --- a/src/random.c +++ b/src/random.c @@ -21,26 +21,7 @@ * */ -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "numeric.h" -#include "msg.h" -#include "channel.h" -#include "version.h" -#include -#ifdef _WIN32 -#include -#endif -#include -#include -#include -#include -#ifdef _WIN32 -#include -#endif -#include -#include "h.h" +#include "unrealircd.h" /* * Based on Arc4 random number generator for FreeBSD/OpenBSD. diff --git a/src/res.c b/src/res.c index 36cddeac1..bae8bee65 100644 --- a/src/res.c +++ b/src/res.c @@ -18,32 +18,13 @@ * */ -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "numeric.h" -#include "msg.h" -#include "proto.h" -#include "channel.h" -#include "version.h" +#include "unrealircd.h" +#include #if !defined(UNREAL_VERSION_TIME) #error "YOU MUST RUN ./Config WHENEVER YOU ARE UPGRADING UNREAL!!!!" #endif -#include -#include -#include -#include -#include -#ifdef _WIN32 -#include -#endif -#include "inet.h" -#include -#include "h.h" - -#include /* Prevent crashes due to invalid prototype/ABI. * And force the use of at least the version shipped with Unreal diff --git a/src/s_auth.c b/src/s_auth.c index 96001f615..e1736a3b2 100644 --- a/src/s_auth.c +++ b/src/s_auth.c @@ -17,24 +17,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "numeric.h" -#include "version.h" -#include "inet.h" -#ifndef _WIN32 -#include -#include -#include -#else -#include -#endif -#include -#include "h.h" -#include "res.h" -#include "proto.h" -#include +#include "unrealircd.h" static void send_authports(int fd, int revents, void *data); static void read_authports(int fd, int revents, void *data); diff --git a/src/s_conf.c b/src/s_conf.c index de7c64a25..72e2861e0 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -17,37 +17,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "struct.h" -#include "url.h" -#include "common.h" -#include "sys.h" -#include "numeric.h" -#include "channel.h" -#include "macros.h" -#include -#ifndef _WIN32 -#include -#include -#else -#include -#endif -#include -#ifdef __hpux -#include "inet.h" -#endif -#if defined(PCS) || defined(AIX) || defined(SVR3) -#include -#endif -#include -#ifdef GLOBH -#include -#endif -#include "h.h" -#include "inet.h" -#include "proto.h" -#ifdef _WIN32 -#undef GLOBH -#endif + +#include "unrealircd.h" /* * Some typedefs.. diff --git a/src/s_debug.c b/src/s_debug.c index d222b83bd..b1b665338 100644 --- a/src/s_debug.c +++ b/src/s_debug.c @@ -20,30 +20,20 @@ /* s_debug.c 2.30 1/3/94 (C) 1988 University of Oulu, Computing Center and Jarkko Oikarinen */ -#include "struct.h" -#include -#include "proto.h" -/* - * Option string. Must be before #ifdef DEBUGMODE. - */ +#include "unrealircd.h" + MODVAR char serveropts[] = { #ifdef DEBUGMODE 'D', #endif - /* FDLIST is always compiled in now. Well, my replacement to it - * is anyway. --nenolod - */ + /* FDLIST (always) */ 'F', - /* - * Marks that the ircd is ``compiled as'' a hub. - * Now always defined as it's impossible to build unrealircd - * without hub support AFAIK. (#0003891) --binki - */ + /* Hub (always) */ 'h', #ifdef SHOW_INVISIBLE_LUSERS 'i', #endif - /* NOSPOOF is always compiled in now. --nenolod */ + /* NOSPOOF (always) */ 'n', #ifdef VALLOC 'V', @@ -75,50 +65,6 @@ MODVAR char serveropts[] = { char *extraflags = NULL; -#include "numeric.h" -#include "common.h" -#include "sys.h" -#include "whowas.h" -#include "hash.h" -#ifndef _WIN32 -#include -#endif -#ifdef HPUX -#include -#endif -#if !defined(ULTRIX) && !defined(SGI) && \ - !defined(__convex__) && !defined(_WIN32) -# include -#endif -#ifdef HPUX -# include -# define getrusage(a,b) syscall(SYS_GETRUSAGE, a, b) -#endif -#ifdef GETRUSAGE_2 -# ifdef _SOLARIS -# include -# ifdef RUSAGEH -# include -# endif -# endif -# include -#else -# ifdef TIMES_2 -# include -# endif -#endif -#ifdef PCS -# include -#endif -#ifdef HPUX -#include -#endif -#include "h.h" - -#ifndef ssize_t -#define ssize_t unsigned int -#endif - MODVAR int debugfd = 2; void flag_add(char ch) diff --git a/src/s_dispatch.c b/src/s_dispatch.c index dbfbc885c..bb074c4c4 100644 --- a/src/s_dispatch.c +++ b/src/s_dispatch.c @@ -17,9 +17,11 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "setup.h" -#include "config.h" +#include "unrealircd.h" +/* Some specials here, for this file.. */ + +/* Do we even support this, poll on Windows? */ #ifdef BACKEND_POLL #ifndef _WIN32 # include @@ -32,34 +34,13 @@ #ifdef _WIN32 #include #endif - -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "res.h" -#include "numeric.h" -#include "version.h" #ifndef _WIN32 -#include #include #include -#include -#else -#include #endif #if defined(_SOLARIS) #include #endif -#include "inet.h" -#include -#include -#include - -#include -#include "proto.h" - /* define it (BSD4.2 needs this) */ -#include "h.h" -#include "fdlist.h" /*************************************************************************************** * Backend-independent functions. fd_setselect() and friends * diff --git a/src/s_err.c b/src/s_err.c index c1b475cf1..bd6d1f73e 100644 --- a/src/s_err.c +++ b/src/s_err.c @@ -17,12 +17,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "struct.h" -#include "numeric.h" -#include "common.h" - -/* "s_err.c 1.12 11/1/93 (C) 1992 Darren Reed */ -/* Redone to be similar to bahamut's s_err.c -- codemastr */ +#include "unrealircd.h" static char *replies[] = { /* 000 */ NULL, @@ -1047,9 +1042,10 @@ static char *replies[] = { /* 1000 */ NULL, }; -char *getreply(int numeric) { - if((numeric<0 || numeric>999) || !replies[numeric]) - return(replies[ERR_NUMERICERR]); +char *getreply(int numeric) +{ + if ((numeric < 0) || (numeric > 999) || !replies[numeric]) + return replies[ERR_NUMERICERR]; else - return(replies[numeric]); + return replies[numeric]; } diff --git a/src/s_extra.c b/src/s_extra.c index e0a45c3aa..ea53c0073 100644 --- a/src/s_extra.c +++ b/src/s_extra.c @@ -20,24 +20,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "numeric.h" -#include "msg.h" -#include "channel.h" -#include -#include -#include -#include -#include -#include -#ifdef _WIN32 -#include -#endif -#include -#include "h.h" -#include "proto.h" +#include "unrealircd.h" ID_Copyright("(C) Carsten Munk 1999"); diff --git a/src/s_kline.c b/src/s_kline.c index 629bc7d2c..e45c83105 100644 --- a/src/s_kline.c +++ b/src/s_kline.c @@ -21,24 +21,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "numeric.h" -#include "msg.h" -#include "channel.h" -#include -#include -#include -#include -#include -#ifdef _WIN32 -#include -#endif -#include -#include "h.h" -#include "proto.h" -#include "inet.h" +#include "unrealircd.h" + +// FIXME: with so little here, why have a file for it? Move it! MODVAR aTKline *tklines[TKLISTLEN]; MODVAR aTKline *tklines_ip_hash[TKLIPHASHLEN1][TKLIPHASHLEN2]; diff --git a/src/s_misc.c b/src/s_misc.c index eda2164d0..28bf7ca3a 100644 --- a/src/s_misc.c +++ b/src/s_misc.c @@ -1,4 +1,3 @@ - /* * Unreal Internet Relay Chat Daemon, src/s_misc.c * Copyright (C) 1990 Jarkko Oikarinen and @@ -22,33 +21,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef _WIN32 -#include -#endif -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "numeric.h" -#include -#include -#include -#if !defined(ULTRIX) && !defined(SGI) && \ - !defined(__convex__) && !defined(_WIN32) -# include -#endif -#if defined(PCS) || defined(AIX) || defined(SVR3) -# include -#endif -#ifdef HPUX -#include -#endif -#ifdef _WIN32 -# include -#endif -#include "h.h" -#include "proto.h" -#include "channel.h" -#include +#include "unrealircd.h" extern ircstats IRCstats; extern char *me_hash; diff --git a/src/s_numeric.c b/src/s_numeric.c index 2d7df84e9..91a7416a2 100644 --- a/src/s_numeric.c +++ b/src/s_numeric.c @@ -21,13 +21,7 @@ /* s_numeric.c 2.14 1/30/94 (C) 1988 University of Oulu, Computing Center and Jarkko Oikarinen */ -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "numeric.h" -#include "h.h" -#include "proto.h" -#include +#include "unrealircd.h" extern char backupbuf[]; static char buffer[1024]; diff --git a/src/s_serv.c b/src/s_serv.c index b32a941a8..c49551a85 100644 --- a/src/s_serv.c +++ b/src/s_serv.c @@ -23,26 +23,7 @@ /* s_serv.c 2.55 2/7/94 (C) 1988 University of Oulu, Computing Center and Jarkko Oikarinen */ -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "numeric.h" -#include "msg.h" -#include "channel.h" -#include "version.h" -#include -#include -#ifdef _WIN32 -#include -#endif -#include -#include "h.h" -#include "proto.h" -#include -#ifdef USE_LIBCURL -#include "url.h" -#include -#endif +#include "unrealircd.h" #ifndef _WIN32 /* for uname(), is POSIX so should be OK... */ #include diff --git a/src/s_svs.c b/src/s_svs.c index a3f0a49eb..09900f561 100644 --- a/src/s_svs.c +++ b/src/s_svs.c @@ -16,29 +16,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "numeric.h" -#include "channel.h" -#include -#ifndef _WIN32 -#include -#include -#else -#include -#endif -#include -#ifdef __hpux -#include "inet.h" -#endif -#if defined(PCS) || defined(AIX) || defined(SVR3) -#include -#endif -#include -#include "h.h" -#include "proto.h" +#include "unrealircd.h" extern ircstats IRCstats; diff --git a/src/s_user.c b/src/s_user.c index ac59e0837..976bf186d 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -23,29 +23,7 @@ /* s_user.c 2.74 2/8/94 (C) 1988 University of Oulu, Computing Center and Jarkko Oikarinen */ -#include "macros.h" -#include "config.h" -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "numeric.h" -#include "msg.h" -#include "channel.h" -#include -#include -#include -#include -#include -#ifdef _WIN32 -#include -#endif -#include -#include "h.h" -#include "proto.h" - -#ifdef _WIN32 -#include "version.h" -#endif +#include "unrealircd.h" void send_umode_out(aClient *, aClient *, long); void send_umode(aClient *, aClient *, long, long, char *); diff --git a/src/scache.c b/src/scache.c index 7b6facc75..063330575 100644 --- a/src/scache.c +++ b/src/scache.c @@ -1,13 +1,7 @@ /* $Id$ */ -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "numeric.h" -#include "h.h" -#include "proto.h" -#include +#include "unrealircd.h" static int hash(char *); /* diff --git a/src/send.c b/src/send.c index 08ec1f986..5c9646112 100644 --- a/src/send.c +++ b/src/send.c @@ -20,22 +20,7 @@ /* send.c 2.32 2/28/94 (C) 1988 University of Oulu, Computing Center and Jarkko Oikarinen */ -/* -- Jto -- 16 Jun 1990 - * Added Armin's PRIVMSG patches... - */ - -#include "struct.h" -#include "numeric.h" -#include "common.h" -#include "sys.h" -#include "h.h" -#include "msg.h" -#include -#include -#ifdef _WIN32 -#include -#endif -#include +#include "unrealircd.h" void vsendto_one(aClient *to, MessageTag *mtags, const char *pattern, va_list vl); void sendbufto_one(aClient *to, char *msg, unsigned int quick); @@ -1094,7 +1079,7 @@ void sendto_one_nickcmd(aClient *cptr, aClient *sptr, char *umodes) } sendto_one(cptr, NULL, - "NICK %s %d %d %s %s %s %s %s %s %s%s%s%s:%s", + "NICK %s %d %ld %s %s %s %s %s %s %s%s%s%s:%s", sptr->name, sptr->hopcount+1, sptr->lastnick, sptr->user->username, sptr->user->realhost, sptr->srvptr->name, diff --git a/src/socket.c b/src/socket.c index a589ce75f..e17b7bf04 100644 --- a/src/socket.c +++ b/src/socket.c @@ -18,20 +18,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "h.h" -#include -#include -#include "inet.h" -#ifndef _WIN32 -extern int errno; /* ...seems that errno.h doesn't define this everywhere */ -#endif -#include -#ifndef _WIN32 -#include -#endif +#include "unrealircd.h" /** Attempt to deliver data to a client. * This function is only called from send_queued() and will deal diff --git a/src/ssl.c b/src/ssl.c index aa6be515f..178302f48 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -21,7 +21,6 @@ #include "unrealircd.h" #include "openssl_hostname_validation.h" - #ifdef _WIN32 #define IDC_PASS 1166 extern HINSTANCE hInst; diff --git a/src/support.c b/src/support.c index 074569633..3ef250ac4 100644 --- a/src/support.c +++ b/src/support.c @@ -19,26 +19,7 @@ /* support.c 2.21 4/13/94 1990, 1991 Armin Gruner; 1992, 1993 Darren Reed */ -#include "config.h" -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "version.h" -#include "h.h" -#include "inet.h" -#include -#include -#include -#ifdef _WIN32 -#include -#else -extern uid_t irc_uid; -extern gid_t irc_gid; -#include -#include -#include -extern int errno; /* ...seems that errno.h doesn't define this everywhere */ -#endif +#include "unrealircd.h" extern void outofmemory(); diff --git a/src/uid.c b/src/uid.c index c969dbe9c..a930bf432 100644 --- a/src/uid.c +++ b/src/uid.c @@ -17,13 +17,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "h.h" -#include "config.h" -#include "fdlist.h" -#include "proto.h" +#include "unrealircd.h" void uid_init(void) { diff --git a/src/umodes.c b/src/umodes.c index c6ff4dc34..3aa8b2c1b 100644 --- a/src/umodes.c +++ b/src/umodes.c @@ -20,24 +20,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "numeric.h" -#include "msg.h" -#include "proto.h" -#include "channel.h" -#include "version.h" -#include -#include -#include -#include -#include -#ifdef _WIN32 -#include -#endif -#include -#include "h.h" +#include "unrealircd.h" char umodestring[UMODETABLESZ+1]; diff --git a/src/url.c b/src/url.c index 3d0e5b848..93d6f64c7 100644 --- a/src/url.c +++ b/src/url.c @@ -18,15 +18,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include -#include -#include -#include "proto.h" -#include "h.h" -#include -#include -#include -#include "url.h" +#include "unrealircd.h" extern char *SSLKeyPasswd; diff --git a/src/whowas.c b/src/whowas.c index 60fd4b650..59d1874f5 100644 --- a/src/whowas.c +++ b/src/whowas.c @@ -1,4 +1,3 @@ - /************************************************************************ * IRC - Internet Relay Chat, src/whowas.c * Copyright (C) 1990 Markku Savela @@ -18,15 +17,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "numeric.h" -#include "h.h" -#include "hash.h" -#include "proto.h" -#include "msg.h" -#include +#include "unrealircd.h" /* externally defined functions */ unsigned int hash_whowas_name(char *); /* defined in hash.c */