From abdb186046bcdd83aefbc4171a00bd1ad7ec963c Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 3 Apr 2004 15:46:53 +0000 Subject: Added support for module-defined chanmodes with no parameters Fixed minor typo in example conf Added new stylesheet and docs git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@362 e03df62e-2008-0410-955e-edbf42e46eb7 --- docs/module-doc/modules_8h-source.html | 273 ++++++++++++++++++--------------- 1 file changed, 146 insertions(+), 127 deletions(-) (limited to 'docs/module-doc/modules_8h-source.html') diff --git a/docs/module-doc/modules_8h-source.html b/docs/module-doc/modules_8h-source.html index f872917ec..e1848aeb4 100644 --- a/docs/module-doc/modules_8h-source.html +++ b/docs/module-doc/modules_8h-source.html @@ -1,7 +1,7 @@ modules.h Source File - +
@@ -32,8 +32,8 @@ 00024 #include <string> 00025 #include <deque> 00026 -00029 typedef std::deque<std::string> file_cache; -00030 typedef file_cache string_list; +00029 typedef std::deque<std::string> file_cache; +00030 typedef file_cache string_list; 00031 00032 // This #define allows us to call a method in all 00033 // loaded modules in a readable simple way, e.g.: @@ -41,131 +41,150 @@ 00035 00036 #define FOREACH_MOD for (int i = 0; i <= MODCOUNT; i++) modules[i]-> 00037 -00038 extern void createcommand(char* cmd, handlerfunc f, char flags, int minparams); -00039 extern void server_mode(char **parameters, int pcnt, userrec *user); -00040 -00041 // class Version holds the version information of a Module, returned -00042 // by Module::GetVersion (thanks RD) +00038 // This define is similar to the one above but returns a result in MOD_RESULT. +00039 // The first module to return a nonzero result is the value to be accepted, +00040 // and any modules after are ignored. +00041 +00042 // ********************************************************************************************* 00043 -00048 class Version : public classbase -00049 { -00050 public: -00051 const int Major, Minor, Revision, Build; -00052 Version(int major, int minor, int revision, int build); -00053 }; -00054 -00060 class Admin : public classbase -00061 { -00062 public: -00063 const std::string Name, Email, Nick; -00064 Admin(std::string name, std::string email, std::string nick); -00065 }; -00066 -00072 class Module : public classbase -00073 { -00074 public: -00075 -00079 Module(); -00080 -00084 virtual ~Module(); -00085 -00090 virtual Version GetVersion(); -00091 -00095 virtual void OnUserConnect(userrec* user); -00096 -00100 virtual void OnUserQuit(userrec* user); -00101 -00106 virtual void OnUserJoin(userrec* user, chanrec* channel); -00107 -00112 virtual void OnUserPart(userrec* user, chanrec* channel); -00113 -00120 virtual void Module::OnPacketTransmit(char *p); -00121 -00129 virtual void Module::OnPacketReceive(char *p); -00130 -00136 virtual void OnRehash(); -00137 -00144 virtual void OnServerRaw(std::string &raw, bool inbound); -00145 -00154 virtual bool OnExtendedMode(userrec* user, chanrec* chan, char modechar, int type, bool mode_on, string_list &params); -00155 -00156 -00157 }; -00158 -00159 -00165 class Server : public classbase -00166 { -00167 public: -00171 Server(); -00175 virtual ~Server(); -00176 -00180 virtual void SendOpers(std::string s); -00185 virtual void Log(int level, std::string s); -00190 virtual void Send(int Socket, std::string s); -00195 virtual void SendServ(int Socket, std::string s); -00200 virtual void SendFrom(int Socket, userrec* User, std::string s); -00205 virtual void SendTo(userrec* Source, userrec* Dest, std::string s); -00212 virtual void SendChannel(userrec* User, chanrec* Channel, std::string s,bool IncludeSender); -00217 virtual bool CommonChannels(userrec* u1, userrec* u2); -00225 virtual void SendCommon(userrec* User, std::string text,bool IncludeSender); -00230 virtual void SendWallops(userrec* User, std::string text); -00231 -00235 virtual bool IsNick(std::string nick); -00239 virtual userrec* FindNick(std::string nick); -00243 virtual chanrec* FindChannel(std::string channel); -00248 virtual std::string ChanMode(userrec* User, chanrec* Chan); -00251 virtual std::string GetServerName(); -00254 virtual std::string GetNetworkName(); -00260 virtual Admin GetAdmin(); -00278 virtual bool AddExtendedMode(char modechar, int type, bool default_on, int params_when_on, int params_when_off); -00279 -00294 virtual void AddCommand(char* cmd, handlerfunc f, char flags, int minparams); -00295 -00313 virtual void SendMode(char **parameters, int pcnt, userrec *user); -00314 }; -00315 -00322 class ConfigReader : public classbase -00323 { -00324 protected: -00327 std::string fname; -00328 public: -00333 ConfigReader(); // default constructor reads ircd.conf -00337 ConfigReader(std::string filename); // read a module-specific config -00341 ~ConfigReader(); -00346 std::string ReadValue(std::string tag, std::string name, int index); -00353 int Enumerate(std::string tag); -00357 bool Verify(); -00358 }; -00359 -00360 -00361 -00367 class FileReader : public classbase -00368 { -00369 file_cache fc; -00370 public: -00375 FileReader(); -00381 FileReader(std::string filename); -00385 ~FileReader(); -00391 void LoadFile(std::string filename); -00396 bool Exists(); -00397 std::string GetLine(int x); -00403 int FileSize(); -00404 }; -00405 -00406 -00413 class ModuleFactory : public classbase -00414 { -00415 public: -00416 ModuleFactory() { } -00417 virtual ~ModuleFactory() { } -00422 virtual Module * CreateModule() = 0; -00423 }; -00424 -00425 -00426 typedef DLLFactory<ModuleFactory> ircd_module; -00427 -00428 #endif -
Generated on Fri Apr 2 14:46:05 2004 for InspIRCd by +00044 #define FOREACH_RESULT(x) { MOD_RESULT = 0; \ +00045 for (int i = 0; i <= MODCOUNT; i++) { \ +00046 int res = modules[i]->x ; \ +00047 if (res) { \ +00048 MOD_RESULT = res; \ +00049 break; \ +00050 } \ +00051 } \ +00052 } +00053 +00054 // ********************************************************************************************* +00055 +00056 extern void createcommand(char* cmd, handlerfunc f, char flags, int minparams); +00057 extern void server_mode(char **parameters, int pcnt, userrec *user); +00058 +00059 // class Version holds the version information of a Module, returned +00060 // by Module::GetVersion (thanks RD) +00061 +00066 class Version : public classbase +00067 { +00068 public: +00069 const int Major, Minor, Revision, Build; +00070 Version(int major, int minor, int revision, int build); +00071 }; +00072 +00078 class Admin : public classbase +00079 { +00080 public: +00081 const std::string Name, Email, Nick; +00082 Admin(std::string name, std::string email, std::string nick); +00083 }; +00084 +00090 class Module : public classbase +00091 { +00092 public: +00093 +00097 Module(); +00098 +00102 virtual ~Module(); +00103 +00108 virtual Version GetVersion(); +00109 +00113 virtual void OnUserConnect(userrec* user); +00114 +00118 virtual void OnUserQuit(userrec* user); +00119 +00124 virtual void OnUserJoin(userrec* user, chanrec* channel); +00125 +00130 virtual void OnUserPart(userrec* user, chanrec* channel); +00131 +00138 virtual void OnPacketTransmit(char *p); +00139 +00147 virtual void OnPacketReceive(char *p); +00148 +00154 virtual void OnRehash(); +00155 +00162 virtual void OnServerRaw(std::string &raw, bool inbound); +00163 +00172 virtual bool OnExtendedMode(userrec* user, chanrec* chan, char modechar, int type, bool mode_on, string_list &params); +00173 +00186 virtual int Module::OnUserPreJoin(userrec* user, chanrec* chan, char* cname); +00187 +00188 }; +00189 +00190 +00196 class Server : public classbase +00197 { +00198 public: +00202 Server(); +00206 virtual ~Server(); +00207 +00211 virtual void SendOpers(std::string s); +00216 virtual void Log(int level, std::string s); +00221 virtual void Send(int Socket, std::string s); +00226 virtual void SendServ(int Socket, std::string s); +00231 virtual void SendFrom(int Socket, userrec* User, std::string s); +00236 virtual void SendTo(userrec* Source, userrec* Dest, std::string s); +00243 virtual void SendChannel(userrec* User, chanrec* Channel, std::string s,bool IncludeSender); +00248 virtual bool CommonChannels(userrec* u1, userrec* u2); +00256 virtual void SendCommon(userrec* User, std::string text,bool IncludeSender); +00261 virtual void SendWallops(userrec* User, std::string text); +00262 +00266 virtual bool IsNick(std::string nick); +00270 virtual userrec* FindNick(std::string nick); +00274 virtual chanrec* FindChannel(std::string channel); +00279 virtual std::string ChanMode(userrec* User, chanrec* Chan); +00282 virtual std::string GetServerName(); +00285 virtual std::string GetNetworkName(); +00291 virtual Admin GetAdmin(); +00309 virtual bool AddExtendedMode(char modechar, int type, bool default_on, int params_when_on, int params_when_off); +00310 +00325 virtual void AddCommand(char* cmd, handlerfunc f, char flags, int minparams); +00326 +00348 virtual void SendMode(char **parameters, int pcnt, userrec *user); +00349 }; +00350 +00357 class ConfigReader : public classbase +00358 { +00359 protected: +00362 std::string fname; +00363 public: +00368 ConfigReader(); // default constructor reads ircd.conf +00372 ConfigReader(std::string filename); // read a module-specific config +00376 ~ConfigReader(); +00381 std::string ReadValue(std::string tag, std::string name, int index); +00388 int Enumerate(std::string tag); +00392 bool Verify(); +00393 }; +00394 +00395 +00396 +00402 class FileReader : public classbase +00403 { +00404 file_cache fc; +00405 public: +00410 FileReader(); +00416 FileReader(std::string filename); +00420 ~FileReader(); +00426 void LoadFile(std::string filename); +00431 bool Exists(); +00432 std::string GetLine(int x); +00438 int FileSize(); +00439 }; +00440 +00441 +00448 class ModuleFactory : public classbase +00449 { +00450 public: +00451 ModuleFactory() { } +00452 virtual ~ModuleFactory() { } +00457 virtual Module * CreateModule() = 0; +00458 }; +00459 +00460 +00461 typedef DLLFactory<ModuleFactory> ircd_module; +00462 +00463 #endif +
Generated on Sat Apr 3 16:36:03 2004 for InspIRCd by doxygen1.3-rc3
-- cgit v1.2.3