]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - docs/man/man3/modules.h.3
481aeaa5796160b03d1c5eefeba55afa3056a1d9
[user/henk/code/inspircd.git] / docs / man / man3 / modules.h.3
1 .TH "modules.h" 3 "15 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*-
2 .ad l
3 .nh
4 .SH NAME
5 modules.h \- 
6 .SH SYNOPSIS
7 .br
8 .PP
9 \fC#include 'dynamic.h'\fP
10 .br
11 \fC#include 'base.h'\fP
12 .br
13 \fC#include 'ctables.h'\fP
14 .br
15 \fC#include 'socket.h'\fP
16 .br
17 \fC#include <string>\fP
18 .br
19 \fC#include <deque>\fP
20 .br
21 \fC#include <sstream>\fP
22 .br
23
24 .SS "Classes"
25
26 .in +1c
27 .ti -1c
28 .RI "class \fBVersion\fP"
29 .br
30 .RI "\fIHolds a module's Version information The four members (set by the constructor only) indicate details as to the version number of a module. \fP"
31 .ti -1c
32 .RI "class \fBAdmin\fP"
33 .br
34 .RI "\fIHolds /ADMIN data This class contains the admin details of the local server. \fP"
35 .ti -1c
36 .RI "class \fBModuleMessage\fP"
37 .br
38 .RI "\fIThe ModuleMessage class is the base class of \fBRequest\fP and \fBEvent\fP This class is used to represent a basic data structure which is passed between modules for safe inter-module communications. \fP"
39 .ti -1c
40 .RI "class \fBRequest\fP"
41 .br
42 .RI "\fIThe Request class is a unicast message directed at a given module. \fP"
43 .ti -1c
44 .RI "class \fBEvent\fP"
45 .br
46 .RI "\fIThe Event class is a unicast message directed at all modules. \fP"
47 .ti -1c
48 .RI "class \fBExtMode\fP"
49 .br
50 .RI "\fIHolds an extended mode's details. \fP"
51 .ti -1c
52 .RI "class \fBModule\fP"
53 .br
54 .RI "\fIBase class for all \fBInspIRCd\fP modules This class is the base class for \fBInspIRCd\fP modules. \fP"
55 .ti -1c
56 .RI "class \fBServer\fP"
57 .br
58 .RI "\fIAllows server output and query functions This class contains methods which allow a module to query the state of the irc server, and produce output to users and other servers. \fP"
59 .ti -1c
60 .RI "class \fBConfigReader\fP"
61 .br
62 .RI "\fIAllows reading of values from configuration files This class allows a module to read from either the main configuration file (inspircd.conf) or from a module-specified configuration file. \fP"
63 .ti -1c
64 .RI "class \fBFileReader\fP"
65 .br
66 .RI "\fICaches a text file into memory and can be used to retrieve lines from it. \fP"
67 .ti -1c
68 .RI "class \fBModuleFactory\fP"
69 .br
70 .RI "\fIInstantiates classes inherited from \fBModule\fP This class creates a class inherited from type \fBModule\fP, using new. \fP"
71 .in -1c
72 .SS "Defines"
73
74 .in +1c
75 .ti -1c
76 .RI "#define \fBDEBUG\fP   10"
77 .br
78 .RI "\fIlog levels \fP"
79 .ti -1c
80 .RI "#define \fBVERBOSE\fP   20"
81 .br
82 .ti -1c
83 .RI "#define \fBDEFAULT\fP   30"
84 .br
85 .ti -1c
86 .RI "#define \fBSPARSE\fP   40"
87 .br
88 .ti -1c
89 .RI "#define \fBNONE\fP   50"
90 .br
91 .ti -1c
92 .RI "#define \fBMT_CHANNEL\fP   1"
93 .br
94 .RI "\fIUsed with OnExtendedMode() method of modules. \fP"
95 .ti -1c
96 .RI "#define \fBMT_CLIENT\fP   2"
97 .br
98 .ti -1c
99 .RI "#define \fBMT_SERVER\fP   3"
100 .br
101 .ti -1c
102 .RI "#define \fBACR_DEFAULT\fP   0"
103 .br
104 .RI "\fIUsed with OnAccessCheck() method of modules. \fP"
105 .ti -1c
106 .RI "#define \fBACR_DENY\fP   1"
107 .br
108 .ti -1c
109 .RI "#define \fBACR_ALLOW\fP   2"
110 .br
111 .ti -1c
112 .RI "#define \fBAC_KICK\fP   0"
113 .br
114 .ti -1c
115 .RI "#define \fBAC_DEOP\fP   1"
116 .br
117 .ti -1c
118 .RI "#define \fBAC_OP\fP   2"
119 .br
120 .ti -1c
121 .RI "#define \fBAC_VOICE\fP   3"
122 .br
123 .ti -1c
124 .RI "#define \fBAC_DEVOICE\fP   4"
125 .br
126 .ti -1c
127 .RI "#define \fBAC_HALFOP\fP   5"
128 .br
129 .ti -1c
130 .RI "#define \fBAC_DEHALFOP\fP   6"
131 .br
132 .ti -1c
133 .RI "#define \fBAC_INVITE\fP   7"
134 .br
135 .ti -1c
136 .RI "#define \fBAC_GENERAL_MODE\fP   8"
137 .br
138 .ti -1c
139 .RI "#define \fBVF_STATIC\fP   1"
140 .br
141 .RI "\fIUsed to define a set of behavior bits for a module. \fP"
142 .ti -1c
143 .RI "#define \fBVF_VENDOR\fP   2"
144 .br
145 .ti -1c
146 .RI "#define \fBVF_SERVICEPROVIDER\fP   4"
147 .br
148 .ti -1c
149 .RI "#define \fBVF_COMMON\fP   8"
150 .br
151 .ti -1c
152 .RI "#define \fBFOREACH_MOD\fP   for (int _i = 0; _i <= \fBMODCOUNT\fP; _i++) modules[_i]->"
153 .br
154 .ti -1c
155 .RI "#define \fBFOREACH_RESULT\fP(x)"
156 .br
157 .ti -1c
158 .RI "#define \fBFD_MAGIC_NUMBER\fP   -42"
159 .br
160 .ti -1c
161 .RI "#define \fBCONF_NOT_A_NUMBER\fP   0x000010"
162 .br
163 .ti -1c
164 .RI "#define \fBCONF_NOT_UNSIGNED\fP   0x000080"
165 .br
166 .ti -1c
167 .RI "#define \fBCONF_VALUE_NOT_FOUND\fP   0x000100"
168 .br
169 .ti -1c
170 .RI "#define \fBCONF_FILE_NOT_FOUND\fP   0x000200"
171 .br
172 .in -1c
173 .SS "Typedefs"
174
175 .in +1c
176 .ti -1c
177 .RI "typedef std::deque< \fBstd::string\fP > \fBfile_cache\fP"
178 .br
179 .RI "\fILow level definition of a \fBFileReader\fP classes file cache area. \fP"
180 .ti -1c
181 .RI "typedef \fBfile_cache\fP \fBstring_list\fP"
182 .br
183 .ti -1c
184 .RI "typedef std::deque< \fBuserrec\fP * > \fBchanuserlist\fP"
185 .br
186 .RI "\fIHolds a list of users in a channel. \fP"
187 .ti -1c
188 .RI "typedef DLLFactory< \fBModuleFactory\fP > \fBircd_module\fP"
189 .br
190 .in -1c
191 .SS "Functions"
192
193 .in +1c
194 .ti -1c
195 .RI "void \fBcreatecommand\fP (char *cmd, \fBhandlerfunc\fP f, char flags, int minparams, char *source)"
196 .br
197 .ti -1c
198 .RI "void \fBserver_mode\fP (char **parameters, int pcnt, \fBuserrec\fP *user)"
199 .br
200 .ti -1c
201 .RI "bool \fBModeDefined\fP (char c, int i)"
202 .br
203 .ti -1c
204 .RI "bool \fBModeDefinedOper\fP (char c, int i)"
205 .br
206 .ti -1c
207 .RI "int \fBModeDefinedOn\fP (char c, int i)"
208 .br
209 .ti -1c
210 .RI "int \fBModeDefinedOff\fP (char c, int i)"
211 .br
212 .ti -1c
213 .RI "void \fBModeMakeList\fP (char modechar)"
214 .br
215 .ti -1c
216 .RI "bool \fBModeIsListMode\fP (char modechar, int type)"
217 .br
218 .in -1c
219 .SH "Define Documentation"
220 .PP 
221 .SS "#define AC_DEHALFOP   6"
222 .PP
223 Definition at line 46 of file modules.h.
224 .SS "#define AC_DEOP   1"
225 .PP
226 Definition at line 41 of file modules.h.
227 .SS "#define AC_DEVOICE   4"
228 .PP
229 Definition at line 44 of file modules.h.
230 .SS "#define AC_GENERAL_MODE   8"
231 .PP
232 Definition at line 48 of file modules.h.
233 .SS "#define AC_HALFOP   5"
234 .PP
235 Definition at line 45 of file modules.h.
236 .SS "#define AC_INVITE   7"
237 .PP
238 Definition at line 47 of file modules.h.
239 .SS "#define AC_KICK   0"
240 .PP
241 Definition at line 40 of file modules.h.
242 .PP
243 Referenced by kick_channel().
244 .SS "#define AC_OP   2"
245 .PP
246 Definition at line 42 of file modules.h.
247 .SS "#define AC_VOICE   3"
248 .PP
249 Definition at line 43 of file modules.h.
250 .SS "#define ACR_ALLOW   2"
251 .PP
252 Definition at line 39 of file modules.h.
253 .SS "#define ACR_DEFAULT   0"
254 .PP
255 Used with OnAccessCheck() method of modules. 
256 .PP
257 Definition at line 37 of file modules.h.
258 .PP
259 Referenced by kick_channel(), and Module::OnAccessCheck().
260 .SS "#define ACR_DENY   1"
261 .PP
262 Definition at line 38 of file modules.h.
263 .PP
264 Referenced by kick_channel().
265 .SS "#define CONF_FILE_NOT_FOUND   0x000200"
266 .PP
267 Definition at line 1523 of file modules.h.
268 .PP
269 Referenced by ConfigReader::ConfigReader().
270 .SS "#define CONF_NOT_A_NUMBER   0x000010"
271 .PP
272 Definition at line 1520 of file modules.h.
273 .PP
274 Referenced by ConfigReader::ReadInteger().
275 .SS "#define CONF_NOT_UNSIGNED   0x000080"
276 .PP
277 Definition at line 1521 of file modules.h.
278 .PP
279 Referenced by ConfigReader::ReadInteger().
280 .SS "#define CONF_VALUE_NOT_FOUND   0x000100"
281 .PP
282 Definition at line 1522 of file modules.h.
283 .PP
284 Referenced by ConfigReader::ReadFlag(), ConfigReader::ReadInteger(), and ConfigReader::ReadValue().
285 .SS "#define DEBUG   10"
286 .PP
287 log levels 
288 .PP
289 Definition at line 23 of file modules.h.
290 .SS "#define DEFAULT   30"
291 .PP
292 Definition at line 25 of file modules.h.
293 .SS "#define FD_MAGIC_NUMBER   -42"
294 .PP
295 Definition at line 101 of file modules.h.
296 .PP
297 Referenced by Server::PseudoToUser(), and Server::UserToPseudo().
298 .SS "#define FOREACH_MOD   for (int _i = 0; _i <= \fBMODCOUNT\fP; _i++) modules[_i]->"
299 .PP
300 Definition at line 81 of file modules.h.
301 .PP
302 Referenced by del_channel(), ForceChan(), kick_channel(), and Event::Send().
303 .SS "#define FOREACH_RESULT(x)"
304 .PP
305 \fBValue:\fP
306 .PP
307 .nf
308 { MOD_RESULT = 0; \
309                         for (int _i = 0; _i <= MODCOUNT; _i++) { \
310                         int res = modules[_i]->x ; \
311                         if (res != 0) { \
312                                 MOD_RESULT = res; \
313                                 break; \
314                         } \
315                 } \
316         }
317 .fi
318 .PP
319 Definition at line 89 of file modules.h.
320 .PP
321 Referenced by add_channel(), and kick_channel().
322 .SS "#define MT_CHANNEL   1"
323 .PP
324 Used with OnExtendedMode() method of modules. 
325 .PP
326 Definition at line 31 of file modules.h.
327 .PP
328 Referenced by Server::AddExtendedListMode(), and ModeMakeList().
329 .SS "#define MT_CLIENT   2"
330 .PP
331 Definition at line 32 of file modules.h.
332 .PP
333 Referenced by Server::AddExtendedMode().
334 .SS "#define MT_SERVER   3"
335 .PP
336 Definition at line 33 of file modules.h.
337 .PP
338 Referenced by Server::AddExtendedMode().
339 .SS "#define NONE   50"
340 .PP
341 Definition at line 27 of file modules.h.
342 .SS "#define SPARSE   40"
343 .PP
344 Definition at line 26 of file modules.h.
345 .SS "#define VERBOSE   20"
346 .PP
347 Definition at line 24 of file modules.h.
348 .SS "#define VF_COMMON   8"
349 .PP
350 Definition at line 55 of file modules.h.
351 .SS "#define VF_SERVICEPROVIDER   4"
352 .PP
353 Definition at line 54 of file modules.h.
354 .SS "#define VF_STATIC   1"
355 .PP
356 Used to define a set of behavior bits for a module. 
357 .PP
358 Definition at line 52 of file modules.h.
359 .SS "#define VF_VENDOR   2"
360 .PP
361 Definition at line 53 of file modules.h.
362 .PP
363 Referenced by Module::GetVersion().
364 .SH "Typedef Documentation"
365 .PP 
366 .SS "typedef std::deque<\fBuserrec\fP*> \fBchanuserlist\fP"
367 .PP
368 Holds a list of users in a channel. 
369 .PP
370 Definition at line 74 of file modules.h.
371 .SS "typedef std::deque<\fBstd::string\fP> \fBfile_cache\fP"
372 .PP
373 Low level definition of a \fBFileReader\fP classes file cache area. 
374 .PP
375 Definition at line 65 of file modules.h.
376 .SS "typedef DLLFactory<\fBModuleFactory\fP> \fBircd_module\fP"
377 .PP
378 Definition at line 1689 of file modules.h.
379 .SS "typedef \fBfile_cache\fP \fBstring_list\fP"
380 .PP
381 Definition at line 70 of file modules.h.
382 .SH "Function Documentation"
383 .PP 
384 .SS "void createcommand (char * cmd, \fBhandlerfunc\fP f, char flags, int minparams, char * source)"
385 .PP
386 Referenced by Server::AddCommand().
387 .SS "bool ModeDefined (char c, int i)"
388 .PP
389 Definition at line 71 of file modules.cpp.
390 .PP
391 References EMode.
392 .PP
393 Referenced by DoAddExtendedMode().
394 .PP
395 .nf
396 72 {
397 73         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
398 74         {
399 75                 if ((i->modechar == modechar) && (i->type == type))
400 76                 {
401 77                         return true;
402 78                 }
403 79         }
404 80         return false;
405 81 }
406 .fi
407 .PP
408 .SS "int ModeDefinedOff (char c, int i)"
409 .PP
410 Definition at line 121 of file modules.cpp.
411 .PP
412 References EMode.
413 .PP
414 .nf
415 122 {
416 123         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
417 124         {
418 125                 if ((i->modechar == modechar) && (i->type == type))
419 126                 {
420 127                         return i->params_when_off;
421 128                 }
422 129         }
423 130         return 0;
424 131 }
425 .fi
426 .PP
427 .SS "int ModeDefinedOn (char c, int i)"
428 .PP
429 Definition at line 108 of file modules.cpp.
430 .PP
431 References EMode.
432 .PP
433 .nf
434 109 {
435 110         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
436 111         {
437 112                 if ((i->modechar == modechar) && (i->type == type))
438 113                 {
439 114                         return i->params_when_on;
440 115                 }
441 116         }
442 117         return 0;
443 118 }
444 .fi
445 .PP
446 .SS "bool ModeDefinedOper (char c, int i)"
447 .PP
448 Definition at line 95 of file modules.cpp.
449 .PP
450 References EMode.
451 .PP
452 .nf
453 96 {
454 97         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
455 98         {
456 99                 if ((i->modechar == modechar) && (i->type == type) && (i->needsoper == true))
457 100                 {
458 101                         return true;
459 102                 }
460 103         }
461 104         return false;
462 105 }
463 .fi
464 .PP
465 .SS "bool ModeIsListMode (char modechar, int type)"
466 .PP
467 Definition at line 83 of file modules.cpp.
468 .PP
469 References EMode.
470 .PP
471 .nf
472 84 {
473 85         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
474 86         {
475 87                 if ((i->modechar == modechar) && (i->type == type) && (i->list == true))
476 88                 {
477 89                         return true;
478 90                 }
479 91         }
480 92         return false;
481 93 }
482 .fi
483 .PP
484 .SS "void ModeMakeList (char modechar)"
485 .PP
486 Definition at line 144 of file modules.cpp.
487 .PP
488 References EMode, and MT_CHANNEL.
489 .PP
490 Referenced by Server::AddExtendedListMode().
491 .PP
492 .nf
493 145 {
494 146         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
495 147         {
496 148                 if ((i->modechar == modechar) && (i->type == MT_CHANNEL))
497 149                 {
498 150                         i->list = true;
499 151                         return;
500 152                 }
501 153         }
502 154         return;
503 155 }
504 .fi
505 .PP
506 .SS "void server_mode (char ** parameters, int pcnt, \fBuserrec\fP * user)"
507 .PP
508 .SH "Author"
509 .PP 
510 Generated automatically by Doxygen for InspIRCd from the source code.