]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/typedefs.h
Use IsCTCP in blockcolor for ignoring CTCPs.
[user/henk/code/inspircd.git] / include / typedefs.h
1 /*
2  * InspIRCd -- Internet Relay Chat Daemon
3  *
4  *   Copyright (C) 2013, 2016, 2018, 2020 Sadie Powell <sadie@witchery.services>
5  *   Copyright (C) 2012-2014, 2016, 2018 Attila Molnar <attilamolnar@hush.com>
6  *   Copyright (C) 2012 Robby <robby@chatbelgie.be>
7  *   Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
8  *   Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
9  *   Copyright (C) 2005, 2010 Craig Edwards <brain@inspircd.org>
10  *
11  * This file is part of InspIRCd.  InspIRCd is free software: you can
12  * redistribute it and/or modify it under the terms of the GNU General Public
13  * License as published by the Free Software Foundation, version 2.
14  *
15  * This program is distributed in the hope that it will be useful, but WITHOUT
16  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
22  */
23
24
25 #pragma once
26
27 class BanCacheManager;
28 class BufferedSocket;
29 class Channel;
30 class Command;
31 class ConfigStatus;
32 class ConfigTag;
33 class Extensible;
34 class FakeUser;
35 class InspIRCd;
36 class Invitation;
37 class IOHookProvider;
38 class LocalUser;
39 class Membership;
40 class Module;
41 class OperInfo;
42 class ProtocolServer;
43 class RemoteUser;
44 class Server;
45 class ServerConfig;
46 class ServerLimits;
47 class Thread;
48 class User;
49 class XLine;
50 class XLineManager;
51 class XLineFactory;
52 struct ConnectClass;
53 class ModResult;
54
55 namespace ClientProtocol
56 {
57         class Event;
58         class EventProvider;
59         class Message;
60         class MessageTagEvent;
61         class MessageTagProvider;
62         class Serializer;
63
64         typedef std::vector<Message*> MessageList;
65         typedef std::vector<std::string> ParamList;
66         typedef std::string SerializedMessage;
67
68         struct MessageTagData
69         {
70                 MessageTagProvider* tagprov;
71                 std::string value;
72                 void* provdata;
73
74                 MessageTagData(MessageTagProvider* prov, const std::string& val, void* data = NULL);
75         };
76
77         /** Map of message tag values and providers keyed by their name.
78          * Sorted in descending order to ensure tag names beginning with symbols (such as '+') come later when iterating
79          * the container than tags with a normal name.
80          */
81         typedef insp::flat_map<std::string, MessageTagData, std::greater<std::string> > TagMap;
82 }
83
84 #include "hashcomp.h"
85 #include "base.h"
86
87 typedef TR1NS::unordered_map<std::string, User*, irc::insensitive, irc::StrHashComp> user_hash;
88 typedef TR1NS::unordered_map<std::string, Channel*, irc::insensitive, irc::StrHashComp> chan_hash;
89
90 /** List of channels to consider when building the neighbor list of a user
91  */
92 typedef std::vector<Membership*> IncludeChanList;
93
94 /** A cached text file stored with its contents as lines
95  */
96 typedef std::vector<std::string> file_cache;
97
98 /** A mapping of configuration keys to their assigned values.
99  */
100 typedef insp::flat_map<std::string, std::string, irc::insensitive_swo> ConfigItems;
101
102 /** The entire configuration
103  */
104 typedef std::multimap<std::string, reference<ConfigTag>, irc::insensitive_swo> ConfigDataHash;
105
106 /** Iterator of ConfigDataHash */
107 typedef ConfigDataHash::const_iterator ConfigIter;
108 /** Iterator pair, used for tag-name ranges */
109 typedef std::pair<ConfigIter,ConfigIter> ConfigTagList;
110
111 /** Files read by the configuration */
112 typedef std::map<std::string, file_cache> ConfigFileCache;
113
114 /** Generic user list, used for exceptions */
115 typedef std::set<User*> CUList;
116
117 /** Contains an ident and host split into two strings
118  */
119 typedef std::pair<std::string, std::string> IdentHostPair;
120
121 /** A map of xline factories
122  */
123 typedef std::map<std::string, XLineFactory*> XLineFactMap;
124
125 /** A map of XLines indexed by string
126  */
127 typedef std::map<std::string, XLine*, irc::insensitive_swo> XLineLookup;
128
129 /** A map of XLineLookup maps indexed by string
130  */
131 typedef std::map<std::string, XLineLookup > XLineContainer;
132
133 /** An iterator in an XLineContainer
134  */
135 typedef XLineContainer::iterator ContainerIter;
136
137 /** An iterator in an XLineLookup
138  */
139 typedef XLineLookup::iterator LookupIter;
140
141 namespace Stats
142 {
143         class Context;
144 }