diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-05-12 02:26:05 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-05-12 02:26:05 +0000 |
commit | a266dadd1351d10b56ec187c7b6f7af75350ed68 (patch) | |
tree | 0729c41ca0f1719c69277dc862d4704d63d6248f /docs/module-doc/modules_8cpp-source.html | |
parent | c42a4ace0281ee6a89f6df2af3b15563ffe98064 (diff) |
Documented new recvq and sendq stuff
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1367 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'docs/module-doc/modules_8cpp-source.html')
-rw-r--r-- | docs/module-doc/modules_8cpp-source.html | 2016 |
1 files changed, 1017 insertions, 999 deletions
diff --git a/docs/module-doc/modules_8cpp-source.html b/docs/module-doc/modules_8cpp-source.html index 79165ee67..9807b4f97 100644 --- a/docs/module-doc/modules_8cpp-source.html +++ b/docs/module-doc/modules_8cpp-source.html @@ -30,1032 +30,1050 @@ 00023 <span class="preprocessor">#include <sys/errno.h></span> 00024 <span class="preprocessor">#include <sys/ioctl.h></span> 00025 <span class="preprocessor">#include <sys/utsname.h></span> -00026 <span class="preprocessor">#include <cstdio></span> -00027 <span class="preprocessor">#include <time.h></span> -00028 <span class="preprocessor">#include <string></span> -00029 <span class="preprocessor">#ifdef GCC3</span> -00030 <span class="preprocessor"></span><span class="preprocessor">#include <ext/hash_map></span> -00031 <span class="preprocessor">#else</span> -00032 <span class="preprocessor"></span><span class="preprocessor">#include <hash_map></span> -00033 <span class="preprocessor">#endif</span> -00034 <span class="preprocessor"></span><span class="preprocessor">#include <map></span> -00035 <span class="preprocessor">#include <sstream></span> -00036 <span class="preprocessor">#include <vector></span> -00037 <span class="preprocessor">#include <errno.h></span> -00038 <span class="preprocessor">#include <deque></span> -00039 <span class="preprocessor">#include <errno.h></span> -00040 <span class="preprocessor">#include <unistd.h></span> -00041 <span class="preprocessor">#include <sched.h></span> -00042 <span class="preprocessor">#include "<a class="code" href="connection_8h.html">connection.h</a>"</span> -00043 <span class="preprocessor">#include "<a class="code" href="users_8h.html">users.h</a>"</span> -00044 <span class="preprocessor">#include "<a class="code" href="servers_8h.html">servers.h</a>"</span> -00045 <span class="preprocessor">#include "<a class="code" href="ctables_8h.html">ctables.h</a>"</span> -00046 <span class="preprocessor">#include "globals.h"</span> -00047 <span class="preprocessor">#include "<a class="code" href="modules_8h.html">modules.h</a>"</span> -00048 <span class="preprocessor">#include "dynamic.h"</span> -00049 <span class="preprocessor">#include "wildcard.h"</span> -00050 <span class="preprocessor">#include "<a class="code" href="message_8h.html">message.h</a>"</span> -00051 <span class="preprocessor">#include "<a class="code" href="mode_8h.html">mode.h</a>"</span> -00052 <span class="preprocessor">#include "<a class="code" href="xline_8h.html">xline.h</a>"</span> -00053 <span class="preprocessor">#include "<a class="code" href="commands_8h.html">commands.h</a>"</span> -00054 <span class="preprocessor">#include "inspstring.h"</span> -00055 -00056 <span class="preprocessor">#ifdef GCC3</span> -00057 <span class="preprocessor"></span><span class="preprocessor">#define nspace __gnu_cxx</span> -00058 <span class="preprocessor"></span><span class="preprocessor">#else</span> -<a name="l00059"></a><a class="code" href="modules_8cpp.html#a0">00059</a> <span class="preprocessor"></span><span class="preprocessor">#define nspace std</span> -00060 <span class="preprocessor"></span><span class="preprocessor">#endif</span> -00061 <span class="preprocessor"></span> -00062 <span class="keyword">using</span> <span class="keyword">namespace </span>std; -00063 -00064 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="modules_8cpp.html#a1">MODCOUNT</a>; -<a name="l00065"></a><a class="code" href="modules_8cpp.html#a2">00065</a> <span class="keyword">extern</span> std::vector<Module*> <a class="code" href="channels_8cpp.html#a2">modules</a>; -<a name="l00066"></a><a class="code" href="modules_8cpp.html#a3">00066</a> <span class="keyword">extern</span> std::vector<ircd_module*> <a class="code" href="channels_8cpp.html#a3">factory</a>; -00067 -<a name="l00068"></a><a class="code" href="modules_8cpp.html#a4">00068</a> <span class="keyword">extern</span> time_t <a class="code" href="channels_8cpp.html#a37">TIME</a>; -00069 -<a name="l00070"></a><a class="code" href="modules_8cpp.html#a5">00070</a> <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="channels_8cpp.html#a4">LogLevel</a>; -<a name="l00071"></a><a class="code" href="modules_8cpp.html#a6">00071</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a5">ServerName</a>[MAXBUF]; -<a name="l00072"></a><a class="code" href="modules_8cpp.html#a7">00072</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a6">Network</a>[MAXBUF]; -<a name="l00073"></a><a class="code" href="modules_8cpp.html#a8">00073</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a7">ServerDesc</a>[MAXBUF]; -<a name="l00074"></a><a class="code" href="modules_8cpp.html#a9">00074</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a8">AdminName</a>[MAXBUF]; -<a name="l00075"></a><a class="code" href="modules_8cpp.html#a10">00075</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a9">AdminEmail</a>[MAXBUF]; -<a name="l00076"></a><a class="code" href="modules_8cpp.html#a11">00076</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a10">AdminNick</a>[MAXBUF]; -<a name="l00077"></a><a class="code" href="modules_8cpp.html#a12">00077</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a11">diepass</a>[MAXBUF]; -<a name="l00078"></a><a class="code" href="modules_8cpp.html#a13">00078</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a12">restartpass</a>[MAXBUF]; -<a name="l00079"></a><a class="code" href="modules_8cpp.html#a14">00079</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a13">motd</a>[MAXBUF]; -<a name="l00080"></a><a class="code" href="modules_8cpp.html#a15">00080</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a14">rules</a>[MAXBUF]; -<a name="l00081"></a><a class="code" href="modules_8cpp.html#a16">00081</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a15">list</a>[MAXBUF]; -<a name="l00082"></a><a class="code" href="modules_8cpp.html#a17">00082</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a16">PrefixQuit</a>[MAXBUF]; -<a name="l00083"></a><a class="code" href="modules_8cpp.html#a18">00083</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a17">DieValue</a>[MAXBUF]; -00084 -<a name="l00085"></a><a class="code" href="modules_8cpp.html#a19">00085</a> <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="channels_8cpp.html#a18">debugging</a>; -<a name="l00086"></a><a class="code" href="modules_8cpp.html#a20">00086</a> <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="channels_8cpp.html#a19">WHOWAS_STALE</a>; -<a name="l00087"></a><a class="code" href="modules_8cpp.html#a21">00087</a> <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="channels_8cpp.html#a20">WHOWAS_MAX</a>; -<a name="l00088"></a><a class="code" href="modules_8cpp.html#a22">00088</a> <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="channels_8cpp.html#a21">DieDelay</a>; -<a name="l00089"></a><a class="code" href="modules_8cpp.html#a23">00089</a> <span class="keyword">extern</span> time_t <a class="code" href="channels_8cpp.html#a22">startup_time</a>; -<a name="l00090"></a><a class="code" href="modules_8cpp.html#a24">00090</a> <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="channels_8cpp.html#a23">NetBufferSize</a>; -<a name="l00091"></a><a class="code" href="modules_8cpp.html#a25">00091</a> <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="channels_8cpp.html#a24">MaxWhoResults</a>; -<a name="l00092"></a><a class="code" href="modules_8cpp.html#a26">00092</a> <span class="keyword">extern</span> time_t <a class="code" href="channels_8cpp.html#a25">nb_start</a>; +00026 <span class="preprocessor">#ifdef USE_KQUEUE</span> +00027 <span class="preprocessor"></span><span class="preprocessor">#include <sys/types.h></span> +00028 <span class="preprocessor">#include <sys/event.h></span> +00029 <span class="preprocessor">#include <sys/time.h></span> +00030 <span class="preprocessor">#endif</span> +00031 <span class="preprocessor"></span><span class="preprocessor">#include <cstdio></span> +00032 <span class="preprocessor">#include <time.h></span> +00033 <span class="preprocessor">#include <string></span> +00034 <span class="preprocessor">#ifdef GCC3</span> +00035 <span class="preprocessor"></span><span class="preprocessor">#include <ext/hash_map></span> +00036 <span class="preprocessor">#else</span> +00037 <span class="preprocessor"></span><span class="preprocessor">#include <hash_map></span> +00038 <span class="preprocessor">#endif</span> +00039 <span class="preprocessor"></span><span class="preprocessor">#include <map></span> +00040 <span class="preprocessor">#include <sstream></span> +00041 <span class="preprocessor">#include <vector></span> +00042 <span class="preprocessor">#include <errno.h></span> +00043 <span class="preprocessor">#include <deque></span> +00044 <span class="preprocessor">#include <errno.h></span> +00045 <span class="preprocessor">#include <unistd.h></span> +00046 <span class="preprocessor">#include <sched.h></span> +00047 <span class="preprocessor">#include "<a class="code" href="connection_8h.html">connection.h</a>"</span> +00048 <span class="preprocessor">#include "<a class="code" href="users_8h.html">users.h</a>"</span> +00049 <span class="preprocessor">#include "<a class="code" href="servers_8h.html">servers.h</a>"</span> +00050 <span class="preprocessor">#include "<a class="code" href="ctables_8h.html">ctables.h</a>"</span> +00051 <span class="preprocessor">#include "globals.h"</span> +00052 <span class="preprocessor">#include "<a class="code" href="modules_8h.html">modules.h</a>"</span> +00053 <span class="preprocessor">#include "dynamic.h"</span> +00054 <span class="preprocessor">#include "wildcard.h"</span> +00055 <span class="preprocessor">#include "<a class="code" href="message_8h.html">message.h</a>"</span> +00056 <span class="preprocessor">#include "<a class="code" href="mode_8h.html">mode.h</a>"</span> +00057 <span class="preprocessor">#include "<a class="code" href="xline_8h.html">xline.h</a>"</span> +00058 <span class="preprocessor">#include "<a class="code" href="commands_8h.html">commands.h</a>"</span> +00059 <span class="preprocessor">#include "inspstring.h"</span> +00060 +00061 <span class="preprocessor">#ifdef GCC3</span> +00062 <span class="preprocessor"></span><span class="preprocessor">#define nspace __gnu_cxx</span> +00063 <span class="preprocessor"></span><span class="preprocessor">#else</span> +<a name="l00064"></a><a class="code" href="modules_8cpp.html#a0">00064</a> <span class="preprocessor"></span><span class="preprocessor">#define nspace std</span> +00065 <span class="preprocessor"></span><span class="preprocessor">#endif</span> +00066 <span class="preprocessor"></span> +00067 <span class="keyword">using</span> <span class="keyword">namespace </span>std; +00068 +00069 <span class="preprocessor">#ifdef USE_KQUEUE</span> +00070 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="keywordtype">int</span> kq; +00071 <span class="preprocessor">#endif</span> +00072 <span class="preprocessor"></span> +00073 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="modules_8cpp.html#a1">MODCOUNT</a>; +<a name="l00074"></a><a class="code" href="modules_8cpp.html#a2">00074</a> <span class="keyword">extern</span> std::vector<Module*> <a class="code" href="channels_8cpp.html#a2">modules</a>; +<a name="l00075"></a><a class="code" href="modules_8cpp.html#a3">00075</a> <span class="keyword">extern</span> std::vector<ircd_module*> <a class="code" href="channels_8cpp.html#a3">factory</a>; +00076 +<a name="l00077"></a><a class="code" href="modules_8cpp.html#a4">00077</a> <span class="keyword">extern</span> time_t <a class="code" href="channels_8cpp.html#a37">TIME</a>; +00078 +<a name="l00079"></a><a class="code" href="modules_8cpp.html#a5">00079</a> <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="channels_8cpp.html#a4">LogLevel</a>; +<a name="l00080"></a><a class="code" href="modules_8cpp.html#a6">00080</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a5">ServerName</a>[MAXBUF]; +<a name="l00081"></a><a class="code" href="modules_8cpp.html#a7">00081</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a6">Network</a>[MAXBUF]; +<a name="l00082"></a><a class="code" href="modules_8cpp.html#a8">00082</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a7">ServerDesc</a>[MAXBUF]; +<a name="l00083"></a><a class="code" href="modules_8cpp.html#a9">00083</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a8">AdminName</a>[MAXBUF]; +<a name="l00084"></a><a class="code" href="modules_8cpp.html#a10">00084</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a9">AdminEmail</a>[MAXBUF]; +<a name="l00085"></a><a class="code" href="modules_8cpp.html#a11">00085</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a10">AdminNick</a>[MAXBUF]; +<a name="l00086"></a><a class="code" href="modules_8cpp.html#a12">00086</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a11">diepass</a>[MAXBUF]; +<a name="l00087"></a><a class="code" href="modules_8cpp.html#a13">00087</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a12">restartpass</a>[MAXBUF]; +<a name="l00088"></a><a class="code" href="modules_8cpp.html#a14">00088</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a13">motd</a>[MAXBUF]; +<a name="l00089"></a><a class="code" href="modules_8cpp.html#a15">00089</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a14">rules</a>[MAXBUF]; +<a name="l00090"></a><a class="code" href="modules_8cpp.html#a16">00090</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a15">list</a>[MAXBUF]; +<a name="l00091"></a><a class="code" href="modules_8cpp.html#a17">00091</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a16">PrefixQuit</a>[MAXBUF]; +<a name="l00092"></a><a class="code" href="modules_8cpp.html#a18">00092</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="channels_8cpp.html#a17">DieValue</a>[MAXBUF]; 00093 -<a name="l00094"></a><a class="code" href="modules_8cpp.html#a27">00094</a> <span class="keyword">extern</span> std::vector<int> <a class="code" href="channels_8cpp.html#a26">fd_reap</a>; -<a name="l00095"></a><a class="code" href="modules_8cpp.html#a28">00095</a> <span class="keyword">extern</span> std::vector<std::string> <a class="code" href="channels_8cpp.html#a27">module_names</a>; -00096 -<a name="l00097"></a><a class="code" href="modules_8cpp.html#a29">00097</a> <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="channels_8cpp.html#a28">boundPortCount</a>; -<a name="l00098"></a><a class="code" href="modules_8cpp.html#a30">00098</a> <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="channels_8cpp.html#a29">portCount</a>; -<a name="l00099"></a><a class="code" href="modules_8cpp.html#a31">00099</a> <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="channels_8cpp.html#a30">UDPportCount</a>; -<a name="l00100"></a><a class="code" href="modules_8cpp.html#a32">00100</a> <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="channels_8cpp.html#a31">ports</a>[MAXSOCKS]; -<a name="l00101"></a><a class="code" href="modules_8cpp.html#a33">00101</a> <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="channels_8cpp.html#a32">defaultRoute</a>; +<a name="l00094"></a><a class="code" href="modules_8cpp.html#a19">00094</a> <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="channels_8cpp.html#a18">debugging</a>; +<a name="l00095"></a><a class="code" href="modules_8cpp.html#a20">00095</a> <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="channels_8cpp.html#a19">WHOWAS_STALE</a>; +<a name="l00096"></a><a class="code" href="modules_8cpp.html#a21">00096</a> <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="channels_8cpp.html#a20">WHOWAS_MAX</a>; +<a name="l00097"></a><a class="code" href="modules_8cpp.html#a22">00097</a> <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="channels_8cpp.html#a21">DieDelay</a>; +<a name="l00098"></a><a class="code" href="modules_8cpp.html#a23">00098</a> <span class="keyword">extern</span> time_t <a class="code" href="channels_8cpp.html#a22">startup_time</a>; +<a name="l00099"></a><a class="code" href="modules_8cpp.html#a24">00099</a> <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="channels_8cpp.html#a23">NetBufferSize</a>; +<a name="l00100"></a><a class="code" href="modules_8cpp.html#a25">00100</a> <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="channels_8cpp.html#a24">MaxWhoResults</a>; +<a name="l00101"></a><a class="code" href="modules_8cpp.html#a26">00101</a> <span class="keyword">extern</span> time_t <a class="code" href="channels_8cpp.html#a25">nb_start</a>; 00102 -<a name="l00103"></a><a class="code" href="modules_8cpp.html#a34">00103</a> <span class="keyword">extern</span> std::vector<long> <a class="code" href="channels_8cpp.html#a33">auth_cookies</a>; -<a name="l00104"></a><a class="code" href="modules_8cpp.html#a35">00104</a> <span class="keyword">extern</span> std::stringstream <a class="code" href="channels_8cpp.html#a34">config_f</a>; +<a name="l00103"></a><a class="code" href="modules_8cpp.html#a27">00103</a> <span class="keyword">extern</span> std::vector<int> <a class="code" href="channels_8cpp.html#a26">fd_reap</a>; +<a name="l00104"></a><a class="code" href="modules_8cpp.html#a28">00104</a> <span class="keyword">extern</span> std::vector<std::string> <a class="code" href="channels_8cpp.html#a27">module_names</a>; 00105 -<a name="l00106"></a><a class="code" href="modules_8cpp.html#a36">00106</a> <span class="keyword">extern</span> <a class="code" href="classserverrec.html">serverrec</a>* <a class="code" href="channels_8cpp.html#a35">me</a>[32]; -00107 -<a name="l00108"></a><a class="code" href="modules_8cpp.html#a37">00108</a> <span class="keyword">extern</span> FILE *<a class="code" href="channels_8cpp.html#a36">log_file</a>; -00109 -<a name="l00110"></a><a class="code" href="modules_8cpp.html#a38">00110</a> <span class="keyword">extern</span> <a class="code" href="classuserrec.html">userrec</a>* <a class="code" href="modules_8cpp.html#a38">fd_ref_table</a>[65536]; +<a name="l00106"></a><a class="code" href="modules_8cpp.html#a29">00106</a> <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="channels_8cpp.html#a28">boundPortCount</a>; +<a name="l00107"></a><a class="code" href="modules_8cpp.html#a30">00107</a> <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="channels_8cpp.html#a29">portCount</a>; +<a name="l00108"></a><a class="code" href="modules_8cpp.html#a31">00108</a> <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="channels_8cpp.html#a30">SERVERportCount</a>; +<a name="l00109"></a><a class="code" href="modules_8cpp.html#a32">00109</a> <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="channels_8cpp.html#a31">ports</a>[MAXSOCKS]; +<a name="l00110"></a><a class="code" href="modules_8cpp.html#a33">00110</a> <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="channels_8cpp.html#a32">defaultRoute</a>; 00111 -<a name="l00112"></a><a class="code" href="namespacenspace.html">00112</a> <span class="keyword">namespace </span><a class="code" href="channels_8cpp.html#a0">nspace</a> -00113 { -00114 <span class="preprocessor">#ifdef GCC34</span> -00115 <span class="preprocessor"></span> <span class="keyword">template</span><> <span class="keyword">struct </span>hash<in_addr> -00116 #else -<a name="l00117"></a><a class="code" href="structnspace_1_1nspace_1_1hash_3_01in__addr_01_4.html">00117</a> template<> struct <a class="code" href="channels_8cpp.html#a0">nspace</a>::hash<in_addr> -00118 #endif -00119 { -<a name="l00120"></a><a class="code" href="structnspace_1_1nspace_1_1hash_3_01in__addr_01_4.html#a0">00120</a> size_t operator()(<span class="keyword">const</span> <span class="keyword">struct</span> in_addr &a)<span class="keyword"> const</span> -00121 <span class="keyword"> </span>{ -00122 size_t q; -00123 memcpy(&q,&a,<span class="keyword">sizeof</span>(size_t)); -00124 <span class="keywordflow">return</span> q; -00125 } -00126 }; -00127 <span class="preprocessor">#ifdef GCC34</span> -00128 <span class="preprocessor"></span> <span class="keyword">template</span><> <span class="keyword">struct </span>hash<string> -00129 #else -<a name="l00130"></a><a class="code" href="structnspace_1_1nspace_1_1hash_3_01string_01_4.html">00130</a> template<> struct <a class="code" href="channels_8cpp.html#a0">nspace</a>::hash<string> -00131 #endif -00132 { -<a name="l00133"></a><a class="code" href="structnspace_1_1nspace_1_1hash_3_01string_01_4.html#a0">00133</a> size_t operator()(<span class="keyword">const</span> string &s)<span class="keyword"> const</span> -00134 <span class="keyword"> </span>{ -00135 <span class="keywordtype">char</span> a[MAXBUF]; -00136 <span class="keyword">static</span> <span class="keyword">struct </span>hash<const char *> strhash; -00137 strlcpy(a,s.c_str(),MAXBUF); -00138 strlower(a); -00139 <span class="keywordflow">return</span> strhash(a); -00140 } -00141 }; -00142 } -00143 -<a name="l00144"></a><a class="code" href="structStrHashComp.html">00144</a> <span class="keyword">struct </span><a class="code" href="structStrHashComp.html">StrHashComp</a> -00145 { -00146 -<a name="l00147"></a><a class="code" href="structStrHashComp.html#a0">00147</a> <span class="keywordtype">bool</span> <a class="code" href="structStrHashComp.html#a0">operator()</a>(<span class="keyword">const</span> string& s1, <span class="keyword">const</span> string& s2)<span class="keyword"> const</span> -00148 <span class="keyword"> </span>{ -00149 <span class="keywordtype">char</span> a[MAXBUF],b[MAXBUF]; -00150 strlcpy(a,s1.c_str(),MAXBUF); -00151 strlcpy(b,s2.c_str(),MAXBUF); -00152 strlower(a); -00153 strlower(b); -00154 <span class="keywordflow">return</span> (strcasecmp(a,b) == 0); -00155 } -00156 -00157 }; -00158 -<a name="l00159"></a><a class="code" href="structInAddr__HashComp.html">00159</a> <span class="keyword">struct </span><a class="code" href="structInAddr__HashComp.html">InAddr_HashComp</a> -00160 { -00161 -<a name="l00162"></a><a class="code" href="structInAddr__HashComp.html#a0">00162</a> <span class="keywordtype">bool</span> <a class="code" href="structInAddr__HashComp.html#a0">operator()</a>(<span class="keyword">const</span> in_addr &s1, <span class="keyword">const</span> in_addr &s2)<span class="keyword"> const</span> -00163 <span class="keyword"> </span>{ -00164 size_t q; -00165 size_t p; -00166 -00167 memcpy(&q,&s1,<span class="keyword">sizeof</span>(size_t)); -00168 memcpy(&p,&s2,<span class="keyword">sizeof</span>(size_t)); -00169 -00170 <span class="keywordflow">return</span> (q == p); -00171 } -00172 -00173 }; -00174 -00175 -<a name="l00176"></a><a class="code" href="modules_8cpp.html#a39">00176</a> <span class="keyword">typedef</span> nspace::hash_map<std::string, userrec*, nspace::hash<string>, <a class="code" href="structStrHashComp.html">StrHashComp</a>> <a class="code" href="modules_8cpp.html#a39">user_hash</a>; -<a name="l00177"></a><a class="code" href="modules_8cpp.html#a40">00177</a> <span class="keyword">typedef</span> nspace::hash_map<std::string, chanrec*, nspace::hash<string>, <a class="code" href="structStrHashComp.html">StrHashComp</a>> <a class="code" href="modules_8cpp.html#a40">chan_hash</a>; -<a name="l00178"></a><a class="code" href="modules_8cpp.html#a41">00178</a> <span class="keyword">typedef</span> nspace::hash_map<in_addr,string*, nspace::hash<in_addr>, <a class="code" href="structInAddr__HashComp.html">InAddr_HashComp</a>> <a class="code" href="modules_8cpp.html#a41">address_cache</a>; -<a name="l00179"></a><a class="code" href="modules_8cpp.html#a42">00179</a> <span class="keyword">typedef</span> std::deque<command_t> <a class="code" href="modules_8cpp.html#a42">command_table</a>; -00180 +<a name="l00112"></a><a class="code" href="modules_8cpp.html#a34">00112</a> <span class="keyword">extern</span> std::vector<long> <a class="code" href="channels_8cpp.html#a33">auth_cookies</a>; +<a name="l00113"></a><a class="code" href="modules_8cpp.html#a35">00113</a> <span class="keyword">extern</span> std::stringstream <a class="code" href="channels_8cpp.html#a34">config_f</a>; +00114 +<a name="l00115"></a><a class="code" href="modules_8cpp.html#a36">00115</a> <span class="keyword">extern</span> <a class="code" href="classserverrec.html">serverrec</a>* <a class="code" href="channels_8cpp.html#a35">me</a>[32]; +00116 +<a name="l00117"></a><a class="code" href="modules_8cpp.html#a37">00117</a> <span class="keyword">extern</span> FILE *<a class="code" href="channels_8cpp.html#a36">log_file</a>; +00118 +<a name="l00119"></a><a class="code" href="modules_8cpp.html#a38">00119</a> <span class="keyword">extern</span> <a class="code" href="classuserrec.html">userrec</a>* <a class="code" href="modules_8cpp.html#a38">fd_ref_table</a>[65536]; +00120 +<a name="l00121"></a><a class="code" href="namespacenspace.html">00121</a> <span class="keyword">namespace </span><a class="code" href="channels_8cpp.html#a0">nspace</a> +00122 { +00123 <span class="preprocessor">#ifdef GCC34</span> +00124 <span class="preprocessor"></span> <span class="keyword">template</span><> <span class="keyword">struct </span>hash<in_addr> +00125 #else +<a name="l00126"></a><a class="code" href="structnspace_1_1nspace_1_1hash_3_01in__addr_01_4.html">00126</a> template<> struct <a class="code" href="channels_8cpp.html#a0">nspace</a>::hash<in_addr> +00127 #endif +00128 { +<a name="l00129"></a><a class="code" href="structnspace_1_1nspace_1_1hash_3_01in__addr_01_4.html#a0">00129</a> size_t operator()(<span class="keyword">const</span> <span class="keyword">struct</span> in_addr &a)<span class="keyword"> const</span> +00130 <span class="keyword"> </span>{ +00131 size_t q; +00132 memcpy(&q,&a,<span class="keyword">sizeof</span>(size_t)); +00133 <span class="keywordflow">return</span> q; +00134 } +00135 }; +00136 <span class="preprocessor">#ifdef GCC34</span> +00137 <span class="preprocessor"></span> <span class="keyword">template</span><> <span class="keyword">struct </span>hash<string> +00138 #else +<a name="l00139"></a><a class="code" href="structnspace_1_1nspace_1_1hash_3_01string_01_4.html">00139</a> template<> struct <a class="code" href="channels_8cpp.html#a0">nspace</a>::hash<string> +00140 #endif +00141 { +<a name="l00142"></a><a class="code" href="structnspace_1_1nspace_1_1hash_3_01string_01_4.html#a0">00142</a> size_t operator()(<span class="keyword">const</span> string &s)<span class="keyword"> const</span> +00143 <span class="keyword"> </span>{ +00144 <span class="keywordtype">char</span> a[MAXBUF]; +00145 <span class="keyword">static</span> <span class="keyword">struct </span>hash<const char *> strhash; +00146 strlcpy(a,s.c_str(),MAXBUF); +00147 strlower(a); +00148 <span class="keywordflow">return</span> strhash(a); +00149 } +00150 }; +00151 } +00152 +<a name="l00153"></a><a class="code" href="structStrHashComp.html">00153</a> <span class="keyword">struct </span><a class="code" href="structStrHashComp.html">StrHashComp</a> +00154 { +00155 +<a name="l00156"></a><a class="code" href="structStrHashComp.html#a0">00156</a> <span class="keywordtype">bool</span> <a class="code" href="structStrHashComp.html#a0">operator()</a>(<span class="keyword">const</span> string& s1, <span class="keyword">const</span> string& s2)<span class="keyword"> const</span> +00157 <span class="keyword"> </span>{ +00158 <span class="keywordtype">char</span> a[MAXBUF],b[MAXBUF]; +00159 strlcpy(a,s1.c_str(),MAXBUF); +00160 strlcpy(b,s2.c_str(),MAXBUF); +00161 strlower(a); +00162 strlower(b); +00163 <span class="keywordflow">return</span> (strcasecmp(a,b) == 0); +00164 } +00165 +00166 }; +00167 +<a name="l00168"></a><a class="code" href="structInAddr__HashComp.html">00168</a> <span class="keyword">struct </span><a class="code" href="structInAddr__HashComp.html">InAddr_HashComp</a> +00169 { +00170 +<a name="l00171"></a><a class="code" href="structInAddr__HashComp.html#a0">00171</a> <span class="keywordtype">bool</span> <a class="code" href="structInAddr__HashComp.html#a0">operator()</a>(<span class="keyword">const</span> in_addr &s1, <span class="keyword">const</span> in_addr &s2)<span class="keyword"> const</span> +00172 <span class="keyword"> </span>{ +00173 size_t q; +00174 size_t p; +00175 +00176 memcpy(&q,&s1,<span class="keyword">sizeof</span>(size_t)); +00177 memcpy(&p,&s2,<span class="keyword">sizeof</span>(size_t)); +00178 +00179 <span class="keywordflow">return</span> (q == p); +00180 } 00181 -<a name="l00182"></a><a class="code" href="modules_8cpp.html#a43">00182</a> <span class="keyword">extern</span> <a class="code" href="modules_8cpp.html#a39">user_hash</a> <a class="code" href="modules_8cpp.html#a43">clientlist</a>; -<a name="l00183"></a><a class="code" href="modules_8cpp.html#a44">00183</a> <span class="keyword">extern</span> <a class="code" href="modules_8cpp.html#a40">chan_hash</a> <a class="code" href="modules_8cpp.html#a44">chanlist</a>; -<a name="l00184"></a><a class="code" href="modules_8cpp.html#a45">00184</a> <span class="keyword">extern</span> <a class="code" href="modules_8cpp.html#a39">user_hash</a> <a class="code" href="modules_8cpp.html#a45">whowas</a>; -<a name="l00185"></a><a class="code" href="modules_8cpp.html#a46">00185</a> <span class="keyword">extern</span> <a class="code" href="modules_8cpp.html#a42">command_table</a> <a class="code" href="modules_8cpp.html#a46">cmdlist</a>; -<a name="l00186"></a><a class="code" href="modules_8cpp.html#a47">00186</a> <span class="keyword">extern</span> <a class="code" href="modules_8h.html#a31">file_cache</a> <a class="code" href="modules_8cpp.html#a47">MOTD</a>; -<a name="l00187"></a><a class="code" href="modules_8cpp.html#a48">00187</a> <span class="keyword">extern</span> <a class="code" href="modules_8h.html#a31">file_cache</a> <a class="code" href="modules_8cpp.html#a48">RULES</a>; -<a name="l00188"></a><a class="code" href="modules_8cpp.html#a49">00188</a> <span class="keyword">extern</span> <a class="code" href="modules_8cpp.html#a41">address_cache</a> <a class="code" href="modules_8cpp.html#a49">IP</a>; +00182 }; +00183 +00184 +<a name="l00185"></a><a class="code" href="modules_8cpp.html#a39">00185</a> <span class="keyword">typedef</span> nspace::hash_map<std::string, userrec*, nspace::hash<string>, <a class="code" href="structStrHashComp.html">StrHashComp</a>> <a class="code" href="modules_8cpp.html#a39">user_hash</a>; +<a name="l00186"></a><a class="code" href="modules_8cpp.html#a40">00186</a> <span class="keyword">typedef</span> nspace::hash_map<std::string, chanrec*, nspace::hash<string>, <a class="code" href="structStrHashComp.html">StrHashComp</a>> <a class="code" href="modules_8cpp.html#a40">chan_hash</a>; +<a name="l00187"></a><a class="code" href="modules_8cpp.html#a41">00187</a> <span class="keyword">typedef</span> nspace::hash_map<in_addr,string*, nspace::hash<in_addr>, <a class="code" href="structInAddr__HashComp.html">InAddr_HashComp</a>> <a class="code" href="modules_8cpp.html#a41">address_cache</a>; +<a name="l00188"></a><a class="code" href="modules_8cpp.html#a42">00188</a> <span class="keyword">typedef</span> std::deque<command_t> <a class="code" href="modules_8cpp.html#a42">command_table</a>; 00189 00190 -00191 <span class="comment">// class type for holding an extended mode character - internal to core</span> -00192 -<a name="l00193"></a><a class="code" href="classExtMode.html">00193</a> <span class="keyword">class </span><a class="code" href="classExtMode.html">ExtMode</a> : <span class="keyword">public</span> <a class="code" href="classclassbase.html">classbase</a> -00194 { -00195 <span class="keyword">public</span>: -<a name="l00196"></a><a class="code" href="classExtMode.html#o0">00196</a> <span class="keywordtype">char</span> <a class="code" href="classExtMode.html#o0">modechar</a>; -<a name="l00197"></a><a class="code" href="classExtMode.html#o1">00197</a> <span class="keywordtype">int</span> <a class="code" href="classExtMode.html#o1">type</a>; -<a name="l00198"></a><a class="code" href="classExtMode.html#o2">00198</a> <span class="keywordtype">int</span> <a class="code" href="classExtMode.html#o2">params_when_on</a>; -<a name="l00199"></a><a class="code" href="classExtMode.html#o3">00199</a> <span class="keywordtype">int</span> <a class="code" href="classExtMode.html#o3">params_when_off</a>; -<a name="l00200"></a><a class="code" href="classExtMode.html#o4">00200</a> <span class="keywordtype">bool</span> <a class="code" href="classExtMode.html#o4">needsoper</a>; -<a name="l00201"></a><a class="code" href="classExtMode.html#o5">00201</a> <span class="keywordtype">bool</span> <a class="code" href="channels_8cpp.html#a15">list</a>; -<a name="l00202"></a><a class="code" href="classExtMode.html#a0">00202</a> <a class="code" href="classExtMode.html#a0">ExtMode</a>(<span class="keywordtype">char</span> mc, <span class="keywordtype">int</span> ty, <span class="keywordtype">bool</span> oper, <span class="keywordtype">int</span> p_on, <span class="keywordtype">int</span> p_off) : <a class="code" href="classExtMode.html#o0">modechar</a>(mc), <a class="code" href="classExtMode.html#o1">type</a>(ty), <a class="code" href="classExtMode.html#o4">needsoper</a>(oper), <a class="code" href="classExtMode.html#o2">params_when_on</a>(p_on), <a class="code" href="classExtMode.html#o3">params_when_off</a>(p_off) { }; -00203 }; -00204 -<a name="l00205"></a><a class="code" href="modules_8cpp.html#a50">00205</a> <span class="keyword">typedef</span> std::vector<ExtMode> <a class="code" href="modules_8cpp.html#a50">ExtModeList</a>; -<a name="l00206"></a><a class="code" href="modules_8cpp.html#a51">00206</a> <span class="keyword">typedef</span> ExtModeList::iterator <a class="code" href="modules_8cpp.html#a51">ExtModeListIter</a>; -00207 -00208 -<a name="l00209"></a><a class="code" href="modules_8cpp.html#a52">00209</a> <a class="code" href="modules_8cpp.html#a50">ExtModeList</a> <a class="code" href="modules_8cpp.html#a52">EMode</a>; -00210 -00211 <span class="comment">// returns true if an extended mode character is in use</span> -<a name="l00212"></a><a class="code" href="modules_8cpp.html#a53">00212</a> <span class="keywordtype">bool</span> <a class="code" href="modules_8cpp.html#a53">ModeDefined</a>(<span class="keywordtype">char</span> modechar, <span class="keywordtype">int</span> type) -00213 { -00214 <span class="keywordflow">for</span> (<a class="code" href="modules_8cpp.html#a51">ExtModeListIter</a> i = <a class="code" href="modules_8cpp.html#a52">EMode</a>.begin(); i < <a class="code" href="modules_8cpp.html#a52">EMode</a>.end(); i++) -00215 { -00216 <span class="keywordflow">if</span> ((i->modechar == modechar) && (i->type == type)) -00217 { -00218 <span class="keywordflow">return</span> <span class="keyword">true</span>; -00219 } -00220 } -00221 <span class="keywordflow">return</span> <span class="keyword">false</span>; -00222 } -00223 -<a name="l00224"></a><a class="code" href="modules_8cpp.html#a54">00224</a> <span class="keywordtype">bool</span> <a class="code" href="modules_8cpp.html#a54">ModeIsListMode</a>(<span class="keywordtype">char</span> modechar, <span class="keywordtype">int</span> type) -00225 { -00226 <span class="keywordflow">for</span> (<a class="code" href="modules_8cpp.html#a51">ExtModeListIter</a> i = <a class="code" href="modules_8cpp.html#a52">EMode</a>.begin(); i < <a class="code" href="modules_8cpp.html#a52">EMode</a>.end(); i++) -00227 { -00228 <span class="keywordflow">if</span> ((i->modechar == modechar) && (i->type == type) && (i->list == <span class="keyword">true</span>)) -00229 { -00230 <span class="keywordflow">return</span> <span class="keyword">true</span>; -00231 } -00232 } -00233 <span class="keywordflow">return</span> <span class="keyword">false</span>; -00234 } -00235 -<a name="l00236"></a><a class="code" href="modules_8cpp.html#a55">00236</a> <span class="keywordtype">bool</span> <a class="code" href="modules_8cpp.html#a55">ModeDefinedOper</a>(<span class="keywordtype">char</span> modechar, <span class="keywordtype">int</span> type) -00237 { -00238 <span class="keywordflow">for</span> (<a class="code" href="modules_8cpp.html#a51">ExtModeListIter</a> i = <a class="code" href="modules_8cpp.html#a52">EMode</a>.begin(); i < <a class="code" href="modules_8cpp.html#a52">EMode</a>.end(); i++) -00239 { -00240 <span class="keywordflow">if</span> ((i->modechar == modechar) && (i->type == type) && (i->needsoper == <span class="keyword">true</span>)) -00241 { -00242 <span class="keywordflow">return</span> <span class="keyword">true</span>; -00243 } -00244 } -00245 <span class="keywordflow">return</span> <span class="keyword">false</span>; -00246 } -00247 -00248 <span class="comment">// returns number of parameters for a custom mode when it is switched on</span> -<a name="l00249"></a><a class="code" href="modules_8cpp.html#a56">00249</a> <span class="keywordtype">int</span> <a class="code" href="modules_8cpp.html#a56">ModeDefinedOn</a>(<span class="keywordtype">char</span> modechar, <span class="keywordtype">int</span> type) -00250 { -00251 <span class="keywordflow">for</span> (<a class="code" href="modules_8cpp.html#a51">ExtModeListIter</a> i = <a class="code" href="modules_8cpp.html#a52">EMode</a>.begin(); i < <a class="code" href="modules_8cpp.html#a52">EMode</a>.end(); i++) -00252 { -00253 <span class="keywordflow">if</span> ((i->modechar == modechar) && (i->type == type)) -00254 { -00255 <span class="keywordflow">return</span> i->params_when_on; -00256 } -00257 } -00258 <span class="keywordflow">return</span> 0; -00259 } -00260 -00261 <span class="comment">// returns number of parameters for a custom mode when it is switched on</span> -<a name="l00262"></a><a class="code" href="modules_8cpp.html#a57">00262</a> <span class="keywordtype">int</span> <a class="code" href="modules_8cpp.html#a57">ModeDefinedOff</a>(<span class="keywordtype">char</span> modechar, <span class="keywordtype">int</span> type) -00263 { -00264 <span class="keywordflow">for</span> (<a class="code" href="modules_8cpp.html#a51">ExtModeListIter</a> i = <a class="code" href="modules_8cpp.html#a52">EMode</a>.begin(); i < <a class="code" href="modules_8cpp.html#a52">EMode</a>.end(); i++) -00265 { -00266 <span class="keywordflow">if</span> ((i->modechar == modechar) && (i->type == type)) -00267 { -00268 <span class="keywordflow">return</span> i->params_when_off; -00269 } -00270 } -00271 <span class="keywordflow">return</span> 0; -00272 } -00273 -00274 <span class="comment">// returns true if an extended mode character is in use</span> -<a name="l00275"></a><a class="code" href="modules_8cpp.html#a58">00275</a> <span class="keywordtype">bool</span> <a class="code" href="modules_8cpp.html#a58">DoAddExtendedMode</a>(<span class="keywordtype">char</span> modechar, <span class="keywordtype">int</span> type, <span class="keywordtype">bool</span> requires_oper, <span class="keywordtype">int</span> params_on, <span class="keywordtype">int</span> params_off) -00276 { -00277 <span class="keywordflow">if</span> (<a class="code" href="modules_8cpp.html#a53">ModeDefined</a>(modechar,type)) { -00278 <span class="keywordflow">return</span> <span class="keyword">false</span>; +<a name="l00191"></a><a class="code" href="modules_8cpp.html#a43">00191</a> <span class="keyword">extern</span> <a class="code" href="modules_8cpp.html#a39">user_hash</a> <a class="code" href="modules_8cpp.html#a43">clientlist</a>; +<a name="l00192"></a><a class="code" href="modules_8cpp.html#a44">00192</a> <span class="keyword">extern</span> <a class="code" href="modules_8cpp.html#a40">chan_hash</a> <a class="code" href="modules_8cpp.html#a44">chanlist</a>; +<a name="l00193"></a><a class="code" href="modules_8cpp.html#a45">00193</a> <span class="keyword">extern</span> <a class="code" href="modules_8cpp.html#a39">user_hash</a> <a class="code" href="modules_8cpp.html#a45">whowas</a>; +<a name="l00194"></a><a class="code" href="modules_8cpp.html#a46">00194</a> <span class="keyword">extern</span> <a class="code" href="modules_8cpp.html#a42">command_table</a> <a class="code" href="modules_8cpp.html#a46">cmdlist</a>; +<a name="l00195"></a><a class="code" href="modules_8cpp.html#a47">00195</a> <span class="keyword">extern</span> <a class="code" href="modules_8h.html#a31">file_cache</a> <a class="code" href="modules_8cpp.html#a47">MOTD</a>; +<a name="l00196"></a><a class="code" href="modules_8cpp.html#a48">00196</a> <span class="keyword">extern</span> <a class="code" href="modules_8h.html#a31">file_cache</a> <a class="code" href="modules_8cpp.html#a48">RULES</a>; +<a name="l00197"></a><a class="code" href="modules_8cpp.html#a49">00197</a> <span class="keyword">extern</span> <a class="code" href="modules_8cpp.html#a41">address_cache</a> <a class="code" href="modules_8cpp.html#a49">IP</a>; +00198 +00199 +00200 <span class="comment">// class type for holding an extended mode character - internal to core</span> +00201 +<a name="l00202"></a><a class="code" href="classExtMode.html">00202</a> <span class="keyword">class </span><a class="code" href="classExtMode.html">ExtMode</a> : <span class="keyword">public</span> <a class="code" href="classclassbase.html">classbase</a> +00203 { +00204 <span class="keyword">public</span>: +<a name="l00205"></a><a class="code" href="classExtMode.html#o0">00205</a> <span class="keywordtype">char</span> <a class="code" href="classExtMode.html#o0">modechar</a>; +<a name="l00206"></a><a class="code" href="classExtMode.html#o1">00206</a> <span class="keywordtype">int</span> <a class="code" href="classExtMode.html#o1">type</a>; +<a name="l00207"></a><a class="code" href="classExtMode.html#o2">00207</a> <span class="keywordtype">int</span> <a class="code" href="classExtMode.html#o2">params_when_on</a>; +<a name="l00208"></a><a class="code" href="classExtMode.html#o3">00208</a> <span class="keywordtype">int</span> <a class="code" href="classExtMode.html#o3">params_when_off</a>; +<a name="l00209"></a><a class="code" href="classExtMode.html#o4">00209</a> <span class="keywordtype">bool</span> <a class="code" href="classExtMode.html#o4">needsoper</a>; +<a name="l00210"></a><a class="code" href="classExtMode.html#o5">00210</a> <span class="keywordtype">bool</span> <a class="code" href="channels_8cpp.html#a15">list</a>; +<a name="l00211"></a><a class="code" href="classExtMode.html#a0">00211</a> <a class="code" href="classExtMode.html#a0">ExtMode</a>(<span class="keywordtype">char</span> mc, <span class="keywordtype">int</span> ty, <span class="keywordtype">bool</span> oper, <span class="keywordtype">int</span> p_on, <span class="keywordtype">int</span> p_off) : <a class="code" href="classExtMode.html#o0">modechar</a>(mc), <a class="code" href="classExtMode.html#o1">type</a>(ty), <a class="code" href="classExtMode.html#o4">needsoper</a>(oper), <a class="code" href="classExtMode.html#o2">params_when_on</a>(p_on), <a class="code" href="classExtMode.html#o3">params_when_off</a>(p_off) { }; +00212 }; +00213 +<a name="l00214"></a><a class="code" href="modules_8cpp.html#a50">00214</a> <span class="keyword">typedef</span> std::vector<ExtMode> <a class="code" href="modules_8cpp.html#a50">ExtModeList</a>; +<a name="l00215"></a><a class="code" href="modules_8cpp.html#a51">00215</a> <span class="keyword">typedef</span> ExtModeList::iterator <a class="code" href="modules_8cpp.html#a51">ExtModeListIter</a>; +00216 +00217 +<a name="l00218"></a><a class="code" href="modules_8cpp.html#a52">00218</a> <a class="code" href="modules_8cpp.html#a50">ExtModeList</a> <a class="code" href="modules_8cpp.html#a52">EMode</a>; +00219 +00220 <span class="comment">// returns true if an extended mode character is in use</span> +<a name="l00221"></a><a class="code" href="modules_8cpp.html#a53">00221</a> <span class="keywordtype">bool</span> <a class="code" href="modules_8cpp.html#a53">ModeDefined</a>(<span class="keywordtype">char</span> modechar, <span class="keywordtype">int</span> type) +00222 { +00223 <span class="keywordflow">for</span> (<a class="code" href="modules_8cpp.html#a51">ExtModeListIter</a> i = <a class="code" href="modules_8cpp.html#a52">EMode</a>.begin(); i < <a class="code" href="modules_8cpp.html#a52">EMode</a>.end(); i++) +00224 { +00225 <span class="keywordflow">if</span> ((i->modechar == modechar) && (i->type == type)) +00226 { +00227 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00228 } +00229 } +00230 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00231 } +00232 +<a name="l00233"></a><a class="code" href="modules_8cpp.html#a54">00233</a> <span class="keywordtype">bool</span> <a class="code" href="modules_8cpp.html#a54">ModeIsListMode</a>(<span class="keywordtype">char</span> modechar, <span class="keywordtype">int</span> type) +00234 { +00235 <span class="keywordflow">for</span> (<a class="code" href="modules_8cpp.html#a51">ExtModeListIter</a> i = <a class="code" href="modules_8cpp.html#a52">EMode</a>.begin(); i < <a class="code" href="modules_8cpp.html#a52">EMode</a>.end(); i++) +00236 { +00237 <span class="keywordflow">if</span> ((i->modechar == modechar) && (i->type == type) && (i->list == <span class="keyword">true</span>)) +00238 { +00239 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00240 } +00241 } +00242 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00243 } +00244 +<a name="l00245"></a><a class="code" href="modules_8cpp.html#a55">00245</a> <span class="keywordtype">bool</span> <a class="code" href="modules_8cpp.html#a55">ModeDefinedOper</a>(<span class="keywordtype">char</span> modechar, <span class="keywordtype">int</span> type) +00246 { +00247 <span class="keywordflow">for</span> (<a class="code" href="modules_8cpp.html#a51">ExtModeListIter</a> i = <a class="code" href="modules_8cpp.html#a52">EMode</a>.begin(); i < <a class="code" href="modules_8cpp.html#a52">EMode</a>.end(); i++) +00248 { +00249 <span class="keywordflow">if</span> ((i->modechar == modechar) && (i->type == type) && (i->needsoper == <span class="keyword">true</span>)) +00250 { +00251 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00252 } +00253 } +00254 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00255 } +00256 +00257 <span class="comment">// returns number of parameters for a custom mode when it is switched on</span> +<a name="l00258"></a><a class="code" href="modules_8cpp.html#a56">00258</a> <span class="keywordtype">int</span> <a class="code" href="modules_8cpp.html#a56">ModeDefinedOn</a>(<span class="keywordtype">char</span> modechar, <span class="keywordtype">int</span> type) +00259 { +00260 <span class="keywordflow">for</span> (<a class="code" href="modules_8cpp.html#a51">ExtModeListIter</a> i = <a class="code" href="modules_8cpp.html#a52">EMode</a>.begin(); i < <a class="code" href="modules_8cpp.html#a52">EMode</a>.end(); i++) +00261 { +00262 <span class="keywordflow">if</span> ((i->modechar == modechar) && (i->type == type)) +00263 { +00264 <span class="keywordflow">return</span> i->params_when_on; +00265 } +00266 } +00267 <span class="keywordflow">return</span> 0; +00268 } +00269 +00270 <span class="comment">// returns number of parameters for a custom mode when it is switched on</span> +<a name="l00271"></a><a class="code" href="modules_8cpp.html#a57">00271</a> <span class="keywordtype">int</span> <a class="code" href="modules_8cpp.html#a57">ModeDefinedOff</a>(<span class="keywordtype">char</span> modechar, <span class="keywordtype">int</span> type) +00272 { +00273 <span class="keywordflow">for</span> (<a class="code" href="modules_8cpp.html#a51">ExtModeListIter</a> i = <a class="code" href="modules_8cpp.html#a52">EMode</a>.begin(); i < <a class="code" href="modules_8cpp.html#a52">EMode</a>.end(); i++) +00274 { +00275 <span class="keywordflow">if</span> ((i->modechar == modechar) && (i->type == type)) +00276 { +00277 <span class="keywordflow">return</span> i->params_when_off; +00278 } 00279 } -00280 <a class="code" href="modules_8cpp.html#a52">EMode</a>.push_back(<a class="code" href="classExtMode.html">ExtMode</a>(modechar,type,requires_oper,params_on,params_off)); -00281 <span class="keywordflow">return</span> <span class="keyword">true</span>; -00282 } -00283 -00284 <span class="comment">// turns a mode into a listmode</span> -<a name="l00285"></a><a class="code" href="modules_8cpp.html#a59">00285</a> <span class="keywordtype">void</span> <a class="code" href="modules_8cpp.html#a59">ModeMakeList</a>(<span class="keywordtype">char</span> modechar) -00286 { -00287 <span class="keywordflow">for</span> (<a class="code" href="modules_8cpp.html#a51">ExtModeListIter</a> i = <a class="code" href="modules_8cpp.html#a52">EMode</a>.begin(); i < <a class="code" href="modules_8cpp.html#a52">EMode</a>.end(); i++) -00288 { -00289 <span class="keywordflow">if</span> ((i->modechar == modechar) && (i->type == <a class="code" href="modules_8h.html#a5">MT_CHANNEL</a>)) -00290 { -00291 i->list = <span class="keyword">true</span>; -00292 <span class="keywordflow">return</span>; -00293 } -00294 } -00295 <span class="keywordflow">return</span>; -00296 } -00297 -00298 <span class="comment">// version is a simple class for holding a modules version number</span> -00299 -<a name="l00300"></a><a class="code" href="classVersion.html#a0">00300</a> <a class="code" href="classVersion.html#a0">Version::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, <span class="keywordtype">int</span> flags) : Major(major), Minor(minor), Revision(revision), Build(build), Flags(flags) { }; -00301 -00302 <span class="comment">// admin is a simple class for holding a server's administrative info</span> -00303 -<a name="l00304"></a><a class="code" href="classAdmin.html#a0">00304</a> <a class="code" href="classAdmin.html#a0">Admin::Admin</a>(std::string name, std::string email, std::string nick) : Name(name), Email(email), Nick(nick) { }; -00305 -<a name="l00306"></a><a class="code" href="classRequest.html#a0">00306</a> <a class="code" href="classRequest.html#a0">Request::Request</a>(<span class="keywordtype">char</span>* anydata, <a class="code" href="classModule.html">Module</a>* src, <a class="code" href="classModule.html">Module</a>* dst) : data(anydata), source(src), dest(dst) { }; -00307 -<a name="l00308"></a><a class="code" href="classRequest.html#a1">00308</a> <span class="keywordtype">char</span>* <a class="code" href="classRequest.html#a1">Request::GetData</a>() -00309 { -00310 <span class="keywordflow">return</span> this-><a class="code" href="classRequest.html#p0">data</a>; -00311 } +00280 <span class="keywordflow">return</span> 0; +00281 } +00282 +00283 <span class="comment">// returns true if an extended mode character is in use</span> +<a name="l00284"></a><a class="code" href="modules_8cpp.html#a58">00284</a> <span class="keywordtype">bool</span> <a class="code" href="modules_8cpp.html#a58">DoAddExtendedMode</a>(<span class="keywordtype">char</span> modechar, <span class="keywordtype">int</span> type, <span class="keywordtype">bool</span> requires_oper, <span class="keywordtype">int</span> params_on, <span class="keywordtype">int</span> params_off) +00285 { +00286 <span class="keywordflow">if</span> (<a class="code" href="modules_8cpp.html#a53">ModeDefined</a>(modechar,type)) { +00287 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00288 } +00289 <a class="code" href="modules_8cpp.html#a52">EMode</a>.push_back(<a class="code" href="classExtMode.html">ExtMode</a>(modechar,type,requires_oper,params_on,params_off)); +00290 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00291 } +00292 +00293 <span class="comment">// turns a mode into a listmode</span> +<a name="l00294"></a><a class="code" href="modules_8cpp.html#a59">00294</a> <span class="keywordtype">void</span> <a class="code" href="modules_8cpp.html#a59">ModeMakeList</a>(<span class="keywordtype">char</span> modechar) +00295 { +00296 <span class="keywordflow">for</span> (<a class="code" href="modules_8cpp.html#a51">ExtModeListIter</a> i = <a class="code" href="modules_8cpp.html#a52">EMode</a>.begin(); i < <a class="code" href="modules_8cpp.html#a52">EMode</a>.end(); i++) +00297 { +00298 <span class="keywordflow">if</span> ((i->modechar == modechar) && (i->type == <a class="code" href="modules_8h.html#a5">MT_CHANNEL</a>)) +00299 { +00300 i->list = <span class="keyword">true</span>; +00301 <span class="keywordflow">return</span>; +00302 } +00303 } +00304 <span class="keywordflow">return</span>; +00305 } +00306 +00307 <span class="comment">// version is a simple class for holding a modules version number</span> +00308 +<a name="l00309"></a><a class="code" href="classVersion.html#a0">00309</a> <a class="code" href="classVersion.html#a0">Version::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, <span class="keywordtype">int</span> flags) : Major(major), Minor(minor), Revision(revision), Build(build), Flags(flags) { }; +00310 +00311 <span class="comment">// admin is a simple class for holding a server's administrative info</span> 00312 -<a name="l00313"></a><a class="code" href="classRequest.html#a2">00313</a> <a class="code" href="classModule.html">Module</a>* <a class="code" href="classRequest.html#a2">Request::GetSource</a>() -00314 { -00315 <span class="keywordflow">return</span> this-><a class="code" href="classRequest.html#p1">source</a>; -00316 } -00317 -<a name="l00318"></a><a class="code" href="classRequest.html#a3">00318</a> <a class="code" href="classModule.html">Module</a>* <a class="code" href="classRequest.html#a3">Request::GetDest</a>() -00319 { -00320 <span class="keywordflow">return</span> this-><a class="code" href="classRequest.html#p2">dest</a>; -00321 } -00322 -<a name="l00323"></a><a class="code" href="classRequest.html#a4">00323</a> <span class="keywordtype">char</span>* <a class="code" href="classRequest.html#a4">Request::Send</a>() -00324 { -00325 <span class="keywordflow">if</span> (this-><a class="code" href="classRequest.html#p2">dest</a>) -00326 { -00327 <span class="keywordflow">return</span> <a class="code" href="classRequest.html#p2">dest</a>-><a class="code" href="classModule.html#a46">OnRequest</a>(<span class="keyword">this</span>); -00328 } -00329 <span class="keywordflow">else</span> -00330 { -00331 <span class="keywordflow">return</span> NULL; -00332 } -00333 } -00334 -<a name="l00335"></a><a class="code" href="classEvent.html#a0">00335</a> <a class="code" href="classEvent.html#a0">Event::Event</a>(<span class="keywordtype">char</span>* anydata, <a class="code" href="classModule.html">Module</a>* src, std::string eventid) : data(anydata), source(src), id(eventid) { }; -00336 -<a name="l00337"></a><a class="code" href="classEvent.html#a1">00337</a> <span class="keywordtype">char</span>* <a class="code" href="classEvent.html#a1">Event::GetData</a>() -00338 { -00339 <span class="keywordflow">return</span> this-><a class="code" href="classEvent.html#p0">data</a>; -00340 } -00341 -<a name="l00342"></a><a class="code" href="classEvent.html#a2">00342</a> <a class="code" href="classModule.html">Module</a>* <a class="code" href="classEvent.html#a2">Event::GetSource</a>() -00343 { -00344 <span class="keywordflow">return</span> this-><a class="code" href="classEvent.html#p1">source</a>; -00345 } -00346 -<a name="l00347"></a><a class="code" href="classEvent.html#a4">00347</a> <span class="keywordtype">char</span>* <a class="code" href="classEvent.html#a4">Event::Send</a>() -00348 { -00349 <a class="code" href="modules_8h.html#a24">FOREACH_MOD</a> OnEvent(<span class="keyword">this</span>); -00350 <span class="keywordflow">return</span> NULL; -00351 } -00352 -<a name="l00353"></a><a class="code" href="classEvent.html#a3">00353</a> std::string <a class="code" href="classEvent.html#a3">Event::GetEventID</a>() -00354 { -00355 <span class="keywordflow">return</span> this-><a class="code" href="classEvent.html#p2">id</a>; -00356 } -00357 -00358 -00359 <span class="comment">// These declarations define the behavours of the base class Module (which does nothing at all)</span> -<a name="l00360"></a><a class="code" href="classModule.html#a0">00360</a> <a class="code" href="classModule.html#a0">Module::Module</a>() { } -<a name="l00361"></a><a class="code" href="classModule.html#a1">00361</a> <a class="code" href="classModule.html#a1">Module::~Module</a>() { } -<a name="l00362"></a><a class="code" href="classModule.html#a3">00362</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a3">Module::OnUserConnect</a>(<a class="code" href="classuserrec.html">userrec</a>* user) { } -<a name="l00363"></a><a class="code" href="classModule.html#a4">00363</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a4">Module::OnUserQuit</a>(<a class="code" href="classuserrec.html">userrec</a>* user) { } -<a name="l00364"></a><a class="code" href="classModule.html#a5">00364</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a5">Module::OnUserDisconnect</a>(<a class="code" href="classuserrec.html">userrec</a>* user) { } -<a name="l00365"></a><a class="code" href="classModule.html#a6">00365</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a6">Module::OnUserJoin</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* channel) { } -<a name="l00366"></a><a class="code" href="classModule.html#a7">00366</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a7">Module::OnUserPart</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* channel) { } -<a name="l00367"></a><a class="code" href="classModule.html#a8">00367</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a8">Module::OnPacketTransmit</a>(std::string &data, std::string serv) { } -<a name="l00368"></a><a class="code" href="classModule.html#a9">00368</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a9">Module::OnPacketReceive</a>(std::string &data, std::string serv) { } -<a name="l00369"></a><a class="code" href="classModule.html#a10">00369</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a10">Module::OnRehash</a>() { } -<a name="l00370"></a><a class="code" href="classModule.html#a11">00370</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a11">Module::OnServerRaw</a>(std::string &raw, <span class="keywordtype">bool</span> inbound, <a class="code" href="classuserrec.html">userrec</a>* user) { } -<a name="l00371"></a><a class="code" href="classModule.html#a13">00371</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a13">Module::OnUserPreJoin</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* chan, <span class="keyword">const</span> <span class="keywordtype">char</span>* cname) { <span class="keywordflow">return</span> 0; } -<a name="l00372"></a><a class="code" href="classModule.html#a12">00372</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a12">Module::OnExtendedMode</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <span class="keywordtype">void</span>* target, <span class="keywordtype">char</span> modechar, <span class="keywordtype">int</span> type, <span class="keywordtype">bool</span> mode_on, string_list &params) { <span class="keywordflow">return</span> <span class="keyword">false</span>; } -<a name="l00373"></a><a class="code" href="classModule.html#a2">00373</a> <a class="code" href="classVersion.html">Version</a> <a class="code" href="classModule.html#a2">Module::GetVersion</a>() { <span class="keywordflow">return</span> <a class="code" href="classVersion.html">Version</a>(1,0,0,0,<a class="code" href="modules_8h.html#a21">VF_VENDOR</a>); } -<a name="l00374"></a><a class="code" href="classModule.html#a16">00374</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a16">Module::OnOper</a>(<a class="code" href="classuserrec.html">userrec</a>* user) { }; -<a name="l00375"></a><a class="code" href="classModule.html#a17">00375</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a17">Module::OnInfo</a>(<a class="code" href="classuserrec.html">userrec</a>* user) { }; -<a name="l00376"></a><a class="code" href="classModule.html#a18">00376</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a18">Module::OnWhois</a>(<a class="code" href="classuserrec.html">userrec</a>* source, <a class="code" href="classuserrec.html">userrec</a>* dest) { }; -<a name="l00377"></a><a class="code" href="classModule.html#a19">00377</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a19">Module::OnUserPreInvite</a>(<a class="code" href="classuserrec.html">userrec</a>* source,<a class="code" href="classuserrec.html">userrec</a>* dest,<a class="code" href="classchanrec.html">chanrec</a>* channel) { <span class="keywordflow">return</span> 0; }; -<a name="l00378"></a><a class="code" href="classModule.html#a20">00378</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a20">Module::OnUserPreMessage</a>(<a class="code" href="classuserrec.html">userrec</a>* user,<span class="keywordtype">void</span>* dest,<span class="keywordtype">int</span> target_type, std::string &text) { <span class="keywordflow">return</span> 0; }; -<a name="l00379"></a><a class="code" href="classModule.html#a21">00379</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a21">Module::OnUserPreNotice</a>(<a class="code" href="classuserrec.html">userrec</a>* user,<span class="keywordtype">void</span>* dest,<span class="keywordtype">int</span> target_type, std::string &text) { <span class="keywordflow">return</span> 0; }; -<a name="l00380"></a><a class="code" href="classModule.html#a22">00380</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a22">Module::OnUserPreNick</a>(<a class="code" href="classuserrec.html">userrec</a>* user, std::string newnick) { <span class="keywordflow">return</span> 0; }; -<a name="l00381"></a><a class="code" href="classModule.html#a23">00381</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a23">Module::OnUserPostNick</a>(<a class="code" href="classuserrec.html">userrec</a>* user, std::string oldnick) { }; -<a name="l00382"></a><a class="code" href="classModule.html#a24">00382</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a24">Module::OnAccessCheck</a>(<a class="code" href="classuserrec.html">userrec</a>* source,<a class="code" href="classuserrec.html">userrec</a>* dest,<a class="code" href="classchanrec.html">chanrec</a>* channel,<span class="keywordtype">int</span> access_type) { <span class="keywordflow">return</span> <a class="code" href="modules_8h.html#a8">ACR_DEFAULT</a>; }; -<a name="l00383"></a><a class="code" href="classModule.html#a25">00383</a> <a class="code" href="modules_8h.html#a32">string_list</a> <a class="code" href="classModule.html#a25">Module::OnUserSync</a>(<a class="code" href="classuserrec.html">userrec</a>* user) { <a class="code" href="modules_8h.html#a32">string_list</a> empty; <span class="keywordflow">return</span> empty; } -<a name="l00384"></a><a class="code" href="classModule.html#a26">00384</a> <a class="code" href="modules_8h.html#a32">string_list</a> <a class="code" href="classModule.html#a26">Module::OnChannelSync</a>(<a class="code" href="classchanrec.html">chanrec</a>* chan) { <a class="code" href="modules_8h.html#a32">string_list</a> empty; <span class="keywordflow">return</span> empty; } -<a name="l00385"></a><a class="code" href="classModule.html#a27">00385</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a27">Module::On005Numeric</a>(std::string &output) { }; -<a name="l00386"></a><a class="code" href="classModule.html#a28">00386</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a28">Module::OnKill</a>(<a class="code" href="classuserrec.html">userrec</a>* source, <a class="code" href="classuserrec.html">userrec</a>* dest, std::string reason) { <span class="keywordflow">return</span> 0; }; -<a name="l00387"></a><a class="code" href="classModule.html#a29">00387</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a29">Module::OnLoadModule</a>(<a class="code" href="classModule.html">Module</a>* mod,std::string name) { }; -<a name="l00388"></a><a class="code" href="classModule.html#a30">00388</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a30">Module::OnBackgroundTimer</a>(time_t curtime) { }; -<a name="l00389"></a><a class="code" href="classModule.html#a31">00389</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a31">Module::OnSendList</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* channel, <span class="keywordtype">char</span> mode) { }; -<a name="l00390"></a><a class="code" href="classModule.html#a32">00390</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a32">Module::OnPreCommand</a>(std::string command, <span class="keywordtype">char</span> **parameters, <span class="keywordtype">int</span> pcnt, <a class="code" href="classuserrec.html">userrec</a> *user) { <span class="keywordflow">return</span> 0; }; -<a name="l00391"></a><a class="code" href="classModule.html#a33">00391</a> <span class="keywordtype">bool</span> <a class="code" href="classModule.html#a33">Module::OnCheckReady</a>(<a class="code" href="classuserrec.html">userrec</a>* user) { <span class="keywordflow">return</span> <span class="keyword">true</span>; }; -<a name="l00392"></a><a class="code" href="classModule.html#a34">00392</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a34">Module::OnUserRegister</a>(<a class="code" href="classuserrec.html">userrec</a>* user) { }; -<a name="l00393"></a><a class="code" href="classModule.html#a14">00393</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a14">Module::OnUserPreKick</a>(<a class="code" href="classuserrec.html">userrec</a>* source, <a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* chan, std::string reason) { <span class="keywordflow">return</span> 0; }; -<a name="l00394"></a><a class="code" href="classModule.html#a15">00394</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a15">Module::OnUserKick</a>(<a class="code" href="classuserrec.html">userrec</a>* source, <a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* chan, std::string reason) { }; -<a name="l00395"></a><a class="code" href="classModule.html#a35">00395</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a35">Module::OnRawMode</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* chan, <span class="keywordtype">char</span> mode, std::string param, <span class="keywordtype">bool</span> adding, <span class="keywordtype">int</span> pcnt) { <span class="keywordflow">return</span> 0; }; -<a name="l00396"></a><a class="code" href="classModule.html#a36">00396</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a36">Module::OnCheckInvite</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* chan) { <span class="keywordflow">return</span> 0; }; -<a name="l00397"></a><a class="code" href="classModule.html#a37">00397</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a37">Module::OnCheckKey</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* chan, std::string keygiven) { <span class="keywordflow">return</span> 0; }; -<a name="l00398"></a><a class="code" href="classModule.html#a38">00398</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a38">Module::OnCheckLimit</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* chan) { <span class="keywordflow">return</span> 0; }; -<a name="l00399"></a><a class="code" href="classModule.html#a39">00399</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a39">Module::OnCheckBan</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* chan) { <span class="keywordflow">return</span> 0; }; -<a name="l00400"></a><a class="code" href="classModule.html#a40">00400</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a40">Module::OnStats</a>(<span class="keywordtype">char</span> symbol) { }; -<a name="l00401"></a><a class="code" href="classModule.html#a41">00401</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a41">Module::OnChangeLocalUserHost</a>(<a class="code" href="classuserrec.html">userrec</a>* user, std::string newhost) { <span class="keywordflow">return</span> 0; }; -<a name="l00402"></a><a class="code" href="classModule.html#a42">00402</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a42">Module::OnChangeLocalUserGECOS</a>(<a class="code" href="classuserrec.html">userrec</a>* user, std::string newhost) { <span class="keywordflow">return</span> 0; }; -<a name="l00403"></a><a class="code" href="classModule.html#a43">00403</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a43">Module::OnLocalTopicChange</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* chan, std::string topic) { <span class="keywordflow">return</span> 0; }; -<a name="l00404"></a><a class="code" href="classModule.html#a44">00404</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a44">Module::OnMeshToken</a>(<span class="keywordtype">char</span> token,string_list params,<a class="code" href="classserverrec.html">serverrec</a>* source,<a class="code" href="classserverrec.html">serverrec</a>* reply, std::string tcp_host,std::string ipaddr,<span class="keywordtype">int</span> port) { <span class="keywordflow">return</span> 0; }; -<a name="l00405"></a><a class="code" href="classModule.html#a45">00405</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a45">Module::OnEvent</a>(<a class="code" href="classEvent.html">Event</a>* event) { <span class="keywordflow">return</span>; }; -<a name="l00406"></a><a class="code" href="classModule.html#a46">00406</a> <span class="keywordtype">char</span>* <a class="code" href="classModule.html#a46">Module::OnRequest</a>(<a class="code" href="classRequest.html">Request</a>* request) { <span class="keywordflow">return</span> NULL; }; -<a name="l00407"></a><a class="code" href="classModule.html#a47">00407</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a47">Module::OnOperCompare</a>(std::string password, std::string input) { <span class="keywordflow">return</span> 0; }; -<a name="l00408"></a><a class="code" href="classModule.html#a48">00408</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a48">Module::OnGlobalOper</a>(<a class="code" href="classuserrec.html">userrec</a>* user) { }; -<a name="l00409"></a><a class="code" href="classModule.html#a49">00409</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a49">Module::OnGlobalConnect</a>(<a class="code" href="classuserrec.html">userrec</a>* user) { }; -<a name="l00410"></a><a class="code" href="classModule.html#a50">00410</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a50">Module::OnAddBan</a>(<a class="code" href="classuserrec.html">userrec</a>* source, <a class="code" href="classchanrec.html">chanrec</a>* channel,std::string banmask) { <span class="keywordflow">return</span> 0; }; -<a name="l00411"></a><a class="code" href="classModule.html#a51">00411</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a51">Module::OnDelBan</a>(<a class="code" href="classuserrec.html">userrec</a>* source, <a class="code" href="classchanrec.html">chanrec</a>* channel,std::string banmask) { <span class="keywordflow">return</span> 0; }; -<a name="l00412"></a><a class="code" href="classModule.html#a52">00412</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a52">Module::OnRawSocketAccept</a>(<span class="keywordtype">int</span> fd, std::string ip, <span class="keywordtype">int</span> localport) { }; -<a name="l00413"></a><a class="code" href="classModule.html#a53">00413</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a53">Module::OnRawSocketWrite</a>(<span class="keywordtype">int</span> fd, <span class="keywordtype">char</span>* buffer, <span class="keywordtype">int</span> count) { <span class="keywordflow">return</span> 0; }; -<a name="l00414"></a><a class="code" href="classModule.html#a54">00414</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a54">Module::OnRawSocketClose</a>(<span class="keywordtype">int</span> fd) { }; -<a name="l00415"></a><a class="code" href="classModule.html#a55">00415</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a55">Module::OnRawSocketRead</a>(<span class="keywordtype">int</span> fd, <span class="keywordtype">char</span>* buffer, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> count, <span class="keywordtype">int</span> &readresult) { <span class="keywordflow">return</span> 0; }; -00416 -00417 <span class="comment">// server is a wrapper class that provides methods to all of the C-style</span> -00418 <span class="comment">// exports in the core</span> -00419 <span class="comment">//</span> -00420 -<a name="l00421"></a><a class="code" href="classServer.html#a0">00421</a> <a class="code" href="classServer.html#a0">Server::Server</a>() -00422 { -00423 } -00424 -<a name="l00425"></a><a class="code" href="classServer.html#a1">00425</a> <a class="code" href="classServer.html#a1">Server::~Server</a>() -00426 { -00427 } -00428 -<a name="l00429"></a><a class="code" href="classServer.html#a2">00429</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a2">Server::SendOpers</a>(std::string s) -00430 { -00431 WriteOpers(<span class="stringliteral">"%s"</span>,s.c_str()); +<a name="l00313"></a><a class="code" href="classAdmin.html#a0">00313</a> <a class="code" href="classAdmin.html#a0">Admin::Admin</a>(std::string name, std::string email, std::string nick) : Name(name), Email(email), Nick(nick) { }; +00314 +<a name="l00315"></a><a class="code" href="classRequest.html#a0">00315</a> <a class="code" href="classRequest.html#a0">Request::Request</a>(<span class="keywordtype">char</span>* anydata, <a class="code" href="classModule.html">Module</a>* src, <a class="code" href="classModule.html">Module</a>* dst) : data(anydata), source(src), dest(dst) { }; +00316 +<a name="l00317"></a><a class="code" href="classRequest.html#a1">00317</a> <span class="keywordtype">char</span>* <a class="code" href="classRequest.html#a1">Request::GetData</a>() +00318 { +00319 <span class="keywordflow">return</span> this-><a class="code" href="classRequest.html#p0">data</a>; +00320 } +00321 +<a name="l00322"></a><a class="code" href="classRequest.html#a2">00322</a> <a class="code" href="classModule.html">Module</a>* <a class="code" href="classRequest.html#a2">Request::GetSource</a>() +00323 { +00324 <span class="keywordflow">return</span> this-><a class="code" href="classRequest.html#p1">source</a>; +00325 } +00326 +<a name="l00327"></a><a class="code" href="classRequest.html#a3">00327</a> <a class="code" href="classModule.html">Module</a>* <a class="code" href="classRequest.html#a3">Request::GetDest</a>() +00328 { +00329 <span class="keywordflow">return</span> this-><a class="code" href="classRequest.html#p2">dest</a>; +00330 } +00331 +<a name="l00332"></a><a class="code" href="classRequest.html#a4">00332</a> <span class="keywordtype">char</span>* <a class="code" href="classRequest.html#a4">Request::Send</a>() +00333 { +00334 <span class="keywordflow">if</span> (this-><a class="code" href="classRequest.html#p2">dest</a>) +00335 { +00336 <span class="keywordflow">return</span> <a class="code" href="classRequest.html#p2">dest</a>-><a class="code" href="classModule.html#a46">OnRequest</a>(<span class="keyword">this</span>); +00337 } +00338 <span class="keywordflow">else</span> +00339 { +00340 <span class="keywordflow">return</span> NULL; +00341 } +00342 } +00343 +<a name="l00344"></a><a class="code" href="classEvent.html#a0">00344</a> <a class="code" href="classEvent.html#a0">Event::Event</a>(<span class="keywordtype">char</span>* anydata, <a class="code" href="classModule.html">Module</a>* src, std::string eventid) : data(anydata), source(src), id(eventid) { }; +00345 +<a name="l00346"></a><a class="code" href="classEvent.html#a1">00346</a> <span class="keywordtype">char</span>* <a class="code" href="classEvent.html#a1">Event::GetData</a>() +00347 { +00348 <span class="keywordflow">return</span> this-><a class="code" href="classEvent.html#p0">data</a>; +00349 } +00350 +<a name="l00351"></a><a class="code" href="classEvent.html#a2">00351</a> <a class="code" href="classModule.html">Module</a>* <a class="code" href="classEvent.html#a2">Event::GetSource</a>() +00352 { +00353 <span class="keywordflow">return</span> this-><a class="code" href="classEvent.html#p1">source</a>; +00354 } +00355 +<a name="l00356"></a><a class="code" href="classEvent.html#a4">00356</a> <span class="keywordtype">char</span>* <a class="code" href="classEvent.html#a4">Event::Send</a>() +00357 { +00358 <a class="code" href="modules_8h.html#a24">FOREACH_MOD</a> OnEvent(<span class="keyword">this</span>); +00359 <span class="keywordflow">return</span> NULL; +00360 } +00361 +<a name="l00362"></a><a class="code" href="classEvent.html#a3">00362</a> std::string <a class="code" href="classEvent.html#a3">Event::GetEventID</a>() +00363 { +00364 <span class="keywordflow">return</span> this-><a class="code" href="classEvent.html#p2">id</a>; +00365 } +00366 +00367 +00368 <span class="comment">// These declarations define the behavours of the base class Module (which does nothing at all)</span> +<a name="l00369"></a><a class="code" href="classModule.html#a0">00369</a> <a class="code" href="classModule.html#a0">Module::Module</a>() { } +<a name="l00370"></a><a class="code" href="classModule.html#a1">00370</a> <a class="code" href="classModule.html#a1">Module::~Module</a>() { } +<a name="l00371"></a><a class="code" href="classModule.html#a3">00371</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a3">Module::OnUserConnect</a>(<a class="code" href="classuserrec.html">userrec</a>* user) { } +<a name="l00372"></a><a class="code" href="classModule.html#a4">00372</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a4">Module::OnUserQuit</a>(<a class="code" href="classuserrec.html">userrec</a>* user) { } +<a name="l00373"></a><a class="code" href="classModule.html#a5">00373</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a5">Module::OnUserDisconnect</a>(<a class="code" href="classuserrec.html">userrec</a>* user) { } +<a name="l00374"></a><a class="code" href="classModule.html#a6">00374</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a6">Module::OnUserJoin</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* channel) { } +<a name="l00375"></a><a class="code" href="classModule.html#a7">00375</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a7">Module::OnUserPart</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* channel) { } +<a name="l00376"></a><a class="code" href="classModule.html#a8">00376</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a8">Module::OnPacketTransmit</a>(std::string &data, std::string serv) { } +<a name="l00377"></a><a class="code" href="classModule.html#a9">00377</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a9">Module::OnPacketReceive</a>(std::string &data, std::string serv) { } +<a name="l00378"></a><a class="code" href="classModule.html#a10">00378</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a10">Module::OnRehash</a>() { } +<a name="l00379"></a><a class="code" href="classModule.html#a11">00379</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a11">Module::OnServerRaw</a>(std::string &raw, <span class="keywordtype">bool</span> inbound, <a class="code" href="classuserrec.html">userrec</a>* user) { } +<a name="l00380"></a><a class="code" href="classModule.html#a13">00380</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a13">Module::OnUserPreJoin</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* chan, <span class="keyword">const</span> <span class="keywordtype">char</span>* cname) { <span class="keywordflow">return</span> 0; } +<a name="l00381"></a><a class="code" href="classModule.html#a12">00381</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a12">Module::OnExtendedMode</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <span class="keywordtype">void</span>* target, <span class="keywordtype">char</span> modechar, <span class="keywordtype">int</span> type, <span class="keywordtype">bool</span> mode_on, string_list &params) { <span class="keywordflow">return</span> <span class="keyword">false</span>; } +<a name="l00382"></a><a class="code" href="classModule.html#a2">00382</a> <a class="code" href="classVersion.html">Version</a> <a class="code" href="classModule.html#a2">Module::GetVersion</a>() { <span class="keywordflow">return</span> <a class="code" href="classVersion.html">Version</a>(1,0,0,0,<a class="code" href="modules_8h.html#a21">VF_VENDOR</a>); } +<a name="l00383"></a><a class="code" href="classModule.html#a16">00383</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a16">Module::OnOper</a>(<a class="code" href="classuserrec.html">userrec</a>* user) { }; +<a name="l00384"></a><a class="code" href="classModule.html#a17">00384</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a17">Module::OnInfo</a>(<a class="code" href="classuserrec.html">userrec</a>* user) { }; +<a name="l00385"></a><a class="code" href="classModule.html#a18">00385</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a18">Module::OnWhois</a>(<a class="code" href="classuserrec.html">userrec</a>* source, <a class="code" href="classuserrec.html">userrec</a>* dest) { }; +<a name="l00386"></a><a class="code" href="classModule.html#a19">00386</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a19">Module::OnUserPreInvite</a>(<a class="code" href="classuserrec.html">userrec</a>* source,<a class="code" href="classuserrec.html">userrec</a>* dest,<a class="code" href="classchanrec.html">chanrec</a>* channel) { <span class="keywordflow">return</span> 0; }; +<a name="l00387"></a><a class="code" href="classModule.html#a20">00387</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a20">Module::OnUserPreMessage</a>(<a class="code" href="classuserrec.html">userrec</a>* user,<span class="keywordtype">void</span>* dest,<span class="keywordtype">int</span> target_type, std::string &text) { <span class="keywordflow">return</span> 0; }; +<a name="l00388"></a><a class="code" href="classModule.html#a21">00388</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a21">Module::OnUserPreNotice</a>(<a class="code" href="classuserrec.html">userrec</a>* user,<span class="keywordtype">void</span>* dest,<span class="keywordtype">int</span> target_type, std::string &text) { <span class="keywordflow">return</span> 0; }; +<a name="l00389"></a><a class="code" href="classModule.html#a22">00389</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a22">Module::OnUserPreNick</a>(<a class="code" href="classuserrec.html">userrec</a>* user, std::string newnick) { <span class="keywordflow">return</span> 0; }; +<a name="l00390"></a><a class="code" href="classModule.html#a23">00390</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a23">Module::OnUserPostNick</a>(<a class="code" href="classuserrec.html">userrec</a>* user, std::string oldnick) { }; +<a name="l00391"></a><a class="code" href="classModule.html#a24">00391</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a24">Module::OnAccessCheck</a>(<a class="code" href="classuserrec.html">userrec</a>* source,<a class="code" href="classuserrec.html">userrec</a>* dest,<a class="code" href="classchanrec.html">chanrec</a>* channel,<span class="keywordtype">int</span> access_type) { <span class="keywordflow">return</span> <a class="code" href="modules_8h.html#a8">ACR_DEFAULT</a>; }; +<a name="l00392"></a><a class="code" href="classModule.html#a25">00392</a> <a class="code" href="modules_8h.html#a32">string_list</a> <a class="code" href="classModule.html#a25">Module::OnUserSync</a>(<a class="code" href="classuserrec.html">userrec</a>* user) { <a class="code" href="modules_8h.html#a32">string_list</a> empty; <span class="keywordflow">return</span> empty; } +<a name="l00393"></a><a class="code" href="classModule.html#a26">00393</a> <a class="code" href="modules_8h.html#a32">string_list</a> <a class="code" href="classModule.html#a26">Module::OnChannelSync</a>(<a class="code" href="classchanrec.html">chanrec</a>* chan) { <a class="code" href="modules_8h.html#a32">string_list</a> empty; <span class="keywordflow">return</span> empty; } +<a name="l00394"></a><a class="code" href="classModule.html#a27">00394</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a27">Module::On005Numeric</a>(std::string &output) { }; +<a name="l00395"></a><a class="code" href="classModule.html#a28">00395</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a28">Module::OnKill</a>(<a class="code" href="classuserrec.html">userrec</a>* source, <a class="code" href="classuserrec.html">userrec</a>* dest, std::string reason) { <span class="keywordflow">return</span> 0; }; +<a name="l00396"></a><a class="code" href="classModule.html#a29">00396</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a29">Module::OnLoadModule</a>(<a class="code" href="classModule.html">Module</a>* mod,std::string name) { }; +<a name="l00397"></a><a class="code" href="classModule.html#a30">00397</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a30">Module::OnBackgroundTimer</a>(time_t curtime) { }; +<a name="l00398"></a><a class="code" href="classModule.html#a31">00398</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a31">Module::OnSendList</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* channel, <span class="keywordtype">char</span> mode) { }; +<a name="l00399"></a><a class="code" href="classModule.html#a32">00399</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a32">Module::OnPreCommand</a>(std::string command, <span class="keywordtype">char</span> **parameters, <span class="keywordtype">int</span> pcnt, <a class="code" href="classuserrec.html">userrec</a> *user) { <span class="keywordflow">return</span> 0; }; +<a name="l00400"></a><a class="code" href="classModule.html#a33">00400</a> <span class="keywordtype">bool</span> <a class="code" href="classModule.html#a33">Module::OnCheckReady</a>(<a class="code" href="classuserrec.html">userrec</a>* user) { <span class="keywordflow">return</span> <span class="keyword">true</span>; }; +<a name="l00401"></a><a class="code" href="classModule.html#a34">00401</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a34">Module::OnUserRegister</a>(<a class="code" href="classuserrec.html">userrec</a>* user) { }; +<a name="l00402"></a><a class="code" href="classModule.html#a14">00402</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a14">Module::OnUserPreKick</a>(<a class="code" href="classuserrec.html">userrec</a>* source, <a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* chan, std::string reason) { <span class="keywordflow">return</span> 0; }; +<a name="l00403"></a><a class="code" href="classModule.html#a15">00403</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a15">Module::OnUserKick</a>(<a class="code" href="classuserrec.html">userrec</a>* source, <a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* chan, std::string reason) { }; +<a name="l00404"></a><a class="code" href="classModule.html#a35">00404</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a35">Module::OnRawMode</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* chan, <span class="keywordtype">char</span> mode, std::string param, <span class="keywordtype">bool</span> adding, <span class="keywordtype">int</span> pcnt) { <span class="keywordflow">return</span> 0; }; +<a name="l00405"></a><a class="code" href="classModule.html#a36">00405</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a36">Module::OnCheckInvite</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* chan) { <span class="keywordflow">return</span> 0; }; +<a name="l00406"></a><a class="code" href="classModule.html#a37">00406</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a37">Module::OnCheckKey</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* chan, std::string keygiven) { <span class="keywordflow">return</span> 0; }; +<a name="l00407"></a><a class="code" href="classModule.html#a38">00407</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a38">Module::OnCheckLimit</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* chan) { <span class="keywordflow">return</span> 0; }; +<a name="l00408"></a><a class="code" href="classModule.html#a39">00408</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a39">Module::OnCheckBan</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* chan) { <span class="keywordflow">return</span> 0; }; +<a name="l00409"></a><a class="code" href="classModule.html#a40">00409</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a40">Module::OnStats</a>(<span class="keywordtype">char</span> symbol) { }; +<a name="l00410"></a><a class="code" href="classModule.html#a41">00410</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a41">Module::OnChangeLocalUserHost</a>(<a class="code" href="classuserrec.html">userrec</a>* user, std::string newhost) { <span class="keywordflow">return</span> 0; }; +<a name="l00411"></a><a class="code" href="classModule.html#a42">00411</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a42">Module::OnChangeLocalUserGECOS</a>(<a class="code" href="classuserrec.html">userrec</a>* user, std::string newhost) { <span class="keywordflow">return</span> 0; }; +<a name="l00412"></a><a class="code" href="classModule.html#a43">00412</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a43">Module::OnLocalTopicChange</a>(<a class="code" href="classuserrec.html">userrec</a>* user, <a class="code" href="classchanrec.html">chanrec</a>* chan, std::string topic) { <span class="keywordflow">return</span> 0; }; +<a name="l00413"></a><a class="code" href="classModule.html#a44">00413</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a44">Module::OnMeshToken</a>(<span class="keywordtype">char</span> token,string_list params,<a class="code" href="classserverrec.html">serverrec</a>* source,<a class="code" href="classserverrec.html">serverrec</a>* reply, std::string tcp_host,std::string ipaddr,<span class="keywordtype">int</span> port) { <span class="keywordflow">return</span> 0; }; +<a name="l00414"></a><a class="code" href="classModule.html#a45">00414</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a45">Module::OnEvent</a>(<a class="code" href="classEvent.html">Event</a>* event) { <span class="keywordflow">return</span>; }; +<a name="l00415"></a><a class="code" href="classModule.html#a46">00415</a> <span class="keywordtype">char</span>* <a class="code" href="classModule.html#a46">Module::OnRequest</a>(<a class="code" href="classRequest.html">Request</a>* request) { <span class="keywordflow">return</span> NULL; }; +<a name="l00416"></a><a class="code" href="classModule.html#a47">00416</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a47">Module::OnOperCompare</a>(std::string password, std::string input) { <span class="keywordflow">return</span> 0; }; +<a name="l00417"></a><a class="code" href="classModule.html#a48">00417</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a48">Module::OnGlobalOper</a>(<a class="code" href="classuserrec.html">userrec</a>* user) { }; +<a name="l00418"></a><a class="code" href="classModule.html#a49">00418</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a49">Module::OnGlobalConnect</a>(<a class="code" href="classuserrec.html">userrec</a>* user) { }; +<a name="l00419"></a><a class="code" href="classModule.html#a50">00419</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a50">Module::OnAddBan</a>(<a class="code" href="classuserrec.html">userrec</a>* source, <a class="code" href="classchanrec.html">chanrec</a>* channel,std::string banmask) { <span class="keywordflow">return</span> 0; }; +<a name="l00420"></a><a class="code" href="classModule.html#a51">00420</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a51">Module::OnDelBan</a>(<a class="code" href="classuserrec.html">userrec</a>* source, <a class="code" href="classchanrec.html">chanrec</a>* channel,std::string banmask) { <span class="keywordflow">return</span> 0; }; +<a name="l00421"></a><a class="code" href="classModule.html#a52">00421</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a52">Module::OnRawSocketAccept</a>(<span class="keywordtype">int</span> fd, std::string ip, <span class="keywordtype">int</span> localport) { }; +<a name="l00422"></a><a class="code" href="classModule.html#a53">00422</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a53">Module::OnRawSocketWrite</a>(<span class="keywordtype">int</span> fd, <span class="keywordtype">char</span>* buffer, <span class="keywordtype">int</span> count) { <span class="keywordflow">return</span> 0; }; +<a name="l00423"></a><a class="code" href="classModule.html#a54">00423</a> <span class="keywordtype">void</span> <a class="code" href="classModule.html#a54">Module::OnRawSocketClose</a>(<span class="keywordtype">int</span> fd) { }; +<a name="l00424"></a><a class="code" href="classModule.html#a55">00424</a> <span class="keywordtype">int</span> <a class="code" href="classModule.html#a55">Module::OnRawSocketRead</a>(<span class="keywordtype">int</span> fd, <span class="keywordtype">char</span>* buffer, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> count, <span class="keywordtype">int</span> &readresult) { <span class="keywordflow">return</span> 0; }; +00425 +00426 <span class="comment">// server is a wrapper class that provides methods to all of the C-style</span> +00427 <span class="comment">// exports in the core</span> +00428 <span class="comment">//</span> +00429 +<a name="l00430"></a><a class="code" href="classServer.html#a0">00430</a> <a class="code" href="classServer.html#a0">Server::Server</a>() +00431 { 00432 } 00433 -<a name="l00434"></a><a class="code" href="classServer.html#a32">00434</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a32">Server::MatchText</a>(std::string sliteral, std::string spattern) +<a name="l00434"></a><a class="code" href="classServer.html#a1">00434</a> <a class="code" href="classServer.html#a1">Server::~Server</a>() 00435 { -00436 <span class="keywordtype">char</span> literal[MAXBUF],pattern[MAXBUF]; -00437 strlcpy(literal,sliteral.c_str(),MAXBUF); -00438 strlcpy(pattern,spattern.c_str(),MAXBUF); -00439 <span class="keywordflow">return</span> match(literal,pattern); -00440 } -00441 -<a name="l00442"></a><a class="code" href="classServer.html#a27">00442</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a27">Server::SendToModeMask</a>(std::string modes, <span class="keywordtype">int</span> flags, std::string text) -00443 { -00444 WriteMode(modes.c_str(),flags,<span class="stringliteral">"%s"</span>,text.c_str()); -00445 } -00446 -<a name="l00447"></a><a class="code" href="classServer.html#a28">00447</a> <a class="code" href="classchanrec.html">chanrec</a>* <a class="code" href="classServer.html#a28">Server::JoinUserToChannel</a>(<a class="code" href="classuserrec.html">userrec</a>* user, std::string cname, std::string key) -00448 { -00449 <span class="keywordflow">return</span> add_channel(user,cname.c_str(),key.c_str(),<span class="keyword">false</span>); -00450 } -00451 -<a name="l00452"></a><a class="code" href="classServer.html#a29">00452</a> <a class="code" href="classchanrec.html">chanrec</a>* <a class="code" href="classServer.html#a29">Server::PartUserFromChannel</a>(<a class="code" href="classuserrec.html">userrec</a>* user, std::string cname, std::string reason) -00453 { -00454 <span class="keywordflow">return</span> del_channel(user,cname.c_str(),reason.c_str(),<span class="keyword">false</span>); -00455 } -00456 -<a name="l00457"></a><a class="code" href="classServer.html#a37">00457</a> <a class="code" href="modules_8h.html#a33">chanuserlist</a> <a class="code" href="classServer.html#a37">Server::GetUsers</a>(<a class="code" href="classchanrec.html">chanrec</a>* chan) -00458 { -00459 <a class="code" href="modules_8h.html#a33">chanuserlist</a> userl; -00460 userl.clear(); -00461 std::vector<char*> *<a class="code" href="channels_8cpp.html#a15">list</a> = chan-><a class="code" href="classchanrec.html#a9">GetUsers</a>(); -00462 <span class="keywordflow">for</span> (std::vector<char*>::iterator i = <a class="code" href="channels_8cpp.html#a15">list</a>->begin(); i != <a class="code" href="channels_8cpp.html#a15">list</a>->end(); i++) -00463 { -00464 <span class="keywordtype">char</span>* o = *i; -00465 userl.push_back((<a class="code" href="classuserrec.html">userrec</a>*)o); -00466 } -00467 <span class="keywordflow">return</span> userl; -00468 } -<a name="l00469"></a><a class="code" href="classServer.html#a30">00469</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a30">Server::ChangeUserNick</a>(<a class="code" href="classuserrec.html">userrec</a>* user, std::string nickname) -00470 { -00471 force_nickchange(user,nickname.c_str()); -00472 } -00473 -<a name="l00474"></a><a class="code" href="classServer.html#a31">00474</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a31">Server::QuitUser</a>(<a class="code" href="classuserrec.html">userrec</a>* user, std::string reason) -00475 { -00476 kill_link(user,reason.c_str()); +00436 } +00437 +<a name="l00438"></a><a class="code" href="classServer.html#a2">00438</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a2">Server::SendOpers</a>(std::string s) +00439 { +00440 WriteOpers(<span class="stringliteral">"%s"</span>,s.c_str()); +00441 } +00442 +<a name="l00443"></a><a class="code" href="classServer.html#a32">00443</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a32">Server::MatchText</a>(std::string sliteral, std::string spattern) +00444 { +00445 <span class="keywordtype">char</span> literal[MAXBUF],pattern[MAXBUF]; +00446 strlcpy(literal,sliteral.c_str(),MAXBUF); +00447 strlcpy(pattern,spattern.c_str(),MAXBUF); +00448 <span class="keywordflow">return</span> match(literal,pattern); +00449 } +00450 +<a name="l00451"></a><a class="code" href="classServer.html#a27">00451</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a27">Server::SendToModeMask</a>(std::string modes, <span class="keywordtype">int</span> flags, std::string text) +00452 { +00453 WriteMode(modes.c_str(),flags,<span class="stringliteral">"%s"</span>,text.c_str()); +00454 } +00455 +<a name="l00456"></a><a class="code" href="classServer.html#a28">00456</a> <a class="code" href="classchanrec.html">chanrec</a>* <a class="code" href="classServer.html#a28">Server::JoinUserToChannel</a>(<a class="code" href="classuserrec.html">userrec</a>* user, std::string cname, std::string key) +00457 { +00458 <span class="keywordflow">return</span> add_channel(user,cname.c_str(),key.c_str(),<span class="keyword">false</span>); +00459 } +00460 +<a name="l00461"></a><a class="code" href="classServer.html#a29">00461</a> <a class="code" href="classchanrec.html">chanrec</a>* <a class="code" href="classServer.html#a29">Server::PartUserFromChannel</a>(<a class="code" href="classuserrec.html">userrec</a>* user, std::string cname, std::string reason) +00462 { +00463 <span class="keywordflow">return</span> del_channel(user,cname.c_str(),reason.c_str(),<span class="keyword">false</span>); +00464 } +00465 +<a name="l00466"></a><a class="code" href="classServer.html#a37">00466</a> <a class="code" href="modules_8h.html#a33">chanuserlist</a> <a class="code" href="classServer.html#a37">Server::GetUsers</a>(<a class="code" href="classchanrec.html">chanrec</a>* chan) +00467 { +00468 <a class="code" href="modules_8h.html#a33">chanuserlist</a> userl; +00469 userl.clear(); +00470 std::vector<char*> *<a class="code" href="channels_8cpp.html#a15">list</a> = chan-><a class="code" href="classchanrec.html#a9">GetUsers</a>(); +00471 <span class="keywordflow">for</span> (std::vector<char*>::iterator i = <a class="code" href="channels_8cpp.html#a15">list</a>->begin(); i != <a class="code" href="channels_8cpp.html#a15">list</a>->end(); i++) +00472 { +00473 <span class="keywordtype">char</span>* o = *i; +00474 userl.push_back((<a class="code" href="classuserrec.html">userrec</a>*)o); +00475 } +00476 <span class="keywordflow">return</span> userl; 00477 } -00478 -<a name="l00479"></a><a class="code" href="classServer.html#a36">00479</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a36">Server::IsUlined</a>(std::string server) -00480 { -00481 <span class="keywordflow">return</span> <a class="code" href="commands_8h.html#a74">is_uline</a>(server.c_str()); -00482 } -00483 -<a name="l00484"></a><a class="code" href="classServer.html#a33">00484</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a33">Server::CallCommandHandler</a>(std::string commandname, <span class="keywordtype">char</span>** parameters, <span class="keywordtype">int</span> pcnt, <a class="code" href="classuserrec.html">userrec</a>* user) -00485 { -00486 call_handler(commandname.c_str(),parameters,pcnt,user); -00487 } -00488 -<a name="l00489"></a><a class="code" href="classServer.html#a3">00489</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a3">Server::Log</a>(<span class="keywordtype">int</span> level, std::string s) -00490 { -00491 log(level,<span class="stringliteral">"%s"</span>,s.c_str()); -00492 } -00493 -<a name="l00494"></a><a class="code" href="classServer.html#a25">00494</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a25">Server::AddCommand</a>(<span class="keywordtype">char</span>* cmd, handlerfunc f, <span class="keywordtype">char</span> flags, <span class="keywordtype">int</span> minparams, <span class="keywordtype">char</span>* source) -00495 { -00496 <a class="code" href="modules_8h.html#a35">createcommand</a>(cmd,f,flags,minparams,source); -00497 } -00498 -<a name="l00499"></a><a class="code" href="classServer.html#a26">00499</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a26">Server::SendMode</a>(<span class="keywordtype">char</span> **parameters, <span class="keywordtype">int</span> pcnt, <a class="code" href="classuserrec.html">userrec</a> *user) -00500 { -00501 <a class="code" href="modules_8h.html#a36">server_mode</a>(parameters,pcnt,user); -00502 } -00503 -<a name="l00504"></a><a class="code" href="classServer.html#a4">00504</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a4">Server::Send</a>(<span class="keywordtype">int</span> Socket, std::string s) -00505 { -00506 Write(Socket,<span class="stringliteral">"%s"</span>,s.c_str()); -00507 } -00508 -<a name="l00509"></a><a class="code" href="classServer.html#a5">00509</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a5">Server::SendServ</a>(<span class="keywordtype">int</span> Socket, std::string s) -00510 { -00511 WriteServ(Socket,<span class="stringliteral">"%s"</span>,s.c_str()); -00512 } -00513 -<a name="l00514"></a><a class="code" href="classServer.html#a7">00514</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a7">Server::SendFrom</a>(<span class="keywordtype">int</span> Socket, <a class="code" href="classuserrec.html">userrec</a>* User, std::string s) -00515 { -00516 WriteFrom(Socket,User,<span class="stringliteral">"%s"</span>,s.c_str()); -00517 } -00518 -<a name="l00519"></a><a class="code" href="classServer.html#a8">00519</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a8">Server::SendTo</a>(<a class="code" href="classuserrec.html">userrec</a>* Source, <a class="code" href="classuserrec.html">userrec</a>* Dest, std::string s) -00520 { -00521 <span class="keywordflow">if</span> (!Source) -00522 { -00523 <span class="comment">// if source is NULL, then the message originates from the local server</span> -00524 Write(Dest-><a class="code" href="classconnection.html#o0">fd</a>,<span class="stringliteral">":%s %s"</span>,this->GetServerName().c_str(),s.c_str()); -00525 } -00526 <span class="keywordflow">else</span> -00527 { -00528 <span class="comment">// otherwise it comes from the user specified</span> -00529 WriteTo(Source,Dest,<span class="stringliteral">"%s"</span>,s.c_str()); -00530 } -00531 } -00532 -<a name="l00533"></a><a class="code" href="classServer.html#a6">00533</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a6">Server::SendChannelServerNotice</a>(std::string ServName, <a class="code" href="classchanrec.html">chanrec</a>* Channel, std::string text) -00534 { -00535 WriteChannelWithServ((<span class="keywordtype">char</span>*)ServName.c_str(), Channel, <span class="stringliteral">"%s"</span>, text.c_str()); -00536 } -00537 -<a name="l00538"></a><a class="code" href="classServer.html#a9">00538</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a9">Server::SendChannel</a>(<a class="code" href="classuserrec.html">userrec</a>* User, <a class="code" href="classchanrec.html">chanrec</a>* Channel, std::string s,<span class="keywordtype">bool</span> IncludeSender) -00539 { -00540 <span class="keywordflow">if</span> (IncludeSender) -00541 { -00542 WriteChannel(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str()); -00543 } -00544 <span class="keywordflow">else</span> -00545 { -00546 ChanExceptSender(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str()); -00547 } -00548 } -00549 -<a name="l00550"></a><a class="code" href="classServer.html#a10">00550</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a10">Server::CommonChannels</a>(<a class="code" href="classuserrec.html">userrec</a>* u1, <a class="code" href="classuserrec.html">userrec</a>* u2) -00551 { -00552 <span class="keywordflow">return</span> (<a class="code" href="message_8h.html#a0">common_channels</a>(u1,u2) != 0); -00553 } -00554 -<a name="l00555"></a><a class="code" href="classServer.html#a11">00555</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a11">Server::SendCommon</a>(<a class="code" href="classuserrec.html">userrec</a>* User, std::string text,<span class="keywordtype">bool</span> IncludeSender) -00556 { -00557 <span class="keywordflow">if</span> (IncludeSender) -00558 { -00559 WriteCommon(User,<span class="stringliteral">"%s"</span>,text.c_str()); -00560 } -00561 <span class="keywordflow">else</span> -00562 { -00563 WriteCommonExcept(User,<span class="stringliteral">"%s"</span>,text.c_str()); -00564 } -00565 } -00566 -<a name="l00567"></a><a class="code" href="classServer.html#a12">00567</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a12">Server::SendWallops</a>(<a class="code" href="classuserrec.html">userrec</a>* User, std::string text) -00568 { -00569 WriteWallOps(User,<span class="keyword">false</span>,<span class="stringliteral">"%s"</span>,text.c_str()); -00570 } -00571 -<a name="l00572"></a><a class="code" href="classServer.html#a34">00572</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a34">Server::ChangeHost</a>(<a class="code" href="classuserrec.html">userrec</a>* user, std::string host) -00573 { -00574 <a class="code" href="message_8h.html#a11">ChangeDisplayedHost</a>(user,host.c_str()); -00575 } -00576 -<a name="l00577"></a><a class="code" href="classServer.html#a35">00577</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a35">Server::ChangeGECOS</a>(<a class="code" href="classuserrec.html">userrec</a>* user, std::string gecos) -00578 { -00579 <a class="code" href="message_8h.html#a10">ChangeName</a>(user,gecos.c_str()); -00580 } -00581 -<a name="l00582"></a><a class="code" href="classServer.html#a13">00582</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a13">Server::IsNick</a>(std::string nick) -00583 { -00584 <span class="keywordflow">return</span> (<a class="code" href="message_8h.html#a13">isnick</a>(nick.c_str()) != 0); -00585 } -00586 -<a name="l00587"></a><a class="code" href="classServer.html#a15">00587</a> <a class="code" href="classuserrec.html">userrec</a>* <a class="code" href="classServer.html#a15">Server::FindNick</a>(std::string nick) -00588 { -00589 <span class="keywordflow">return</span> Find(nick); -00590 } -00591 -<a name="l00592"></a><a class="code" href="classServer.html#a16">00592</a> <a class="code" href="classuserrec.html">userrec</a>* <a class="code" href="classServer.html#a16">Server::FindDescriptor</a>(<span class="keywordtype">int</span> socket) -00593 { -00594 <span class="keywordflow">return</span> (socket < 65536 ? <a class="code" href="modules_8cpp.html#a38">fd_ref_table</a>[socket] : NULL); -00595 } -00596 -<a name="l00597"></a><a class="code" href="classServer.html#a17">00597</a> <a class="code" href="classchanrec.html">chanrec</a>* <a class="code" href="classServer.html#a17">Server::FindChannel</a>(std::string channel) -00598 { -00599 <span class="keywordflow">return</span> FindChan(channel.c_str()); -00600 } -00601 -<a name="l00602"></a><a class="code" href="classServer.html#a18">00602</a> std::string <a class="code" href="classServer.html#a18">Server::ChanMode</a>(<a class="code" href="classuserrec.html">userrec</a>* User, <a class="code" href="classchanrec.html">chanrec</a>* Chan) -00603 { -00604 <span class="keywordflow">return</span> <a class="code" href="message_8h.html#a14">cmode</a>(User,Chan); -00605 } -00606 -<a name="l00607"></a><a class="code" href="classServer.html#a19">00607</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a19">Server::IsOnChannel</a>(<a class="code" href="classuserrec.html">userrec</a>* User, <a class="code" href="classchanrec.html">chanrec</a>* Chan) -00608 { -00609 <span class="keywordflow">return</span> <a class="code" href="message_8h.html#a16">has_channel</a>(User,Chan); -00610 } -00611 -<a name="l00612"></a><a class="code" href="classServer.html#a20">00612</a> std::string <a class="code" href="classServer.html#a20">Server::GetServerName</a>() -00613 { -00614 <span class="keywordflow">return</span> getservername(); -00615 } -00616 -<a name="l00617"></a><a class="code" href="classServer.html#a21">00617</a> std::string <a class="code" href="classServer.html#a21">Server::GetNetworkName</a>() -00618 { -00619 <span class="keywordflow">return</span> getnetworkname(); -00620 } -00621 -<a name="l00622"></a><a class="code" href="classServer.html#a22">00622</a> <a class="code" href="classAdmin.html">Admin</a> <a class="code" href="classServer.html#a22">Server::GetAdmin</a>() -00623 { -00624 <span class="keywordflow">return</span> <a class="code" href="classAdmin.html">Admin</a>(getadminname(),getadminemail(),getadminnick()); -00625 } -00626 -00627 -00628 -<a name="l00629"></a><a class="code" href="classServer.html#a23">00629</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a23">Server::AddExtendedMode</a>(<span class="keywordtype">char</span> modechar, <span class="keywordtype">int</span> type, <span class="keywordtype">bool</span> requires_oper, <span class="keywordtype">int</span> params_when_on, <span class="keywordtype">int</span> params_when_off) -00630 { -00631 <span class="keywordflow">if</span> (((modechar >= <span class="charliteral">'A'</span>) && (modechar <= 'Z')) || ((modechar >= <span class="charliteral">'a'</span>) && (modechar <= <span class="charliteral">'z'</span>))) -00632 { -00633 <span class="keywordflow">if</span> (type == <a class="code" href="modules_8h.html#a7">MT_SERVER</a>) -00634 { -00635 log(<a class="code" href="modules_8h.html#a0">DEBUG</a>,<span class="stringliteral">"*** API ERROR *** Modes of type MT_SERVER are reserved for future expansion"</span>); -00636 <span class="keywordflow">return</span> <span class="keyword">false</span>; -00637 } -00638 <span class="keywordflow">if</span> (((params_when_on>0) || (params_when_off>0)) && (type == <a class="code" href="modules_8h.html#a6">MT_CLIENT</a>)) -00639 { -00640 log(<a class="code" href="modules_8h.html#a0">DEBUG</a>,<span class="stringliteral">"*** API ERROR *** Parameters on MT_CLIENT modes are not supported"</span>); -00641 <span class="keywordflow">return</span> <span class="keyword">false</span>; -00642 } -00643 <span class="keywordflow">if</span> ((params_when_on>1) || (params_when_off>1)) -00644 { -00645 log(<a class="code" href="modules_8h.html#a0">DEBUG</a>,<span class="stringliteral">"*** API ERROR *** More than one parameter for an MT_CHANNEL mode is not yet supported"</span>); -00646 <span class="keywordflow">return</span> <span class="keyword">false</span>; -00647 } -00648 <span class="keywordflow">return</span> <a class="code" href="modules_8cpp.html#a58">DoAddExtendedMode</a>(modechar,type,requires_oper,params_when_on,params_when_off); -00649 } -00650 <span class="keywordflow">else</span> -00651 { -00652 log(<a class="code" href="modules_8h.html#a0">DEBUG</a>,<span class="stringliteral">"*** API ERROR *** Muppet modechar detected."</span>); -00653 } -00654 <span class="keywordflow">return</span> <span class="keyword">false</span>; -00655 } -00656 -<a name="l00657"></a><a class="code" href="classServer.html#a24">00657</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a24">Server::AddExtendedListMode</a>(<span class="keywordtype">char</span> modechar) -00658 { -00659 <span class="keywordtype">bool</span> res = <a class="code" href="modules_8cpp.html#a58">DoAddExtendedMode</a>(modechar,<a class="code" href="modules_8h.html#a5">MT_CHANNEL</a>,<span class="keyword">false</span>,1,1); -00660 <span class="keywordflow">if</span> (res) -00661 <a class="code" href="modules_8cpp.html#a59">ModeMakeList</a>(modechar); -00662 <span class="keywordflow">return</span> res; -00663 } -00664 -<a name="l00665"></a><a class="code" href="classServer.html#a14">00665</a> <span class="keywordtype">int</span> <a class="code" href="classServer.html#a14">Server::CountUsers</a>(<a class="code" href="classchanrec.html">chanrec</a>* c) -00666 { -00667 <span class="keywordflow">return</span> usercount(c); -00668 } -00669 -00670 -<a name="l00671"></a><a class="code" href="classServer.html#a38">00671</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a38">Server::UserToPseudo</a>(<a class="code" href="classuserrec.html">userrec</a>* user,std::string message) -00672 { -00673 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> old_fd = user-><a class="code" href="classconnection.html#o0">fd</a>; -00674 user-><a class="code" href="classconnection.html#o0">fd</a> = <a class="code" href="modules_8h.html#a26">FD_MAGIC_NUMBER</a>; -00675 user-><a class="code" href="classuserrec.html#a10">ClearBuffer</a>(); -00676 Write(old_fd,<span class="stringliteral">"ERROR :Closing link (%s@%s) [%s]"</span>,user-><a class="code" href="classuserrec.html#o1">ident</a>,user-><a class="code" href="classconnection.html#o1">host</a>,message.c_str()); -00677 shutdown(old_fd,2); -00678 close(old_fd); -00679 } -00680 -<a name="l00681"></a><a class="code" href="classServer.html#a39">00681</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a39">Server::PseudoToUser</a>(<a class="code" href="classuserrec.html">userrec</a>* alive,<a class="code" href="classuserrec.html">userrec</a>* zombie,std::string message) -00682 { -00683 zombie-><a class="code" href="classconnection.html#o0">fd</a> = alive-><a class="code" href="classconnection.html#o0">fd</a>; -00684 alive-><a class="code" href="classconnection.html#o0">fd</a> = <a class="code" href="modules_8h.html#a26">FD_MAGIC_NUMBER</a>; -00685 alive-><a class="code" href="classuserrec.html#a10">ClearBuffer</a>(); -00686 Write(zombie-><a class="code" href="classconnection.html#o0">fd</a>,<span class="stringliteral">":%s!%s@%s NICK %s"</span>,alive-><a class="code" href="classuserrec.html#o0">nick</a>,alive-><a class="code" href="classuserrec.html#o1">ident</a>,alive-><a class="code" href="classconnection.html#o1">host</a>,zombie-><a class="code" href="classuserrec.html#o0">nick</a>); -00687 kill_link(alive,message.c_str()); -00688 <a class="code" href="modules_8cpp.html#a38">fd_ref_table</a>[zombie-><a class="code" href="classconnection.html#o0">fd</a>] = zombie; -00689 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i != MAXCHANS; i++) -00690 { -00691 <span class="keywordflow">if</span> (zombie->chans[i].channel != NULL) -00692 { -00693 <span class="keywordflow">if</span> (zombie->chans[i].channel->name) -00694 { -00695 <a class="code" href="classchanrec.html">chanrec</a>* Ptr = zombie-><a class="code" href="classuserrec.html#o5">chans</a>[i].<a class="code" href="classucrec.html#o1">channel</a>; -00696 WriteFrom(zombie->fd,zombie,<span class="stringliteral">"JOIN %s"</span>,Ptr-><a class="code" href="classchanrec.html#o0">name</a>); -00697 <span class="keywordflow">if</span> (Ptr-><a class="code" href="classchanrec.html#o6">topicset</a>) -00698 { -00699 WriteServ(zombie->fd,<span class="stringliteral">"332 %s %s :%s"</span>, zombie->nick, Ptr-><a class="code" href="classchanrec.html#o0">name</a>, Ptr-><a class="code" href="classchanrec.html#o4">topic</a>); -00700 WriteServ(zombie->fd,<span class="stringliteral">"333 %s %s %s %d"</span>, zombie->nick, Ptr-><a class="code" href="classchanrec.html#o0">name</a>, Ptr-><a class="code" href="classchanrec.html#o7">setby</a>, Ptr-><a class="code" href="classchanrec.html#o6">topicset</a>); -00701 } -00702 userlist(zombie,Ptr); -00703 WriteServ(zombie->fd,<span class="stringliteral">"366 %s %s :End of /NAMES list."</span>, zombie->nick, Ptr-><a class="code" href="classchanrec.html#o0">name</a>); -00704 -00705 } -00706 } -00707 } -00708 -00709 } -00710 -<a name="l00711"></a><a class="code" href="classServer.html#a40">00711</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a40">Server::AddGLine</a>(<span class="keywordtype">long</span> duration, std::string source, std::string reason, std::string hostmask) -00712 { -00713 <a class="code" href="xline_8h.html#a1">add_gline</a>(<a class="code" href="commands_8h.html#a75">duration</a>, source.c_str(), reason.c_str(), hostmask.c_str()); -00714 } -00715 -<a name="l00716"></a><a class="code" href="classServer.html#a41">00716</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a41">Server::AddQLine</a>(<span class="keywordtype">long</span> duration, std::string source, std::string reason, std::string nickname) -00717 { -00718 <a class="code" href="xline_8h.html#a2">add_qline</a>(<a class="code" href="commands_8h.html#a75">duration</a>, source.c_str(), reason.c_str(), nickname.c_str()); -00719 } -00720 -<a name="l00721"></a><a class="code" href="classServer.html#a42">00721</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a42">Server::AddZLine</a>(<span class="keywordtype">long</span> duration, std::string source, std::string reason, std::string ipaddr) -00722 { -00723 <a class="code" href="xline_8h.html#a3">add_zline</a>(<a class="code" href="commands_8h.html#a75">duration</a>, source.c_str(), reason.c_str(), ipaddr.c_str()); -00724 } -00725 -<a name="l00726"></a><a class="code" href="classServer.html#a43">00726</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a43">Server::AddKLine</a>(<span class="keywordtype">long</span> duration, std::string source, std::string reason, std::string hostmask) -00727 { -00728 <a class="code" href="xline_8h.html#a4">add_kline</a>(<a class="code" href="commands_8h.html#a75">duration</a>, source.c_str(), reason.c_str(), hostmask.c_str()); -00729 } -00730 -<a name="l00731"></a><a class="code" href="classServer.html#a44">00731</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a44">Server::AddELine</a>(<span class="keywordtype">long</span> duration, std::string source, std::string reason, std::string hostmask) -00732 { -00733 <a class="code" href="xline_8h.html#a5">add_eline</a>(<a class="code" href="commands_8h.html#a75">duration</a>, source.c_str(), reason.c_str(), hostmask.c_str()); -00734 } -00735 -<a name="l00736"></a><a class="code" href="classServer.html#a45">00736</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a45">Server::DelGLine</a>(std::string hostmask) -00737 { -00738 <a class="code" href="xline_8h.html#a6">del_gline</a>(hostmask.c_str()); -00739 } -00740 -<a name="l00741"></a><a class="code" href="classServer.html#a46">00741</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a46">Server::DelQLine</a>(std::string nickname) -00742 { -00743 <a class="code" href="xline_8h.html#a7">del_qline</a>(nickname.c_str()); -00744 } -00745 -<a name="l00746"></a><a class="code" href="classServer.html#a47">00746</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a47">Server::DelZLine</a>(std::string ipaddr) -00747 { -00748 <a class="code" href="xline_8h.html#a8">del_zline</a>(ipaddr.c_str()); -00749 } -00750 -<a name="l00751"></a><a class="code" href="classServer.html#a48">00751</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a48">Server::DelKLine</a>(std::string hostmask) -00752 { -00753 <a class="code" href="xline_8h.html#a9">del_kline</a>(hostmask.c_str()); -00754 } -00755 -<a name="l00756"></a><a class="code" href="classServer.html#a49">00756</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a49">Server::DelELine</a>(std::string hostmask) -00757 { -00758 <a class="code" href="xline_8h.html#a10">del_eline</a>(hostmask.c_str()); -00759 } -00760 -<a name="l00761"></a><a class="code" href="classServer.html#a50">00761</a> <span class="keywordtype">long</span> <a class="code" href="classServer.html#a50">Server::CalcDuration</a>(std::string delta) -00762 { -00763 <span class="keywordflow">return</span> <a class="code" href="commands_8h.html#a75">duration</a>(delta.c_str()); -00764 } -00765 -<a name="l00766"></a><a class="code" href="classServer.html#a51">00766</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a51">Server::IsValidMask</a>(std::string mask) -00767 { -00768 <span class="keyword">const</span> <span class="keywordtype">char</span>* dest = mask.c_str(); -00769 <span class="keywordflow">if</span> (strchr(dest,<span class="charliteral">'!'</span>)==0) -00770 <span class="keywordflow">return</span> <span class="keyword">false</span>; -00771 <span class="keywordflow">if</span> (strchr(dest,<span class="charliteral">'@'</span>)==0) -00772 <span class="keywordflow">return</span> <span class="keyword">false</span>; -00773 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++) -00774 <span class="keywordflow">if</span> (dest[i] < 32) -00775 <span class="keywordflow">return</span> <span class="keyword">false</span>; -00776 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++) -00777 <span class="keywordflow">if</span> (dest[i] > 126) -00778 <span class="keywordflow">return</span> <span class="keyword">false</span>; -00779 <span class="keywordtype">int</span> c = 0; -00780 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++) -00781 <span class="keywordflow">if</span> (dest[i] == <span class="charliteral">'!'</span>) -00782 c++; -00783 <span class="keywordflow">if</span> (c>1) -00784 <span class="keywordflow">return</span> <span class="keyword">false</span>; -00785 c = 0; -00786 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++) -00787 <span class="keywordflow">if</span> (dest[i] == <span class="charliteral">'@'</span>) -00788 c++; -00789 <span class="keywordflow">if</span> (c>1) +<a name="l00478"></a><a class="code" href="classServer.html#a30">00478</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a30">Server::ChangeUserNick</a>(<a class="code" href="classuserrec.html">userrec</a>* user, std::string nickname) +00479 { +00480 force_nickchange(user,nickname.c_str()); +00481 } +00482 +<a name="l00483"></a><a class="code" href="classServer.html#a31">00483</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a31">Server::QuitUser</a>(<a class="code" href="classuserrec.html">userrec</a>* user, std::string reason) +00484 { +00485 kill_link(user,reason.c_str()); +00486 } +00487 +<a name="l00488"></a><a class="code" href="classServer.html#a36">00488</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a36">Server::IsUlined</a>(std::string server) +00489 { +00490 <span class="keywordflow">return</span> <a class="code" href="commands_8h.html#a74">is_uline</a>(server.c_str()); +00491 } +00492 +<a name="l00493"></a><a class="code" href="classServer.html#a33">00493</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a33">Server::CallCommandHandler</a>(std::string commandname, <span class="keywordtype">char</span>** parameters, <span class="keywordtype">int</span> pcnt, <a class="code" href="classuserrec.html">userrec</a>* user) +00494 { +00495 call_handler(commandname.c_str(),parameters,pcnt,user); +00496 } +00497 +<a name="l00498"></a><a class="code" href="classServer.html#a3">00498</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a3">Server::Log</a>(<span class="keywordtype">int</span> level, std::string s) +00499 { +00500 log(level,<span class="stringliteral">"%s"</span>,s.c_str()); +00501 } +00502 +<a name="l00503"></a><a class="code" href="classServer.html#a25">00503</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a25">Server::AddCommand</a>(<span class="keywordtype">char</span>* cmd, handlerfunc f, <span class="keywordtype">char</span> flags, <span class="keywordtype">int</span> minparams, <span class="keywordtype">char</span>* source) +00504 { +00505 <a class="code" href="modules_8h.html#a35">createcommand</a>(cmd,f,flags,minparams,source); +00506 } +00507 +<a name="l00508"></a><a class="code" href="classServer.html#a26">00508</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a26">Server::SendMode</a>(<span class="keywordtype">char</span> **parameters, <span class="keywordtype">int</span> pcnt, <a class="code" href="classuserrec.html">userrec</a> *user) +00509 { +00510 <a class="code" href="modules_8h.html#a36">server_mode</a>(parameters,pcnt,user); +00511 } +00512 +<a name="l00513"></a><a class="code" href="classServer.html#a4">00513</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a4">Server::Send</a>(<span class="keywordtype">int</span> Socket, std::string s) +00514 { +00515 Write(Socket,<span class="stringliteral">"%s"</span>,s.c_str()); +00516 } +00517 +<a name="l00518"></a><a class="code" href="classServer.html#a5">00518</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a5">Server::SendServ</a>(<span class="keywordtype">int</span> Socket, std::string s) +00519 { +00520 WriteServ(Socket,<span class="stringliteral">"%s"</span>,s.c_str()); +00521 } +00522 +<a name="l00523"></a><a class="code" href="classServer.html#a7">00523</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a7">Server::SendFrom</a>(<span class="keywordtype">int</span> Socket, <a class="code" href="classuserrec.html">userrec</a>* User, std::string s) +00524 { +00525 WriteFrom(Socket,User,<span class="stringliteral">"%s"</span>,s.c_str()); +00526 } +00527 +<a name="l00528"></a><a class="code" href="classServer.html#a8">00528</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a8">Server::SendTo</a>(<a class="code" href="classuserrec.html">userrec</a>* Source, <a class="code" href="classuserrec.html">userrec</a>* Dest, std::string s) +00529 { +00530 <span class="keywordflow">if</span> (!Source) +00531 { +00532 <span class="comment">// if source is NULL, then the message originates from the local server</span> +00533 Write(Dest-><a class="code" href="classconnection.html#o0">fd</a>,<span class="stringliteral">":%s %s"</span>,this->GetServerName().c_str(),s.c_str()); +00534 } +00535 <span class="keywordflow">else</span> +00536 { +00537 <span class="comment">// otherwise it comes from the user specified</span> +00538 WriteTo(Source,Dest,<span class="stringliteral">"%s"</span>,s.c_str()); +00539 } +00540 } +00541 +<a name="l00542"></a><a class="code" href="classServer.html#a6">00542</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a6">Server::SendChannelServerNotice</a>(std::string ServName, <a class="code" href="classchanrec.html">chanrec</a>* Channel, std::string text) +00543 { +00544 WriteChannelWithServ((<span class="keywordtype">char</span>*)ServName.c_str(), Channel, <span class="stringliteral">"%s"</span>, text.c_str()); +00545 } +00546 +<a name="l00547"></a><a class="code" href="classServer.html#a9">00547</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a9">Server::SendChannel</a>(<a class="code" href="classuserrec.html">userrec</a>* User, <a class="code" href="classchanrec.html">chanrec</a>* Channel, std::string s,<span class="keywordtype">bool</span> IncludeSender) +00548 { +00549 <span class="keywordflow">if</span> (IncludeSender) +00550 { +00551 WriteChannel(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str()); +00552 } +00553 <span class="keywordflow">else</span> +00554 { +00555 ChanExceptSender(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str()); +00556 } +00557 } +00558 +<a name="l00559"></a><a class="code" href="classServer.html#a10">00559</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a10">Server::CommonChannels</a>(<a class="code" href="classuserrec.html">userrec</a>* u1, <a class="code" href="classuserrec.html">userrec</a>* u2) +00560 { +00561 <span class="keywordflow">return</span> (<a class="code" href="message_8h.html#a0">common_channels</a>(u1,u2) != 0); +00562 } +00563 +<a name="l00564"></a><a class="code" href="classServer.html#a11">00564</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a11">Server::SendCommon</a>(<a class="code" href="classuserrec.html">userrec</a>* User, std::string text,<span class="keywordtype">bool</span> IncludeSender) +00565 { +00566 <span class="keywordflow">if</span> (IncludeSender) +00567 { +00568 WriteCommon(User,<span class="stringliteral">"%s"</span>,text.c_str()); +00569 } +00570 <span class="keywordflow">else</span> +00571 { +00572 WriteCommonExcept(User,<span class="stringliteral">"%s"</span>,text.c_str()); +00573 } +00574 } +00575 +<a name="l00576"></a><a class="code" href="classServer.html#a12">00576</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a12">Server::SendWallops</a>(<a class="code" href="classuserrec.html">userrec</a>* User, std::string text) +00577 { +00578 WriteWallOps(User,<span class="keyword">false</span>,<span class="stringliteral">"%s"</span>,text.c_str()); +00579 } +00580 +<a name="l00581"></a><a class="code" href="classServer.html#a34">00581</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a34">Server::ChangeHost</a>(<a class="code" href="classuserrec.html">userrec</a>* user, std::string host) +00582 { +00583 <a class="code" href="message_8h.html#a11">ChangeDisplayedHost</a>(user,host.c_str()); +00584 } +00585 +<a name="l00586"></a><a class="code" href="classServer.html#a35">00586</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a35">Server::ChangeGECOS</a>(<a class="code" href="classuserrec.html">userrec</a>* user, std::string gecos) +00587 { +00588 <a class="code" href="message_8h.html#a10">ChangeName</a>(user,gecos.c_str()); +00589 } +00590 +<a name="l00591"></a><a class="code" href="classServer.html#a13">00591</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a13">Server::IsNick</a>(std::string nick) +00592 { +00593 <span class="keywordflow">return</span> (<a class="code" href="message_8h.html#a13">isnick</a>(nick.c_str()) != 0); +00594 } +00595 +<a name="l00596"></a><a class="code" href="classServer.html#a15">00596</a> <a class="code" href="classuserrec.html">userrec</a>* <a class="code" href="classServer.html#a15">Server::FindNick</a>(std::string nick) +00597 { +00598 <span class="keywordflow">return</span> Find(nick); +00599 } +00600 +<a name="l00601"></a><a class="code" href="classServer.html#a16">00601</a> <a class="code" href="classuserrec.html">userrec</a>* <a class="code" href="classServer.html#a16">Server::FindDescriptor</a>(<span class="keywordtype">int</span> socket) +00602 { +00603 <span class="keywordflow">return</span> (socket < 65536 ? <a class="code" href="modules_8cpp.html#a38">fd_ref_table</a>[socket] : NULL); +00604 } +00605 +<a name="l00606"></a><a class="code" href="classServer.html#a17">00606</a> <a class="code" href="classchanrec.html">chanrec</a>* <a class="code" href="classServer.html#a17">Server::FindChannel</a>(std::string channel) +00607 { +00608 <span class="keywordflow">return</span> FindChan(channel.c_str()); +00609 } +00610 +<a name="l00611"></a><a class="code" href="classServer.html#a18">00611</a> std::string <a class="code" href="classServer.html#a18">Server::ChanMode</a>(<a class="code" href="classuserrec.html">userrec</a>* User, <a class="code" href="classchanrec.html">chanrec</a>* Chan) +00612 { +00613 <span class="keywordflow">return</span> <a class="code" href="message_8h.html#a14">cmode</a>(User,Chan); +00614 } +00615 +<a name="l00616"></a><a class="code" href="classServer.html#a19">00616</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a19">Server::IsOnChannel</a>(<a class="code" href="classuserrec.html">userrec</a>* User, <a class="code" href="classchanrec.html">chanrec</a>* Chan) +00617 { +00618 <span class="keywordflow">return</span> <a class="code" href="message_8h.html#a16">has_channel</a>(User,Chan); +00619 } +00620 +<a name="l00621"></a><a class="code" href="classServer.html#a20">00621</a> std::string <a class="code" href="classServer.html#a20">Server::GetServerName</a>() +00622 { +00623 <span class="keywordflow">return</span> getservername(); +00624 } +00625 +<a name="l00626"></a><a class="code" href="classServer.html#a21">00626</a> std::string <a class="code" href="classServer.html#a21">Server::GetNetworkName</a>() +00627 { +00628 <span class="keywordflow">return</span> getnetworkname(); +00629 } +00630 +<a name="l00631"></a><a class="code" href="classServer.html#a22">00631</a> <a class="code" href="classAdmin.html">Admin</a> <a class="code" href="classServer.html#a22">Server::GetAdmin</a>() +00632 { +00633 <span class="keywordflow">return</span> <a class="code" href="classAdmin.html">Admin</a>(getadminname(),getadminemail(),getadminnick()); +00634 } +00635 +00636 +00637 +<a name="l00638"></a><a class="code" href="classServer.html#a23">00638</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a23">Server::AddExtendedMode</a>(<span class="keywordtype">char</span> modechar, <span class="keywordtype">int</span> type, <span class="keywordtype">bool</span> requires_oper, <span class="keywordtype">int</span> params_when_on, <span class="keywordtype">int</span> params_when_off) +00639 { +00640 <span class="keywordflow">if</span> (((modechar >= <span class="charliteral">'A'</span>) && (modechar <= 'Z')) || ((modechar >= <span class="charliteral">'a'</span>) && (modechar <= <span class="charliteral">'z'</span>))) +00641 { +00642 <span class="keywordflow">if</span> (type == <a class="code" href="modules_8h.html#a7">MT_SERVER</a>) +00643 { +00644 log(<a class="code" href="modules_8h.html#a0">DEBUG</a>,<span class="stringliteral">"*** API ERROR *** Modes of type MT_SERVER are reserved for future expansion"</span>); +00645 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00646 } +00647 <span class="keywordflow">if</span> (((params_when_on>0) || (params_when_off>0)) && (type == <a class="code" href="modules_8h.html#a6">MT_CLIENT</a>)) +00648 { +00649 log(<a class="code" href="modules_8h.html#a0">DEBUG</a>,<span class="stringliteral">"*** API ERROR *** Parameters on MT_CLIENT modes are not supported"</span>); +00650 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00651 } +00652 <span class="keywordflow">if</span> ((params_when_on>1) || (params_when_off>1)) +00653 { +00654 log(<a class="code" href="modules_8h.html#a0">DEBUG</a>,<span class="stringliteral">"*** API ERROR *** More than one parameter for an MT_CHANNEL mode is not yet supported"</span>); +00655 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00656 } +00657 <span class="keywordflow">return</span> <a class="code" href="modules_8cpp.html#a58">DoAddExtendedMode</a>(modechar,type,requires_oper,params_when_on,params_when_off); +00658 } +00659 <span class="keywordflow">else</span> +00660 { +00661 log(<a class="code" href="modules_8h.html#a0">DEBUG</a>,<span class="stringliteral">"*** API ERROR *** Muppet modechar detected."</span>); +00662 } +00663 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00664 } +00665 +<a name="l00666"></a><a class="code" href="classServer.html#a24">00666</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a24">Server::AddExtendedListMode</a>(<span class="keywordtype">char</span> modechar) +00667 { +00668 <span class="keywordtype">bool</span> res = <a class="code" href="modules_8cpp.html#a58">DoAddExtendedMode</a>(modechar,<a class="code" href="modules_8h.html#a5">MT_CHANNEL</a>,<span class="keyword">false</span>,1,1); +00669 <span class="keywordflow">if</span> (res) +00670 <a class="code" href="modules_8cpp.html#a59">ModeMakeList</a>(modechar); +00671 <span class="keywordflow">return</span> res; +00672 } +00673 +<a name="l00674"></a><a class="code" href="classServer.html#a14">00674</a> <span class="keywordtype">int</span> <a class="code" href="classServer.html#a14">Server::CountUsers</a>(<a class="code" href="classchanrec.html">chanrec</a>* c) +00675 { +00676 <span class="keywordflow">return</span> usercount(c); +00677 } +00678 +00679 +<a name="l00680"></a><a class="code" href="classServer.html#a38">00680</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a38">Server::UserToPseudo</a>(<a class="code" href="classuserrec.html">userrec</a>* user,std::string message) +00681 { +00682 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> old_fd = user-><a class="code" href="classconnection.html#o0">fd</a>; +00683 user-><a class="code" href="classconnection.html#o0">fd</a> = <a class="code" href="modules_8h.html#a26">FD_MAGIC_NUMBER</a>; +00684 user-><a class="code" href="classuserrec.html#a10">ClearBuffer</a>(); +00685 Write(old_fd,<span class="stringliteral">"ERROR :Closing link (%s@%s) [%s]"</span>,user-><a class="code" href="classuserrec.html#o1">ident</a>,user-><a class="code" href="classconnection.html#o1">host</a>,message.c_str()); +00686 <span class="preprocessor">#ifdef USE_KQUEUE</span> +00687 <span class="preprocessor"></span> <span class="keyword">struct </span>kevent ke; +00688 EV_SET(&ke, old_fd, EVFILT_READ, EV_DELETE, 0, 0, NULL); +00689 <span class="keywordtype">int</span> i = kevent(kq, &ke, 1, 0, 0, NULL); +00690 <span class="keywordflow">if</span> (i == -1) +00691 { +00692 log(<a class="code" href="modules_8h.html#a0">DEBUG</a>,<span class="stringliteral">"kqueue: Failed to remove user from queue!"</span>); +00693 } +00694 <span class="preprocessor">#endif</span> +00695 <span class="preprocessor"></span> shutdown(old_fd,2); +00696 close(old_fd); +00697 } +00698 +<a name="l00699"></a><a class="code" href="classServer.html#a39">00699</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a39">Server::PseudoToUser</a>(<a class="code" href="classuserrec.html">userrec</a>* alive,<a class="code" href="classuserrec.html">userrec</a>* zombie,std::string message) +00700 { +00701 zombie-><a class="code" href="classconnection.html#o0">fd</a> = alive-><a class="code" href="classconnection.html#o0">fd</a>; +00702 alive-><a class="code" href="classconnection.html#o0">fd</a> = <a class="code" href="modules_8h.html#a26">FD_MAGIC_NUMBER</a>; +00703 alive-><a class="code" href="classuserrec.html#a10">ClearBuffer</a>(); +00704 Write(zombie-><a class="code" href="classconnection.html#o0">fd</a>,<span class="stringliteral">":%s!%s@%s NICK %s"</span>,alive-><a class="code" href="classuserrec.html#o0">nick</a>,alive-><a class="code" href="classuserrec.html#o1">ident</a>,alive-><a class="code" href="classconnection.html#o1">host</a>,zombie-><a class="code" href="classuserrec.html#o0">nick</a>); +00705 kill_link(alive,message.c_str()); +00706 <a class="code" href="modules_8cpp.html#a38">fd_ref_table</a>[zombie-><a class="code" href="classconnection.html#o0">fd</a>] = zombie; +00707 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i != MAXCHANS; i++) +00708 { +00709 <span class="keywordflow">if</span> (zombie->chans[i].channel != NULL) +00710 { +00711 <span class="keywordflow">if</span> (zombie->chans[i].channel->name) +00712 { +00713 <a class="code" href="classchanrec.html">chanrec</a>* Ptr = zombie-><a class="code" href="classuserrec.html#o5">chans</a>[i].<a class="code" href="classucrec.html#o1">channel</a>; +00714 WriteFrom(zombie->fd,zombie,<span class="stringliteral">"JOIN %s"</span>,Ptr-><a class="code" href="classchanrec.html#o0">name</a>); +00715 <span class="keywordflow">if</span> (Ptr-><a class="code" href="classchanrec.html#o6">topicset</a>) +00716 { +00717 WriteServ(zombie->fd,<span class="stringliteral">"332 %s %s :%s"</span>, zombie->nick, Ptr-><a class="code" href="classchanrec.html#o0">name</a>, Ptr-><a class="code" href="classchanrec.html#o4">topic</a>); +00718 WriteServ(zombie->fd,<span class="stringliteral">"333 %s %s %s %d"</span>, zombie->nick, Ptr-><a class="code" href="classchanrec.html#o0">name</a>, Ptr-><a class="code" href="classchanrec.html#o7">setby</a>, Ptr-><a class="code" href="classchanrec.html#o6">topicset</a>); +00719 } +00720 userlist(zombie,Ptr); +00721 WriteServ(zombie->fd,<span class="stringliteral">"366 %s %s :End of /NAMES list."</span>, zombie->nick, Ptr-><a class="code" href="classchanrec.html#o0">name</a>); +00722 +00723 } +00724 } +00725 } +00726 +00727 } +00728 +<a name="l00729"></a><a class="code" href="classServer.html#a40">00729</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a40">Server::AddGLine</a>(<span class="keywordtype">long</span> duration, std::string source, std::string reason, std::string hostmask) +00730 { +00731 <a class="code" href="xline_8h.html#a1">add_gline</a>(<a class="code" href="commands_8h.html#a75">duration</a>, source.c_str(), reason.c_str(), hostmask.c_str()); +00732 } +00733 +<a name="l00734"></a><a class="code" href="classServer.html#a41">00734</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a41">Server::AddQLine</a>(<span class="keywordtype">long</span> duration, std::string source, std::string reason, std::string nickname) +00735 { +00736 <a class="code" href="xline_8h.html#a2">add_qline</a>(<a class="code" href="commands_8h.html#a75">duration</a>, source.c_str(), reason.c_str(), nickname.c_str()); +00737 } +00738 +<a name="l00739"></a><a class="code" href="classServer.html#a42">00739</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a42">Server::AddZLine</a>(<span class="keywordtype">long</span> duration, std::string source, std::string reason, std::string ipaddr) +00740 { +00741 <a class="code" href="xline_8h.html#a3">add_zline</a>(<a class="code" href="commands_8h.html#a75">duration</a>, source.c_str(), reason.c_str(), ipaddr.c_str()); +00742 } +00743 +<a name="l00744"></a><a class="code" href="classServer.html#a43">00744</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a43">Server::AddKLine</a>(<span class="keywordtype">long</span> duration, std::string source, std::string reason, std::string hostmask) +00745 { +00746 <a class="code" href="xline_8h.html#a4">add_kline</a>(<a class="code" href="commands_8h.html#a75">duration</a>, source.c_str(), reason.c_str(), hostmask.c_str()); +00747 } +00748 +<a name="l00749"></a><a class="code" href="classServer.html#a44">00749</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a44">Server::AddELine</a>(<span class="keywordtype">long</span> duration, std::string source, std::string reason, std::string hostmask) +00750 { +00751 <a class="code" href="xline_8h.html#a5">add_eline</a>(<a class="code" href="commands_8h.html#a75">duration</a>, source.c_str(), reason.c_str(), hostmask.c_str()); +00752 } +00753 +<a name="l00754"></a><a class="code" href="classServer.html#a45">00754</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a45">Server::DelGLine</a>(std::string hostmask) +00755 { +00756 <a class="code" href="xline_8h.html#a6">del_gline</a>(hostmask.c_str()); +00757 } +00758 +<a name="l00759"></a><a class="code" href="classServer.html#a46">00759</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a46">Server::DelQLine</a>(std::string nickname) +00760 { +00761 <a class="code" href="xline_8h.html#a7">del_qline</a>(nickname.c_str()); +00762 } +00763 +<a name="l00764"></a><a class="code" href="classServer.html#a47">00764</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a47">Server::DelZLine</a>(std::string ipaddr) +00765 { +00766 <a class="code" href="xline_8h.html#a8">del_zline</a>(ipaddr.c_str()); +00767 } +00768 +<a name="l00769"></a><a class="code" href="classServer.html#a48">00769</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a48">Server::DelKLine</a>(std::string hostmask) +00770 { +00771 <a class="code" href="xline_8h.html#a9">del_kline</a>(hostmask.c_str()); +00772 } +00773 +<a name="l00774"></a><a class="code" href="classServer.html#a49">00774</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a49">Server::DelELine</a>(std::string hostmask) +00775 { +00776 <a class="code" href="xline_8h.html#a10">del_eline</a>(hostmask.c_str()); +00777 } +00778 +<a name="l00779"></a><a class="code" href="classServer.html#a50">00779</a> <span class="keywordtype">long</span> <a class="code" href="classServer.html#a50">Server::CalcDuration</a>(std::string delta) +00780 { +00781 <span class="keywordflow">return</span> <a class="code" href="commands_8h.html#a75">duration</a>(delta.c_str()); +00782 } +00783 +<a name="l00784"></a><a class="code" href="classServer.html#a51">00784</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a51">Server::IsValidMask</a>(std::string mask) +00785 { +00786 <span class="keyword">const</span> <span class="keywordtype">char</span>* dest = mask.c_str(); +00787 <span class="keywordflow">if</span> (strchr(dest,<span class="charliteral">'!'</span>)==0) +00788 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00789 <span class="keywordflow">if</span> (strchr(dest,<span class="charliteral">'@'</span>)==0) 00790 <span class="keywordflow">return</span> <span class="keyword">false</span>; -00791 -00792 <span class="keywordflow">return</span> <span class="keyword">true</span>; -00793 } -00794 -<a name="l00795"></a><a class="code" href="classServer.html#a52">00795</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a52">Server::MeshSendAll</a>(std::string text) -00796 { -00797 NetSendToAll((<span class="keywordtype">char</span>*)text.c_str()); -00798 } -00799 -<a name="l00800"></a><a class="code" href="classServer.html#a53">00800</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a53">Server::MeshSendCommon</a>(<a class="code" href="classuserrec.html">userrec</a>* user, std::string text) -00801 { -00802 <span class="keywordflow">if</span> (user) -00803 NetSendToCommon(user,(<span class="keywordtype">char</span>*)text.c_str()); -00804 } -00805 -<a name="l00806"></a><a class="code" href="classServer.html#a54">00806</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a54">Server::MeshSendAllAlive</a>(std::string text) -00807 { -00808 NetSendToAllAlive((<span class="keywordtype">char</span>*)text.c_str()); -00809 } -00810 -<a name="l00811"></a><a class="code" href="classServer.html#a55">00811</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a55">Server::MeshSendUnicast</a>(std::string destination, std::string text) -00812 { -00813 NetSendToOne((<span class="keywordtype">char</span>*)destination.c_str(),(<span class="keywordtype">char</span>*)text.c_str()); -00814 } -00815 -<a name="l00816"></a><a class="code" href="classServer.html#a56">00816</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a56">Server::MeshSendAllExcept</a>(std::string target, std::string text) -00817 { -00818 NetSendToAllExcept(target.c_str(),(<span class="keywordtype">char</span>*)text.c_str()); -00819 } -00820 -<a name="l00821"></a><a class="code" href="classServer.html#a57">00821</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a57">Server::MeshCheckChan</a>(<a class="code" href="classchanrec.html">chanrec</a> *c,std::string servername) -00822 { -00823 <span class="keywordflow">if</span> (c) -00824 { -00825 <span class="keywordflow">return</span> ChanAnyOnThisServer(c,(<span class="keywordtype">char</span>*)servername.c_str()); -00826 } -00827 <span class="keywordflow">else</span> <span class="keywordflow">return</span> <span class="keyword">false</span>; -00828 } -00829 -<a name="l00830"></a><a class="code" href="classServer.html#a58">00830</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a58">Server::MeshCheckCommon</a>(<a class="code" href="classuserrec.html">userrec</a>* u,std::string servername) -00831 { -00832 <span class="keywordflow">if</span> (u) -00833 { -00834 <span class="keywordflow">return</span> CommonOnThisServer(u,(<span class="keywordtype">char</span>*)servername.c_str()); -00835 } -00836 <span class="keywordflow">else</span> <span class="keywordflow">return</span> <span class="keyword">false</span>; +00791 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++) +00792 <span class="keywordflow">if</span> (dest[i] < 32) +00793 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00794 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++) +00795 <span class="keywordflow">if</span> (dest[i] > 126) +00796 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00797 <span class="keywordtype">int</span> c = 0; +00798 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++) +00799 <span class="keywordflow">if</span> (dest[i] == <span class="charliteral">'!'</span>) +00800 c++; +00801 <span class="keywordflow">if</span> (c>1) +00802 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00803 c = 0; +00804 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(dest); i++) +00805 <span class="keywordflow">if</span> (dest[i] == <span class="charliteral">'@'</span>) +00806 c++; +00807 <span class="keywordflow">if</span> (c>1) +00808 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00809 +00810 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00811 } +00812 +<a name="l00813"></a><a class="code" href="classServer.html#a52">00813</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a52">Server::MeshSendAll</a>(std::string text) +00814 { +00815 NetSendToAll((<span class="keywordtype">char</span>*)text.c_str()); +00816 } +00817 +<a name="l00818"></a><a class="code" href="classServer.html#a53">00818</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a53">Server::MeshSendCommon</a>(<a class="code" href="classuserrec.html">userrec</a>* user, std::string text) +00819 { +00820 <span class="keywordflow">if</span> (user) +00821 NetSendToCommon(user,(<span class="keywordtype">char</span>*)text.c_str()); +00822 } +00823 +<a name="l00824"></a><a class="code" href="classServer.html#a54">00824</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a54">Server::MeshSendAllAlive</a>(std::string text) +00825 { +00826 NetSendToAllAlive((<span class="keywordtype">char</span>*)text.c_str()); +00827 } +00828 +<a name="l00829"></a><a class="code" href="classServer.html#a55">00829</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a55">Server::MeshSendUnicast</a>(std::string destination, std::string text) +00830 { +00831 NetSendToOne((<span class="keywordtype">char</span>*)destination.c_str(),(<span class="keywordtype">char</span>*)text.c_str()); +00832 } +00833 +<a name="l00834"></a><a class="code" href="classServer.html#a56">00834</a> <span class="keywordtype">void</span> <a class="code" href="classServer.html#a56">Server::MeshSendAllExcept</a>(std::string target, std::string text) +00835 { +00836 NetSendToAllExcept(target.c_str(),(<span class="keywordtype">char</span>*)text.c_str()); 00837 } 00838 -<a name="l00839"></a><a class="code" href="classServer.html#a59">00839</a> <a class="code" href="classModule.html">Module</a>* <a class="code" href="classServer.html#a59">Server::FindModule</a>(std::string name) +<a name="l00839"></a><a class="code" href="classServer.html#a57">00839</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a57">Server::MeshCheckChan</a>(<a class="code" href="classchanrec.html">chanrec</a> *c,std::string servername) 00840 { -00841 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i <= <a class="code" href="modules_8cpp.html#a1">MODCOUNT</a>; i++) +00841 <span class="keywordflow">if</span> (c) 00842 { -00843 <span class="keywordflow">if</span> (<a class="code" href="channels_8cpp.html#a27">module_names</a>[i] == name) -00844 { -00845 <span class="keywordflow">return</span> <a class="code" href="channels_8cpp.html#a2">modules</a>[i]; -00846 } -00847 } -00848 <span class="keywordflow">return</span> NULL; -00849 } -00850 -<a name="l00851"></a><a class="code" href="classConfigReader.html#a0">00851</a> <a class="code" href="classConfigReader.html#a0">ConfigReader::ConfigReader</a>() -00852 { -00853 this-><a class="code" href="classConfigReader.html#p0">cache</a> = <span class="keyword">new</span> std::stringstream(std::stringstream::in | std::stringstream::out); -00854 this-><a class="code" href="classConfigReader.html#p1">errorlog</a> = <span class="keyword">new</span> std::stringstream(std::stringstream::in | std::stringstream::out); -00855 this-><a class="code" href="classConfigReader.html#p2">readerror</a> = LoadConf(CONFIG_FILE,this->cache,this->errorlog); -00856 <span class="keywordflow">if</span> (!this-><a class="code" href="classConfigReader.html#p2">readerror</a>) -00857 this-><a class="code" href="classConfigReader.html#p3">error</a> = <a class="code" href="modules_8h.html#a30">CONF_FILE_NOT_FOUND</a>; -00858 } -00859 -00860 -<a name="l00861"></a><a class="code" href="classConfigReader.html#a2">00861</a> <a class="code" href="classConfigReader.html#a2">ConfigReader::~ConfigReader</a>() -00862 { -00863 <span class="keywordflow">if</span> (this-><a class="code" href="classConfigReader.html#p0">cache</a>) -00864 <span class="keyword">delete</span> this-><a class="code" href="classConfigReader.html#p0">cache</a>; -00865 <span class="keywordflow">if</span> (this-><a class="code" href="classConfigReader.html#p1">errorlog</a>) -00866 <span class="keyword">delete</span> this-><a class="code" href="classConfigReader.html#p1">errorlog</a>; +00843 <span class="keywordflow">return</span> ChanAnyOnThisServer(c,(<span class="keywordtype">char</span>*)servername.c_str()); +00844 } +00845 <span class="keywordflow">else</span> <span class="keywordflow">return</span> <span class="keyword">false</span>; +00846 } +00847 +<a name="l00848"></a><a class="code" href="classServer.html#a58">00848</a> <span class="keywordtype">bool</span> <a class="code" href="classServer.html#a58">Server::MeshCheckCommon</a>(<a class="code" href="classuserrec.html">userrec</a>* u,std::string servername) +00849 { +00850 <span class="keywordflow">if</span> (u) +00851 { +00852 <span class="keywordflow">return</span> CommonOnThisServer(u,(<span class="keywordtype">char</span>*)servername.c_str()); +00853 } +00854 <span class="keywordflow">else</span> <span class="keywordflow">return</span> <span class="keyword">false</span>; +00855 } +00856 +<a name="l00857"></a><a class="code" href="classServer.html#a59">00857</a> <a class="code" href="classModule.html">Module</a>* <a class="code" href="classServer.html#a59">Server::FindModule</a>(std::string name) +00858 { +00859 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i <= <a class="code" href="modules_8cpp.html#a1">MODCOUNT</a>; i++) +00860 { +00861 <span class="keywordflow">if</span> (<a class="code" href="channels_8cpp.html#a27">module_names</a>[i] == name) +00862 { +00863 <span class="keywordflow">return</span> <a class="code" href="channels_8cpp.html#a2">modules</a>[i]; +00864 } +00865 } +00866 <span class="keywordflow">return</span> NULL; 00867 } 00868 -00869 -<a name="l00870"></a><a class="code" href="classConfigReader.html#a1">00870</a> <a class="code" href="classConfigReader.html#a0">ConfigReader::ConfigReader</a>(std::string filename) -00871 { -00872 this-><a class="code" href="classConfigReader.html#p0">cache</a> = <span class="keyword">new</span> std::stringstream(std::stringstream::in | std::stringstream::out); -00873 this-><a class="code" href="classConfigReader.html#p1">errorlog</a> = <span class="keyword">new</span> std::stringstream(std::stringstream::in | std::stringstream::out); -00874 this-><a class="code" href="classConfigReader.html#p2">readerror</a> = LoadConf(filename.c_str(),this-><a class="code" href="classConfigReader.html#p0">cache</a>,this-><a class="code" href="classConfigReader.html#p1">errorlog</a>); -00875 <span class="keywordflow">if</span> (!this-><a class="code" href="classConfigReader.html#p2">readerror</a>) -00876 this-><a class="code" href="classConfigReader.html#p3">error</a> = <a class="code" href="modules_8h.html#a30">CONF_FILE_NOT_FOUND</a>; -00877 }; +<a name="l00869"></a><a class="code" href="classConfigReader.html#a0">00869</a> <a class="code" href="classConfigReader.html#a0">ConfigReader::ConfigReader</a>() +00870 { +00871 this-><a class="code" href="classConfigReader.html#p0">cache</a> = <span class="keyword">new</span> std::stringstream(std::stringstream::in | std::stringstream::out); +00872 this-><a class="code" href="classConfigReader.html#p1">errorlog</a> = <span class="keyword">new</span> std::stringstream(std::stringstream::in | std::stringstream::out); +00873 this-><a class="code" href="classConfigReader.html#p2">readerror</a> = LoadConf(CONFIG_FILE,this->cache,this->errorlog); +00874 <span class="keywordflow">if</span> (!this-><a class="code" href="classConfigReader.html#p2">readerror</a>) +00875 this-><a class="code" href="classConfigReader.html#p3">error</a> = <a class="code" href="modules_8h.html#a30">CONF_FILE_NOT_FOUND</a>; +00876 } +00877 00878 -<a name="l00879"></a><a class="code" href="classConfigReader.html#a3">00879</a> std::string <a class="code" href="classConfigReader.html#a3">ConfigReader::ReadValue</a>(std::string tag, std::string name, <span class="keywordtype">int</span> index) +<a name="l00879"></a><a class="code" href="classConfigReader.html#a2">00879</a> <a class="code" href="classConfigReader.html#a2">ConfigReader::~ConfigReader</a>() 00880 { -00881 <span class="keywordtype">char</span> val[MAXBUF]; -00882 <span class="keywordtype">char</span> t[MAXBUF]; -00883 <span class="keywordtype">char</span> n[MAXBUF]; -00884 strlcpy(t,tag.c_str(),MAXBUF); -00885 strlcpy(n,name.c_str(),MAXBUF); -00886 <span class="keywordtype">int</span> res = ReadConf(<a class="code" href="classConfigReader.html#p0">cache</a>,t,n,index,val); -00887 <span class="keywordflow">if</span> (!res) -00888 { -00889 this-><a class="code" href="classConfigReader.html#p3">error</a> = <a class="code" href="modules_8h.html#a29">CONF_VALUE_NOT_FOUND</a>; -00890 <span class="keywordflow">return</span> <span class="stringliteral">""</span>; -00891 } -00892 <span class="keywordflow">return</span> std::string(val); -00893 } -00894 -<a name="l00895"></a><a class="code" href="classConfigReader.html#a4">00895</a> <span class="keywordtype">bool</span> <a class="code" href="classConfigReader.html#a4">ConfigReader::ReadFlag</a>(std::string tag, std::string name, <span class="keywordtype">int</span> index) -00896 { -00897 <span class="keywordtype">char</span> val[MAXBUF]; -00898 <span class="keywordtype">char</span> t[MAXBUF]; -00899 <span class="keywordtype">char</span> n[MAXBUF]; -00900 strlcpy(t,tag.c_str(),MAXBUF); -00901 strlcpy(n,name.c_str(),MAXBUF); -00902 <span class="keywordtype">int</span> res = ReadConf(<a class="code" href="classConfigReader.html#p0">cache</a>,t,n,index,val); -00903 <span class="keywordflow">if</span> (!res) -00904 { -00905 this-><a class="code" href="classConfigReader.html#p3">error</a> = <a class="code" href="modules_8h.html#a29">CONF_VALUE_NOT_FOUND</a>; -00906 <span class="keywordflow">return</span> <span class="keyword">false</span>; -00907 } -00908 std::string s = val; -00909 <span class="keywordflow">return</span> ((s == <span class="stringliteral">"yes"</span>) || (s == <span class="stringliteral">"YES"</span>) || (s == <span class="stringliteral">"true"</span>) || (s == <span class="stringliteral">"TRUE"</span>) || (s == <span class="stringliteral">"1"</span>)); -00910 } -00911 -<a name="l00912"></a><a class="code" href="classConfigReader.html#a5">00912</a> <span class="keywordtype">long</span> <a class="code" href="classConfigReader.html#a5">ConfigReader::ReadInteger</a>(std::string tag, std::string name, <span class="keywordtype">int</span> index, <span class="keywordtype">bool</span> needs_unsigned) -00913 { -00914 <span class="keywordtype">char</span> val[MAXBUF]; -00915 <span class="keywordtype">char</span> t[MAXBUF]; -00916 <span class="keywordtype">char</span> n[MAXBUF]; -00917 strlcpy(t,tag.c_str(),MAXBUF); -00918 strlcpy(n,name.c_str(),MAXBUF); -00919 <span class="keywordtype">int</span> res = ReadConf(<a class="code" href="classConfigReader.html#p0">cache</a>,t,n,index,val); -00920 <span class="keywordflow">if</span> (!res) -00921 { -00922 this-><a class="code" href="classConfigReader.html#p3">error</a> = <a class="code" href="modules_8h.html#a29">CONF_VALUE_NOT_FOUND</a>; -00923 <span class="keywordflow">return</span> 0; -00924 } -00925 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(val); i++) -00926 { -00927 <span class="keywordflow">if</span> (!isdigit(val[i])) -00928 { -00929 this-><a class="code" href="classConfigReader.html#p3">error</a> = <a class="code" href="modules_8h.html#a27">CONF_NOT_A_NUMBER</a>; -00930 <span class="keywordflow">return</span> 0; -00931 } -00932 } -00933 <span class="keywordflow">if</span> ((needs_unsigned) && (atoi(val)<0)) -00934 { -00935 this-><a class="code" href="classConfigReader.html#p3">error</a> = <a class="code" href="modules_8h.html#a28">CONF_NOT_UNSIGNED</a>; -00936 <span class="keywordflow">return</span> 0; -00937 } -00938 <span class="keywordflow">return</span> atoi(val); -00939 } -00940 -<a name="l00941"></a><a class="code" href="classConfigReader.html#a6">00941</a> <span class="keywordtype">long</span> <a class="code" href="classConfigReader.html#a6">ConfigReader::GetError</a>() -00942 { -00943 <span class="keywordtype">long</span> olderr = this-><a class="code" href="classConfigReader.html#p3">error</a>; -00944 this->error = 0; -00945 <span class="keywordflow">return</span> olderr; -00946 } -00947 -<a name="l00948"></a><a class="code" href="classConfigReader.html#a9">00948</a> <span class="keywordtype">void</span> <a class="code" href="classConfigReader.html#a9">ConfigReader::DumpErrors</a>(<span class="keywordtype">bool</span> bail, <a class="code" href="classuserrec.html">userrec</a>* user) -00949 { -00950 <span class="keywordflow">if</span> (bail) -00951 { -00952 printf(<span class="stringliteral">"There were errors in your configuration:\n%s"</span>,<a class="code" href="classConfigReader.html#p1">errorlog</a>->str().c_str()); -00953 exit(0); -00954 } -00955 <span class="keywordflow">else</span> -00956 { -00957 <span class="keywordtype">char</span> dataline[1024]; -00958 <span class="keywordflow">if</span> (user) -00959 { -00960 WriteServ(user-><a class="code" href="classconnection.html#o0">fd</a>,<span class="stringliteral">"NOTICE %s :There were errors in the configuration file:"</span>,user-><a class="code" href="classuserrec.html#o0">nick</a>); -00961 <span class="keywordflow">while</span> (!<a class="code" href="classConfigReader.html#p1">errorlog</a>->eof()) -00962 { -00963 <a class="code" href="classConfigReader.html#p1">errorlog</a>->getline(dataline,1024); -00964 WriteServ(user-><a class="code" href="classconnection.html#o0">fd</a>,<span class="stringliteral">"NOTICE %s :%s"</span>,user-><a class="code" href="classuserrec.html#o0">nick</a>,dataline); -00965 } -00966 } -00967 <span class="keywordflow">else</span> -00968 { -00969 WriteOpers(<span class="stringliteral">"There were errors in the configuration file:"</span>,user-><a class="code" href="classuserrec.html#o0">nick</a>); -00970 <span class="keywordflow">while</span> (!<a class="code" href="classConfigReader.html#p1">errorlog</a>->eof()) -00971 { -00972 <a class="code" href="classConfigReader.html#p1">errorlog</a>->getline(dataline,1024); -00973 WriteOpers(dataline); -00974 } -00975 } -00976 <span class="keywordflow">return</span>; -00977 } -00978 } -00979 -00980 -<a name="l00981"></a><a class="code" href="classConfigReader.html#a7">00981</a> <span class="keywordtype">int</span> <a class="code" href="classConfigReader.html#a7">ConfigReader::Enumerate</a>(std::string tag) -00982 { -00983 <span class="keywordflow">return</span> EnumConf(<a class="code" href="classConfigReader.html#p0">cache</a>,tag.c_str()); -00984 } -00985 -<a name="l00986"></a><a class="code" href="classConfigReader.html#a10">00986</a> <span class="keywordtype">int</span> <a class="code" href="classConfigReader.html#a10">ConfigReader::EnumerateValues</a>(std::string tag, <span class="keywordtype">int</span> index) -00987 { -00988 <span class="keywordflow">return</span> EnumValues(<a class="code" href="classConfigReader.html#p0">cache</a>, tag.c_str(), index); -00989 } -00990 -<a name="l00991"></a><a class="code" href="classConfigReader.html#a8">00991</a> <span class="keywordtype">bool</span> <a class="code" href="classConfigReader.html#a8">ConfigReader::Verify</a>() -00992 { -00993 <span class="keywordflow">return</span> this-><a class="code" href="classConfigReader.html#p2">readerror</a>; -00994 } -00995 -00996 -<a name="l00997"></a><a class="code" href="classFileReader.html#a1">00997</a> <a class="code" href="classFileReader.html#a0">FileReader::FileReader</a>(std::string filename) -00998 { -00999 <a class="code" href="modules_8h.html#a31">file_cache</a> c; -01000 readfile(c,filename.c_str()); -01001 this-><a class="code" href="classFileReader.html#r0">fc</a> = c; +00881 <span class="keywordflow">if</span> (this-><a class="code" href="classConfigReader.html#p0">cache</a>) +00882 <span class="keyword">delete</span> this-><a class="code" href="classConfigReader.html#p0">cache</a>; +00883 <span class="keywordflow">if</span> (this-><a class="code" href="classConfigReader.html#p1">errorlog</a>) +00884 <span class="keyword">delete</span> this-><a class="code" href="classConfigReader.html#p1">errorlog</a>; +00885 } +00886 +00887 +<a name="l00888"></a><a class="code" href="classConfigReader.html#a1">00888</a> <a class="code" href="classConfigReader.html#a0">ConfigReader::ConfigReader</a>(std::string filename) +00889 { +00890 this-><a class="code" href="classConfigReader.html#p0">cache</a> = <span class="keyword">new</span> std::stringstream(std::stringstream::in | std::stringstream::out); +00891 this-><a class="code" href="classConfigReader.html#p1">errorlog</a> = <span class="keyword">new</span> std::stringstream(std::stringstream::in | std::stringstream::out); +00892 this-><a class="code" href="classConfigReader.html#p2">readerror</a> = LoadConf(filename.c_str(),this-><a class="code" href="classConfigReader.html#p0">cache</a>,this-><a class="code" href="classConfigReader.html#p1">errorlog</a>); +00893 <span class="keywordflow">if</span> (!this-><a class="code" href="classConfigReader.html#p2">readerror</a>) +00894 this-><a class="code" href="classConfigReader.html#p3">error</a> = <a class="code" href="modules_8h.html#a30">CONF_FILE_NOT_FOUND</a>; +00895 }; +00896 +<a name="l00897"></a><a class="code" href="classConfigReader.html#a3">00897</a> std::string <a class="code" href="classConfigReader.html#a3">ConfigReader::ReadValue</a>(std::string tag, std::string name, <span class="keywordtype">int</span> index) +00898 { +00899 <span class="keywordtype">char</span> val[MAXBUF]; +00900 <span class="keywordtype">char</span> t[MAXBUF]; +00901 <span class="keywordtype">char</span> n[MAXBUF]; +00902 strlcpy(t,tag.c_str(),MAXBUF); +00903 strlcpy(n,name.c_str(),MAXBUF); +00904 <span class="keywordtype">int</span> res = ReadConf(<a class="code" href="classConfigReader.html#p0">cache</a>,t,n,index,val); +00905 <span class="keywordflow">if</span> (!res) +00906 { +00907 this-><a class="code" href="classConfigReader.html#p3">error</a> = <a class="code" href="modules_8h.html#a29">CONF_VALUE_NOT_FOUND</a>; +00908 <span class="keywordflow">return</span> <span class="stringliteral">""</span>; +00909 } +00910 <span class="keywordflow">return</span> val; +00911 } +00912 +<a name="l00913"></a><a class="code" href="classConfigReader.html#a4">00913</a> <span class="keywordtype">bool</span> <a class="code" href="classConfigReader.html#a4">ConfigReader::ReadFlag</a>(std::string tag, std::string name, <span class="keywordtype">int</span> index) +00914 { +00915 <span class="keywordtype">char</span> val[MAXBUF]; +00916 <span class="keywordtype">char</span> t[MAXBUF]; +00917 <span class="keywordtype">char</span> n[MAXBUF]; +00918 strlcpy(t,tag.c_str(),MAXBUF); +00919 strlcpy(n,name.c_str(),MAXBUF); +00920 <span class="keywordtype">int</span> res = ReadConf(<a class="code" href="classConfigReader.html#p0">cache</a>,t,n,index,val); +00921 <span class="keywordflow">if</span> (!res) +00922 { +00923 this-><a class="code" href="classConfigReader.html#p3">error</a> = <a class="code" href="modules_8h.html#a29">CONF_VALUE_NOT_FOUND</a>; +00924 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00925 } +00926 std::string s = val; +00927 <span class="keywordflow">return</span> ((s == <span class="stringliteral">"yes"</span>) || (s == <span class="stringliteral">"YES"</span>) || (s == <span class="stringliteral">"true"</span>) || (s == <span class="stringliteral">"TRUE"</span>) || (s == <span class="stringliteral">"1"</span>)); +00928 } +00929 +<a name="l00930"></a><a class="code" href="classConfigReader.html#a5">00930</a> <span class="keywordtype">long</span> <a class="code" href="classConfigReader.html#a5">ConfigReader::ReadInteger</a>(std::string tag, std::string name, <span class="keywordtype">int</span> index, <span class="keywordtype">bool</span> needs_unsigned) +00931 { +00932 <span class="keywordtype">char</span> val[MAXBUF]; +00933 <span class="keywordtype">char</span> t[MAXBUF]; +00934 <span class="keywordtype">char</span> n[MAXBUF]; +00935 strlcpy(t,tag.c_str(),MAXBUF); +00936 strlcpy(n,name.c_str(),MAXBUF); +00937 <span class="keywordtype">int</span> res = ReadConf(<a class="code" href="classConfigReader.html#p0">cache</a>,t,n,index,val); +00938 <span class="keywordflow">if</span> (!res) +00939 { +00940 this-><a class="code" href="classConfigReader.html#p3">error</a> = <a class="code" href="modules_8h.html#a29">CONF_VALUE_NOT_FOUND</a>; +00941 <span class="keywordflow">return</span> 0; +00942 } +00943 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < strlen(val); i++) +00944 { +00945 <span class="keywordflow">if</span> (!isdigit(val[i])) +00946 { +00947 this-><a class="code" href="classConfigReader.html#p3">error</a> = <a class="code" href="modules_8h.html#a27">CONF_NOT_A_NUMBER</a>; +00948 <span class="keywordflow">return</span> 0; +00949 } +00950 } +00951 <span class="keywordflow">if</span> ((needs_unsigned) && (atoi(val)<0)) +00952 { +00953 this-><a class="code" href="classConfigReader.html#p3">error</a> = <a class="code" href="modules_8h.html#a28">CONF_NOT_UNSIGNED</a>; +00954 <span class="keywordflow">return</span> 0; +00955 } +00956 <span class="keywordflow">return</span> atoi(val); +00957 } +00958 +<a name="l00959"></a><a class="code" href="classConfigReader.html#a6">00959</a> <span class="keywordtype">long</span> <a class="code" href="classConfigReader.html#a6">ConfigReader::GetError</a>() +00960 { +00961 <span class="keywordtype">long</span> olderr = this-><a class="code" href="classConfigReader.html#p3">error</a>; +00962 this->error = 0; +00963 <span class="keywordflow">return</span> olderr; +00964 } +00965 +<a name="l00966"></a><a class="code" href="classConfigReader.html#a9">00966</a> <span class="keywordtype">void</span> <a class="code" href="classConfigReader.html#a9">ConfigReader::DumpErrors</a>(<span class="keywordtype">bool</span> bail, <a class="code" href="classuserrec.html">userrec</a>* user) +00967 { +00968 <span class="keywordflow">if</span> (bail) +00969 { +00970 printf(<span class="stringliteral">"There were errors in your configuration:\n%s"</span>,<a class="code" href="classConfigReader.html#p1">errorlog</a>->str().c_str()); +00971 exit(0); +00972 } +00973 <span class="keywordflow">else</span> +00974 { +00975 <span class="keywordtype">char</span> dataline[1024]; +00976 <span class="keywordflow">if</span> (user) +00977 { +00978 WriteServ(user-><a class="code" href="classconnection.html#o0">fd</a>,<span class="stringliteral">"NOTICE %s :There were errors in the configuration file:"</span>,user-><a class="code" href="classuserrec.html#o0">nick</a>); +00979 <span class="keywordflow">while</span> (!<a class="code" href="classConfigReader.html#p1">errorlog</a>->eof()) +00980 { +00981 <a class="code" href="classConfigReader.html#p1">errorlog</a>->getline(dataline,1024); +00982 WriteServ(user-><a class="code" href="classconnection.html#o0">fd</a>,<span class="stringliteral">"NOTICE %s :%s"</span>,user-><a class="code" href="classuserrec.html#o0">nick</a>,dataline); +00983 } +00984 } +00985 <span class="keywordflow">else</span> +00986 { +00987 WriteOpers(<span class="stringliteral">"There were errors in the configuration file:"</span>,user-><a class="code" href="classuserrec.html#o0">nick</a>); +00988 <span class="keywordflow">while</span> (!<a class="code" href="classConfigReader.html#p1">errorlog</a>->eof()) +00989 { +00990 <a class="code" href="classConfigReader.html#p1">errorlog</a>->getline(dataline,1024); +00991 WriteOpers(dataline); +00992 } +00993 } +00994 <span class="keywordflow">return</span>; +00995 } +00996 } +00997 +00998 +<a name="l00999"></a><a class="code" href="classConfigReader.html#a7">00999</a> <span class="keywordtype">int</span> <a class="code" href="classConfigReader.html#a7">ConfigReader::Enumerate</a>(std::string tag) +01000 { +01001 <span class="keywordflow">return</span> EnumConf(<a class="code" href="classConfigReader.html#p0">cache</a>,tag.c_str()); 01002 } 01003 -<a name="l01004"></a><a class="code" href="classFileReader.html#a0">01004</a> <a class="code" href="classFileReader.html#a0">FileReader::FileReader</a>() +<a name="l01004"></a><a class="code" href="classConfigReader.html#a10">01004</a> <span class="keywordtype">int</span> <a class="code" href="classConfigReader.html#a10">ConfigReader::EnumerateValues</a>(std::string tag, <span class="keywordtype">int</span> index) 01005 { -01006 } -01007 -<a name="l01008"></a><a class="code" href="classFileReader.html#a3">01008</a> <span class="keywordtype">void</span> <a class="code" href="classFileReader.html#a3">FileReader::LoadFile</a>(std::string filename) -01009 { -01010 <a class="code" href="modules_8h.html#a31">file_cache</a> c; -01011 readfile(c,filename.c_str()); -01012 this-><a class="code" href="classFileReader.html#r0">fc</a> = c; -01013 } +01006 <span class="keywordflow">return</span> EnumValues(<a class="code" href="classConfigReader.html#p0">cache</a>, tag.c_str(), index); +01007 } +01008 +<a name="l01009"></a><a class="code" href="classConfigReader.html#a8">01009</a> <span class="keywordtype">bool</span> <a class="code" href="classConfigReader.html#a8">ConfigReader::Verify</a>() +01010 { +01011 <span class="keywordflow">return</span> this-><a class="code" href="classConfigReader.html#p2">readerror</a>; +01012 } +01013 01014 -01015 -<a name="l01016"></a><a class="code" href="classFileReader.html#a2">01016</a> <a class="code" href="classFileReader.html#a2">FileReader::~FileReader</a>() -01017 { -01018 } -01019 -<a name="l01020"></a><a class="code" href="classFileReader.html#a4">01020</a> <span class="keywordtype">bool</span> <a class="code" href="classFileReader.html#a4">FileReader::Exists</a>() -01021 { -01022 <span class="keywordflow">if</span> (<a class="code" href="classFileReader.html#r0">fc</a>.size() == 0) -01023 { -01024 <span class="keywordflow">return</span>(<span class="keyword">false</span>); -01025 } -01026 <span class="keywordflow">else</span> -01027 { -01028 <span class="keywordflow">return</span>(<span class="keyword">true</span>); -01029 } -01030 } -01031 -<a name="l01032"></a><a class="code" href="classFileReader.html#a5">01032</a> std::string <a class="code" href="classFileReader.html#a5">FileReader::GetLine</a>(<span class="keywordtype">int</span> x) -01033 { -01034 <span class="keywordflow">if</span> ((x<0) || (x><a class="code" href="classFileReader.html#r0">fc</a>.size())) -01035 <span class="keywordflow">return</span> <span class="stringliteral">""</span>; -01036 <span class="keywordflow">return</span> <a class="code" href="classFileReader.html#r0">fc</a>[x]; -01037 } -01038 -<a name="l01039"></a><a class="code" href="classFileReader.html#a6">01039</a> <span class="keywordtype">int</span> <a class="code" href="classFileReader.html#a6">FileReader::FileSize</a>() -01040 { -01041 <span class="keywordflow">return</span> <a class="code" href="classFileReader.html#r0">fc</a>.size(); -01042 } -01043 -01044 -01045 std::vector<Module*> <a class="code" href="modules_8cpp.html#a60">modules</a>(255); -01046 std::vector<ircd_module*> <a class="code" href="modules_8cpp.html#a61">factory</a>(255); -01047 -<a name="l01048"></a><a class="code" href="modules_8cpp.html#a1">01048</a> <span class="keywordtype">int</span> <a class="code" href="modules_8cpp.html#a1">MODCOUNT</a> = -1; +<a name="l01015"></a><a class="code" href="classFileReader.html#a1">01015</a> <a class="code" href="classFileReader.html#a0">FileReader::FileReader</a>(std::string filename) +01016 { +01017 <a class="code" href="modules_8h.html#a31">file_cache</a> c; +01018 readfile(c,filename.c_str()); +01019 this-><a class="code" href="classFileReader.html#r0">fc</a> = c; +01020 } +01021 +<a name="l01022"></a><a class="code" href="classFileReader.html#a0">01022</a> <a class="code" href="classFileReader.html#a0">FileReader::FileReader</a>() +01023 { +01024 } +01025 +<a name="l01026"></a><a class="code" href="classFileReader.html#a3">01026</a> <span class="keywordtype">void</span> <a class="code" href="classFileReader.html#a3">FileReader::LoadFile</a>(std::string filename) +01027 { +01028 <a class="code" href="modules_8h.html#a31">file_cache</a> c; +01029 readfile(c,filename.c_str()); +01030 this-><a class="code" href="classFileReader.html#r0">fc</a> = c; +01031 } +01032 +01033 +<a name="l01034"></a><a class="code" href="classFileReader.html#a2">01034</a> <a class="code" href="classFileReader.html#a2">FileReader::~FileReader</a>() +01035 { +01036 } +01037 +<a name="l01038"></a><a class="code" href="classFileReader.html#a4">01038</a> <span class="keywordtype">bool</span> <a class="code" href="classFileReader.html#a4">FileReader::Exists</a>() +01039 { +01040 <span class="keywordflow">if</span> (<a class="code" href="classFileReader.html#r0">fc</a>.size() == 0) +01041 { +01042 <span class="keywordflow">return</span>(<span class="keyword">false</span>); +01043 } +01044 <span class="keywordflow">else</span> +01045 { +01046 <span class="keywordflow">return</span>(<span class="keyword">true</span>); +01047 } +01048 } 01049 -01050 -</pre></div><hr size="1"><address style="align: right;"><small>Generated on Sat May 7 15:34:21 2005 for InspIRCd by +<a name="l01050"></a><a class="code" href="classFileReader.html#a5">01050</a> std::string <a class="code" href="classFileReader.html#a5">FileReader::GetLine</a>(<span class="keywordtype">int</span> x) +01051 { +01052 <span class="keywordflow">if</span> ((x<0) || (x><a class="code" href="classFileReader.html#r0">fc</a>.size())) +01053 <span class="keywordflow">return</span> <span class="stringliteral">""</span>; +01054 <span class="keywordflow">return</span> <a class="code" href="classFileReader.html#r0">fc</a>[x]; +01055 } +01056 +<a name="l01057"></a><a class="code" href="classFileReader.html#a6">01057</a> <span class="keywordtype">int</span> <a class="code" href="classFileReader.html#a6">FileReader::FileSize</a>() +01058 { +01059 <span class="keywordflow">return</span> <a class="code" href="classFileReader.html#r0">fc</a>.size(); +01060 } +01061 +01062 +01063 std::vector<Module*> <a class="code" href="modules_8cpp.html#a60">modules</a>(255); +01064 std::vector<ircd_module*> <a class="code" href="modules_8cpp.html#a61">factory</a>(255); +01065 +<a name="l01066"></a><a class="code" href="modules_8cpp.html#a1">01066</a> <span class="keywordtype">int</span> <a class="code" href="modules_8cpp.html#a1">MODCOUNT</a> = -1; +01067 +01068 +</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 12 02:25:12 2005 for InspIRCd by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border=0 > </a>1.3.3 </small></address> |