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
|
<!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.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3-rc2 -->
<center>
<a class="qindex" href="main.html">Main Page</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.h</h1><a href="modules_8h.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">$Log$
00003 <span class="comment">Revision 1.3 2003/01/26 23:52:48 brain
00003 <span class="comment">Modified documentation for base classes
00003 <span class="comment"></span>
00004 <span class="comment">Revision 1.1.1.1 2003/01/23 19:45:58 brain</span>
00005 <span class="comment">InspIRCd second source tree</span>
00006 <span class="comment"></span>
00007 <span class="comment">Revision 1.12 2003/01/22 20:59:10 brain</span>
00008 <span class="comment">Added FileReader class documentation</span>
00009 <span class="comment"></span>
00010 <span class="comment">Revision 1.11 2003/01/22 20:49:16 brain</span>
00011 <span class="comment">Added FileReader file-caching class</span>
00012 <span class="comment">Changed m_randquote to use FileReader class</span>
00013 <span class="comment"></span>
00014 <span class="comment">Revision 1.10 2003/01/22 00:57:27 brain</span>
00015 <span class="comment">Changes to documentation</span>
00016 <span class="comment"></span>
00017 <span class="comment">Revision 1.9 2003/01/22 00:44:26 brain</span>
00018 <span class="comment">Added documentation comments</span>
00019 <span class="comment"></span>
00020 <span class="comment">Revision 1.8 2003/01/21 20:31:24 brain</span>
00021 <span class="comment">Modified to add documentation</span>
00022 <span class="comment">Added ConfigReader class for modules</span>
00023 <span class="comment"></span>
00024 <span class="comment">Revision 1.7 2003/01/15 22:47:44 brain</span>
00025 <span class="comment">Changed user and channel structs to classes (finally)</span>
00026 <span class="comment"></span>
00027 <span class="comment">Revision 1.6 2003/01/13 22:30:50 brain</span>
00028 <span class="comment">Added Admin class (holds /admin info for modules)</span>
00029 <span class="comment">Added methods to Server class</span>
00030 <span class="comment"></span>
00031 <span class="comment"></span>
00032 <span class="comment">*/</span>
00033
00034
00035 <span class="preprocessor">#ifndef __PLUGIN_H</span>
00036 <span class="preprocessor"></span><span class="preprocessor">#define __PLUGIN_H</span>
00037 <span class="preprocessor"></span>
00038 <span class="preprocessor">#include "dynamic.h"</span>
00039 <span class="preprocessor">#include "<a class="code" href="base_8h.html">base.h</a>"</span>
00040 <span class="preprocessor">#include <string></span>
00041 <span class="preprocessor">#include <deque></span>
00042
<a name="l00045"></a><a class="code" href="modules_8h.html#a1">00045</a> <span class="keyword">typedef</span> deque<string> <a class="code" href="modules_8h.html#a1">file_cache</a>;
00046
00047
00048 <span class="comment">// This #define allows us to call a method in all</span>
00049 <span class="comment">// loaded modules in a readable simple way, e.g.:</span>
00050 <span class="comment">// 'FOREACH_MOD OnConnect(user);'</span>
00051
<a name="l00052"></a><a class="code" href="modules_8h.html#a0">00052</a> <span class="preprocessor">#define FOREACH_MOD for (int i = 0; i <= MODCOUNT; i++) modules[i]-></span>
00053 <span class="preprocessor"></span>
00054 <span class="comment">// class Version holds the version information of a Module, returned</span>
00055 <span class="comment">// by Module::GetVersion (thanks RD)</span>
00056
<a name="l00061"></a><a class="code" href="classVersion.html">00061</a> <span class="keyword">class </span><a class="code" href="classVersion.html">Version</a> : <span class="keyword">public</span> <a class="code" href="classclassbase.html">classbase</a>
00062 {
00063 <span class="keyword">public</span>:
<a name="l00064"></a><a class="code" href="classVersion.html#m2">00064</a> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="classVersion.html#m0">Major</a>, <a class="code" href="classVersion.html#m1">Minor</a>, <a class="code" href="classVersion.html#m2">Revision</a>, <a class="code" href="classVersion.html#m3">Build</a>;
00065 <a class="code" href="classVersion.html#a0">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);
00066 };
00067
00068
<a name="l00074"></a><a class="code" href="classAdmin.html">00074</a> <span class="keyword">class </span><a class="code" href="classAdmin.html">Admin</a> : <span class="keyword">public</span> <a class="code" href="classclassbase.html">classbase</a>
00075 {
00076 <span class="keyword">public</span>:
<a name="l00077"></a><a class="code" href="classAdmin.html#m2">00077</a> <span class="keyword">const</span> string <a class="code" href="classAdmin.html#m0">Name</a>, <a class="code" href="classAdmin.html#m1">Email</a>, <a class="code" href="classAdmin.html#m2">Nick</a>;
00078 <a class="code" href="classAdmin.html#a0">Admin</a>(string name,string email,string nick);
00079 };
00080
<a name="l00086"></a><a class="code" href="classModule.html">00086</a> <span class="keyword">class </span><a class="code" href="classModule.html">Module</a> : <span class="keyword">public</span> <a class="code" href="classclassbase.html">classbase</a>
00087 {
00088 <span class="keyword">public</span>:
00092 <a class="code" href="classModule.html#a0">Module</a>();
00096 <span class="keyword">virtual</span> <a class="code" href="classModule.html#a1">~Module</a>();
00101 <span class="keyword">virtual</span> <a class="code" href="classVersion.html">Version</a> <a class="code" href="classModule.html#a2">GetVersion</a>();
00105 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a3">OnUserConnect</a>(<a class="code" href="classuserrec.html">userrec</a>* user);
00109 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a4">OnUserQuit</a>(<a class="code" href="classuserrec.html">userrec</a>* user);
00114 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a5">OnUserJoin</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* channel);
00119 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a6">OnUserPart</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* channel);
00120 };
00121
00122
<a name="l00128"></a><a class="code" href="classServer.html">00128</a> <span class="keyword">class </span><a class="code" href="classServer.html">Server</a> : <span class="keyword">public</span> <a class="code" href="classclassbase.html">classbase</a>
00129 {
00130 <span class="keyword">public</span>:
00134 <a class="code" href="classServer.html#a0">Server</a>();
00138 <span class="keyword">virtual</span> <a class="code" href="classServer.html#a1">~Server</a>();
00139
00143 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a2">SendOpers</a>(string s);
00148 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a3">Debug</a>(string s);
00153 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a4">Send</a>(<span class="keywordtype">int</span> Socket, string s);
00158 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a5">SendServ</a>(<span class="keywordtype">int</span> Socket, string s);
00163 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a6">SendFrom</a>(<span class="keywordtype">int</span> Socket, <a class="code" href="classuserrec.html">userrec</a>* User, string s);
00168 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a7">SendTo</a>(<a class="code" href="classuserrec.html">userrec</a>* Source, <a class="code" href="classuserrec.html">userrec</a>* Dest, string s);
00175 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a8">SendChannel</a>(<a class="code" href="classuserrec.html">userrec</a>* User, <a class="code" href="classchanrec.html">chanrec</a>* Channel, string s,<span class="keywordtype">bool</span> IncludeSender);
00180 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a9">CommonChannels</a>(<a class="code" href="classuserrec.html">userrec</a>* u1, <a class="code" href="classuserrec.html">userrec</a>* u2);
00188 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a10">SendCommon</a>(<a class="code" href="classuserrec.html">userrec</a>* User, string text,<span class="keywordtype">bool</span> IncludeSender);
00193 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a11">SendWallops</a>(<a class="code" href="classuserrec.html">userrec</a>* User, string text);
00194
00198 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a12">IsNick</a>(string nick);
00202 <span class="keyword">virtual</span> <a class="code" href="classuserrec.html">userrec</a>* <a class="code" href="classServer.html#a13">FindNick</a>(string nick);
00206 <span class="keyword">virtual</span> <a class="code" href="classchanrec.html">chanrec</a>* <a class="code" href="classServer.html#a14">FindChannel</a>(string channel);
00211 <span class="keyword">virtual</span> string <a class="code" href="classServer.html#a15">ChanMode</a>(<a class="code" href="classuserrec.html">userrec</a>* User, <a class="code" href="classchanrec.html">chanrec</a>* Chan);
00214 <span class="keyword">virtual</span> string <a class="code" href="classServer.html#a16">GetServerName</a>();
00217 <span class="keyword">virtual</span> string <a class="code" href="classServer.html#a17">GetNetworkName</a>();
00223 <span class="keyword">virtual</span> <a class="code" href="classAdmin.html">Admin</a> <a class="code" href="classServer.html#a18">GetAdmin</a>();
00224
00225 };
00226
<a name="l00233"></a><a class="code" href="classConfigReader.html">00233</a> <span class="keyword">class </span><a class="code" href="classConfigReader.html">ConfigReader</a> : <span class="keyword">public</span> <a class="code" href="classclassbase.html">classbase</a>
00234 {
00235 <span class="keyword">protected</span>:
<a name="l00238"></a><a class="code" href="classConfigReader.html#n0">00238</a> string <a class="code" href="classConfigReader.html#n0">fname</a>;
00239 <span class="keyword">public</span>:
00244 <a class="code" href="classConfigReader.html#a0">ConfigReader</a>(); <span class="comment">// default constructor reads ircd.conf</span>
00248 <span class="comment"></span> <a class="code" href="classConfigReader.html#a0">ConfigReader</a>(string filename); <span class="comment">// read a module-specific config</span>
00252 <span class="comment"></span> <a class="code" href="classConfigReader.html#a2">~ConfigReader</a>();
00257 string <a class="code" href="classConfigReader.html#a3">ReadValue</a>(string tag, string name, <span class="keywordtype">int</span> index);
00264 <span class="keywordtype">int</span> <a class="code" href="classConfigReader.html#a4">Enumerate</a>(string tag);
00268 <span class="keywordtype">bool</span> <a class="code" href="classConfigReader.html#a5">Verify</a>();
00269 };
00270
00271
00272
<a name="l00278"></a><a class="code" href="classFileReader.html">00278</a> <span class="keyword">class </span><a class="code" href="classFileReader.html">FileReader</a> : <span class="keyword">public</span> <a class="code" href="classclassbase.html">classbase</a>
00279 {
<a name="l00280"></a><a class="code" href="classFileReader.html#o0">00280</a> <a class="code" href="modules_8h.html#a1">file_cache</a> <a class="code" href="classFileReader.html#o0">fc</a>;
00281 <span class="keyword">public</span>:
00286 <a class="code" href="classFileReader.html#a0">FileReader</a>();
00292 <a class="code" href="classFileReader.html#a0">FileReader</a>(string filename);
00296 <a class="code" href="classFileReader.html#a2">~FileReader</a>();
00302 <span class="keywordtype">void</span> <a class="code" href="classFileReader.html#a3">LoadFile</a>(string filename);
00307 string <a class="code" href="classFileReader.html#a4">GetLine</a>(<span class="keywordtype">int</span> x);
00313 <span class="keywordtype">int</span> <a class="code" href="classFileReader.html#a5">FileSize</a>();
00314 };
00315
00316
<a name="l00323"></a><a class="code" href="classModuleFactory.html">00323</a> <span class="keyword">class </span><a class="code" href="classModuleFactory.html">ModuleFactory</a> : <span class="keyword">public</span> <a class="code" href="classclassbase.html">classbase</a>
00324 {
00325 <span class="keyword">public</span>:
<a name="l00326"></a><a class="code" href="classModuleFactory.html#a0">00326</a> <a class="code" href="classModuleFactory.html#a0">ModuleFactory</a>() { }
<a name="l00327"></a><a class="code" href="classModuleFactory.html#a1">00327</a> <span class="keyword">virtual</span> <a class="code" href="classModuleFactory.html#a1">~ModuleFactory</a>() { }
00332 <span class="keyword">virtual</span> <a class="code" href="classModule.html">Module</a> * <a class="code" href="classModuleFactory.html#a2">CreateModule</a>() = 0;
00333 };
00334
00335 <span class="preprocessor">#endif</span>
</pre></div><hr><address style="align: right;"><small>Generated on Sun Jan 26 23:45:47 2003 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-rc2 </small></address>
</body>
</html>
|