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