summaryrefslogtreecommitdiff
path: root/include/command_parse.h
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-03 00:44:11 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-03 00:44:11 +0000
commit540f3bd9da75eea65e8ae5e5fd929ff522d95870 (patch)
treebec0072b8a7911367a156de8e1d33f80bb4a376c /include/command_parse.h
parent1b7c615062a7b203c7fc3ce4c56e16eb671f7c15 (diff)
Add /RELOAD and move cmd_mode into its own command.
/RELOAD is the only thing you cant reload (ahem) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5119 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/command_parse.h')
-rw-r--r--include/command_parse.h29
1 files changed, 27 insertions, 2 deletions
diff --git a/include/command_parse.h b/include/command_parse.h
index d4c64dab4..a9c1e26c8 100644
--- a/include/command_parse.h
+++ b/include/command_parse.h
@@ -24,6 +24,8 @@
class InspIRCd;
+typedef std::map<std::string, void*> SharedObjectList;
+
/** This class handles command management and parsing.
* It allows you to add and remove commands from the map,
* call command handlers by name, and chop up comma seperated
@@ -55,12 +57,16 @@ class CommandParser : public classbase
void FindSym(void** v, void* h);
+ SharedObjectList RFCCommands;
+
+ void LoadCommand(const char* name);
+
public:
/** Command list, a hash_map of command names to command_t*
*/
command_table cmdlist;
- void LoadCommand(const char* name);
+ bool ReloadCommand(const char* cmd);
/** Default constructor.
* @param Instance The creator of this class
@@ -146,9 +152,28 @@ class CommandParser : public classbase
/** Add a new command to the commands hash
* @param f The new command_t to add to the list
+ * @param so_handle The handle to the shared object where the command can be found.
+ * Only core commands loaded via cmd_*.so files should set this parameter to anything
+ * meaningful. Module authors should leave this parameter at its default of NULL.
* @return True if the command was added
*/
- bool CreateCommand(command_t *f);
+ bool CreateCommand(command_t *f, void* so_handle = NULL);
+};
+
+/** Command handler class for the RELOAD command.
+ * A command cant really reload itself, so this has to be in here.
+ */
+class cmd_reload : public command_t
+{
+ public:
+ /** Standard constructor
+ */
+ cmd_reload (InspIRCd* Instance) : command_t(Instance,"RELOAD",'o',1) { syntax = "<core-command>"; }
+ /** Handle RELOAD
+ */
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
+
+
#endif