summaryrefslogtreecommitdiff
path: root/include/ctables.h
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-16 18:10:38 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-16 18:10:38 +0000
commit293df6a8b55e89c127e60e92711ef0ef1027bff8 (patch)
treeda33b32cfdd5b6e93cabaf288316671af9a51297 /include/ctables.h
parent0d6f3c83f101e3cb1f6cd6768cc4d17de24db489 (diff)
Split all commands into seperate files and redid command system to take classes, not function pointers (function pointers suck ass)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2534 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/ctables.h')
-rw-r--r--include/ctables.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/include/ctables.h b/include/ctables.h
index 2dadca42d..65b469948 100644
--- a/include/ctables.h
+++ b/include/ctables.h
@@ -22,7 +22,7 @@
class userrec;
-typedef void (handlerfunc) (char**, int, userrec*);
+/*typedef void (handlerfunc) (char**, int, userrec*);*/
/** A structure that defines a command
*/
@@ -31,10 +31,7 @@ class command_t
public:
/** Command name
*/
- char command[MAXBUF];
- /** Handler function as in typedef
- */
- handlerfunc *handler_function;
+ std::string command;
/** User flags needed to execute the command or 0
*/
char flags_needed;
@@ -49,10 +46,20 @@ class command_t
long total_bytes;
/** used for resource tracking between modules
*/
- char source[MAXBUF];
+ std::string source;
+
+ command_t(std::string cmd, char flags, int minpara) : command(cmd), flags_needed(flags), min_params(minpara)
+ {
+ use_count = total_bytes = 0;
+ source = "<core>";
+ }
+
+ virtual void Handle(char** parameters, int pcnt, userrec* user) = 0;
+
+ virtual ~command_t() {}
};
-typedef std::deque<command_t> command_table;
+typedef std::deque<command_t*> command_table;
#endif