Clean up duplication in ChannelModeFunc prototypes (#52)
This commit is contained in:
parent
7393690255
commit
92c6e47b4a
6 changed files with 18 additions and 33 deletions
|
@ -14,8 +14,7 @@ static const char chm_operonly_compat[] =
|
||||||
|
|
||||||
static int _modinit(void);
|
static int _modinit(void);
|
||||||
static void _moddeinit(void);
|
static void _moddeinit(void);
|
||||||
static void chm_operonly(struct Client *source_p, struct Channel *chptr,
|
static ChannelModeFunc chm_operonly;
|
||||||
int alevel, const char *arg, int *errors, int dir, char c, long mode_type);
|
|
||||||
|
|
||||||
DECLARE_MODULE_AV2(chm_operonly_compat, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, chm_operonly_compat);
|
DECLARE_MODULE_AV2(chm_operonly_compat, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, chm_operonly_compat);
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,7 @@ static const char chm_quietunreg_compat_desc[] =
|
||||||
|
|
||||||
static int _modinit(void);
|
static int _modinit(void);
|
||||||
static void _moddeinit(void);
|
static void _moddeinit(void);
|
||||||
static void chm_quietunreg(struct Client *source_p, struct Channel *chptr,
|
static ChannelModeFunc chm_quietunreg;
|
||||||
int alevel, const char *arg, int *errors, int dir, char c, long mode_type);
|
|
||||||
|
|
||||||
DECLARE_MODULE_AV2(chm_quietunreg_compat, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, chm_quietunreg_compat_desc);
|
DECLARE_MODULE_AV2(chm_quietunreg_compat, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, chm_quietunreg_compat_desc);
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,7 @@ static const char chm_sslonly_compat_desc[] =
|
||||||
|
|
||||||
static int _modinit(void);
|
static int _modinit(void);
|
||||||
static void _moddeinit(void);
|
static void _moddeinit(void);
|
||||||
static void chm_sslonly(struct Client *source_p, struct Channel *chptr,
|
static ChannelModeFunc chm_sslonly;
|
||||||
int alevel, const char *arg, int *errors, int dir, char c, long mode_type);
|
|
||||||
|
|
||||||
DECLARE_MODULE_AV2(chm_sslonly_compat, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, chm_sslonly_compat_desc);
|
DECLARE_MODULE_AV2(chm_sslonly_compat, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, chm_sslonly_compat_desc);
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,7 @@ struct ChModeChange
|
||||||
int mems;
|
int mems;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef void (*ChannelModeFunc)(struct Client *source_p, struct Channel *chptr,
|
typedef void ChannelModeFunc(struct Client *source_p, struct Channel *chptr,
|
||||||
int alevel, const char *arg, int *errors, int dir, char c, long mode_type);
|
int alevel, const char *arg, int *errors, int dir, char c, long mode_type);
|
||||||
|
|
||||||
enum chm_flags
|
enum chm_flags
|
||||||
|
@ -136,7 +136,7 @@ enum chm_flags
|
||||||
|
|
||||||
struct ChannelMode
|
struct ChannelMode
|
||||||
{
|
{
|
||||||
ChannelModeFunc set_func;
|
ChannelModeFunc *set_func;
|
||||||
long mode_type;
|
long mode_type;
|
||||||
enum chm_flags flags;
|
enum chm_flags flags;
|
||||||
};
|
};
|
||||||
|
|
|
@ -34,30 +34,18 @@
|
||||||
|
|
||||||
extern int chmode_flags[256];
|
extern int chmode_flags[256];
|
||||||
|
|
||||||
extern void chm_nosuch(struct Client *source_p, struct Channel *chptr,
|
extern ChannelModeFunc chm_nosuch;
|
||||||
int alevel, const char *arg, int *errors, int dir, char c, long mode_type);
|
extern ChannelModeFunc chm_orphaned;
|
||||||
extern void chm_orphaned(struct Client *source_p, struct Channel *chptr,
|
extern ChannelModeFunc chm_simple;
|
||||||
int alevel, const char *arg, int *errors, int dir, char c, long mode_type);
|
extern ChannelModeFunc chm_ban;
|
||||||
extern void chm_simple(struct Client *source_p, struct Channel *chptr,
|
extern ChannelModeFunc chm_hidden;
|
||||||
int alevel, const char *arg, int *errors, int dir, char c, long mode_type);
|
extern ChannelModeFunc chm_staff;
|
||||||
extern void chm_ban(struct Client *source_p, struct Channel *chptr,
|
extern ChannelModeFunc chm_forward;
|
||||||
int alevel, const char *arg, int *errors, int dir, char c, long mode_type);
|
extern ChannelModeFunc chm_throttle;
|
||||||
extern void chm_hidden(struct Client *source_p, struct Channel *chptr,
|
extern ChannelModeFunc chm_key;
|
||||||
int alevel, const char *arg, int *errors, int dir, char c, long mode_type);
|
extern ChannelModeFunc chm_limit;
|
||||||
extern void chm_staff(struct Client *source_p, struct Channel *chptr,
|
extern ChannelModeFunc chm_op;
|
||||||
int alevel, const char *arg, int *errors, int dir, char c, long mode_type);
|
extern ChannelModeFunc chm_voice;
|
||||||
extern void chm_forward(struct Client *source_p, struct Channel *chptr,
|
|
||||||
int alevel, const char *arg, int *errors, int dir, char c, long mode_type);
|
|
||||||
extern void chm_throttle(struct Client *source_p, struct Channel *chptr,
|
|
||||||
int alevel, const char *arg, int *errors, int dir, char c, long mode_type);
|
|
||||||
extern void chm_key(struct Client *source_p, struct Channel *chptr,
|
|
||||||
int alevel, const char *arg, int *errors, int dir, char c, long mode_type);
|
|
||||||
extern void chm_limit(struct Client *source_p, struct Channel *chptr,
|
|
||||||
int alevel, const char *arg, int *errors, int dir, char c, long mode_type);
|
|
||||||
extern void chm_op(struct Client *source_p, struct Channel *chptr,
|
|
||||||
int alevel, const char *arg, int *errors, int dir, char c, long mode_type);
|
|
||||||
extern void chm_voice(struct Client *source_p, struct Channel *chptr,
|
|
||||||
int alevel, const char *arg, int *errors, int dir, char c, long mode_type);
|
|
||||||
|
|
||||||
extern unsigned int cflag_add(char c, ChannelModeFunc function);
|
extern unsigned int cflag_add(char c, ChannelModeFunc function);
|
||||||
extern void cflag_orphan(char c);
|
extern void cflag_orphan(char c);
|
||||||
|
|
|
@ -1512,7 +1512,7 @@ set_channel_mode(struct Client *client_p, struct Client *source_p,
|
||||||
|
|
||||||
for (ms = modesets; ms < mend; ms++)
|
for (ms = modesets; ms < mend; ms++)
|
||||||
{
|
{
|
||||||
ChannelModeFunc set_func = ms->cm->set_func;
|
ChannelModeFunc *set_func = ms->cm->set_func;
|
||||||
if (set_func == NULL)
|
if (set_func == NULL)
|
||||||
set_func = chm_nosuch;
|
set_func = chm_nosuch;
|
||||||
set_func(fakesource_p, chptr, alevel, ms->arg, &errors, ms->dir, ms->mode, ms->cm->mode_type);
|
set_func(fakesource_p, chptr, alevel, ms->arg, &errors, ms->dir, ms->mode, ms->cm->mode_type);
|
||||||
|
|
Loading…
Reference in a new issue