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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>modules.cpp Source File</title>
<link href="inspircd.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3-rc3 -->
<center>
<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center>
<hr><h1>modules.cpp</h1><a href="modules_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>
00002 <span class="comment"></span>
00003 <span class="comment"></span>
00004 <span class="comment">*/</span>
00005
00006
00007
00008 <span class="preprocessor">#include <typeinfo></span>
00009 <span class="preprocessor">#include <iostream></span>
00010 <span class="preprocessor">#include "globals.h"</span>
00011 <span class="preprocessor">#include "<a class="code" href="modules_8h.html">modules.h</a>"</span>
00012 <span class="preprocessor">#include "<a class="code" href="ctables_8h.html">ctables.h</a>"</span>
00013 <span class="preprocessor">#include "inspircd_io.h"</span>
00014
00015 <span class="comment">// class type for holding an extended mode character - internal to core</span>
00016
<a name="l00017"></a><a class="code" href="classExtMode.html">00017</a> <span class="keyword">class </span><a class="code" href="classExtMode.html">ExtMode</a>
00018 {
00019 <span class="keyword">public</span>:
<a name="l00020"></a><a class="code" href="classExtMode.html#m0">00020</a> <span class="keywordtype">char</span> <a class="code" href="classExtMode.html#m0">modechar</a>;
<a name="l00021"></a><a class="code" href="classExtMode.html#m1">00021</a> <span class="keywordtype">int</span> <a class="code" href="classExtMode.html#m1">type</a>;
<a name="l00022"></a><a class="code" href="classExtMode.html#m2">00022</a> <span class="keywordtype">int</span> <a class="code" href="classExtMode.html#m2">params_when_on</a>;
<a name="l00023"></a><a class="code" href="classExtMode.html#m3">00023</a> <span class="keywordtype">int</span> <a class="code" href="classExtMode.html#m3">params_when_off</a>;
<a name="l00024"></a><a class="code" href="classExtMode.html#m4">00024</a> <span class="keywordtype">bool</span> <a class="code" href="classExtMode.html#m4">needsoper</a>;
<a name="l00025"></a><a class="code" href="classExtMode.html#a0">00025</a> <a class="code" href="classExtMode.html#a0">ExtMode</a>(<span class="keywordtype">char</span> mc, <span class="keywordtype">int</span> ty, <span class="keywordtype">bool</span> oper, <span class="keywordtype">int</span> p_on, <span class="keywordtype">int</span> p_off) : modechar(mc), type(ty), needsoper(oper), params_when_on(p_on), params_when_off(p_off) { };
00026 };
00027
<a name="l00028"></a><a class="code" href="modules_8cpp.html#a0">00028</a> <span class="keyword">typedef</span> std::vector<ExtMode> <a class="code" href="modules_8cpp.html#a0">ExtModeList</a>;
<a name="l00029"></a><a class="code" href="modules_8cpp.html#a1">00029</a> <span class="keyword">typedef</span> ExtModeList::iterator <a class="code" href="modules_8cpp.html#a1">ExtModeListIter</a>;
00030
<a name="l00031"></a><a class="code" href="modules_8cpp.html#a2">00031</a> <a class="code" href="modules_8cpp.html#a0">ExtModeList</a> <a class="code" href="modules_8cpp.html#a2">EMode</a>;
00032
00033 <span class="comment">// returns true if an extended mode character is in use</span>
<a name="l00034"></a><a class="code" href="modules_8cpp.html#a4">00034</a> <span class="keywordtype">bool</span> <a class="code" href="modules_8cpp.html#a4">ModeDefined</a>(<span class="keywordtype">char</span> modechar, <span class="keywordtype">int</span> type)
00035 {
00036 log(DEBUG,<span class="stringliteral">"Size of extmodes vector is %d"</span>,<a class="code" href="modules_8cpp.html#a2">EMode</a>.size());
00037 <span class="keywordflow">for</span> (<a class="code" href="modules_8cpp.html#a1">ExtModeListIter</a> i = <a class="code" href="modules_8cpp.html#a2">EMode</a>.begin(); i < <a class="code" href="modules_8cpp.html#a2">EMode</a>.end(); i++)
00038 {
00039 log(DEBUG,<span class="stringliteral">"i->modechar==%c, modechar=%c, i->type=%d, type=%d"</span>,i->modechar,modechar,i->type,type);
00040 <span class="keywordflow">if</span> ((i->modechar == modechar) && (i->type == type))
00041 {
00042 <span class="keywordflow">return</span> <span class="keyword">true</span>;
00043 }
00044 }
00045 <span class="keywordflow">return</span> <span class="keyword">false</span>;
00046 }
00047
<a name="l00048"></a><a class="code" href="modules_8cpp.html#a5">00048</a> <span class="keywordtype">bool</span> <a class="code" href="modules_8cpp.html#a5">ModeDefinedOper</a>(<span class="keywordtype">char</span> modechar, <span class="keywordtype">int</span> type)
00049 {
00050 log(DEBUG,<span class="stringliteral">"Size of extmodes vector is %d"</span>,<a class="code" href="modules_8cpp.html#a2">EMode</a>.size());
00051 <span class="keywordflow">for</span> (<a class="code" href="modules_8cpp.html#a1">ExtModeListIter</a> i = <a class="code" href="modules_8cpp.html#a2">EMode</a>.begin(); i < <a class="code" href="modules_8cpp.html#a2">EMode</a>.end(); i++)
00052 {
00053 log(DEBUG,<span class="stringliteral">"i->modechar==%c, modechar=%c, i->type=%d, type=%d"</span>,i->modechar,modechar,i->type,type);
00054 <span class="keywordflow">if</span> ((i->modechar == modechar) && (i->type == type) && (i->needsoper == <span class="keyword">true</span>))
00055 {
00056 <span class="keywordflow">return</span> <span class="keyword">true</span>;
00057 }
00058 }
00059 <span class="keywordflow">return</span> <span class="keyword">false</span>;
00060 }
00061
00062 <span class="comment">// returns number of parameters for a custom mode when it is switched on</span>
<a name="l00063"></a><a class="code" href="modules_8cpp.html#a6">00063</a> <span class="keywordtype">int</span> <a class="code" href="modules_8cpp.html#a6">ModeDefinedOn</a>(<span class="keywordtype">char</span> modechar, <span class="keywordtype">int</span> type)
00064 {
00065 <span class="keywordflow">for</span> (<a class="code" href="modules_8cpp.html#a1">ExtModeListIter</a> i = <a class="code" href="modules_8cpp.html#a2">EMode</a>.begin(); i < <a class="code" href="modules_8cpp.html#a2">EMode</a>.end(); i++)
00066 {
00067 <span class="keywordflow">if</span> ((i->modechar == modechar) && (i->type == type))
00068 {
00069 <span class="keywordflow">return</span> i->params_when_on;
00070 }
00071 }
00072 <span class="keywordflow">return</span> 0;
00073 }
00074
00075 <span class="comment">// returns number of parameters for a custom mode when it is switched on</span>
<a name="l00076"></a><a class="code" href="modules_8cpp.html#a7">00076</a> <span class="keywordtype">int</span> <a class="code" href="modules_8cpp.html#a7">ModeDefinedOff</a>(<span class="keywordtype">char</span> modechar, <span class="keywordtype">int</span> type)
00077 {
00078 <span class="keywordflow">for</span> (<a class="code" href="modules_8cpp.html#a1">ExtModeListIter</a> i = <a class="code" href="modules_8cpp.html#a2">EMode</a>.begin(); i < <a class="code" href="modules_8cpp.html#a2">EMode</a>.end(); i++)
00079 {
00080 <span class="keywordflow">if</span> ((i->modechar == modechar) && (i->type == type))
00081 {
00082 <span class="keywordflow">return</span> i->params_when_off;
00083 }
00084 }
00085 <span class="keywordflow">return</span> 0;
00086 }
00087
00088 <span class="comment">// returns true if an extended mode character is in use</span>
<a name="l00089"></a><a class="code" href="modules_8cpp.html#a8">00089</a> <span class="keywordtype">bool</span> <a class="code" href="modules_8cpp.html#a8">DoAddExtendedMode</a>(<span class="keywordtype">char</span> modechar, <span class="keywordtype">int</span> type, <span class="keywordtype">bool</span> requires_oper, <span class="keywordtype">int</span> params_on, <span class="keywordtype">int</span> params_off)
00090 {
00091 <span class="keywordflow">if</span> (<a class="code" href="modules_8cpp.html#a4">ModeDefined</a>(modechar,type)) {
00092 <span class="keywordflow">return</span> <span class="keyword">false</span>;
00093 }
00094 <a class="code" href="modules_8cpp.html#a2">EMode</a>.push_back(<a class="code" href="classExtMode.html">ExtMode</a>(modechar,type,requires_oper,params_on,params_off));
00095 <span class="keywordflow">return</span> <span class="keyword">true</span>;
00096 }
00097
00098
00099 <span class="comment">// version is a simple class for holding a modules version number</span>
00100
<a name="l00101"></a><a class="code" href="classVersion.html#a0">00101</a> <a class="code" href="classVersion.html#a0">Version::Version</a>(<span class="keywordtype">int</span> major, <span class="keywordtype">int</span> minor, <span class="keywordtype">int</span> revision, <span class="keywordtype">int</span> build) : Major(major), Minor(minor), Revision(revision), Build(build) { };
00102
00103 <span class="comment">// admin is a simple class for holding a server's administrative info</span>
00104
<a name="l00105"></a><a class="code" href="classAdmin.html#a0">00105</a> <a class="code" href="classAdmin.html#a0">Admin::Admin</a>(std::string name, std::string email, std::string nick) : Name(name), Email(email), Nick(nick) { };
00106
<a name="l00107"></a><a class="code" href="classModule.html#a0">00107</a> <a class="code" href="classModule.html#a0">Module::Module</a>() { }
<a name="l00108"></a><a class="code" href="classModule.html#a1">00108</a> <a class="code" href="classModule.html#a1">Module::~Module</a>() { }
<a name="l00109"></a><a class="code" href="classModule.html#a3">00109</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a3">Module::OnUserConnect</a>(<a class="code" href="classuserrec.html">userrec</a>* user) { }
<a name="l00110"></a><a class="code" href="classModule.html#a4">00110</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a4">Module::OnUserQuit</a>(<a class="code" href="classuserrec.html">userrec</a>* user) { }
<a name="l00111"></a><a class="code" href="classModule.html#a5">00111</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a5">Module::OnUserJoin</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* channel) { }
<a name="l00112"></a><a class="code" href="classModule.html#a6">00112</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a6">Module::OnUserPart</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* channel) { }
<a name="l00113"></a><a class="code" href="classModule.html#a7">00113</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a7">Module::OnPacketTransmit</a>(<span class="keywordtype">char</span> *p) { }
<a name="l00114"></a><a class="code" href="classModule.html#a8">00114</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a8">Module::OnPacketReceive</a>(<span class="keywordtype">char</span> *p) { }
<a name="l00115"></a><a class="code" href="classModule.html#a9">00115</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a9">Module::OnRehash</a>() { }
<a name="l00116"></a><a class="code" href="classModule.html#a10">00116</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a10">Module::OnServerRaw</a>(std::string &raw, <span class="keywordtype">bool</span> inbound) { }
00117 <span class="keywordtype">int</span> Module::OnUserPreJoin(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* chan, <span class="keywordtype">char</span>* cname) { <span class="keywordflow">return</span> 0; }
<a name="l00118"></a><a class="code" href="classModule.html#a11">00118</a> <span class="keywordtype">bool</span> <a class="code" href="classModule.html#a11">Module::OnExtendedMode</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <span class="keywordtype">void</span>* target, <span class="keywordtype">char</span> modechar, <span class="keywordtype">int</span> type, <span class="keywordtype">bool</span> mode_on, string_list &params) { }
<a name="l00119"></a><a class="code" href="classModule.html#a2">00119</a> <a class="code" href="classVersion.html">Version</a> <a class="code" href="classModule.html#a2">Module::GetVersion</a>() { <span class="keywordflow">return</span> <a class="code" href="classVersion.html">Version</a>(1,0,0,0); }
00120
00121 <span class="comment">// server is a wrapper class that provides methods to all of the C-style</span>
00122 <span class="comment">// exports in the core</span>
00123 <span class="comment">//</span>
00124
<a name="l00125"></a><a class="code" href="classServer.html#a0">00125</a> <a class="code" href="classServer.html#a0">Server::Server</a>()
00126 {
00127 }
00128
<a name="l00129"></a><a class="code" href="classServer.html#a1">00129</a> <a class="code" href="classServer.html#a1">Server::~Server</a>()
00130 {
00131 }
00132
<a name="l00133"></a><a class="code" href="classServer.html#a2">00133</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a2">Server::SendOpers</a>(std::string s)
00134 {
00135 WriteOpers(<span class="stringliteral">"%s"</span>,s.c_str());
00136 }
00137
<a name="l00138"></a><a class="code" href="classServer.html#a3">00138</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a3">Server::Log</a>(<span class="keywordtype">int</span> level, std::string s)
00139 {
00140 log(level,<span class="stringliteral">"%s"</span>,s.c_str());
00141 }
00142
<a name="l00143"></a><a class="code" href="classServer.html#a20">00143</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a20">Server::AddCommand</a>(<span class="keywordtype">char</span>* cmd, handlerfunc f, <span class="keywordtype">char</span> flags, <span class="keywordtype">int</span> minparams)
00144 {
00145 <a class="code" href="modules_8h.html#a13">createcommand</a>(cmd,f,flags,minparams);
00146 }
00147
<a name="l00148"></a><a class="code" href="classServer.html#a21">00148</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a21">Server::SendMode</a>(<span class="keywordtype">char</span> **parameters, <span class="keywordtype">int</span> pcnt, <a class="code" href="classuserrec.html">userrec</a> *user)
00149 {
00150 <a class="code" href="modules_8h.html#a14">server_mode</a>(parameters,pcnt,user);
00151 }
00152
<a name="l00153"></a><a class="code" href="classServer.html#a4">00153</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a4">Server::Send</a>(<span class="keywordtype">int</span> Socket, std::string s)
00154 {
00155 Write(Socket,<span class="stringliteral">"%s"</span>,s.c_str());
00156 }
00157
<a name="l00158"></a><a class="code" href="classServer.html#a5">00158</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a5">Server::SendServ</a>(<span class="keywordtype">int</span> Socket, std::string s)
00159 {
00160 WriteServ(Socket,<span class="stringliteral">"%s"</span>,s.c_str());
00161 }
00162
<a name="l00163"></a><a class="code" href="classServer.html#a6">00163</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a6">Server::SendFrom</a>(<span class="keywordtype">int</span> Socket, <a class="code" href="classuserrec.html">userrec</a>* User, std::string s)
00164 {
00165 WriteFrom(Socket,User,<span class="stringliteral">"%s"</span>,s.c_str());
00166 }
00167
<a name="l00168"></a><a class="code" href="classServer.html#a7">00168</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a7">Server::SendTo</a>(<a class="code" href="classuserrec.html">userrec</a>* Source, <a class="code" href="classuserrec.html">userrec</a>* Dest, std::string s)
00169 {
00170 WriteTo(Source,Dest,<span class="stringliteral">"%s"</span>,s.c_str());
00171 }
00172
<a name="l00173"></a><a class="code" href="classServer.html#a8">00173</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a8">Server::SendChannel</a>(<a class="code" href="classuserrec.html">userrec</a>* User, <a class="code" href="classchanrec.html">chanrec</a>* Channel, std::string s,<span class="keywordtype">bool</span> IncludeSender)
00174 {
00175 <span class="keywordflow">if</span> (IncludeSender)
00176 {
00177 WriteChannel(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str());
00178 }
00179 <span class="keywordflow">else</span>
00180 {
00181 ChanExceptSender(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str());
00182 }
00183 }
00184
<a name="l00185"></a><a class="code" href="classServer.html#a9">00185</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a9">Server::CommonChannels</a>(<a class="code" href="classuserrec.html">userrec</a>* u1, <a class="code" href="classuserrec.html">userrec</a>* u2)
00186 {
00187 <span class="keywordflow">return</span> (common_channels(u1,u2) != 0);
00188 }
00189
<a name="l00190"></a><a class="code" href="classServer.html#a10">00190</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a10">Server::SendCommon</a>(<a class="code" href="classuserrec.html">userrec</a>* User, std::string text,<span class="keywordtype">bool</span> IncludeSender)
00191 {
00192 <span class="keywordflow">if</span> (IncludeSender)
00193 {
00194 WriteCommon(User,<span class="stringliteral">"%s"</span>,text.c_str());
00195 }
00196 <span class="keywordflow">else</span>
00197 {
00198 WriteCommonExcept(User,<span class="stringliteral">"%s"</span>,text.c_str());
00199 }
00200 }
00201
<a name="l00202"></a><a class="code" href="classServer.html#a11">00202</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a11">Server::SendWallops</a>(<a class="code" href="classuserrec.html">userrec</a>* User, std::string text)
00203 {
00204 WriteWallOps(User,<span class="stringliteral">"%s"</span>,text.c_str());
00205 }
00206
<a name="l00207"></a><a class="code" href="classServer.html#a12">00207</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a12">Server::IsNick</a>(std::string nick)
00208 {
00209 <span class="keywordflow">return</span> (isnick(nick.c_str()) != 0);
00210 }
00211
<a name="l00212"></a><a class="code" href="classServer.html#a13">00212</a> <a class="code" href="classuserrec.html">userrec</a>* <a class="code" href="classServer.html#a13">Server::FindNick</a>(std::string nick)
00213 {
00214 <span class="keywordflow">return</span> Find(nick);
00215 }
00216
<a name="l00217"></a><a class="code" href="classServer.html#a14">00217</a> <a class="code" href="classchanrec.html">chanrec</a>* <a class="code" href="classServer.html#a14">Server::FindChannel</a>(std::string channel)
00218 {
00219 <span class="keywordflow">return</span> FindChan(channel.c_str());
00220 }
00221
<a name="l00222"></a><a class="code" href="classServer.html#a15">00222</a> std::string <a class="code" href="classServer.html#a15">Server::ChanMode</a>(<a class="code" href="classuserrec.html">userrec</a>* User, <a class="code" href="classchanrec.html">chanrec</a>* Chan)
00223 {
00224 <span class="keywordflow">return</span> cmode(User,Chan);
00225 }
00226
<a name="l00227"></a><a class="code" href="classServer.html#a16">00227</a> std::string <a class="code" href="classServer.html#a16">Server::GetServerName</a>()
00228 {
00229 <span class="keywordflow">return</span> getservername();
00230 }
00231
<a name="l00232"></a><a class="code" href="classServer.html#a17">00232</a> std::string <a class="code" href="classServer.html#a17">Server::GetNetworkName</a>()
00233 {
00234 <span class="keywordflow">return</span> getnetworkname();
00235 }
00236
<a name="l00237"></a><a class="code" href="classServer.html#a18">00237</a> <a class="code" href="classAdmin.html">Admin</a> <a class="code" href="classServer.html#a18">Server::GetAdmin</a>()
00238 {
00239 <span class="keywordflow">return</span> <a class="code" href="classAdmin.html">Admin</a>(getadminname(),getadminemail(),getadminnick());
00240 }
00241
00242
00243
<a name="l00244"></a><a class="code" href="classServer.html#a19">00244</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a19">Server::AddExtendedMode</a>(<span class="keywordtype">char</span> modechar, <span class="keywordtype">int</span> type, <span class="keywordtype">bool</span> requires_oper, <span class="keywordtype">int</span> params_when_on, <span class="keywordtype">int</span> params_when_off)
00245 {
00246 <span class="keywordflow">if</span> (type == <a class="code" href="modules_8h.html#a7">MT_SERVER</a>)
00247 {
00248 log(DEBUG,<span class="stringliteral">"*** API ERROR *** Modes of type MT_SERVER are reserved for future expansion"</span>);
00249 <span class="keywordflow">return</span> <span class="keyword">false</span>;
00250 }
00251 <span class="keywordflow">if</span> (((params_when_on>0) || (params_when_off>0)) && (type == <a class="code" href="modules_8h.html#a6">MT_CLIENT</a>))
00252 {
00253 log(DEBUG,<span class="stringliteral">"*** API ERROR *** Parameters on MT_CLIENT modes are not supported"</span>);
00254 <span class="keywordflow">return</span> <span class="keyword">false</span>;
00255 }
00256 <span class="keywordflow">if</span> ((params_when_on>1) || (params_when_off>1))
00257 {
00258 log(DEBUG,<span class="stringliteral">"*** API ERROR *** More than one parameter for an MT_CHANNEL mode is not yet supported"</span>);
00259 <span class="keywordflow">return</span> <span class="keyword">false</span>;
00260 }
00261 <span class="keywordflow">return</span> <a class="code" href="modules_8cpp.html#a8">DoAddExtendedMode</a>(modechar,type,requires_oper,params_when_on,params_when_off);
00262 }
00263
00264
<a name="l00265"></a><a class="code" href="classConfigReader.html#a0">00265</a> <a class="code" href="classConfigReader.html#a0">ConfigReader::ConfigReader</a>()
00266 {
00267 <a class="code" href="classConfigReader.html#n0">fname</a> = CONFIG_FILE;
00268 }
00269
00270
<a name="l00271"></a><a class="code" href="classConfigReader.html#a2">00271</a> <a class="code" href="classConfigReader.html#a2">ConfigReader::~ConfigReader</a>()
00272 {
00273 }
00274
00275
<a name="l00276"></a><a class="code" href="classConfigReader.html#a1">00276</a> <a class="code" href="classConfigReader.html#a0">ConfigReader::ConfigReader</a>(std::string filename) : fname(filename) { };
00277
<a name="l00278"></a><a class="code" href="classConfigReader.html#a3">00278</a> std::string <a class="code" href="classConfigReader.html#a3">ConfigReader::ReadValue</a>(std::string tag, std::string name, <span class="keywordtype">int</span> index)
00279 {
00280 <span class="keywordtype">char</span> val[MAXBUF];
00281 ReadConf(<a class="code" href="classConfigReader.html#n0">fname</a>.c_str(),tag.c_str(),name.c_str(),index,val);
00282 <span class="keywordflow">return</span> val;
00283 }
00284
00285
<a name="l00286"></a><a class="code" href="classConfigReader.html#a4">00286</a> <span class="keywordtype">int</span> <a class="code" href="classConfigReader.html#a4">ConfigReader::Enumerate</a>(std::string tag)
00287 {
00288 <span class="keywordflow">return</span> EnumConf(<a class="code" href="classConfigReader.html#n0">fname</a>.c_str(),tag.c_str());
00289 }
00290
00291
<a name="l00292"></a><a class="code" href="classConfigReader.html#a5">00292</a> <span class="keywordtype">bool</span> <a class="code" href="classConfigReader.html#a5">ConfigReader::Verify</a>()
00293 {
00294 <span class="keywordflow">return</span> <span class="keyword">true</span>;
00295 }
00296
00297
<a name="l00298"></a><a class="code" href="classFileReader.html#a1">00298</a> <a class="code" href="classFileReader.html#a0">FileReader::FileReader</a>(std::string filename)
00299 {
00300 <a class="code" href="modules_8h.html#a10">file_cache</a> c;
00301 readfile(c,filename.c_str());
00302 this-><a class="code" href="classFileReader.html#o0">fc</a> = c;
00303 }
00304
<a name="l00305"></a><a class="code" href="classFileReader.html#a0">00305</a> <a class="code" href="classFileReader.html#a0">FileReader::FileReader</a>()
00306 {
00307 }
00308
<a name="l00309"></a><a class="code" href="classFileReader.html#a3">00309</a> <span class="keywordtype">void</span> <a class="code" href="classFileReader.html#a3">FileReader::LoadFile</a>(std::string filename)
00310 {
00311 <a class="code" href="modules_8h.html#a10">file_cache</a> c;
00312 readfile(c,filename.c_str());
00313 this-><a class="code" href="classFileReader.html#o0">fc</a> = c;
00314 }
00315
00316
<a name="l00317"></a><a class="code" href="classFileReader.html#a2">00317</a> <a class="code" href="classFileReader.html#a2">FileReader::~FileReader</a>()
00318 {
00319 }
00320
<a name="l00321"></a><a class="code" href="classFileReader.html#a4">00321</a> <span class="keywordtype">bool</span> <a class="code" href="classFileReader.html#a4">FileReader::Exists</a>()
00322 {
00323 <span class="keywordflow">if</span> (<a class="code" href="classFileReader.html#o0">fc</a>.size() == 0)
00324 {
00325 <span class="keywordflow">return</span>(false);
00326 }
00327 <span class="keywordflow">else</span>
00328 {
00329 <span class="keywordflow">return</span>(true);
00330 }
00331 }
00332
<a name="l00333"></a><a class="code" href="classFileReader.html#a5">00333</a> std::string <a class="code" href="classFileReader.html#a5">FileReader::GetLine</a>(<span class="keywordtype">int</span> x)
00334 {
00335 <span class="keywordflow">if</span> ((x<0) || (x><a class="code" href="classFileReader.html#o0">fc</a>.size()))
00336 <span class="keywordflow">return</span> <span class="stringliteral">""</span>;
00337 <span class="keywordflow">return</span> <a class="code" href="classFileReader.html#o0">fc</a>[x];
00338 }
00339
<a name="l00340"></a><a class="code" href="classFileReader.html#a6">00340</a> <span class="keywordtype">int</span> <a class="code" href="classFileReader.html#a6">FileReader::FileSize</a>()
00341 {
00342 <span class="keywordflow">return</span> <a class="code" href="classFileReader.html#o0">fc</a>.size();
00343 }
00344
00345
00346 std::vector<Module*> <a class="code" href="modules_8cpp.html#a9">modules</a>(255);
00347 std::vector<ircd_module*> <a class="code" href="modules_8cpp.html#a10">factory</a>(255);
00348
<a name="l00349"></a><a class="code" href="modules_8cpp.html#a3">00349</a> <span class="keywordtype">int</span> <a class="code" href="modules_8cpp.html#a3">MODCOUNT</a> = -1;
00350
00351
</pre></div><hr><address style="align: right;"><small>Generated on Mon Apr 5 02:03:51 2004 for InspIRCd by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0
width=110 height=53></a>1.3-rc3 </small></address>
</body>
</html>
|