diff --git a/extensions/chm_adminonly.c b/extensions/chm_adminonly.c index 81e70a6e..eba49cdc 100644 --- a/extensions/chm_adminonly.c +++ b/extensions/chm_adminonly.c @@ -10,10 +10,11 @@ #include "numeric.h" #include "chmode.h" -static void h_can_join(hook_data_channel *); static const char chm_adminonly_desc[] = "Enables channel mode +A that blocks non-admins from joining a channel"; +static void h_can_join(hook_data_channel *); + mapi_hfn_list_av1 adminonly_hfnlist[] = { { "can_join", (hookfn) h_can_join }, { NULL, NULL } diff --git a/extensions/chm_insecure.c b/extensions/chm_insecure.c index b7ccd2f1..14037e82 100644 --- a/extensions/chm_insecure.c +++ b/extensions/chm_insecure.c @@ -10,11 +10,12 @@ #include "numeric.h" #include "chmode.h" -static void h_can_join(hook_data_channel *); static const char chm_insecure_desc[] = "Adds channel mode +U that allows non-SSL users to join a channel, " "disallowing them by default"; +static void h_can_join(hook_data_channel *); + mapi_hfn_list_av1 sslonly_hfnlist[] = { { "can_join", (hookfn) h_can_join }, { NULL, NULL } diff --git a/extensions/chm_nonotice.c b/extensions/chm_nonotice.c index 1948d74d..c2dcb6b2 100644 --- a/extensions/chm_nonotice.c +++ b/extensions/chm_nonotice.c @@ -35,11 +35,12 @@ #include "messages.h" #include "inline/stringops.h" +static const char chm_nonotice_desc[] = + "Adds channel mode +T which blocks notices to the channel."; + static unsigned int mode_nonotice; static void chm_nonotice_process(hook_data_privmsg_channel *); -static const char chm_nonotice_desc[] = - "Adds channel mode +T which blocks notices to the channel."; mapi_hfn_list_av1 chm_nonotice_hfnlist[] = { { "privmsg_channel", (hookfn) chm_nonotice_process }, diff --git a/extensions/chm_operonly.c b/extensions/chm_operonly.c index 458190dc..ba4df9dd 100644 --- a/extensions/chm_operonly.c +++ b/extensions/chm_operonly.c @@ -10,10 +10,11 @@ #include "numeric.h" #include "chmode.h" -static void h_can_join(hook_data_channel *); static const char chm_operonly_desc[] = "Adds channel mode +O which makes a channel operator-only"; +static void h_can_join(hook_data_channel *); + mapi_hfn_list_av1 operonly_hfnlist[] = { { "can_join", (hookfn) h_can_join }, { NULL, NULL } diff --git a/extensions/chm_operonly_compat.c b/extensions/chm_operonly_compat.c index 86472a1c..ef8f0b3e 100644 --- a/extensions/chm_operonly_compat.c +++ b/extensions/chm_operonly_compat.c @@ -9,13 +9,14 @@ #include "ircd.h" #include "chmode.h" +static const char chm_operonly_compat[] = + "Adds an emulated channel mode +O which is converted into mode +i and +I $o"; + static int _modinit(void); static void _moddeinit(void); static void chm_operonly(struct Client *source_p, struct Channel *chptr, int alevel, int parc, int *parn, const char **parv, int *errors, int dir, char c, long mode_type); -static const char chm_operonly_compat[] = - "Adds an emulated channel mode +O which is converted into mode +i and +I $o"; DECLARE_MODULE_AV2(chm_operonly_compat, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, chm_operonly_compat); diff --git a/extensions/chm_operpeace.c b/extensions/chm_operpeace.c index 70a20744..0d853b2b 100644 --- a/extensions/chm_operpeace.c +++ b/extensions/chm_operpeace.c @@ -18,10 +18,11 @@ #include "s_newconf.h" #include "chmode.h" -static void hdl_can_kick(hook_data_channel_approval *); static const char chm_operpeace_desc[] = "Adds channel mode +M which prohibits operators from being kicked"; +static void hdl_can_kick(hook_data_channel_approval *); + mapi_hfn_list_av1 chm_operpeace_hfnlist[] = { { "can_kick", (hookfn) hdl_can_kick }, { NULL, NULL } diff --git a/extensions/chm_quietunreg_compat.c b/extensions/chm_quietunreg_compat.c index 607a4d74..6afe8e25 100644 --- a/extensions/chm_quietunreg_compat.c +++ b/extensions/chm_quietunreg_compat.c @@ -10,13 +10,14 @@ #include "ircd.h" #include "chmode.h" +static const char chm_quietunreg_compat_desc[] = + "Adds an emulated channel mode +R which is converted into mode +q $~a"; + static int _modinit(void); static void _moddeinit(void); static void chm_quietunreg(struct Client *source_p, struct Channel *chptr, int alevel, int parc, int *parn, const char **parv, int *errors, int dir, char c, long mode_type); -static const char chm_quietunreg_compat_desc[] = - "Adds an emulated channel mode +R which is converted into mode +q $~a"; DECLARE_MODULE_AV2(chm_quietunreg_compat, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, chm_quietunreg_compat_desc); diff --git a/extensions/chm_sslonly.c b/extensions/chm_sslonly.c index 13051bea..2cbc7a47 100644 --- a/extensions/chm_sslonly.c +++ b/extensions/chm_sslonly.c @@ -10,6 +10,9 @@ #include "numeric.h" #include "chmode.h" +static const char chm_sslonly_desc[] = + "Adds channel mode +S that bans non-SSL users from joing a channel"; + static void h_can_join(hook_data_channel *); mapi_hfn_list_av1 sslonly_hfnlist[] = { @@ -19,9 +22,6 @@ mapi_hfn_list_av1 sslonly_hfnlist[] = { static unsigned int mymode; -static const char chm_sslonly_desc[] = - "Adds channel mode +S that bans non-SSL users from joing a channel"; - static int _modinit(void) { diff --git a/extensions/chm_sslonly_compat.c b/extensions/chm_sslonly_compat.c index 1c50ba77..9ee1ca25 100644 --- a/extensions/chm_sslonly_compat.c +++ b/extensions/chm_sslonly_compat.c @@ -9,13 +9,14 @@ #include "ircd.h" #include "chmode.h" +static const char chm_sslonly_compat_desc[] = + "Adds an emulated channel mode +S which is converted into mode +b $~z"; + static int _modinit(void); static void _moddeinit(void); static void chm_sslonly(struct Client *source_p, struct Channel *chptr, int alevel, int parc, int *parn, const char **parv, int *errors, int dir, char c, long mode_type); -static const char chm_sslonly_compat_desc[] = - "Adds an emulated channel mode +S which is converted into mode +b $~z"; DECLARE_MODULE_AV2(chm_sslonly_compat, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, chm_sslonly_compat_desc); diff --git a/extensions/createauthonly.c b/extensions/createauthonly.c index 0a701844..dea11a0c 100644 --- a/extensions/createauthonly.c +++ b/extensions/createauthonly.c @@ -16,9 +16,10 @@ #include "snomask.h" #include "numeric.h" -static void h_can_create_channel_authenticated(hook_data_client_approval *); static const char restrict_desc[] = "Restricts channel creation to authenticated users and IRC operators only"; +static void h_can_create_channel_authenticated(hook_data_client_approval *); + mapi_hfn_list_av1 restrict_hfnlist[] = { { "can_create_channel", (hookfn) h_can_create_channel_authenticated }, { NULL, NULL } diff --git a/extensions/createoperonly.c b/extensions/createoperonly.c index ec92540a..f763d676 100644 --- a/extensions/createoperonly.c +++ b/extensions/createoperonly.c @@ -16,9 +16,10 @@ #include "snomask.h" #include "numeric.h" -static void h_can_create_channel_authenticated(hook_data_client_approval *); static const char restrict_desc[] = "Restricts channel creation to IRC operators"; +static void h_can_create_channel_authenticated(hook_data_client_approval *); + mapi_hfn_list_av1 restrict_hfnlist[] = { { "can_create_channel", (hookfn) h_can_create_channel_authenticated }, { NULL, NULL } diff --git a/extensions/example_module.c b/extensions/example_module.c index 63b9f7b9..8074fe96 100644 --- a/extensions/example_module.c +++ b/extensions/example_module.c @@ -25,6 +25,13 @@ #include "ircd.h" #include "send.h" +/* This string describes the module. Always declare it a static const char[]. + * It is preferred for stylistic reasons to put it first. + * + * Make it short, sweet, and to the point. + */ +static const char example_desc[] = "This is an example Charybdis module."; + /* Declare the void's initially up here, as modules dont have an * include file, we will normally have client_p, source_p, parc * and parv[] where: @@ -46,25 +53,25 @@ static int moper_test(struct MsgBuf *msgbuf_p, struct Client *client_p, struct C */ struct Message test_msgtab = { - "TEST", /* the /COMMAND you want */ - 0, /* SET TO ZERO -- number of times command used by clients */ - 0, /* SET TO ZERO -- number of times command used by clients */ - 0, /* SET TO ZERO -- number of times command used by clients */ - 0, /* ALWAYS SET TO 0 */ + "TEST", /* the /COMMAND you want */ + 0, /* SET TO ZERO -- number of times command used by clients */ + 0, /* SET TO ZERO -- number of times command used by clients */ + 0, /* SET TO ZERO -- number of times command used by clients */ + 0, /* ALWAYS SET TO 0 */ - /* the functions to call for each handler. If not using the generic - * handlers, the first param is the function to call, the second is the - * required number of parameters. NOTE: If you specify a min para of 2, - * then parv[1] must *also* be non-empty. - */ - { - {munreg_test, 0}, /* function call for unregistered clients, 0 parms required */ - {mclient_test, 0}, /* function call for local clients, 0 parms required */ - {mrclient_test, 0}, /* function call for remote clients, 0 parms required */ - {mserver_test, 0}, /* function call for servers, 0 parms required */ - mg_ignore, /* function call for ENCAP, unused in this test */ - {moper_test, 0} /* function call for operators, 0 parms required */ - } + /* the functions to call for each handler. If not using the generic + * handlers, the first param is the function to call, the second is the + * required number of parameters. NOTE: If you specify a min para of 2, + * then parv[1] must *also* be non-empty. + */ + { + {munreg_test, 0}, /* function call for unregistered clients, 0 parms required */ + {mclient_test, 0}, /* function call for local clients, 0 parms required */ + {mrclient_test, 0}, /* function call for remote clients, 0 parms required */ + {mserver_test, 0}, /* function call for servers, 0 parms required */ + mg_ignore, /* function call for ENCAP, unused in this test */ + {moper_test, 0} /* function call for operators, 0 parms required */ + } }; /* * There are also some macros for the above function calls and parameter counts. @@ -143,28 +150,27 @@ moddeinit(void) /* DECLARE_MODULE_AV2() actually declare the MAPI header. */ DECLARE_MODULE_AV2( - /* The first argument is the name */ - example, - /* The second argument is the function to call on load */ - modinit, - /* And the function to call on unload */ - moddeinit, - /* Then the MAPI command list */ - test_clist, - /* Next the hook list, if we have one. */ - test_hlist, - /* Then the hook function list, if we have one */ - test_hfnlist, - /* Then the caps list, if we have one */ - test_cap_list, - /* Then the version number of this module (NULL for bundled) */ - NULL, - /* And finally, the description of this module */ - "This is an example module"); + /* The first argument is the name */ + example, + /* The second argument is the function to call on load */ + modinit, + /* And the function to call on unload */ + moddeinit, + /* Then the MAPI command list */ + test_clist, + /* Next the hook list, if we have one. */ + test_hlist, + /* Then the hook function list, if we have one */ + test_hfnlist, + /* Then the caps list, if we have one */ + test_cap_list, + /* Then the version number of this module (NULL for bundled) */ + NULL, + /* And finally, the description of this module */ + example_desc); /* Any of the above arguments can be NULL to indicate they aren't used. */ - /* * mr_test * parv[1] = parameter diff --git a/extensions/extb_account.c b/extensions/extb_account.c index 4f9d3edb..82af5889 100644 --- a/extensions/extb_account.c +++ b/extensions/extb_account.c @@ -8,10 +8,11 @@ #include "client.h" #include "ircd.h" +static const char extb_desc[] = "Account ($a) extban type"; + static int _modinit(void); static void _moddeinit(void); static int eb_account(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type); -static const char extb_desc[] = "Account ($a) extban type"; DECLARE_MODULE_AV2(extb_account, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc); diff --git a/extensions/extb_canjoin.c b/extensions/extb_canjoin.c index bfb02bc4..ab437896 100644 --- a/extensions/extb_canjoin.c +++ b/extensions/extb_canjoin.c @@ -11,10 +11,11 @@ #include "hash.h" #include "ircd.h" +static const char extb_desc[] = "Can join ($j) extban type - matches users who are or are not banned from a specified channel"; + static int _modinit(void); static void _moddeinit(void); static int eb_canjoin(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type); -static const char extb_desc[] = "Can join ($j) extban type - matches users who are or are not banned from a specified channel"; DECLARE_MODULE_AV2(extb_canjoin, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc); diff --git a/extensions/extb_channel.c b/extensions/extb_channel.c index 2168701a..3225d076 100644 --- a/extensions/extb_channel.c +++ b/extensions/extb_channel.c @@ -10,10 +10,11 @@ #include "hash.h" #include "ircd.h" +static const char extb_desc[] = "Channel ($c) extban type"; + static int _modinit(void); static void _moddeinit(void); static int eb_channel(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type); -static const char extb_desc[] = "Channel ($c) extban type"; DECLARE_MODULE_AV2(extb_channel, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc); diff --git a/extensions/extb_combi.c b/extensions/extb_combi.c index 86a9d530..6b06fdb9 100644 --- a/extensions/extb_combi.c +++ b/extensions/extb_combi.c @@ -42,8 +42,10 @@ #include "client.h" #include "ircd.h" -// #define DEBUG(s) sendto_realops_snomask(SNO_DEBUG, L_NETWIDE, (s)) -#define DEBUG(s) +static const char extb_desc[] = "Combination ($&, $|) extban types"; + +// #define MOD_DEBUG(s) sendto_realops_snomask(SNO_DEBUG, L_NETWIDE, (s)) +#define MOD_DEBUG(s) #define RETURN_INVALID { recursion_depth--; return EXTBAN_INVALID; } static int _modinit(void); @@ -52,7 +54,6 @@ static int eb_or(const char *data, struct Client *client_p, struct Channel *chpt static int eb_and(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type); static int eb_combi(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type, int is_and); static int recursion_depth = 0; -static const char extb_desc[] = "Combination ($&, $|) extban types"; DECLARE_MODULE_AV2(extb_extended, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc); @@ -93,12 +94,12 @@ static int eb_combi(const char *data, struct Client *client_p, size_t datalen; if (recursion_depth >= 5) { - DEBUG("combo invalid: recursion depth too high"); + MOD_DEBUG("combo invalid: recursion depth too high"); return EXTBAN_INVALID; } if (EmptyString(data)) { - DEBUG("combo invalid: empty data"); + MOD_DEBUG("combo invalid: empty data"); return EXTBAN_INVALID; } @@ -107,7 +108,7 @@ static int eb_combi(const char *data, struct Client *client_p, /* I'd be sad if this ever happened, but if it does we * could overflow the buffer used below, so... */ - DEBUG("combo invalid: > BANLEN"); + MOD_DEBUG("combo invalid: > BANLEN"); return EXTBAN_INVALID; } banend = data + datalen; @@ -116,7 +117,7 @@ static int eb_combi(const char *data, struct Client *client_p, p = data + 1; banend--; if (*banend != ')') { - DEBUG("combo invalid: starting but no closing paren"); + MOD_DEBUG("combo invalid: starting but no closing paren"); return EXTBAN_INVALID; } } else { @@ -125,7 +126,7 @@ static int eb_combi(const char *data, struct Client *client_p, /* Empty combibans are invalid. */ if (banend == p) { - DEBUG("combo invalid: no data (after removing parens)"); + MOD_DEBUG("combo invalid: no data (after removing parens)"); return EXTBAN_INVALID; } @@ -150,14 +151,14 @@ static int eb_combi(const char *data, struct Client *client_p, invert = TRUE; p++; if (p == banend) { - DEBUG("combo invalid: no data after ~"); + MOD_DEBUG("combo invalid: no data after ~"); RETURN_INVALID; } } f = extban_table[(unsigned char) *p++]; if (!f) { - DEBUG("combo invalid: non-existant child extban"); + MOD_DEBUG("combo invalid: non-existant child extban"); RETURN_INVALID; } @@ -175,7 +176,7 @@ static int eb_combi(const char *data, struct Client *client_p, while (TRUE) { if (p == banend) { if (parencount) { - DEBUG("combo invalid: EOD while in parens"); + MOD_DEBUG("combo invalid: EOD while in parens"); RETURN_INVALID; } break; @@ -197,7 +198,7 @@ static int eb_combi(const char *data, struct Client *client_p, break; case ')': if (!parencount) { - DEBUG("combo invalid: negative parencount"); + MOD_DEBUG("combo invalid: negative parencount"); RETURN_INVALID; } parencount--; @@ -227,7 +228,7 @@ static int eb_combi(const char *data, struct Client *client_p, int child_result = f(child_data, client_p, chptr, mode_type); if (child_result == EXTBAN_INVALID) { - DEBUG("combo invalid: child invalid"); + MOD_DEBUG("combo invalid: child invalid"); RETURN_INVALID; } @@ -245,19 +246,19 @@ static int eb_combi(const char *data, struct Client *client_p, break; if (*p++ != ',') { - DEBUG("combo invalid: no ',' after ban"); + MOD_DEBUG("combo invalid: no ',' after ban"); RETURN_INVALID; } if (p == banend) { - DEBUG("combo invalid: banend after ','"); + MOD_DEBUG("combo invalid: banend after ','"); RETURN_INVALID; } } /* at this point, *p should == banend */ if (p != banend) { - DEBUG("combo invalid: more child extbans than allowed"); + MOD_DEBUG("combo invalid: more child extbans than allowed"); RETURN_INVALID; } diff --git a/extensions/extb_extgecos.c b/extensions/extb_extgecos.c index d53c112c..7dbf73f1 100644 --- a/extensions/extb_extgecos.c +++ b/extensions/extb_extgecos.c @@ -9,10 +9,11 @@ #include "client.h" #include "ircd.h" +static const char extb_desc[] = "Extended mask ($x) extban type"; + static int _modinit(void); static void _moddeinit(void); static int eb_extended(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type); -static const char extb_desc[] = "Extended mask ($x) extban type"; DECLARE_MODULE_AV2(extb_extended, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc); diff --git a/extensions/extb_hostmask.c b/extensions/extb_hostmask.c index 169235f4..fcdee731 100644 --- a/extensions/extb_hostmask.c +++ b/extensions/extb_hostmask.c @@ -9,10 +9,11 @@ #include "ircd.h" #include "ipv4_from_ipv6.h" +static const char extb_desc[] = "Hostmask ($m) extban type"; + static int _modinit(void); static void _moddeinit(void); static int eb_hostmask(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type); -static const char extb_desc[] = "Hostmask ($m) extban type"; DECLARE_MODULE_AV2(extb_hostmask, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc); diff --git a/extensions/extb_oper.c b/extensions/extb_oper.c index 0505df2a..72908b29 100644 --- a/extensions/extb_oper.c +++ b/extensions/extb_oper.c @@ -10,10 +10,11 @@ #include "s_newconf.h" #include "ircd.h" +static const char extb_desc[] = "Oper ($o) extban type"; + static int _modinit(void); static void _moddeinit(void); static int eb_oper(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type); -static const char extb_desc[] = "Oper ($o) extban type"; DECLARE_MODULE_AV2(extb_oper, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc); diff --git a/extensions/extb_realname.c b/extensions/extb_realname.c index f0ad8463..eed8a807 100644 --- a/extensions/extb_realname.c +++ b/extensions/extb_realname.c @@ -8,10 +8,11 @@ #include "client.h" #include "ircd.h" +static const char extb_desc[] = "Realname/GECOS ($r) extban type"; + static int _modinit(void); static void _moddeinit(void); static int eb_realname(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type); -static const char extb_desc[] = "Realname/GECOS ($r) extban type"; DECLARE_MODULE_AV2(extb_realname, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc); diff --git a/extensions/extb_server.c b/extensions/extb_server.c index f637b6a8..b3e4e037 100644 --- a/extensions/extb_server.c +++ b/extensions/extb_server.c @@ -8,10 +8,11 @@ #include "client.h" #include "ircd.h" +static const char extb_desc[] = "Server ($s) extban type"; + static int _modinit(void); static void _moddeinit(void); static int eb_server(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type); -static const char extb_desc[] = "Server ($s) extban type"; DECLARE_MODULE_AV2(extb_server, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc); diff --git a/extensions/extb_ssl.c b/extensions/extb_ssl.c index f6abc2a5..801d4e9b 100644 --- a/extensions/extb_ssl.c +++ b/extensions/extb_ssl.c @@ -5,10 +5,11 @@ #include "client.h" #include "ircd.h" +static const char extb_desc[] = "SSL/TLS ($z) extban type"; + static int _modinit(void); static void _moddeinit(void); static int eb_ssl(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type); -static const char extb_desc[] = "SSL/TLS ($z) extban type"; DECLARE_MODULE_AV2(extb_ssl, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc); diff --git a/extensions/extb_usermode.c b/extensions/extb_usermode.c index c7f11dd0..a8acc0a2 100644 --- a/extensions/extb_usermode.c +++ b/extensions/extb_usermode.c @@ -15,10 +15,11 @@ #include "s_serv.h" #include "numeric.h" +static const char extb_desc[] = "Usermode ($m) extban type"; + static int _modinit(void); static void _moddeinit(void); static int eb_usermode(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type); -static const char extb_desc[] = "Usermode ($m) extban type"; DECLARE_MODULE_AV2(extb_usermode, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc); diff --git a/extensions/helpops.c b/extensions/helpops.c index a47fd24a..0e74ef95 100644 --- a/extensions/helpops.c +++ b/extensions/helpops.c @@ -14,6 +14,8 @@ #include "s_newconf.h" #include "numeric.h" +static const char helpops_desc[] = "The helpops system as used by freenode"; + static rb_dlink_list helper_list = { NULL, NULL, 0 }; static void h_hdl_stats_request(hook_data_int *hdata); static void h_hdl_new_remote_user(struct Client *client_p); @@ -43,8 +45,6 @@ struct Message dehelper_msgtab = { mapi_clist_av1 helpops_clist[] = { &dehelper_msgtab, NULL }; -static const char helpops_desc[] = "The helpops system as used by freenode"; - static int mo_dehelper(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char **parv) { struct Client *target_p; diff --git a/extensions/hide_uncommon_channels.c b/extensions/hide_uncommon_channels.c index c9e03a22..ff1d0cb6 100644 --- a/extensions/hide_uncommon_channels.c +++ b/extensions/hide_uncommon_channels.c @@ -12,6 +12,8 @@ #include "s_conf.h" #include "s_newconf.h" +static const char hide_desc[] = "Hides channel memberships not shared"; + static void h_huc_doing_whois_channel_visibility(hook_data_client *); mapi_hfn_list_av1 huc_hfnlist[] = { @@ -19,8 +21,6 @@ mapi_hfn_list_av1 huc_hfnlist[] = { { NULL, NULL } }; -static const char hide_desc[] = "Hides channel memberships not shared"; - DECLARE_MODULE_AV2(hide_uncommon_channels, NULL, NULL, NULL, NULL, huc_hfnlist, NULL, NULL, hide_desc); static void diff --git a/extensions/ip_cloaking.c b/extensions/ip_cloaking.c index 0e0abb26..a650c8ab 100644 --- a/extensions/ip_cloaking.c +++ b/extensions/ip_cloaking.c @@ -17,6 +17,8 @@ #include "s_serv.h" #include "numeric.h" +static const char ip_cloaking_desc[] = "IP cloaking module that uses user mode +h"; + static int _modinit(void) { @@ -43,8 +45,6 @@ mapi_hfn_list_av1 ip_cloaking_hfnlist[] = { { NULL, NULL } }; -static const char ip_cloaking_desc[] = "IP cloaking module that uses user mode +h"; - DECLARE_MODULE_AV2(ip_cloaking, _modinit, _moddeinit, NULL, NULL, ip_cloaking_hfnlist, NULL, NULL, ip_cloaking_desc); diff --git a/extensions/ip_cloaking_3.0.c b/extensions/ip_cloaking_3.0.c index d79af222..a1d16ca5 100644 --- a/extensions/ip_cloaking_3.0.c +++ b/extensions/ip_cloaking_3.0.c @@ -10,6 +10,8 @@ #include "s_serv.h" #include "numeric.h" +static const char ip_cloaking_desc[] = "The old IP cloaking mechanism version 3.0"; + /* if you're modifying this module, you'll probably want to change this */ #define KEY 0x13748cfa @@ -39,8 +41,6 @@ mapi_hfn_list_av1 ip_cloaking_hfnlist[] = { { NULL, NULL } }; -static const char ip_cloaking_desc[] = "The old IP cloaking mechanism version 3.0"; - DECLARE_MODULE_AV2(ip_cloaking, _modinit, _moddeinit, NULL, NULL, ip_cloaking_hfnlist, NULL, NULL, ip_cloaking_desc); diff --git a/extensions/ip_cloaking_4.0.c b/extensions/ip_cloaking_4.0.c index a2514dde..011fcc69 100644 --- a/extensions/ip_cloaking_4.0.c +++ b/extensions/ip_cloaking_4.0.c @@ -17,6 +17,8 @@ #include "s_serv.h" #include "numeric.h" +static const char ip_cloaking_desc[] = "New IP cloaking module that uses user mode +x instead of +h"; + static int _modinit(void) { @@ -43,8 +45,6 @@ mapi_hfn_list_av1 ip_cloaking_hfnlist[] = { { NULL, NULL } }; -static const char ip_cloaking_desc[] = "New IP cloaking module that uses user mode +x instead of +h"; - DECLARE_MODULE_AV2(ip_cloaking, _modinit, _moddeinit, NULL, NULL, ip_cloaking_hfnlist, NULL, NULL, ip_cloaking_desc); diff --git a/extensions/ip_cloaking_old.c b/extensions/ip_cloaking_old.c index e739b1c4..ca4f9111 100644 --- a/extensions/ip_cloaking_old.c +++ b/extensions/ip_cloaking_old.c @@ -10,6 +10,8 @@ #include "s_serv.h" #include "numeric.h" +static const char ip_cloaking_desc[] = "Very old IP cloaking mechanism"; + /* if you're modifying this module, you'll probably want to change this */ #define KEY 0x13748cfa @@ -39,8 +41,6 @@ mapi_hfn_list_av1 ip_cloaking_hfnlist[] = { { NULL, NULL } }; -static const char ip_cloaking_desc[] = "Very old IP cloaking mechanism"; - DECLARE_MODULE_AV2(ip_cloaking, _modinit, _moddeinit, NULL, NULL, ip_cloaking_hfnlist, NULL, NULL, ip_cloaking_desc); diff --git a/extensions/m_adminwall.c b/extensions/m_adminwall.c index 1c7f20a1..d40f643b 100644 --- a/extensions/m_adminwall.c +++ b/extensions/m_adminwall.c @@ -37,6 +37,9 @@ #include "s_serv.h" #include "messages.h" +static const char adminwall_desc[] = + "Provides the ADMINWALL command to send a message to all administrators"; + static int mo_adminwall(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int me_adminwall(struct MsgBuf *, struct Client *, struct Client *, int, const char **); @@ -45,15 +48,10 @@ struct Message adminwall_msgtab = { {mg_unreg, mg_not_oper, mg_ignore, mg_ignore, {me_adminwall, 2}, {mo_adminwall, 2}} }; - mapi_clist_av1 adminwall_clist[] = { &adminwall_msgtab, NULL }; -static const char adminwall_desc[] = - "Provides the ADMINWALL command to send a message to all administrators"; - DECLARE_MODULE_AV2(adminwall, NULL, NULL, adminwall_clist, NULL, NULL, NULL, NULL, adminwall_desc); - /* * mo_adminwall (write to *all* admins currently online) * parv[1] = message text diff --git a/extensions/m_extendchans.c b/extensions/m_extendchans.c index ee845107..20ee6a5c 100644 --- a/extensions/m_extendchans.c +++ b/extensions/m_extendchans.c @@ -31,6 +31,9 @@ #include "send.h" #include "numeric.h" +static const char extendchans_desc[] = + "Allow an oper or service to let a given user join more channels"; + static int mo_extendchans(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int me_extendchans(struct MsgBuf *, struct Client *, struct Client *, int, const char **); @@ -41,9 +44,6 @@ struct Message extendchans_msgtab = { mapi_clist_av1 extendchans_clist[] = { &extendchans_msgtab, NULL }; -static const char extendchans_desc[] = - "Allow an oper or service to let a given user join more channels"; - DECLARE_MODULE_AV2(extendchans, NULL, NULL, extendchans_clist, NULL, NULL, NULL, NULL, extendchans_desc); static int diff --git a/extensions/m_findforwards.c b/extensions/m_findforwards.c index d6ebce09..8ca383c6 100644 --- a/extensions/m_findforwards.c +++ b/extensions/m_findforwards.c @@ -34,6 +34,8 @@ #include "packet.h" #include "messages.h" +static const char findfowards_desc[] = "Allows operators to find forwards to a given channel"; + static int m_findforwards(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); @@ -44,8 +46,6 @@ struct Message findforwards_msgtab = { mapi_clist_av1 findforwards_clist[] = { &findforwards_msgtab, NULL }; -static const char findfowards_desc[] = "Allows operators to find forwards to a given channel"; - DECLARE_MODULE_AV2(findforwards, NULL, NULL, findforwards_clist, NULL, NULL, NULL, NULL, findfowards_desc); /* diff --git a/extensions/m_identify.c b/extensions/m_identify.c index c2f26d80..7f242b28 100644 --- a/extensions/m_identify.c +++ b/extensions/m_identify.c @@ -47,6 +47,8 @@ #define SVS_chanserv_NICK "ChanServ" #define SVS_nickserv_NICK "NickServ" +static const char identify_desc[] = "Adds the IDENTIFY alias that forwards to NickServ or ChanServ"; + static int m_identify(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); struct Message identify_msgtab = { diff --git a/extensions/m_mkpasswd.c b/extensions/m_mkpasswd.c index 7b9352ce..788558f7 100644 --- a/extensions/m_mkpasswd.c +++ b/extensions/m_mkpasswd.c @@ -15,6 +15,8 @@ #include +const char mkpasswd_desc[] = "Hash a password for use in ircd.conf"; + static int m_mkpasswd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); static int mo_mkpasswd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, @@ -36,8 +38,6 @@ struct Message mkpasswd_msgtab = { mapi_clist_av1 mkpasswd_clist[] = { &mkpasswd_msgtab, NULL }; -const char mkpasswd_desc[] = "Hash a password for use in ircd.conf"; - DECLARE_MODULE_AV2(mkpasswd, NULL, NULL, mkpasswd_clist, NULL, NULL, NULL, NULL, mkpasswd_desc); diff --git a/extensions/m_ojoin.c b/extensions/m_ojoin.c index dec3fbe7..4f99db3e 100644 --- a/extensions/m_ojoin.c +++ b/extensions/m_ojoin.c @@ -35,6 +35,8 @@ #include "modules.h" #include "messages.h" +static const char ojoin_desc[] = "Allow admins to forcibly join channels with the OJOIN command"; + static int mo_ojoin(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); struct Message ojoin_msgtab = { @@ -44,8 +46,6 @@ struct Message ojoin_msgtab = { mapi_clist_av1 ojoin_clist[] = { &ojoin_msgtab, NULL }; -static const char ojoin_desc[] = "Allow admins to forcibly join channels with the OJOIN command"; - DECLARE_MODULE_AV2(ojoin, NULL, NULL, ojoin_clist, NULL, NULL, NULL, NULL, ojoin_desc); /* diff --git a/extensions/m_okick.c b/extensions/m_okick.c index 01da58ab..dac845e3 100644 --- a/extensions/m_okick.c +++ b/extensions/m_okick.c @@ -38,8 +38,9 @@ #include "messages.h" #include "logger.h" -static int mo_okick(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); +static const char okick_desc[] = "Allow admins to forcibly kick users from channels with the OKICK command"; +static int mo_okick(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); struct Message okick_msgtab = { "OKICK", 0, 0, 0, 0, @@ -48,8 +49,6 @@ struct Message okick_msgtab = { mapi_clist_av1 okick_clist[] = { &okick_msgtab, NULL }; -static const char okick_desc[] = "Allow admins to forcibly kick users from channels with the OKICK command"; - DECLARE_MODULE_AV2(okick, NULL, NULL, okick_clist, NULL, NULL, NULL, NULL, okick_desc); /* diff --git a/extensions/m_omode.c b/extensions/m_omode.c index 91caf405..a0cdeb98 100644 --- a/extensions/m_omode.c +++ b/extensions/m_omode.c @@ -42,6 +42,8 @@ #include "messages.h" #include "logger.h" +static const char omode_desc[] = "Allow admins to forcibly change modes on channels with the OMODE command"; + static int mo_omode(struct MsgBuf *, struct Client *, struct Client *, int, const char **); struct Message omode_msgtab = { @@ -51,8 +53,6 @@ struct Message omode_msgtab = { mapi_clist_av1 omode_clist[] = { &omode_msgtab, NULL }; -static const char omode_desc[] = "Allow admins to forcibly change modes on channels with the OMODE command"; - DECLARE_MODULE_AV2(omode, NULL, NULL, omode_clist, NULL, NULL, NULL, NULL, omode_desc); /* diff --git a/extensions/m_opme.c b/extensions/m_opme.c index def7fe56..98e12f2a 100644 --- a/extensions/m_opme.c +++ b/extensions/m_opme.c @@ -34,6 +34,8 @@ #include "s_newconf.h" #include "messages.h" +static const char opme_desc[] = "Allow admins to op themselves on opless channels"; + static int mo_opme(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); struct Message opme_msgtab = { @@ -43,8 +45,6 @@ struct Message opme_msgtab = { mapi_clist_av1 opme_clist[] = { &opme_msgtab, NULL }; -static const char opme_desc[] = "Allow admins to op themselves on opless channels"; - DECLARE_MODULE_AV2(opme, NULL, NULL, opme_clist, NULL, NULL, NULL, NULL, opme_desc); /* diff --git a/extensions/m_remove.c b/extensions/m_remove.c index 35d70edc..c827423d 100644 --- a/extensions/m_remove.c +++ b/extensions/m_remove.c @@ -39,12 +39,14 @@ #include "hook.h" #include "messages.h" -unsigned int CAP_REMOVE; -static char part_buf[REASONLEN + 1]; +static const char description[] = "Provides the REMOVE command, an alternative to KICK"; static int m_remove(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static void remove_quote_part(hook_data_privmsg_channel *); +unsigned int CAP_REMOVE; +static char part_buf[REASONLEN + 1]; + struct Message remove_msgtab = { "REMOVE", 0, 0, 0, 0, {mg_unreg, {m_remove, 3}, {m_remove, 3}, {m_remove, 3}, mg_ignore, {m_remove, 3}} @@ -60,8 +62,6 @@ mapi_cap_list_av2 remove_cap_list[] = { { 0, NULL, NULL, NULL } }; -const char description[] = "Provides the REMOVE command, an alternative to KICK"; - DECLARE_MODULE_AV2(remove, NULL, NULL, remove_clist, NULL, remove_hfnlist, remove_cap_list, NULL, description); static int diff --git a/extensions/m_sendbans.c b/extensions/m_sendbans.c index b08f7c2c..96dfbd92 100644 --- a/extensions/m_sendbans.c +++ b/extensions/m_sendbans.c @@ -45,6 +45,9 @@ #include "messages.h" #include "rb_radixtree.h" +static const char sendbands_desc[] = + "Adds the ability to send all permanent RESVs and XLINEs to given server"; + static int mo_sendbans(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); struct Message sendbans_msgtab = { @@ -57,9 +60,6 @@ mapi_clist_av1 sendbans_clist[] = { NULL }; -static const char sendbands_desc[] = - "Adds the ability to send all permanent RESVs and XLINEs to given server"; - DECLARE_MODULE_AV2(sendbans, NULL, NULL, sendbans_clist, NULL, NULL, NULL, NULL, sendbands_desc); static const char *expand_xline(const char *mask) diff --git a/extensions/m_webirc.c b/extensions/m_webirc.c index fe0a4ae2..60c9de7c 100644 --- a/extensions/m_webirc.c +++ b/extensions/m_webirc.c @@ -53,6 +53,8 @@ #include "s_conf.h" #include "reject.h" +static const char webirc_desc[] = "Adds support for the WebIRC system"; + static int mr_webirc(struct MsgBuf *msgbuf_p, struct Client *, struct Client *, int, const char **); struct Message webirc_msgtab = { @@ -62,8 +64,6 @@ struct Message webirc_msgtab = { mapi_clist_av1 webirc_clist[] = { &webirc_msgtab, NULL }; -static const char webirc_desc[] = "Adds support for the WebIRC system"; - DECLARE_MODULE_AV2(webirc, NULL, NULL, webirc_clist, NULL, NULL, NULL, NULL, webirc_desc); /* diff --git a/extensions/sno_channelcreate.c b/extensions/sno_channelcreate.c index d3ab9f55..4259bf94 100644 --- a/extensions/sno_channelcreate.c +++ b/extensions/sno_channelcreate.c @@ -12,6 +12,9 @@ #include "snomask.h" #include "rb_lib.h" +static const char sno_desc[] = + "Adds server notice mask +l that allows operators to receive channel creation notices"; + static int _modinit(void); static void _moddeinit(void); static void h_scc_channel_join(void *); @@ -21,9 +24,6 @@ mapi_hfn_list_av1 scc_hfnlist[] = { { NULL, NULL } }; -static const char sno_desc[] = - "Adds server notice mask +l that allows operators to receive channel creation notices"; - DECLARE_MODULE_AV2(sno_channelcreate, _modinit, _moddeinit, NULL, NULL, scc_hfnlist, NULL, NULL, sno_desc); static int diff --git a/extensions/sno_farconnect.c b/extensions/sno_farconnect.c index 36e2dbae..9638592a 100644 --- a/extensions/sno_farconnect.c +++ b/extensions/sno_farconnect.c @@ -15,6 +15,9 @@ #include "s_conf.h" #include "snomask.h" +static const char sno_desc[] = + "Adds server notice mask +F that allows operators to receive notices for connections on other servers"; + static int _modinit(void); static void _moddeinit(void); static void h_gcn_new_remote_user(struct Client *); @@ -26,9 +29,6 @@ mapi_hfn_list_av1 gcn_hfnlist[] = { { NULL, NULL } }; -static const char sno_desc[] = - "Adds server notice mask +F that allows operators to receive notices for connections on other servers"; - DECLARE_MODULE_AV2(globalconnexit, _modinit, _moddeinit, NULL, NULL, gcn_hfnlist, NULL, NULL, sno_desc); static int diff --git a/extensions/sno_globalkline.c b/extensions/sno_globalkline.c index 49fa8bf6..0b3285b2 100644 --- a/extensions/sno_globalkline.c +++ b/extensions/sno_globalkline.c @@ -15,6 +15,9 @@ #include "send.h" #include "s_conf.h" +static const char sno_desc[] = + "Adds server notices for global XLINEs, KLINEs, and DLINEs"; + static void h_gla_client_exit(hook_data_client_exit *); mapi_hfn_list_av1 gla_hfnlist[] = { @@ -22,9 +25,6 @@ mapi_hfn_list_av1 gla_hfnlist[] = { { NULL, NULL } }; -static const char sno_desc[] = - "Adds server notices for global XLINEs, KLINEs, and DLINEs"; - DECLARE_MODULE_AV2(globallineactive, NULL, NULL, NULL, NULL, gla_hfnlist, NULL, NULL, sno_desc); static void diff --git a/extensions/sno_globalnickchange.c b/extensions/sno_globalnickchange.c index 17ef37cd..9c53d48d 100644 --- a/extensions/sno_globalnickchange.c +++ b/extensions/sno_globalnickchange.c @@ -11,6 +11,9 @@ #include "s_conf.h" #include "snomask.h" +static const char sno_desc[] = + "Adds server notices for remote nick changes"; + static int _modinit(void); static void h_gnc_nick_change(hook_data *data); @@ -19,9 +22,6 @@ mapi_hfn_list_av1 gcn_hfnlist[] = { { NULL, NULL } }; -static const char sno_desc[] = - "Adds server notices for remote nick changes"; - DECLARE_MODULE_AV2(globalnickchange, _modinit, NULL, NULL, NULL, gcn_hfnlist, NULL, NULL, sno_desc); static int diff --git a/extensions/sno_globaloper.c b/extensions/sno_globaloper.c index 7bf7a191..ea5476c2 100644 --- a/extensions/sno_globaloper.c +++ b/extensions/sno_globaloper.c @@ -11,6 +11,9 @@ #include "s_conf.h" #include "snomask.h" +static const char sno_desc[] = + "Adds server notices for remote oper up"; + static void h_sgo_umode_changed(void *); mapi_hfn_list_av1 sgo_hfnlist[] = { @@ -18,9 +21,6 @@ mapi_hfn_list_av1 sgo_hfnlist[] = { { NULL, NULL } }; -static const char sno_desc[] = - "Adds server notices for remote oper up"; - DECLARE_MODULE_AV2(sno_globaloper, NULL, NULL, NULL, NULL, sgo_hfnlist, NULL, NULL, sno_desc); static void diff --git a/extensions/sno_whois.c b/extensions/sno_whois.c index 56d857ca..f5c69d92 100644 --- a/extensions/sno_whois.c +++ b/extensions/sno_whois.c @@ -16,6 +16,15 @@ /* undefine this to allow anyone to receive whois notifications */ #define OPERONLY +static const char sno_desc[] = + "Adds server notice mask +W that allows " +#ifdef OPERONLY + "operators" +#else + "users" +#endif + " to receive notices for when a WHOIS has been done on them"; + void show_whois(hook_data_client *); mapi_hfn_list_av1 whois_hfnlist[] = { @@ -38,15 +47,6 @@ fini(void) snomask_modes['W'] = 0; } -static const char sno_desc[] = - "Adds server notice mask +W that allows " -#ifdef OPERONLY - "operators" -#else - "users" -#endif - " to receive notices for when a WHOIS has been done on them"; - DECLARE_MODULE_AV2(sno_whois, init, fini, NULL, NULL, whois_hfnlist, NULL, NULL, sno_desc); void diff --git a/include/modules.h b/include/modules.h index d4d0ce07..b2ff535b 100644 --- a/include/modules.h +++ b/include/modules.h @@ -79,7 +79,7 @@ typedef struct int cap_index; /* Which cap index does this belong to? */ const char *cap_name; /* Capability name */ void *cap_ownerdata; /* Not used much but why not... */ - unsigned int *cap_id; /* May be set to non-NULL to store cap id */ + unsigned int *cap_id; /* May be set to non-NULL to store cap id */ } mapi_cap_list_av2; struct mapi_mheader_av1 diff --git a/modules/cap_account_tag.c b/modules/cap_account_tag.c index d88da242..85e8dab2 100644 --- a/modules/cap_account_tag.c +++ b/modules/cap_account_tag.c @@ -34,6 +34,9 @@ #include "chmode.h" #include "inline/stringops.h" +static const char cap_account_tag_desc[] = + "Provides the account-tag client capability"; + static void cap_account_tag_process(hook_data *); unsigned int CLICAP_ACCOUNT_TAG = 0; @@ -45,9 +48,6 @@ mapi_cap_list_av2 cap_account_tag_cap_list[] = { { MAPI_CAP_CLIENT, "account-tag", NULL, &CLICAP_ACCOUNT_TAG }, { 0, NULL, NULL, NULL }, }; -static const char cap_account_tag_desc[] = - "Provides the account-tag client capability"; - static void cap_account_tag_process(hook_data *data) { diff --git a/modules/cap_server_time.c b/modules/cap_server_time.c index 698263a8..3119319f 100644 --- a/modules/cap_server_time.c +++ b/modules/cap_server_time.c @@ -34,6 +34,9 @@ #include "chmode.h" #include "inline/stringops.h" +static const char cap_server_time_desc[] = + "Provides the server-time client capability"; + static void cap_server_time_process(hook_data *); unsigned int CLICAP_SERVER_TIME = 0; @@ -45,8 +48,6 @@ mapi_cap_list_av2 cap_server_time_cap_list[] = { { MAPI_CAP_CLIENT, "server-time", NULL, &CLICAP_SERVER_TIME }, { 0, NULL, NULL, NULL } }; -static const char cap_server_time_desc[] = - "Provides the server-time client capability"; static void cap_server_time_process(hook_data *data) diff --git a/modules/chm_nocolour.c b/modules/chm_nocolour.c index 84244ea6..0a39c12f 100644 --- a/modules/chm_nocolour.c +++ b/modules/chm_nocolour.c @@ -34,6 +34,9 @@ #include "chmode.h" #include "inline/stringops.h" +static const char chm_nocolour_desc[] = + "Enables channel mode +c that filters colours and formatting from a channel"; + static char buf[BUFSIZE]; static unsigned int mode_nocolour; @@ -44,9 +47,6 @@ mapi_hfn_list_av1 chm_nocolour_hfnlist[] = { { NULL, NULL } }; -static const char chm_nocolour_desc[] = - "Enables channel mode +c that filters colours and formatting from a channel"; - static void chm_nocolour_process(hook_data_privmsg_channel *data) { diff --git a/modules/chm_noctcp.c b/modules/chm_noctcp.c index f23f18a5..d4d990c1 100644 --- a/modules/chm_noctcp.c +++ b/modules/chm_noctcp.c @@ -34,6 +34,9 @@ #include "chmode.h" #include "inline/stringops.h" +static const char chm_noctcp_desc[] = + "Adds channel mode +C, which blocks CTCP messages from a channel (except ACTION)"; + static unsigned int mode_noctcp; static void chm_noctcp_process(hook_data_privmsg_channel *); @@ -43,9 +46,6 @@ mapi_hfn_list_av1 chm_noctcp_hfnlist[] = { { NULL, NULL } }; -static const char chm_noctcp_desc[] = - "Adds channel mode +C, which blocks CTCP messages from a channel (except ACTION)"; - static void chm_noctcp_process(hook_data_privmsg_channel *data) { diff --git a/modules/core/m_ban.c b/modules/core/m_ban.c index ee7302ee..9e755865 100644 --- a/modules/core/m_ban.c +++ b/modules/core/m_ban.c @@ -46,9 +46,10 @@ #include "hostmask.h" #include "logger.h" +static const char ban_desc[] = "Provides the TS6 BAN command for propagating network-wide bans"; + static int m_ban(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); static int ms_ban(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); -static const char ban_desc[] = "Provides the TS6 BAN command for propagating network-wide bans"; struct Message ban_msgtab = { "BAN", 0, 0, 0, 0, @@ -56,6 +57,7 @@ struct Message ban_msgtab = { }; mapi_clist_av1 ban_clist[] = { &ban_msgtab, NULL }; + DECLARE_MODULE_AV2(ban, NULL, NULL, ban_clist, NULL, NULL, NULL, NULL, ban_desc); static int diff --git a/modules/core/m_die.c b/modules/core/m_die.c index aaece7a7..098ca9d1 100644 --- a/modules/core/m_die.c +++ b/modules/core/m_die.c @@ -36,10 +36,11 @@ #include "s_newconf.h" #include "hash.h" +static const char die_desc[] = "Provides the DIE command to allow an operator to shutdown a server"; + static int mo_die(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int me_die(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int do_die(struct Client *, const char *); -static const char die_desc[] = "Provides the DIE command to allow an operator to shutdown a server"; static struct Message die_msgtab = { "DIE", 0, 0, 0, 0, diff --git a/modules/core/m_error.c b/modules/core/m_error.c index 14c0813f..a97627ae 100644 --- a/modules/core/m_error.c +++ b/modules/core/m_error.c @@ -33,6 +33,9 @@ #include "logger.h" #include "s_conf.h" +static const char error_desc[] = + "Provides the ERROR command for clients and servers"; + static int m_error(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int ms_error(struct MsgBuf *, struct Client *, struct Client *, int, const char **); @@ -45,9 +48,6 @@ mapi_clist_av1 error_clist[] = { &error_msgtab, NULL }; -static const char error_desc[] = - "Provides the ERROR command for clients and servers"; - DECLARE_MODULE_AV2(error, NULL, NULL, error_clist, NULL, NULL, NULL, NULL, error_desc); /* Determine whether an ERROR message is safe to show (no IP address in it) */ diff --git a/modules/core/m_join.c b/modules/core/m_join.c index af78d781..0ee308d4 100644 --- a/modules/core/m_join.c +++ b/modules/core/m_join.c @@ -42,10 +42,11 @@ #include "ratelimit.h" #include "s_assert.h" +static const char join_desc[] = "Provides the JOIN and TS6 SJOIN commands to facilitate joining and creating channels"; + static int m_join(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int ms_join(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int ms_sjoin(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -static const char join_desc[] = "Provides the JOIN and TS6 SJOIN commands to facilitate joining and creating channels"; static int h_can_create_channel; static int h_channel_join; diff --git a/modules/core/m_kick.c b/modules/core/m_kick.c index a8964edc..6b1abf61 100644 --- a/modules/core/m_kick.c +++ b/modules/core/m_kick.c @@ -37,9 +37,10 @@ #include "s_serv.h" #include "hook.h" +static const char kick_desc[] = "Provides the KICK command to remove a user from a channel"; + static int m_kick(struct MsgBuf *, struct Client *, struct Client *, int, const char **); #define mg_kick { m_kick, 3 } -static const char kick_desc[] = "Provides the KICK command to remove a user from a channel"; struct Message kick_msgtab = { "KICK", 0, 0, 0, 0, @@ -110,30 +111,10 @@ m_kick(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p { sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED), get_id(&me, source_p), get_id(source_p, source_p), name); - return 0; + return; } } - /* Its a user doing a kick, but is not showing as chanop locally - * its also not a user ON -my- server, and the channel has a TS. - * There are two cases we can get to this point then... - * - * 1) connect burst is happening, and for some reason a legit - * op has sent a KICK, but the SJOIN hasn't happened yet or - * been seen. (who knows.. due to lag...) - * - * 2) The channel is desynced. That can STILL happen with TS - * - * Now, the old code roger wrote, would allow the KICK to - * go through. Thats quite legit, but lets weird things like - * KICKS by users who appear not to be chanopped happen, - * or even neater, they appear not to be on the channel. - * This fits every definition of a desync, doesn't it? ;-) - * So I will allow the KICK, otherwise, things are MUCH worse. - * But I will warn it as a possible desync. - * - * -Dianora - */ } if((p = strchr(parv[2], ','))) diff --git a/modules/core/m_kill.c b/modules/core/m_kill.c index 918e80ce..db7c7a75 100644 --- a/modules/core/m_kill.c +++ b/modules/core/m_kill.c @@ -38,6 +38,8 @@ #include "modules.h" #include "s_newconf.h" +static const char kill_desc[] = "Provides the KILL command to remove a user from the network"; + static int h_can_kill; static char buf[BUFSIZE]; @@ -45,7 +47,6 @@ static int ms_kill(struct MsgBuf *, struct Client *, struct Client *, int, const static int mo_kill(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static void relay_kill(struct Client *, struct Client *, struct Client *, const char *, const char *); -static const char kill_desc[] = "Provides the KILL command to remove a user from the network"; struct Message kill_msgtab = { "KILL", 0, 0, 0, 0, diff --git a/modules/core/m_message.c b/modules/core/m_message.c index dd6b7bee..4a5a4958 100644 --- a/modules/core/m_message.c +++ b/modules/core/m_message.c @@ -44,11 +44,12 @@ #include "tgchange.h" #include "inline/stringops.h" +static const char message_desc[] = + "Provides the PRIVMSG and NOTICE commands to send messages to users and channels"; + static int m_message(enum message_type, struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int m_privmsg(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int m_notice(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -static const char message_desc[] = - "Provides the PRIVMSG and NOTICE commands to send messages to users and channels"; static void expire_tgchange(void *unused); static struct ev_entry *expire_tgchange_event; diff --git a/modules/core/m_mode.c b/modules/core/m_mode.c index e4420293..e196eb1e 100644 --- a/modules/core/m_mode.c +++ b/modules/core/m_mode.c @@ -40,6 +40,9 @@ #include "packet.h" #include "s_newconf.h" +static const char mode_desc[] = + "Provides the MODE and MLOCK client and server commands, and TS6 server-to-server TMODE and BMASK commands"; + static int m_mode(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int ms_mode(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int ms_tmode(struct MsgBuf *, struct Client *, struct Client *, int, const char **); @@ -64,8 +67,6 @@ struct Message bmask_msgtab = { }; mapi_clist_av1 mode_clist[] = { &mode_msgtab, &tmode_msgtab, &mlock_msgtab, &bmask_msgtab, NULL }; -static const char mode_desc[] = - "Provides the MODE and MLOCK client and server commands, and TS6 server-to-server TMODE and BMASK commands"; DECLARE_MODULE_AV2(mode, NULL, NULL, mode_clist, NULL, NULL, NULL, NULL, mode_desc); diff --git a/modules/core/m_part.c b/modules/core/m_part.c index 73e7277c..5c722fc5 100644 --- a/modules/core/m_part.c +++ b/modules/core/m_part.c @@ -40,9 +40,10 @@ #include "inline/stringops.h" #include "hook.h" -static int m_part(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static const char part_desc[] = "Provides the PART command to leave a channel"; +static int m_part(struct MsgBuf *, struct Client *, struct Client *, int, const char **); + struct Message part_msgtab = { "PART", 0, 0, 0, 0, {mg_unreg, {m_part, 2}, {m_part, 2}, mg_ignore, mg_ignore, {m_part, 2}} diff --git a/modules/core/m_quit.c b/modules/core/m_quit.c index 4c769129..e273ce61 100644 --- a/modules/core/m_quit.c +++ b/modules/core/m_quit.c @@ -34,9 +34,10 @@ #include "s_conf.h" #include "inline/stringops.h" +static const char quit_desc[] = "Provides the QUIT command to allow a user to leave the network"; + static int m_quit(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int ms_quit(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -static const char quit_desc[] = "Provides the QUIT command to allow a user to leave the network"; struct Message quit_msgtab = { "QUIT", 0, 0, 0, 0, diff --git a/modules/core/m_server.c b/modules/core/m_server.c index 50cb8651..ba6c4c90 100644 --- a/modules/core/m_server.c +++ b/modules/core/m_server.c @@ -40,12 +40,12 @@ #include "parse.h" #include "modules.h" -static int mr_server(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -static int ms_server(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -static int ms_sid(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static const char server_desc[] = "Provides the TS6 commands to introduce a new server to the network"; +static int mr_server(struct MsgBuf *, struct Client *, struct Client *, int, const char **); +static int ms_server(struct MsgBuf *, struct Client *, struct Client *, int, const char **); +static int ms_sid(struct MsgBuf *, struct Client *, struct Client *, int, const char **); struct Message server_msgtab = { "SERVER", 0, 0, 0, 0, {{mr_server, 4}, mg_reg, mg_ignore, {ms_server, 4}, mg_ignore, mg_reg} diff --git a/modules/core/m_squit.c b/modules/core/m_squit.c index f85adba3..82036db4 100644 --- a/modules/core/m_squit.c +++ b/modules/core/m_squit.c @@ -38,9 +38,10 @@ #include "hash.h" #include "s_newconf.h" +static const char squit_desc[] = "Provides the SQUIT command to cause a server to quit"; + static int ms_squit(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int mo_squit(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -static const char squit_desc[] = "Provides the SQUIT command to cause a server to quit"; struct Message squit_msgtab = { "SQUIT", 0, 0, 0, 0, diff --git a/modules/m_accept.c b/modules/m_accept.c index 835b7ea0..95932aee 100644 --- a/modules/m_accept.c +++ b/modules/m_accept.c @@ -34,6 +34,9 @@ #include "parse.h" #include "modules.h" +static const char accept_desc[] = + "Provides the ACCEPT command for use with Caller ID/user mode +g"; + static int m_accept(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static void build_nicklist(struct Client *, char *, char *, const char *); @@ -48,8 +51,6 @@ struct Message accept_msgtab = { mapi_clist_av1 accept_clist[] = { &accept_msgtab, NULL }; -static const char accept_desc[] = - "Provides the ACCEPT command for use with Caller ID/user mode +g"; DECLARE_MODULE_AV2(accept, NULL, NULL, accept_clist, NULL, NULL, NULL, NULL, accept_desc); diff --git a/modules/m_admin.c b/modules/m_admin.c index 57d363e0..01a98c7f 100644 --- a/modules/m_admin.c +++ b/modules/m_admin.c @@ -34,6 +34,9 @@ #include "hook.h" #include "modules.h" +const char admin_desc[] = + "Provides the ADMIN command to show server administrator information"; + static int m_admin(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int mr_admin(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int ms_admin(struct MsgBuf *, struct Client *, struct Client *, int, const char **); @@ -54,9 +57,6 @@ mapi_hlist_av1 admin_hlist[] = { { NULL, NULL } }; -const char admin_desc[] = - "Provides the ADMIN command to show server administrator information"; - DECLARE_MODULE_AV2(admin, NULL, NULL, admin_clist, admin_hlist, NULL, NULL, NULL, admin_desc); /* diff --git a/modules/m_away.c b/modules/m_away.c index 059e5b48..80bbc55e 100644 --- a/modules/m_away.c +++ b/modules/m_away.c @@ -35,6 +35,8 @@ #include "s_serv.h" #include "packet.h" +static const char away_desc[] = "Provides the AWAY command to set yourself away"; + static int m_away(struct MsgBuf *, struct Client *, struct Client *, int, const char **); struct Message away_msgtab = { @@ -44,8 +46,6 @@ struct Message away_msgtab = { mapi_clist_av1 away_clist[] = { &away_msgtab, NULL }; -static const char away_desc[] = "Provides the AWAY command to set yourself away"; - DECLARE_MODULE_AV2(away, NULL, NULL, away_clist, NULL, NULL, NULL, NULL, away_desc); /*********************************************************************** diff --git a/modules/m_cap.c b/modules/m_cap.c index d74e3812..5348ba19 100644 --- a/modules/m_cap.c +++ b/modules/m_cap.c @@ -44,6 +44,8 @@ #include "s_conf.h" #include "hash.h" +static const char cap_desc[] = "Provides the commands used for client capability negotiation"; + typedef int (*bqcmp)(const void *, const void *); static int m_cap(struct MsgBuf *, struct Client *, struct Client *, int, const char **); @@ -55,8 +57,6 @@ struct Message cap_msgtab = { mapi_clist_av1 cap_clist[] = { &cap_msgtab, NULL }; -static const char cap_desc[] = "Provides the commands used for client capability negotiation"; - DECLARE_MODULE_AV2(cap, NULL, NULL, cap_clist, NULL, NULL, NULL, NULL, cap_desc); #define IsCapableEntry(c, e) IsCapable(c, 1 << (e)->value) diff --git a/modules/m_capab.c b/modules/m_capab.c index e40eb98d..854851d1 100644 --- a/modules/m_capab.c +++ b/modules/m_capab.c @@ -31,6 +31,8 @@ #include "parse.h" #include "modules.h" +static const char capab_desc[] = "Provides the commands used for server-to-server capability negotiation"; + static int mr_capab(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int me_gcap(struct MsgBuf *, struct Client *, struct Client *, int, const char **); @@ -45,8 +47,6 @@ struct Message gcap_msgtab = { mapi_clist_av1 capab_clist[] = { &capab_msgtab, &gcap_msgtab, NULL }; -static const char capab_desc[] = "Provides the commands used for server-to-server capability negotiation"; - DECLARE_MODULE_AV2(capab, NULL, NULL, capab_clist, NULL, NULL, NULL, NULL, capab_desc); /* diff --git a/modules/m_certfp.c b/modules/m_certfp.c index 1175489f..22ab3a1b 100644 --- a/modules/m_certfp.c +++ b/modules/m_certfp.c @@ -38,6 +38,9 @@ #include "msg.h" #include "modules.h" +static const char certfp_desc[] = + "Provides the CERTFP facility used by servers to set certificate fingerprints"; + static int me_certfp(struct MsgBuf *, struct Client *, struct Client *, int, const char **); struct Message certfp_msgtab = { @@ -47,9 +50,6 @@ struct Message certfp_msgtab = { mapi_clist_av1 certfp_clist[] = { &certfp_msgtab, NULL }; -static const char certfp_desc[] = - "Provides the CERTFP facility used by servers to set certificate fingerprints"; - DECLARE_MODULE_AV2(certfp, NULL, NULL, certfp_clist, NULL, NULL, NULL, NULL, certfp_desc); /* diff --git a/modules/m_challenge.c b/modules/m_challenge.c index 51b4fa4e..c01acec5 100644 --- a/modules/m_challenge.c +++ b/modules/m_challenge.c @@ -53,25 +53,25 @@ #define CHALLENGE_SECRET_LENGTH 128 /* how long our challenge secret should be */ #ifndef HAVE_LIBCRYPTO + +static const char challenge_desc[] = "Does nothing as OpenSSL was not enabled."; + /* Maybe this should be an error or something?-davidt */ /* now it is -larne */ -static int challenge_load(void) +static int challenge_load(void) { -#ifndef STATIC_MODULES sendto_realops_snomask(SNO_GENERAL, L_ALL, "Challenge module not loaded because OpenSSL is not available."); ilog(L_MAIN, "Challenge module not loaded because OpenSSL is not available."); return -1; -#else - return 0; -#endif } -static const char challenge_desc[] = "Does nothing as OpenSSL was not enabled."; - DECLARE_MODULE_AV2(challenge, challenge_load, NULL, NULL, NULL, NULL, NULL, NULL, challenge_desc); #else +static const char challenge_desc[] = + "Provides the challenge-response facility used for becoming an IRC operator"; + static int m_challenge(struct MsgBuf *, struct Client *, struct Client *, int, const char **); /* We have openssl support, so include /CHALLENGE */ @@ -82,10 +82,6 @@ struct Message challenge_msgtab = { mapi_clist_av1 challenge_clist[] = { &challenge_msgtab, NULL }; -static const char challenge_desc[] = - "Provides the challenge-response facility used for becoming an IRC operator"; - - DECLARE_MODULE_AV2(challenge, NULL, NULL, challenge_clist, NULL, NULL, NULL, NULL, challenge_desc); static int generate_challenge(char **r_challenge, char **r_response, RSA * key); diff --git a/modules/m_chghost.c b/modules/m_chghost.c index ee1ad296..ba8f1ab7 100644 --- a/modules/m_chghost.c +++ b/modules/m_chghost.c @@ -28,6 +28,8 @@ #include "whowas.h" #include "monitor.h" +static const char chghost_desc[] = "Provides commands used to change and retrieve client hostnames"; + static int me_realhost(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int ms_chghost(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int me_chghost(struct MsgBuf *, struct Client *, struct Client *, int, const char **); @@ -45,8 +47,6 @@ struct Message chghost_msgtab = { mapi_clist_av1 chghost_clist[] = { &chghost_msgtab, &realhost_msgtab, NULL }; -static const char chghost_desc[] = "Provides commands used to change and retrieve client hostnames"; - DECLARE_MODULE_AV2(chghost, NULL, NULL, chghost_clist, NULL, NULL, NULL, NULL, chghost_desc); /* clean_host() diff --git a/modules/m_close.c b/modules/m_close.c index 15934e10..c5863eaa 100644 --- a/modules/m_close.c +++ b/modules/m_close.c @@ -31,6 +31,8 @@ #include "parse.h" #include "modules.h" +static const char close_desc[] = "Provides the CLOSE command to clear all unfinished connections"; + static int mo_close(struct MsgBuf *, struct Client *, struct Client *, int, const char **); struct Message close_msgtab = { @@ -40,8 +42,6 @@ struct Message close_msgtab = { mapi_clist_av1 close_clist[] = { &close_msgtab, NULL }; -static const char close_desc[] = "Provides the CLOSE command to clear all unfinished connections"; - DECLARE_MODULE_AV2(close, NULL, NULL, close_clist, NULL, NULL, NULL, NULL, close_desc); /* diff --git a/modules/m_cmessage.c b/modules/m_cmessage.c index 37ad0813..220e8334 100644 --- a/modules/m_cmessage.c +++ b/modules/m_cmessage.c @@ -42,6 +42,9 @@ #include "packet.h" #include "supported.h" +static const char cmessage_desc[] = + "Provides the CPRIVMSG and CNOTICE facilities for bypassing anti-spam measures"; + static int m_cmessage(int, const char *, struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int m_cprivmsg(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int m_cnotice(struct MsgBuf *, struct Client *, struct Client *, int, const char **); @@ -73,9 +76,6 @@ struct Message cnotice_msgtab = { mapi_clist_av1 cmessage_clist[] = { &cprivmsg_msgtab, &cnotice_msgtab, NULL }; -static const char cmessage_desc[] = - "Provides the CPRIVMSG and CNOTICE facilities for bypassing anti-spam measures"; - DECLARE_MODULE_AV2(cmessage, _modinit, _moddeinit, cmessage_clist, NULL, NULL, NULL, NULL, cmessage_desc); #define PRIVMSG 0 diff --git a/modules/m_connect.c b/modules/m_connect.c index 32c3b1be..b6c802ed 100644 --- a/modules/m_connect.c +++ b/modules/m_connect.c @@ -38,6 +38,9 @@ #include "modules.h" #include "sslproc.h" +static const char connect_desc[] = + "Provides the CONNECT command to introduce servers to the network"; + static int mo_connect(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int ms_connect(struct MsgBuf *, struct Client *, struct Client *, int, const char **); @@ -48,9 +51,6 @@ struct Message connect_msgtab = { mapi_clist_av1 connect_clist[] = { &connect_msgtab, NULL }; -static const char connect_desc[] = - "Provides the CONNECT command to introduce servers to the network"; - DECLARE_MODULE_AV2(connect, NULL, NULL, connect_clist, NULL, NULL, NULL, NULL, connect_desc); /* diff --git a/modules/m_dline.c b/modules/m_dline.c index 4d60a0df..d0d91170 100644 --- a/modules/m_dline.c +++ b/modules/m_dline.c @@ -43,6 +43,8 @@ #include "bandbi.h" #include "operhash.h" +static const char dline_desc[] = "Provides the DLINE facility to ban users via IP address"; + static int mo_dline(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int me_dline(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int mo_undline(struct MsgBuf *, struct Client *, struct Client *, int, const char **); diff --git a/modules/m_encap.c b/modules/m_encap.c index 27c30c8e..531b7957 100644 --- a/modules/m_encap.c +++ b/modules/m_encap.c @@ -41,8 +41,10 @@ #include "parse.h" #include "modules.h" +static const char encap_desc[] = "Provides the TS6 ENCAP facility"; + static int ms_encap(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, - int parc, const char *parv[]); + int parc, const char *parv[]); struct Message encap_msgtab = { "ENCAP", 0, 0, 0, 0, @@ -51,8 +53,6 @@ struct Message encap_msgtab = { mapi_clist_av1 encap_clist[] = { &encap_msgtab, NULL }; -static const char encap_desc[] = "Provides the TS6 ENCAP facility"; - DECLARE_MODULE_AV2(encap, NULL, NULL, encap_clist, NULL, NULL, NULL, NULL, encap_desc); /* ms_encap() diff --git a/modules/m_etrace.c b/modules/m_etrace.c index d7c9049f..b53878bc 100644 --- a/modules/m_etrace.c +++ b/modules/m_etrace.c @@ -50,6 +50,9 @@ #include "logger.h" #include "supported.h" +static const char etrace_desc[] = + "Provides enhanced tracing facilities to opers (ETRACE, CHANTRACE, and MASKTRACE)"; + static int mo_etrace(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int me_etrace(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int m_chantrace(struct MsgBuf *, struct Client *, struct Client *, int, const char **); @@ -84,9 +87,6 @@ _moddeinit(void) mapi_clist_av1 etrace_clist[] = { &etrace_msgtab, &chantrace_msgtab, &masktrace_msgtab, NULL }; -static const char etrace_desc[] = - "Provides enhanced tracing facilities to opers (ETRACE, CHANTRACE, and MASKTRACE)"; - DECLARE_MODULE_AV2(etrace, _modinit, _moddeinit, etrace_clist, NULL, NULL, NULL, NULL, etrace_desc); static void do_etrace(struct Client *source_p, int ipv4, int ipv6); diff --git a/modules/m_grant.c b/modules/m_grant.c index 1d799899..7dd14827 100644 --- a/modules/m_grant.c +++ b/modules/m_grant.c @@ -14,6 +14,9 @@ #include "s_conf.h" #include "s_newconf.h" +static const char grant_desc[] = + "Provides the grant facility for giving other users specific privilege sets"; + static int mo_grant(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); static int me_grant(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); @@ -26,9 +29,6 @@ struct Message grant_msgtab = { mapi_clist_av1 grant_clist[] = { &grant_msgtab, NULL }; -static const char grant_desc[] = - "Provides the grant facility for giving other users specific privilege sets"; - DECLARE_MODULE_AV2(grant, NULL, NULL, grant_clist, NULL, NULL, NULL, NULL, grant_desc); static int diff --git a/modules/m_help.c b/modules/m_help.c index 8dceed5b..f3dea073 100644 --- a/modules/m_help.c +++ b/modules/m_help.c @@ -36,6 +36,9 @@ #include "cache.h" #include "rb_dictionary.h" +static const char help_desc[] = + "Provides the help facility for commands, modes, and server concepts"; + static int m_help(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int mo_help(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int mo_uhelp(struct MsgBuf *, struct Client *, struct Client *, int, const char **); @@ -52,9 +55,6 @@ struct Message uhelp_msgtab = { mapi_clist_av1 help_clist[] = { &help_msgtab, &uhelp_msgtab, NULL }; -static const char help_desc[] = - "Provides the help facility for commands, modes, and server concepts"; - DECLARE_MODULE_AV2(help, NULL, NULL, help_clist, NULL, NULL, NULL, NULL, help_desc); /* diff --git a/modules/m_info.c b/modules/m_info.c index 1c636025..8660044b 100644 --- a/modules/m_info.c +++ b/modules/m_info.c @@ -39,6 +39,9 @@ #include "parse.h" #include "modules.h" +static const char info_desc[] = + "Provides the INFO command for retrieving server copyright, credits, and other info"; + static void send_conf_options(struct Client *source_p); static void send_birthdate_online_time(struct Client *source_p); static void send_info_text(struct Client *source_p); @@ -60,9 +63,6 @@ mapi_hlist_av1 info_hlist[] = { { NULL, NULL } }; -static const char info_desc[] = - "Provides the INFO command for retrieving server copyright, credits, and other info"; - DECLARE_MODULE_AV2(info, NULL, NULL, info_clist, info_hlist, NULL, NULL, NULL, info_desc); /* diff --git a/modules/m_invite.c b/modules/m_invite.c index 27e7c004..ec4a40ef 100644 --- a/modules/m_invite.c +++ b/modules/m_invite.c @@ -39,9 +39,10 @@ #include "packet.h" #include "tgchange.h" +static const char invite_desc[] = "Provides facilities for invite and related notifications"; + static int m_invite(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static unsigned int CAP_INVITE_NOTIFY = 0; -static const char invite_desc[] = "Provides facilities for invite and related notifications"; struct Message invite_msgtab = { "INVITE", 0, 0, 0, 0, diff --git a/modules/m_ison.c b/modules/m_ison.c index bb545cfd..43c18008 100644 --- a/modules/m_ison.c +++ b/modules/m_ison.c @@ -37,6 +37,8 @@ #include +static const char ison_desc[] = "Provides the ISON command to check if a set of users is online"; + static int m_ison(struct MsgBuf *, struct Client *, struct Client *, int, const char **); struct Message ison_msgtab = { @@ -46,8 +48,6 @@ struct Message ison_msgtab = { mapi_clist_av1 ison_clist[] = { &ison_msgtab, NULL }; -static const char ison_desc[] = "Provides the ISON command to check if a set of users is online"; - DECLARE_MODULE_AV2(ison, NULL, NULL, ison_clist, NULL, NULL, NULL, NULL, ison_desc); static char buf[BUFSIZE]; diff --git a/modules/m_kline.c b/modules/m_kline.c index 7a2273c5..8bbfb084 100644 --- a/modules/m_kline.c +++ b/modules/m_kline.c @@ -44,6 +44,8 @@ #include "bandbi.h" #include "operhash.h" +static const char kline_desc[] = "Provides the KLINE facility to ban users via hostmask"; + static int mo_kline(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int ms_kline(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int me_kline(struct MsgBuf *, struct Client *, struct Client *, int, const char **); @@ -63,8 +65,6 @@ struct Message unkline_msgtab = { mapi_clist_av1 kline_clist[] = { &kline_msgtab, &unkline_msgtab, NULL }; -static const char kline_desc[] = "Provides the KLINE facility to ban users via hostmask"; - DECLARE_MODULE_AV2(kline, NULL, NULL, kline_clist, NULL, NULL, NULL, NULL, kline_desc); /* Local function prototypes */ diff --git a/modules/m_knock.c b/modules/m_knock.c index 58438c90..5cc994d5 100644 --- a/modules/m_knock.c +++ b/modules/m_knock.c @@ -36,6 +36,8 @@ #include "s_serv.h" #include "supported.h" +static const char knock_desc[] = "Provides the KNOCK command to ask for an invite to an invite-only channel"; + static int m_knock(struct MsgBuf *, struct Client *, struct Client *, int, const char **); struct Message knock_msgtab = { @@ -58,8 +60,6 @@ _moddeinit(void) mapi_clist_av1 knock_clist[] = { &knock_msgtab, NULL }; -static const char knock_desc[] = "Provides the KNOCK command to ask for an invite to an invite-only channel"; - DECLARE_MODULE_AV2(knock, _modinit, _moddeinit, knock_clist, NULL, NULL, NULL, NULL, knock_desc); /* m_knock diff --git a/modules/m_links.c b/modules/m_links.c index 4366ed80..dd5a027d 100644 --- a/modules/m_links.c +++ b/modules/m_links.c @@ -37,6 +37,9 @@ #include "scache.h" #include "s_assert.h" +static const char links_desc[] = + "Provides the LINKS command to view servers linked to the host server"; + static int m_links(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int mo_links(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static char * clean_string(char *dest, const unsigned char *src, size_t len); @@ -54,9 +57,6 @@ mapi_hlist_av1 links_hlist[] = { { NULL, NULL } }; -static const char links_desc[] = - "Provides the LINKS command to view servers linked to the host server"; - DECLARE_MODULE_AV2(links, NULL, NULL, links_clist, links_hlist, NULL, NULL, NULL, links_desc); /* diff --git a/modules/m_list.c b/modules/m_list.c index 3f2d44dc..2c197552 100644 --- a/modules/m_list.c +++ b/modules/m_list.c @@ -51,6 +51,8 @@ #include "logger.h" #include "rb_radixtree.h" +static const char list_desc[] = "Provides the LIST command to clients to view non-hidden channels"; + static rb_dlink_list safelisting_clients = { NULL, NULL, 0 }; static int _modinit(void); @@ -81,8 +83,6 @@ mapi_hfn_list_av1 list_hfnlist[] = { {NULL, NULL} }; -static const char list_desc[] = "Provides the LIST command to clients to view non-hidden channels"; - DECLARE_MODULE_AV2(list, _modinit, _moddeinit, list_clist, NULL, list_hfnlist, NULL, NULL, list_desc); static struct ev_entry *iterate_clients_ev = NULL; diff --git a/modules/m_locops.c b/modules/m_locops.c index abd44049..981d2f99 100644 --- a/modules/m_locops.c +++ b/modules/m_locops.c @@ -37,6 +37,9 @@ #include "modules.h" #include "s_serv.h" +static const char locops_desc[] = + "Provides the LOCOPS command to send a message to all local operators"; + static int m_locops(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int ms_locops(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int me_locops(struct MsgBuf *, struct Client *, struct Client *, int, const char **); @@ -48,9 +51,6 @@ struct Message locops_msgtab = { mapi_clist_av1 locops_clist[] = { &locops_msgtab, NULL }; -static const char locops_desc[] = - "Provides the LOCOPS command to send a message to all local operators"; - DECLARE_MODULE_AV2(locops, NULL, NULL, locops_clist, NULL, NULL, NULL, NULL, locops_desc); /* diff --git a/modules/m_lusers.c b/modules/m_lusers.c index d88dc783..98e8d3b5 100644 --- a/modules/m_lusers.c +++ b/modules/m_lusers.c @@ -34,6 +34,9 @@ #include "parse.h" #include "modules.h" +static const char lusers_desc[] = + "Provides the LUSERS command to view the number of current and maximum lusers on a server"; + static int m_lusers(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int ms_lusers(struct MsgBuf *, struct Client *, struct Client *, int, const char **); @@ -44,9 +47,6 @@ struct Message lusers_msgtab = { mapi_clist_av1 lusers_clist[] = { &lusers_msgtab, NULL }; -static const char lusers_desc[] = - "Provides the LUSERS command to view the number of current and maximum lusers on a server"; - DECLARE_MODULE_AV2(lusers, NULL, NULL, lusers_clist, NULL, NULL, NULL, NULL, lusers_desc); /* diff --git a/modules/m_map.c b/modules/m_map.c index cb9d1e8e..da2b6a7b 100644 --- a/modules/m_map.c +++ b/modules/m_map.c @@ -30,6 +30,8 @@ #define USER_COL 50 /* display | Users: %d at col 50 */ +static const char map_desc[] = "Provides the MAP command to view network topology information"; + static int m_map(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); static int mo_map(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); @@ -40,8 +42,6 @@ struct Message map_msgtab = { mapi_clist_av1 map_clist[] = { &map_msgtab, NULL }; -static const char map_desc[] = "Provides the MAP command to view network topology information"; - DECLARE_MODULE_AV2(map, NULL, NULL, map_clist, NULL, NULL, NULL, NULL, map_desc); static void dump_map(struct Client *client_p, struct Client *root, char *pbuf); diff --git a/modules/m_monitor.c b/modules/m_monitor.c index d7ec2abd..5cedbb20 100644 --- a/modules/m_monitor.c +++ b/modules/m_monitor.c @@ -39,6 +39,8 @@ #include "send.h" #include "supported.h" +static const char monitor_desc[] = "Provides the MONITOR facility for tracking user signon and signoff"; + static int monitor_init(void); static void monitor_deinit(void); static int m_monitor(struct MsgBuf *, struct Client *, struct Client *, int, const char **); @@ -50,8 +52,6 @@ struct Message monitor_msgtab = { mapi_clist_av1 monitor_clist[] = { &monitor_msgtab, NULL }; -static const char monitor_desc[] = "Provides the MONITOR facility for tracking user signon and signoff"; - DECLARE_MODULE_AV2(monitor, monitor_init, monitor_deinit, monitor_clist, NULL, NULL, NULL, NULL, monitor_desc); static int monitor_init(void) diff --git a/modules/m_motd.c b/modules/m_motd.c index 873825b7..b0299bdf 100644 --- a/modules/m_motd.c +++ b/modules/m_motd.c @@ -36,6 +36,8 @@ #include "cache.h" #include "ratelimit.h" +static const char motd_desc[] = "Provides the MOTD command to view the Message of the Day"; + static int m_motd(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int mo_motd(struct MsgBuf *, struct Client *, struct Client *, int, const char **); @@ -52,8 +54,6 @@ mapi_hlist_av1 motd_hlist[] = { { NULL, NULL } }; -static const char motd_desc[] = "Provides the MOTD command to view the Message of the Day"; - DECLARE_MODULE_AV2(motd, NULL, NULL, motd_clist, motd_hlist, NULL, NULL, NULL, motd_desc); static void motd_spy(struct Client *); diff --git a/modules/m_names.c b/modules/m_names.c index 766fac03..c18ecf8d 100644 --- a/modules/m_names.c +++ b/modules/m_names.c @@ -37,6 +37,8 @@ #include "parse.h" #include "modules.h" +static const char names_desc[] = "Provides the NAMES command to view users on a channel"; + static int m_names(struct MsgBuf *, struct Client *, struct Client *, int, const char **); struct Message names_msgtab = { @@ -46,8 +48,6 @@ struct Message names_msgtab = { mapi_clist_av1 names_clist[] = { &names_msgtab, NULL }; -static const char names_desc[] = "Provides the NAMES command to view users on a channel"; - DECLARE_MODULE_AV2(names, NULL, NULL, names_clist, NULL, NULL, NULL, NULL, names_desc); static void names_global(struct Client *source_p); diff --git a/modules/m_oper.c b/modules/m_oper.c index 9ec15a5e..0e3b652c 100644 --- a/modules/m_oper.c +++ b/modules/m_oper.c @@ -39,6 +39,8 @@ #include "packet.h" #include "cache.h" +static const char oper_desc[] = "Provides the OPER command to become an IRC operator"; + static int m_oper(struct MsgBuf *, struct Client *, struct Client *, int, const char **); struct Message oper_msgtab = { @@ -48,8 +50,6 @@ struct Message oper_msgtab = { mapi_clist_av1 oper_clist[] = { &oper_msgtab, NULL }; -static const char oper_desc[] = "Provides the OPER command to become an IRC operator"; - DECLARE_MODULE_AV2(oper, NULL, NULL, oper_clist, NULL, NULL, NULL, NULL, oper_desc); static int match_oper_password(const char *password, struct oper_conf *oper_p); diff --git a/modules/m_operspy.c b/modules/m_operspy.c index 3158ead8..f88a6ebb 100644 --- a/modules/m_operspy.c +++ b/modules/m_operspy.c @@ -42,8 +42,11 @@ #include "modules.h" #include "logger.h" +static const char operspy_desc[] = + "Provides the operspy facility for viewing normally private data"; + static int ms_operspy(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, - int parc, const char *parv[]); + int parc, const char *parv[]); struct Message operspy_msgtab = { "OPERSPY", 0, 0, 0, 0, @@ -52,9 +55,6 @@ struct Message operspy_msgtab = { mapi_clist_av1 operspy_clist[] = { &operspy_msgtab, NULL }; -static const char operspy_desc[] = - "Provides the operspy facility for viewing normally private data"; - DECLARE_MODULE_AV2(operspy, NULL, NULL, operspy_clist, NULL, NULL, NULL, NULL, operspy_desc); /* ms_operspy() diff --git a/modules/m_pass.c b/modules/m_pass.c index ad25522b..18e17a57 100644 --- a/modules/m_pass.c +++ b/modules/m_pass.c @@ -35,15 +35,17 @@ #include "hash.h" #include "s_conf.h" -static int mr_pass(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static const char pass_desc[] = "Provides the PASS command to authenticate clients and servers"; +static int mr_pass(struct MsgBuf *, struct Client *, struct Client *, int, const char **); + struct Message pass_msgtab = { "PASS", 0, 0, 0, 0, {{mr_pass, 2}, mg_reg, mg_ignore, mg_ignore, mg_ignore, mg_reg} }; mapi_clist_av1 pass_clist[] = { &pass_msgtab, NULL }; + DECLARE_MODULE_AV2(pass, NULL, NULL, pass_clist, NULL, NULL, NULL, NULL, pass_desc); /* diff --git a/modules/m_ping.c b/modules/m_ping.c index e9063271..93e7cda7 100644 --- a/modules/m_ping.c +++ b/modules/m_ping.c @@ -35,17 +35,19 @@ #include "s_conf.h" #include "s_serv.h" -static int m_ping(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -static int ms_ping(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static const char ping_desc[] = "Provides the PING command to ensure a client or server is still alive"; +static int m_ping(struct MsgBuf *, struct Client *, struct Client *, int, const char **); +static int ms_ping(struct MsgBuf *, struct Client *, struct Client *, int, const char **); + struct Message ping_msgtab = { "PING", 0, 0, 0, 0, {mg_unreg, {m_ping, 2}, {ms_ping, 2}, {ms_ping, 2}, mg_ignore, {m_ping, 2}} }; mapi_clist_av1 ping_clist[] = { &ping_msgtab, NULL }; + DECLARE_MODULE_AV2(ping, NULL, NULL, ping_clist, NULL, NULL, NULL, NULL, ping_desc); /* diff --git a/modules/m_pong.c b/modules/m_pong.c index 3c2b244b..28b6db02 100644 --- a/modules/m_pong.c +++ b/modules/m_pong.c @@ -38,9 +38,10 @@ #include "hash.h" #include "modules.h" +static const char pong_desc[] = "Provides the PONG command to respond to a PING message"; + static int mr_pong(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int ms_pong(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -static const char pong_desc[] = "Provides the PONG command to respond to a PING message"; struct Message pong_msgtab = { "PONG", 0, 0, 0, 0, @@ -48,6 +49,7 @@ struct Message pong_msgtab = { }; mapi_clist_av1 pong_clist[] = { &pong_msgtab, NULL }; + DECLARE_MODULE_AV2(pong, NULL, NULL, pong_clist, NULL, NULL, NULL, NULL, pong_desc); static int diff --git a/modules/m_post.c b/modules/m_post.c index d3923c4c..57fa2526 100644 --- a/modules/m_post.c +++ b/modules/m_post.c @@ -33,10 +33,11 @@ #include "modules.h" #include "s_conf.h" -static int mr_dumb_proxy(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static const char post_desc[] = "Ensure Web forms/proxies cannot connect by disconnecting on POST, GET, and PUT"; +static int mr_dumb_proxy(struct MsgBuf *, struct Client *, struct Client *, int, const char **); + struct Message post_msgtab = { "POST", 0, 0, 0, 0, {{mr_dumb_proxy, 0}, mg_ignore, mg_ignore, mg_ignore, mg_ignore, mg_ignore} @@ -50,7 +51,6 @@ struct Message put_msgtab = { {{mr_dumb_proxy, 0}, mg_ignore, mg_ignore, mg_ignore, mg_ignore, mg_ignore} }; - mapi_clist_av1 post_clist[] = { &post_msgtab, &get_msgtab, &put_msgtab, NULL }; diff --git a/modules/m_privs.c b/modules/m_privs.c index fca73bf1..0ae1a4e6 100644 --- a/modules/m_privs.c +++ b/modules/m_privs.c @@ -40,10 +40,11 @@ #include "s_conf.h" #include "s_newconf.h" +static const char privs_desc[] = "Provides the PRIVS command to inspect an operator's privileges"; + static int m_privs(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); static int me_privs(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); static int mo_privs(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); -static const char privs_desc[] = "Provides the PRIVS command to inspect an operator's privileges"; struct Message privs_msgtab = { "PRIVS", 0, 0, 0, 0, diff --git a/modules/m_rehash.c b/modules/m_rehash.c index 9d0af3db..21c70715 100644 --- a/modules/m_rehash.c +++ b/modules/m_rehash.c @@ -44,17 +44,19 @@ #include "rb_radixtree.h" #include "sslproc.h" -static int mo_rehash(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -static int me_rehash(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static const char rehash_desc[] = "Provides the REHASH command to reload configuration and other files"; +static int mo_rehash(struct MsgBuf *, struct Client *, struct Client *, int, const char **); +static int me_rehash(struct MsgBuf *, struct Client *, struct Client *, int, const char **); + struct Message rehash_msgtab = { "REHASH", 0, 0, 0, 0, {mg_unreg, mg_not_oper, mg_ignore, mg_ignore, {me_rehash, 0}, {mo_rehash, 0}} }; mapi_clist_av1 rehash_clist[] = { &rehash_msgtab, NULL }; + DECLARE_MODULE_AV2(rehash, NULL, NULL, rehash_clist, NULL, NULL, NULL, NULL, rehash_desc); struct hash_commands diff --git a/modules/m_restart.c b/modules/m_restart.c index 114ee361..1b940b1f 100644 --- a/modules/m_restart.c +++ b/modules/m_restart.c @@ -38,10 +38,11 @@ #include "modules.h" #include "hash.h" +static const char restart_desc[] = "Provides the RESTART command to restart the server"; + static int mo_restart(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int me_restart(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int do_restart(struct Client *source_p, const char *servername); -static const char restart_desc[] = "Provides the RESTART command to restart the server"; struct Message restart_msgtab = { "RESTART", 0, 0, 0, 0, @@ -49,6 +50,7 @@ struct Message restart_msgtab = { }; mapi_clist_av1 restart_clist[] = { &restart_msgtab, NULL }; + DECLARE_MODULE_AV2(restart, NULL, NULL, restart_clist, NULL, NULL, NULL, NULL, restart_desc); /* diff --git a/modules/m_resv.c b/modules/m_resv.c index 8f010bcf..c89ac6a5 100644 --- a/modules/m_resv.c +++ b/modules/m_resv.c @@ -38,14 +38,15 @@ #include "bandbi.h" #include "operhash.h" +static const char resv_desc[] = + "Provides management of reserved nicknames and channels using (UN)RESV"; + static int mo_resv(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int ms_resv(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int me_resv(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int mo_unresv(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int ms_unresv(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int me_unresv(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -static const char resv_desc[] = - "Provides management of reserved nicknames and channels using (UN)RESV"; struct Message resv_msgtab = { "RESV", 0, 0, 0, 0, diff --git a/modules/m_sasl.c b/modules/m_sasl.c index 5efdf8be..a04fe78a 100644 --- a/modules/m_sasl.c +++ b/modules/m_sasl.c @@ -41,10 +41,11 @@ #include "s_newconf.h" #include "s_conf.h" +static const char sasl_desc[] = "Provides SASL authentication support"; + static int m_authenticate(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int me_sasl(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int me_mechlist(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -static const char sasl_desc[] = "Provides SASL authentication support"; static void abort_sasl(struct Client *); static void abort_sasl_exit(hook_data_client_exit *); diff --git a/modules/m_scan.c b/modules/m_scan.c index db41c3bb..ea8d8dfc 100644 --- a/modules/m_scan.c +++ b/modules/m_scan.c @@ -49,18 +49,19 @@ #include "modules.h" #include "logger.h" -static int mo_scan(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -static int scan_umodes(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -/*static int scan_cmodes(struct MsgBuf *, struct Client *, struct Client *, int, const char **);*/ static const char scan_desc[] = "Provides the SCAN command to show users that have a mode set or cleared"; +static int mo_scan(struct MsgBuf *, struct Client *, struct Client *, int, const char **); +static int scan_umodes(struct MsgBuf *, struct Client *, struct Client *, int, const char **); + struct Message scan_msgtab = { "SCAN", 0, 0, 0, 0, {mg_ignore, mg_not_oper, mg_ignore, mg_ignore, mg_ignore, {mo_scan, 2}} }; mapi_clist_av1 scan_clist[] = { &scan_msgtab, NULL }; + DECLARE_MODULE_AV2(scan, NULL, NULL, scan_clist, NULL, NULL, NULL, NULL, scan_desc); typedef int (*scan_handler)(struct MsgBuf *, struct Client *, struct Client *, int, diff --git a/modules/m_services.c b/modules/m_services.c index 01d21be8..a36c06a4 100644 --- a/modules/m_services.c +++ b/modules/m_services.c @@ -47,6 +47,8 @@ #include "monitor.h" #include "supported.h" +static const char services_desc[] = "Provides support for running a services daemon"; + static int _modinit(void); static void _moddeinit(void); @@ -58,8 +60,6 @@ static int me_login(struct MsgBuf *, struct Client *, struct Client *, int, cons static int me_rsfnc(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int me_nickdelay(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -static const char services_desc[] = "Provides support for running a services daemon"; - static void h_svc_server_introduced(hook_data_client *); static void h_svc_whois(hook_data_client *); static void h_svc_stats(hook_data_int *); diff --git a/modules/m_set.c b/modules/m_set.c index ea15259e..766f1956 100644 --- a/modules/m_set.c +++ b/modules/m_set.c @@ -39,9 +39,10 @@ #include "parse.h" #include "modules.h" -static int mo_set(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static const char set_desc[] = "Provides the SET command to change server parameters"; +static int mo_set(struct MsgBuf *, struct Client *, struct Client *, int, const char **); + struct Message set_msgtab = { "SET", 0, 0, 0, 0, {mg_unreg, mg_not_oper, mg_ignore, mg_ignore, mg_ignore, {mo_set, 0}} diff --git a/modules/m_signon.c b/modules/m_signon.c index c933ae66..d24a0656 100644 --- a/modules/m_signon.c +++ b/modules/m_signon.c @@ -49,9 +49,10 @@ #include "match.h" #include "s_user.h" +static const char signon_desc[] = "Provides account login/logout support for services"; + static int me_svslogin(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int ms_signon(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -static const char signon_desc[] = "Provides account login/logout support for services"; static void send_signon(struct Client *, struct Client *, const char *, const char *, const char *, unsigned int, const char *); diff --git a/modules/m_snote.c b/modules/m_snote.c index 9d92a00b..26b55811 100644 --- a/modules/m_snote.c +++ b/modules/m_snote.c @@ -48,15 +48,17 @@ #include "parse.h" #include "modules.h" -static int me_snote(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static const char snote_desc[] = "Provides server notices via the SNOTE command"; +static void me_snote(struct MsgBuf *, struct Client *, struct Client *, int, const char **); + struct Message snote_msgtab = { "SNOTE", 0, 0, 0, 0, {mg_ignore, mg_not_oper, mg_ignore, mg_ignore, {me_snote, 3}, mg_ignore} }; mapi_clist_av1 snote_clist[] = { &snote_msgtab, NULL }; + DECLARE_MODULE_AV2(snote, NULL, NULL, snote_clist, NULL, NULL, NULL, NULL, snote_desc); /* diff --git a/modules/m_starttls.c b/modules/m_starttls.c index b1f00a29..bac785ca 100644 --- a/modules/m_starttls.c +++ b/modules/m_starttls.c @@ -33,9 +33,10 @@ #include "s_serv.h" #include "logger.h" -static int mr_starttls(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static const char starttls_desc[] = "Provides the tls CAP and STARTTLS command"; +static int mr_starttls(struct MsgBuf *, struct Client *, struct Client *, int, const char **); + struct Message starttls_msgtab = { "STARTTLS", 0, 0, 0, 0, {{mr_starttls, 0}, mg_ignore, mg_ignore, mg_ignore, mg_ignore, mg_ignore} @@ -51,7 +52,9 @@ mapi_cap_list_av2 starttls_cap_list[] = { { 0, NULL, NULL, NULL } }; #else /* HAVE_LIBCRYPTO */ + mapi_cap_list_av2 starttls_cap_list[] = { { 0, NULL, NULL, NULL } }; + #endif /* HAVE_LIBCRYPTO */ DECLARE_MODULE_AV2(starttls, NULL, NULL, starttls_clist, NULL, NULL, starttls_cap_list, NULL, starttls_desc); diff --git a/modules/m_stats.c b/modules/m_stats.c index b6d8d591..10b2ac4d 100644 --- a/modules/m_stats.c +++ b/modules/m_stats.c @@ -49,10 +49,11 @@ #include "rb_radixtree.h" #include "sslproc.h" -static int m_stats (struct MsgBuf *, struct Client *, struct Client *, int, const char **); static const char stats_desc[] = "Provides the STATS command to inspect various server/network information"; +static int m_stats (struct MsgBuf *, struct Client *, struct Client *, int, const char **); + struct Message stats_msgtab = { "STATS", 0, 0, 0, 0, {mg_unreg, {m_stats, 2}, {m_stats, 3}, mg_ignore, mg_ignore, {m_stats, 2}} diff --git a/modules/m_svinfo.c b/modules/m_svinfo.c index 1264774c..5c8d9e39 100644 --- a/modules/m_svinfo.c +++ b/modules/m_svinfo.c @@ -35,10 +35,10 @@ #include "parse.h" #include "modules.h" -static int ms_svinfo(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static const char svinfo_desc[] = "Provides TS6 SVINFO command to ensure version and clock synchronisation"; +static int ms_svinfo(struct MsgBuf *, struct Client *, struct Client *, int, const char **); struct Message svinfo_msgtab = { "SVINFO", 0, 0, 0, 0, {mg_unreg, mg_ignore, mg_ignore, {ms_svinfo, 5}, mg_ignore, mg_ignore} diff --git a/modules/m_tb.c b/modules/m_tb.c index a66dab6b..62527dbe 100644 --- a/modules/m_tb.c +++ b/modules/m_tb.c @@ -42,11 +42,12 @@ #include "hash.h" #include "s_serv.h" -static int ms_tb(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); -static int ms_etb(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); static const char tb_desc[] = "Provides TS6 TB and ETB commands for topic bursting between servers"; +static int ms_tb(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); +static int ms_etb(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); + struct Message tb_msgtab = { "TB", 0, 0, 0, 0, {mg_unreg, mg_ignore, mg_ignore, {ms_tb, 4}, mg_ignore, mg_ignore} diff --git a/modules/m_testline.c b/modules/m_testline.c index 81358ae4..e2f512e0 100644 --- a/modules/m_testline.c +++ b/modules/m_testline.c @@ -39,9 +39,10 @@ #include "s_newconf.h" #include "reject.h" +static const char testline_desc[] = "Provides the ability to test I/K/D/X lines and RESVs"; + static int mo_testline(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int mo_testgecos(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -static const char testline_desc[] = "Provides the ability to test I/K/D/X lines and RESVs"; struct Message testline_msgtab = { "TESTLINE", 0, 0, 0, 0, @@ -53,6 +54,7 @@ struct Message testgecos_msgtab = { }; mapi_clist_av1 testline_clist[] = { &testline_msgtab, &testgecos_msgtab, NULL }; + DECLARE_MODULE_AV2(testline, NULL, NULL, testline_clist, NULL, NULL, NULL, NULL, testline_desc); static int diff --git a/modules/m_testmask.c b/modules/m_testmask.c index 53102aba..ea8770c8 100644 --- a/modules/m_testmask.c +++ b/modules/m_testmask.c @@ -46,7 +46,7 @@ #include "parse.h" #include "modules.h" -static int mo_testmask(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, +static void mo_testmask(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); static const char testmask_desc[] = "Provides the TESTMASK command to show the number of clients matching a hostmask or GECOS"; diff --git a/modules/m_tginfo.c b/modules/m_tginfo.c index 027b2311..ceac9410 100644 --- a/modules/m_tginfo.c +++ b/modules/m_tginfo.c @@ -39,9 +39,10 @@ #include "modules.h" #include "s_newconf.h" /* add_tgchange */ -static int me_tginfo(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static const char tginfo_desc[] = "Processes target change notifications from other servers"; +static int me_tginfo(struct MsgBuf *, struct Client *, struct Client *, int, const char **); + struct Message tginfo_msgtab = { "TGINFO", 0, 0, 0, 0, {mg_unreg, mg_ignore, mg_ignore, mg_ignore, {me_tginfo, 2}, mg_ignore} diff --git a/modules/m_topic.c b/modules/m_topic.c index cfaa7833..dc30d338 100644 --- a/modules/m_topic.c +++ b/modules/m_topic.c @@ -41,11 +41,12 @@ #include "logger.h" #include "inline/stringops.h" -static int m_topic(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -static int ms_topic(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static const char topic_desc[] = "Provides the TOPIC command to set, remove, and inspect channel topics"; +static int m_topic(struct MsgBuf *, struct Client *, struct Client *, int, const char **); +static int ms_topic(struct MsgBuf *, struct Client *, struct Client *, int, const char **); + struct Message topic_msgtab = { "TOPIC", 0, 0, 0, 0, {mg_unreg, {m_topic, 2}, {m_topic, 2}, {ms_topic, 5}, mg_ignore, {m_topic, 2}} diff --git a/modules/m_trace.c b/modules/m_trace.c index 245577b4..4ba245fe 100644 --- a/modules/m_trace.c +++ b/modules/m_trace.c @@ -40,10 +40,11 @@ #include "parse.h" #include "modules.h" -static int m_trace(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static const char trace_desc[] = "Provides the TRACE command to trace the route to a client or server"; +static int m_trace(struct MsgBuf *, struct Client *, struct Client *, int, const char **); + static void trace_spy(struct Client *, struct Client *); struct Message trace_msgtab = { diff --git a/modules/m_user.c b/modules/m_user.c index 2a6b53fc..f80e2263 100644 --- a/modules/m_user.c +++ b/modules/m_user.c @@ -36,10 +36,11 @@ #include "blacklist.h" #include "s_assert.h" -static int mr_user(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static const char user_desc[] = "Provides the USER command to register a new connection"; +static int mr_user(struct MsgBuf *, struct Client *, struct Client *, int, const char **); + struct Message user_msgtab = { "USER", 0, 0, 0, 0, {{mr_user, 5}, mg_reg, mg_ignore, mg_ignore, mg_ignore, mg_reg} diff --git a/modules/m_userhost.c b/modules/m_userhost.c index e39866fe..f43fb098 100644 --- a/modules/m_userhost.c +++ b/modules/m_userhost.c @@ -34,11 +34,12 @@ #include "modules.h" #include "s_conf.h" +static const char userhost_desc[] = + "Provides the USERHOST command to show a user's host"; + static char buf[BUFSIZE]; static int m_userhost(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -static const char userhost_desc[] = - "Provides the USERHOST command to show a user's host"; struct Message userhost_msgtab = { "USERHOST", 0, 0, 0, 0, @@ -46,6 +47,7 @@ struct Message userhost_msgtab = { }; mapi_clist_av1 userhost_clist[] = { &userhost_msgtab, NULL }; + DECLARE_MODULE_AV2(userhost, NULL, NULL, userhost_clist, NULL, NULL, NULL, NULL, userhost_desc); /* diff --git a/modules/m_users.c b/modules/m_users.c index a38e4f2c..90449f2e 100644 --- a/modules/m_users.c +++ b/modules/m_users.c @@ -33,16 +33,18 @@ #include "parse.h" #include "modules.h" -static int m_users(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static const char users_desc[] = "Provides the USERS command to display connection statistics locally and globally"; +static int m_users(struct MsgBuf *, struct Client *, struct Client *, int, const char **); + struct Message users_msgtab = { "USERS", 0, 0, 0, 0, {mg_unreg, {m_users, 0}, {m_users, 0}, mg_ignore, mg_ignore, {m_users, 0}} }; mapi_clist_av1 users_clist[] = { &users_msgtab, NULL }; + DECLARE_MODULE_AV2(users, NULL, NULL, users_clist, NULL, NULL, NULL, NULL, users_desc); /* diff --git a/modules/m_version.c b/modules/m_version.c index e9e1607b..47cedb81 100644 --- a/modules/m_version.c +++ b/modules/m_version.c @@ -34,12 +34,13 @@ #include "parse.h" #include "modules.h" +static const char version_desc[] = + "Provides the VERSION command to display server version information"; + static char *confopts(void); static int m_version(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int mo_version(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -static const char version_desc[] = - "Provides the VERSION command to display server version information"; struct Message version_msgtab = { "VERSION", 0, 0, 0, 0, @@ -47,6 +48,7 @@ struct Message version_msgtab = { }; mapi_clist_av1 version_clist[] = { &version_msgtab, NULL }; + DECLARE_MODULE_AV2(version, NULL, NULL, version_clist, NULL, NULL, NULL, NULL, version_desc); /* diff --git a/modules/m_wallops.c b/modules/m_wallops.c index 0f551391..95675c72 100644 --- a/modules/m_wallops.c +++ b/modules/m_wallops.c @@ -36,11 +36,12 @@ #include "modules.h" #include "s_serv.h" +static const char wallops_desc[] = + "Provides the WALLOPS and OPERWALL commands to message online operators"; + static int mo_operwall(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int ms_operwall(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int ms_wallops(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -static const char wallops_desc[] = - "Provides the WALLOPS and OPERWALL commands to message online operators"; struct Message wallops_msgtab = { "WALLOPS", 0, 0, 0, 0, @@ -52,6 +53,7 @@ struct Message operwall_msgtab = { }; mapi_clist_av1 wallops_clist[] = { &wallops_msgtab, &operwall_msgtab, NULL }; + DECLARE_MODULE_AV2(wallops, NULL, NULL, wallops_clist, NULL, NULL, NULL, NULL, wallops_desc); /* diff --git a/modules/m_who.c b/modules/m_who.c index 5ea42ba6..5cc1ba8c 100644 --- a/modules/m_who.c +++ b/modules/m_who.c @@ -55,6 +55,9 @@ #define FIELD_ACCOUNT 0x0800 #define FIELD_OPLEVEL 0x1000 /* meaningless and stupid, but whatever */ +static const char who_desc[] = + "Provides the WHO command to display information for users on a channel"; + struct who_format { int fields; @@ -62,8 +65,6 @@ struct who_format }; static int m_who(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -static const char who_desc[] = - "Provides the WHO command to display information for users on a channel"; struct Message who_msgtab = { "WHO", 0, 0, 0, 0, diff --git a/modules/m_whois.c b/modules/m_whois.c index 5afa2c94..15fe6e78 100644 --- a/modules/m_whois.c +++ b/modules/m_whois.c @@ -45,13 +45,14 @@ #include "ratelimit.h" #include "s_assert.h" +static const char whois_desc[] = + "Provides the WHOIS command to display information about a user"; + static void do_whois(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); static void single_whois(struct Client *source_p, struct Client *target_p, int operspy); static int m_whois(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static int ms_whois(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -static const char whois_desc[] = - "Provides the WHOIS command to display information about a user"; struct Message whois_msgtab = { "WHOIS", 0, 0, 0, 0, diff --git a/modules/m_whowas.c b/modules/m_whowas.c index 5739dade..c263861a 100644 --- a/modules/m_whowas.c +++ b/modules/m_whowas.c @@ -39,16 +39,18 @@ #include "parse.h" #include "modules.h" -static int m_whowas(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static const char whowas_desc[] = "Provides the WHOWAS command to display information on a disconnected user"; +static int m_whowas(struct MsgBuf *, struct Client *, struct Client *, int, const char **); + struct Message whowas_msgtab = { "WHOWAS", 0, 0, 0, 0, {mg_unreg, {m_whowas, 2}, {m_whowas, 4}, mg_ignore, mg_ignore, {m_whowas, 2}} }; mapi_clist_av1 whowas_clist[] = { &whowas_msgtab, NULL }; + DECLARE_MODULE_AV2(whowas, NULL, NULL, whowas_clist, NULL, NULL, NULL, NULL, whowas_desc); /* diff --git a/modules/m_xline.c b/modules/m_xline.c index 3b61afd2..c8c9edf3 100644 --- a/modules/m_xline.c +++ b/modules/m_xline.c @@ -51,6 +51,9 @@ #include "bandbi.h" #include "operhash.h" +static const char xline_desc[] = + "Provides management of GECOS bans via (UN)XLINE command"; + static int mo_xline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); static int ms_xline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); static int me_xline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); @@ -60,8 +63,20 @@ static int ms_unxline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct C const char *parv[]); static int me_unxline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); -static const char xline_desc[] = - "Provides management of GECOS bans via (UN)XLINE command"; + +static int valid_xline(struct Client *, const char *, const char *); +static void apply_xline(struct Client *client_p, const char *name, + const char *reason, int temp_time, int propagated); +static void propagate_xline(struct Client *source_p, const char *target, + int temp_time, const char *name, const char *type, const char *reason); +static void cluster_xline(struct Client *source_p, int temp_time, + const char *name, const char *reason); + +static void handle_remote_xline(struct Client *source_p, int temp_time, + const char *name, const char *reason); +static void handle_remote_unxline(struct Client *source_p, const char *name); +static void remove_xline(struct Client *source_p, const char *name, + int propagated); struct Message xline_msgtab = { "XLINE", 0, 0, 0, 0, @@ -77,22 +92,6 @@ mapi_clist_av1 xline_clist[] = { &xline_msgtab, &unxline_msgtab, NULL }; DECLARE_MODULE_AV2(xline, NULL, NULL, xline_clist, NULL, NULL, NULL, NULL, xline_desc); -static int valid_xline(struct Client *, const char *, const char *); -static void apply_xline(struct Client *client_p, const char *name, - const char *reason, int temp_time, int propagated); -static void propagate_xline(struct Client *source_p, const char *target, - int temp_time, const char *name, const char *type, const char *reason); -static void cluster_xline(struct Client *source_p, int temp_time, - const char *name, const char *reason); - -static void handle_remote_xline(struct Client *source_p, int temp_time, - const char *name, const char *reason); -static void handle_remote_unxline(struct Client *source_p, const char *name); - -static void remove_xline(struct Client *source_p, const char *name, - int propagated); - - /* m_xline() * * parv[1] - thing to xline