Move module description headers to the top

This is cleaner.

Note this was broken out of a much larger piece of work I did, so if
there's any problems, I apologise!
This commit is contained in:
Elizabeth Myers 2016-03-09 01:29:41 -06:00
parent 6287d57fa9
commit eeabf33a7c
127 changed files with 400 additions and 342 deletions

View file

@ -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

View file

@ -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,

View file

@ -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) */

View file

@ -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;

View file

@ -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], ',')))

View file

@ -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,

View file

@ -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;

View file

@ -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);

View file

@ -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}}

View file

@ -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,

View file

@ -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}

View file

@ -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,