]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - docs/module-doc/classchanrec.html
Added docs for new smaller memory footprint classes
[user/henk/code/inspircd.git] / docs / module-doc / classchanrec.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3 <title>InspIRCd: chanrec class Reference</title>
4 <link href="inspircd.css" rel="stylesheet" type="text/css">
5 </head><body>
6 <!-- Generated by Doxygen 1.3.3 -->
7 <div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Compound&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Compound&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
8 <h1>chanrec Class Reference</h1>Holds all relevent information for a channel.  
9 <a href="#_details">More...</a>
10 <p>
11 <code>#include &lt;<a class="el" href="channels_8h-source.html">channels.h</a>&gt;</code>
12 <p>
13 Inherits <a class="el" href="classExtensible.html">Extensible</a>.
14 <p>
15 <a href="classchanrec-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
16 <tr><td></td></tr>
17 <tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
18 <tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a0">SetCustomMode</a> (char mode, bool mode_on)</td></tr>
19
20 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets or unsets a custom mode in the channels info. </em> <a href="#a0"></a><em><br><br></td></tr>
21 <tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a1">SetCustomModeParam</a> (char mode, char *parameter, bool mode_on)</td></tr>
22
23 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets or unsets the parameters for a custom mode in a channels info. </em> <a href="#a1"></a><em><br><br></td></tr>
24 <tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a2">IsCustomModeSet</a> (char mode)</td></tr>
25
26 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns true if a custom mode is set on a channel. </em> <a href="#a2"></a><em><br><br></td></tr>
27 <tr><td class="memItemLeft" nowrap align=right valign=top>std::string&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a3">GetModeParameter</a> (char mode)</td></tr>
28
29 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the parameter for a custom mode on a channel. </em> <a href="#a3"></a><em><br><br></td></tr>
30 <tr><td class="memItemLeft" nowrap align=right valign=top>long&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a4">GetUserCounter</a> ()</td></tr>
31
32 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Obtain the channel "user counter" This returns the channel reference counter, which is initialized to 0 when the channel is created and incremented/decremented upon joins, parts quits and kicks. </em> <a href="#a4"></a><em><br><br></td></tr>
33 <tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a5">AddUser</a> (char *castuser)</td></tr>
34
35 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Add a user pointer to the internal reference list The data inserted into the reference list is a table as it is an arbitary pointer compared to other users by its memory address, as this is a very fast 32 or 64 bit integer comparison. </em> <a href="#a5"></a><em><br><br></td></tr>
36 <tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a6">DelUser</a> (char *castuser)</td></tr>
37
38 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Delete a user pointer to the internal reference list The data removed from the reference list is a table as it is an arbitary pointer compared to other users by its memory address, as this is a very fast 32 or 64 bit integer comparison. </em> <a href="#a6"></a><em><br><br></td></tr>
39 <tr><td class="memItemLeft" nowrap align=right valign=top>std::vector&lt; char * &gt; *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a7">GetUsers</a> ()</td></tr>
40
41 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Obrain the internal reference list The internal reference list contains a list of userrec* cast to char*. </em> <a href="#a7"></a><em><br><br></td></tr>
42 <tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a8">chanrec</a> ()</td></tr>
43
44 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creates a channel record and initialises it with default values. </em> <a href="#a8"></a><em><br><br></td></tr>
45 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a9">~chanrec</a> ()</td></tr>
46
47 <tr><td colspan=2><br><h2>Public Attributes</h2></td></tr>
48 <tr><td class="memItemLeft" nowrap align=right valign=top>char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o0">name</a> [CHANMAX]</td></tr>
49
50 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The channels name. </em> <a href="#o0"></a><em><br><br></td></tr>
51 <tr><td class="memItemLeft" nowrap align=right valign=top>char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o1">custom_modes</a> [MAXMODES]</td></tr>
52
53 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Custom modes for the channel. </em> <a href="#o1"></a><em><br><br></td></tr>
54 <tr><td class="memItemLeft" nowrap align=right valign=top>std::vector&lt; char * &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o2">internal_userlist</a></td></tr>
55
56 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">User list (casted to char*'s to stop forward declaration stuff) (chicken and egg scenario!). </em> <a href="#o2"></a><em><br><br></td></tr>
57 <tr><td class="memItemLeft" nowrap align=right valign=top>char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o3">topic</a> [MAXBUF]</td></tr>
58
59 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Channel topic. </em> <a href="#o3"></a><em><br><br></td></tr>
60 <tr><td class="memItemLeft" nowrap align=right valign=top>time_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o4">created</a></td></tr>
61
62 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creation time. </em> <a href="#o4"></a><em><br><br></td></tr>
63 <tr><td class="memItemLeft" nowrap align=right valign=top>time_t&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o5">topicset</a></td></tr>
64
65 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Time topic was set. </em> <a href="#o5"></a><em><br><br></td></tr>
66 <tr><td class="memItemLeft" nowrap align=right valign=top>char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o6">setby</a> [NICKMAX]</td></tr>
67
68 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The last user to set the topic. </em> <a href="#o6"></a><em><br><br></td></tr>
69 <tr><td class="memItemLeft" nowrap align=right valign=top>short int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o7">limit</a></td></tr>
70
71 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Contains the channel user limit. </em> <a href="#o7"></a><em><br><br></td></tr>
72 <tr><td class="memItemLeft" nowrap align=right valign=top>char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o8">key</a> [32]</td></tr>
73
74 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Contains the channel key. </em> <a href="#o8"></a><em><br><br></td></tr>
75 <tr><td class="memItemLeft" nowrap align=right valign=top>char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o9">binarymodes</a></td></tr>
76
77 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Contains a bitmask of the CM_* builtin (RFC) binary mode symbols. </em> <a href="#o9"></a><em><br><br></td></tr>
78 <tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="channels_8h.html#a11">BanList</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o10">bans</a></td></tr>
79
80 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The list of all bans set on the channel. </em> <a href="#o10"></a><em><br><br></td></tr>
81 </table>
82 <hr><a name="_details"></a><h2>Detailed Description</h2>
83 Holds all relevent information for a channel. 
84 <p>
85 This class represents a channel, and contains its name, modes, time created, topic, topic set time, etc, and an instance of the BanList type. 
86 <p>
87
88 <p>
89 Definition at line <a class="el" href="channels_8h-source.html#l00101">101</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.<hr><h2>Constructor &amp; Destructor Documentation</h2>
90 <a name="a8" doxytag="chanrec::chanrec"></a><p>
91 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
92   <tr>
93     <td class="mdRow">
94       <table cellpadding="0" cellspacing="0" border="0">
95         <tr>
96           <td class="md" nowrap valign="top"> chanrec::chanrec </td>
97           <td class="md" valign="top">(&nbsp;</td>
98           <td class="mdname1" valign="top" nowrap>          </td>
99           <td class="md" valign="top">&nbsp;)&nbsp;</td>
100           <td class="md" nowrap></td>
101         </tr>
102
103       </table>
104     </td>
105   </tr>
106 </table>
107 <table cellspacing=5 cellpadding=0 border=0>
108   <tr>
109     <td>
110       &nbsp;
111     </td>
112     <td>
113
114 <p>
115 Creates a channel record and initialises it with default values. 
116 <p>
117
118 <p>
119 Definition at line <a class="el" href="channels_8cpp-source.html#l00113">113</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
120 <p>
121 References <a class="el" href="channels_8h-source.html#l00145">binarymodes</a>, <a class="el" href="channels_8h-source.html#l00123">created</a>, <a class="el" href="channels_8h-source.html#l00110">custom_modes</a>, <a class="el" href="channels_8h-source.html#l00115">internal_userlist</a>, <a class="el" href="channels_8h-source.html#l00141">key</a>, <a class="el" href="channels_8h-source.html#l00136">limit</a>, <a class="el" href="channels_8h-source.html#l00106">name</a>, <a class="el" href="channels_8h-source.html#l00131">setby</a>, <a class="el" href="channels_8h-source.html#l00120">topic</a>, and <a class="el" href="channels_8h-source.html#l00127">topicset</a>.
122 <p>
123 <div class="fragment"><pre>00114 {
124 00115         strcpy(name,<span class="stringliteral">""</span>);
125 00116         strcpy(custom_modes,<span class="stringliteral">""</span>);
126 00117         strcpy(topic,<span class="stringliteral">""</span>);
127 00118         strcpy(setby,<span class="stringliteral">""</span>);
128 00119         strcpy(key,<span class="stringliteral">""</span>);
129 00120         <a class="code" href="classchanrec.html#o4">created</a> = <a class="code" href="classchanrec.html#o5">topicset</a> = <a class="code" href="classchanrec.html#o7">limit</a> = 0;
130 00121         <a class="code" href="classchanrec.html#o9">binarymodes</a> = 0;
131 00122         <a class="code" href="classchanrec.html#o2">internal_userlist</a>.clear();
132 00123 }
133 </pre></div>    </td>
134   </tr>
135 </table>
136 <a name="a9" doxytag="chanrec::~chanrec"></a><p>
137 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
138   <tr>
139     <td class="mdRow">
140       <table cellpadding="0" cellspacing="0" border="0">
141         <tr>
142           <td class="md" nowrap valign="top"> virtual chanrec::~<a class="el" href="classchanrec.html">chanrec</a> </td>
143           <td class="md" valign="top">(&nbsp;</td>
144           <td class="mdname1" valign="top" nowrap>          </td>
145           <td class="md" valign="top">&nbsp;)&nbsp;</td>
146           <td class="md" nowrap><code> [inline, virtual]</code></td>
147         </tr>
148
149       </table>
150     </td>
151   </tr>
152 </table>
153 <table cellspacing=5 cellpadding=0 border=0>
154   <tr>
155     <td>
156       &nbsp;
157     </td>
158     <td>
159
160 <p>
161
162 <p>
163 Definition at line <a class="el" href="channels_8h-source.html#l00205">205</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
164 <p>
165 <div class="fragment"><pre>00205 { <span class="comment">/* stub */</span> }
166 </pre></div>    </td>
167   </tr>
168 </table>
169 <hr><h2>Member Function Documentation</h2>
170 <a name="a5" doxytag="chanrec::AddUser"></a><p>
171 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
172   <tr>
173     <td class="mdRow">
174       <table cellpadding="0" cellspacing="0" border="0">
175         <tr>
176           <td class="md" nowrap valign="top"> void chanrec::AddUser </td>
177           <td class="md" valign="top">(&nbsp;</td>
178           <td class="md" nowrap valign="top">char *&nbsp;</td>
179           <td class="mdname1" valign="top" nowrap> <em>castuser</em>          </td>
180           <td class="md" valign="top">&nbsp;)&nbsp;</td>
181           <td class="md" nowrap></td>
182         </tr>
183
184       </table>
185     </td>
186   </tr>
187 </table>
188 <table cellspacing=5 cellpadding=0 border=0>
189   <tr>
190     <td>
191       &nbsp;
192     </td>
193     <td>
194
195 <p>
196 Add a user pointer to the internal reference list The data inserted into the reference list is a table as it is an arbitary pointer compared to other users by its memory address, as this is a very fast 32 or 64 bit integer comparison. 
197 <p>
198
199 <p>
200 Definition at line <a class="el" href="channels_8cpp-source.html#l00207">207</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
201 <p>
202 References <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, and <a class="el" href="channels_8h-source.html#l00115">internal_userlist</a>.
203 <p>
204 <div class="fragment"><pre>00208 {
205 00209         <a class="code" href="classchanrec.html#o2">internal_userlist</a>.push_back(castuser);
206 00210         log(DEBUG,<span class="stringliteral">"Added casted user to channel's internal list"</span>);
207 00211 }
208 </pre></div>    </td>
209   </tr>
210 </table>
211 <a name="a6" doxytag="chanrec::DelUser"></a><p>
212 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
213   <tr>
214     <td class="mdRow">
215       <table cellpadding="0" cellspacing="0" border="0">
216         <tr>
217           <td class="md" nowrap valign="top"> void chanrec::DelUser </td>
218           <td class="md" valign="top">(&nbsp;</td>
219           <td class="md" nowrap valign="top">char *&nbsp;</td>
220           <td class="mdname1" valign="top" nowrap> <em>castuser</em>          </td>
221           <td class="md" valign="top">&nbsp;)&nbsp;</td>
222           <td class="md" nowrap></td>
223         </tr>
224
225       </table>
226     </td>
227   </tr>
228 </table>
229 <table cellspacing=5 cellpadding=0 border=0>
230   <tr>
231     <td>
232       &nbsp;
233     </td>
234     <td>
235
236 <p>
237 Delete a user pointer to the internal reference list The data removed from the reference list is a table as it is an arbitary pointer compared to other users by its memory address, as this is a very fast 32 or 64 bit integer comparison. 
238 <p>
239
240 <p>
241 Definition at line <a class="el" href="channels_8cpp-source.html#l00213">213</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
242 <p>
243 References <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, <a class="el" href="channels_8h-source.html#l00115">internal_userlist</a>, and <a class="el" href="channels_8h-source.html#l00106">name</a>.
244 <p>
245 <div class="fragment"><pre>00214 {
246 00215         <span class="keywordflow">for</span> (std::vector&lt;char*&gt;::iterator a = <a class="code" href="classchanrec.html#o2">internal_userlist</a>.begin(); a &lt; <a class="code" href="classchanrec.html#o2">internal_userlist</a>.end(); a++)
247 00216         {
248 00217                 <span class="keywordflow">if</span> (*a == castuser)
249 00218                 {
250 00219                         log(DEBUG,<span class="stringliteral">"Removed casted user from channel's internal list"</span>);
251 00220                         <a class="code" href="classchanrec.html#o2">internal_userlist</a>.erase(a);
252 00221                         <span class="keywordflow">return</span>;
253 00222                 }
254 00223         }
255 00224         log(DEBUG,<span class="stringliteral">"BUG BUG BUG! Attempt to remove an uncasted user from the internal list of %s!"</span>,name);
256 00225 }
257 </pre></div>    </td>
258   </tr>
259 </table>
260 <a name="a3" doxytag="chanrec::GetModeParameter"></a><p>
261 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
262   <tr>
263     <td class="mdRow">
264       <table cellpadding="0" cellspacing="0" border="0">
265         <tr>
266           <td class="md" nowrap valign="top"> std::string chanrec::GetModeParameter </td>
267           <td class="md" valign="top">(&nbsp;</td>
268           <td class="md" nowrap valign="top">char&nbsp;</td>
269           <td class="mdname1" valign="top" nowrap> <em>mode</em>          </td>
270           <td class="md" valign="top">&nbsp;)&nbsp;</td>
271           <td class="md" nowrap></td>
272         </tr>
273
274       </table>
275     </td>
276   </tr>
277 </table>
278 <table cellspacing=5 cellpadding=0 border=0>
279   <tr>
280     <td>
281       &nbsp;
282     </td>
283     <td>
284
285 <p>
286 Returns the parameter for a custom mode on a channel. 
287 <p>
288 For example if "+L #foo" is set, and you pass this method 'L', it will return '#foo'. If the mode is not set on the channel, or the mode has no parameters associated with it, it will return an empty string.
289 <p>
290 Definition at line <a class="el" href="channels_8cpp-source.html#l00187">187</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
291 <p>
292 References <a class="el" href="channels_8cpp-source.html#l00111">custom_mode_params</a>.
293 <p>
294 <div class="fragment"><pre>00188 {
295 00189         <span class="keywordflow">if</span> (<a class="code" href="channels_8cpp.html#a38">custom_mode_params</a>.size())
296 00190         {
297 00191                 <span class="keywordflow">for</span> (vector&lt;ModeParameter&gt;::iterator i = <a class="code" href="channels_8cpp.html#a38">custom_mode_params</a>.begin(); i &lt; <a class="code" href="channels_8cpp.html#a38">custom_mode_params</a>.end(); i++)
298 00192                 {
299 00193                         <span class="keywordflow">if</span> ((i-&gt;mode == mode) &amp;&amp; (!strcasecmp(this-&gt;name,i-&gt;channel)))
300 00194                         {
301 00195                                 <span class="keywordflow">return</span> i-&gt;parameter;
302 00196                         }
303 00197                 }
304 00198         }
305 00199         <span class="keywordflow">return</span> <span class="stringliteral">""</span>;
306 00200 }
307 </pre></div>    </td>
308   </tr>
309 </table>
310 <a name="a4" doxytag="chanrec::GetUserCounter"></a><p>
311 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
312   <tr>
313     <td class="mdRow">
314       <table cellpadding="0" cellspacing="0" border="0">
315         <tr>
316           <td class="md" nowrap valign="top"> long chanrec::GetUserCounter </td>
317           <td class="md" valign="top">(&nbsp;</td>
318           <td class="mdname1" valign="top" nowrap>          </td>
319           <td class="md" valign="top">&nbsp;)&nbsp;</td>
320           <td class="md" nowrap></td>
321         </tr>
322
323       </table>
324     </td>
325   </tr>
326 </table>
327 <table cellspacing=5 cellpadding=0 border=0>
328   <tr>
329     <td>
330       &nbsp;
331     </td>
332     <td>
333
334 <p>
335 Obtain the channel "user counter" This returns the channel reference counter, which is initialized to 0 when the channel is created and incremented/decremented upon joins, parts quits and kicks. 
336 <p>
337
338 <p>
339 Definition at line <a class="el" href="channels_8cpp-source.html#l00202">202</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
340 <p>
341 References <a class="el" href="channels_8h-source.html#l00115">internal_userlist</a>.
342 <p>
343 <div class="fragment"><pre>00203 {
344 00204         <span class="keywordflow">return</span> (this-&gt;<a class="code" href="classchanrec.html#o2">internal_userlist</a>.size());
345 00205 }
346 </pre></div>    </td>
347   </tr>
348 </table>
349 <a name="a7" doxytag="chanrec::GetUsers"></a><p>
350 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
351   <tr>
352     <td class="mdRow">
353       <table cellpadding="0" cellspacing="0" border="0">
354         <tr>
355           <td class="md" nowrap valign="top"> std::vector&lt; char * &gt; * chanrec::GetUsers </td>
356           <td class="md" valign="top">(&nbsp;</td>
357           <td class="mdname1" valign="top" nowrap>          </td>
358           <td class="md" valign="top">&nbsp;)&nbsp;</td>
359           <td class="md" nowrap></td>
360         </tr>
361
362       </table>
363     </td>
364   </tr>
365 </table>
366 <table cellspacing=5 cellpadding=0 border=0>
367   <tr>
368     <td>
369       &nbsp;
370     </td>
371     <td>
372
373 <p>
374 Obrain the internal reference list The internal reference list contains a list of userrec* cast to char*. 
375 <p>
376 These are used for rapid comparison to determine channel membership for PRIVMSG, NOTICE, QUIT, PART etc. The resulting pointer to the vector should be considered readonly and only modified via AddUser and DelUser.
377 <p>
378 Definition at line <a class="el" href="channels_8cpp-source.html#l00227">227</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
379 <p>
380 References <a class="el" href="channels_8h-source.html#l00115">internal_userlist</a>.
381 <p>
382 Referenced by <a class="el" href="modules_8cpp-source.html#l00467">Server::GetUsers()</a>.
383 <p>
384 <div class="fragment"><pre>00228 {
385 00229         <span class="keywordflow">return</span> &amp;<a class="code" href="classchanrec.html#o2">internal_userlist</a>;
386 00230 }
387 </pre></div>    </td>
388   </tr>
389 </table>
390 <a name="a2" doxytag="chanrec::IsCustomModeSet"></a><p>
391 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
392   <tr>
393     <td class="mdRow">
394       <table cellpadding="0" cellspacing="0" border="0">
395         <tr>
396           <td class="md" nowrap valign="top"> bool chanrec::IsCustomModeSet </td>
397           <td class="md" valign="top">(&nbsp;</td>
398           <td class="md" nowrap valign="top">char&nbsp;</td>
399           <td class="mdname1" valign="top" nowrap> <em>mode</em>          </td>
400           <td class="md" valign="top">&nbsp;)&nbsp;</td>
401           <td class="md" nowrap></td>
402         </tr>
403
404       </table>
405     </td>
406   </tr>
407 </table>
408 <table cellspacing=5 cellpadding=0 border=0>
409   <tr>
410     <td>
411       &nbsp;
412     </td>
413     <td>
414
415 <p>
416 Returns true if a custom mode is set on a channel. 
417 <p>
418
419 <p>
420 Definition at line <a class="el" href="channels_8cpp-source.html#l00181">181</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
421 <p>
422 References <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>.
423 <p>
424 <div class="fragment"><pre>00182 {
425 00183         log(DEBUG,<span class="stringliteral">"Checking ISCustomModeSet: %c %s"</span>,mode,this-&gt;custom_modes);
426 00184         <span class="keywordflow">return</span> (strchr(this-&gt;custom_modes,mode) != 0);
427 00185 }
428 </pre></div>    </td>
429   </tr>
430 </table>
431 <a name="a0" doxytag="chanrec::SetCustomMode"></a><p>
432 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
433   <tr>
434     <td class="mdRow">
435       <table cellpadding="0" cellspacing="0" border="0">
436         <tr>
437           <td class="md" nowrap valign="top"> void chanrec::SetCustomMode </td>
438           <td class="md" valign="top">(&nbsp;</td>
439           <td class="md" nowrap valign="top">char&nbsp;</td>
440           <td class="mdname" nowrap> <em>mode</em>, </td>
441         </tr>
442         <tr>
443           <td></td>
444           <td></td>
445           <td class="md" nowrap>bool&nbsp;</td>
446           <td class="mdname" nowrap> <em>mode_on</em></td>
447         </tr>
448         <tr>
449           <td></td>
450           <td class="md">)&nbsp;</td>
451           <td class="md" colspan="2"></td>
452         </tr>
453
454       </table>
455     </td>
456   </tr>
457 </table>
458 <table cellspacing=5 cellpadding=0 border=0>
459   <tr>
460     <td>
461       &nbsp;
462     </td>
463     <td>
464
465 <p>
466 Sets or unsets a custom mode in the channels info. 
467 <p>
468
469 <p>
470 Definition at line <a class="el" href="channels_8cpp-source.html#l00125">125</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
471 <p>
472 References <a class="el" href="channels_8h-source.html#l00110">custom_modes</a>, <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, and <a class="el" href="channels_8cpp-source.html#l00150">SetCustomModeParam()</a>.
473 <p>
474 <div class="fragment"><pre>00126 {
475 00127         <span class="keywordflow">if</span> (mode_on) {
476 00128                 <span class="keyword">static</span> <span class="keywordtype">char</span> m[3];
477 00129                 m[0] = mode;
478 00130                 m[1] = <span class="charliteral">'\0'</span>;
479 00131                 <span class="keywordflow">if</span> (!strchr(this-&gt;custom_modes,mode))
480 00132                 {
481 00133                         strlcat(custom_modes,m,MAXMODES);
482 00134                 }
483 00135                 log(DEBUG,<span class="stringliteral">"Custom mode %c set"</span>,mode);
484 00136         }
485 00137         <span class="keywordflow">else</span> {
486 00138 
487 00139                 std::string a = this-&gt;<a class="code" href="classchanrec.html#o1">custom_modes</a>;
488 00140                 <span class="keywordtype">int</span> pos = a.find(mode);
489 00141                 a.erase(pos,1);
490 00142                 strncpy(this-&gt;custom_modes,a.c_str(),MAXMODES);
491 00143 
492 00144                 log(DEBUG,<span class="stringliteral">"Custom mode %c removed: modelist='%s'"</span>,mode,this-&gt;custom_modes);
493 00145                 this-&gt;<a class="code" href="classchanrec.html#a1">SetCustomModeParam</a>(mode,<span class="stringliteral">""</span>,<span class="keyword">false</span>);
494 00146         }
495 00147 }
496 </pre></div>    </td>
497   </tr>
498 </table>
499 <a name="a1" doxytag="chanrec::SetCustomModeParam"></a><p>
500 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
501   <tr>
502     <td class="mdRow">
503       <table cellpadding="0" cellspacing="0" border="0">
504         <tr>
505           <td class="md" nowrap valign="top"> void chanrec::SetCustomModeParam </td>
506           <td class="md" valign="top">(&nbsp;</td>
507           <td class="md" nowrap valign="top">char&nbsp;</td>
508           <td class="mdname" nowrap> <em>mode</em>, </td>
509         </tr>
510         <tr>
511           <td></td>
512           <td></td>
513           <td class="md" nowrap>char *&nbsp;</td>
514           <td class="mdname" nowrap> <em>parameter</em>, </td>
515         </tr>
516         <tr>
517           <td></td>
518           <td></td>
519           <td class="md" nowrap>bool&nbsp;</td>
520           <td class="mdname" nowrap> <em>mode_on</em></td>
521         </tr>
522         <tr>
523           <td></td>
524           <td class="md">)&nbsp;</td>
525           <td class="md" colspan="2"></td>
526         </tr>
527
528       </table>
529     </td>
530   </tr>
531 </table>
532 <table cellspacing=5 cellpadding=0 border=0>
533   <tr>
534     <td>
535       &nbsp;
536     </td>
537     <td>
538
539 <p>
540 Sets or unsets the parameters for a custom mode in a channels info. 
541 <p>
542
543 <p>
544 Definition at line <a class="el" href="channels_8cpp-source.html#l00150">150</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
545 <p>
546 References <a class="el" href="channels_8h-source.html#l00082">ModeParameter::channel</a>, <a class="el" href="channels_8cpp-source.html#l00111">custom_mode_params</a>, <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, <a class="el" href="channels_8h-source.html#l00080">ModeParameter::mode</a>, and <a class="el" href="channels_8h-source.html#l00081">ModeParameter::parameter</a>.
547 <p>
548 Referenced by <a class="el" href="channels_8cpp-source.html#l00125">SetCustomMode()</a>.
549 <p>
550 <div class="fragment"><pre>00151 {
551 00152 
552 00153         log(DEBUG,<span class="stringliteral">"SetCustomModeParam called"</span>);
553 00154         <a class="code" href="classModeParameter.html">ModeParameter</a> M;
554 00155         M.<a class="code" href="classModeParameter.html#o0">mode</a> = mode;
555 00156         strlcpy(M.<a class="code" href="classModeParameter.html#o2">channel</a>,this-&gt;name,CHANMAX);
556 00157         strlcpy(M.<a class="code" href="classModeParameter.html#o1">parameter</a>,parameter,MAXBUF);
557 00158         <span class="keywordflow">if</span> (mode_on)
558 00159         {
559 00160                 log(DEBUG,<span class="stringliteral">"Custom mode parameter %c %s added"</span>,mode,parameter);
560 00161                 <a class="code" href="channels_8cpp.html#a38">custom_mode_params</a>.push_back(M);
561 00162         }
562 00163         <span class="keywordflow">else</span>
563 00164         {
564 00165                 <span class="keywordflow">if</span> (<a class="code" href="channels_8cpp.html#a38">custom_mode_params</a>.size())
565 00166                 {
566 00167                         <span class="keywordflow">for</span> (vector&lt;ModeParameter&gt;::iterator i = <a class="code" href="channels_8cpp.html#a38">custom_mode_params</a>.begin(); i &lt; <a class="code" href="channels_8cpp.html#a38">custom_mode_params</a>.end(); i++)
567 00168                         {
568 00169                                 <span class="keywordflow">if</span> ((i-&gt;mode == mode) &amp;&amp; (!strcasecmp(this-&gt;name,i-&gt;channel)))
569 00170                                 {
570 00171                                         log(DEBUG,<span class="stringliteral">"Custom mode parameter %c %s removed"</span>,mode,parameter);
571 00172                                         <a class="code" href="channels_8cpp.html#a38">custom_mode_params</a>.erase(i);
572 00173                                         <span class="keywordflow">return</span>;
573 00174                                 }
574 00175                         }
575 00176                 }
576 00177                 log(DEBUG,<span class="stringliteral">"*** BUG *** Attempt to remove non-existent mode parameter!"</span>);
577 00178         }
578 00179 }
579 </pre></div>    </td>
580   </tr>
581 </table>
582 <hr><h2>Member Data Documentation</h2>
583 <a name="o10" doxytag="chanrec::bans"></a><p>
584 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
585   <tr>
586     <td class="mdRow">
587       <table cellpadding="0" cellspacing="0" border="0">
588         <tr>
589           <td class="md" nowrap valign="top"> <a class="el" href="channels_8h.html#a11">BanList</a> <a class="el" href="classchanrec.html#o10">chanrec::bans</a>
590       </table>
591     </td>
592   </tr>
593 </table>
594 <table cellspacing=5 cellpadding=0 border=0>
595   <tr>
596     <td>
597       &nbsp;
598     </td>
599     <td>
600
601 <p>
602 The list of all bans set on the channel. 
603 <p>
604
605 <p>
606 Definition at line <a class="el" href="channels_8h-source.html#l00149">149</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.    </td>
607   </tr>
608 </table>
609 <a name="o9" doxytag="chanrec::binarymodes"></a><p>
610 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
611   <tr>
612     <td class="mdRow">
613       <table cellpadding="0" cellspacing="0" border="0">
614         <tr>
615           <td class="md" nowrap valign="top"> char <a class="el" href="classchanrec.html#o9">chanrec::binarymodes</a>
616       </table>
617     </td>
618   </tr>
619 </table>
620 <table cellspacing=5 cellpadding=0 border=0>
621   <tr>
622     <td>
623       &nbsp;
624     </td>
625     <td>
626
627 <p>
628 Contains a bitmask of the CM_* builtin (RFC) binary mode symbols. 
629 <p>
630
631 <p>
632 Definition at line <a class="el" href="channels_8h-source.html#l00145">145</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
633 <p>
634 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>.    </td>
635   </tr>
636 </table>
637 <a name="o4" doxytag="chanrec::created"></a><p>
638 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
639   <tr>
640     <td class="mdRow">
641       <table cellpadding="0" cellspacing="0" border="0">
642         <tr>
643           <td class="md" nowrap valign="top"> time_t <a class="el" href="classchanrec.html#o4">chanrec::created</a>
644       </table>
645     </td>
646   </tr>
647 </table>
648 <table cellspacing=5 cellpadding=0 border=0>
649   <tr>
650     <td>
651       &nbsp;
652     </td>
653     <td>
654
655 <p>
656 Creation time. 
657 <p>
658
659 <p>
660 Definition at line <a class="el" href="channels_8h-source.html#l00123">123</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
661 <p>
662 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>.    </td>
663   </tr>
664 </table>
665 <a name="o1" doxytag="chanrec::custom_modes"></a><p>
666 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
667   <tr>
668     <td class="mdRow">
669       <table cellpadding="0" cellspacing="0" border="0">
670         <tr>
671           <td class="md" nowrap valign="top"> char <a class="el" href="classchanrec.html#o1">chanrec::custom_modes</a>[MAXMODES]
672       </table>
673     </td>
674   </tr>
675 </table>
676 <table cellspacing=5 cellpadding=0 border=0>
677   <tr>
678     <td>
679       &nbsp;
680     </td>
681     <td>
682
683 <p>
684 Custom modes for the channel. 
685 <p>
686 Plugins may use this field in any way they see fit.
687 <p>
688 Definition at line <a class="el" href="channels_8h-source.html#l00110">110</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
689 <p>
690 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>, and <a class="el" href="channels_8cpp-source.html#l00125">SetCustomMode()</a>.    </td>
691   </tr>
692 </table>
693 <a name="o2" doxytag="chanrec::internal_userlist"></a><p>
694 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
695   <tr>
696     <td class="mdRow">
697       <table cellpadding="0" cellspacing="0" border="0">
698         <tr>
699           <td class="md" nowrap valign="top"> std::vector&lt;char*&gt; <a class="el" href="classchanrec.html#o2">chanrec::internal_userlist</a>
700       </table>
701     </td>
702   </tr>
703 </table>
704 <table cellspacing=5 cellpadding=0 border=0>
705   <tr>
706     <td>
707       &nbsp;
708     </td>
709     <td>
710
711 <p>
712 User list (casted to char*'s to stop forward declaration stuff) (chicken and egg scenario!). 
713 <p>
714
715 <p>
716 Definition at line <a class="el" href="channels_8h-source.html#l00115">115</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
717 <p>
718 Referenced by <a class="el" href="channels_8cpp-source.html#l00207">AddUser()</a>, <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>, <a class="el" href="channels_8cpp-source.html#l00213">DelUser()</a>, <a class="el" href="channels_8cpp-source.html#l00202">GetUserCounter()</a>, and <a class="el" href="channels_8cpp-source.html#l00227">GetUsers()</a>.    </td>
719   </tr>
720 </table>
721 <a name="o8" doxytag="chanrec::key"></a><p>
722 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
723   <tr>
724     <td class="mdRow">
725       <table cellpadding="0" cellspacing="0" border="0">
726         <tr>
727           <td class="md" nowrap valign="top"> char <a class="el" href="classchanrec.html#o8">chanrec::key</a>[32]
728       </table>
729     </td>
730   </tr>
731 </table>
732 <table cellspacing=5 cellpadding=0 border=0>
733   <tr>
734     <td>
735       &nbsp;
736     </td>
737     <td>
738
739 <p>
740 Contains the channel key. 
741 <p>
742 If this value is an empty string, there is no channel key in place.
743 <p>
744 Definition at line <a class="el" href="channels_8h-source.html#l00141">141</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
745 <p>
746 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>.    </td>
747   </tr>
748 </table>
749 <a name="o7" doxytag="chanrec::limit"></a><p>
750 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
751   <tr>
752     <td class="mdRow">
753       <table cellpadding="0" cellspacing="0" border="0">
754         <tr>
755           <td class="md" nowrap valign="top"> short int <a class="el" href="classchanrec.html#o7">chanrec::limit</a>
756       </table>
757     </td>
758   </tr>
759 </table>
760 <table cellspacing=5 cellpadding=0 border=0>
761   <tr>
762     <td>
763       &nbsp;
764     </td>
765     <td>
766
767 <p>
768 Contains the channel user limit. 
769 <p>
770 If this value is zero, there is no limit in place.
771 <p>
772 Definition at line <a class="el" href="channels_8h-source.html#l00136">136</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
773 <p>
774 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>.    </td>
775   </tr>
776 </table>
777 <a name="o0" doxytag="chanrec::name"></a><p>
778 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
779   <tr>
780     <td class="mdRow">
781       <table cellpadding="0" cellspacing="0" border="0">
782         <tr>
783           <td class="md" nowrap valign="top"> char <a class="el" href="classchanrec.html#o0">chanrec::name</a>[CHANMAX]
784       </table>
785     </td>
786   </tr>
787 </table>
788 <table cellspacing=5 cellpadding=0 border=0>
789   <tr>
790     <td>
791       &nbsp;
792     </td>
793     <td>
794
795 <p>
796 The channels name. 
797 <p>
798
799 <p>
800 Definition at line <a class="el" href="channels_8h-source.html#l00106">106</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
801 <p>
802 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>, <a class="el" href="channels_8cpp-source.html#l00213">DelUser()</a>, and <a class="el" href="modules_8cpp-source.html#l00700">Server::PseudoToUser()</a>.    </td>
803   </tr>
804 </table>
805 <a name="o6" doxytag="chanrec::setby"></a><p>
806 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
807   <tr>
808     <td class="mdRow">
809       <table cellpadding="0" cellspacing="0" border="0">
810         <tr>
811           <td class="md" nowrap valign="top"> char <a class="el" href="classchanrec.html#o6">chanrec::setby</a>[NICKMAX]
812       </table>
813     </td>
814   </tr>
815 </table>
816 <table cellspacing=5 cellpadding=0 border=0>
817   <tr>
818     <td>
819       &nbsp;
820     </td>
821     <td>
822
823 <p>
824 The last user to set the topic. 
825 <p>
826 If this member is an empty string, no topic was ever set.
827 <p>
828 Definition at line <a class="el" href="channels_8h-source.html#l00131">131</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
829 <p>
830 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>, and <a class="el" href="modules_8cpp-source.html#l00700">Server::PseudoToUser()</a>.    </td>
831   </tr>
832 </table>
833 <a name="o3" doxytag="chanrec::topic"></a><p>
834 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
835   <tr>
836     <td class="mdRow">
837       <table cellpadding="0" cellspacing="0" border="0">
838         <tr>
839           <td class="md" nowrap valign="top"> char <a class="el" href="classchanrec.html#o3">chanrec::topic</a>[MAXBUF]
840       </table>
841     </td>
842   </tr>
843 </table>
844 <table cellspacing=5 cellpadding=0 border=0>
845   <tr>
846     <td>
847       &nbsp;
848     </td>
849     <td>
850
851 <p>
852 Channel topic. 
853 <p>
854 If this is an empty string, no channel topic is set.
855 <p>
856 Definition at line <a class="el" href="channels_8h-source.html#l00120">120</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
857 <p>
858 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>, and <a class="el" href="modules_8cpp-source.html#l00700">Server::PseudoToUser()</a>.    </td>
859   </tr>
860 </table>
861 <a name="o5" doxytag="chanrec::topicset"></a><p>
862 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
863   <tr>
864     <td class="mdRow">
865       <table cellpadding="0" cellspacing="0" border="0">
866         <tr>
867           <td class="md" nowrap valign="top"> time_t <a class="el" href="classchanrec.html#o5">chanrec::topicset</a>
868       </table>
869     </td>
870   </tr>
871 </table>
872 <table cellspacing=5 cellpadding=0 border=0>
873   <tr>
874     <td>
875       &nbsp;
876     </td>
877     <td>
878
879 <p>
880 Time topic was set. 
881 <p>
882 If no topic was ever set, this will be equal to <a class="el" href="classchanrec.html#o4">chanrec::created</a>
883 <p>
884 Definition at line <a class="el" href="channels_8h-source.html#l00127">127</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
885 <p>
886 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>, and <a class="el" href="modules_8cpp-source.html#l00700">Server::PseudoToUser()</a>.    </td>
887   </tr>
888 </table>
889 <hr>The documentation for this class was generated from the following files:<ul>
890 <li><a class="el" href="channels_8h-source.html">channels.h</a><li><a class="el" href="channels_8cpp-source.html">channels.cpp</a></ul>
891 <hr size="1"><address style="align: right;"><small>Generated on Thu May 12 22:59:01 2005 for InspIRCd by
892 <a href="http://www.doxygen.org/index.html">
893 <img src="doxygen.png" alt="doxygen" align="middle" border=0 > 
894 </a>1.3.3 </small></address>
895 </body>
896 </html>