diff options
author | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-04 22:40:47 +0000 |
---|---|---|
committer | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-04 22:40:47 +0000 |
commit | 032e327fcf1a44440ddc767c6df0036b6b5d6a89 (patch) | |
tree | 44118ed6fa3127cc084ec73e0f761355615bc274 /src | |
parent | e1344b1cab8f4df0843b24c61cf8af65b1107079 (diff) |
Convert MemoServ.. *weep*
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1555 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r-- | src/core/ms_cancel.c | 41 | ||||
-rw-r--r-- | src/core/ms_check.c | 41 | ||||
-rw-r--r-- | src/core/ms_del.c | 40 | ||||
-rw-r--r-- | src/core/ms_help.c | 37 | ||||
-rw-r--r-- | src/core/ms_info.c | 41 | ||||
-rw-r--r-- | src/core/ms_list.c | 40 | ||||
-rw-r--r-- | src/core/ms_read.c | 41 | ||||
-rw-r--r-- | src/core/ms_rsend.c | 43 | ||||
-rw-r--r-- | src/core/ms_send.c | 42 | ||||
-rw-r--r-- | src/core/ms_sendall.c | 42 | ||||
-rw-r--r-- | src/core/ms_set.c | 54 | ||||
-rw-r--r-- | src/core/ms_staff.c | 42 |
12 files changed, 176 insertions, 328 deletions
diff --git a/src/core/ms_cancel.c b/src/core/ms_cancel.c index ceda631df..c6c172673 100644 --- a/src/core/ms_cancel.c +++ b/src/core/ms_cancel.c @@ -18,34 +18,21 @@ int do_cancel(User * u); void myMemoServHelp(User * u); -/** - * Create the cancel command, and tell anope about it. - * @param argc Argument count - * @param argv Argument list - * @return MOD_CONT to allow the module, MOD_STOP to stop it - **/ -int AnopeInit(int argc, char **argv) +class MSCancel : public Module { - Command *c; - - moduleAddAuthor("Anope"); - moduleAddVersion("$Id$"); - moduleSetType(CORE); - c = createCommand("CANCEL", do_cancel, NULL, MEMO_HELP_CANCEL, -1, -1, - -1, -1); - moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); - moduleSetMemoHelp(myMemoServHelp); - - return MOD_CONT; -} + public: + MSCancel(const std::string &creator) : Module(creator) + { + Command *c; -/** - * Unload the module - **/ -void AnopeFini(void) -{ - -} + moduleAddAuthor("Anope"); + moduleAddVersion("$Id$"); + moduleSetType(CORE); + c = createCommand("CANCEL", do_cancel, NULL, MEMO_HELP_CANCEL, -1, -1, -1, -1); + moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); + moduleSetMemoHelp(myMemoServHelp); + } +}; @@ -104,4 +91,4 @@ int do_cancel(User * u) return MOD_CONT; } -MODULE_INIT("ms_cancel") +MODULE_INIT(MSCancel) diff --git a/src/core/ms_check.c b/src/core/ms_check.c index 1cc755232..e4f52e09d 100644 --- a/src/core/ms_check.c +++ b/src/core/ms_check.c @@ -18,34 +18,21 @@ int do_memocheck(User * u); void myMemoServHelp(User * u); -/** - * Create the command, and tell anope about it. - * @param argc Argument count - * @param argv Argument list - * @return MOD_CONT to allow the module, MOD_STOP to stop it - **/ -int AnopeInit(int argc, char **argv) +class MSCheck : public Module { - Command *c; - - moduleAddAuthor("Anope"); - moduleAddVersion("$Id$"); - moduleSetType(CORE); - c = createCommand("CHECK", do_memocheck, NULL, MEMO_HELP_CHECK, -1, -1, - -1, -1); - moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); - moduleSetMemoHelp(myMemoServHelp); - - return MOD_CONT; -} + public: + MSCheck(const std::string &creator) : Module(creator) + { + Command *c; -/** - * Unload the module - **/ -void AnopeFini(void) -{ - -} + moduleAddAuthor("Anope"); + moduleAddVersion("$Id$"); + moduleSetType(CORE); + c = createCommand("CHECK", do_memocheck, NULL, MEMO_HELP_CHECK, -1, -1, -1, -1); + moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); + moduleSetMemoHelp(myMemoServHelp); + } +}; @@ -117,4 +104,4 @@ int do_memocheck(User * u) return MOD_CONT; } -MODULE_INIT("ms_check") +MODULE_INIT(MSCheck) diff --git a/src/core/ms_del.c b/src/core/ms_del.c index 4bc32630c..418b61d9b 100644 --- a/src/core/ms_del.c +++ b/src/core/ms_del.c @@ -19,33 +19,21 @@ int do_del(User * u); int del_memo_callback(User * u, int num, va_list args); void myMemoServHelp(User * u); -/** - * Create the command, and tell anope about it. - * @param argc Argument count - * @param argv Argument list - * @return MOD_CONT to allow the module, MOD_STOP to stop it - **/ -int AnopeInit(int argc, char **argv) +class MSDel : public Module { - Command *c; - - moduleAddAuthor("Anope"); - moduleAddVersion("$Id$"); - moduleSetType(CORE); - c = createCommand("DEL", do_del, NULL, MEMO_HELP_DEL, -1, -1, -1, -1); - moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); - moduleSetMemoHelp(myMemoServHelp); - - return MOD_CONT; -} + public: + MSDel(const std::string &creator) : Module(creator) + { + Command *c; -/** - * Unload the module - **/ -void AnopeFini(void) -{ - -} + moduleAddAuthor("Anope"); + moduleAddVersion("$Id$"); + moduleSetType(CORE); + c = createCommand("DEL", do_del, NULL, MEMO_HELP_DEL, -1, -1, -1, -1); + moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); + moduleSetMemoHelp(myMemoServHelp); + } +}; @@ -201,4 +189,4 @@ int del_memo_callback(User * u, int num, va_list args) } } -MODULE_INIT("ms_del") +MODULE_INIT(MSDel) diff --git a/src/core/ms_help.c b/src/core/ms_help.c index 470b74e60..852ea08c5 100644 --- a/src/core/ms_help.c +++ b/src/core/ms_help.c @@ -17,32 +17,21 @@ int do_help(User * u); -/** - * Create the help command, and tell anope about it. - * @param argc Argument count - * @param argv Argument list - * @return MOD_CONT to allow the module, MOD_STOP to stop it - **/ -int AnopeInit(int argc, char **argv) +class MSHelp : public Module { - Command *c; - - moduleAddAuthor("Anope"); - moduleAddVersion("$Id$"); - moduleSetType(CORE); - c = createCommand("HELP", do_help, NULL, -1, -1, -1, -1, -1); - moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); - - return MOD_CONT; -} + public: + MSHelp(const std::string &creator) : Module(creator) + { + Command *c; -/** - * Unload the module - **/ -void AnopeFini(void) -{ + moduleAddAuthor("Anope"); + moduleAddVersion("$Id$"); + moduleSetType(CORE); + c = createCommand("HELP", do_help, NULL, -1, -1, -1, -1, -1); + moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); + } +}; -} @@ -65,4 +54,4 @@ int do_help(User * u) return MOD_CONT; } -MODULE_INIT("ms_help") +MODULE_INIT(MSHelp) diff --git a/src/core/ms_info.c b/src/core/ms_info.c index 48703eccc..736d7f98a 100644 --- a/src/core/ms_info.c +++ b/src/core/ms_info.c @@ -18,34 +18,21 @@ int do_info(User * u); void myMemoServHelp(User * u); -/** - * Create the command, and tell anope about it. - * @param argc Argument count - * @param argv Argument list - * @return MOD_CONT to allow the module, MOD_STOP to stop it - **/ -int AnopeInit(int argc, char **argv) -{ - Command *c; - - moduleAddAuthor("Anope"); - moduleAddVersion("$Id$"); - moduleSetType(CORE); - c = createCommand("INFO", do_info, NULL, -1, MEMO_HELP_INFO, -1, - MEMO_SERVADMIN_HELP_INFO, MEMO_SERVADMIN_HELP_INFO); - moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); - moduleSetMemoHelp(myMemoServHelp); - - return MOD_CONT; -} - -/** - * Unload the module - **/ -void AnopeFini(void) +class MSInfo : public Module { + public: + MSInfo(const std::string &creator) : Module(creator) + { + Command *c; -} + moduleAddAuthor("Anope"); + moduleAddVersion("$Id$"); + moduleSetType(CORE); + c = createCommand("INFO", do_info, NULL, -1, MEMO_HELP_INFO, -1, MEMO_SERVADMIN_HELP_INFO, MEMO_SERVADMIN_HELP_INFO); + moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); + moduleSetMemoHelp(myMemoServHelp); + } +}; @@ -230,4 +217,4 @@ int do_info(User * u) return MOD_CONT; /* if (name && (ci || na->nc != u->na->nc)) */ } -MODULE_INIT("ms_info") +MODULE_INIT(MSInfo) diff --git a/src/core/ms_list.c b/src/core/ms_list.c index 815fc80c5..88cabb6a2 100644 --- a/src/core/ms_list.c +++ b/src/core/ms_list.c @@ -19,34 +19,22 @@ int list_memo_callback(User * u, int num, va_list args); int list_memo(User * u, int index, MemoInfo * mi, int *sent_header, int newi, const char *chan); void myMemoServHelp(User * u); -/** - * Create the command, and tell anope about it. - * @param argc Argument count - * @param argv Argument list - * @return MOD_CONT to allow the module, MOD_STOP to stop it - **/ -int AnopeInit(int argc, char **argv) +class MSList : public Module { - Command *c; - - moduleAddAuthor("Anope"); - moduleAddVersion("$Id$"); - moduleSetType(CORE); - c = createCommand("LIST", do_list, NULL, MEMO_HELP_LIST, -1, -1, -1, - -1); - moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); - moduleSetMemoHelp(myMemoServHelp); - - return MOD_CONT; -} + public: + MSList(const std::string &creator) : Module(creator) + { + Command *c; -/** - * Unload the module - **/ -void AnopeFini(void) -{ + moduleAddAuthor("Anope"); + moduleAddVersion("$Id$"); + moduleSetType(CORE); + c = createCommand("LIST", do_list, NULL, MEMO_HELP_LIST, -1, -1, -1, -1); + moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); + moduleSetMemoHelp(myMemoServHelp); + } +}; -} @@ -194,4 +182,4 @@ int list_memo(User * u, int index, MemoInfo * mi, int *sent_header, int newi, co return 1; } -MODULE_INIT("ms_list") +MODULE_INIT(MSList) diff --git a/src/core/ms_read.c b/src/core/ms_read.c index 7b107b69e..10e456e69 100644 --- a/src/core/ms_read.c +++ b/src/core/ms_read.c @@ -22,34 +22,21 @@ void myMemoServHelp(User * u); extern void rsend_notify(User * u, Memo * m, const char *chan); -/** - * Create the command, and tell anope about it. - * @param argc Argument count - * @param argv Argument list - * @return MOD_CONT to allow the module, MOD_STOP to stop it - **/ -int AnopeInit(int argc, char **argv) +class MSRead : public Module { - Command *c; - - moduleAddAuthor("Anope"); - moduleAddVersion("$Id$"); - moduleSetType(CORE); - c = createCommand("READ", do_read, NULL, MEMO_HELP_READ, -1, -1, -1, - -1); - moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); - moduleSetMemoHelp(myMemoServHelp); - - return MOD_CONT; -} + public: + MSRead(const std::string &creator) : Module(creator) + { + Command *c; -/** - * Unload the module - **/ -void AnopeFini(void) -{ - -} + moduleAddAuthor("Anope"); + moduleAddVersion("$Id$"); + moduleSetType(CORE); + c = createCommand("READ", do_read, NULL, MEMO_HELP_READ, -1, -1, -1, -1); + moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); + moduleSetMemoHelp(myMemoServHelp); + } +}; @@ -202,4 +189,4 @@ int read_memo(User * u, int index, MemoInfo * mi, const char *chan) return 1; } -MODULE_INIT("ms_read") +MODULE_INIT(MSRead) diff --git a/src/core/ms_rsend.c b/src/core/ms_rsend.c index 7cb0be1ad..f4b5e1068 100644 --- a/src/core/ms_rsend.c +++ b/src/core/ms_rsend.c @@ -18,31 +18,24 @@ int do_rsend(User * u); void myMemoServHelp(User * u); -/** - * Create the command, and tell anope about it. - * @param argc Argument count - * @param argv Argument list - * @return MOD_CONT to allow the module, MOD_STOP to stop it - **/ -int AnopeInit(int argc, char **argv) +class MSRSend : public Module { - Command *c; - - moduleAddAuthor("Anope"); - moduleAddVersion - ("$Id$"); - moduleSetType(CORE); - c = createCommand("RSEND", do_rsend, NULL, MEMO_HELP_RSEND, -1, -1, -1, - -1); - moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); - moduleSetMemoHelp(myMemoServHelp); - - if (!MSMemoReceipt) { - return MOD_STOP; - } - - return MOD_CONT; -} + public: + MSRSend(const std::string &creator) : Module(creator) + { + Command *c; + + moduleAddAuthor("Anope"); + moduleAddVersion("$Id$"); + moduleSetType(CORE); + c = createCommand("RSEND", do_rsend, NULL, MEMO_HELP_RSEND, -1, -1, -1, -1); + moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); + moduleSetMemoHelp(myMemoServHelp); + + if (!MSMemoReceipt) + throw ModuleException("Don't like memo reciepts, or something."); + } +}; /** * Unload the module @@ -119,4 +112,4 @@ int do_rsend(User * u) return MOD_CONT; } -MODULE_INIT("ms_rsend") +MODULE_INIT(MSRSend) diff --git a/src/core/ms_send.c b/src/core/ms_send.c index 64faec005..306b30ae7 100644 --- a/src/core/ms_send.c +++ b/src/core/ms_send.c @@ -18,35 +18,21 @@ int do_send(User * u); void myMemoServHelp(User * u); -/** - * Create the command, and tell anope about it. - * @param argc Argument count - * @param argv Argument list - * @return MOD_CONT to allow the module, MOD_STOP to stop it - **/ -int AnopeInit(int argc, char **argv) +class MSSend : public Module { - Command *c; - - moduleAddAuthor("Anope"); - moduleAddVersion - ("$Id$"); - moduleSetType(CORE); - c = createCommand("SEND", do_send, NULL, MEMO_HELP_SEND, -1, -1, -1, - -1); - moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); - moduleSetMemoHelp(myMemoServHelp); - - return MOD_CONT; -} + public: + MSSend(const std::string &creator) : Module(creator) + { + Command *c; -/** - * Unload the module - **/ -void AnopeFini(void) -{ - -} + moduleAddAuthor("Anope"); + moduleAddVersion("$Id$"); + moduleSetType(CORE); + c = createCommand("SEND", do_send, NULL, MEMO_HELP_SEND, -1, -1, -1, -1); + moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); + moduleSetMemoHelp(myMemoServHelp); + } +}; @@ -73,4 +59,4 @@ int do_send(User * u) return MOD_CONT; } -MODULE_INIT("ms_send") +MODULE_INIT(MSSend) diff --git a/src/core/ms_sendall.c b/src/core/ms_sendall.c index f2e0382a9..9d87a4879 100644 --- a/src/core/ms_sendall.c +++ b/src/core/ms_sendall.c @@ -18,35 +18,21 @@ int do_sendall(User * u); void myMemoServHelp(User * u); -/** - * Create the command, and tell anope about it. - * @param argc Argument count - * @param argv Argument list - * @return MOD_CONT to allow the module, MOD_STOP to stop it - **/ -int AnopeInit(int argc, char **argv) +class MSSendAll : public Module { - Command *c; - - moduleAddAuthor("Anope"); - moduleAddVersion - ("$Id$"); - moduleSetType(CORE); - c = createCommand("SENDALL", do_sendall, is_services_admin, -1, -1, -1, - MEMO_HELP_SENDALL, MEMO_HELP_SENDALL); - moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); - moduleSetMemoHelp(myMemoServHelp); - - return MOD_CONT; -} + public: + MSSendAll(const std::string &creator) : Module(creator) + { + Command *c; -/** - * Unload the module - **/ -void AnopeFini(void) -{ - -} + moduleAddAuthor("Anope"); + moduleAddVersion("$Id$"); + moduleSetType(CORE); + c = createCommand("SENDALL", do_sendall, is_services_admin, -1, -1, -1, MEMO_HELP_SENDALL, MEMO_HELP_SENDALL); + moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); + moduleSetMemoHelp(myMemoServHelp); + } +}; @@ -95,4 +81,4 @@ int do_sendall(User * u) return MOD_CONT; } -MODULE_INIT("ms_sendall") +MODULE_INIT(MSSendAll) diff --git a/src/core/ms_set.c b/src/core/ms_set.c index 4f5b16fb8..de5744406 100644 --- a/src/core/ms_set.c +++ b/src/core/ms_set.c @@ -20,46 +20,30 @@ int do_set_notify(User * u, MemoInfo * mi, char *param); int do_set_limit(User * u, MemoInfo * mi, char *param); void myMemoServHelp(User * u); -/** - * Create the command, and tell anope about it. - * @param argc Argument count - * @param argv Argument list - * @return MOD_CONT to allow the module, MOD_STOP to stop it - **/ -int AnopeInit(int argc, char **argv) +class MSSet : public Module { - Command *c; - - moduleAddAuthor("Anope"); - moduleAddVersion("$Id$"); - moduleSetType(CORE); + public: + MSSet(const std::string &creator) : Module(creator) + { + Command *c; - c = createCommand("SET", do_set, NULL, MEMO_HELP_SET, -1, -1, -1, -1); - moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); + moduleAddAuthor("Anope"); + moduleAddVersion("$Id$"); + moduleSetType(CORE); - c = createCommand("SET NOTIFY", NULL, NULL, MEMO_HELP_SET_NOTIFY, -1, - -1, -1, -1); - moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); + c = createCommand("SET", do_set, NULL, MEMO_HELP_SET, -1, -1, -1, -1); + moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); - c = createCommand("SET LIMIT", NULL, NULL, -1, MEMO_HELP_SET_LIMIT, - MEMO_SERVADMIN_HELP_SET_LIMIT, - MEMO_SERVADMIN_HELP_SET_LIMIT, - MEMO_SERVADMIN_HELP_SET_LIMIT); - c->help_param1 = (char *) (long) MSMaxMemos; - moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); + c = createCommand("SET NOTIFY", NULL, NULL, MEMO_HELP_SET_NOTIFY, -1, -1, -1, -1); + moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); - moduleSetMemoHelp(myMemoServHelp); - - return MOD_CONT; -} + c = createCommand("SET LIMIT", NULL, NULL, -1, MEMO_HELP_SET_LIMIT, MEMO_SERVADMIN_HELP_SET_LIMIT, MEMO_SERVADMIN_HELP_SET_LIMIT, MEMO_SERVADMIN_HELP_SET_LIMIT); + c->help_param1 = (char *) (long) MSMaxMemos; + moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); -/** - * Unload the module - **/ -void AnopeFini(void) -{ - -} + moduleSetMemoHelp(myMemoServHelp); + } +}; @@ -265,4 +249,4 @@ int do_set_limit(User * u, MemoInfo * mi, char *param) return MOD_CONT; } -MODULE_INIT("ms_set") +MODULE_INIT(MSSet) diff --git a/src/core/ms_staff.c b/src/core/ms_staff.c index 4d5b849f9..434755276 100644 --- a/src/core/ms_staff.c +++ b/src/core/ms_staff.c @@ -18,35 +18,21 @@ int do_staff(User * u); void myMemoServHelp(User * u); -/** - * Create the command, and tell anope about it. - * @param argc Argument count - * @param argv Argument list - * @return MOD_CONT to allow the module, MOD_STOP to stop it - **/ -int AnopeInit(int argc, char **argv) +class MSStaff : public Module { - Command *c; - - moduleAddAuthor("Anope"); - moduleAddVersion - ("$Id$"); - moduleSetType(CORE); - c = createCommand("STAFF", do_staff, is_services_oper, -1, -1, - MEMO_HELP_STAFF, MEMO_HELP_STAFF, MEMO_HELP_STAFF); - moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); - moduleSetMemoHelp(myMemoServHelp); - - return MOD_CONT; -} + public: + MSStaff(const std::string &creator) : Module(creator) + { + Command *c; -/** - * Unload the module - **/ -void AnopeFini(void) -{ - -} + moduleAddAuthor("Anope"); + moduleAddVersion("$Id$"); + moduleSetType(CORE); + c = createCommand("STAFF", do_staff, is_services_oper, -1, -1, MEMO_HELP_STAFF, MEMO_HELP_STAFF, MEMO_HELP_STAFF); + moduleAddCommand(MEMOSERV, c, MOD_UNIQUE); + moduleSetMemoHelp(myMemoServHelp); + } +}; @@ -92,4 +78,4 @@ int do_staff(User * u) return MOD_CONT; } -MODULE_INIT("ms_staff") +MODULE_INIT(MSStaff) |