]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Move forward declarations to typedefs.h
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 24 Oct 2009 20:03:53 +0000 (20:03 +0000)
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 24 Oct 2009 20:03:53 +0000 (20:03 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11967 e03df62e-2008-0410-955e-edbf42e46eb7

17 files changed:
include/base.h
include/channels.h
include/configreader.h
include/ctables.h
include/dns.h
include/dynamic.h
include/extensible.h
include/hashcomp.h
include/inspircd.h
include/membership.h
include/modules.h
include/socket.h
include/threadengines/threadengine_pthread.h
include/typedefs.h
include/users.h
include/xline.h
src/hashcomp.cpp

index daff74e5663468be7a092b931978dccf5591f9e1..b39c7d0778463e0f8bb478073c27859f002818f6 100644 (file)
@@ -182,8 +182,6 @@ class CoreExport CoreException : public std::exception
        }
 };
 
-class Module;
-
 class CoreExport ModuleException : public CoreException
 {
  public:
index 5207acfdd45e3cac3d16777ebf9db9a7c4350348..9b4e40375039ace8054e4117a7bf21e2d6371cc4 100644 (file)
@@ -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 {
index 70e09e6c3b1155e38480a7ea1dab18f89b2bdf42..4b42bcd435e83f5c2b744433ce483ff5ae9b0bec 100644 (file)
 #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
index 4cb530e63af892c7b9e598fc5bfb185dcfe276d4..68244932da1bf1d2f360f988f4a9103cbd08a97e 100644 (file)
@@ -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);
index e2f151d61a2a00a2f6699a6248566f99f039dbfa..d5752d2e021c1cd7aee5d3bda4c770fe0e997dbb 100644 (file)
@@ -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
  */
@@ -122,21 +120,6 @@ enum ResolverError
        RESOLVER_FORCEUNLOAD    =       5
 };
 
-/**
- * A DNS request
- */
-class DNSRequest;
-
-/**
- * A DNS packet header
- */
-class DNSHeader;
-
-/**
- * A DNS Resource Record (rr)
- */
-struct ResourceRecord;
-
 /**
  * Query and resource record types
  */
index 12f6ffbc9a2de6d47927665684f3ecee97c8a24f..47523f3afb3e326fd51b840e04e14f24ad6c833a 100644 (file)
@@ -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.
  */
index f0031e801f322424f8e31f0e45e1fdaea957e839..81859b1c89a3afc0e29b538c9f8a6f1e235f606b 100644 (file)
@@ -1,6 +1,3 @@
-class Extensible;
-class Module;
-
 enum SerializeFormat
 {
        /** Shown to a human (does not need to be unserializable) */
index 5392c6ae5d94e26126ea05846520a971b6ebd999..df36eefde30526484629f1c0ee311c2491ddf1e2 100644 (file)
 #define _HASHCOMP_H_
 
 #include <cstring>
+#include <string>
+#include <vector>
+#include <deque>
+#include <map>
+#include <set>
 #include "hash_map.h"
 
 /*******************************************************
  * 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(); }
index 292fbd488631c43b5917249403b72bbadaa98e6e..a183e1dedf7e3a3892404523d5d0389aa838c2e4 100644 (file)
 #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.
  */
index 458c7efc4b7575872f9be21de1881bd5faafa1a0..c92933ba8a9a07f550f5ccaf1278be403c474b8e 100644 (file)
 #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
index 08f1a2dc0cf84eace0a4b576e1de8688ad097ad0..8bda9a725efc10789e6d4fa8eac5c82c8bac2deb 100644 (file)
@@ -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
index 448d79e9fcd2f2a72c5b7b17a71d260992068aff..ef6edbbcabf0bead682d68ea66f08bf756fa916b 100644 (file)
@@ -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.
index 4952ea3e8782369c87713c7c28d4040398bc8768..91d0eb380a631a9f1762cdc58e5eac852dbfc8cb 100644 (file)
 #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
index 296c2efa56acf3b666673b914715eac6ba719f05..c0a5ebbc1fc128a2b06b60645c84b38ddca15eca 100644 (file)
 #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;
        #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
 
index 5e75414a498f19dac707567804ec7000a54c8dd3..de69f63832702ce02c484d716a56da044b3f11ca 100644 (file)
@@ -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 &lt;connect allow&gt; and &lt;connect deny&gt; 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
index 4ad1c63be8e7e12eaa297a3f80260af2852bc318..30cd1380110cd3fd7f57c6eea51e2207822bd768 100644 (file)
 #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.
index bf2a218a6e8475c7d5a51ea259474b2dfe1232fa..68c744cb9669788c1e9cd647c4e07ee6c5a61c3a 100644 (file)
  *
  ******************************************************/
 
+/** 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;