diff --git a/extensions/m_identify.c b/extensions/m_identify.c index 156e6a9db..aebcd3616 100644 --- a/extensions/m_identify.c +++ b/extensions/m_identify.c @@ -31,7 +31,6 @@ #include "stdinc.h" #include "client.h" -#include "common.h" #include "ircd.h" #include "match.h" #include "numeric.h" diff --git a/extensions/m_sendbans.c b/extensions/m_sendbans.c index 106cb6b77..a6e155122 100644 --- a/extensions/m_sendbans.c +++ b/extensions/m_sendbans.c @@ -31,7 +31,6 @@ #include "stdinc.h" #include "client.h" -#include "common.h" #include "ircd.h" #include "match.h" #include "numeric.h" diff --git a/include/common.h b/include/common.h deleted file mode 100644 index 58b52ac45..000000000 --- a/include/common.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * ircd-ratbox: A slightly useful ircd. - * common.h: An ircd header common to most code. - * - * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center - * Copyright (C) 1996-2002 Hybrid Development Team - * Copyright (C) 2002-2004 ircd-ratbox development 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 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA - */ - -#ifndef INCLUDED_common_h -#define INCLUDED_common_h - -/* Just blindly define our own MIN/MAX macro */ - -#define IRCD_MAX(a, b) ((a) > (b) ? (a) : (b)) -#define IRCD_MIN(a, b) ((a) < (b) ? (a) : (b)) - -/* readbuf size */ -#define READBUF_SIZE 16384 - -#endif /* INCLUDED_common_h */ diff --git a/include/ircd_defs.h b/include/ircd_defs.h index 64245cd7c..40db53839 100644 --- a/include/ircd_defs.h +++ b/include/ircd_defs.h @@ -56,6 +56,14 @@ #define IRC_DEPRECATED #endif +#ifndef MAX +#define MAX(a, b) ((a) > (b) ? (a) : (b)) +#endif + +#ifndef MIN +#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#endif + #define HOSTLEN 63 /* Length of hostname. Updated to */ /* comply with RFC1123 */ @@ -115,4 +123,7 @@ #define PATRICIA_BITS 32 #endif +/* Read buffer size */ +#define READBUF_SIZE 16384 + #endif /* INCLUDED_ircd_defs_h */ diff --git a/include/s_conf.h b/include/s_conf.h index b4bd821c2..9a0f55328 100644 --- a/include/s_conf.h +++ b/include/s_conf.h @@ -33,7 +33,6 @@ #include "ircd_defs.h" #include "class.h" #include "client.h" -#include "common.h" struct Client; struct DNSReply; diff --git a/ircd/cache.c b/ircd/cache.c index f596dfa54..1a2cb14fa 100644 --- a/ircd/cache.c +++ b/ircd/cache.c @@ -32,7 +32,6 @@ #include "stdinc.h" #include "ircd_defs.h" -#include "common.h" #include "s_conf.h" #include "client.h" #include "hash.h" diff --git a/ircd/channel.c b/ircd/channel.c index 77bb26c43..717df263e 100644 --- a/ircd/channel.c +++ b/ircd/channel.c @@ -26,7 +26,6 @@ #include "channel.h" #include "chmode.h" #include "client.h" -#include "common.h" #include "hash.h" #include "hook.h" #include "match.h" diff --git a/ircd/chmode.c b/ircd/chmode.c index 5616fc7c7..6ec2f497a 100644 --- a/ircd/chmode.c +++ b/ircd/chmode.c @@ -26,7 +26,6 @@ #include "stdinc.h" #include "channel.h" #include "client.h" -#include "common.h" #include "hash.h" #include "hook.h" #include "match.h" @@ -889,7 +888,7 @@ chm_ban(struct Client *source_p, struct Channel *chptr, * also make sure it will always fit on a line with channel * name etc. */ - if(strlen(mask) > IRCD_MIN(BANLEN, MODEBUFLEN - 5)) + if(strlen(mask) > MIN(BANLEN, MODEBUFLEN - 5)) { sendto_one_numeric(source_p, ERR_INVALIDBAN, form_str(ERR_INVALIDBAN), diff --git a/ircd/class.c b/ircd/class.c index a882f405f..75db28d0a 100644 --- a/ircd/class.c +++ b/ircd/class.c @@ -27,7 +27,6 @@ #include "class.h" #include "client.h" -#include "common.h" #include "ircd.h" #include "numeric.h" #include "s_conf.h" diff --git a/ircd/client.c b/ircd/client.c index 3ae434f5c..f411848b3 100644 --- a/ircd/client.c +++ b/ircd/client.c @@ -27,7 +27,6 @@ #include "client.h" #include "class.h" -#include "common.h" #include "hash.h" #include "match.h" #include "ircd.h" diff --git a/ircd/extban.c b/ircd/extban.c index 037dfdb52..69603f140 100644 --- a/ircd/extban.c +++ b/ircd/extban.c @@ -23,7 +23,6 @@ #include "stdinc.h" #include "channel.h" #include "client.h" -#include "common.h" ExtbanFunc extban_table[256] = { NULL }; diff --git a/ircd/hash.c b/ircd/hash.c index f444a25c9..c1ef81cbc 100644 --- a/ircd/hash.c +++ b/ircd/hash.c @@ -27,7 +27,6 @@ #include "s_conf.h" #include "channel.h" #include "client.h" -#include "common.h" #include "hash.h" #include "match.h" #include "ircd.h" diff --git a/ircd/ircd.c b/ircd/ircd.c index 1bd94f2ea..b3f1b5d0b 100644 --- a/ircd/ircd.c +++ b/ircd/ircd.c @@ -31,7 +31,6 @@ #include "channel.h" #include "class.h" #include "client.h" -#include "common.h" #include "hash.h" #include "match.h" #include "ircd_signal.h" diff --git a/ircd/newconf.c b/ircd/newconf.c index 827f6ed90..7a726db3a 100644 --- a/ircd/newconf.c +++ b/ircd/newconf.c @@ -10,7 +10,6 @@ #include "newconf.h" #include "ircd_defs.h" -#include "common.h" #include "logger.h" #include "s_conf.h" #include "s_user.h" diff --git a/ircd/packet.c b/ircd/packet.c index 2e838453c..ef8de04d6 100644 --- a/ircd/packet.c +++ b/ircd/packet.c @@ -25,7 +25,6 @@ #include "s_conf.h" #include "s_serv.h" #include "client.h" -#include "common.h" #include "ircd.h" #include "parse.h" #include "packet.h" diff --git a/ircd/parse.c b/ircd/parse.c index 76a3585de..74c5fddb2 100644 --- a/ircd/parse.c +++ b/ircd/parse.c @@ -27,7 +27,6 @@ #include "parse.h" #include "client.h" #include "channel.h" -#include "common.h" #include "hash.h" #include "match.h" #include "ircd.h" diff --git a/ircd/s_auth.c b/ircd/s_auth.c index d9cdadfa5..c30b9e140 100644 --- a/ircd/s_auth.c +++ b/ircd/s_auth.c @@ -38,7 +38,6 @@ #include "s_auth.h" #include "s_conf.h" #include "client.h" -#include "common.h" #include "match.h" #include "ircd.h" #include "numeric.h" diff --git a/ircd/s_conf.c b/ircd/s_conf.c index ef5966c04..87520538a 100644 --- a/ircd/s_conf.c +++ b/ircd/s_conf.c @@ -32,7 +32,6 @@ #include "channel.h" #include "class.h" #include "client.h" -#include "common.h" #include "hash.h" #include "match.h" #include "ircd.h" diff --git a/ircd/s_newconf.c b/ircd/s_newconf.c index 4b79f291b..3815f839f 100644 --- a/ircd/s_newconf.c +++ b/ircd/s_newconf.c @@ -32,7 +32,6 @@ #include "stdinc.h" #include "ircd_defs.h" -#include "common.h" #include "s_conf.h" #include "s_newconf.h" #include "client.h" diff --git a/ircd/s_serv.c b/ircd/s_serv.c index 9f4d37356..619ab51f1 100644 --- a/ircd/s_serv.c +++ b/ircd/s_serv.c @@ -31,7 +31,6 @@ #include "s_serv.h" #include "class.h" #include "client.h" -#include "common.h" #include "hash.h" #include "match.h" #include "ircd.h" diff --git a/ircd/s_user.c b/ircd/s_user.c index 1f6a4cb40..86a8c7cd5 100644 --- a/ircd/s_user.c +++ b/ircd/s_user.c @@ -27,7 +27,6 @@ #include "channel.h" #include "class.h" #include "client.h" -#include "common.h" #include "hash.h" #include "match.h" #include "ircd.h" diff --git a/ircd/scache.c b/ircd/scache.c index f418e36f8..93f5acdc7 100644 --- a/ircd/scache.c +++ b/ircd/scache.c @@ -24,7 +24,6 @@ #include "stdinc.h" #include "client.h" -#include "common.h" #include "match.h" #include "ircd.h" #include "numeric.h" diff --git a/ircd/send.c b/ircd/send.c index 44cb04984..a8782112f 100644 --- a/ircd/send.c +++ b/ircd/send.c @@ -27,7 +27,6 @@ #include "channel.h" #include "class.h" #include "client.h" -#include "common.h" #include "match.h" #include "ircd.h" #include "numeric.h" diff --git a/ircd/supported.c b/ircd/supported.c index 94ebf3a29..c28ed9d03 100644 --- a/ircd/supported.c +++ b/ircd/supported.c @@ -72,7 +72,6 @@ #include "stdinc.h" #include "client.h" -#include "common.h" #include "numeric.h" #include "ircd.h" #include "s_conf.h" diff --git a/modules/core/m_ban.c b/modules/core/m_ban.c index a9ffbce29..94c18f2dc 100644 --- a/modules/core/m_ban.c +++ b/modules/core/m_ban.c @@ -31,7 +31,6 @@ #include "send.h" #include "channel.h" #include "client.h" -#include "common.h" #include "defaults.h" #include "ircd.h" #include "match.h" diff --git a/modules/core/m_error.c b/modules/core/m_error.c index 078dcbc48..d8a931482 100644 --- a/modules/core/m_error.c +++ b/modules/core/m_error.c @@ -24,7 +24,6 @@ #include "stdinc.h" #include "client.h" -#include "common.h" #include "ircd.h" #include "numeric.h" #include "send.h" diff --git a/modules/core/m_join.c b/modules/core/m_join.c index d17850152..4018ff82b 100644 --- a/modules/core/m_join.c +++ b/modules/core/m_join.c @@ -25,7 +25,6 @@ #include "stdinc.h" #include "channel.h" #include "client.h" -#include "common.h" #include "hash.h" #include "match.h" #include "ircd.h" diff --git a/modules/core/m_message.c b/modules/core/m_message.c index d1b2da6e7..afc8e04fe 100644 --- a/modules/core/m_message.c +++ b/modules/core/m_message.c @@ -26,7 +26,6 @@ #include "client.h" #include "ircd.h" #include "numeric.h" -#include "common.h" #include "s_conf.h" #include "s_serv.h" #include "msg.h" diff --git a/modules/core/m_nick.c b/modules/core/m_nick.c index cd9dc9c0f..7930ddea9 100644 --- a/modules/core/m_nick.c +++ b/modules/core/m_nick.c @@ -40,7 +40,6 @@ #include "msg.h" #include "parse.h" #include "modules.h" -#include "common.h" #include "packet.h" #include "scache.h" #include "s_newconf.h" diff --git a/modules/core/m_part.c b/modules/core/m_part.c index 15357c00c..094f39f10 100644 --- a/modules/core/m_part.c +++ b/modules/core/m_part.c @@ -25,7 +25,6 @@ #include "stdinc.h" #include "channel.h" #include "client.h" -#include "common.h" #include "hash.h" #include "match.h" #include "ircd.h" diff --git a/modules/core/m_server.c b/modules/core/m_server.c index 992ede46e..3f16888aa 100644 --- a/modules/core/m_server.c +++ b/modules/core/m_server.c @@ -24,7 +24,6 @@ #include "stdinc.h" #include "client.h" /* client struct */ -#include "common.h" #include "hash.h" /* add_to_client_hash */ #include "match.h" #include "ircd.h" /* me */ diff --git a/modules/core/m_squit.c b/modules/core/m_squit.c index fb2ce5cce..ad2dc9652 100644 --- a/modules/core/m_squit.c +++ b/modules/core/m_squit.c @@ -24,7 +24,6 @@ #include "stdinc.h" #include "client.h" -#include "common.h" #include "match.h" #include "ircd.h" #include "numeric.h" diff --git a/modules/m_certfp.c b/modules/m_certfp.c index d5c1c558c..f6dc003af 100644 --- a/modules/m_certfp.c +++ b/modules/m_certfp.c @@ -29,7 +29,6 @@ #include "stdinc.h" #include "client.h" -#include "common.h" #include "match.h" #include "hash.h" #include "ircd.h" diff --git a/modules/m_chghost.c b/modules/m_chghost.c index 4a964620f..b6711f763 100644 --- a/modules/m_chghost.c +++ b/modules/m_chghost.c @@ -13,7 +13,6 @@ #include "send.h" #include "channel.h" #include "client.h" -#include "common.h" #include "defaults.h" #include "ircd.h" #include "numeric.h" diff --git a/modules/m_dline.c b/modules/m_dline.c index 9c3a39882..9a056d05a 100644 --- a/modules/m_dline.c +++ b/modules/m_dline.c @@ -26,7 +26,6 @@ #include "channel.h" #include "class.h" #include "client.h" -#include "common.h" #include "match.h" #include "ircd.h" #include "hostmask.h" diff --git a/modules/m_encap.c b/modules/m_encap.c index afa4b239d..f87ed6558 100644 --- a/modules/m_encap.c +++ b/modules/m_encap.c @@ -31,7 +31,6 @@ #include "send.h" #include "channel.h" #include "client.h" -#include "common.h" #include "defaults.h" #include "ircd.h" #include "numeric.h" diff --git a/modules/m_etrace.c b/modules/m_etrace.c index 7e5e3c049..064206ae5 100644 --- a/modules/m_etrace.c +++ b/modules/m_etrace.c @@ -35,7 +35,6 @@ #include "hook.h" #include "client.h" #include "hash.h" -#include "common.h" #include "hash.h" #include "match.h" #include "ircd.h" diff --git a/modules/m_info.c b/modules/m_info.c index 60461e16c..81d69a969 100644 --- a/modules/m_info.c +++ b/modules/m_info.c @@ -26,7 +26,6 @@ #include "m_info.h" #include "channel.h" #include "client.h" -#include "common.h" #include "match.h" #include "ircd.h" #include "hook.h" diff --git a/modules/m_invite.c b/modules/m_invite.c index 3572c0e41..bd9aeefb6 100644 --- a/modules/m_invite.c +++ b/modules/m_invite.c @@ -23,7 +23,6 @@ */ #include "stdinc.h" -#include "common.h" #include "channel.h" #include "client.h" #include "hash.h" diff --git a/modules/m_kline.c b/modules/m_kline.c index c1861ec3a..7c55fc55d 100644 --- a/modules/m_kline.c +++ b/modules/m_kline.c @@ -26,7 +26,6 @@ #include "channel.h" #include "class.h" #include "client.h" -#include "common.h" #include "match.h" #include "ircd.h" #include "hostmask.h" diff --git a/modules/m_names.c b/modules/m_names.c index c7e142eb9..026dfd2d2 100644 --- a/modules/m_names.c +++ b/modules/m_names.c @@ -25,7 +25,6 @@ #include "stdinc.h" #include "channel.h" #include "client.h" -#include "common.h" #include "hash.h" #include "match.h" #include "ircd.h" diff --git a/modules/m_oper.c b/modules/m_oper.c index a6d5eca94..926af3fdc 100644 --- a/modules/m_oper.c +++ b/modules/m_oper.c @@ -24,7 +24,6 @@ #include "stdinc.h" #include "client.h" -#include "common.h" #include "match.h" #include "ircd.h" #include "numeric.h" diff --git a/modules/m_operspy.c b/modules/m_operspy.c index 241019509..32a1a96d9 100644 --- a/modules/m_operspy.c +++ b/modules/m_operspy.c @@ -31,7 +31,6 @@ #include "send.h" #include "channel.h" #include "client.h" -#include "common.h" #include "defaults.h" #include "ircd.h" #include "numeric.h" diff --git a/modules/m_privs.c b/modules/m_privs.c index 402a4e019..d8a32ebbe 100644 --- a/modules/m_privs.c +++ b/modules/m_privs.c @@ -31,7 +31,6 @@ #include "stdinc.h" #include "client.h" -#include "common.h" #include "numeric.h" #include "send.h" #include "msg.h" diff --git a/modules/m_rehash.c b/modules/m_rehash.c index 4fc411614..bd6670aaa 100644 --- a/modules/m_rehash.c +++ b/modules/m_rehash.c @@ -25,7 +25,6 @@ #include "stdinc.h" #include "client.h" #include "channel.h" -#include "common.h" #include "match.h" #include "ircd.h" #include "s_serv.h" diff --git a/modules/m_restart.c b/modules/m_restart.c index cad6bd72d..3910e299b 100644 --- a/modules/m_restart.c +++ b/modules/m_restart.c @@ -24,7 +24,6 @@ #include "stdinc.h" #include "client.h" -#include "common.h" #include "match.h" #include "ircd.h" #include "numeric.h" diff --git a/modules/m_scan.c b/modules/m_scan.c index b144a06de..550717163 100644 --- a/modules/m_scan.c +++ b/modules/m_scan.c @@ -34,7 +34,6 @@ #include "hook.h" #include "client.h" #include "hash.h" -#include "common.h" #include "hash.h" #include "match.h" #include "ircd.h" diff --git a/modules/m_services.c b/modules/m_services.c index 515ac735f..b8a1f363f 100644 --- a/modules/m_services.c +++ b/modules/m_services.c @@ -32,7 +32,6 @@ #include "send.h" #include "channel.h" #include "client.h" -#include "common.h" #include "defaults.h" #include "ircd.h" #include "numeric.h" diff --git a/modules/m_set.c b/modules/m_set.c index 3ee08aecb..e28b7002e 100644 --- a/modules/m_set.c +++ b/modules/m_set.c @@ -31,7 +31,6 @@ #include "numeric.h" #include "s_serv.h" #include "send.h" -#include "common.h" #include "channel.h" #include "s_conf.h" #include "s_newconf.h" diff --git a/modules/m_signon.c b/modules/m_signon.c index ad866d968..9175c3579 100644 --- a/modules/m_signon.c +++ b/modules/m_signon.c @@ -32,7 +32,6 @@ #include "send.h" #include "channel.h" #include "client.h" -#include "common.h" #include "defaults.h" #include "ircd.h" #include "numeric.h" diff --git a/modules/m_snote.c b/modules/m_snote.c index af23287db..b79afbd94 100644 --- a/modules/m_snote.c +++ b/modules/m_snote.c @@ -34,7 +34,6 @@ #include "hook.h" #include "client.h" #include "hash.h" -#include "common.h" #include "hash.h" #include "match.h" #include "ircd.h" diff --git a/modules/m_starttls.c b/modules/m_starttls.c index 67f31d154..dbbc71391 100644 --- a/modules/m_starttls.c +++ b/modules/m_starttls.c @@ -20,7 +20,6 @@ #include "stdinc.h" #include "client.h" -#include "common.h" #include "match.h" #include "hash.h" #include "ircd.h" diff --git a/modules/m_stats.c b/modules/m_stats.c index 4cf728909..40082039a 100644 --- a/modules/m_stats.c +++ b/modules/m_stats.c @@ -25,7 +25,6 @@ #include "stdinc.h" #include "class.h" /* report_classes */ #include "client.h" /* Client */ -#include "common.h" #include "match.h" #include "ircd.h" /* me */ #include "listener.h" /* show_ports */ diff --git a/modules/m_svinfo.c b/modules/m_svinfo.c index 9faadc42d..c6042fe11 100644 --- a/modules/m_svinfo.c +++ b/modules/m_svinfo.c @@ -23,7 +23,6 @@ */ #include "stdinc.h" #include "client.h" -#include "common.h" #include "match.h" #include "ircd.h" #include "numeric.h" diff --git a/modules/m_tb.c b/modules/m_tb.c index 2ca66a505..4dce456ce 100644 --- a/modules/m_tb.c +++ b/modules/m_tb.c @@ -32,7 +32,6 @@ #include "send.h" #include "channel.h" #include "client.h" -#include "common.h" #include "defaults.h" #include "ircd.h" #include "match.h" diff --git a/modules/m_testmask.c b/modules/m_testmask.c index 4537d648e..46b431f87 100644 --- a/modules/m_testmask.c +++ b/modules/m_testmask.c @@ -34,7 +34,6 @@ /* List of ircd includes from ../include/ */ #include "stdinc.h" #include "client.h" -#include "common.h" #include "ircd.h" #include "match.h" #include "numeric.h" diff --git a/modules/m_tginfo.c b/modules/m_tginfo.c index dd9050a17..c30d65013 100644 --- a/modules/m_tginfo.c +++ b/modules/m_tginfo.c @@ -29,7 +29,6 @@ #include "stdinc.h" #include "client.h" -#include "common.h" #include "match.h" #include "hash.h" #include "ircd.h" diff --git a/modules/m_trace.c b/modules/m_trace.c index fb0fdb920..38550667a 100644 --- a/modules/m_trace.c +++ b/modules/m_trace.c @@ -27,7 +27,6 @@ #include "hook.h" #include "client.h" #include "hash.h" -#include "common.h" #include "hash.h" #include "match.h" #include "ircd.h" diff --git a/modules/m_who.c b/modules/m_who.c index f0260830e..aa674582b 100644 --- a/modules/m_who.c +++ b/modules/m_who.c @@ -22,7 +22,6 @@ * USA */ #include "stdinc.h" -#include "common.h" #include "client.h" #include "channel.h" #include "hash.h" diff --git a/modules/m_whois.c b/modules/m_whois.c index 3caf1330d..5f7b42d13 100644 --- a/modules/m_whois.c +++ b/modules/m_whois.c @@ -23,7 +23,6 @@ */ #include "stdinc.h" -#include "common.h" #include "client.h" #include "hash.h" #include "channel.h" diff --git a/modules/m_whowas.c b/modules/m_whowas.c index 7f6e0926b..a5038cce8 100644 --- a/modules/m_whowas.c +++ b/modules/m_whowas.c @@ -25,7 +25,6 @@ #include "stdinc.h" #include "whowas.h" #include "client.h" -#include "common.h" #include "hash.h" #include "match.h" #include "ircd.h" diff --git a/modules/m_xline.c b/modules/m_xline.c index 52ef33218..8f557b496 100644 --- a/modules/m_xline.c +++ b/modules/m_xline.c @@ -32,7 +32,6 @@ #include "send.h" #include "channel.h" #include "client.h" -#include "common.h" #include "defaults.h" #include "class.h" #include "ircd.h"