From b5482c91035029ff8b7c970d8f5b23dcbb885da3 Mon Sep 17 00:00:00 2001 From: Valery Yatsko Date: Tue, 8 Apr 2008 23:39:35 +0400 Subject: [PATCH] chm_* declarations gone to chmode.h - this makes some modules clean --- TODO | 5 ++- extensions/chm_operonly_compat.c | 13 +----- extensions/chm_quietunreg_compat.c | 10 +---- extensions/chm_sslonly_compat.c | 10 +---- include/chmode.h | 65 ++++++++++++++++++++++++++++++ src/chmode.c | 1 + 6 files changed, 72 insertions(+), 32 deletions(-) create mode 100644 include/chmode.h diff --git a/TODO b/TODO index de59a29..e37f601 100644 --- a/TODO +++ b/TODO @@ -18,7 +18,7 @@ [x] client-to-client ssl [x] server-to-server ssl [x] ssl usermode (+Z) - [ ] ssl channelmode (by module?) + [x] ssl channelmode (done by extban and chm_compat) [ ] merge some stuff from ircd-seven directly (to be determined what) [?] remote d:lines support? [?] +C (noctcp) channel/usermode @@ -27,5 +27,6 @@ [ ] module engine rework [ ] more beautiful way of adding new channel modes by module [ ] other stuff - [ ] merge m_join.c and m_sjoin.c in one module (same functions, done in ratbox3) + [x] merge m_join.c and m_sjoin.c in one module (same functions, done in ratbox3) [ ] merge s_gline.c and m_gline.c in one module (for pretty look, done in ratbox3) + [x] create chmode.h and put there all declarations of chm_* - this will make some modules clean diff --git a/extensions/chm_operonly_compat.c b/extensions/chm_operonly_compat.c index f30104e..73fe269 100644 --- a/extensions/chm_operonly_compat.c +++ b/extensions/chm_operonly_compat.c @@ -7,18 +7,7 @@ #include "client.h" #include "hook.h" #include "ircd.h" - -/* XXX prototypes */ -void chm_ban(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); -void chm_nosuch(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); -void chm_simple(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); -/* end yucky prototypes */ +#include "chmode.h" static int _modinit(void); static void _moddeinit(void); diff --git a/extensions/chm_quietunreg_compat.c b/extensions/chm_quietunreg_compat.c index a742d13..a0d822d 100644 --- a/extensions/chm_quietunreg_compat.c +++ b/extensions/chm_quietunreg_compat.c @@ -8,15 +8,7 @@ #include "client.h" #include "hook.h" #include "ircd.h" - -/* XXX prototypes */ -void chm_ban(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); -void chm_nosuch(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); -/* end yucky prototypes */ +#include "chmode.h" static int _modinit(void); static void _moddeinit(void); diff --git a/extensions/chm_sslonly_compat.c b/extensions/chm_sslonly_compat.c index 3f91e08..63b875e 100644 --- a/extensions/chm_sslonly_compat.c +++ b/extensions/chm_sslonly_compat.c @@ -7,15 +7,7 @@ #include "client.h" #include "hook.h" #include "ircd.h" - -/* XXX prototypes */ -void chm_ban(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); -void chm_nosuch(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); -/* end yucky prototypes */ +#include "chmode.h" static int _modinit(void); static void _moddeinit(void); diff --git a/include/chmode.h b/include/chmode.h new file mode 100644 index 0000000..e7ba080 --- /dev/null +++ b/include/chmode.h @@ -0,0 +1,65 @@ +/* + * charybdis: An advanced ircd. + * chmode.h: The ircd channel header. + * + * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center + * Copyright (C) 1996-2002 Hybrid Development Team + * Copyright (C) 2002-2004 ircd-ratbox development team + * Copyright (C) 2008 charybdis development team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * $Id$ + */ + +#ifndef INCLUDED_chmode_h +#define INCLUDED_chmode_h + +extern void chm_nosuch(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); +extern void chm_simple(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); +extern void chm_ban(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); +extern void chm_staff(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); +extern void chm_forward(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); +extern void chm_throttle(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); +extern void chm_key(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); +extern void chm_limit(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); +extern void chm_regonly(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); +extern void chm_op(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); +extern void chm_voice(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); + +#endif diff --git a/src/chmode.c b/src/chmode.c index 6598eac..81c4202 100644 --- a/src/chmode.c +++ b/src/chmode.c @@ -42,6 +42,7 @@ #include "s_conf.h" /* ConfigFileEntry, ConfigChannel */ #include "s_newconf.h" #include "logger.h" +#include "chmode.h" /* bitmasks for error returns, so we send once per call */ #define SM_ERR_NOTS 0x00000001 /* No TS on channel */