diff options
| author | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-05 00:17:27 +0000 |
|---|---|---|
| committer | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-05 00:17:27 +0000 |
| commit | 3bc401a13010084c8a8221ceb1c0c15463452ec6 (patch) | |
| tree | e97a548887fc05b3aab69d2435a82197114639aa /src/core | |
| parent | e47d169f4961dbcc36014e11a6ead2be0baf62f6 (diff) | |
Convert OperServ. YES, src/core done.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1557 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/core')
38 files changed, 620 insertions, 1110 deletions
diff --git a/src/core/os_admin.c b/src/core/os_admin.c index 6b7a9008b..ca00b3622 100644 --- a/src/core/os_admin.c +++ b/src/core/os_admin.c @@ -21,37 +21,25 @@ int admin_list_callback(SList * slist, int number, void *item, int admin_list(int number, NickCore * nc, User * u, int *sent_header); void myOperServHelp(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 OSAdmin : public Module { - Command *c; - - moduleAddAuthor("Anope"); - moduleAddVersion("$Id$"); - moduleSetType(CORE); + public: + OSAdmin(const std::string &creator) : Module(creator) + { + Command *c; - c = createCommand("ADMIN", do_admin, NULL, OPER_HELP_ADMIN, -1, -1, - -1, -1); - c->help_param1 = s_NickServ; - moduleAddCommand(OPERSERV, c, MOD_UNIQUE); + moduleAddAuthor("Anope"); + moduleAddVersion("$Id$"); + moduleSetType(CORE); - moduleSetOperHelp(myOperServHelp); - - return MOD_CONT; -} + c = createCommand("ADMIN", do_admin, NULL, OPER_HELP_ADMIN, -1, -1, -1, -1); + c->help_param1 = s_NickServ; + moduleAddCommand(OPERSERV, c, MOD_UNIQUE); -/** - * Unload the module - **/ -void AnopeFini(void) -{ + moduleSetOperHelp(myOperServHelp); + } +}; -} @@ -243,4 +231,4 @@ int admin_list(int number, NickCore * nc, User * u, int *sent_header) return 1; } -MODULE_INIT("os_admin") +MODULE_INIT(OSAdmin) diff --git a/src/core/os_akill.c b/src/core/os_akill.c index 5c142f71e..599ba1cf6 100644 --- a/src/core/os_akill.c +++ b/src/core/os_akill.c @@ -24,36 +24,22 @@ int akill_list_callback(SList * slist, int number, void *item, int akill_list(int number, Akill * ak, User * u, int *sent_header); void myOperServHelp(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 OSAKill : public Module { - Command *c; - - moduleAddAuthor("Anope"); - moduleAddVersion - ("$Id$"); - moduleSetType(CORE); - c = createCommand("AKILL", do_akill, is_services_oper, OPER_HELP_AKILL, - -1, -1, -1, -1); - moduleAddCommand(OPERSERV, c, MOD_UNIQUE); - - moduleSetOperHelp(myOperServHelp); - - return MOD_CONT; -} + public: + OSAKill(const std::string &creator) : Module(creator) + { + Command *c; -/** - * Unload the module - **/ -void AnopeFini(void) -{ + moduleAddAuthor("Anope"); + moduleAddVersion("$Id$"); + moduleSetType(CORE); + c = createCommand("AKILL", do_akill, is_services_oper, OPER_HELP_AKILL, -1, -1, -1, -1); + moduleAddCommand(OPERSERV, c, MOD_UNIQUE); -} + moduleSetOperHelp(myOperServHelp); + } +}; @@ -388,4 +374,4 @@ int akill_list(int number, Akill * ak, User * u, int *sent_header) return 1; } -MODULE_INIT("os_akill") +MODULE_INIT(OSAKill) diff --git a/src/core/os_chankill.c b/src/core/os_chankill.c index 16ea99071..e3fe7e1bd 100644 --- a/src/core/os_chankill.c +++ b/src/core/os_chankill.c @@ -18,37 +18,23 @@ int do_chankill(User * u); void myOperServHelp(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 OSChanKill : public Module { - Command *c; - - moduleAddAuthor("Anope"); - moduleAddVersion - ("$Id$"); - moduleSetType(CORE); + public: + OSChanKill(const std::string &creator) : Module(creator) + { + Command *c; - c = createCommand("CHANKILL", do_chankill, is_services_admin, - OPER_HELP_CHANKILL, -1, -1, -1, -1); - moduleAddCommand(OPERSERV, c, MOD_UNIQUE); + moduleAddAuthor("Anope"); + moduleAddVersion("$Id$"); + moduleSetType(CORE); - moduleSetOperHelp(myOperServHelp); - - return MOD_CONT; -} + c = createCommand("CHANKILL", do_chankill, is_services_admin, OPER_HELP_CHANKILL, -1, -1, -1, -1); + moduleAddCommand(OPERSERV, c, MOD_UNIQUE); -/** - * Unload the module - **/ -void AnopeFini(void) -{ - -} + moduleSetOperHelp(myOperServHelp); + } +}; @@ -133,4 +119,4 @@ int do_chankill(User * u) return MOD_CONT; } -MODULE_INIT("os_chankill") +MODULE_INIT(OSChanKill) diff --git a/src/core/os_chanlist.c b/src/core/os_chanlist.c index 56a12d53f..e7652785c 100644 --- a/src/core/os_chanlist.c +++ b/src/core/os_chanlist.c @@ -21,37 +21,24 @@ void myOperServHelp(User * u); extern MDE int anope_get_private_mode(); #endif -/** - * 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 OSChanList : public Module { - Command *c; - - moduleAddAuthor("Anope"); - moduleAddVersion("$Id$"); - moduleSetType(CORE); + public: + OSChanList(const std::string &creator) : Module(creator) + { + Command *c; - c = createCommand("CHANLIST", do_chanlist, is_services_oper, - OPER_HELP_CHANLIST, -1, -1, -1, -1); - moduleAddCommand(OPERSERV, c, MOD_UNIQUE); + moduleAddAuthor("Anope"); + moduleAddVersion("$Id$"); + moduleSetType(CORE); - moduleSetOperHelp(myOperServHelp); - - return MOD_CONT; -} + c = createCommand("CHANLIST", do_chanlist, is_services_oper, OPER_HELP_CHANLIST, -1, -1, -1, -1); + moduleAddCommand(OPERSERV, c, MOD_UNIQUE); + moduleSetOperHelp(myOperServHelp); + } +}; -/** - * Unload the module - **/ -void AnopeFini(void) -{ - -} /** @@ -115,4 +102,4 @@ int do_chanlist(User * u) return MOD_CONT; } -MODULE_INIT("os_chanlist") +MODULE_INIT(OSChanList) diff --git a/src/core/os_clearmodes.c b/src/core/os_clearmodes.c index 6f1fc79f0..0b5f0ff03 100644 --- a/src/core/os_clearmodes.c +++ b/src/core/os_clearmodes.c @@ -18,37 +18,24 @@ int do_clearmodes(User * u); void myOperServHelp(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 OSClearModes : public Module { - Command *c; - - moduleAddAuthor("Anope"); - moduleAddVersion - ("$Id$"); - moduleSetType(CORE); + public: + OSClearModes(const std::string &creator) : Module(creator) + { + Command *c; - c = createCommand("CLEARMODES", do_clearmodes, is_services_oper, - OPER_HELP_CLEARMODES, -1, -1, -1, -1); - moduleAddCommand(OPERSERV, c, MOD_UNIQUE); + moduleAddAuthor("Anope"); + moduleAddVersion + ("$Id$"); + moduleSetType(CORE); - moduleSetOperHelp(myOperServHelp); - - return MOD_CONT; -} + c = createCommand("CLEARMODES", do_clearmodes, is_services_oper, OPER_HELP_CLEARMODES, -1, -1, -1, -1); + moduleAddCommand(OPERSERV, c, MOD_UNIQUE); -/** - * Unload the module - **/ -void AnopeFini(void) -{ - -} + moduleSetOperHelp(myOperServHelp); + } +}; /** @@ -307,4 +294,4 @@ int do_clearmodes(User * u) return MOD_CONT; } -MODULE_INIT("os_clearmodes") +MODULE_INIT(OSClearModes) diff --git a/src/core/os_defcon.c b/src/core/os_defcon.c index 4b6079d20..612b200a4 100644 --- a/src/core/os_defcon.c +++ b/src/core/os_defcon.c @@ -24,36 +24,23 @@ void defcon_sendlvls(User * u); void myOperServHelp(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 OSDEFCON : public Module { - Command *c; - - moduleAddAuthor("Anope"); - moduleAddVersion("$Id$"); - moduleSetType(CORE); + public: + OSDEFCON(const std::string &creator) : Module(creator) + { + Command *c; - c = createCommand("DEFCON", do_defcon, is_services_admin, - OPER_HELP_DEFCON, -1, -1, -1, -1); - moduleAddCommand(OPERSERV, c, MOD_UNIQUE); + moduleAddAuthor("Anope"); + moduleAddVersion("$Id$"); + moduleSetType(CORE); - moduleSetOperHelp(myOperServHelp); - - return MOD_CONT; -} + c = createCommand("DEFCON", do_defcon, is_services_admin, OPER_HELP_DEFCON, -1, -1, -1, -1); + moduleAddCommand(OPERSERV, c, MOD_UNIQUE); -/** - * Unload the module - **/ -void AnopeFini(void) -{ - -} + moduleSetOperHelp(myOperServHelp); + } +}; /** @@ -168,4 +155,4 @@ void defcon_sendlvls(User * u) } } -MODULE_INIT("os_defcon") +MODULE_INIT(OSDEFCON) diff --git a/src/core/os_global.c b/src/core/os_global.c index 4258b8df1..4c0b37536 100644 --- a/src/core/os_global.c +++ b/src/core/os_global.c @@ -18,36 +18,24 @@ int do_global(User * u); void myOperServHelp(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 OSGlobal : public Module { - Command *c; - - moduleAddAuthor("Anope"); - moduleAddVersion("$Id$"); - moduleSetType(CORE); + public: + OSGlobal(const std::string &creator) : Module(creator) + { + Command *c; - c = createCommand("GLOBAL", do_global, is_services_admin, - OPER_HELP_GLOBAL, -1, -1, -1, -1); - c->help_param1 = s_GlobalNoticer; - moduleAddCommand(OPERSERV, c, MOD_UNIQUE); - moduleSetOperHelp(myOperServHelp); - - return MOD_CONT; -} + moduleAddAuthor("Anope"); + moduleAddVersion("$Id$"); + moduleSetType(CORE); -/** - * Unload the module - **/ -void AnopeFini(void) -{ + c = createCommand("GLOBAL", do_global, is_services_admin, OPER_HELP_GLOBAL, -1, -1, -1, -1); + c->help_param1 = s_GlobalNoticer; + moduleAddCommand(OPERSERV, c, MOD_UNIQUE); + moduleSetOperHelp(myOperServHelp); + } +}; -} /** @@ -81,4 +69,4 @@ int do_global(User * u) return MOD_CONT; } -MODULE_INIT("os_global") +MODULE_INIT(OSGlobal) diff --git a/src/core/os_help.c b/src/core/os_help.c index 5842f888f..6f2193197 100644 --- a/src/core/os_help.c +++ b/src/core/os_help.c @@ -17,32 +17,20 @@ int do_help(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 OSHelp : public Module { - Command *c; - - moduleAddAuthor("Anope"); - moduleAddVersion("$Id$"); - moduleSetType(CORE); - c = createCommand("HELP", do_help, NULL, -1, -1, -1, -1, -1); - moduleAddCommand(OPERSERV, c, MOD_UNIQUE); - - return MOD_CONT; -} + public: + OSHelp(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(OPERSERV, c, MOD_UNIQUE); + } +}; @@ -65,4 +53,4 @@ int do_help(User * u) return MOD_CONT; } -MODULE_INIT("os_help") +MODULE_INIT(OSHelp) diff --git a/src/core/os_ignore.c b/src/core/os_ignore.c index b6d47764a..39d461d6e 100644 --- a/src/core/os_ignore.c +++ b/src/core/os_ignore.c @@ -19,35 +19,22 @@ int do_ignorelist(User * u); void myOperServHelp(User * u); int do_ignoreuser(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 OSIgnore : public Module { - Command *c; - - moduleAddAuthor("Anope"); - moduleAddVersion("$Id$"); - moduleSetType(CORE); - c = createCommand("IGNORE", do_ignoreuser, is_services_admin, - OPER_HELP_IGNORE, -1, -1, -1, -1); - moduleAddCommand(OPERSERV, c, MOD_UNIQUE); - - moduleSetOperHelp(myOperServHelp); - - return MOD_CONT; -} + public: + OSIgnore(const std::string &creator) : Module(creator) + { + Command *c; -/** - * Unload the module - **/ -void AnopeFini(void) -{ + moduleAddAuthor("Anope"); + moduleAddVersion("$Id$"); + moduleSetType(CORE); + c = createCommand("IGNORE", do_ignoreuser, is_services_admin, OPER_HELP_IGNORE, -1, -1, -1, -1); + moduleAddCommand(OPERSERV, c, MOD_UNIQUE); -} + moduleSetOperHelp(myOperServHelp); + } +}; /** @@ -143,6 +130,4 @@ int do_ignorelist(User * u) return MOD_CONT; } -/* EOF */ - -MODULE_INIT("os_ignore") +MODULE_INIT(OSIgnore) diff --git a/src/core/os_jupe.c b/src/core/os_jupe.c index ea5d0a98a..4bb666945 100644 --- a/src/core/os_jupe.c +++ b/src/core/os_jupe.c @@ -18,36 +18,23 @@ int do_jupe(User * u); void myOperServHelp(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 OSJupe : public Module { - Command *c; - - moduleAddAuthor("Anope"); - moduleAddVersion("$Id$"); - moduleSetType(CORE); + public: + OSJupe(const std::string &creator) : Module(creator) + { + Command *c; - c = createCommand("JUPE", do_jupe, is_services_admin, OPER_HELP_JUPE, - -1, -1, -1, -1); - moduleAddCommand(OPERSERV, c, MOD_UNIQUE); + moduleAddAuthor("Anope"); + moduleAddVersion("$Id$"); + moduleSetType(CORE); - moduleSetOperHelp(myOperServHelp); - - return MOD_CONT; -} + c = createCommand("JUPE", do_jupe, is_services_admin, OPER_HELP_JUPE, -1, -1, -1, -1); + moduleAddCommand(OPERSERV, c, MOD_UNIQUE); -/** - * Unload the module - **/ -void AnopeFini(void) -{ - -} + moduleSetOperHelp(myOperServHelp); + } +}; /** @@ -91,4 +78,4 @@ int do_jupe(User * u) return MOD_CONT; } -MODULE_INIT("os_jupe") +MODULE_INIT(OSJupe) diff --git a/src/core/os_kick.c b/src/core/os_kick.c index 69a731767..819b568b6 100644 --- a/src/core/os_kick.c +++ b/src/core/os_kick.c @@ -18,36 +18,23 @@ int do_os_kick(User * u); void myOperServHelp(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 OSKick : public Module { - Command *c; - - moduleAddAuthor("Anope"); - moduleAddVersion("$Id$"); - moduleSetType(CORE); + public: + OSKick(const std::string &creator) : Module(creator) + { + Command *c; - c = createCommand("KICK", do_os_kick, is_services_oper, OPER_HELP_KICK, - -1, -1, -1, -1); - moduleAddCommand(OPERSERV, c, MOD_UNIQUE); + moduleAddAuthor("Anope"); + moduleAddVersion("$Id$"); + moduleSetType(CORE); - moduleSetOperHelp(myOperServHelp); - - return MOD_CONT; -} + c = createCommand("KICK", do_os_kick, is_services_oper, OPER_HELP_KICK, -1, -1, -1, -1); + moduleAddCommand(OPERSERV, c, MOD_UNIQUE); -/** - * Unload the module - **/ -void AnopeFini(void) -{ - -} + moduleSetOperHelp(myOperServHelp); + } +}; /** @@ -99,4 +86,4 @@ int do_os_kick(User * u) return MOD_CONT; } -MODULE_INIT("os_kick") +MODULE_INIT(OSKick) diff --git a/src/core/os_logonnews.c b/src/core/os_logonnews.c index abcd1075d..087df972f 100644 --- a/src/core/os_logonnews.c +++ b/src/core/os_logonnews.c @@ -21,49 +21,43 @@ void myOperServHelp(User * u); int load_config(void); int reload_config(int argc, char **argv); -/** - * 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 OSLogonNews : public Module { - EvtHook *hook; - char buf[BUFSIZE]; - - moduleAddAuthor("Anope"); - moduleAddVersion("$Id$"); - moduleSetType(CORE); - - /** - * For some unknown reason, do_logonnews is actaully defined in news.c - * we can look at moving it here later - **/ - c = createCommand("LOGONNEWS", do_logonnews, is_services_admin, - NEWS_HELP_LOGON, -1, -1, -1, -1); - snprintf(buf, BUFSIZE, "%d", NewsCount), - c->help_param1 = sstrdup(buf); - moduleAddCommand(OPERSERV, c, MOD_UNIQUE); - - moduleSetOperHelp(myOperServHelp); - - hook = createEventHook(EVENT_RELOAD, reload_config); - if (moduleAddEventHook(hook) != MOD_ERR_OK) { - alog("[\002os_logonnews\002] Can't hook to EVENT_RELOAD event"); - return MOD_STOP; - } - - return MOD_CONT; -} + public: + OSLogonNews(const std::string &creator) : Module(creator) + { + EvtHook *hook; + char buf[BUFSIZE]; + + moduleAddAuthor("Anope"); + moduleAddVersion("$Id$"); + moduleSetType(CORE); + + /** + * For some unknown reason, do_logonnews is actaully defined in news.c + * we can look at moving it here later + **/ + c = createCommand("LOGONNEWS", do_logonnews, is_services_admin, + NEWS_HELP_LOGON, -1, -1, -1, -1); + snprintf(buf, BUFSIZE, "%d", NewsCount), + c->help_param1 = sstrdup(buf); + moduleAddCommand(OPERSERV, c, MOD_UNIQUE); + + moduleSetOperHelp(myOperServHelp); + + hook = createEventHook(EVENT_RELOAD, reload_config); + if (moduleAddEventHook(hook) != MOD_ERR_OK) + { + throw ModuleException("os_logonnews: Can't hook to EVENT_RELOAD event"); + } + } + + ~OSLogonNews() + { + free(c->help_param1); + } +}; -/** - * Unload the module - **/ -void AnopeFini(void) -{ - free(c->help_param1); -} /** @@ -97,4 +91,4 @@ int reload_config(int argc, char **argv) { /* EOF */ -MODULE_INIT("os_logonnews") +MODULE_INIT(OSLogonNews) diff --git a/src/core/os_mode.c b/src/core/os_mode.c index c002f40ea..6a7a0b8dc 100644 --- a/src/core/os_mode.c +++ b/src/core/os_mode.c @@ -18,36 +18,24 @@ int do_os_mode(User * u); void myOperServHelp(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 OSMode : public Module { - Command *c; - - moduleAddAuthor("Anope"); - moduleAddVersion("$Id$"); - moduleSetType(CORE); + public: + OSMode(const std::string &creator) : Module(creator) + { + Command *c; - c = createCommand("MODE", do_os_mode, is_services_oper, OPER_HELP_MODE, - -1, -1, -1, -1); - moduleAddCommand(OPERSERV, c, MOD_UNIQUE); + moduleAddAuthor("Anope"); + moduleAddVersion("$Id$"); + moduleSetType(CORE); - moduleSetOperHelp(myOperServHelp); - - return MOD_CONT; -} + c = createCommand("MODE", do_os_mode, is_services_oper, OPER_HELP_MODE, -1, -1, -1, -1); + moduleAddCommand(OPERSERV, c, MOD_UNIQUE); -/** - * Unload the module - **/ -void AnopeFini(void) -{ + moduleSetOperHelp(myOperServHelp); + } +}; -} /** @@ -101,4 +89,4 @@ int do_os_mode(User * u) return MOD_CONT; } -MODULE_INIT("os_mode") +MODULE_INIT(OSMode) diff --git a/src/core/os_modinfo.c b/src/core/os_modinfo.c index f3c73d8fb..6c073fa08 100644 --- a/src/core/os_modinfo.c +++ b/src/core/os_modinfo.c @@ -20,35 +20,22 @@ void myOperServHelp(User * u); int showModuleMsgLoaded(MessageHash * msgList, char *mod_name, User * u); int showModuleCmdLoaded(CommandHash * cmdList, char *mod_name, 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 OSModInfo : public Module { - Command *c; - - moduleAddAuthor("Anope"); - moduleAddVersion("$Id$"); - moduleSetType(CORE); - c = createCommand("MODINFO", do_modinfo, NULL, -1, -1, -1, -1, - OPER_HELP_MODINFO); - moduleAddCommand(OPERSERV, c, MOD_UNIQUE); - - moduleSetOperHelp(myOperServHelp); - - return MOD_CONT; -} + public: + OSModInfo(const std::string &creator) : Module(creator) + { + Command *c; -/** - * Unload the module - **/ -void AnopeFini(void) -{ + moduleAddAuthor("Anope"); + moduleAddVersion("$Id$"); + moduleSetType(CORE); + c = createCommand("MODINFO", do_modinfo, NULL, -1, -1, -1, -1, OPER_HELP_MODINFO); + moduleAddCommand(OPERSERV, c, MOD_UNIQUE); -} + moduleSetOperHelp(myOperServHelp); + } +}; /** @@ -138,4 +125,4 @@ int showModuleMsgLoaded(MessageHash * msgList, char *mod_name, User * u) return display; } -MODULE_INIT("os_modinfo") +MODULE_INIT(OSModInfo) diff --git a/src/core/os_modlist.c b/src/core/os_modlist.c index 91f9f39e1..dbc52d750 100644 --- a/src/core/os_modlist.c +++ b/src/core/os_modlist.c @@ -18,36 +18,23 @@ int do_modlist(User * u); void myOperServHelp(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 OSModList : public Module { - Command *c; |
