diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-12-14 12:29:20 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-12-14 12:29:20 +0000 |
commit | 7a17273ec03afb3f5caa0e4b6fe3473cf09711d4 (patch) | |
tree | 42dd84a5b39e15b679102edb60738c265b4a183f | |
parent | ccf86b877c9443e0dd547460ca9852ff647ff598 (diff) |
Tidied up modules.h added some typedefs to typedefs.h
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2401 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | include/modules.h | 15 | ||||
-rw-r--r-- | include/typedefs.h | 3 | ||||
-rw-r--r-- | src/commands.cpp | 7 | ||||
-rw-r--r-- | src/helperfuncs.cpp | 4 | ||||
-rw-r--r-- | src/inspircd.cpp | 7 | ||||
-rw-r--r-- | src/modules.cpp | 28 | ||||
-rw-r--r-- | src/userprocess.cpp | 5 | ||||
-rw-r--r-- | src/xline.cpp | 1 |
8 files changed, 19 insertions, 51 deletions
diff --git a/include/modules.h b/include/modules.h index 315739c22..71bec2d3d 100644 --- a/include/modules.h +++ b/include/modules.h @@ -230,6 +230,21 @@ class Event : public ModuleMessage char* Send(); }; +/** Holds an extended mode's details. + * Used internally by modules.cpp + */ +class ExtMode : public classbase +{ + public: + char modechar; + int type; + bool needsoper; + int params_when_on; + int params_when_off; + bool list; + ExtMode(char mc, int ty, bool oper, int p_on, int p_off) : modechar(mc), type(ty), needsoper(oper), params_when_on(p_on), params_when_off(p_off) { }; +}; + /** Base class for all InspIRCd modules * This class is the base class for InspIRCd modules. All modules must inherit from this class, diff --git a/include/typedefs.h b/include/typedefs.h index 39876207d..1cd48a24a 100644 --- a/include/typedefs.h +++ b/include/typedefs.h @@ -7,6 +7,7 @@ #include "inspstring.h" #include "ctables.h" #include "inspircd.h" +#include "modules.h" #include "inspircd_config.h" #include <string> #ifdef GCC3 @@ -21,5 +22,7 @@ typedef nspace::hash_map<in_addr,string*, nspace::hash<in_addr>, irc::InAddr_Has typedef nspace::hash_map<std::string, WhoWasUser*, nspace::hash<string>, irc::StrHashComp> whowas_hash; typedef std::deque<command_t> command_table; typedef std::vector<std::string> servernamelist; +typedef std::vector<ExtMode> ExtModeList; +typedef ExtModeList::iterator ExtModeListIter; #endif diff --git a/src/commands.cpp b/src/commands.cpp index 498760524..cea3fe9e3 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -87,13 +87,6 @@ const long duration_d = duration_h * 24; const long duration_w = duration_d * 7; const long duration_y = duration_w * 52; -/*typedef nspace::hash_map<std::string, userrec*, nspace::hash<string>, irc::StrHashComp> user_hash; -typedef nspace::hash_map<std::string, chanrec*, nspace::hash<string>, irc::StrHashComp> chan_hash; -typedef nspace::hash_map<in_addr,string*, nspace::hash<in_addr>, irc::InAddr_HashComp> address_cache; -typedef nspace::hash_map<std::string, WhoWasUser*, nspace::hash<string>, irc::StrHashComp> whowas_hash; -typedef std::deque<command_t> command_table;*/ - - extern user_hash clientlist; extern chan_hash chanlist; extern whowas_hash whowas; diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 6bede19a4..eed15dc7b 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -67,10 +67,6 @@ extern std::vector<userrec*> all_opers; extern ClassVector Classes; -/*typedef nspace::hash_map<std::string, userrec*, nspace::hash<string>, irc::StrHashComp> user_hash; -typedef nspace::hash_map<std::string, chanrec*, nspace::hash<string>, irc::StrHashComp> chan_hash; -typedef std::deque<command_t> command_table;*/ - extern user_hash clientlist; extern chan_hash chanlist; extern command_table cmdlist; diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 582eac7b8..5d92f2226 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -86,13 +86,6 @@ SocketEngine* SE = NULL; extern std::vector<std::string> include_stack; -/*typedef nspace::hash_map<std::string, userrec*, nspace::hash<string>, irc::StrHashComp> user_hash; -typedef nspace::hash_map<std::string, chanrec*, nspace::hash<string>, irc::StrHashComp> chan_hash; -typedef nspace::hash_map<in_addr,string*, nspace::hash<in_addr>, irc::InAddr_HashComp> address_cache; -typedef nspace::hash_map<std::string, WhoWasUser*, nspace::hash<string>, irc::StrHashComp> whowas_hash; -typedef std::deque<command_t> command_table; -typedef std::vector<std::string> servernamelist;*/ - // This table references users by file descriptor. // its an array to make it VERY fast, as all lookups are referenced // by an integer, meaning there is no need for a scan/search operation. diff --git a/src/modules.cpp b/src/modules.cpp index 00bdf9b0f..736042c33 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -72,39 +72,13 @@ class Server; extern std::stringstream config_f; extern userrec* fd_ref_table[65536]; -/*typedef nspace::hash_map<std::string, userrec*, nspace::hash<string>, irc::StrHashComp> user_hash; -typedef nspace::hash_map<std::string, chanrec*, nspace::hash<string>, irc::StrHashComp> chan_hash; -typedef nspace::hash_map<in_addr,string*, nspace::hash<in_addr>, irc::InAddr_HashComp> address_cache; -typedef nspace::hash_map<std::string, WhoWasUser*, nspace::hash<string>, irc::StrHashComp> whowas_hash; -typedef std::deque<command_t> command_table;*/ - extern user_hash clientlist; extern chan_hash chanlist; extern whowas_hash whowas; extern command_table cmdlist; extern file_cache MOTD; extern file_cache RULES; -extern address_cache IP; - - -// class type for holding an extended mode character - internal to core - -class ExtMode : public classbase -{ -public: - char modechar; - int type; - bool needsoper; - int params_when_on; - int params_when_off; - bool list; - ExtMode(char mc, int ty, bool oper, int p_on, int p_off) : modechar(mc), type(ty), needsoper(oper), params_when_on(p_on), params_when_off(p_off) { }; -}; - -typedef std::vector<ExtMode> ExtModeList; -typedef ExtModeList::iterator ExtModeListIter; - - +extern address_cache IP; ExtModeList EMode; // returns true if an extended mode character is in use diff --git a/src/userprocess.cpp b/src/userprocess.cpp index 37e0153e5..86a03cca1 100644 --- a/src/userprocess.cpp +++ b/src/userprocess.cpp @@ -78,11 +78,6 @@ extern ServerConfig *Config; extern userrec* fd_ref_table[65536]; char data[65536]; -/*typedef nspace::hash_map<std::string, userrec*, nspace::hash<string>, irc::StrHashComp> user_hash; -typedef nspace::hash_map<std::string, chanrec*, nspace::hash<string>, irc::StrHashComp> chan_hash; -typedef nspace::hash_map<in_addr,string*, nspace::hash<in_addr>, irc::InAddr_HashComp> address_cache; -typedef nspace::hash_map<std::string, WhoWasUser*, nspace::hash<string>, irc::StrHashComp> whowas_hash;*/ - extern user_hash clientlist; extern chan_hash chanlist; extern whowas_hash whowas; diff --git a/src/xline.cpp b/src/xline.cpp index 52648d1d1..32d35dace 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -53,7 +53,6 @@ extern std::vector<Module*> modules; extern std::vector<ircd_module*> factory; extern ServerConfig* Config; extern std::stringstream config_f; -/*typedef nspace::hash_map<std::string, userrec*, nspace::hash<string>, irc::StrHashComp> user_hash;*/ extern user_hash clientlist; /* Version two, now with optimized expiry! |