summaryrefslogtreecommitdiff
path: root/docs/man/man3/modules.h.3
blob: 24fd4c360077b5fa76da8cf5e354356e8313dcc8 (plain)
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
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
.TH "modules.h" 3 "14 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*-
.ad l
.nh
.SH NAME
modules.h \- 
.SH SYNOPSIS
.br
.PP
\fC#include 'dynamic.h'\fP
.br
\fC#include 'base.h'\fP
.br
\fC#include 'ctables.h'\fP
.br
\fC#include 'socket.h'\fP
.br
\fC#include <string>\fP
.br
\fC#include <deque>\fP
.br
\fC#include <sstream>\fP
.br

.SS "Classes"

.in +1c
.ti -1c
.RI "class \fBVersion\fP"
.br
.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"
.ti -1c
.RI "class \fBAdmin\fP"
.br
.RI "\fIHolds /ADMIN data This class contains the admin details of the local server. \fP"
.ti -1c
.RI "class \fBModuleMessage\fP"
.br
.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"
.ti -1c
.RI "class \fBRequest\fP"
.br
.RI "\fIThe Request class is a unicast message directed at a given module. \fP"
.ti -1c
.RI "class \fBEvent\fP"
.br
.RI "\fIThe Event class is a unicast message directed at all modules. \fP"
.ti -1c
.RI "class \fBExtMode\fP"
.br
.RI "\fIHolds an extended mode's details. \fP"
.ti -1c
.RI "class \fBModule\fP"
.br
.RI "\fIBase class for all \fBInspIRCd\fP modules This class is the base class for \fBInspIRCd\fP modules. \fP"
.ti -1c
.RI "class \fBServer\fP"
.br
.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"
.ti -1c
.RI "class \fBConfigReader\fP"
.br
.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"
.ti -1c
.RI "class \fBFileReader\fP"
.br
.RI "\fICaches a text file into memory and can be used to retrieve lines from it. \fP"
.ti -1c
.RI "class \fBModuleFactory\fP"
.br
.RI "\fIInstantiates classes inherited from \fBModule\fP This class creates a class inherited from type \fBModule\fP, using new. \fP"
.in -1c
.SS "Defines"

.in +1c
.ti -1c
.RI "#define \fBDEBUG\fP   10"
.br
.RI "\fIlog levels \fP"
.ti -1c
.RI "#define \fBVERBOSE\fP   20"
.br
.ti -1c
.RI "#define \fBDEFAULT\fP   30"
.br
.ti -1c
.RI "#define \fBSPARSE\fP   40"
.br
.ti -1c
.RI "#define \fBNONE\fP   50"
.br
.ti -1c
.RI "#define \fBMT_CHANNEL\fP   1"
.br
.RI "\fIUsed with OnExtendedMode() method of modules. \fP"
.ti -1c
.RI "#define \fBMT_CLIENT\fP   2"
.br
.ti -1c
.RI "#define \fBMT_SERVER\fP   3"
.br
.ti -1c
.RI "#define \fBACR_DEFAULT\fP   0"
.br
.RI "\fIUsed with OnAccessCheck() method of modules. \fP"
.ti -1c
.RI "#define \fBACR_DENY\fP   1"
.br
.ti -1c
.RI "#define \fBACR_ALLOW\fP   2"
.br
.ti -1c
.RI "#define \fBAC_KICK\fP   0"
.br
.ti -1c
.RI "#define \fBAC_DEOP\fP   1"
.br
.ti -1c
.RI "#define \fBAC_OP\fP   2"
.br
.ti -1c
.RI "#define \fBAC_VOICE\fP   3"
.br
.ti -1c
.RI "#define \fBAC_DEVOICE\fP   4"
.br
.ti -1c
.RI "#define \fBAC_HALFOP\fP   5"
.br
.ti -1c
.RI "#define \fBAC_DEHALFOP\fP   6"
.br
.ti -1c
.RI "#define \fBAC_INVITE\fP   7"
.br
.ti -1c
.RI "#define \fBAC_GENERAL_MODE\fP   8"
.br
.ti -1c
.RI "#define \fBVF_STATIC\fP   1"
.br
.RI "\fIUsed to define a set of behavior bits for a module. \fP"
.ti -1c
.RI "#define \fBVF_VENDOR\fP   2"
.br
.ti -1c
.RI "#define \fBVF_SERVICEPROVIDER\fP   4"
.br
.ti -1c
.RI "#define \fBVF_COMMON\fP   8"
.br
.ti -1c
.RI "#define \fBFOREACH_MOD\fP   for (int _i = 0; _i <= \fBMODCOUNT\fP; _i++) modules[_i]->"
.br
.ti -1c
.RI "#define \fBFOREACH_RESULT\fP(x)"
.br
.ti -1c
.RI "#define \fBFD_MAGIC_NUMBER\fP   -42"
.br
.ti -1c
.RI "#define \fBCONF_NOT_A_NUMBER\fP   0x000010"
.br
.ti -1c
.RI "#define \fBCONF_NOT_UNSIGNED\fP   0x000080"
.br
.ti -1c
.RI "#define \fBCONF_VALUE_NOT_FOUND\fP   0x000100"
.br
.ti -1c
.RI "#define \fBCONF_FILE_NOT_FOUND\fP   0x000200"
.br
.in -1c
.SS "Typedefs"

.in +1c
.ti -1c
.RI "typedef std::deque< \fBstd::string\fP > \fBfile_cache\fP"
.br
.RI "\fILow level definition of a \fBFileReader\fP classes file cache area. \fP"
.ti -1c
.RI "typedef \fBfile_cache\fP \fBstring_list\fP"
.br
.ti -1c
.RI "typedef std::deque< \fBuserrec\fP * > \fBchanuserlist\fP"
.br
.RI "\fIHolds a list of users in a channel. \fP"
.ti -1c
.RI "typedef DLLFactory< \fBModuleFactory\fP > \fBircd_module\fP"
.br
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "void \fBcreatecommand\fP (char *cmd, \fBhandlerfunc\fP f, char flags, int minparams, char *source)"
.br
.ti -1c
.RI "void \fBserver_mode\fP (char **parameters, int pcnt, \fBuserrec\fP *user)"
.br
.ti -1c
.RI "bool \fBModeDefined\fP (char c, int i)"
.br
.ti -1c
.RI "bool \fBModeDefinedOper\fP (char c, int i)"
.br
.ti -1c
.RI "int \fBModeDefinedOn\fP (char c, int i)"
.br
.ti -1c
.RI "int \fBModeDefinedOff\fP (char c, int i)"
.br
.ti -1c
.RI "void \fBModeMakeList\fP (char modechar)"
.br
.ti -1c
.RI "bool \fBModeIsListMode\fP (char modechar, int type)"
.br
.in -1c
.SH "Define Documentation"
.PP 
.SS "#define AC_DEHALFOP   6"
.PP
Definition at line 46 of file modules.h.
.SS "#define AC_DEOP   1"
.PP
Definition at line 41 of file modules.h.
.SS "#define AC_DEVOICE   4"
.PP
Definition at line 44 of file modules.h.
.SS "#define AC_GENERAL_MODE   8"
.PP
Definition at line 48 of file modules.h.
.SS "#define AC_HALFOP   5"
.PP
Definition at line 45 of file modules.h.
.SS "#define AC_INVITE   7"
.PP
Definition at line 47 of file modules.h.
.SS "#define AC_KICK   0"
.PP
Definition at line 40 of file modules.h.
.PP
Referenced by kick_channel().
.SS "#define AC_OP   2"
.PP
Definition at line 42 of file modules.h.
.SS "#define AC_VOICE   3"
.PP
Definition at line 43 of file modules.h.
.SS "#define ACR_ALLOW   2"
.PP
Definition at line 39 of file modules.h.
.SS "#define ACR_DEFAULT   0"
.PP
Used with OnAccessCheck() method of modules. 
.PP
Definition at line 37 of file modules.h.
.PP
Referenced by kick_channel(), and Module::OnAccessCheck().
.SS "#define ACR_DENY   1"
.PP
Definition at line 38 of file modules.h.
.PP
Referenced by kick_channel().
.SS "#define CONF_FILE_NOT_FOUND   0x000200"
.PP
Definition at line 1520 of file modules.h.
.PP
Referenced by ConfigReader::ConfigReader().
.SS "#define CONF_NOT_A_NUMBER   0x000010"
.PP
Definition at line 1517 of file modules.h.
.PP
Referenced by ConfigReader::ReadInteger().
.SS "#define CONF_NOT_UNSIGNED   0x000080"
.PP
Definition at line 1518 of file modules.h.
.PP
Referenced by ConfigReader::ReadInteger().
.SS "#define CONF_VALUE_NOT_FOUND   0x000100"
.PP
Definition at line 1519 of file modules.h.
.PP
Referenced by ConfigReader::ReadFlag(), ConfigReader::ReadInteger(), and ConfigReader::ReadValue().
.SS "#define DEBUG   10"
.PP
log levels 
.PP
Definition at line 23 of file modules.h.
.SS "#define DEFAULT   30"
.PP
Definition at line 25 of file modules.h.
.SS "#define FD_MAGIC_NUMBER   -42"
.PP
Definition at line 101 of file modules.h.
.PP
Referenced by Server::PseudoToUser(), and Server::UserToPseudo().
.SS "#define FOREACH_MOD   for (int _i = 0; _i <= \fBMODCOUNT\fP; _i++) modules[_i]->"
.PP
Definition at line 81 of file modules.h.
.PP
Referenced by del_channel(), ForceChan(), kick_channel(), and Event::Send().
.SS "#define FOREACH_RESULT(x)"
.PP
\fBValue:\fP
.PP
.nf
{ MOD_RESULT = 0; \
                        for (int _i = 0; _i <= MODCOUNT; _i++) { \
                        int res = modules[_i]->x ; \
                        if (res != 0) { \
                                MOD_RESULT = res; \
                                break; \
                        } \
                } \
        }
.fi
.PP
Definition at line 89 of file modules.h.
.PP
Referenced by add_channel(), and kick_channel().
.SS "#define MT_CHANNEL   1"
.PP
Used with OnExtendedMode() method of modules. 
.PP
Definition at line 31 of file modules.h.
.PP
Referenced by Server::AddExtendedListMode(), and ModeMakeList().
.SS "#define MT_CLIENT   2"
.PP
Definition at line 32 of file modules.h.
.PP
Referenced by Server::AddExtendedMode().
.SS "#define MT_SERVER   3"
.PP
Definition at line 33 of file modules.h.
.PP
Referenced by Server::AddExtendedMode().
.SS "#define NONE   50"
.PP
Definition at line 27 of file modules.h.
.SS "#define SPARSE   40"
.PP
Definition at line 26 of file modules.h.
.SS "#define VERBOSE   20"
.PP
Definition at line 24 of file modules.h.
.SS "#define VF_COMMON   8"
.PP
Definition at line 55 of file modules.h.
.SS "#define VF_SERVICEPROVIDER   4"
.PP
Definition at line 54 of file modules.h.
.SS "#define VF_STATIC   1"
.PP
Used to define a set of behavior bits for a module. 
.PP
Definition at line 52 of file modules.h.
.SS "#define VF_VENDOR   2"
.PP
Definition at line 53 of file modules.h.
.PP
Referenced by Module::GetVersion().
.SH "Typedef Documentation"
.PP 
.SS "typedef std::deque<\fBuserrec\fP*> \fBchanuserlist\fP"
.PP
Holds a list of users in a channel. 
.PP
Definition at line 74 of file modules.h.
.SS "typedef std::deque<\fBstd::string\fP> \fBfile_cache\fP"
.PP
Low level definition of a \fBFileReader\fP classes file cache area. 
.PP
Definition at line 65 of file modules.h.
.SS "typedef DLLFactory<\fBModuleFactory\fP> \fBircd_module\fP"
.PP
Definition at line 1686 of file modules.h.
.SS "typedef \fBfile_cache\fP \fBstring_list\fP"
.PP
Definition at line 70 of file modules.h.
.SH "Function Documentation"
.PP 
.SS "void createcommand (char * cmd, \fBhandlerfunc\fP f, char flags, int minparams, char * source)"
.PP
Referenced by Server::AddCommand().
.SS "bool ModeDefined (char c, int i)"
.PP
Definition at line 71 of file modules.cpp.
.PP
References EMode.
.PP
Referenced by DoAddExtendedMode().
.PP
.nf
72 {
73         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
74         {
75                 if ((i->modechar == modechar) && (i->type == type))
76                 {
77                         return true;
78                 }
79         }
80         return false;
81 }
.fi
.PP
.SS "int ModeDefinedOff (char c, int i)"
.PP
Definition at line 121 of file modules.cpp.
.PP
References EMode.
.PP
.nf
122 {
123         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
124         {
125                 if ((i->modechar == modechar) && (i->type == type))
126                 {
127                         return i->params_when_off;
128                 }
129         }
130         return 0;
131 }
.fi
.PP
.SS "int ModeDefinedOn (char c, int i)"
.PP
Definition at line 108 of file modules.cpp.
.PP
References EMode.
.PP
.nf
109 {
110         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
111         {
112                 if ((i->modechar == modechar) && (i->type == type))
113                 {
114                         return i->params_when_on;
115                 }
116         }
117         return 0;
118 }
.fi
.PP
.SS "bool ModeDefinedOper (char c, int i)"
.PP
Definition at line 95 of file modules.cpp.
.PP
References EMode.
.PP
.nf
96 {
97         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
98         {
99                 if ((i->modechar == modechar) && (i->type == type) && (i->needsoper == true))
100                 {
101                         return true;
102                 }
103         }
104         return false;
105 }
.fi
.PP
.SS "bool ModeIsListMode (char modechar, int type)"
.PP
Definition at line 83 of file modules.cpp.
.PP
References EMode.
.PP
.nf
84 {
85         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
86         {
87                 if ((i->modechar == modechar) && (i->type == type) && (i->list == true))
88                 {
89                         return true;
90                 }
91         }
92         return false;
93 }
.fi
.PP
.SS "void ModeMakeList (char modechar)"
.PP
Definition at line 144 of file modules.cpp.
.PP
References EMode, and MT_CHANNEL.
.PP
Referenced by Server::AddExtendedListMode().
.PP
.nf
145 {
146         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
147         {
148                 if ((i->modechar == modechar) && (i->type == MT_CHANNEL))
149                 {
150                         i->list = true;
151                         return;
152                 }
153         }
154         return;
155 }
.fi
.PP
.SS "void server_mode (char ** parameters, int pcnt, \fBuserrec\fP * user)"
.PP
.SH "Author"
.PP 
Generated automatically by Doxygen for InspIRCd from the source code.