]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/typedefs.h
Replace copyright headers with headers granting specific authors copyright
[user/henk/code/inspircd.git] / include / typedefs.h
1 /*
2  * InspIRCd -- Internet Relay Chat Daemon
3  *
4  *   Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
5  *   Copyright (C) 2005, 2008 Craig Edwards <craigedwards@brainbox.cc>
6  *   Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
7  *
8  * This file is part of InspIRCd.  InspIRCd is free software: you can
9  * redistribute it and/or modify it under the terms of the GNU General Public
10  * License as published by the Free Software Foundation, version 2.
11  *
12  * This program is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
15  * details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19  */
20
21
22 #ifndef TYPEDEFS_H
23 #define TYPEDEFS_H
24
25 class BanCacheManager;
26 class BanItem;
27 class BufferedSocket;
28 class Channel;
29 class Command;
30 class ConfigReader;
31 class ConfigTag;
32 class DNSHeader;
33 class DNSRequest;
34 class Extensible;
35 class FakeUser;
36 class InspIRCd;
37 class LocalUser;
38 class Membership;
39 class Module;
40 class OperInfo;
41 class RemoteUser;
42 class ServerConfig;
43 class ServerLimits;
44 class Thread;
45 class User;
46 class UserResolver;
47 class XLine;
48 class XLineManager;
49 class XLineFactory;
50 struct ConnectClass;
51 struct ModResult;
52 struct ResourceRecord;
53
54 #include "hashcomp.h"
55 #include "base.h"
56
57 #if defined(WINDOWS) && !defined(HASHMAP_DEPRECATED)
58         typedef nspace::hash_map<std::string, User*, nspace::hash_compare<std::string, std::less<std::string> > > user_hash;
59         typedef nspace::hash_map<std::string, Channel*, nspace::hash_compare<std::string, std::less<std::string> > > chan_hash;
60 #else
61         #ifdef HASHMAP_DEPRECATED
62                 typedef nspace::hash_map<std::string, User*, nspace::insensitive, irc::StrHashComp> user_hash;
63                 typedef nspace::hash_map<std::string, Channel*, nspace::insensitive, irc::StrHashComp> chan_hash;
64         #else
65                 typedef nspace::hash_map<std::string, User*, nspace::hash<std::string>, irc::StrHashComp> user_hash;
66                 typedef nspace::hash_map<std::string, Channel*, nspace::hash<std::string>, irc::StrHashComp> chan_hash;
67         #endif
68 #endif
69
70 /** A list of failed port bindings, used for informational purposes on startup */
71 typedef std::vector<std::pair<std::string, std::string> > FailedPortList;
72
73 /** 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.
74  */
75 typedef std::vector< std::pair<irc::string, time_t> > InvitedList;
76
77 /** Holds a complete list of all allow and deny tags from the configuration file (connection classes)
78  */
79 typedef std::vector<reference<ConnectClass> > ClassVector;
80
81 /** Typedef for the list of user-channel records for a user
82  */
83 typedef std::set<Channel*> UserChanList;
84
85 /** Shorthand for an iterator into a UserChanList
86  */
87 typedef UserChanList::iterator UCListIter;
88
89 /** Holds a complete ban list
90  */
91 typedef std::vector<BanItem> BanList;
92
93 /** A list of custom modes parameters on a channel
94  */
95 typedef std::map<char,std::string> CustomModeList;
96
97 /** A cached text file stored with its contents as lines
98  */
99 typedef std::vector<std::string> file_cache;
100
101 /** A configuration key and value pair
102  */
103 typedef std::pair<std::string, std::string> KeyVal;
104
105 /** The entire configuration
106  */
107 typedef std::multimap<std::string, reference<ConfigTag> > ConfigDataHash;
108
109 /** Iterator of ConfigDataHash */
110 typedef ConfigDataHash::const_iterator ConfigIter;
111 /** Iterator pair, used for tag-name ranges */
112 typedef std::pair<ConfigIter,ConfigIter> ConfigTagList;
113
114 /** Index of valid oper blocks and types */
115 typedef std::map<std::string, reference<OperInfo> > OperIndex;
116
117 /** Files read by the configuration */
118 typedef std::map<std::string, file_cache> ConfigFileCache;
119
120 /** A hash of commands used by the core
121  */
122 typedef nspace::hash_map<std::string,Command*> Commandtable;
123
124 /** Membership list of a channel */
125 typedef std::map<User*, Membership*> UserMembList;
126 /** Iterator of UserMembList */
127 typedef UserMembList::iterator UserMembIter;
128 /** const Iterator of UserMembList */
129 typedef UserMembList::const_iterator UserMembCIter;
130
131 /** Generic user list, used for exceptions */
132 typedef std::set<User*> CUList;
133
134 /** A set of strings.
135  */
136 typedef std::vector<std::string> string_list;
137
138 /** Contains an ident and host split into two strings
139  */
140 typedef std::pair<std::string, std::string> IdentHostPair;
141
142 /** A map of xline factories
143  */
144 typedef std::map<std::string, XLineFactory*> XLineFactMap;
145
146 /** A map of XLines indexed by string
147  */
148 typedef std::map<irc::string, XLine *> XLineLookup;
149
150 /** A map of XLineLookup maps indexed by string
151  */
152 typedef std::map<std::string, XLineLookup > XLineContainer;
153
154 /** An iterator in an XLineContainer
155  */
156 typedef XLineContainer::iterator ContainerIter;
157
158 /** An interator in an XLineLookup
159  */
160 typedef XLineLookup::iterator LookupIter;
161
162
163 #endif
164