diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-11 09:50:16 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-11 09:50:16 +0000 |
commit | a5833e654dd99fc2513b17100f0f06d50e75b4a9 (patch) | |
tree | 46dd719ddacf849a2e1e3a9bcf5da70a73cb1f39 | |
parent | 9ea40ce2f7f7c5d55bf22e4b39e9903509925f1a (diff) |
Move whowas into InspIRCd
Tidy up lowermap extern (for now, we cant do much but have this as extern)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4876 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | include/inspircd.h | 1 | ||||
-rw-r--r-- | src/cmd_whowas.cpp | 7 | ||||
-rw-r--r-- | src/hashcomp.cpp | 36 | ||||
-rw-r--r-- | src/inspircd.cpp | 14 | ||||
-rw-r--r-- | src/userprocess.cpp | 4 | ||||
-rw-r--r-- | src/wildcard.cpp | 3 |
6 files changed, 31 insertions, 34 deletions
diff --git a/include/inspircd.h b/include/inspircd.h index 3e3029310..6efe1757d 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -126,6 +126,7 @@ class InspIRCd : public classbase chan_hash chanlist; std::vector<userrec*> local_users; std::vector<userrec*> all_opers; + irc::whowas::whowas_users whowas; DNS* Res; TimerManager* Timers; command_table cmdlist; diff --git a/src/cmd_whowas.cpp b/src/cmd_whowas.cpp index b300782c5..f147336fd 100644 --- a/src/cmd_whowas.cpp +++ b/src/cmd_whowas.cpp @@ -21,14 +21,11 @@ #include "helperfuncs.h" #include "commands/cmd_whowas.h" - -extern irc::whowas::whowas_users whowas; - void cmd_whowas::Handle (const char** parameters, int pcnt, userrec* user) { - irc::whowas::whowas_users::iterator i = whowas.find(parameters[0]); + irc::whowas::whowas_users::iterator i = ServerInstance->whowas.find(parameters[0]); - if (i == whowas.end()) + if (i == ServerInstance->whowas.end()) { user->WriteServ("406 %s %s :There was no such nickname",user->nick,parameters[0]); } diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index ac51cafe8..953997e5b 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -3,13 +3,13 @@ * +------------------------------------+ * * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev. - * E-mail: - * <brain@chatspike.net> - * <Craig@chatspike.net> + * E-mail: + * <brain@chatspike.net> + * <Craig@chatspike.net> * * Written by Craig Edwards, Craig McLure, and others. * This program is free but copyrighted software; see - * the file COPYING for details. + * the file COPYING for details. * * --------------------------------------------------- */ @@ -25,8 +25,7 @@ using namespace std; #define nspace __gnu_cxx -// from helperfuncs.cpp -extern const char lowermap[255]; +char lowermap[255]; /****************************************************** * @@ -71,11 +70,11 @@ using namespace irc::sockets; */ void nspace::strlower(char *n) { - if (n) - { - for (char* t = n; *t; t++) - *t = lowermap[(unsigned char)*t]; - } + if (n) + { + for (char* t = n; *t; t++) + *t = lowermap[(unsigned char)*t]; + } } size_t nspace::hash<insp_inaddr>::operator()(const insp_inaddr &a) const @@ -283,3 +282,18 @@ const std::string irc::commasepstream::GetToken() irc::commasepstream::~commasepstream() { } + +void InspIRCd::MakeLowerMap() +{ + // initialize the lowercase mapping table + for (unsigned char cn = 0; cn < 255; cn++) + lowermap[cn] = cn; + // lowercase the uppercase chars + for (unsigned char cn = 65; cn < 91; cn++) + lowermap[cn] = tolower(cn); + // now replace the specific chars for scandanavian comparison + lowermap[(unsigned char)'['] = '{'; + lowermap[(unsigned char)']'] = '}'; + lowermap[(unsigned char)'\\'] = '|'; +} + diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 0b56dad98..1e2f16e07 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -192,20 +192,6 @@ std::string InspIRCd::GetRevision() return REVISION; } -void InspIRCd::MakeLowerMap() -{ - // initialize the lowercase mapping table - for (unsigned int cn = 0; cn < 256; cn++) - lowermap[cn] = cn; - // lowercase the uppercase chars - for (unsigned int cn = 65; cn < 91; cn++) - lowermap[cn] = tolower(cn); - // now replace the specific chars for scandanavian comparison - lowermap[(unsigned)'['] = '{'; - lowermap[(unsigned)']'] = '}'; - lowermap[(unsigned)'\\'] = '|'; -} - InspIRCd::InspIRCd(int argc, char** argv) : ModCount(-1) { bool SEGVHandler = false; diff --git a/src/userprocess.cpp b/src/userprocess.cpp index ccd32a9c9..656eac865 100644 --- a/src/userprocess.cpp +++ b/src/userprocess.cpp @@ -51,8 +51,8 @@ using namespace std; #include "command_parse.h" #include "cull_list.h" -extern struct sockaddr_in client,server; -extern socklen_t length; +//extern struct sockaddr_in client,server; +//extern socklen_t length; char data[65536]; diff --git a/src/wildcard.cpp b/src/wildcard.cpp index 6b84ef5b3..403280996 100644 --- a/src/wildcard.cpp +++ b/src/wildcard.cpp @@ -24,8 +24,6 @@ using namespace std; using irc::sockets::MatchCIDR; -extern char lowermap[255]; - // Wed 27 Apr 2005 - Brain // I've taken our our old wildcard routine - // although comprehensive, it was topheavy and very @@ -41,6 +39,7 @@ bool match(const char *str, const char *mask) unsigned char *cp, *mp; unsigned char* string = (unsigned char*)str; unsigned char* wild = (unsigned char*)mask; + extern char lowermap[255]; while ((*string) && (*wild != '*')) { |