From 755d67224f033aaa9b4ef3d2dd00f46bb8c19dc2 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 7 Apr 2005 20:15:05 +0000 Subject: New docs to match extra module Version class stuff, etc git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1008 e03df62e-2008-0410-955e-edbf42e46eb7 --- docs/module-doc/modules_8h-source.html | 471 +++++++++++++++++---------------- 1 file changed, 239 insertions(+), 232 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 af553f1c7..80f93ef15 100644 --- a/docs/module-doc/modules_8h-source.html +++ b/docs/module-doc/modules_8h-source.html @@ -55,245 +55,252 @@ 00048 #define AC_INVITE 7 // a user is being invited 00049 #define AC_GENERAL_MODE 8 // a user channel mode is being changed 00050 -00051 #include "dynamic.h" -00052 #include "base.h" -00053 #include "ctables.h" -00054 #include <string> -00055 #include <deque> -00056 #include <sstream> -00057 -00060 typedef std::deque<std::string> file_cache; -00061 typedef file_cache string_list; -00062 -00065 typedef std::deque<userrec*> chanuserlist; -00066 -00067 -00068 // This #define allows us to call a method in all -00069 // loaded modules in a readable simple way, e.g.: -00070 // 'FOREACH_MOD OnConnect(user);' -00071 -00072 #define FOREACH_MOD for (int i = 0; i <= MODCOUNT; i++) modules[i]-> -00073 -00074 // This define is similar to the one above but returns a result in MOD_RESULT. -00075 // The first module to return a nonzero result is the value to be accepted, -00076 // and any modules after are ignored. -00077 -00078 // ********************************************************************************************* -00079 -00080 #define FOREACH_RESULT(x) { MOD_RESULT = 0; \ -00081 for (int i = 0; i <= MODCOUNT; i++) { \ -00082 int res = modules[i]->x ; \ -00083 if (res != 0) { \ -00084 MOD_RESULT = res; \ -00085 break; \ -00086 } \ -00087 } \ -00088 } -00089 -00090 // ********************************************************************************************* -00091 -00092 extern void createcommand(char* cmd, handlerfunc f, char flags, int minparams); -00093 extern void server_mode(char **parameters, int pcnt, userrec *user); -00094 -00095 // class Version holds the version information of a Module, returned -00096 // by Module::GetVersion (thanks RD) -00097 -00102 class Version : public classbase -00103 { -00104 public: -00105 const int Major, Minor, Revision, Build; -00106 Version(int major, int minor, int revision, int build); -00107 }; -00108 -00114 class Admin : public classbase -00115 { -00116 public: -00117 const std::string Name, Email, Nick; -00118 Admin(std::string name, std::string email, std::string nick); -00119 }; -00120 -00126 class Module : public classbase -00127 { -00128 public: -00129 -00133 Module(); -00134 -00138 virtual ~Module(); -00139 -00144 virtual Version GetVersion(); -00145 -00149 virtual void OnUserConnect(userrec* user); -00150 -00154 virtual void OnUserQuit(userrec* user); -00155 -00160 virtual void OnUserJoin(userrec* user, chanrec* channel); -00161 -00166 virtual void OnUserPart(userrec* user, chanrec* channel); -00167 -00174 virtual void OnPacketTransmit(char *p); -00175 -00183 virtual void OnPacketReceive(char *p); -00184 -00190 virtual void OnRehash(); +00051 // used to define a set of behavior bits for a module +00052 +00053 #define VF_STATIC 1 // module is static, cannot be /unloadmodule'd +00054 #define VF_VENDOR 2 // module is a vendor module (came in the original tarball, not 3rd party) +00055 #define VF_SERVICEPROVIDER 4 // module provides a service to other modules (can be a dependency) +00056 #define VF_COMMON 8 // module needs to be common on all servers in a mesh to link +00057 +00058 #include "dynamic.h" +00059 #include "base.h" +00060 #include "ctables.h" +00061 #include <string> +00062 #include <deque> +00063 #include <sstream> +00064 +00067 typedef std::deque<std::string> file_cache; +00068 typedef file_cache string_list; +00069 +00072 typedef std::deque<userrec*> chanuserlist; +00073 +00074 +00075 // This #define allows us to call a method in all +00076 // loaded modules in a readable simple way, e.g.: +00077 // 'FOREACH_MOD OnConnect(user);' +00078 +00079 #define FOREACH_MOD for (int i = 0; i <= MODCOUNT; i++) modules[i]-> +00080 +00081 // This define is similar to the one above but returns a result in MOD_RESULT. +00082 // The first module to return a nonzero result is the value to be accepted, +00083 // and any modules after are ignored. +00084 +00085 // ********************************************************************************************* +00086 +00087 #define FOREACH_RESULT(x) { MOD_RESULT = 0; \ +00088 for (int i = 0; i <= MODCOUNT; i++) { \ +00089 int res = modules[i]->x ; \ +00090 if (res != 0) { \ +00091 MOD_RESULT = res; \ +00092 break; \ +00093 } \ +00094 } \ +00095 } +00096 +00097 // ********************************************************************************************* +00098 +00099 extern void createcommand(char* cmd, handlerfunc f, char flags, int minparams, char* source); +00100 extern void server_mode(char **parameters, int pcnt, userrec *user); +00101 +00102 // class Version holds the version information of a Module, returned +00103 // by Module::GetVersion (thanks RD) +00104 +00109 class Version : public classbase +00110 { +00111 public: +00112 const int Major, Minor, Revision, Build, Flags; +00113 Version(int major, int minor, int revision, int build, int flags); +00114 }; +00115 +00121 class Admin : public classbase +00122 { +00123 public: +00124 const std::string Name, Email, Nick; +00125 Admin(std::string name, std::string email, std::string nick); +00126 }; +00127 +00133 class Module : public classbase +00134 { +00135 public: +00136 +00140 Module(); +00141 +00145 virtual ~Module(); +00146 +00151 virtual Version GetVersion(); +00152 +00156 virtual void OnUserConnect(userrec* user); +00157 +00161 virtual void OnUserQuit(userrec* user); +00162 +00167 virtual void OnUserJoin(userrec* user, chanrec* channel); +00168 +00173 virtual void OnUserPart(userrec* user, chanrec* channel); +00174 +00181 virtual void OnPacketTransmit(char *p); +00182 +00190 virtual void OnPacketReceive(char *p); 00191 -00200 virtual void OnServerRaw(std::string &raw, bool inbound, userrec* user); -00201 -00211 virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list &params); -00212 -00226 virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname); -00227 -00228 -00233 virtual void OnOper(userrec* user); +00197 virtual void OnRehash(); +00198 +00207 virtual void OnServerRaw(std::string &raw, bool inbound, userrec* user); +00208 +00218 virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list &params); +00219 +00233 virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname); 00234 -00243 virtual void OnInfo(userrec* user); -00244 -00249 virtual void OnWhois(userrec* source, userrec* dest); -00250 -00256 virtual int OnUserPreInvite(userrec* source,userrec* dest,chanrec* channel); +00235 +00240 virtual void OnOper(userrec* user); +00241 +00250 virtual void OnInfo(userrec* user); +00251 +00256 virtual void OnWhois(userrec* source, userrec* dest); 00257 -00266 virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text); -00267 -00279 virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text); -00280 -00288 virtual int OnUserPreNick(userrec* user, std::string newnick); -00289 -00297 virtual void OnUserPostNick(userrec* user, std::string oldnick); -00298 -00320 virtual int OnAccessCheck(userrec* source,userrec* dest,chanrec* channel,int access_type); -00321 -00327 virtual string_list OnUserSync(userrec* user); +00263 virtual int OnUserPreInvite(userrec* source,userrec* dest,chanrec* channel); +00264 +00273 virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text); +00274 +00286 virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text); +00287 +00295 virtual int OnUserPreNick(userrec* user, std::string newnick); +00296 +00304 virtual void OnUserPostNick(userrec* user, std::string oldnick); +00305 +00327 virtual int OnAccessCheck(userrec* source,userrec* dest,chanrec* channel,int access_type); 00328 -00334 virtual string_list OnChannelSync(chanrec* chan); +00334 virtual string_list OnUserSync(userrec* user); 00335 -00339 virtual void On005Numeric(std::string &output); -00340 -00350 virtual int OnKill(userrec* source, userrec* dest, std::string reason); -00351 -00362 virtual void OnLoadModule(Module* mod,std::string name); -00363 }; -00364 -00365 -00371 class Server : public classbase -00372 { -00373 public: -00377 Server(); -00381 virtual ~Server(); -00382 -00386 virtual void SendOpers(std::string s); -00391 virtual void Log(int level, std::string s); -00396 virtual void Send(int Socket, std::string s); -00401 virtual void SendServ(int Socket, std::string s); -00406 virtual void SendFrom(int Socket, userrec* User, std::string s); -00421 virtual void SendTo(userrec* Source, userrec* Dest, std::string s); -00428 virtual void SendChannel(userrec* User, chanrec* Channel, std::string s,bool IncludeSender); -00433 virtual bool CommonChannels(userrec* u1, userrec* u2); -00441 virtual void SendCommon(userrec* User, std::string text,bool IncludeSender); -00446 virtual void SendWallops(userrec* User, std::string text); -00447 -00451 virtual bool IsNick(std::string nick); -00455 virtual int CountUsers(chanrec* c); -00459 virtual userrec* FindNick(std::string nick); -00463 virtual chanrec* FindChannel(std::string channel); -00468 virtual std::string ChanMode(userrec* User, chanrec* Chan); -00472 virtual bool IsOnChannel(userrec* User, chanrec* Chan); -00475 virtual std::string GetServerName(); -00478 virtual std::string GetNetworkName(); -00484 virtual Admin GetAdmin(); -00503 virtual bool AddExtendedMode(char modechar, int type, bool requires_oper, int params_when_on, int params_when_off); -00504 -00526 virtual bool AddExtendedListMode(char modechar); -00527 -00542 virtual void AddCommand(char* cmd, handlerfunc f, char flags, int minparams); -00543 -00565 virtual void SendMode(char **parameters, int pcnt, userrec *user); -00566 -00579 virtual void SendToModeMask(std::string modes, int flags, std::string text); -00580 -00586 virtual chanrec* JoinUserToChannel(userrec* user, std::string cname, std::string key); -00587 -00593 virtual chanrec* PartUserFromChannel(userrec* user, std::string cname, std::string reason); -00594 -00600 virtual void ChangeUserNick(userrec* user, std::string nickname); -00601 -00612 virtual void QuitUser(userrec* user, std::string reason); -00613 -00618 virtual bool MatchText(std::string sliteral, std::string spattern); -00619 -00631 virtual void CallCommandHandler(std::string commandname, char** parameters, int pcnt, userrec* user); -00632 -00638 virtual void ChangeHost(userrec* user, std::string host); -00639 -00645 virtual void ChangeGECOS(userrec* user, std::string gecos); -00646 -00655 virtual bool IsUlined(std::string server); +00341 virtual string_list OnChannelSync(chanrec* chan); +00342 +00346 virtual void On005Numeric(std::string &output); +00347 +00357 virtual int OnKill(userrec* source, userrec* dest, std::string reason); +00358 +00369 virtual void OnLoadModule(Module* mod,std::string name); +00370 }; +00371 +00372 +00378 class Server : public classbase +00379 { +00380 public: +00384 Server(); +00388 virtual ~Server(); +00389 +00393 virtual void SendOpers(std::string s); +00398 virtual void Log(int level, std::string s); +00403 virtual void Send(int Socket, std::string s); +00408 virtual void SendServ(int Socket, std::string s); +00413 virtual void SendFrom(int Socket, userrec* User, std::string s); +00428 virtual void SendTo(userrec* Source, userrec* Dest, std::string s); +00435 virtual void SendChannel(userrec* User, chanrec* Channel, std::string s,bool IncludeSender); +00440 virtual bool CommonChannels(userrec* u1, userrec* u2); +00448 virtual void SendCommon(userrec* User, std::string text,bool IncludeSender); +00453 virtual void SendWallops(userrec* User, std::string text); +00454 +00458 virtual bool IsNick(std::string nick); +00462 virtual int CountUsers(chanrec* c); +00466 virtual userrec* FindNick(std::string nick); +00470 virtual chanrec* FindChannel(std::string channel); +00475 virtual std::string ChanMode(userrec* User, chanrec* Chan); +00479 virtual bool IsOnChannel(userrec* User, chanrec* Chan); +00482 virtual std::string GetServerName(); +00485 virtual std::string GetNetworkName(); +00491 virtual Admin GetAdmin(); +00510 virtual bool AddExtendedMode(char modechar, int type, bool requires_oper, int params_when_on, int params_when_off); +00511 +00533 virtual bool AddExtendedListMode(char modechar); +00534 +00552 virtual void AddCommand(char* cmd, handlerfunc f, char flags, int minparams, char* source); +00553 +00575 virtual void SendMode(char **parameters, int pcnt, userrec *user); +00576 +00589 virtual void SendToModeMask(std::string modes, int flags, std::string text); +00590 +00596 virtual chanrec* JoinUserToChannel(userrec* user, std::string cname, std::string key); +00597 +00603 virtual chanrec* PartUserFromChannel(userrec* user, std::string cname, std::string reason); +00604 +00610 virtual void ChangeUserNick(userrec* user, std::string nickname); +00611 +00622 virtual void QuitUser(userrec* user, std::string reason); +00623 +00628 virtual bool MatchText(std::string sliteral, std::string spattern); +00629 +00641 virtual void CallCommandHandler(std::string commandname, char** parameters, int pcnt, userrec* user); +00642 +00648 virtual void ChangeHost(userrec* user, std::string host); +00649 +00655 virtual void ChangeGECOS(userrec* user, std::string gecos); 00656 -00660 virtual chanuserlist GetUsers(chanrec* chan); -00661 -00662 }; -00663 -00664 #define CONF_NOT_A_NUMBER 0x000010 -00665 #define CONF_NOT_UNSIGNED 0x000080 -00666 #define CONF_VALUE_NOT_FOUND 0x000100 -00667 #define CONF_FILE_NOT_FOUND 0x000200 -00668 -00675 class ConfigReader : public classbase -00676 { -00677 protected: -00683 std::stringstream *cache; -00684 std::stringstream *errorlog; -00687 bool readerror; -00688 long error; -00689 -00690 public: -00695 ConfigReader(); // default constructor reads ircd.conf -00699 ConfigReader(std::string filename); // read a module-specific config -00703 ~ConfigReader(); -00708 std::string ReadValue(std::string tag, std::string name, int index); -00714 bool ReadFlag(std::string tag, std::string name, int index); -00723 long ReadInteger(std::string tag, std::string name, int index, bool needs_unsigned); -00728 long GetError(); -00735 int Enumerate(std::string tag); -00740 bool Verify(); -00747 void DumpErrors(bool bail,userrec* user); -00748 -00754 int EnumerateValues(std::string tag, int index); -00755 }; -00756 -00757 +00665 virtual bool IsUlined(std::string server); +00666 +00670 virtual chanuserlist GetUsers(chanrec* chan); +00671 +00672 }; +00673 +00674 #define CONF_NOT_A_NUMBER 0x000010 +00675 #define CONF_NOT_UNSIGNED 0x000080 +00676 #define CONF_VALUE_NOT_FOUND 0x000100 +00677 #define CONF_FILE_NOT_FOUND 0x000200 +00678 +00685 class ConfigReader : public classbase +00686 { +00687 protected: +00693 std::stringstream *cache; +00694 std::stringstream *errorlog; +00697 bool readerror; +00698 long error; +00699 +00700 public: +00705 ConfigReader(); // default constructor reads ircd.conf +00709 ConfigReader(std::string filename); // read a module-specific config +00713 ~ConfigReader(); +00718 std::string ReadValue(std::string tag, std::string name, int index); +00724 bool ReadFlag(std::string tag, std::string name, int index); +00733 long ReadInteger(std::string tag, std::string name, int index, bool needs_unsigned); +00738 long GetError(); +00745 int Enumerate(std::string tag); +00750 bool Verify(); +00757 void DumpErrors(bool bail,userrec* user); 00758 -00764 class FileReader : public classbase -00765 { -00766 file_cache fc; -00767 public: -00772 FileReader(); -00773 -00779 FileReader(std::string filename); -00780 -00784 ~FileReader(); -00785 -00791 void LoadFile(std::string filename); -00792 -00796 bool Exists(); -00797 -00802 std::string GetLine(int x); -00803 -00809 int FileSize(); -00810 }; -00811 -00812 -00819 class ModuleFactory : public classbase -00820 { -00821 public: -00822 ModuleFactory() { } -00823 virtual ~ModuleFactory() { } -00828 virtual Module * CreateModule() = 0; -00829 }; -00830 -00831 -00832 typedef DLLFactory<ModuleFactory> ircd_module; -00833 -00834 #endif -
Generated on Mon Apr 4 18:12:48 2005 for InspIRCd by +00764 int EnumerateValues(std::string tag, int index); +00765 }; +00766 +00767 +00768 +00774 class FileReader : public classbase +00775 { +00776 file_cache fc; +00777 public: +00782 FileReader(); +00783 +00789 FileReader(std::string filename); +00790 +00794 ~FileReader(); +00795 +00801 void LoadFile(std::string filename); +00802 +00806 bool Exists(); +00807 +00812 std::string GetLine(int x); +00813 +00819 int FileSize(); +00820 }; +00821 +00822 +00829 class ModuleFactory : public classbase +00830 { +00831 public: +00832 ModuleFactory() { } +00833 virtual ~ModuleFactory() { } +00838 virtual Module * CreateModule() = 0; +00839 }; +00840 +00841 +00842 typedef DLLFactory<ModuleFactory> ircd_module; +00843 +00844 #endif +
Generated on Thu Apr 7 20:14:21 2005 for InspIRCd by doxygen 1.3.3
-- cgit v1.2.3