diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-07 17:04:04 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-07 17:04:04 +0000 |
commit | 211b24ba8cf6e21f435f145b0366adc8a3b62460 (patch) | |
tree | 8119f965d57ad163f57c220ff8e11ca772184419 /include | |
parent | e4a08d44617d8b46f58a0e110ffcf7f8df29a56f (diff) |
Started work on /UNLOADMODULE, resource tracking and flags in Version class
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@999 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r-- | include/commands.h | 1 | ||||
-rw-r--r-- | include/ctables.h | 3 | ||||
-rw-r--r-- | include/inspircd.h | 1 | ||||
-rw-r--r-- | include/modules.h | 11 |
4 files changed, 12 insertions, 4 deletions
diff --git a/include/commands.h b/include/commands.h index aa6fcf206..589168409 100644 --- a/include/commands.h +++ b/include/commands.h @@ -80,6 +80,7 @@ void handle_qline(char **parameters, int pcnt, userrec *user); void handle_eline(char **parameters, int pcnt, userrec *user); void handle_server(char **parameters, int pcnt, userrec *user); void handle_loadmodule(char **parameters, int pcnt, userrec *user); +void handle_unloadmodule(char **parameters, int pcnt, userrec *user); /** Special functions for processing server to server traffic */ diff --git a/include/ctables.h b/include/ctables.h index fb96b9ef6..5926f3a2a 100644 --- a/include/ctables.h +++ b/include/ctables.h @@ -44,6 +44,9 @@ class command_t : public Extensible /** used by /stats m */ long total_bytes; + /** used for resource tracking between modules + */ + char source[MAXBUF]; }; #endif diff --git a/include/inspircd.h b/include/inspircd.h index e54da779b..b7a5b7104 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -159,6 +159,7 @@ long map_count(const char* s); userrec* ReHashNick(char* Old, char* New); long GetMaxBans(char* name); bool LoadModule(const char* filename); +bool UnloadModule(const char* filename); char* ModuleError(); // mesh network functions diff --git a/include/modules.h b/include/modules.h index 9b2118472..b1f505e29 100644 --- a/include/modules.h +++ b/include/modules.h @@ -96,7 +96,7 @@ typedef std::deque<userrec*> chanuserlist; // ********************************************************************************************* -extern void createcommand(char* cmd, handlerfunc f, char flags, int minparams); +extern void createcommand(char* cmd, handlerfunc f, char flags, int minparams, char* source); extern void server_mode(char **parameters, int pcnt, userrec *user); // class Version holds the version information of a Module, returned @@ -109,8 +109,8 @@ extern void server_mode(char **parameters, int pcnt, userrec *user); class Version : public classbase { public: - const int Major, Minor, Revision, Build; - Version(int major, int minor, int revision, int build); + const int Major, Minor, Revision, Build, Flags; + Version(int major, int minor, int revision, int build, int flags); }; /** Holds /ADMIN data @@ -545,8 +545,11 @@ class Server : public classbase * than the 'minparams' value you specified when creating the command. The *user parameter is the class of * the user which caused the command to trigger, who will always have the flag you specified in 'flags' when * creating the initial command. For example to create an oper only command create the commands with flags='o'. + * The source parameter is used for resource tracking, and should contain the name of your module (with file + * extension) e.g. "m_blarp.so". If you place the wrong identifier here, you can cause crashes if your module + * is unloaded. */ - virtual void AddCommand(char* cmd, handlerfunc f, char flags, int minparams); + virtual void AddCommand(char* cmd, handlerfunc f, char flags, int minparams, char* source); /** Sends a servermode. * you must format the parameters array with the target, modes and parameters for those modes. |