diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-24 20:03:53 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-24 20:03:53 +0000 |
commit | 6b2ea833674bb3bfedb0f2e2af06efa25655e5f5 (patch) | |
tree | eed4cba6bd5b019ffd33f2e46ddb8b129d2d732d | |
parent | 68e8a75daf6933d7ec4a3bd21cf12ed1ac880739 (diff) |
Move forward declarations to typedefs.h
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11967 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | include/base.h | 2 | ||||
-rw-r--r-- | include/channels.h | 12 | ||||
-rw-r--r-- | include/configreader.h | 23 | ||||
-rw-r--r-- | include/ctables.h | 8 | ||||
-rw-r--r-- | include/dns.h | 17 | ||||
-rw-r--r-- | include/dynamic.h | 2 | ||||
-rw-r--r-- | include/extensible.h | 3 | ||||
-rw-r--r-- | include/hashcomp.h | 86 | ||||
-rw-r--r-- | include/inspircd.h | 16 | ||||
-rw-r--r-- | include/membership.h | 12 | ||||
-rw-r--r-- | include/modules.h | 27 | ||||
-rw-r--r-- | include/socket.h | 1 | ||||
-rw-r--r-- | include/threadengines/threadengine_pthread.h | 5 | ||||
-rw-r--r-- | include/typedefs.h | 133 | ||||
-rw-r--r-- | include/users.h | 26 | ||||
-rw-r--r-- | include/xline.h | 32 | ||||
-rw-r--r-- | src/hashcomp.cpp | 58 |
17 files changed, 211 insertions, 252 deletions
diff --git a/include/base.h b/include/base.h index daff74e56..b39c7d077 100644 --- a/include/base.h +++ b/include/base.h @@ -182,8 +182,6 @@ class CoreExport CoreException : public std::exception } }; -class Module; - class CoreExport ModuleException : public CoreException { public: diff --git a/include/channels.h b/include/channels.h index 5207acfdd..9b4e40375 100644 --- a/include/channels.h +++ b/include/channels.h @@ -29,10 +29,6 @@ enum ChannelModes { CM_LIMIT = 'l'-65 /* +l: Maximum user limit */ }; -/* Forward declarations - needed */ -class User; -struct ModResult; - /** Holds an entry for a ban list, exemption list, or invite list. * This class contains a single element in a channel list, such as a banlist. */ @@ -59,14 +55,6 @@ class BanItem : public HostItem { }; -/** Holds a complete ban list - */ -typedef std::list<BanItem> BanList; - -/** A list of custom modes parameters on a channel - */ -typedef std::map<char,std::string> CustomModeList; - /** used to hold a channel and a users modes on that channel, e.g. +v, +h, +o */ enum UserChannelModes { diff --git a/include/configreader.h b/include/configreader.h index 70e09e6c3..4b42bcd43 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -23,20 +23,6 @@ #include "socketengine.h" #include "socket.h" -/* Required forward definitions */ -class ServerConfig; -class ServerLimits; -class InspIRCd; -class BufferedSocket; - -/** A cached text file stored with its contents as lines - */ -typedef std::vector<std::string> file_cache; - -/** A configuration key and value pair - */ -typedef std::pair<std::string, std::string> KeyVal; - /** Structure representing a single <tag> in config */ class CoreExport ConfigTag : public refcountbase { @@ -74,10 +60,6 @@ class CoreExport ConfigTag : public refcountbase ConfigTag(const std::string& Tag, const std::string& file, int line); }; -/** An entire config file, built up of KeyValLists - */ -typedef std::multimap<std::string, reference<ConfigTag> > ConfigDataHash; - /** Defines the server's length limits on various length-limited * items such as topics, nicknames, channel names etc. */ @@ -201,11 +183,6 @@ class CoreExport OperInfo : public refcountbase } }; -typedef std::map<std::string, reference<ConfigTag> > TagIndex; -typedef std::map<std::string, reference<OperInfo> > OperIndex; -typedef ConfigDataHash::iterator ConfigIter; -typedef std::pair<ConfigDataHash::iterator, ConfigDataHash::iterator> ConfigTagList; - /** This class holds the bulk of the runtime configuration for the ircd. * It allows for reading new config values, accessing configuration files, * and storage of the configuration data needed to run the ircd, such as diff --git a/include/ctables.h b/include/ctables.h index 4cb530e63..68244932d 100644 --- a/include/ctables.h +++ b/include/ctables.h @@ -214,10 +214,6 @@ class CoreExport Command : public classbase virtual ~Command(); }; -class LocalUser; -class RemoteUser; -class FakeUser; - class CoreExport SplitCommand : public Command { public: @@ -229,10 +225,6 @@ class CoreExport SplitCommand : public Command virtual CmdResult HandleServer(const std::vector<std::string>& parameters, FakeUser* user); }; -/** A hash of commands used by the core - */ -typedef nspace::hash_map<std::string,Command*> Commandtable; - /** Shortcut macros for defining translation lists */ #define TRANSLATE1(x1) translation.push_back(x1); diff --git a/include/dns.h b/include/dns.h index e2f151d61..d5752d2e0 100644 --- a/include/dns.h +++ b/include/dns.h @@ -35,8 +35,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "socket.h" #include "hashcomp.h" -class Module; - /** * Result status, used internally */ @@ -123,21 +121,6 @@ enum ResolverError }; /** - * A DNS request - */ -class DNSRequest; - -/** - * A DNS packet header - */ -class DNSHeader; - -/** - * A DNS Resource Record (rr) - */ -struct ResourceRecord; - -/** * Query and resource record types */ enum QueryType diff --git a/include/dynamic.h b/include/dynamic.h index 12f6ffbc9..47523f3af 100644 --- a/include/dynamic.h +++ b/include/dynamic.h @@ -14,8 +14,6 @@ #ifndef __DLL_H #define __DLL_H -class Module; - /** The DLLManager class is able to load a module file by filename, * and locate its init_module symbol. */ diff --git a/include/extensible.h b/include/extensible.h index f0031e801..81859b1c8 100644 --- a/include/extensible.h +++ b/include/extensible.h @@ -1,6 +1,3 @@ -class Extensible; -class Module; - enum SerializeFormat { /** Shown to a human (does not need to be unserializable) */ diff --git a/include/hashcomp.h b/include/hashcomp.h index 5392c6ae5..df36eefde 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -15,6 +15,11 @@ #define _HASHCOMP_H_ #include <cstring> +#include <string> +#include <vector> +#include <deque> +#include <map> +#include <set> #include "hash_map.h" /******************************************************* @@ -32,28 +37,6 @@ * aware of irc::string. *******************************************************/ -#ifndef LOWERMAP -#define LOWERMAP - -/** A mapping of uppercase to lowercase, including scandinavian - * 'oddities' as specified by RFC1459, e.g. { -> [, and | -> \ - */ -unsigned const char rfc_case_insensitive_map[256] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, /* 0-19 */ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, /* 20-39 */ - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, /* 40-59 */ - 60, 61, 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, /* 60-79 */ - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 94, 95, 96, 97, 98, 99, /* 80-99 */ - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, /* 100-119 */ - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, /* 120-139 */ - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, /* 140-159 */ - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, /* 160-179 */ - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, /* 180-199 */ - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, /* 200-219 */ - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, /* 220-239 */ - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 /* 240-255 */ -}; - /** Seperate from the other casemap tables so that code *can* still exclusively rely on RFC casemapping * if it must. * @@ -62,46 +45,20 @@ unsigned const char rfc_case_insensitive_map[256] = { */ CoreExport extern unsigned const char *national_case_insensitive_map; +/** A mapping of uppercase to lowercase, including scandinavian + * 'oddities' as specified by RFC1459, e.g. { -> [, and | -> \ + */ +CoreExport extern unsigned const char rfc_case_insensitive_map[256]; + /** Case insensitive map, ASCII rules. * That is; * [ != {, but A == a. */ -unsigned const char ascii_case_insensitive_map[256] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, /* 0-19 */ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, /* 20-39 */ - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, /* 40-59 */ - 60, 61, 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, /* 60-79 */ - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 91, 92, 93, 94, 95, 96, 97, 98, 99, /* 80-99 */ - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, /* 100-119 */ - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, /* 120-139 */ - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, /* 140-159 */ - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, /* 160-179 */ - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, /* 180-199 */ - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, /* 200-219 */ - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, /* 220-239 */ - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 /* 240-255 */ -}; - -/** Case sensitive map. - * Can technically also be used for ASCII case sensitive comparisons, as [ != {, etc. - */ -unsigned const char rfc_case_sensitive_map[256] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 -}; +CoreExport extern unsigned const char ascii_case_insensitive_map[256]; -#endif +/** Case sensitive (identity) map. + */ +CoreExport extern unsigned const char rfc_case_sensitive_map[256]; template<typename T> const T& SearchAndReplace(T& text, const T& pattern, const T& replace) { @@ -596,21 +553,6 @@ inline bool operator!= (const std::string& leftval, const irc::string& rightval) return !(leftval.c_str() == rightval); } -// FIXME MAXBUF messes up these -#if 0 -template<std::size_t N> -static inline bool operator == (std::string const &lhs, char const (&rhs)[N]) -{ - return lhs.length() == N - 1 && !std::memcmp(lhs.data(), rhs, N - 1); -} - -template<std::size_t N> -static inline bool operator != (std::string const &lhs, char const (&rhs)[N]) -{ - return !(lhs == rhs); -} -#endif - /** Assign an irc::string to a std::string. */ inline std::string assign(const irc::string &other) { return other.c_str(); } diff --git a/include/inspircd.h b/include/inspircd.h index 292fbd488..a183e1ded 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -53,15 +53,12 @@ #include <map> #include <bitset> #include <set> +#include "inspircd_config.h" +#include "inspircd_version.h" +#include "typedefs.h" -/** A list of failed port bindings, used for informational purposes on startup */ -typedef std::vector<std::pair<std::string, std::string> > FailedPortList; - -class InspIRCd; CoreExport extern InspIRCd* ServerInstance; -#include "inspircd_config.h" -#include "inspircd_version.h" #include "caller.h" #include "cull_list.h" #include "extensible.h" @@ -71,7 +68,6 @@ CoreExport extern InspIRCd* ServerInstance; #include "channels.h" #include "timer.h" #include "hashcomp.h" -#include "typedefs.h" #include "logger.h" #include "usermanager.h" #include "socket.h" @@ -237,8 +233,6 @@ class serverstats } }; -class InspIRCd; - DEFINE_HANDLER2(IsNickHandler, bool, const char*, size_t); DEFINE_HANDLER1(IsIdentHandler, bool, const char*); DEFINE_HANDLER1(FloodQuitUserHandler, void, User*); @@ -246,10 +240,6 @@ DEFINE_HANDLER2(IsChannelHandler, bool, const char*, size_t); DEFINE_HANDLER1(IsSIDHandler, bool, const std::string&); DEFINE_HANDLER1(RehashHandler, void, const std::string&); -/* Forward declaration - required */ -class XLineManager; -class BanCacheManager; - /** The background thread for config reading, so that reading from executable includes * does not block. */ diff --git a/include/membership.h b/include/membership.h index 458c7efc4..c92933ba8 100644 --- a/include/membership.h +++ b/include/membership.h @@ -14,11 +14,9 @@ #ifndef __MEMBERSHIP_H__ #define __MEMBERSHIP_H__ -class User; -class Channel; - -struct CoreExport Membership : public Extensible +class CoreExport Membership : public Extensible { + public: User* const user; Channel* const chan; // mode list, sorted by prefix rank, higest first @@ -31,10 +29,4 @@ struct CoreExport Membership : public Extensible unsigned int getRank(); }; -CoreExport typedef std::map<User*, Membership*> UserMembList; -CoreExport typedef UserMembList::iterator UserMembIter; -CoreExport typedef UserMembList::const_iterator UserMembCIter; - -CoreExport typedef std::set<User*> CUList; - #endif diff --git a/include/modules.h b/include/modules.h index 08f1a2dc0..8bda9a725 100644 --- a/include/modules.h +++ b/include/modules.h @@ -25,8 +25,6 @@ #include "mode.h" #include "dns.h" -class XLine; - /** Used to define a set of behavior bits for a module */ enum ModuleFlags { @@ -108,29 +106,6 @@ struct ModResult { */ #define API_VERSION 137 -class ServerConfig; - -/* Forward-delacare module for ModuleMessage etc - */ -class Module; -class InspIRCd; - -/** A set of strings. - */ -typedef std::vector<std::string> string_list; - -/** Holds a list of 'published features' for modules. - */ -typedef std::map<std::string,Module*> featurelist; - -/** Holds a list of modules which implement an interface - */ -typedef std::deque<Module*> modulelist; - -/** Holds a list of all modules which implement interfaces, by interface name - */ -typedef std::map<std::string, std::pair<int, modulelist> > interfacelist; - /** * This #define allows us to call a method in all * loaded modules in a readable simple way, e.g.: @@ -318,8 +293,6 @@ enum Implementation I_END }; -class ConfigReader; - /** Base class for all InspIRCd modules * This class is the base class for InspIRCd modules. All modules must inherit from this class, * its methods will be called when irc server events occur. class inherited from module must be diff --git a/include/socket.h b/include/socket.h index 448d79e9f..ef6edbbca 100644 --- a/include/socket.h +++ b/include/socket.h @@ -131,7 +131,6 @@ namespace irc } } -class ConfigTag; /** This class handles incoming connections on client ports. * It will create a new User for every valid connection * and assign it a file descriptor. diff --git a/include/threadengines/threadengine_pthread.h b/include/threadengines/threadengine_pthread.h index 4952ea3e8..91d0eb380 100644 --- a/include/threadengines/threadengine_pthread.h +++ b/include/threadengines/threadengine_pthread.h @@ -15,10 +15,7 @@ #define __THREADENGINE_PTHREAD__ #include <pthread.h> -#include "inspircd_config.h" -#include "base.h" - -class Thread; +#include "typedefs.h" /** The ThreadEngine class has the responsibility of initialising * Thread derived classes. It does this by creating operating system diff --git a/include/typedefs.h b/include/typedefs.h index 296c2efa5..c0a5ebbc1 100644 --- a/include/typedefs.h +++ b/include/typedefs.h @@ -14,6 +14,38 @@ #ifndef __TYPEDEF_H__ #define __TYPEDEF_H__ +class BanCacheManager; +class BanItem; +class BufferedSocket; +class Channel; +class Command; +class ConfigReader; +class ConfigTag; +class DNSHeader; +class DNSRequest; +class Extensible; +class FakeUser; +class InspIRCd; +class LocalUser; +class Membership; +class Module; +class OperInfo; +class RemoteUser; +class ServerConfig; +class ServerLimits; +class Thread; +class User; +class UserResolver; +class XLine; +class XLineManager; +class XLineFactory; +struct ConnectClass; +struct ModResult; +struct ResourceRecord; + +#include "hashcomp.h" +#include "base.h" + #if defined(WINDOWS) && !defined(HASHMAP_DEPRECATED) typedef nspace::hash_map<std::string, User*, nspace::hash_compare<std::string, std::less<std::string> > > user_hash; typedef nspace::hash_map<std::string, Channel*, nspace::hash_compare<std::string, std::less<std::string> > > chan_hash; @@ -27,5 +59,106 @@ #endif #endif +/** A list of failed port bindings, used for informational purposes on startup */ +typedef std::vector<std::pair<std::string, std::string> > FailedPortList; + +/** Holds a complete list of all channels to which a user has been invited and has not yet joined, and the time at which they'll expire. + */ +typedef std::vector< std::pair<irc::string, time_t> > InvitedList; + +/** Holds a complete list of all allow and deny tags from the configuration file (connection classes) + */ +typedef std::vector<reference<ConnectClass> > ClassVector; + +/** Typedef for the list of user-channel records for a user + */ +typedef std::set<Channel*> UserChanList; + +/** Shorthand for an iterator into a UserChanList + */ +typedef UserChanList::iterator UCListIter; + +/** Holds a complete ban list + */ +typedef std::vector<BanItem> BanList; + +/** A list of custom modes parameters on a channel + */ +typedef std::map<char,std::string> CustomModeList; + +/** A cached text file stored with its contents as lines + */ +typedef std::vector<std::string> file_cache; + +/** A configuration key and value pair + */ +typedef std::pair<std::string, std::string> KeyVal; + +/** The entire configuration + */ +typedef std::multimap<std::string, reference<ConfigTag> > ConfigDataHash; +/** Iterator of ConfigDataHash */ +typedef ConfigDataHash::const_iterator ConfigIter; +/** Iterator pair, used for tag-name ranges */ +typedef std::pair<ConfigIter,ConfigIter> ConfigTagList; + +/** Index of valid oper blocks and types */ +typedef std::map<std::string, reference<OperInfo> > OperIndex; + +/** A hash of commands used by the core + */ +typedef nspace::hash_map<std::string,Command*> Commandtable; + +/** Membership list of a channel */ +typedef std::map<User*, Membership*> UserMembList; +/** Iterator of UserMembList */ +typedef UserMembList::iterator UserMembIter; +/** const Iterator of UserMembList */ +typedef UserMembList::const_iterator UserMembCIter; + +/** Generic user list, used for exceptions */ +typedef std::set<User*> CUList; + +/** A set of strings. + */ +typedef std::vector<std::string> string_list; + +/** Holds a list of 'published features' for modules. + */ +typedef std::map<std::string,Module*> featurelist; + +/** Holds a list of modules which implement an interface + */ +typedef std::deque<Module*> modulelist; + +/** Holds a list of all modules which implement interfaces, by interface name + */ +typedef std::map<std::string, std::pair<int, modulelist> > interfacelist; + +/** Contains an ident and host split into two strings + */ +typedef std::pair<std::string, std::string> IdentHostPair; + +/** A map of xline factories + */ +typedef std::map<std::string, XLineFactory*> XLineFactMap; + +/** A map of XLines indexed by string + */ +typedef std::map<irc::string, XLine *> XLineLookup; + +/** A map of XLineLookup maps indexed by string + */ +typedef std::map<std::string, XLineLookup > XLineContainer; + +/** An iterator in an XLineContainer + */ +typedef XLineContainer::iterator ContainerIter; + +/** An interator in an XLineLookup + */ +typedef XLineLookup::iterator LookupIter; + + #endif diff --git a/include/users.h b/include/users.h index 5e75414a4..de69f6383 100644 --- a/include/users.h +++ b/include/users.h @@ -56,12 +56,6 @@ enum RegistrationState { REG_ALL = 7 /* REG_NICKUSER plus next bit along */ }; -/* Required forward declaration */ -class Channel; -class UserResolver; -class ConfigTag; -class OperInfo; - /** Holds information relevent to <connect allow> and <connect deny> tags in the config file. */ struct CoreExport ConnectClass : public refcountbase @@ -208,26 +202,6 @@ struct CoreExport ConnectClass : public refcountbase } }; -/** Holds a complete list of all channels to which a user has been invited and has not yet joined, and the time at which they'll expire. - */ -typedef std::vector< std::pair<irc::string, time_t> > InvitedList; - -/** Holds a complete list of all allow and deny tags from the configuration file (connection classes) - */ -typedef std::vector<reference<ConnectClass> > ClassVector; - -/** Typedef for the list of user-channel records for a user - */ -typedef std::set<Channel*> UserChanList; - -/** Shorthand for an iterator into a UserChanList - */ -typedef UserChanList::iterator UCListIter; - -/* Required forward declaration - */ -class User; - /** Holds all information about a user * This class stores all information about a user connected to the irc server. Everything about a * connection is stored here primarily, from the user's socket ID (file descriptor) through to the diff --git a/include/xline.h b/include/xline.h index 4ad1c63be..30cd13801 100644 --- a/include/xline.h +++ b/include/xline.h @@ -14,10 +14,6 @@ #ifndef __XLINE_H #define __XLINE_H -//#include <string> -//#include <deque> -//#include <vector> - /** XLine is the base class for ban lines such as G lines and K lines. * Modules may derive from this, and their xlines will automatically be * handled as expected by any protocol modules (e.g. m_spanningtree will @@ -355,10 +351,6 @@ class CoreExport QLine : public XLine std::string nick; }; -/** Contains an ident and host split into two strings - */ -typedef std::pair<std::string, std::string> IdentHostPair; - /** XLineFactory is used to generate an XLine pointer, given just the * pattern, timing information and type of line to create. This is used * for example in the spanningtree module which will call an XLineFactory @@ -402,30 +394,6 @@ class CoreExport XLineFactory virtual ~XLineFactory() { } }; -/* Required forward declarations - */ -class ServerConfig; - -/** A map of xline factories - */ -typedef std::map<std::string, XLineFactory*> XLineFactMap; - -/** A map of XLines indexed by string - */ -typedef std::map<irc::string, XLine *> XLineLookup; - -/** A map of XLineLookup maps indexed by string - */ -typedef std::map<std::string, XLineLookup > XLineContainer; - -/** An iterator in an XLineContainer - */ -typedef XLineContainer::iterator ContainerIter; - -/** An interator in an XLineLookup - */ -typedef XLineLookup::iterator LookupIter; - /** XLineManager is a class used to manage glines, klines, elines, zlines and qlines, * or any other line created by a module. It also manages XLineFactory classes which * can generate a specialized XLine for use by another module. diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index bf2a218a6..68c744cb9 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -42,6 +42,64 @@ * ******************************************************/ +/** A mapping of uppercase to lowercase, including scandinavian + * 'oddities' as specified by RFC1459, e.g. { -> [, and | -> \ + */ +unsigned const char rfc_case_insensitive_map[256] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, /* 0-19 */ + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, /* 20-39 */ + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, /* 40-59 */ + 60, 61, 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, /* 60-79 */ + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 94, 95, 96, 97, 98, 99, /* 80-99 */ + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, /* 100-119 */ + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, /* 120-139 */ + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, /* 140-159 */ + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, /* 160-179 */ + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, /* 180-199 */ + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, /* 200-219 */ + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, /* 220-239 */ + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 /* 240-255 */ +}; + +/** Case insensitive map, ASCII rules. + * That is; + * [ != {, but A == a. + */ +unsigned const char ascii_case_insensitive_map[256] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, /* 0-19 */ + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, /* 20-39 */ + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, /* 40-59 */ + 60, 61, 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, /* 60-79 */ + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 91, 92, 93, 94, 95, 96, 97, 98, 99, /* 80-99 */ + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, /* 100-119 */ + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, /* 120-139 */ + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, /* 140-159 */ + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, /* 160-179 */ + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, /* 180-199 */ + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, /* 200-219 */ + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, /* 220-239 */ + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 /* 240-255 */ +}; + +/** Case sensitive map. + * Can technically also be used for ASCII case sensitive comparisons, as [ != {, etc. + */ +unsigned const char rfc_case_sensitive_map[256] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 +}; + /* convert a string to lowercase. Note following special circumstances * taken from RFC 1459. Many "official" server branches still hold to this * rule so i will too; |