From 60a9969b9471dec190d5526b79cb731ea2e1b751 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 7 Apr 2004 18:21:29 +0000 Subject: Added new documentation git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@424 e03df62e-2008-0410-955e-edbf42e46eb7 --- docs/module-doc/modules_8h-source.html | 352 +++++++++++++++++---------------- 1 file changed, 182 insertions(+), 170 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 d461928e2..7fca50afb 100644 --- a/docs/module-doc/modules_8h-source.html +++ b/docs/module-doc/modules_8h-source.html @@ -31,180 +31,192 @@ 00023 #include "ctables.h" 00024 #include <string> 00025 #include <deque> -00026 -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.: -00034 // 'FOREACH_MOD OnConnect(user);' -00035 -00036 #define FOREACH_MOD for (int i = 0; i <= MODCOUNT; i++) modules[i]-> -00037 -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 -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 -00173 virtual bool OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list &params); -00174 -00187 virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname); -00188 +00026 #include <sstream> +00027 +00030 typedef std::deque<std::string> file_cache; +00031 typedef file_cache string_list; +00032 +00033 // This #define allows us to call a method in all +00034 // loaded modules in a readable simple way, e.g.: +00035 // 'FOREACH_MOD OnConnect(user);' +00036 +00037 #define FOREACH_MOD for (int i = 0; i <= MODCOUNT; i++) modules[i]-> +00038 +00039 // This define is similar to the one above but returns a result in MOD_RESULT. +00040 // The first module to return a nonzero result is the value to be accepted, +00041 // and any modules after are ignored. +00042 +00043 // ********************************************************************************************* +00044 +00045 #define FOREACH_RESULT(x) { MOD_RESULT = 0; \ +00046 for (int i = 0; i <= MODCOUNT; i++) { \ +00047 int res = modules[i]->x ; \ +00048 if (res) { \ +00049 MOD_RESULT = res; \ +00050 break; \ +00051 } \ +00052 } \ +00053 } +00054 +00055 // ********************************************************************************************* +00056 +00057 extern void createcommand(char* cmd, handlerfunc f, char flags, int minparams); +00058 extern void server_mode(char **parameters, int pcnt, userrec *user); +00059 +00060 // class Version holds the version information of a Module, returned +00061 // by Module::GetVersion (thanks RD) +00062 +00067 class Version : public classbase +00068 { +00069 public: +00070 const int Major, Minor, Revision, Build; +00071 Version(int major, int minor, int revision, int build); +00072 }; +00073 +00079 class Admin : public classbase +00080 { +00081 public: +00082 const std::string Name, Email, Nick; +00083 Admin(std::string name, std::string email, std::string nick); +00084 }; +00085 +00091 class Module : public classbase +00092 { +00093 public: +00094 +00098 Module(); +00099 +00103 virtual ~Module(); +00104 +00109 virtual Version GetVersion(); +00110 +00114 virtual void OnUserConnect(userrec* user); +00115 +00119 virtual void OnUserQuit(userrec* user); +00120 +00125 virtual void OnUserJoin(userrec* user, chanrec* channel); +00126 +00131 virtual void OnUserPart(userrec* user, chanrec* channel); +00132 +00139 virtual void OnPacketTransmit(char *p); +00140 +00148 virtual void OnPacketReceive(char *p); +00149 +00155 virtual void OnRehash(); +00156 +00163 virtual void OnServerRaw(std::string &raw, bool inbound); +00164 +00174 virtual bool OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list &params); +00175 +00188 virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname); 00189 -00194 virtual void OnOper(userrec* user); -00195 -00204 virtual void OnInfo(userrec* user); -00205 -00210 virtual void OnWhois(userrec* source, userrec* dest); -00211 -00220 virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string text); -00221 -00230 virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string text); -00231 }; -00232 +00190 +00195 virtual void OnOper(userrec* user); +00196 +00205 virtual void OnInfo(userrec* user); +00206 +00211 virtual void OnWhois(userrec* source, userrec* dest); +00212 +00221 virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string text); +00222 +00231 virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string text); +00232 }; 00233 -00239 class Server : public classbase -00240 { -00241 public: -00245 Server(); -00249 virtual ~Server(); -00250 -00254 virtual void SendOpers(std::string s); -00259 virtual void Log(int level, std::string s); -00264 virtual void Send(int Socket, std::string s); -00269 virtual void SendServ(int Socket, std::string s); -00274 virtual void SendFrom(int Socket, userrec* User, std::string s); -00279 virtual void SendTo(userrec* Source, userrec* Dest, std::string s); -00286 virtual void SendChannel(userrec* User, chanrec* Channel, std::string s,bool IncludeSender); -00291 virtual bool CommonChannels(userrec* u1, userrec* u2); -00299 virtual void SendCommon(userrec* User, std::string text,bool IncludeSender); -00304 virtual void SendWallops(userrec* User, std::string text); -00305 -00309 virtual bool IsNick(std::string nick); -00313 virtual userrec* FindNick(std::string nick); -00317 virtual chanrec* FindChannel(std::string channel); -00322 virtual std::string ChanMode(userrec* User, chanrec* Chan); -00325 virtual std::string GetServerName(); -00328 virtual std::string GetNetworkName(); -00334 virtual Admin GetAdmin(); -00353 virtual bool AddExtendedMode(char modechar, int type, bool requires_oper, int params_when_on, int params_when_off); -00354 -00369 virtual void AddCommand(char* cmd, handlerfunc f, char flags, int minparams); -00370 -00392 virtual void SendMode(char **parameters, int pcnt, userrec *user); -00393 -00406 virtual void SendToModeMask(std::string modes, int flags, std::string text); -00407 -00413 virtual chanrec* Server::JoinUserToChannel(userrec* user, std::string cname, std::string key); -00414 -00420 virtual chanrec* Server::PartUserFromChannel(userrec* user, std::string cname, std::string reason); -00421 -00427 virtual void ChangeUserNick(userrec* user, std::string nickname); -00428 -00439 virtual void QuitUser(userrec* user, std::string reason); -00440 }; -00441 -00448 class ConfigReader : public classbase -00449 { -00450 protected: -00453 std::string fname; -00454 public: -00459 ConfigReader(); // default constructor reads ircd.conf -00463 ConfigReader(std::string filename); // read a module-specific config -00467 ~ConfigReader(); -00472 std::string ReadValue(std::string tag, std::string name, int index); -00479 int Enumerate(std::string tag); -00483 bool Verify(); -00484 }; -00485 -00486 -00487 -00493 class FileReader : public classbase -00494 { -00495 file_cache fc; -00496 public: -00501 FileReader(); -00507 FileReader(std::string filename); -00511 ~FileReader(); -00517 void LoadFile(std::string filename); -00522 bool Exists(); -00523 std::string GetLine(int x); -00529 int FileSize(); -00530 }; +00234 +00240 class Server : public classbase +00241 { +00242 public: +00246 Server(); +00250 virtual ~Server(); +00251 +00255 virtual void SendOpers(std::string s); +00260 virtual void Log(int level, std::string s); +00265 virtual void Send(int Socket, std::string s); +00270 virtual void SendServ(int Socket, std::string s); +00275 virtual void SendFrom(int Socket, userrec* User, std::string s); +00290 virtual void SendTo(userrec* Source, userrec* Dest, std::string s); +00297 virtual void SendChannel(userrec* User, chanrec* Channel, std::string s,bool IncludeSender); +00302 virtual bool CommonChannels(userrec* u1, userrec* u2); +00310 virtual void SendCommon(userrec* User, std::string text,bool IncludeSender); +00315 virtual void SendWallops(userrec* User, std::string text); +00316 +00320 virtual bool IsNick(std::string nick); +00324 virtual int CountUsers(chanrec* c); +00328 virtual userrec* FindNick(std::string nick); +00332 virtual chanrec* FindChannel(std::string channel); +00337 virtual std::string ChanMode(userrec* User, chanrec* Chan); +00340 virtual std::string GetServerName(); +00343 virtual std::string GetNetworkName(); +00349 virtual Admin GetAdmin(); +00368 virtual bool AddExtendedMode(char modechar, int type, bool requires_oper, int params_when_on, int params_when_off); +00369 +00384 virtual void AddCommand(char* cmd, handlerfunc f, char flags, int minparams); +00385 +00407 virtual void SendMode(char **parameters, int pcnt, userrec *user); +00408 +00421 virtual void SendToModeMask(std::string modes, int flags, std::string text); +00422 +00428 virtual chanrec* JoinUserToChannel(userrec* user, std::string cname, std::string key); +00429 +00435 virtual chanrec* PartUserFromChannel(userrec* user, std::string cname, std::string reason); +00436 +00442 virtual void ChangeUserNick(userrec* user, std::string nickname); +00443 +00454 virtual void QuitUser(userrec* user, std::string reason); +00455 +00460 virtual bool MatchText(std::string sliteral, std::string spattern); +00461 }; +00462 +00469 class ConfigReader : public classbase +00470 { +00471 protected: +00477 std::stringstream *cache; +00480 bool error; +00481 +00482 public: +00487 ConfigReader(); // default constructor reads ircd.conf +00491 ConfigReader(std::string filename); // read a module-specific config +00495 ~ConfigReader(); +00500 std::string ReadValue(std::string tag, std::string name, int index); +00507 int Enumerate(std::string tag); +00512 bool Verify(); +00513 }; +00514 +00515 +00516 +00522 class FileReader : public classbase +00523 { +00524 file_cache fc; +00525 public: +00530 FileReader(); 00531 -00532 -00539 class ModuleFactory : public classbase -00540 { -00541 public: -00542 ModuleFactory() { } -00543 virtual ~ModuleFactory() { } -00548 virtual Module * CreateModule() = 0; -00549 }; +00537 FileReader(std::string filename); +00538 +00542 ~FileReader(); +00543 +00549 void LoadFile(std::string filename); 00550 -00551 -00552 typedef DLLFactory<ModuleFactory> ircd_module; -00553 -00554 #endif -
Generated on Tue Apr 6 21:13:19 2004 for InspIRCd by +00551 bool Exists(); +00552 +00557 std::string GetLine(int x); +00558 +00564 int FileSize(); +00565 }; +00566 +00567 +00574 class ModuleFactory : public classbase +00575 { +00576 public: +00577 ModuleFactory() { } +00578 virtual ~ModuleFactory() { } +00583 virtual Module * CreateModule() = 0; +00584 }; +00585 +00586 +00587 typedef DLLFactory<ModuleFactory> ircd_module; +00588 +00589 #endif +
Generated on Wed Apr 7 19:20:14 2004 for InspIRCd by doxygen1.3-rc3
-- cgit v1.2.3