]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - docs/man/man3/modules.cpp.3
Added docs for new smaller memory footprint classes
[user/henk/code/inspircd.git] / docs / man / man3 / modules.cpp.3
1 .TH "modules.cpp" 3 "12 May 2005" "InspIRCd" \" -*- nroff -*-
2 .ad l
3 .nh
4 .SH NAME
5 modules.cpp \- 
6 .SH SYNOPSIS
7 .br
8 .PP
9 \fC#include 'inspircd.h'\fP
10 .br
11 \fC#include 'inspircd_io.h'\fP
12 .br
13 \fC#include 'inspircd_util.h'\fP
14 .br
15 \fC#include 'inspircd_config.h'\fP
16 .br
17 \fC#include <unistd.h>\fP
18 .br
19 \fC#include <fcntl.h>\fP
20 .br
21 \fC#include <sys/errno.h>\fP
22 .br
23 \fC#include <sys/ioctl.h>\fP
24 .br
25 \fC#include <sys/utsname.h>\fP
26 .br
27 \fC#include <cstdio>\fP
28 .br
29 \fC#include <time.h>\fP
30 .br
31 \fC#include <string>\fP
32 .br
33 \fC#include <hash_map>\fP
34 .br
35 \fC#include <map>\fP
36 .br
37 \fC#include <sstream>\fP
38 .br
39 \fC#include <vector>\fP
40 .br
41 \fC#include <errno.h>\fP
42 .br
43 \fC#include <deque>\fP
44 .br
45 \fC#include <sched.h>\fP
46 .br
47 \fC#include 'connection.h'\fP
48 .br
49 \fC#include 'users.h'\fP
50 .br
51 \fC#include 'servers.h'\fP
52 .br
53 \fC#include 'ctables.h'\fP
54 .br
55 \fC#include 'globals.h'\fP
56 .br
57 \fC#include 'modules.h'\fP
58 .br
59 \fC#include 'dynamic.h'\fP
60 .br
61 \fC#include 'wildcard.h'\fP
62 .br
63 \fC#include 'message.h'\fP
64 .br
65 \fC#include 'mode.h'\fP
66 .br
67 \fC#include 'xline.h'\fP
68 .br
69 \fC#include 'commands.h'\fP
70 .br
71 \fC#include 'inspstring.h'\fP
72 .br
73
74 .SS "Namespaces"
75
76 .in +1c
77 .ti -1c
78 .RI "namespace \fBnspace\fP"
79 .br
80 .in -1c
81 .SS "Compounds"
82
83 .in +1c
84 .ti -1c
85 .RI "class \fBExtMode\fP"
86 .br
87 .ti -1c
88 .RI "struct \fBInAddr_HashComp\fP"
89 .br
90 .ti -1c
91 .RI "struct \fBStrHashComp\fP"
92 .br
93 .in -1c
94 .SS "Defines"
95
96 .in +1c
97 .ti -1c
98 .RI "#define \fBnspace\fP   std"
99 .br
100 .in -1c
101 .SS "Typedefs"
102
103 .in +1c
104 .ti -1c
105 .RI "typedef nspace::hash_map< std::string, \fBuserrec\fP *, nspace::hash< string >, \fBStrHashComp\fP > \fBuser_hash\fP"
106 .br
107 .ti -1c
108 .RI "typedef nspace::hash_map< std::string, \fBchanrec\fP *, nspace::hash< string >, \fBStrHashComp\fP > \fBchan_hash\fP"
109 .br
110 .ti -1c
111 .RI "typedef nspace::hash_map< in_addr, string *, nspace::hash< in_addr >, \fBInAddr_HashComp\fP > \fBaddress_cache\fP"
112 .br
113 .ti -1c
114 .RI "typedef nspace::hash_map< std::string, \fBWhoWasUser\fP *, nspace::hash< string >, \fBStrHashComp\fP > \fBwhowas_hash\fP"
115 .br
116 .ti -1c
117 .RI "typedef std::deque< \fBcommand_t\fP > \fBcommand_table\fP"
118 .br
119 .ti -1c
120 .RI "typedef std::vector< \fBExtMode\fP > \fBExtModeList\fP"
121 .br
122 .ti -1c
123 .RI "typedef ExtModeList::iterator \fBExtModeListIter\fP"
124 .br
125 .in -1c
126 .SS "Functions"
127
128 .in +1c
129 .ti -1c
130 .RI "bool \fBModeDefined\fP (char modechar, int type)"
131 .br
132 .ti -1c
133 .RI "bool \fBModeIsListMode\fP (char modechar, int type)"
134 .br
135 .ti -1c
136 .RI "bool \fBModeDefinedOper\fP (char modechar, int type)"
137 .br
138 .ti -1c
139 .RI "int \fBModeDefinedOn\fP (char modechar, int type)"
140 .br
141 .ti -1c
142 .RI "int \fBModeDefinedOff\fP (char modechar, int type)"
143 .br
144 .ti -1c
145 .RI "bool \fBDoAddExtendedMode\fP (char modechar, int type, bool requires_oper, int params_on, int params_off)"
146 .br
147 .ti -1c
148 .RI "void \fBModeMakeList\fP (char modechar)"
149 .br
150 .ti -1c
151 .RI "std::vector< \fBModule\fP * > \fBmodules\fP (255)"
152 .br
153 .ti -1c
154 .RI "std::vector< \fBircd_module\fP * > \fBfactory\fP (255)"
155 .br
156 .in -1c
157 .SS "Variables"
158
159 .in +1c
160 .ti -1c
161 .RI "int \fBMODCOUNT\fP = -1"
162 .br
163 .ti -1c
164 .RI "std::vector< \fBModule\fP * > \fBmodules\fP"
165 .br
166 .ti -1c
167 .RI "std::vector< \fBircd_module\fP * > \fBfactory\fP"
168 .br
169 .ti -1c
170 .RI "time_t \fBTIME\fP"
171 .br
172 .ti -1c
173 .RI "int \fBLogLevel\fP"
174 .br
175 .ti -1c
176 .RI "char \fBServerName\fP [MAXBUF]"
177 .br
178 .ti -1c
179 .RI "char \fBNetwork\fP [MAXBUF]"
180 .br
181 .ti -1c
182 .RI "char \fBServerDesc\fP [MAXBUF]"
183 .br
184 .ti -1c
185 .RI "char \fBAdminName\fP [MAXBUF]"
186 .br
187 .ti -1c
188 .RI "char \fBAdminEmail\fP [MAXBUF]"
189 .br
190 .ti -1c
191 .RI "char \fBAdminNick\fP [MAXBUF]"
192 .br
193 .ti -1c
194 .RI "char \fBdiepass\fP [MAXBUF]"
195 .br
196 .ti -1c
197 .RI "char \fBrestartpass\fP [MAXBUF]"
198 .br
199 .ti -1c
200 .RI "char \fBmotd\fP [MAXBUF]"
201 .br
202 .ti -1c
203 .RI "char \fBrules\fP [MAXBUF]"
204 .br
205 .ti -1c
206 .RI "char \fBlist\fP [MAXBUF]"
207 .br
208 .ti -1c
209 .RI "char \fBPrefixQuit\fP [MAXBUF]"
210 .br
211 .ti -1c
212 .RI "char \fBDieValue\fP [MAXBUF]"
213 .br
214 .ti -1c
215 .RI "int \fBdebugging\fP"
216 .br
217 .ti -1c
218 .RI "int \fBWHOWAS_STALE\fP"
219 .br
220 .ti -1c
221 .RI "int \fBWHOWAS_MAX\fP"
222 .br
223 .ti -1c
224 .RI "int \fBDieDelay\fP"
225 .br
226 .ti -1c
227 .RI "time_t \fBstartup_time\fP"
228 .br
229 .ti -1c
230 .RI "int \fBNetBufferSize\fP"
231 .br
232 .ti -1c
233 .RI "int \fBMaxWhoResults\fP"
234 .br
235 .ti -1c
236 .RI "time_t \fBnb_start\fP"
237 .br
238 .ti -1c
239 .RI "std::vector< int > \fBfd_reap\fP"
240 .br
241 .ti -1c
242 .RI "std::vector< std::string > \fBmodule_names\fP"
243 .br
244 .ti -1c
245 .RI "int \fBboundPortCount\fP"
246 .br
247 .ti -1c
248 .RI "int \fBportCount\fP"
249 .br
250 .ti -1c
251 .RI "int \fBSERVERportCount\fP"
252 .br
253 .ti -1c
254 .RI "int \fBports\fP [MAXSOCKS]"
255 .br
256 .ti -1c
257 .RI "int \fBdefaultRoute\fP"
258 .br
259 .ti -1c
260 .RI "std::vector< long > \fBauth_cookies\fP"
261 .br
262 .ti -1c
263 .RI "std::stringstream \fBconfig_f\fP"
264 .br
265 .ti -1c
266 .RI "\fBserverrec\fP * \fBme\fP [32]"
267 .br
268 .ti -1c
269 .RI "FILE * \fBlog_file\fP"
270 .br
271 .ti -1c
272 .RI "\fBuserrec\fP * \fBfd_ref_table\fP [65536]"
273 .br
274 .ti -1c
275 .RI "\fBuser_hash\fP \fBclientlist\fP"
276 .br
277 .ti -1c
278 .RI "\fBchan_hash\fP \fBchanlist\fP"
279 .br
280 .ti -1c
281 .RI "\fBwhowas_hash\fP \fBwhowas\fP"
282 .br
283 .ti -1c
284 .RI "\fBcommand_table\fP \fBcmdlist\fP"
285 .br
286 .ti -1c
287 .RI "\fBfile_cache\fP \fBMOTD\fP"
288 .br
289 .ti -1c
290 .RI "\fBfile_cache\fP \fBRULES\fP"
291 .br
292 .ti -1c
293 .RI "\fBaddress_cache\fP \fBIP\fP"
294 .br
295 .ti -1c
296 .RI "\fBExtModeList\fP \fBEMode\fP"
297 .br
298 .in -1c
299 .SH "Define Documentation"
300 .PP 
301 .SS "#define nspace   std"
302 .PP
303 Definition at line 64 of file modules.cpp.
304 .SH "Typedef Documentation"
305 .PP 
306 .SS "typedef nspace::hash_map<in_addr,string*, nspace::hash<in_addr>, \fBInAddr_HashComp\fP> \fBaddress_cache\fP"
307 .PP
308 Definition at line 187 of file modules.cpp.
309 .SS "typedef nspace::hash_map<std::string, \fBchanrec\fP*, nspace::hash<string>, \fBStrHashComp\fP> \fBchan_hash\fP"
310 .PP
311 Definition at line 186 of file modules.cpp.
312 .SS "typedef std::deque<\fBcommand_t\fP> \fBcommand_table\fP"
313 .PP
314 Definition at line 189 of file modules.cpp.
315 .SS "typedef std::vector<\fBExtMode\fP> \fBExtModeList\fP"
316 .PP
317 Definition at line 215 of file modules.cpp.
318 .SS "typedef ExtModeList::iterator \fBExtModeListIter\fP"
319 .PP
320 Definition at line 216 of file modules.cpp.
321 .PP
322 Referenced by ModeDefined(), ModeDefinedOff(), ModeDefinedOn(), ModeDefinedOper(), ModeIsListMode(), and ModeMakeList().
323 .SS "typedef nspace::hash_map<std::string, \fBuserrec\fP*, nspace::hash<string>, \fBStrHashComp\fP> \fBuser_hash\fP"
324 .PP
325 Definition at line 185 of file modules.cpp.
326 .SS "typedef nspace::hash_map<std::string, \fBWhoWasUser\fP*, nspace::hash<string>, \fBStrHashComp\fP> \fBwhowas_hash\fP"
327 .PP
328 Definition at line 188 of file modules.cpp.
329 .SH "Function Documentation"
330 .PP 
331 .SS "bool DoAddExtendedMode (char modechar, int type, bool requires_oper, int params_on, int params_off)"
332 .PP
333 Definition at line 285 of file modules.cpp.
334 .PP
335 References EMode, and ModeDefined().
336 .PP
337 Referenced by Server::AddExtendedListMode(), and Server::AddExtendedMode().
338 .PP
339 .nf
340 286 {
341 287         if (ModeDefined(modechar,type)) {
342 288                 return false;
343 289         }
344 290         EMode.push_back(ExtMode(modechar,type,requires_oper,params_on,params_off));
345 291         return true;
346 292 }
347 .fi
348 .SS "std::vector<\fBircd_module\fP*> factory (255)"
349 .PP
350 .SS "bool ModeDefined (char modechar, int type)"
351 .PP
352 Definition at line 222 of file modules.cpp.
353 .PP
354 References EMode, and ExtModeListIter.
355 .PP
356 Referenced by DoAddExtendedMode().
357 .PP
358 .nf
359 223 {
360 224         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
361 225         {
362 226                 if ((i->modechar == modechar) && (i->type == type))
363 227                 {
364 228                         return true;
365 229                 }
366 230         }
367 231         return false;
368 232 }
369 .fi
370 .SS "int ModeDefinedOff (char modechar, int type)"
371 .PP
372 Definition at line 272 of file modules.cpp.
373 .PP
374 References EMode, and ExtModeListIter.
375 .PP
376 .nf
377 273 {
378 274         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
379 275         {
380 276                 if ((i->modechar == modechar) && (i->type == type))
381 277                 {
382 278                         return i->params_when_off;
383 279                 }
384 280         }
385 281         return 0;
386 282 }
387 .fi
388 .SS "int ModeDefinedOn (char modechar, int type)"
389 .PP
390 Definition at line 259 of file modules.cpp.
391 .PP
392 References EMode, and ExtModeListIter.
393 .PP
394 .nf
395 260 {
396 261         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
397 262         {
398 263                 if ((i->modechar == modechar) && (i->type == type))
399 264                 {
400 265                         return i->params_when_on;
401 266                 }
402 267         }
403 268         return 0;
404 269 }
405 .fi
406 .SS "bool ModeDefinedOper (char modechar, int type)"
407 .PP
408 Definition at line 246 of file modules.cpp.
409 .PP
410 References EMode, and ExtModeListIter.
411 .PP
412 .nf
413 247 {
414 248         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
415 249         {
416 250                 if ((i->modechar == modechar) && (i->type == type) && (i->needsoper == true))
417 251                 {
418 252                         return true;
419 253                 }
420 254         }
421 255         return false;
422 256 }
423 .fi
424 .SS "bool ModeIsListMode (char modechar, int type)"
425 .PP
426 Definition at line 234 of file modules.cpp.
427 .PP
428 References EMode, and ExtModeListIter.
429 .PP
430 .nf
431 235 {
432 236         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
433 237         {
434 238                 if ((i->modechar == modechar) && (i->type == type) && (i->list == true))
435 239                 {
436 240                         return true;
437 241                 }
438 242         }
439 243         return false;
440 244 }
441 .fi
442 .SS "void ModeMakeList (char modechar)"
443 .PP
444 Definition at line 295 of file modules.cpp.
445 .PP
446 References EMode, ExtModeListIter, and MT_CHANNEL.
447 .PP
448 Referenced by Server::AddExtendedListMode().
449 .PP
450 .nf
451 296 {
452 297         for (ExtModeListIter i = EMode.begin(); i < EMode.end(); i++)
453 298         {
454 299                 if ((i->modechar == modechar) && (i->type == MT_CHANNEL))
455 300                 {
456 301                         i->list = true;
457 302                         return;
458 303                 }
459 304         }
460 305         return;
461 306 }
462 .fi
463 .SS "std::vector<\fBModule\fP*> modules (255)"
464 .PP
465 .SH "Variable Documentation"
466 .PP 
467 .SS "char \fBAdminEmail\fP[MAXBUF]"
468 .PP
469 Definition at line 84 of file modules.cpp.
470 .SS "char \fBAdminName\fP[MAXBUF]"
471 .PP
472 Definition at line 83 of file modules.cpp.
473 .SS "char \fBAdminNick\fP[MAXBUF]"
474 .PP
475 Definition at line 85 of file modules.cpp.
476 .SS "std::vector<long> \fBauth_cookies\fP"
477 .PP
478 Definition at line 112 of file modules.cpp.
479 .SS "int \fBboundPortCount\fP"
480 .PP
481 Definition at line 106 of file modules.cpp.
482 .SS "\fBchan_hash\fP \fBchanlist\fP"
483 .PP
484 Definition at line 193 of file modules.cpp.
485 .SS "\fBuser_hash\fP \fBclientlist\fP"
486 .PP
487 Definition at line 192 of file modules.cpp.
488 .SS "\fBcommand_table\fP \fBcmdlist\fP"
489 .PP
490 Definition at line 195 of file modules.cpp.
491 .SS "std::stringstream \fBconfig_f\fP"
492 .PP
493 Definition at line 113 of file modules.cpp.
494 .SS "int \fBdebugging\fP"
495 .PP
496 Definition at line 94 of file modules.cpp.
497 .SS "int \fBdefaultRoute\fP"
498 .PP
499 Definition at line 110 of file modules.cpp.
500 .SS "int \fBDieDelay\fP"
501 .PP
502 Definition at line 97 of file modules.cpp.
503 .SS "char \fBdiepass\fP[MAXBUF]"
504 .PP
505 Definition at line 86 of file modules.cpp.
506 .SS "char \fBDieValue\fP[MAXBUF]"
507 .PP
508 Definition at line 92 of file modules.cpp.
509 .SS "\fBExtModeList\fP \fBEMode\fP"
510 .PP
511 Definition at line 219 of file modules.cpp.
512 .PP
513 Referenced by DoAddExtendedMode(), ModeDefined(), ModeDefinedOff(), ModeDefinedOn(), ModeDefinedOper(), ModeIsListMode(), and ModeMakeList().
514 .SS "std::vector<\fBircd_module\fP*> factory"
515 .PP
516 Definition at line 75 of file modules.cpp.
517 .SS "std::vector<int> \fBfd_reap\fP"
518 .PP
519 Definition at line 103 of file modules.cpp.
520 .SS "\fBuserrec\fP* \fBfd_ref_table\fP[65536]"
521 .PP
522 Definition at line 119 of file modules.cpp.
523 .PP
524 Referenced by Server::FindDescriptor(), and Server::PseudoToUser().
525 .SS "\fBaddress_cache\fP \fBIP\fP"
526 .PP
527 Definition at line 198 of file modules.cpp.
528 .SS "char \fBlist\fP[MAXBUF]"
529 .PP
530 Definition at line 90 of file modules.cpp.
531 .SS "FILE* \fBlog_file\fP"
532 .PP
533 Definition at line 117 of file modules.cpp.
534 .SS "int \fBLogLevel\fP"
535 .PP
536 Definition at line 79 of file modules.cpp.
537 .SS "int \fBMaxWhoResults\fP"
538 .PP
539 Definition at line 100 of file modules.cpp.
540 .SS "\fBserverrec\fP* \fBme\fP[32]"
541 .PP
542 Definition at line 115 of file modules.cpp.
543 .SS "int \fBMODCOUNT\fP = -1"
544 .PP
545 Definition at line 1067 of file modules.cpp.
546 .SS "std::vector<std::string> \fBmodule_names\fP"
547 .PP
548 Definition at line 104 of file modules.cpp.
549 .SS "std::vector<\fBModule\fP*> modules"
550 .PP
551 Definition at line 74 of file modules.cpp.
552 .SS "\fBfile_cache\fP \fBMOTD\fP"
553 .PP
554 Definition at line 196 of file modules.cpp.
555 .SS "char \fBmotd\fP[MAXBUF]"
556 .PP
557 Definition at line 88 of file modules.cpp.
558 .SS "time_t \fBnb_start\fP"
559 .PP
560 Definition at line 101 of file modules.cpp.
561 .SS "int \fBNetBufferSize\fP"
562 .PP
563 Definition at line 99 of file modules.cpp.
564 .SS "char \fBNetwork\fP[MAXBUF]"
565 .PP
566 Definition at line 81 of file modules.cpp.
567 .SS "int \fBportCount\fP"
568 .PP
569 Definition at line 107 of file modules.cpp.
570 .SS "int \fBports\fP[MAXSOCKS]"
571 .PP
572 Definition at line 109 of file modules.cpp.
573 .SS "char \fBPrefixQuit\fP[MAXBUF]"
574 .PP
575 Definition at line 91 of file modules.cpp.
576 .SS "char \fBrestartpass\fP[MAXBUF]"
577 .PP
578 Definition at line 87 of file modules.cpp.
579 .SS "\fBfile_cache\fP \fBRULES\fP"
580 .PP
581 Definition at line 197 of file modules.cpp.
582 .SS "char \fBrules\fP[MAXBUF]"
583 .PP
584 Definition at line 89 of file modules.cpp.
585 .SS "char \fBServerDesc\fP[MAXBUF]"
586 .PP
587 Definition at line 82 of file modules.cpp.
588 .SS "char \fBServerName\fP[MAXBUF]"
589 .PP
590 Definition at line 80 of file modules.cpp.
591 .SS "int \fBSERVERportCount\fP"
592 .PP
593 Definition at line 108 of file modules.cpp.
594 .SS "time_t \fBstartup_time\fP"
595 .PP
596 Definition at line 98 of file modules.cpp.
597 .SS "time_t \fBTIME\fP"
598 .PP
599 Definition at line 77 of file modules.cpp.
600 .SS "\fBwhowas_hash\fP \fBwhowas\fP"
601 .PP
602 Definition at line 194 of file modules.cpp.
603 .SS "int \fBWHOWAS_MAX\fP"
604 .PP
605 Definition at line 96 of file modules.cpp.
606 .SS "int \fBWHOWAS_STALE\fP"
607 .PP
608 Definition at line 95 of file modules.cpp.
609 .SH "Author"
610 .PP 
611 Generated automatically by Doxygen for InspIRCd from the source code.