Index: include/balloc.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/balloc.h,v
retrieving revision 1.31
diff -b -u -r1.31 balloc.h
Index: include/cache.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/cache.h,v
retrieving revision 1.3
diff -b -u -r1.3 cache.h
--- include/cache.h	22 Jul 2003 15:42:28 -0000	1.3
+++ include/cache.h	19 Aug 2004 22:16:12 -0000
@@ -48,4 +48,3 @@
 extern void send_oper_motd(struct Client *);
 
 #endif
-
Index: include/channel.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/channel.h,v
retrieving revision 7.152.4.3
diff -b -u -r7.152.4.3 channel.h
--- include/channel.h	2 Aug 2004 21:15:38 -0000	7.152.4.3
+++ include/channel.h	19 Aug 2004 22:16:12 -0000
@@ -122,17 +122,20 @@
 /* channel status flags */
 #define CHFL_PEON		0x0000	/* normal member of channel */
 #define CHFL_CHANOP     	0x0001	/* Channel operator */
-#define CHFL_VOICE      	0x0002	/* the power to speak */
-#define CHFL_DEOPPED    	0x0004	/* deopped on sjoin, bounce modes */
-#define CHFL_BANNED		0x0008  /* cached as banned */
-#define ONLY_SERVERS		0x0010
+#define CHFL_HALFOP             0x0002
+#define CHFL_VOICE      	0x0004	/* the power to speak */
+#define CHFL_DEOPPED    	0x0008	/* deopped on sjoin, bounce modes */
+#define CHFL_BANNED 		0x00010	/* cached as banned */
+#define ONLY_SERVERS		0x00020
 #define ALL_MEMBERS		CHFL_PEON
-#define ONLY_CHANOPS		CHFL_CHANOP
+#define ONLY_CHANOPS		(CHFL_CHANOP)
+#define ONLY_CHANOPSHALFOPS     (CHFL_CHANOP|CHFL_HALFOP)
 #define ONLY_CHANOPSVOICED	(CHFL_CHANOP|CHFL_VOICE)
 
 #define is_chanop(x)	((x) && (x)->flags & CHFL_CHANOP)
+#define is_halfop(x)    ((x) && (x)->flags & CHFL_HALFOP)
 #define is_voiced(x)	((x) && (x)->flags & CHFL_VOICE)
-#define is_chanop_voiced(x) ((x) && (x)->flags & (CHFL_CHANOP|CHFL_VOICE))
+#define is_chanop_voiced(x) ((x) && (x)->flags & (CHFL_CHANOP|CHFL_HALFOP|CHFL_VOICE))
 #define is_deop(x)	((x) && (x)->flags & CHFL_DEOPPED)
 #define can_send_banned(x) ((x) && (x)->flags & CHFL_BANNED)
 
@@ -142,10 +145,10 @@
 #define MODE_MODERATED  0x0004
 #define MODE_TOPICLIMIT 0x0008
 #define MODE_INVITEONLY 0x0010
-#define MODE_NOPRIVMSGS 0x0020
-#define CHFL_BAN        0x0040	/* ban channel flag */
-#define CHFL_EXCEPTION  0x0080	/* exception to ban channel flag */
-#define CHFL_INVEX      0x0100
+#define MODE_NOPRIVMSGS 0x0040
+#define CHFL_BAN        0x0080	/* ban channel flag */
+#define CHFL_EXCEPTION  0x0100	/* exception to ban channel flag */
+#define CHFL_INVEX      0x0200
 
 /* mode flags for direction indication */
 #define MODE_QUERY     0
@@ -176,14 +179,13 @@
 
 extern void destroy_channel(struct Channel *);
 
-extern int can_send(struct Channel *chptr, struct Client *who, 
-		    struct membership *);
+extern int can_send(struct Channel *chptr, struct Client *who, struct membership *);
 extern int is_banned(struct Channel *chptr, struct Client *who,
 		     struct membership *msptr, const char *, const char *);
 extern int can_join(struct Client *source_p, struct Channel *chptr, char *key);
 
 extern struct membership *find_channel_membership(struct Channel *, struct Client *);
-extern const char *find_channel_status(struct membership *msptr, int combine);
+extern const char *find_channel_status(struct membership *msptr, int combine, int halfop);
 extern void add_user_to_channel(struct Channel *, struct Client *, int flags);
 extern void remove_user_from_channel(struct membership *);
 extern void remove_user_from_channels(struct Client *);
@@ -192,8 +194,7 @@
 
 extern int check_channel_name(const char *name);
 
-extern void channel_member_names(struct Channel *chptr, struct Client *,
-				 int show_eon);
+extern void channel_member_names(struct Channel *chptr, struct Client *, int show_eon);
 
 extern void del_invite(struct Channel *chptr, struct Client *who);
 
Index: include/client.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/client.h,v
retrieving revision 7.246.2.6
diff -b -u -r7.246.2.6 client.h
--- include/client.h	4 Aug 2004 00:21:08 -0000	7.246.2.6
+++ include/client.h	19 Aug 2004 22:16:12 -0000
@@ -158,7 +158,7 @@
 
 struct LocalUser
 {
-	dlink_node tnode;	/* This is the node for the local list type the client is on*/
+	dlink_node tnode;	/* This is the node for the local list type the client is on */
 	/*
 	 * The following fields are allocated only for local clients
 	 * (directly connected to *this* server with a socket.
Index: include/commio.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/commio.h,v
retrieving revision 1.6.4.1
diff -b -u -r1.6.4.1 commio.h
Index: include/config.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/config.h,v
retrieving revision 7.175.2.1
diff -b -u -r7.175.2.1 config.h
Index: include/hash.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/hash.h,v
retrieving revision 7.51
diff -b -u -r7.51 hash.h
--- include/hash.h	14 Apr 2004 15:25:13 -0000	7.51
+++ include/hash.h	19 Aug 2004 22:16:13 -0000
@@ -80,7 +80,8 @@
 extern void del_from_id_hash(const char *name, struct Client *client);
 extern struct Client *find_id(const char *name);
 
-extern struct Channel *get_or_create_channel(struct Client *client_p, const char *chname, int *isnew);
+extern struct Channel *get_or_create_channel(struct Client *client_p, const char *chname,
+					     int *isnew);
 extern void del_from_channel_hash(const char *name, struct Channel *chan);
 extern struct Channel *find_channel(const char *name);
 
Index: include/hook.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/hook.h,v
retrieving revision 1.25
diff -b -u -r1.25 hook.h
--- include/hook.h	21 May 2004 21:22:09 -0000	1.25
+++ include/hook.h	19 Aug 2004 22:16:13 -0000
@@ -74,10 +74,10 @@
 
 
 int hook_add_event(const char *, int *);
-int hook_add_hook(const char *, hookfn );
+int hook_add_hook(const char *, hookfn);
 int hook_call_event(int id, void *);
 int hook_del_event(const char *);
-int hook_del_hook(const char *event, hookfn );
+int hook_del_hook(const char *event, hookfn);
 void init_hooks(void);
 
 extern int h_iosend_id;
Index: include/hostmask.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/hostmask.h,v
retrieving revision 1.33.4.1
diff -b -u -r1.33.4.1 hostmask.h
Index: include/irc_string.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/irc_string.h,v
retrieving revision 7.58.2.1
diff -b -u -r7.58.2.1 irc_string.h
Index: include/ircd_defs.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/ircd_defs.h,v
retrieving revision 7.50.4.1
diff -b -u -r7.50.4.1 ircd_defs.h
--- include/ircd_defs.h	3 Aug 2004 20:39:44 -0000	7.50.4.1
+++ include/ircd_defs.h	19 Aug 2004 22:16:13 -0000
@@ -131,11 +131,11 @@
 
 
 #ifdef SOCKADDR_IN_HAS_LEN
-struct irc_sockaddr_storage {
+struct irc_sockaddr_storage
+{
 	unsigned char ss_len;
         sa_family_t ss_family;
-        char __ss_pad1[((sizeof(int64_t)) - sizeof(unsigned char) -   
-                        sizeof(sa_family_t) )];
+	char __ss_pad1[((sizeof(int64_t)) - sizeof(unsigned char) - sizeof(sa_family_t))];
         int64_t __ss_align;
 #ifdef IPV6
         char __ss_pad2[(128 - sizeof(unsigned char) - sizeof(sa_family_t) -
@@ -149,9 +149,9 @@
   	sa_family_t ss_family;
   	u_int32_t __ss_align;
 #ifdef IPV6
-        char __ss_padding[(128 - (sizeof(sa_family_t) + sizeof (u_int32_t)))];
+	char __ss_padding[(128 - (sizeof(sa_family_t) + sizeof(u_int32_t)))];
 #else
-        char __ss_padding[(16 - (sizeof(sa_family_t) + sizeof (u_int32_t)))];
+	char __ss_padding[(16 - (sizeof(sa_family_t) + sizeof(u_int32_t)))];
 #endif 
 };
 #endif /* SOCKADDR_IN_HAS_LEN */
Index: include/modules.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/modules.h,v
retrieving revision 7.60
diff -b -u -r7.60 modules.h
--- include/modules.h	15 Mar 2004 17:58:00 -0000	7.60
+++ include/modules.h	19 Aug 2004 22:16:14 -0000
@@ -50,7 +50,7 @@
 	void *address;
 	int core;
 	int mapi_version;
-	void * mapi_header; /* actually struct mapi_mheader_av<mapi_version>	*/
+	void *mapi_header;	/* actually struct mapi_mheader_av<mapi_version>    */
 };
 
 struct module_path
@@ -65,17 +65,17 @@
 #define MAPI_MAGIC(x)	((x) & 0xffff0000)
 #define MAPI_VERSION(x)	((x) & 0x0000ffff)
 
-typedef struct Message* mapi_clist_av1;
+typedef struct Message *mapi_clist_av1;
 
 typedef struct
 {
-	const char *	hapi_name;
-	int *		hapi_id;
+	const char *hapi_name;
+	int *hapi_id;
 } mapi_hlist_av1;
 
 typedef struct
 {
-	const char * 	hapi_name;
+	const char *hapi_name;
 	hookfn 		fn;
 } mapi_hfn_list_av1;
 
@@ -85,10 +85,10 @@
 	int		(*mapi_register)	(void);		/* Register function;
 								   ret -1 = failure (unload)	*/
 	void		(*mapi_unregister)	(void);		/* Unregister function.		*/
-	mapi_clist_av1	* mapi_command_list;			/* List of commands to add.	*/
-	mapi_hlist_av1	* mapi_hook_list;			/* List of hooks to add.	*/
+	mapi_clist_av1 *mapi_command_list;	/* List of commands to add.     */
+	mapi_hlist_av1 *mapi_hook_list;	/* List of hooks to add.        */
 	mapi_hfn_list_av1 *mapi_hfn_list;			/* List of hook_add_hook's to do */
-	const char *	  mapi_module_version;			/* Module's version (freeform)	*/
+	const char *mapi_module_version;	/* Module's version (freeform)  */
 };
 
 #ifndef STATIC_MODULES
Index: include/parse.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/parse.h,v
retrieving revision 7.22
diff -b -u -r7.22 parse.h
--- include/parse.h	15 Mar 2004 17:58:00 -0000	7.22
+++ include/parse.h	19 Aug 2004 22:16:14 -0000
@@ -40,8 +40,7 @@
 #define MAX_MSG_HASH  387
 
 extern void parse(struct Client *, char *, char *);
-extern void handle_encap(struct Client *, struct Client *, 
-		         const char *, int, const char *parv[]);
+extern void handle_encap(struct Client *, struct Client *, const char *, int, const char *parv[]);
 extern void clear_hash_parse(void);
 extern void mod_add_cmd(struct Message *msg);
 extern void mod_del_cmd(struct Message *msg);
Index: include/patricia.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/patricia.h,v
retrieving revision 7.15.4.1
diff -b -u -r7.15.4.1 patricia.h
Index: include/reject.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/reject.h,v
retrieving revision 1.9
diff -b -u -r1.9 reject.h
--- include/reject.h	14 May 2004 19:12:13 -0000	1.9
+++ include/reject.h	19 Aug 2004 22:16:15 -0000
@@ -37,4 +37,3 @@
 void flush_reject(void);
 
 #endif
-
Index: include/s_auth.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/s_auth.h,v
retrieving revision 7.24
diff -b -u -r7.24 s_auth.h
Index: include/s_conf.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/s_conf.h,v
retrieving revision 7.278.2.1
diff -b -u -r7.278.2.1 s_conf.h
Index: include/s_log.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/s_log.h,v
retrieving revision 7.25
diff -b -u -r7.25 s_log.h
--- include/s_log.h	25 May 2004 10:49:45 -0000	7.25
+++ include/s_log.h	19 Aug 2004 22:16:15 -0000
@@ -56,9 +56,11 @@
 
 extern void init_main_logfile(void);
 extern void open_logfiles(void);
-extern void ilog(ilogfile dest, const char *fmt, ...) AFP(2, 3);
-extern void report_operspy(struct Client *, const char *, const char *);
-extern const char *smalldate(void);
-extern void report_error(const char *, const char *, const char *, int);
+extern void
+ilog(ilogfile dest, const char *fmt, ...)
+AFP(2, 3);
+     extern void report_operspy(struct Client *, const char *, const char *);
+     extern const char *smalldate(void);
+     extern void report_error(const char *, const char *, const char *, int);
 
 #endif
Index: include/s_newconf.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/s_newconf.h,v
retrieving revision 7.32.2.1
diff -b -u -r7.32.2.1 s_newconf.h
--- include/s_newconf.h	3 Aug 2004 20:39:44 -0000	7.32.2.1
+++ include/s_newconf.h	19 Aug 2004 22:16:15 -0000
@@ -101,8 +101,7 @@
 extern struct remote_conf *make_remote_conf(void);
 extern void free_remote_conf(struct remote_conf *);
 
-extern int find_shared_conf(const char *username, const char *host,
-			const char *server, int flags);
+extern int find_shared_conf(const char *username, const char *host, const char *server, int flags);
 extern void propagate_generic(struct Client *source_p, const char *command,
 		const char *target, int cap, const char *format, ...);
 extern void cluster_generic(struct Client *, const char *, int cltype,
@@ -206,8 +205,7 @@
 
 extern void attach_server_conf(struct Client *, struct server_conf *);
 extern void detach_server_conf(struct Client *);
-extern void set_server_conf_autoconn(struct Client *source_p, char *name, 
-					int newval);
+extern void set_server_conf_autoconn(struct Client *source_p, char *name, int newval);
 
 
 extern struct ConfItem *find_xline(const char *, int);
@@ -219,7 +217,7 @@
 
 struct nd_entry
 {
-	char name[NICKLEN+1];
+	char name[NICKLEN + 1];
 	time_t expire;
 	unsigned int hashv;
 
@@ -232,4 +230,3 @@
 extern unsigned long get_nd_count(void);
 
 #endif
-
Index: include/s_serv.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/s_serv.h,v
retrieving revision 7.94
diff -b -u -r7.94 s_serv.h
--- include/s_serv.h	12 Apr 2004 02:26:41 -0000	7.94
+++ include/s_serv.h	19 Aug 2004 22:16:15 -0000
@@ -70,6 +70,7 @@
 #define CAP_CLUSTER     0x02000	/* supports cluster stuff */
 #define CAP_ENCAP	0x04000	/* supports ENCAP */
 #define CAP_TS6		0x08000 /* supports TS6 or above */
+#define CAP_HOPS        0x10000	/* supports halfops */
 
 #define CAP_MASK        (CAP_QS  | CAP_EX   | CAP_CHW  | \
                          CAP_IE  | CAP_KLN  | \
Index: include/s_user.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/s_user.h,v
retrieving revision 7.29
diff -b -u -r7.29 s_user.h
Index: include/send.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/send.h,v
retrieving revision 7.81
diff -b -u -r7.81 send.h
--- include/send.h	15 Mar 2004 17:58:00 -0000	7.81
+++ include/send.h	19 Aug 2004 22:16:16 -0000
@@ -40,38 +40,40 @@
 extern void send_queued_write(int fd, void *data);
 extern void send_queued_slink_write(int fd, void *data);
 
-extern void sendto_one(struct Client *target_p, const char *, ...) AFP(2, 3);
-extern void sendto_one_notice(struct Client *target_p,const char *, ...) AFP(2, 3);
-extern void sendto_one_prefix(struct Client *target_p, struct Client *source_p,
+extern void
+sendto_one(struct Client *target_p, const char *, ...)
+AFP(2, 3);
+     extern void sendto_one_notice(struct Client *target_p, const char *, ...) AFP(2, 3);
+     extern void sendto_one_prefix(struct Client *target_p, struct Client *source_p,
 			      const char *command, const char *, ...) AFP(4, 5);
-extern void sendto_one_numeric(struct Client *target_p,
+     extern void sendto_one_numeric(struct Client *target_p,
 			       int numeric, const char *, ...) AFP(3, 4);
 
-extern void sendto_server(struct Client *one, struct Channel *chptr,
+     extern void sendto_server(struct Client *one, struct Channel *chptr,
 			  unsigned long caps, unsigned long nocaps,
 			  const char *format, ...) AFP(5, 6);
 
-extern void sendto_channel_flags(struct Client *one, int type, struct Client *source_p,
+     extern void sendto_channel_flags(struct Client *one, int type, struct Client *source_p,
 				 struct Channel *chptr, const char *, ...) AFP(5, 6);
 
-extern void sendto_channel_local(int type, struct Channel *, const char *, ...) AFP(3, 4);
-extern void sendto_common_channels_local(struct Client *, const char *, ...) AFP(2, 3);
+     extern void sendto_channel_local(int type, struct Channel *, const char *, ...) AFP(3, 4);
+     extern void sendto_common_channels_local(struct Client *, const char *, ...) AFP(2, 3);
 
 
-extern void sendto_match_butone(struct Client *, struct Client *,
+     extern void sendto_match_butone(struct Client *, struct Client *,
 				const char *, int, const char *, ...) AFP(5, 6);
-extern void sendto_match_servs(struct Client *source_p, const char *mask, 
+     extern void sendto_match_servs(struct Client *source_p, const char *mask,
 				int capab, int, const char *, ...) AFP(5, 6);
 
-extern void sendto_anywhere(struct Client *, struct Client *, const char *,
+     extern void sendto_anywhere(struct Client *, struct Client *, const char *,
 			    const char *, ...) AFP(4, 5);
 
-extern void sendto_realops_flags(int, int, const char *, ...) AFP(3, 4);
-extern void sendto_wallops_flags(int, struct Client *, const char *, ...) AFP(3, 4);
+     extern void sendto_realops_flags(int, int, const char *, ...) AFP(3, 4);
+     extern void sendto_wallops_flags(int, struct Client *, const char *, ...) AFP(3, 4);
 
-extern void kill_client(struct Client *client_p, struct Client *diedie,
+     extern void kill_client(struct Client *client_p, struct Client *diedie,
 			 const char *pattern, ...) AFP(3, 4);
-extern void kill_client_serv_butone(struct Client *one, struct Client *source_p, 
+     extern void kill_client_serv_butone(struct Client *one, struct Client *source_p,
 				    const char *pattern, ...) AFP(3, 4);
 
 #define L_ALL 	0
Index: include/sprintf_irc.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/sprintf_irc.h,v
retrieving revision 7.15
diff -b -u -r7.15 sprintf_irc.h
--- include/sprintf_irc.h	15 Mar 2004 17:58:00 -0000	7.15
+++ include/sprintf_irc.h	19 Aug 2004 22:16:16 -0000
@@ -38,8 +38,11 @@
  * ircsprintf - optimized sprintf
  */
 #ifdef __GNUC__
-int ircsprintf(char *str, const char *fmt, ...) __attribute((format(printf, 2, 3)));
-int ircsnprintf(char *str, const size_t size, const char *, ...) __attribute__ ((format(printf, 3, 4)));
+int
+ircsprintf(char *str, const char *fmt, ...)
+__attribute((format(printf, 2, 3)));
+     int ircsnprintf(char *str, const size_t size, const char *, ...)
+	__attribute__ ((format(printf, 3, 4)));
 #else
 int ircsprintf(char *str, const char *format, ...);
 int ircsnprintf(char *str, const size_t size, const char *, ...);
Index: include/stdinc.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/stdinc.h,v
retrieving revision 1.11
diff -b -u -r1.11 stdinc.h
--- include/stdinc.h	30 Sep 2003 19:12:34 -0000	1.11
+++ include/stdinc.h	19 Aug 2004 22:16:16 -0000
@@ -32,10 +32,10 @@
 #  include <alloca.h>
 # else
 #  ifdef _AIX
- #pragma alloca
+#pragma alloca
 #  else
 #   ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
+char *alloca();
 #   endif
 #  endif
 # endif
Index: include/supported.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/supported.h,v
retrieving revision 1.41
diff -b -u -r1.41 supported.h
--- include/supported.h	21 Apr 2004 14:11:58 -0000	1.41
+++ include/supported.h	19 Aug 2004 22:16:16 -0000
@@ -32,7 +32,7 @@
 #include "ircd_defs.h"
 
 #define FEATURES "STD=i-d"		\
-		" STATUSMSG=@+"		\
+		" STATUSMSG=@%%+"	\
                 "%s%s%s"		\
                 " MODES=%i"		\
                 " MAXCHANNELS=%i"	\
@@ -52,7 +52,7 @@
 
 #define FEATURES2 "CHANNELLEN=%i"	\
 		" CHANTYPES=#&"		\
-		" PREFIX=(ov)@+" 	\
+		" PREFIX=(ohv)@%%+" 	\
 		" CHANMODES=%s%sb,k,l,imnpst"	\
 		" NETWORK=%s"		\
 		" CASEMAPPING=rfc1459"	\
Index: include/tools.h
===================================================================
RCS file: /cvsroot/ircd-ratbox/include/tools.h,v
retrieving revision 1.50
diff -b -u -r1.50 tools.h
--- include/tools.h	12 Apr 2004 17:19:42 -0000	1.50
+++ include/tools.h	19 Aug 2004 22:16:16 -0000
@@ -178,7 +178,7 @@
 }
 
 static inline void
-dlinkMoveTail(dlink_node *m, dlink_list *list)
+dlinkMoveTail(dlink_node * m, dlink_list * list)
 {
 	if(list->tail == m)
 		return;
Index: modules/m_accept.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_accept.c,v
retrieving revision 1.58.4.1
diff -b -u -r1.58.4.1 m_accept.c
--- modules/m_accept.c	3 Aug 2004 02:12:39 -0000	1.58.4.1
+++ modules/m_accept.c	19 Aug 2004 22:16:16 -0000
@@ -51,6 +51,7 @@
 mapi_clist_av1 accept_clist[] = {
 	&accept_msgtab, NULL
 };
+
 DECLARE_MODULE_AV1(accept, NULL, NULL, accept_clist, NULL, NULL, "$Revision: 1.58.4.1 $");
 
 /*
@@ -77,7 +78,7 @@
 	build_nicklist(source_p, addbuf, delbuf, parv[1]);
 
 	/* parse the delete list */
-	for (nick = strtoken(&p, delbuf, ","); nick != NULL; nick = strtoken(&p, NULL, ","))
+	for(nick = strtoken(&p, delbuf, ","); nick != NULL; nick = strtoken(&p, NULL, ","))
 	{
 		/* shouldnt happen, but lets be paranoid */
 		if((target_p = find_named_person(nick)) == NULL)
@@ -102,7 +103,7 @@
 	accept_num = dlink_list_length(&source_p->localClient->allow_list);
 
 	/* parse the add list */
-	for (nick = strtoken(&p, addbuf, ","); nick; nick = strtoken(&p, NULL, ","), accept_num++)
+	for(nick = strtoken(&p, addbuf, ","); nick; nick = strtoken(&p, NULL, ","), accept_num++)
 	{
 		/* shouldnt happen, but lets be paranoid */
 		if((target_p = find_named_person(nick)) == NULL)
@@ -160,7 +161,7 @@
 	del = lenadd = lendel = 0;
 
 	/* build list of clients to add into addbuf, clients to remove in delbuf */
-	for (name = strtoken(&p, n, ","); name; name = strtoken(&p, NULL, ","), del = 0)
+	for(name = strtoken(&p, n, ","); name; name = strtoken(&p, NULL, ","), del = 0)
 	{
 		if(*name == '-')
 		{
@@ -254,10 +255,8 @@
 	}
 
 	if(*nicks)
-		sendto_one(source_p, form_str(RPL_ACCEPTLIST), 
-			   me.name, source_p->name, nicks);
+		sendto_one(source_p, form_str(RPL_ACCEPTLIST), me.name, source_p->name, nicks);
 
-	sendto_one(source_p, form_str(RPL_ENDOFACCEPT), 
-		   me.name, source_p->name);
+	sendto_one(source_p, form_str(RPL_ENDOFACCEPT), me.name, source_p->name);
 
 }
Index: modules/m_admin.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_admin.c,v
retrieving revision 1.59
diff -b -u -r1.59 m_admin.c
--- modules/m_admin.c	15 Mar 2004 17:58:02 -0000	1.59
+++ modules/m_admin.c	19 Aug 2004 22:16:16 -0000
@@ -52,8 +52,8 @@
 
 mapi_clist_av1 admin_clist[] = { &admin_msgtab, NULL };
 mapi_hlist_av1 admin_hlist[] = { 
-	{ "doing_admin",	&doing_admin_hook },
-	{ NULL, NULL }
+	{"doing_admin", &doing_admin_hook},
+	{NULL, NULL}
 };
 
 DECLARE_MODULE_AV1(admin, NULL, NULL, admin_clist, admin_hlist, NULL, "$Revision: 1.59 $");
@@ -71,9 +71,7 @@
 	if((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
 	{
 		sendto_one(source_p, form_str(RPL_LOAD2HI), 
-			   me.name, 
-			   EmptyString(source_p->name) ? "*" : source_p->name, 
-			   "ADMIN");
+			   me.name, EmptyString(source_p->name) ? "*" : source_p->name, "ADMIN");
 		return 0;
 	}
 	else
Index: modules/m_away.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_away.c,v
retrieving revision 1.57.2.1
diff -b -u -r1.57.2.1 m_away.c
--- modules/m_away.c	3 Aug 2004 02:01:47 -0000	1.57.2.1
+++ modules/m_away.c	19 Aug 2004 22:16:17 -0000
@@ -46,6 +46,7 @@
 };
 
 mapi_clist_av1 away_clist[] = { &away_msgtab, NULL };
+
 DECLARE_MODULE_AV1(away, NULL, NULL, away_clist, NULL, NULL, "$Revision: 1.57.2.1 $");
 
 /***********************************************************************
@@ -89,14 +90,12 @@
 			/* we now send this only if they were away before --is */
 			sendto_server(client_p, NULL, CAP_TS6, NOCAPS,
 				      ":%s AWAY", use_id(source_p));
-			sendto_server(client_p, NULL, NOCAPS, CAP_TS6, 
-				      ":%s AWAY", source_p->name);
+			sendto_server(client_p, NULL, NOCAPS, CAP_TS6, ":%s AWAY", source_p->name);
 			MyFree(away);
 			source_p->user->away = NULL;
 		}
 		if(MyConnect(source_p))
-			sendto_one(source_p, form_str(RPL_UNAWAY),
-				   me.name, source_p->name);
+			sendto_one(source_p, form_str(RPL_UNAWAY), me.name, source_p->name);
 		return 0;
 	}
 
Index: modules/m_capab.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_capab.c,v
retrieving revision 1.48
diff -b -u -r1.48 m_capab.c
--- modules/m_capab.c	20 Mar 2004 00:34:33 -0000	1.48
+++ modules/m_capab.c	19 Aug 2004 22:16:17 -0000
@@ -46,6 +46,7 @@
 };
 
 mapi_clist_av1 capab_clist[] = { &capab_msgtab, &gcap_msgtab, NULL };
+
 DECLARE_MODULE_AV1(capab, NULL, NULL, capab_clist, NULL, NULL, "$Revision: 1.48 $");
 
 /*
@@ -77,12 +78,12 @@
 
 	DupString(client_p->localClient->fullcaps, parv[1]);
 
-	for (i = 1; i < parc; i++)
+	for(i = 1; i < parc; i++)
 	{
 		char *t = LOCAL_COPY(parv[i]);
-		for (s = strtoken(&p, t, " "); s; s = strtoken(&p, NULL, " "))
+		for(s = strtoken(&p, t, " "); s; s = strtoken(&p, NULL, " "))
 		{
-			for (cap = captab; cap->name; cap++)
+			for(cap = captab; cap->name; cap++)
 			{
 				if(!irccmp(cap->name, s))
 				{
@@ -97,8 +98,7 @@
 }
 
 static int
-me_gcap(struct Client *client_p, struct Client *source_p,
-		int parc, const char *parv[])
+me_gcap(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
 	struct Capability *cap;
 	char *t = LOCAL_COPY(parv[1]);
@@ -114,9 +114,9 @@
 
 	DupString(source_p->serv->fullcaps, parv[1]);
 
-	for (s = strtoken(&p, t, " "); s; s = strtoken(&p, NULL, " "))
+	for(s = strtoken(&p, t, " "); s; s = strtoken(&p, NULL, " "))
 	{
-		for (cap = captab; cap->name; cap++)
+		for(cap = captab; cap->name; cap++)
 		{
 			if(!irccmp(cap->name, s))
 			{
Index: modules/m_challenge.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/Attic/m_challenge.c,v
retrieving revision 1.70.2.1
diff -b -u -r1.70.2.1 m_challenge.c
--- modules/m_challenge.c	3 Aug 2004 02:01:47 -0000	1.70.2.1
+++ modules/m_challenge.c	19 Aug 2004 22:16:17 -0000
@@ -54,7 +54,8 @@
 #ifndef HAVE_LIBCRYPTO
 /* 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_flags(UMODE_ALL, L_ALL, 
@@ -78,6 +79,7 @@
 };
 
 mapi_clist_av1 challenge_clist[] = { &challenge_msgtab, NULL };
+
 DECLARE_MODULE_AV1(challenge, NULL, NULL, challenge_clist, NULL, NULL, "$Revision: 1.70.2.1 $");
 
 static int generate_challenge(char **r_challenge, char **r_response, RSA * key);
@@ -124,13 +126,11 @@
 		}
 
 		oper_p = find_oper_conf(source_p->username, source_p->host, 
-					source_p->sockhost, 
-					source_p->localClient->auth_oper);
+					source_p->sockhost, source_p->localClient->auth_oper);
 
 		if(oper_p == NULL)
 		{
-			sendto_one(source_p, form_str(ERR_NOOPERHOST), 
-				   me.name, source_p->name);
+			sendto_one(source_p, form_str(ERR_NOOPERHOST), me.name, source_p->name);
 			ilog(L_FOPER, "FAILED OPER (%s) by (%s!%s@%s)",
 			     source_p->localClient->auth_oper, source_p->name,
 			     source_p->username, source_p->host);
@@ -161,15 +161,13 @@
 	source_p->localClient->response = NULL;
 	source_p->localClient->auth_oper = NULL;
 
-	oper_p = find_oper_conf(source_p->username, source_p->host, 
-				source_p->sockhost, parv[1]);
+	oper_p = find_oper_conf(source_p->username, source_p->host, source_p->sockhost, parv[1]);
 
 	if(oper_p == NULL)
 	{
 		sendto_one(source_p, form_str(ERR_NOOPERHOST), me.name, source_p->name);
 		ilog(L_FOPER, "FAILED OPER (%s) by (%s!%s@%s)",
-		     parv[1], source_p->name,
-		     source_p->username, source_p->host);
+		     parv[1], source_p->name, source_p->username, source_p->host);
 
 		if(ConfigFileEntry.failed_oper_notice)
 			sendto_realops_flags(UMODE_ALL, L_ALL,
@@ -202,7 +200,7 @@
 	static const char trans[] = "0123456789ABCDEF";
 	int i;
 
-	for (i = 0; i < length; i++)
+	for(i = 0; i < length; i++)
 	{
 		hex[i << 1] = trans[bin[i] >> 4];
 		hex[(i << 1) + 1] = trans[bin[i] & 0xf];
@@ -225,7 +223,8 @@
 	 	if(RAND_bytes(buf, length) > 0)
 	 	        return 1;
 	}
-	else {
+	else
+	{
 	        if(RAND_pseudo_bytes(buf, length) >= 0)
 	                return 1;
 	}
@@ -261,7 +260,7 @@
 	}
 
 	ERR_load_crypto_strings();
-	while ((cnt < 100) && (e = ERR_get_error()))
+	while((cnt < 100) && (e = ERR_get_error()))
 	{
 		ilog(L_MAIN, "SSL error: %s", ERR_error_string(e, 0));
 		cnt++;
Index: modules/m_close.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_close.c,v
retrieving revision 1.42
diff -b -u -r1.42 m_close.c
--- modules/m_close.c	15 Mar 2004 17:58:02 -0000	1.42
+++ modules/m_close.c	19 Aug 2004 22:16:17 -0000
@@ -43,6 +43,7 @@
 };
 
 mapi_clist_av1 close_clist[] = { &close_msgtab, NULL };
+
 DECLARE_MODULE_AV1(close, NULL, NULL, close_clist, NULL, NULL, "$Revision: 1.42 $");
 
 /*
Index: modules/m_connect.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_connect.c,v
retrieving revision 1.71
diff -b -u -r1.71 m_connect.c
--- modules/m_connect.c	29 Mar 2004 12:16:56 -0000	1.71
+++ modules/m_connect.c	19 Aug 2004 22:16:17 -0000
@@ -49,6 +49,7 @@
 };
 
 mapi_clist_av1 connect_clist[] = { &connect_msgtab, NULL };
+
 DECLARE_MODULE_AV1(connect, NULL, NULL, connect_clist, NULL, NULL, "$Revision: 1.71 $");
 
 /*
@@ -74,8 +75,7 @@
 
 	if(MyConnect(source_p) && !IsOperRemote(source_p) && parc > 3)
 	{
-		sendto_one(source_p, form_str(ERR_NOPRIVS),
-			   me.name, source_p->name, "remote");
+		sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "remote");
 		return 0;
 	}
 
@@ -95,8 +95,7 @@
 	if((server_p = find_server_conf(parv[1])) == NULL)
 	{
 		sendto_one(source_p,
-			   "NOTICE %s :Connect: Host %s not listed in ircd.conf",
-			   parv[0], parv[1]);
+			   "NOTICE %s :Connect: Host %s not listed in ircd.conf", parv[0], parv[1]);
 		return 0;
 	}
 
@@ -191,8 +190,7 @@
 	 */
 	if((server_p = find_server_conf(parv[1])) == NULL)
 	{
-		sendto_one_notice(source_p, ":Connect: Host %s not listed in ircd.conf",
-				  parv[1]);
+		sendto_one_notice(source_p, ":Connect: Host %s not listed in ircd.conf", parv[1]);
 		return 0;
 	}
 
@@ -218,8 +216,7 @@
 	 * Notify all operators about remote connect requests
 	 */
 	sendto_wallops_flags(UMODE_WALLOP, &me,
-			     "Remote CONNECT %s %d from %s", 
-			     parv[1], port, source_p->name);
+			     "Remote CONNECT %s %d from %s", parv[1], port, source_p->name);
 	sendto_server(NULL, NULL, CAP_TS6, NOCAPS,
 		      ":%s WALLOPS :Remote CONNECT %s %d from %s",
 		      me.id, parv[1], port, source_p->name);
Index: modules/m_dline.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_dline.c,v
retrieving revision 1.36.2.1
diff -b -u -r1.36.2.1 m_dline.c
--- modules/m_dline.c	3 Aug 2004 20:39:47 -0000	1.36.2.1
+++ modules/m_dline.c	19 Aug 2004 22:16:17 -0000
@@ -59,6 +59,7 @@
 };
 
 mapi_clist_av1 dline_clist[] = { &dline_msgtab, &undline_msgtab, NULL };
+
 DECLARE_MODULE_AV1(dline, NULL, NULL, dline_clist, NULL, NULL, "$Revision: 1.36.2.1 $");
 
 static int valid_comment(char *comment);
@@ -71,8 +72,7 @@
  *   parv[2] - reason
  */
 static int
-mo_dline(struct Client *client_p, struct Client *source_p,
-	 int parc, const char *parv[])
+mo_dline(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
 	char def[] = "No Reason";
 	const char *dlhost;
@@ -89,8 +89,7 @@
 
 	if(!IsOperK(source_p))
 	{
-		sendto_one(source_p, form_str(ERR_NOPRIVS),
-			   me.name, source_p->name, "kline");
+		sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "kline");
 		return 0;
 	}
 
@@ -109,8 +108,7 @@
 
 	if(!parse_netmask(dlhost, NULL, &bits))
 	{
-		sendto_one(source_p, ":%s NOTICE %s :Invalid D-Line",
-			   me.name, source_p->name);
+		sendto_one(source_p, ":%s NOTICE %s :Invalid D-Line", me.name, source_p->name);
 		return 0;
 	}
 
@@ -155,7 +153,7 @@
 	{
 		const char *creason;
 		int t = AF_INET, ty, b;
-		ty = parse_netmask(dlhost, (struct sockaddr *)&daddr, &b);
+		ty = parse_netmask(dlhost, (struct sockaddr *) &daddr, &b);
 #ifdef IPV6
         	if(ty == HM_IPV6)
                 	t = AF_INET6;
@@ -163,7 +161,7 @@
 #endif
 			t = AF_INET;
                                   		
-		if((aconf = find_dline((struct sockaddr *)&daddr, t)) != NULL)
+		if((aconf = find_dline((struct sockaddr *) &daddr, t)) != NULL)
 		{
 			int bx;
 			parse_netmask(aconf->host, NULL, &bx);
@@ -216,8 +214,7 @@
 					     get_oper_name(source_p), tdline_time / 60,
 					     aconf->host, reason);
 			ilog(L_KLINE, "D %s %d %s %s",
-				get_oper_name(source_p), tdline_time / 60,
-				aconf->host, reason);
+			     get_oper_name(source_p), tdline_time / 60, aconf->host, reason);
 		}
 		else
 		{
@@ -265,8 +262,7 @@
 
 	if(!IsOperUnkline(source_p))
 	{
-		sendto_one(source_p, form_str(ERR_NOPRIVS),
-			   me.name, source_p->name, "unkline");
+		sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "unkline");
 		return 0;
 	}
 
@@ -303,7 +299,7 @@
 
 	umask(oldumask);
 
-	while (fbgets(buf, sizeof(buf), in))
+	while(fbgets(buf, sizeof(buf), in))
 	{
 		strlcpy(buff, buf, sizeof(buff));
 
@@ -342,14 +338,12 @@
 	if(error_on_write)
 	{
 		sendto_one(source_p,
-			   ":%s NOTICE %s :Couldn't write D-line file, aborted", 
-			   me.name, parv[0]);
+			   ":%s NOTICE %s :Couldn't write D-line file, aborted", me.name, parv[0]);
 		return 0;
 	}
 	else if(!pairme)
 	{
-		sendto_one(source_p, ":%s NOTICE %s :No D-Line for %s",
-			   me.name, parv[0], cidr);
+		sendto_one(source_p, ":%s NOTICE %s :No D-Line for %s", me.name, parv[0], cidr);
 
 		if(temppath != NULL)
 			(void) unlink(temppath);
@@ -447,9 +441,9 @@
 	int bits, cbits;
 	int i;
 
-	parse_netmask(host, (struct sockaddr *)&addr, &bits);
+	parse_netmask(host, (struct sockaddr *) &addr, &bits);
 
-	for (i = 0; tdline_list[i] != NULL; i++)
+	for(i = 0; tdline_list[i] != NULL; i++)
 	{
 		tdlist = tdline_list[i];
 
@@ -457,9 +451,11 @@
 		{
 			aconf = ptr->data;
 
-			parse_netmask(aconf->host, (struct sockaddr *)&caddr, &cbits);
+			parse_netmask(aconf->host, (struct sockaddr *) &caddr, &cbits);
 
-			if(comp_with_mask_sock((struct sockaddr *)&addr, (struct sockaddr *)&caddr, bits) && bits == cbits)
+			if(comp_with_mask_sock
+			   ((struct sockaddr *) &addr, (struct sockaddr *) &caddr, bits)
+			   && bits == cbits)
 			{
 				dlinkDestroy(ptr, tdlist);
 				delete_one_address_conf(aconf->host, aconf);
Index: modules/m_encap.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_encap.c,v
retrieving revision 1.19
diff -b -u -r1.19 m_encap.c
--- modules/m_encap.c	15 Mar 2004 17:58:02 -0000	1.19
+++ modules/m_encap.c	19 Aug 2004 22:16:17 -0000
@@ -46,8 +46,7 @@
 #include "modules.h"
 #include "sprintf_irc.h"
 
-static int ms_encap(struct Client *client_p, struct Client *source_p,
-		     int parc, const char *parv[]);
+static int ms_encap(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
 
 struct Message encap_msgtab = {
 	"ENCAP", 0, 0, 0, MFLG_SLOW,
@@ -55,6 +54,7 @@
 };
 
 mapi_clist_av1 encap_clist[] = { &encap_msgtab, NULL };
+
 DECLARE_MODULE_AV1(encap, NULL, NULL, encap_clist, NULL, NULL, "$Revision: 1.19 $");
 
 /* ms_encap()
@@ -79,7 +79,7 @@
 		len = strlen(parv[i]) + 1;
 
 		/* ugh, not even at the last parameter, just bail --fl */
-		if((size_t)(cur_len + len) >= sizeof(buffer))
+		if((size_t) (cur_len + len) >= sizeof(buffer))
 			return 0;
 
 		ircsnprintf(ptr, sizeof(buffer) - cur_len, "%s ", parv[i]);
@@ -93,14 +93,13 @@
 	if(parc == 3)
 		ircsnprintf(ptr, sizeof(buffer) - cur_len, "%s", parv[2]);
 	else
-		ircsnprintf(ptr, sizeof(buffer) - cur_len, ":%s", parv[parc-1]);
+		ircsnprintf(ptr, sizeof(buffer) - cur_len, ":%s", parv[parc - 1]);
 
 	/* add a trailing \0 if it was too long */
 	if((cur_len + len) >= BUFSIZE)
-		buffer[BUFSIZE-1] = '\0';
+		buffer[BUFSIZE - 1] = '\0';
 
-	sendto_match_servs(source_p, parv[1], CAP_ENCAP, NOCAPS,
-			   "ENCAP %s", buffer);
+	sendto_match_servs(source_p, parv[1], CAP_ENCAP, NOCAPS, "ENCAP %s", buffer);
 
 	/* if it matches us, find a matching handler and call it */
 	if(match(parv[1], me.name))
@@ -108,5 +107,3 @@
 
 	return 0;
 }
-
-
Index: modules/m_etrace.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/Attic/m_etrace.c,v
retrieving revision 1.10.4.1
diff -b -u -r1.10.4.1 m_etrace.c
--- modules/m_etrace.c	3 Aug 2004 20:39:47 -0000	1.10.4.1
+++ modules/m_etrace.c	19 Aug 2004 22:16:18 -0000
@@ -58,6 +58,7 @@
 };
 
 mapi_clist_av1 etrace_clist[] =  { &etrace_msgtab, NULL };
+
 DECLARE_MODULE_AV1(etrace, NULL, NULL, etrace_clist, NULL, NULL, "$Revision: 1.10.4.1 $");
 
 /*
@@ -86,7 +87,8 @@
 		else
 #endif
 		{
-			inetntop_sock((struct sockaddr *)&target_p->localClient->ip, ip, sizeof(ip));
+			inetntop_sock((struct sockaddr *) &target_p->localClient->ip, ip,
+				      sizeof(ip));
 			ip_ptr = ip;
 		}
 
@@ -101,4 +103,3 @@
 	sendto_one_numeric(source_p, RPL_ENDOFTRACE, form_str(RPL_ENDOFTRACE), me.name);
 	return 0;
 }
-
Index: modules/m_gline.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_gline.c,v
retrieving revision 1.141.2.1
diff -b -u -r1.141.2.1 m_gline.c
--- modules/m_gline.c	3 Aug 2004 20:39:47 -0000	1.141.2.1
+++ modules/m_gline.c	19 Aug 2004 22:16:18 -0000
@@ -63,6 +63,7 @@
 };
 
 mapi_clist_av1 gline_clist[] = { &gline_msgtab, &ungline_msgtab, NULL };
+
 DECLARE_MODULE_AV1(gline, NULL, NULL, gline_clist, NULL, NULL, "$Revision: 1.141.2.1 $");
 
 static int majority_gline(struct Client *source_p, const char *user,
@@ -93,15 +94,13 @@
 
 	if(!ConfigFileEntry.glines)
 	{
-		sendto_one(source_p, ":%s NOTICE %s :GLINE disabled",
-			   me.name, source_p->name);
+		sendto_one(source_p, ":%s NOTICE %s :GLINE disabled", me.name, source_p->name);
 		return 0;
 	}
 
 	if(!IsOperGline(source_p))
 	{
-		sendto_one(source_p, form_str(ERR_NOPRIVS),
-			   me.name, source_p->name, "gline");
+		sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "gline");
 		return 0;
 	}
 
@@ -124,8 +123,7 @@
 		if(strchr(parv[1], '.') == NULL)
 		{
 			sendto_one(source_p,
-				   ":%s NOTICE %s :Invalid parameters",
-				   me.name, source_p->name);
+				   ":%s NOTICE %s :Invalid parameters", me.name, source_p->name);
 			return 0;
 		}
 
@@ -145,8 +143,7 @@
 			sendto_one(source_p,
 				   ":%s NOTICE %s :Please include at least %d non-wildcard "
 				   "characters with the user@host",
-				   me.name, source_p->name, 
-				   ConfigFileEntry.min_nonwildcard);
+				   me.name, source_p->name, ConfigFileEntry.min_nonwildcard);
 		return 0;
 	}
 
@@ -160,18 +157,18 @@
 		{
 			if(bitlen < ConfigFileEntry.gline_min_cidr)
 			{
-				sendto_one(source_p, ":%s NOTICE %s :Cannot set G-Lines with cidr length < %d",
-					   me.name, source_p->name,
-					   ConfigFileEntry.gline_min_cidr);
+				sendto_one(source_p,
+					   ":%s NOTICE %s :Cannot set G-Lines with cidr length < %d",
+					   me.name, source_p->name, ConfigFileEntry.gline_min_cidr);
 				return 0;
 			}
 		}
 		/* ipv6 */
 		else if(bitlen < ConfigFileEntry.gline_min_cidr6)
 		{
-			sendto_one(source_p, ":%s NOTICE %s :Cannot set G-Lines with cidr length < %d",
-				   me.name, source_p->name, 
-				   ConfigFileEntry.gline_min_cidr6);
+			sendto_one(source_p,
+				   ":%s NOTICE %s :Cannot set G-Lines with cidr length < %d",
+				   me.name, source_p->name, ConfigFileEntry.gline_min_cidr6);
 			return 0;
 		}
 	}
@@ -191,27 +188,23 @@
 	majority_gline(source_p, user, host, reason);
 
 	/* 4 param version for hyb-7 servers */
-	sendto_server(NULL, NULL, CAP_GLN|CAP_TS6, NOCAPS,
-			":%s GLINE %s %s :%s", 
-			use_id(source_p), user, host, reason);
+	sendto_server(NULL, NULL, CAP_GLN | CAP_TS6, NOCAPS,
+		      ":%s GLINE %s %s :%s", use_id(source_p), user, host, reason);
 	sendto_server(NULL, NULL, CAP_GLN, CAP_TS6,
-			":%s GLINE %s %s :%s", 
-			source_p->name, user, host, reason);
+		      ":%s GLINE %s %s :%s", source_p->name, user, host, reason);
 
 	/* 8 param for hyb-6 */
 	sendto_server(NULL, NULL, NOCAPS, CAP_GLN,
 			":%s GLINE %s %s %s %s %s %s :%s",
 			me.name, source_p->name, source_p->username,
-			source_p->host, source_p->user->server, 
-			user, host, reason);
+		      source_p->host, source_p->user->server, user, host, reason);
 	return 0;
 }
 
 /* mc_gline()
  */
 static int
-mc_gline(struct Client *client_p, struct Client *source_p,
-	 int parc, const char *parv[])
+mc_gline(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
 	struct Client *acptr;
 	const char *user;
@@ -228,17 +221,14 @@
 	if(invalid_gline(acptr, user, host, reason))
 		return 0;
 
-	sendto_server(client_p, NULL, CAP_GLN|CAP_TS6, NOCAPS,
-		      ":%s GLINE %s %s :%s",
-		      use_id(acptr), user, host, reason);
+	sendto_server(client_p, NULL, CAP_GLN | CAP_TS6, NOCAPS,
+		      ":%s GLINE %s %s :%s", use_id(acptr), user, host, reason);
 	sendto_server(client_p, NULL, CAP_GLN, CAP_TS6,
-		      ":%s GLINE %s %s :%s",
-		      acptr->name, user, host, reason);
+		      ":%s GLINE %s %s :%s", acptr->name, user, host, reason);
 	sendto_server(client_p, NULL, NOCAPS, CAP_GLN,
 		      ":%s GLINE %s %s %s %s %s %s :%s",
 		      acptr->user->server, acptr->name, 
-		      acptr->username, acptr->host,
-		      acptr->user->server, user, host, reason);
+		      acptr->username, acptr->host, acptr->user->server, user, host, reason);
 
 	if(!ConfigFileEntry.glines)
 		return 0;
@@ -251,8 +241,7 @@
 				"%d non-wildcard characters for [%s@%s] [%s]",
 				acptr->name, acptr->username, 
 				acptr->host, acptr->user->server,
-				ConfigFileEntry.min_nonwildcard,
-				user, host, reason);
+				     ConfigFileEntry.min_nonwildcard, user, host, reason);
 		return 0;
 	}
 
@@ -266,12 +255,13 @@
 		{
 			if(bitlen < ConfigFileEntry.gline_min_cidr)
 			{
-				sendto_realops_flags(UMODE_ALL, L_ALL, "%s!%s@%s on %s is requesting a "
+				sendto_realops_flags(UMODE_ALL, L_ALL,
+						     "%s!%s@%s on %s is requesting a "
 						     "gline with a cidr mask < %d for [%s@%s] [%s]",
 						     acptr->name, acptr->username, acptr->host,
 						     acptr->user->server,
-						     ConfigFileEntry.gline_min_cidr, 
-						     user, host, reason);
+						     ConfigFileEntry.gline_min_cidr, user, host,
+						     reason);
 				return 0;
 			}
 		}
@@ -282,8 +272,7 @@
 					     "gline with a cidr mask < %d for [%s@%s] [%s]",
 					     acptr->name, acptr->username, acptr->host,
 					     acptr->user->server,
-					     ConfigFileEntry.gline_min_cidr6,
-					     user, host, reason);
+					     ConfigFileEntry.gline_min_cidr6, user, host, reason);
 			return 0;
 		}
 	}
@@ -336,17 +325,14 @@
 	if(invalid_gline(acptr, user, host, reason))
 		return 0;
 
-	sendto_server(client_p, NULL, CAP_GLN|CAP_TS6, NOCAPS,
-		      ":%s GLINE %s %s :%s",
-		      use_id(acptr), user, host, reason);
+	sendto_server(client_p, NULL, CAP_GLN | CAP_TS6, NOCAPS,
+		      ":%s GLINE %s %s :%s", use_id(acptr), user, host, reason);
 	sendto_server(client_p, NULL, CAP_GLN, CAP_TS6,
-		      ":%s GLINE %s %s :%s",
-		      acptr->name, user, host, reason);
+		      ":%s GLINE %s %s :%s", acptr->name, user, host, reason);
 	sendto_server(client_p, NULL, NOCAPS, CAP_GLN,
 		      ":%s GLINE %s %s %s %s %s %s :%s",
 		      acptr->user->server, acptr->name, 
-		      acptr->username, acptr->host,
-		      acptr->user->server, user, host, reason);
+		      acptr->username, acptr->host, acptr->user->server, user, host, reason);
 
 	if(!ConfigFileEntry.glines)
 		return 0;
@@ -359,8 +345,7 @@
 				"%d non-wildcard characters for [%s@%s] [%s]",
 				acptr->name, acptr->username, 
 				acptr->host, acptr->user->server,
-				ConfigFileEntry.min_nonwildcard,
-				user, host, reason);
+				     ConfigFileEntry.min_nonwildcard, user, host, reason);
 		return 0;
 	}
 
@@ -370,8 +355,7 @@
 			acptr->user->server, user, host, reason);
 
 	ilog(L_GLINE, "R %s %s %s %s %s %s %s",
-	     acptr->name, acptr->username, acptr->host, 
-	     acptr->user->server, user, host, reason);
+	     acptr->name, acptr->username, acptr->host, acptr->user->server, user, host, reason);
 
 	/* If at least 3 opers agree this user should be G lined then do it */
 	majority_gline(acptr, user, host, reason);
@@ -400,8 +384,7 @@
 
 	if(!IsOperUnkline(source_p) || !IsOperGline(source_p))
 	{
-		sendto_one(source_p, form_str(ERR_NOPRIVS),
-			   me.name, source_p->name, "unkline");
+		sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "unkline");
 		return 0;
 	}
 
@@ -463,7 +446,7 @@
 	nonwild = 0;
 	p = user;
 
-	while ((tmpch = *p++))
+	while((tmpch = *p++))
 	{
 		if(!IsKWildChar(tmpch))
 		{
@@ -477,7 +460,7 @@
 	{
 		/* user doesnt, try host */
 		p = host;
-		while ((tmpch = *p++))
+		while((tmpch = *p++))
 		{
 			if(!IsKWildChar(tmpch))
 				if(++nonwild >= ConfigFileEntry.min_nonwildcard)
@@ -498,8 +481,7 @@
  * side effects -
  */
 static int
-invalid_gline(struct Client *source_p, const char *luser,
-	      const char *lhost, char *lreason)
+invalid_gline(struct Client *source_p, const char *luser, const char *lhost, char *lreason)
 {
 	if(strchr(luser, '!'))
 	{
@@ -523,8 +505,7 @@
  * side effects	-
  */
 static void
-set_local_gline(struct Client *source_p, const char *user,
-		const char *host, const char *reason)
+set_local_gline(struct Client *source_p, const char *user, const char *host, const char *reason)
 {
 	char buffer[IRCD_BUFSIZE];
 	struct ConfItem *aconf;
@@ -541,7 +522,7 @@
 	aconf->flags |= CONF_FLAGS_TEMPORARY;
 
 	if(strlen(my_reason) > REASONLEN)
-		my_reason[REASONLEN-1] = '\0';
+		my_reason[REASONLEN - 1] = '\0';
 
 	if((oper_reason = strchr(my_reason, '|')) != NULL)
 	{
@@ -563,8 +544,7 @@
 	sendto_realops_flags(UMODE_ALL, L_ALL,
 			     "%s!%s@%s on %s has triggered gline for [%s@%s] [%s]",
 			     source_p->name, source_p->username,
-			     source_p->host, source_p->user->server,
-			     user, host, reason);
+			     source_p->host, source_p->user->server, user, host, reason);
 	ilog(L_GLINE, "T %s %s %s %s %s %s %s",
 	     source_p->name, source_p->username, source_p->host, 
 	     source_p->user->server, user, host, reason);
@@ -579,8 +559,7 @@
  * side effects -
  */
 static int
-majority_gline(struct Client *source_p, const char *user,
-	       const char *host, const char *reason)
+majority_gline(struct Client *source_p, const char *user, const char *host, const char *reason)
 {
 	dlink_node *pending_node;
 	struct gline_pending *pending;
@@ -596,8 +575,7 @@
 	{
 		pending = pending_node->data;
 
-		if((irccmp(pending->user, user) == 0) &&
-		   (irccmp(pending->host, host) == 0))
+		if((irccmp(pending->user, user) == 0) && (irccmp(pending->host, host) == 0))
 		{
 			/* check oper or server hasnt already voted */
 			if(((irccmp(pending->oper_user1, source_p->username) == 0) ||
@@ -630,8 +608,7 @@
 				}
 
 				/* trigger the gline using the original reason --fl */
-				set_local_gline(source_p, user, host,
-						pending->reason1);
+				set_local_gline(source_p, user, host, pending->reason1);
 
 				cleanup_glines();
 				return YES;
@@ -654,15 +631,11 @@
 	}
 
 	/* no pending gline, create a new one */
-	pending = (struct gline_pending *) 
-			    MyMalloc(sizeof(struct gline_pending));
+	pending = (struct gline_pending *) MyMalloc(sizeof(struct gline_pending));
 
-	strlcpy(pending->oper_nick1, source_p->name,
-		sizeof(pending->oper_nick1));
-	strlcpy(pending->oper_user1, source_p->username,
-		sizeof(pending->oper_user1));
-	strlcpy(pending->oper_host1, source_p->host,
-		sizeof(pending->oper_host1));
+	strlcpy(pending->oper_nick1, source_p->name, sizeof(pending->oper_nick1));
+	strlcpy(pending->oper_user1, source_p->username, sizeof(pending->oper_user1));
+	strlcpy(pending->oper_host1, source_p->host, sizeof(pending->oper_host1));
 
 	pending->oper_server1 = find_or_add(source_p->user->server);
 
@@ -693,19 +666,19 @@
 	struct irc_sockaddr_storage addr, caddr;
 	int bits, cbits;
 
-	parse_netmask(host, (struct sockaddr *)&addr, &bits);
+	parse_netmask(host, (struct sockaddr *) &addr, &bits);
 
 	DLINK_FOREACH(ptr, glines.head)
 	{
 		aconf = ptr->data;
 
-		parse_netmask(aconf->host, (struct sockaddr *)&caddr, &cbits);
+		parse_netmask(aconf->host, (struct sockaddr *) &caddr, &cbits);
 
 		if(user && irccmp(user, aconf->user))
 			continue;
 
 		if(!irccmp(aconf->host, host) && bits == cbits &&
-		   comp_with_mask_sock((struct sockaddr *)&addr, (struct sockaddr *)&caddr, bits))
+		   comp_with_mask_sock((struct sockaddr *) &addr, (struct sockaddr *) &caddr, bits))
 		{
 			dlinkDestroy(ptr, &glines);
 			delete_one_address_conf(aconf->host, aconf);
Index: modules/m_help.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_help.c,v
retrieving revision 1.67
diff -b -u -r1.67 m_help.c
--- modules/m_help.c	15 Mar 2004 17:58:03 -0000	1.67
+++ modules/m_help.c	19 Aug 2004 22:16:18 -0000
@@ -52,6 +52,7 @@
 };
 
 mapi_clist_av1 help_clist[] = { &help_msgtab, &uhelp_msgtab, NULL };
+
 DECLARE_MODULE_AV1(help, NULL, NULL, help_clist, NULL, NULL, "$Revision: 1.67 $");
 
 /*
@@ -67,8 +68,7 @@
 	if((last_used + ConfigFileEntry.pace_wait_simple) > CurrentTime)
 	{
 		/* safe enough to give this on a local connect only */
-		sendto_one(source_p, form_str(RPL_LOAD2HI), 
-			   me.name, source_p->name, "HELP");
+		sendto_one(source_p, form_str(RPL_LOAD2HI), me.name, source_p->name, "HELP");
 		sendto_one(source_p, form_str(RPL_ENDOFHELP),
 			   me.name, source_p->name,
 			   (parc > 1 && !EmptyString(parv[1])) ? parv[1] : "index");
@@ -123,8 +123,7 @@
 
 	if(hptr == NULL)
 	{
-		sendto_one(source_p, form_str(ERR_HELPNOTFOUND),
-			   me.name, source_p->name, topic);
+		sendto_one(source_p, form_str(ERR_HELPNOTFOUND), me.name, source_p->name, topic);
 		return;
 	}
 
@@ -143,7 +142,6 @@
 			   me.name, source_p->name, topic, lineptr->data);
 	}
 
-	sendto_one(source_p, form_str(RPL_ENDOFHELP),
-		   me.name, source_p->name, topic);
+	sendto_one(source_p, form_str(RPL_ENDOFHELP), me.name, source_p->name, topic);
 	return;
 }
Index: modules/m_info.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_info.c,v
retrieving revision 1.109.2.1
diff -b -u -r1.109.2.1 m_info.c
--- modules/m_info.c	4 Aug 2004 00:21:11 -0000	1.109.2.1
+++ modules/m_info.c	19 Aug 2004 22:16:19 -0000
@@ -59,8 +59,8 @@
 
 mapi_clist_av1 info_clist[] = { &info_msgtab, NULL };
 mapi_hlist_av1 info_hlist[] = {
-	{ "doing_info",		&doing_info_hook },
-	{ NULL, NULL }
+	{"doing_info", &doing_info_hook},
+	{NULL, NULL}
 };
 
 DECLARE_MODULE_AV1(info, NULL, NULL, info_clist, info_hlist, NULL, "$Revision: 1.109.2.1 $");
@@ -588,8 +588,7 @@
 	if((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
 	{
 		/* safe enough to give this on a local connect only */
-		sendto_one(source_p, form_str(RPL_LOAD2HI),
-			   me.name, source_p->name, "INFO");
+		sendto_one(source_p, form_str(RPL_LOAD2HI), me.name, source_p->name, "INFO");
 		sendto_one_numeric(source_p, RPL_ENDOFINFO, form_str(RPL_ENDOFINFO));
 		return 0;
 	}
@@ -645,7 +644,7 @@
 {
 	const char **text = infotext;
 
-	while (*text)
+	while(*text)
 	{
 		sendto_one_numeric(source_p, RPL_INFO, form_str(RPL_INFO), *text++);
 	}
@@ -689,30 +688,28 @@
 	 * Now send them a list of all our configuration options
 	 * (mostly from config.h)
 	 */
-	for (infoptr = MyInformation; infoptr->name; infoptr++)
+	for(infoptr = MyInformation; infoptr->name; infoptr++)
 	{
 		if(infoptr->intvalue)
 		{
 			sendto_one(source_p, ":%s %d %s :%-30s %-5d [%-30s]",
 				   get_id(&me, source_p), RPL_INFO,
 				   get_id(source_p, source_p),
-				   infoptr->name, infoptr->intvalue, 
-				   infoptr->desc);
+				   infoptr->name, infoptr->intvalue, infoptr->desc);
 		}
 		else
 		{
 			sendto_one(source_p, ":%s %d %s :%-30s %-5s [%-30s]",
 				   get_id(&me, source_p), RPL_INFO,
 				   get_id(source_p, source_p),
-				   infoptr->name, infoptr->strvalue, 
-				   infoptr->desc);
+				   infoptr->name, infoptr->strvalue, infoptr->desc);
 		}
 	}
 
 	/*
 	 * Parse the info_table[] and do the magic.
 	 */
-	for (i = 0; info_table[i].name; i++)
+	for(i = 0; info_table[i].name; i++)
 	{
 		switch (info_table[i].output_type)
 		{
Index: modules/m_invite.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/Attic/m_invite.c,v
retrieving revision 1.81
diff -b -u -r1.81 m_invite.c
--- modules/m_invite.c	20 Mar 2004 01:31:14 -0000	1.81
+++ modules/m_invite.c	19 Aug 2004 22:16:19 -0000
@@ -48,6 +48,7 @@
 	{mg_unreg, {m_invite, 3}, {m_invite, 3}, mg_ignore, mg_ignore, {m_invite, 3}}
 };
 mapi_clist_av1 invite_clist[] = { &invite_msgtab, NULL };
+
 DECLARE_MODULE_AV1(invite, NULL, NULL, invite_clist, NULL, NULL, "$Revision: 1.81 $");
 
 static void add_invite(struct Channel *, struct Client *);
@@ -71,16 +72,13 @@
 	if((target_p = find_person(parv[1])) == NULL)
 	{
 		sendto_one_numeric(source_p, ERR_NOSUCHNICK, 
-				   form_str(ERR_NOSUCHNICK), 
-				   IsDigit(parv[1][0]) ? "*" : parv[1]);
+				   form_str(ERR_NOSUCHNICK), IsDigit(parv[1][0]) ? "*" : parv[1]);
 		return 0;
 	}
 
 	if(check_channel_name(parv[2]) == 0)
 	{
-		sendto_one_numeric(source_p, ERR_BADCHANNAME,
-				   form_str(ERR_BADCHANNAME),
-				   parv[2]);
+		sendto_one_numeric(source_p, ERR_BADCHANNAME, form_str(ERR_BADCHANNAME), parv[2]);
 		return 0;
 	}
 
@@ -97,8 +95,7 @@
 	 */
 	if(parv[2][0] == '&' && !MyConnect(target_p))
 	{
-		sendto_one(source_p, form_str(ERR_USERNOTONSERV),
-			   me.name, source_p->name, parv[1]);
+		sendto_one(source_p, form_str(ERR_USERNOTONSERV), me.name, source_p->name, parv[1]);
 		return 0;
 	}
 
@@ -112,8 +109,7 @@
 	msptr = find_channel_membership(chptr, source_p);
 	if(MyClient(source_p) && (msptr == NULL))
 	{
-		sendto_one_numeric(source_p, ERR_NOTONCHANNEL,
-				   form_str(ERR_NOTONCHANNEL), parv[2]);
+		sendto_one_numeric(source_p, ERR_NOTONCHANNEL, form_str(ERR_NOTONCHANNEL), parv[2]);
 		return 0;
 	}
 
@@ -141,8 +137,7 @@
 	if(MyConnect(source_p))
 	{
 		sendto_one(source_p, form_str(RPL_INVITING), 
-			   me.name, source_p->name,
-			   target_p->name, parv[2]);
+			   me.name, source_p->name, target_p->name, parv[2]);
 		if(target_p->user->away)
 			sendto_one_numeric(source_p, RPL_AWAY, form_str(RPL_AWAY),
 					   target_p->name, target_p->user->away);
@@ -159,8 +154,7 @@
 	}
 	else if(target_p->from != client_p)
 	{
-		sendto_one_prefix(target_p, source_p, "INVITE", ":%s",
-				  chptr->chname);
+		sendto_one_prefix(target_p, source_p, "INVITE", ":%s", chptr->chname);
 	}
 
 	return 0;
@@ -185,8 +179,7 @@
 	}
 
 	/* ok, if their invite list is too long, remove the tail */
-	if((int)dlink_list_length(&who->user->invited) >= 
-	   ConfigChannel.max_chans_per_user)
+	if((int) dlink_list_length(&who->user->invited) >= ConfigChannel.max_chans_per_user)
 	{
 		ptr = who->user->invited.tail;
 		del_invite(ptr->data, who);
@@ -198,5 +191,3 @@
 	/* add channel to user invite list */
 	dlinkAddAlloc(chptr, &who->user->invited);
 }
-
-
Index: modules/m_ison.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_ison.c,v
retrieving revision 1.51
diff -b -u -r1.51 m_ison.c
--- modules/m_ison.c	15 Mar 2004 17:58:03 -0000	1.51
+++ modules/m_ison.c	19 Aug 2004 22:16:19 -0000
@@ -48,6 +48,7 @@
 };
 
 mapi_clist_av1 ison_clist[] = { &ison_msgtab, NULL };
+
 DECLARE_MODULE_AV1(ison, NULL, NULL, ison_clist, NULL, NULL, "$Revision: 1.51 $");
 
 static char buf[BUFSIZE];
@@ -84,10 +85,10 @@
 	/* rfc1489 is ambigious about how to handle ISON
 	 * this should handle both interpretations.
 	 */
-	for (i = 1; i < parc; i++)
+	for(i = 1; i < parc; i++)
 	{
 		char *cs = LOCAL_COPY(parv[i]);
-		for (nick = strtoken(&p, cs, " "); nick; nick = strtoken(&p, NULL, " "))
+		for(nick = strtoken(&p, cs, " "); nick; nick = strtoken(&p, NULL, " "))
 		{
 			target_p = find_named_client(nick);
 
Index: modules/m_kline.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_kline.c,v
retrieving revision 1.183.2.1
diff -b -u -r1.183.2.1 m_kline.c
--- modules/m_kline.c	3 Aug 2004 20:39:47 -0000	1.183.2.1
+++ modules/m_kline.c	19 Aug 2004 22:16:19 -0000
@@ -65,6 +65,7 @@
 };
 
 mapi_clist_av1 kline_clist[] = { &kline_msgtab, &unkline_msgtab, NULL };
+
 DECLARE_MODULE_AV1(kline, NULL, NULL, kline_clist, NULL, NULL, "$Revision: 1.183.2.1 $");
 
 /* Local function prototypes */
@@ -81,8 +82,7 @@
 			 const char *, const char *, const char *, int);
 static int already_placed_kline(struct Client *, const char *, const char *, int);
 
-static void handle_remote_unkline(struct Client *source_p, 
-			const char *user, const char *host);
+static void handle_remote_unkline(struct Client *source_p, const char *user, const char *host);
 static void remove_permkline_match(struct Client *, const char *, const char *);
 static int flush_write(struct Client *, FBFILE *, const char *, const char *);
 static int remove_temp_kline(const char *, const char *);
@@ -96,8 +96,7 @@
  *   parv[5] - reason
  */
 static int
-mo_kline(struct Client *client_p, struct Client *source_p,
-	 int parc, const char **parv)
+mo_kline(struct Client *client_p, struct Client *source_p, int parc, const char **parv)
 {
 	char def[] = "No Reason";
 	char user[USERLEN + 2];
@@ -113,8 +112,7 @@
 
 	if(!IsOperK(source_p))
 	{
-		sendto_one(source_p, form_str(ERR_NOPRIVS),
-			   me.name, source_p->name, "kline");
+		sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "kline");
 		return 0;
 	}
 
@@ -129,9 +127,9 @@
 
 	loc++;
 
-	if(parc >= loc+2 && !irccmp(parv[loc], "ON"))
+	if(parc >= loc + 2 && !irccmp(parv[loc], "ON"))
 	{
-		target_server = parv[loc+1];
+		target_server = parv[loc + 1];
 		loc += 2;
 	}
 
@@ -147,8 +145,7 @@
 	if(target_server != NULL)
 	{
 		propagate_generic(source_p, "KLINE", target_server, CAP_KLN,
-				"%d %s %s %s",
-				tkline_time, user, host, reason);
+				  "%d %s %s %s", tkline_time, user, host, reason);
 
 		/* If we are sending it somewhere that doesnt include us, stop */
 		if(!match(target_server, me.name))
@@ -157,12 +154,10 @@
 	/* if we have cluster servers, send it to them.. */
 	else if(dlink_list_length(&cluster_conf_list) > 0)
 		cluster_generic(source_p, "KLINE", SHARED_KLINE, CAP_KLN,
-				"%lu %s %s :%s",
-				tkline_time, user, host, reason);
+				"%lu %s %s :%s", tkline_time, user, host, reason);
 
 	if(!valid_user_host(source_p, user, host) || 
-	   !valid_wild_card(source_p, user, host) ||
-	   !valid_comment(source_p, reason))
+	   !valid_wild_card(source_p, user, host) || !valid_comment(source_p, reason))
 		return 0;
 
 	if(already_placed_kline(source_p, user, host, tkline_time))
@@ -230,8 +225,7 @@
 	int tkline_time = atoi(parv[2]);
 
 	propagate_generic(source_p, "KLINE", parv[1], CAP_KLN,
-			"%d %s %s %s",
-			tkline_time, parv[3], parv[4], parv[5]);
+			  "%d %s %s %s", tkline_time, parv[3], parv[4], parv[5]);
 
 	if(!match(parv[1], me.name))
 		return 0;
@@ -268,8 +262,7 @@
 		return;
 
 	if(!valid_user_host(source_p, user, host) ||
-	   !valid_wild_card(source_p, user, host) ||
-	   !valid_comment(source_p, reason))
+	   !valid_wild_card(source_p, user, host) || !valid_comment(source_p, reason))
 		return;
 
 	if(already_placed_kline(source_p, user, host, tkline_time))
@@ -295,8 +288,7 @@
 	current_date = smalldate();
 
 	if(tkline_time > 0)
-		apply_tkline(source_p, aconf, reason, oper_reason,
-				current_date, tkline_time);
+		apply_tkline(source_p, aconf, reason, oper_reason, current_date, tkline_time);
 	else
 		apply_kline(source_p, aconf, aconf->passwd, oper_reason, current_date);
 
@@ -331,8 +323,7 @@
 
 	if(!IsOperUnkline(source_p))
 	{
-		sendto_one(source_p, form_str(ERR_NOPRIVS),
-			   me.name, source_p->name, "unkline");
+		sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "unkline");
 		return 0;
 	}
 
@@ -360,8 +351,7 @@
 	/* possible remote kline.. */
 	if((parc > 3) && (irccmp(parv[2], "ON") == 0))
 	{
-		propagate_generic(source_p, "UNKLINE", parv[3], CAP_UNKLN,
-				"%s %s", user, host);
+		propagate_generic(source_p, "UNKLINE", parv[3], CAP_UNKLN, "%s %s", user, host);
 
 		if(match(parv[3], me.name) == 0)
 			return 0;
@@ -378,8 +368,7 @@
 		sendto_realops_flags(UMODE_ALL, L_ALL,
 				     "%s has removed the temporary K-Line for: [%s@%s]",
 				     get_oper_name(source_p), user, host);
-		ilog(L_KLINE, "UK %s %s %s",
-			get_oper_name(source_p), user, host);
+		ilog(L_KLINE, "UK %s %s %s", get_oper_name(source_p), user, host);
 		return 0;
 	}
 
@@ -399,8 +388,7 @@
 {
 	/* parv[0]  parv[1]        parv[2]  parv[3]
 	 * oper     target server  user     host    */
-	propagate_generic(source_p, "UNKLINE", parv[1], CAP_UNKLN,
-			"%s %s", parv[2], parv[3]);
+	propagate_generic(source_p, "UNKLINE", parv[1], CAP_UNKLN, "%s %s", parv[2], parv[3]);
 
 	if(!match(parv[1], me.name))
 		return 0;
@@ -433,15 +421,13 @@
 	if(remove_temp_kline(user, host))
 	{
 		sendto_one_notice(source_p,
-				":Un-klined [%s@%s] from temporary k-lines",
-				user, host);
+				  ":Un-klined [%s@%s] from temporary k-lines", user, host);
 
 		sendto_realops_flags(UMODE_ALL, L_ALL,
 				"%s has removed the temporary K-Line for: [%s@%s]",
 				get_oper_name(source_p), user, host);
 
-		ilog(L_KLINE, "UK %s %s %s",
-			get_oper_name(source_p), user, host);
+		ilog(L_KLINE, "UK %s %s %s", get_oper_name(source_p), user, host);
 		return;
 	}
 
@@ -485,8 +471,7 @@
 				     get_oper_name(source_p), tkline_time / 60,
 				     aconf->user, aconf->host, reason);
 		ilog(L_KLINE, "K %s %d %s %s %s",
-			get_oper_name(source_p), tkline_time / 60,
-			aconf->user, aconf->host, reason);
+		     get_oper_name(source_p), tkline_time / 60, aconf->user, aconf->host, reason);
 	}
 	else
 	{
@@ -578,7 +563,7 @@
 
 	/* check there are enough non wildcard chars */
 	p = luser;
-	while ((tmpch = *p++))
+	while((tmpch = *p++))
 	{
 		if(!IsKWildChar(tmpch))
 		{
@@ -590,7 +575,7 @@
 
 	/* try host, as user didnt contain enough */
 	p = lhost;
-	while ((tmpch = *p++))
+	while((tmpch = *p++))
 	{
 		if(!IsKWildChar(tmpch))
 			if(++nonwild >= ConfigFileEntry.min_nonwildcard)
@@ -599,8 +584,7 @@
 
 	sendto_one_notice(source_p,
 		   	  ":Please include at least %d non-wildcard "
-			  "characters with the user@host",
-			  ConfigFileEntry.min_nonwildcard);
+			  "characters with the user@host", ConfigFileEntry.min_nonwildcard);
 	return 0;
 }
 
@@ -646,7 +630,7 @@
         int t;
 	if(ConfigFileEntry.non_redundant_klines)
 	{
-		if((t = parse_netmask(lhost, (struct sockaddr *)&iphost, NULL)) != HM_HOST)
+		if((t = parse_netmask(lhost, (struct sockaddr *) &iphost, NULL)) != HM_HOST)
 		{
 #ifdef IPV6
 			if(t == HM_IPV6)
@@ -660,7 +644,8 @@
 		else
 			piphost = NULL;
 
-		if((aconf = find_conf_by_address(lhost, (struct sockaddr *)piphost, CONF_KILL, t, luser)))
+		if((aconf =
+		    find_conf_by_address(lhost, (struct sockaddr *) piphost, CONF_KILL, t, luser)))
 		{
 			/* setting a tkline, or existing one is perm */
 			if(tkline || ((aconf->flags & CONF_FLAGS_TEMPORARY) == 0))
@@ -669,8 +654,7 @@
 
 				sendto_one_notice(source_p,
 						  ":[%s@%s] already K-Lined by [%s@%s] - %s",
-						  luser, lhost, aconf->user,
-						  aconf->host, reason);
+						  luser, lhost, aconf->user, aconf->host, reason);
 				return 1;
 			}
 		}
@@ -696,8 +680,7 @@
 	mode_t oldumask;
 	char *p;
 
-	ircsnprintf(temppath, sizeof(temppath),
-		 "%s.tmp", ConfigFileEntry.klinefile);
+	ircsnprintf(temppath, sizeof(temppath), "%s.tmp", ConfigFileEntry.klinefile);
 
 	filename = get_conf_name(KLINE_TYPE);
 
@@ -717,7 +700,7 @@
 	}
 	umask(oldumask);
 
-	while (fbgets(buf, sizeof(buf), in))
+	while(fbgets(buf, sizeof(buf), in))
 	{
 		char *found_host, *found_user;
 
@@ -771,8 +754,7 @@
 	}
 	else if(!pairme)
 	{
-		sendto_one_notice(source_p, ":No K-Line for %s@%s",
-				  user, host);
+		sendto_one_notice(source_p, ":No K-Line for %s@%s", user, host);
 
 		if(temppath != NULL)
 			(void) unlink(temppath);
@@ -783,15 +765,13 @@
 	(void) rename(temppath, filename);
 	rehash(0);
 
-	sendto_one_notice(source_p, ":K-Line for [%s@%s] is removed",
-			  user, host);
+	sendto_one_notice(source_p, ":K-Line for [%s@%s] is removed", user, host);
 
 	sendto_realops_flags(UMODE_ALL, L_ALL,
 			     "%s has removed the K-Line for: [%s@%s]",
 			     get_oper_name(source_p), user, host);
 
-	ilog(L_KLINE, "UK %s %s %s",
-		get_oper_name(source_p), user, host);
+	ilog(L_KLINE, "UK %s %s %s", get_oper_name(source_p), user, host);
 	return;
 }
 
@@ -824,8 +804,7 @@
 
 	if(error_on_write)
 	{
-		sendto_one_notice(source_p, ":Unable to write to %s",
-				  temppath);
+		sendto_one_notice(source_p, ":Unable to write to %s", temppath);
 		fbclose(out);
 		if(temppath != NULL)
 			(void) unlink(temppath);
@@ -857,9 +836,9 @@
 	int bits, cbits;
 	int i;
 
-	parse_netmask(host, (struct sockaddr *)&addr, &bits);
+	parse_netmask(host, (struct sockaddr *) &addr, &bits);
 
-	for (i = 0; tkline_list[i] != NULL; i++)
+	for(i = 0; tkline_list[i] != NULL; i++)
 	{
 		tklist = tkline_list[i];
 
@@ -867,14 +846,16 @@
 		{
 			aconf = ptr->data;
 
-			parse_netmask(aconf->host, (struct sockaddr *)&caddr, &cbits);
+			parse_netmask(aconf->host, (struct sockaddr *) &caddr, &cbits);
 
 			if(user && irccmp(user, aconf->user))
 				continue;
 
 			if(!irccmp(aconf->host, host) || (bits == cbits
-							  && comp_with_mask_sock((struct sockaddr *)&addr,
-									    (struct sockaddr *)&caddr, bits)))
+							  && comp_with_mask_sock((struct sockaddr *)
+										 &addr,
+										 (struct sockaddr *)
+										 &caddr, bits)))
 			{
 				dlinkDestroy(ptr, tklist);
 				delete_one_address_conf(aconf->host, aconf);
Index: modules/m_knock.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_knock.c,v
retrieving revision 1.88
diff -b -u -r1.88 m_knock.c
--- modules/m_knock.c	15 Mar 2004 17:58:03 -0000	1.88
+++ modules/m_knock.c	19 Aug 2004 22:16:19 -0000
@@ -47,6 +47,7 @@
 };
 
 mapi_clist_av1 knock_clist[] = { &knock_msgtab, NULL };
+
 DECLARE_MODULE_AV1(knock, NULL, NULL, knock_clist, NULL, NULL, "$Revision: 1.88 $");
 
 /* m_knock
@@ -71,8 +72,7 @@
 
 	if(MyClient(source_p) && ConfigChannel.use_knock == 0)
 	{
-		sendto_one(source_p, form_str(ERR_KNOCKDISABLED),
-			   me.name, source_p->name);
+		sendto_one(source_p, form_str(ERR_KNOCKDISABLED), me.name, source_p->name);
 		return 0;
 	}
 
@@ -84,15 +84,13 @@
 
 	if(!IsChannelName(name))
 	{
-		sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
-				   form_str(ERR_NOSUCHCHANNEL), name);
+		sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL, form_str(ERR_NOSUCHCHANNEL), name);
 		return 0;
 	}
 
 	if((chptr = find_channel(name)) == NULL)
 	{
-		sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
-				   form_str(ERR_NOSUCHCHANNEL), name);
+		sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL, form_str(ERR_NOSUCHCHANNEL), name);
 		return 0;
 	}
 
@@ -106,10 +104,9 @@
 
 	if(!((chptr->mode.mode & MODE_INVITEONLY) || (*chptr->mode.key) || 
 	     (chptr->mode.limit && 
-	      dlink_list_length(&chptr->members) >= (unsigned long)chptr->mode.limit)))
+	      dlink_list_length(&chptr->members) >= (unsigned long) chptr->mode.limit)))
 	{
-		sendto_one_numeric(source_p, ERR_CHANOPEN,
-				   form_str(ERR_CHANOPEN), name);
+		sendto_one_numeric(source_p, ERR_CHANOPEN, form_str(ERR_CHANOPEN), name);
 		return 0;
 	}
 
@@ -153,21 +150,18 @@
 		/* ok, we actually can send the knock, tell client */
 		source_p->localClient->last_knock = CurrentTime;
 
-		sendto_one(source_p, form_str(RPL_KNOCKDLVR),
-			   me.name, source_p->name, name);
+		sendto_one(source_p, form_str(RPL_KNOCKDLVR), me.name, source_p->name, name);
 	}
 
 	chptr->last_knock = CurrentTime;
 
 	if(ConfigChannel.use_knock)
-		sendto_channel_local(ONLY_CHANOPS, chptr, form_str(RPL_KNOCK),
+		sendto_channel_local(ONLY_CHANOPSHALFOPS, chptr, form_str(RPL_KNOCK),
 				     me.name, name, name, source_p->name,
 				     source_p->username, source_p->host);
 
-	sendto_server(client_p, chptr, CAP_KNOCK|CAP_TS6, NOCAPS,
+	sendto_server(client_p, chptr, CAP_KNOCK | CAP_TS6, NOCAPS,
 		      ":%s KNOCK %s", use_id(source_p), name);
-	sendto_server(client_p, chptr, CAP_KNOCK, CAP_TS6,
-		      ":%s KNOCK %s", source_p->name, name);
+	sendto_server(client_p, chptr, CAP_KNOCK, CAP_TS6, ":%s KNOCK %s", source_p->name, name);
 	return 0;
 }
-
Index: modules/m_links.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_links.c,v
retrieving revision 1.64
diff -b -u -r1.64 m_links.c
--- modules/m_links.c	8 Jul 2004 17:36:55 -0000	1.64
+++ modules/m_links.c	19 Aug 2004 22:16:20 -0000
@@ -50,8 +50,8 @@
 
 mapi_clist_av1 links_clist[] = { &links_msgtab, NULL };
 mapi_hlist_av1 links_hlist[] = {
-	{ "doing_links",	&doing_links_hook },
-	{ NULL, NULL }
+	{"doing_links", &doing_links_hook},
+	{NULL, NULL}
 };
 
 DECLARE_MODULE_AV1(links, NULL, NULL, links_clist, links_hlist, NULL, "$Revision: 1.64 $");
@@ -145,12 +145,10 @@
 	DLINK_FOREACH(ptr, links_cache_list.head)
 	{
 		sendto_one(source_p, ":%s 364 %s %s",
-			   me.name, source_p->name, (const char *)ptr->data);
+			   me.name, source_p->name, (const char *) ptr->data);
 	}
 
-	sendto_one_numeric(source_p, RPL_LINKS, form_str(RPL_LINKS), 
-			   me.name, me.name, 0, me.info);
+	sendto_one_numeric(source_p, RPL_LINKS, form_str(RPL_LINKS), me.name, me.name, 0, me.info);
 
 	sendto_one_numeric(source_p, RPL_ENDOFLINKS, form_str(RPL_ENDOFLINKS), "*");
 }
-
Index: modules/m_list.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_list.c,v
retrieving revision 1.78
diff -b -u -r1.78 m_list.c
--- modules/m_list.c	12 Apr 2004 23:36:45 -0000	1.78
+++ modules/m_list.c	19 Aug 2004 22:16:20 -0000
@@ -49,6 +49,7 @@
 };
 
 mapi_clist_av1 list_clist[] = { &list_msgtab, NULL };
+
 DECLARE_MODULE_AV1(list, NULL, NULL, list_clist, NULL, NULL, "$Revision: 1.78 $");
 
 static void list_all_channels(struct Client *source_p);
@@ -67,8 +68,7 @@
 	/* pace this due to the sheer traffic involved */
 	if(((last_used + ConfigFileEntry.pace_wait) > CurrentTime))
 	{
-		sendto_one(source_p, form_str(RPL_LOAD2HI),
-			   me.name, source_p->name, "LIST");
+		sendto_one(source_p, form_str(RPL_LOAD2HI), me.name, source_p->name, "LIST");
 		sendto_one(source_p, form_str(RPL_LISTEND), me.name, source_p->name);
 		return 0;
 	}
@@ -244,8 +244,7 @@
 
 	if(*n == '\0')
 	{
-		sendto_one_numeric(source_p, ERR_NOSUCHNICK, 
-				   form_str(ERR_NOSUCHNICK), name);
+		sendto_one_numeric(source_p, ERR_NOSUCHNICK, form_str(ERR_NOSUCHNICK), name);
 		sendto_one(source_p, form_str(RPL_LISTEND), me.name, source_p->name);
 		return;
 	}
@@ -254,8 +253,7 @@
 
 	if(chptr == NULL)
 	{
-		sendto_one_numeric(source_p, ERR_NOSUCHNICK,
-				   form_str(ERR_NOSUCHNICK), n);
+		sendto_one_numeric(source_p, ERR_NOSUCHNICK, form_str(ERR_NOSUCHNICK), n);
 		sendto_one(source_p, form_str(RPL_LISTEND), me.name, source_p->name);
 		return;
 	}
Index: modules/m_locops.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_locops.c,v
retrieving revision 1.51
diff -b -u -r1.51 m_locops.c
--- modules/m_locops.c	31 Mar 2004 00:03:01 -0000	1.51
+++ modules/m_locops.c	19 Aug 2004 22:16:20 -0000
@@ -49,6 +49,7 @@
 };
 
 mapi_clist_av1 locops_clist[] = { &locops_msgtab, NULL };
+
 DECLARE_MODULE_AV1(locops, NULL, NULL, locops_clist, NULL, NULL, "$Revision: 1.51 $");
 
 /*
@@ -63,8 +64,7 @@
 	sendto_wallops_flags(UMODE_LOCOPS, source_p, "LOCOPS - %s", parv[1]);
 	
 	if(dlink_list_length(&cluster_conf_list) > 0)
-		cluster_generic(source_p, "LOCOPS", SHARED_LOCOPS, CAP_CLUSTER,
-				":%s", parv[1]);
+		cluster_generic(source_p, "LOCOPS", SHARED_LOCOPS, CAP_CLUSTER, ":%s", parv[1]);
 
 	return 0;
 }
@@ -75,8 +75,7 @@
 	/* parv[0]  parv[1]      parv[2]
 	 * oper     target serv  message
 	 */
-	propagate_generic(source_p, "LOCOPS", parv[1], CAP_CLUSTER, 
-				":%s", parv[2]);
+	propagate_generic(source_p, "LOCOPS", parv[1], CAP_CLUSTER, ":%s", parv[2]);
 
 	if(!match(parv[1], me.name))
 		return 0;
@@ -88,8 +87,7 @@
 }
 
 static int
-me_locops(struct Client *client_p, struct Client *source_p,
-		int parc, const char *parv[])
+me_locops(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
 	if(!IsPerson(source_p))
 		return 0;
@@ -99,4 +97,3 @@
 
 	return 0;
 }
-
Index: modules/m_lusers.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_lusers.c,v
retrieving revision 1.43
diff -b -u -r1.43 m_lusers.c
--- modules/m_lusers.c	15 Mar 2004 17:58:03 -0000	1.43
+++ modules/m_lusers.c	19 Aug 2004 22:16:20 -0000
@@ -45,6 +45,7 @@
 };
 
 mapi_clist_av1 lusers_clist[] = { &lusers_msgtab, NULL };
+
 DECLARE_MODULE_AV1(lusers, NULL, NULL, lusers_clist, NULL, NULL, "$Revision: 1.43 $");
 
 /*
@@ -61,7 +62,7 @@
 {
 	static time_t last_used = 0;
 
-	if (parc > 2)
+	if(parc > 2)
 	{
 		if((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
 		{
Index: modules/m_map.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_map.c,v
retrieving revision 1.36
diff -b -u -r1.36 m_map.c
--- modules/m_map.c	3 Mar 2004 23:03:04 -0000	1.36
+++ modules/m_map.c	19 Aug 2004 22:16:20 -0000
@@ -41,6 +41,7 @@
 };
 
 mapi_clist_av1 map_clist[] = { &map_msgtab, NULL };
+
 DECLARE_MODULE_AV1(map, NULL, NULL, map_clist, NULL, NULL, "$Revision: 1.36 $");
 
 static void dump_map(struct Client *client_p, struct Client *root, char *pbuf);
@@ -91,7 +92,7 @@
 	*pbuf = '\0';
 
 	strlcat(pbuf, root_p->name, BUFSIZE);
-	if (has_id(root_p))
+	if(has_id(root_p))
 	{
 		strlcat(pbuf, "[", BUFSIZE);
 		strlcat(pbuf, root_p->id, BUFSIZE);
@@ -102,7 +103,7 @@
 
 	if(len < USER_COL)
 	{
-		for (i = len + 1; i < USER_COL; i++)
+		for(i = len + 1; i < USER_COL; i++)
 		{
 			buf[i] = '-';
 		}
Index: modules/m_motd.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_motd.c,v
retrieving revision 1.55
diff -b -u -r1.55 m_motd.c
--- modules/m_motd.c	8 Jul 2004 17:36:55 -0000	1.55
+++ modules/m_motd.c	19 Aug 2004 22:16:20 -0000
@@ -50,8 +50,8 @@
 
 mapi_clist_av1 motd_clist[] = { &motd_msgtab, NULL };
 mapi_hlist_av1 motd_hlist[] = {
-	{ "doing_motd",	&doing_motd_hook },
-	{ NULL, NULL }
+	{"doing_motd", &doing_motd_hook},
+	{NULL, NULL}
 };
 
 DECLARE_MODULE_AV1(motd, NULL, NULL, motd_clist, motd_hlist, NULL, "$Revision: 1.55 $");
@@ -71,10 +71,8 @@
 	if((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
 	{
 		/* safe enough to give this on a local connect only */
-		sendto_one(source_p, form_str(RPL_LOAD2HI),
-			   me.name, source_p->name, "MOTD");
-		sendto_one(source_p, form_str(RPL_ENDOFMOTD),
-			   me.name, source_p->name);
+		sendto_one(source_p, form_str(RPL_LOAD2HI), me.name, source_p->name, "MOTD");
+		sendto_one(source_p, form_str(RPL_ENDOFMOTD), me.name, source_p->name);
 		return 0;
 	}
 	else
Index: modules/m_names.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/Attic/m_names.c,v
retrieving revision 1.79
diff -b -u -r1.79 m_names.c
--- modules/m_names.c	15 Mar 2004 17:58:03 -0000	1.79
+++ modules/m_names.c	19 Aug 2004 22:16:20 -0000
@@ -49,6 +49,7 @@
 };
 
 mapi_clist_av1 names_clist[] = { &names_msgtab, NULL };
+
 DECLARE_MODULE_AV1(names, NULL, NULL, names_clist, NULL, NULL, "$Revision: 1.79 $");
 
 static void names_global(struct Client *source_p);
@@ -78,16 +79,14 @@
 		if(!check_channel_name(p))
 		{
 			sendto_one_numeric(source_p, ERR_BADCHANNAME,
-					   form_str(ERR_BADCHANNAME),
-					   (unsigned char *) p);
+					   form_str(ERR_BADCHANNAME), (unsigned char *) p);
 			return 0;
 		}
 
 		if((chptr = find_channel(p)) != NULL)
 			channel_member_names(chptr, source_p, 1);
 		else
-			sendto_one(source_p, form_str(RPL_ENDOFNAMES), 
-				   me.name, source_p->name, p);
+			sendto_one(source_p, form_str(RPL_ENDOFNAMES), me.name, source_p->name, p);
 	}
 	else
 	{
@@ -106,8 +105,7 @@
 		}
 
 		names_global(source_p);
-		sendto_one(source_p, form_str(RPL_ENDOFNAMES), 
-			   me.name, source_p->name, "*");
+		sendto_one(source_p, form_str(RPL_ENDOFNAMES), me.name, source_p->name, "*");
 	}
 
 	return 0;
@@ -140,8 +138,7 @@
 		chptr = ptr->data;
 		channel_member_names(chptr, source_p, 0);
 	}
-	cur_len = mlen = ircsprintf(buf, form_str(RPL_NAMREPLY), 
-				    me.name, source_p->name, "*", "*");
+	cur_len = mlen = ircsprintf(buf, form_str(RPL_NAMREPLY), me.name, source_p->name, "*", "*");
 	t = buf + mlen;
 
 	/* Second, do all clients in one big sweep */
@@ -165,8 +162,7 @@
 			msptr = lp->data;
 			chptr = msptr->chptr;
 
-			if(PubChannel(chptr) || IsMember(source_p, chptr) ||
-			   SecretChannel(chptr))
+			if(PubChannel(chptr) || IsMember(source_p, chptr) || SecretChannel(chptr))
 			{
 				dont_show = YES;
 				break;
Index: modules/m_oper.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_oper.c,v
retrieving revision 1.82
diff -b -u -r1.82 m_oper.c
--- modules/m_oper.c	15 Mar 2004 17:58:03 -0000	1.82
+++ modules/m_oper.c	19 Aug 2004 22:16:20 -0000
@@ -51,6 +51,7 @@
 };
 
 mapi_clist_av1 oper_clist[] = { &oper_msgtab, NULL };
+
 DECLARE_MODULE_AV1(oper, NULL, NULL, oper_clist, NULL, NULL, "$Revision: 1.82 $");
 
 static int match_oper_password(const char *password, struct oper_conf *oper_p);
@@ -83,15 +84,13 @@
 	if(!IsFloodDone(source_p))
 		flood_endgrace(source_p);
 
-	oper_p = find_oper_conf(source_p->username, source_p->host, 
-				source_p->sockhost, name);
+	oper_p = find_oper_conf(source_p->username, source_p->host, source_p->sockhost, name);
 
 	if(oper_p == NULL)
 	{
 		sendto_one(source_p, form_str(ERR_NOOPERHOST), me.name, source_p->name);
 		ilog(L_FOPER, "FAILED OPER (%s) by (%s!%s@%s)",
-		     name, source_p->name,
-		     source_p->username, source_p->host);
+		     name, source_p->name, source_p->username, source_p->host);
 
 		if(ConfigFileEntry.failed_oper_notice)
 		{
@@ -113,8 +112,7 @@
 	}
 	else
 	{
-		sendto_one(source_p, form_str(ERR_PASSWDMISMATCH),
-			   me.name, source_p->name);
+		sendto_one(source_p, form_str(ERR_PASSWDMISMATCH), me.name, source_p->name);
 
 		ilog(L_FOPER, "FAILED OPER (%s) by (%s!%s@%s)",
 		     name, source_p->name, source_p->username, source_p->host);
Index: modules/m_operspy.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_operspy.c,v
retrieving revision 1.4
diff -b -u -r1.4 m_operspy.c
--- modules/m_operspy.c	15 Mar 2004 17:58:03 -0000	1.4
+++ modules/m_operspy.c	19 Aug 2004 22:16:20 -0000
@@ -55,6 +55,7 @@
 };
 
 mapi_clist_av1 operspy_clist[] = { &operspy_msgtab, NULL };
+
 DECLARE_MODULE_AV1(operspy, NULL, NULL, operspy_clist, NULL, NULL, "$Revision: 1.4 $");
 
 /* ms_operspy()
@@ -63,8 +64,7 @@
  * parv[2] - optional params
  */
 static int
-ms_operspy(struct Client *client_p, struct Client *source_p,
-	   int parc, const char *parv[])
+ms_operspy(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
 	static char buffer[BUFSIZE];
 	char *ptr;
@@ -73,8 +73,7 @@
 
 	if(parc < 4)
 	{
-		report_operspy(source_p, parv[1],
-			    parc < 3 ? NULL : parv[2]);
+		report_operspy(source_p, parv[1], parc < 3 ? NULL : parv[2]);
 	}
 	/* buffer all remaining into one param */
 	else
@@ -86,11 +85,10 @@
 		{
 			len = strlen(parv[i]) + 1;
 
-			if((size_t)(cur_len + len) >= sizeof(buffer))
+			if((size_t) (cur_len + len) >= sizeof(buffer))
 				return 0;
 
-			ircsnprintf(ptr, sizeof(buffer) - cur_len, "%s ",
-				 parv[i]);
+			ircsnprintf(ptr, sizeof(buffer) - cur_len, "%s ", parv[i]);
 			ptr += len;
 			cur_len += len;
 		}
@@ -100,4 +98,3 @@
 
 	return 0;
 }
-
Index: modules/m_pass.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/Attic/m_pass.c,v
retrieving revision 1.47
diff -b -u -r1.47 m_pass.c
--- modules/m_pass.c	19 Mar 2004 20:14:35 -0000	1.47
+++ modules/m_pass.c	19 Aug 2004 22:16:20 -0000
@@ -45,6 +45,7 @@
 };
 
 mapi_clist_av1 pass_clist[] = { &pass_msgtab, NULL };
+
 DECLARE_MODULE_AV1(pass, NULL, NULL, pass_clist, NULL, NULL, "$Revision: 1.47 $");
 
 /*
@@ -62,8 +63,7 @@
 {
 	if(client_p->localClient->passwd)
 	{
-		memset(client_p->localClient->passwd, 0,
-			strlen(client_p->localClient->passwd));
+		memset(client_p->localClient->passwd, 0, strlen(client_p->localClient->passwd));
 		MyFree(client_p->localClient->passwd);
 	}
 
Index: modules/m_ping.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/Attic/m_ping.c,v
retrieving revision 1.56
diff -b -u -r1.56 m_ping.c
--- modules/m_ping.c	12 Apr 2004 13:56:53 -0000	1.56
+++ modules/m_ping.c	19 Aug 2004 22:16:21 -0000
@@ -46,6 +46,7 @@
 };
 
 mapi_clist_av1 ping_clist[] = { &ping_msgtab, NULL };
+
 DECLARE_MODULE_AV1(ping, NULL, NULL, ping_clist, NULL, NULL, "$Revision: 1.56 $");
 
 /*
@@ -73,8 +74,7 @@
 		else
 		{
 			sendto_one_numeric(source_p, ERR_NOSUCHSERVER,
-					   form_str(ERR_NOSUCHSERVER),
-					   destination);
+					   form_str(ERR_NOSUCHSERVER), destination);
 			return 0;
 		}
 	}
@@ -93,8 +93,7 @@
 
 	destination = parv[2];	/* Will get NULL or pointer (parc >= 2!!) */
 
-	if(!EmptyString(destination) && irccmp(destination, me.name) &&
-	   irccmp(destination, me.id))
+	if(!EmptyString(destination) && irccmp(destination, me.name) && irccmp(destination, me.id))
 	{
 		if((target_p = find_client(destination)) && IsServer(target_p))
 			sendto_one(target_p, ":%s PING %s :%s", 
@@ -103,13 +102,11 @@
 		/* not directed at an id.. */
 		else if(!IsDigit(*destination))
 			sendto_one_numeric(source_p, ERR_NOSUCHSERVER,
-					   form_str(ERR_NOSUCHSERVER),
-					   destination);
+					   form_str(ERR_NOSUCHSERVER), destination);
 	}
 	else
 		sendto_one(source_p, ":%s PONG %s :%s", 
-			   get_id(&me, source_p), me.name, 
-			   get_id(source_p, source_p));
+			   get_id(&me, source_p), me.name, get_id(source_p, source_p));
 
 	return 0;
 }
Index: modules/m_pong.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/Attic/m_pong.c,v
retrieving revision 1.56.2.1
diff -b -u -r1.56.2.1 m_pong.c
--- modules/m_pong.c	4 Aug 2004 00:21:11 -0000	1.56.2.1
+++ modules/m_pong.c	19 Aug 2004 22:16:21 -0000
@@ -48,6 +48,7 @@
 };
 
 mapi_clist_av1 pong_clist[] = { &pong_msgtab, NULL };
+
 DECLARE_MODULE_AV1(pong, NULL, NULL, pong_clist, NULL, NULL, "$Revision: 1.56.2.1 $");
 
 static int
@@ -65,14 +66,12 @@
 	 * That being the case, we will route, but only for registered clients (a
 	 * case can be made to allow them only from servers). -Shadowfax
 	 */
-	if(!EmptyString(destination) && !match(destination, me.name) &&
-	   irccmp(destination, me.id))
+	if(!EmptyString(destination) && !match(destination, me.name) && irccmp(destination, me.id))
 	{
 		if((target_p = find_client(destination)) || 
 		   (target_p = find_server(NULL, destination)))
 			sendto_one(target_p, ":%s PONG %s %s", 
-				   get_id(source_p, target_p), parv[1], 
-				   get_id(target_p, target_p));
+				   get_id(source_p, target_p), parv[1], get_id(target_p, target_p));
 		else
 		{
 			if(!IsDigit(*destination))
@@ -89,7 +88,8 @@
 			sendto_realops_flags(UMODE_ALL, L_ALL,
 					     "End of burst (emulated) from %s (%d seconds)",
 					     source_p->name,
-					     (signed int) (CurrentTime - source_p->localClient->firsttime));
+					     (signed int) (CurrentTime -
+							   source_p->localClient->firsttime));
 		SetEob(source_p);
 	}
 
Index: modules/m_post.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_post.c,v
retrieving revision 1.28
diff -b -u -r1.28 m_post.c
--- modules/m_post.c	15 Mar 2004 17:58:03 -0000	1.28
+++ modules/m_post.c	19 Aug 2004 22:16:21 -0000
@@ -54,6 +54,7 @@
 mapi_clist_av1 post_clist[] = {
 	&post_msgtab, &get_msgtab, &put_msgtab, NULL
 };
+
 DECLARE_MODULE_AV1(post, NULL, NULL, post_clist, NULL, NULL, "$Revision: 1.28 $");
 
 
Index: modules/m_rehash.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_rehash.c,v
retrieving revision 1.81
diff -b -u -r1.81 m_rehash.c
--- modules/m_rehash.c	26 Apr 2004 22:58:21 -0000	1.81
+++ modules/m_rehash.c	19 Aug 2004 22:16:21 -0000
@@ -53,6 +53,7 @@
 };
 
 mapi_clist_av1 rehash_clist[] = { &rehash_msgtab, NULL };
+
 DECLARE_MODULE_AV1(rehash, NULL, NULL, rehash_clist, NULL, NULL, "$Revision: 1.81 $");
 
 struct hash_commands
@@ -80,8 +81,7 @@
 static void
 rehash_dns(struct Client *source_p)
 {
-	sendto_realops_flags(UMODE_ALL, L_ALL, "%s is rehashing DNS", 
-			     get_oper_name(source_p));
+	sendto_realops_flags(UMODE_ALL, L_ALL, "%s is rehashing DNS", get_oper_name(source_p));
 
 	/* reread /etc/resolv.conf and reopen res socket */
 	restart_resolver();
@@ -91,8 +91,7 @@
 rehash_motd(struct Client *source_p)
 {
 	sendto_realops_flags(UMODE_ALL, L_ALL,
-			     "%s is forcing re-reading of MOTD file",
-			     get_oper_name(source_p));
+			     "%s is forcing re-reading of MOTD file", get_oper_name(source_p));
 
 	free_cachefile(user_motd);
 	user_motd = cache_file(MPATH, "ircd.motd", 0);
@@ -102,8 +101,7 @@
 rehash_omotd(struct Client *source_p)
 {
 	sendto_realops_flags(UMODE_ALL, L_ALL,
-			     "%s is forcing re-reading of OPER MOTD file",
-			     get_oper_name(source_p));
+			     "%s is forcing re-reading of OPER MOTD file", get_oper_name(source_p));
 
 	free_cachefile(oper_motd);
 	oper_motd = cache_file(OPATH, "opers.motd", 0);
@@ -112,8 +110,7 @@
 static void
 rehash_glines(struct Client *source_p)
 {
-	sendto_realops_flags(UMODE_ALL, L_ALL, "%s is clearing G-lines",
-				get_oper_name(source_p));
+	sendto_realops_flags(UMODE_ALL, L_ALL, "%s is clearing G-lines", get_oper_name(source_p));
 	clear_temps(&glines);
 }
 
@@ -203,9 +200,7 @@
 		free_conf(aconf);
 		dlinkDestroy(ptr, &resvTable[i]);
 	}
-	HASH_WALK_END
-
-	DLINK_FOREACH_SAFE(ptr, next_ptr, resv_conf_list.head)
+	HASH_WALK_END DLINK_FOREACH_SAFE(ptr, next_ptr, resv_conf_list.head)
 	{
 		aconf = ptr->data;
 
@@ -230,8 +225,7 @@
 rehash_help(struct Client *source_p)
 {
 	sendto_realops_flags(UMODE_ALL, L_ALL,
-			     "%s is forcing re-reading of HELP files", 
-			     get_oper_name(source_p));
+			     "%s is forcing re-reading of HELP files", get_oper_name(source_p));
 	clear_help_hash();
 	load_help();
 }
@@ -263,8 +257,7 @@
 {
 	if(!IsOperRehash(source_p))
 	{
-		sendto_one(source_p, form_str(ERR_NOPRIVS),
-			   me.name, source_p->name, "rehash");
+		sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "rehash");
 		return 0;
 	}
 
@@ -273,7 +266,7 @@
 		int x;
 		char cmdbuf[100];
 
-		for (x = 0; rehash_commands[x].cmd != NULL && rehash_commands[x].handler != NULL;
+		for(x = 0; rehash_commands[x].cmd != NULL && rehash_commands[x].handler != NULL;
 		     x++)
 		{
 			if(irccmp(parv[1], rehash_commands[x].cmd) == 0)
@@ -289,7 +282,7 @@
 
 		/* We are still here..we didn't match */
 		cmdbuf[0] = '\0';
-		for (x = 0; rehash_commands[x].cmd != NULL && rehash_commands[x].handler != NULL;
+		for(x = 0; rehash_commands[x].cmd != NULL && rehash_commands[x].handler != NULL;
 		     x++)
 		{
 			strlcat(cmdbuf, " ", sizeof(cmdbuf));
@@ -304,8 +297,7 @@
 			   ConfigFileEntry.configfile);
 		sendto_realops_flags(UMODE_ALL, L_ALL,
 				     "%s is rehashing server config file", get_oper_name(source_p));
-		ilog(L_MAIN, "REHASH From %s[%s]", get_oper_name(source_p),
-		     source_p->sockhost);
+		ilog(L_MAIN, "REHASH From %s[%s]", get_oper_name(source_p), source_p->sockhost);
 		rehash(0);
 		return 0;
 	}
Index: modules/m_restart.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_restart.c,v
retrieving revision 1.44
diff -b -u -r1.44 m_restart.c
--- modules/m_restart.c	15 Mar 2004 17:58:03 -0000	1.44
+++ modules/m_restart.c	19 Aug 2004 22:16:21 -0000
@@ -48,6 +48,7 @@
 };
 
 mapi_clist_av1 restart_clist[] = { &restart_msgtab, NULL };
+
 DECLARE_MODULE_AV1(restart, NULL, NULL, restart_clist, NULL, NULL, "$Revision: 1.44 $");
 
 /*
@@ -63,8 +64,7 @@
 
 	if(!IsOperDie(source_p))
 	{
-		sendto_one(source_p, form_str(ERR_NOPRIVS),
-			   me.name, source_p->name, "die");
+		sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "die");
 		return 0;
 	}
 
Index: modules/m_resv.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_resv.c,v
retrieving revision 1.61
diff -b -u -r1.61 m_resv.c
--- modules/m_resv.c	14 Jun 2004 02:09:17 -0000	1.61
+++ modules/m_resv.c	19 Aug 2004 22:16:21 -0000
@@ -56,6 +56,7 @@
 };
 
 mapi_clist_av1 resv_clist[] = {	&resv_msgtab, &unresv_msgtab, NULL };
+
 DECLARE_MODULE_AV1(resv, NULL, NULL, resv_clist, NULL, NULL, "$Revision: 1.61 $");
 
 static void parse_resv(struct Client *source_p, const char *name,
@@ -95,16 +96,15 @@
 	name = parv[loc];
 	loc++;
 
-	if((parc >= loc+2) && (irccmp(parv[loc], "ON") == 0))
+	if((parc >= loc + 2) && (irccmp(parv[loc], "ON") == 0))
 	{
-		target_server = parv[loc+1];
+		target_server = parv[loc + 1];
 		loc += 2;
 	}
 
 	if(parc <= loc || EmptyString(parv[loc]))
 	{
-		sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS),
-			   me.name, source_p->name, "RESV");
+		sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "RESV");
 		return 0;
 	}
 
@@ -133,8 +133,7 @@
  *     parv[3] = reason
  */
 static int
-ms_resv(struct Client *client_p, struct Client *source_p,
-	int parc, const char *parv[])
+ms_resv(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
 	/* parv[0]  parv[1]        parv[2]  parv[3]
 	 * oper     target server  resv     reason
@@ -157,8 +156,7 @@
 }
 
 static int
-me_resv(struct Client *client_p, struct Client *source_p,
-	int parc, const char *parv[])
+me_resv(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
 	/* time name 0 :reason */
 	if(!IsPerson(source_p))
@@ -182,8 +180,7 @@
  * side effects - will parse the resv and create it if valid
  */
 static void
-parse_resv(struct Client *source_p, const char *name, 
-	   const char *reason, int temp_time)
+parse_resv(struct Client *source_p, const char *name, const char *reason, int temp_time)
 {
 	struct ConfItem *aconf;
 
@@ -192,15 +189,13 @@
 		if(hash_find_resv(name))
 		{
 			sendto_one_notice(source_p,
-					":A RESV has already been placed on channel: %s",
-					name);
+					  ":A RESV has already been placed on channel: %s", name);
 			return;
 		}
 
 		if(strlen(name) > CHANNELLEN)
 		{
-			sendto_one_notice(source_p, ":Invalid RESV length: %s",
-					  name);
+			sendto_one_notice(source_p, ":Invalid RESV length: %s", name);
 			return;
 		}
 
@@ -216,11 +211,9 @@
 
 			sendto_realops_flags(UMODE_ALL, L_ALL,
 				     "%s added temporary %d min. RESV for [%s] [%s]",
-				     get_oper_name(source_p), temp_time / 60,
-				     name, reason);
+					     get_oper_name(source_p), temp_time / 60, name, reason);
 			ilog(L_KLINE, "R %s %d %s %s",
-				get_oper_name(source_p), temp_time / 60,
-				name, reason);
+			     get_oper_name(source_p), temp_time / 60, name, reason);
 			sendto_one_notice(source_p, ":Added temporary %d min. RESV [%s]",
 					temp_time / 60, name);
 		}
@@ -230,10 +223,9 @@
 	}
 	else if(clean_resv_nick(name))
 	{
-		if(strlen(name) > NICKLEN*2)
+		if(strlen(name) > NICKLEN * 2)
 		{
-			sendto_one_notice(source_p, ":Invalid RESV length: %s",
-					   name);
+			sendto_one_notice(source_p, ":Invalid RESV length: %s", name);
 			return;
 		}
 
@@ -249,8 +241,7 @@
 		if(find_nick_resv(name))
 		{
 			sendto_one_notice(source_p,
-					   ":A RESV has already been placed on nick: %s",
-					   name);
+					  ":A RESV has already been placed on nick: %s", name);
 			return;
 		}
 
@@ -266,11 +257,9 @@
 
 			sendto_realops_flags(UMODE_ALL, L_ALL,
 				     "%s added temporary %d min. RESV for [%s] [%s]",
-				     get_oper_name(source_p), temp_time / 60,
-				     name, reason);
+					     get_oper_name(source_p), temp_time / 60, name, reason);
 			ilog(L_KLINE, "R %s %d %s %s",
-				get_oper_name(source_p), temp_time / 60,
-				name, reason);
+			     get_oper_name(source_p), temp_time / 60, name, reason);
 			sendto_one_notice(source_p, ":Added temporary %d min. RESV [%s]",
 					temp_time / 60, name);
 		}
@@ -279,9 +268,7 @@
 					aconf->passwd, NULL, NULL, 0);
 	}
 	else
-		sendto_one_notice(source_p,
-				  ":You have specified an invalid resv: [%s]",
-				  name);
+		sendto_one_notice(source_p, ":You have specified an invalid resv: [%s]", name);
 }
 
 static void 
@@ -291,24 +278,19 @@
 	if(!temp_time)
 	{
 		sendto_match_servs(source_p, target,
-				CAP_CLUSTER, NOCAPS,
-				"RESV %s %s :%s",
-				target, name, reason);
+				   CAP_CLUSTER, NOCAPS, "RESV %s %s :%s", target, name, reason);
 		sendto_match_servs(source_p, target,
 				CAP_ENCAP, CAP_CLUSTER,
-				"ENCAP %s RESV %d %s 0 :%s",
-				target, temp_time, name, reason);
+				   "ENCAP %s RESV %d %s 0 :%s", target, temp_time, name, reason);
 	}
 	else
 		sendto_match_servs(source_p, target,
 				CAP_ENCAP, NOCAPS,
-				"ENCAP %s RESV %d %s 0 :%s",
-				target, temp_time, name, reason);
+				   "ENCAP %s RESV %d %s 0 :%s", target, temp_time, name, reason);
 }
 
 static void
-cluster_resv(struct Client *source_p, int temp_time, const char *name,
-		const char *reason)
+cluster_resv(struct Client *source_p, int temp_time, const char *name, const char *reason)
 {
 	struct remote_conf *shared_p;
 	dlink_node *ptr;
@@ -327,8 +309,7 @@
 		{
 			sendto_match_servs(source_p, shared_p->server,
 					CAP_CLUSTER, NOCAPS,
-					"RESV %s %s :%s",
-					shared_p->server, name, reason);
+					   "RESV %s %s :%s", shared_p->server, name, reason);
 			sendto_match_servs(source_p, shared_p->server,
 					CAP_ENCAP, CAP_CLUSTER,
 					"ENCAP %s RESV %d %s 0 :%s",
@@ -353,15 +334,13 @@
 {
 	if((parc == 4) && (irccmp(parv[2], "ON") == 0))
 	{
-		propagate_generic(source_p, "UNRESV", parv[3], CAP_CLUSTER,
-				"%s", parv[1]);
+		propagate_generic(source_p, "UNRESV", parv[3], CAP_CLUSTER, "%s", parv[1]);
 
 		if(match(parv[3], me.name) == 0)
 			return 0;
 	}
 	else if(dlink_list_length(&cluster_conf_list) > 0)
-		cluster_generic(source_p, "UNRESV", SHARED_UNRESV, CAP_CLUSTER,
-				"%s", parv[1]);
+		cluster_generic(source_p, "UNRESV", SHARED_UNRESV, CAP_CLUSTER, "%s", parv[1]);
 
 	if(remove_temp_resv(source_p, parv[1]))
 		return 0;
@@ -381,8 +360,7 @@
 	/* parv[0]  parv[1]        parv[2]
 	 * oper     target server  resv to remove
 	 */
-	propagate_generic(source_p, "UNRESV", parv[3], CAP_CLUSTER,
-			"%s", parv[2]);
+	propagate_generic(source_p, "UNRESV", parv[3], CAP_CLUSTER, "%s", parv[2]);
 
 	if(!match(me.name, parv[1]))
 		return 0;
@@ -465,8 +443,7 @@
 
 	sendto_one_notice(source_p, ":RESV for [%s] is removed", name);
 	sendto_realops_flags(UMODE_ALL, L_ALL,
-			"%s has removed the RESV for: [%s]", 
-			get_oper_name(source_p), name);
+			     "%s has removed the RESV for: [%s]", get_oper_name(source_p), name);
 	ilog(L_KLINE, "UR %s %s", get_oper_name(source_p), name);
 
 	return 1;
@@ -513,7 +490,7 @@
 
 	umask(oldumask);
 
-	while (fbgets(buf, sizeof(buf), in))
+	while(fbgets(buf, sizeof(buf), in))
 	{
 		const char *resv_name;
 
Index: modules/m_set.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_set.c,v
retrieving revision 1.77
diff -b -u -r1.77 m_set.c
--- modules/m_set.c	21 Apr 2004 21:19:37 -0000	1.77
+++ modules/m_set.c	19 Aug 2004 22:16:22 -0000
@@ -52,6 +52,7 @@
 };
 
 mapi_clist_av1 set_clist[] = { &set_msgtab, NULL };
+
 DECLARE_MODULE_AV1(set, NULL, NULL, set_clist, NULL, NULL, "$Revision: 1.77 $");
 
 /* Structure used for the SET table itself */
@@ -95,21 +96,21 @@
 static struct SetStruct set_cmd_table[] = {
 	/* name               function      string arg  int arg */
 	/* -------------------------------------------------------- */
-	{"ADMINSTRING",	quote_adminstring,	1,	0	},
-	{"AUTOCONN", 	quote_autoconn, 	1,	1	},
-	{"AUTOCONNALL", quote_autoconnall, 	0,	1	},
-	{"FLOODCOUNT", 	quote_floodcount, 	0,	1	},
-	{"IDENTTIMEOUT", quote_identtimeout,	0,	1	},
-	{"IDLETIME", 	quote_idletime, 	0,	1	},
-	{"MAX", 	quote_max, 		0,	1	},
-	{"MAXCLIENTS",	quote_max,		0,	1	},
-	{"OPERSTRING",	quote_operstring,	1,	0	},
-	{"SPAMNUM", 	quote_spamnum, 		0,	1	},
-	{"SPAMTIME", 	quote_spamtime, 	0,	1	},
-	{"SPLITMODE", 	quote_splitmode, 	1,	0	},
-	{"SPLITNUM", 	quote_splitnum, 	0,	1	},
-	{"SPLITUSERS", 	quote_splitusers, 	0,	1	},
-	{"SPLITDELAY",	quote_splitdelay,	0,	1	},
+	{"ADMINSTRING", quote_adminstring, 1, 0},
+	{"AUTOCONN", quote_autoconn, 1, 1},
+	{"AUTOCONNALL", quote_autoconnall, 0, 1},
+	{"FLOODCOUNT", quote_floodcount, 0, 1},
+	{"IDENTTIMEOUT", quote_identtimeout, 0, 1},
+	{"IDLETIME", quote_idletime, 0, 1},
+	{"MAX", quote_max, 0, 1},
+	{"MAXCLIENTS", quote_max, 0, 1},
+	{"OPERSTRING", quote_operstring, 1, 0},
+	{"SPAMNUM", quote_spamnum, 0, 1},
+	{"SPAMTIME", quote_spamtime, 0, 1},
+	{"SPLITMODE", quote_splitmode, 1, 0},
+	{"SPLITNUM", quote_splitnum, 0, 1},
+	{"SPLITUSERS", quote_splitusers, 0, 1},
+	{"SPLITDELAY", quote_splitdelay, 0, 1},
 	/* -------------------------------------------------------- */
 	{(char *) 0, (void (*)()) 0, 0, 0}
 };
@@ -131,7 +132,7 @@
 
 	names[0] = names[1] = names[2] = names[3] = "";
 
-	for (i = 0; set_cmd_table[i].handler; i++)
+	for(i = 0; set_cmd_table[i].handler; i++)
 	{
 		names[j++] = set_cmd_table[i].name;
 
@@ -199,8 +200,7 @@
 {
 	if(!IsOperAdmin(source_p))
 	{
-		sendto_one(source_p, form_str(ERR_NOPRIVS),
-			   me.name, source_p->name, "admin");
+		sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "admin");
 		return;
 	}
 
@@ -271,8 +271,7 @@
 		sendto_realops_flags(UMODE_ALL, L_ALL,
 				     "%s!%s@%s set new MAXCLIENTS to %d (%lu current)",
 				     source_p->name, source_p->username, source_p->host,
-				     GlobalSetOptions.maxclients, 
-				     dlink_list_length(&lclient_list));
+				     GlobalSetOptions.maxclients, dlink_list_length(&lclient_list));
 
 		return;
 	}
@@ -295,8 +294,7 @@
 	}
 	else
 	{
-		strlcpy(GlobalSetOptions.operstring, arg,
-			sizeof(GlobalSetOptions.operstring));
+		strlcpy(GlobalSetOptions.operstring, arg, sizeof(GlobalSetOptions.operstring));
 		
 		sendto_realops_flags(UMODE_ALL, L_ALL,
 				     "%s has changed OPERSTRING to '%s'",
@@ -315,8 +313,7 @@
 	}
 	else
 	{
-		strlcpy(GlobalSetOptions.adminstring, arg,
-			sizeof(GlobalSetOptions.adminstring));
+		strlcpy(GlobalSetOptions.adminstring, arg, sizeof(GlobalSetOptions.adminstring));
 		
 		sendto_realops_flags(UMODE_ALL, L_ALL,
 				     "%s has changed ADMINSTRING to '%s'",
@@ -404,7 +401,7 @@
 	{
 		int newval;
 
-		for (newval = 0; splitmode_values[newval]; newval++)
+		for(newval = 0; splitmode_values[newval]; newval++)
 		{
 			if(!irccmp(splitmode_values[newval], charval))
 				break;
@@ -498,14 +495,12 @@
 	if(newval >= 0)
 	{
 		sendto_realops_flags(UMODE_ALL, L_ALL,
-				     "%s has changed SPLITDELAY to %i",
-				     source_p->name, newval);
+				     "%s has changed SPLITDELAY to %i", source_p->name, newval);
 		GlobalSetOptions.split_delay = newval;
 	}
 	else
 		sendto_one(source_p, ":%s NOTICE %s :SPLITDELAY is currently %i",
-			   me.name, source_p->name,
-			   GlobalSetOptions.split_delay);
+			   me.name, source_p->name, GlobalSetOptions.split_delay);
 }
 
 /*
@@ -528,7 +523,7 @@
 		 * lookup, but at least it's better than a big-ass switch/case
 		 * statement.
 		 */
-		for (i = 0; set_cmd_table[i].handler; i++)
+		for(i = 0; set_cmd_table[i].handler; i++)
 		{
 			if(!irccmp(set_cmd_table[i].name, parv[1]))
 			{
@@ -555,8 +550,7 @@
 						   set_cmd_table[i].name,
 						   (set_cmd_table[i].
 						    wants_char ? "string, " : ""),
-						   (set_cmd_table[i].
-						    wants_char ? "int" : ""));
+						   (set_cmd_table[i].wants_char ? "int" : ""));
 					return 0;
 				}
 
Index: modules/m_stats.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_stats.c,v
retrieving revision 1.219.2.4
diff -b -u -r1.219.2.4 m_stats.c
--- modules/m_stats.c	4 Aug 2004 00:21:11 -0000	1.219.2.4
+++ modules/m_stats.c	19 Aug 2004 22:16:22 -0000
@@ -51,7 +51,7 @@
 #include "s_newconf.h"
 #include "hash.h"
 
-static int m_stats (struct Client *, struct Client *, int, const char **);
+static int m_stats(struct Client *, struct Client *, int, const char **);
 
 struct Message stats_msgtab = {
 	"STATS", 0, 0, 0, MFLG_SLOW,
@@ -63,9 +63,9 @@
 
 mapi_clist_av1 stats_clist[] = { &stats_msgtab, NULL };
 mapi_hlist_av1 stats_hlist[] = {
-	{ "doing_stats",	&doing_stats_hook },
-	{ "doing_stats_p",	&doing_stats_p_hook },
-	{ NULL, NULL }
+	{"doing_stats", &doing_stats_hook},
+	{"doing_stats_p", &doing_stats_p_hook},
+	{NULL, NULL}
 };
 
 DECLARE_MODULE_AV1(stats, NULL, NULL, stats_clist, stats_hlist, NULL, "$Revision: 1.219.2.4 $");
@@ -73,8 +73,7 @@
 const char *Lformat = "%s %u %u %u %u %u :%u %u %s";
 
 static void stats_l_list(struct Client *s, const char *, int, int, dlink_list *, char);
-static void stats_l_client(struct Client *source_p, struct Client *target_p,
-				char statchar);
+static void stats_l_client(struct Client *source_p, struct Client *target_p, char statchar);
 
 static void stats_spy(struct Client *, char, const char *);
 static void stats_p_spy(struct Client *);
@@ -88,7 +87,7 @@
 	int need_admin;
 };
 
-static void stats_adns_servers (struct Client *);
+static void stats_adns_servers(struct Client *);
 static void stats_delay(struct Client *);
 static void stats_hash(struct Client *);
 static void stats_connect(struct Client *);
@@ -121,7 +120,7 @@
 static void stats_ltrace(struct Client *, int, const char **);
 static void stats_ziplinks(struct Client *);
 
-static void report_tklines (struct Client *, dlink_list *);
+static void report_tklines(struct Client *, dlink_list *);
 
 /* This table contains the possible stats items, in order:
  * stats letter,  function to call, operonly? adminonly?
@@ -129,52 +128,52 @@
  */
 static struct StatsStruct stats_cmd_table[] = {
     /* letter     function        need_oper need_admin */
-	{'a', stats_adns_servers,	1, 1, },
-	{'A', stats_adns_servers,	1, 1, },
-	{'b', stats_delay,		1, 1, },
-	{'B', stats_hash,		1, 1, },
-	{'c', stats_connect,		0, 0, },
-	{'C', stats_connect,		0, 0, },
-	{'d', stats_tdeny,		1, 0, },
-	{'D', stats_deny,		1, 0, },
-	{'e', stats_exempt,		1, 0, },
-	{'E', stats_events,		1, 1, },
-	{'f', fd_dump,			1, 1, },
-	{'F', fd_dump,			1, 1, },
-	{'g', stats_pending_glines,	1, 0, },
-	{'G', stats_glines,		1, 0, },
-	{'h', stats_hubleaf,		0, 0, },
-	{'H', stats_hubleaf,		0, 0, },
-	{'i', stats_auth,		0, 0, },
-	{'I', stats_auth,		0, 0, },
-	{'k', stats_tklines,		0, 0, },
-	{'K', stats_klines,		0, 0, },
-	{'l', stats_ltrace,		0, 0, },
-	{'L', stats_ltrace,		0, 0, },
-	{'m', stats_messages,		0, 0, },
-	{'M', stats_messages,		0, 0, },
-	{'o', stats_oper,		0, 0, },
-	{'O', stats_oper,		0, 0, },
-	{'p', stats_operedup,		0, 0, },
-	{'P', stats_ports,		0, 0, },
-	{'q', stats_tresv,		1, 0, },
-	{'Q', stats_resv,		1, 0, },
-	{'r', stats_usage,		1, 0, },
-	{'R', stats_usage,		1, 0, },
-	{'t', stats_tstats,		1, 0, },
-	{'T', stats_tstats,		1, 0, },
-	{'u', stats_uptime,		0, 0, },
-	{'U', stats_shared,		1, 0, },
-	{'v', stats_servers,		0, 0, },
-	{'V', stats_servers,		0, 0, },
-	{'x', stats_tgecos,		1, 0, },
-	{'X', stats_gecos,		1, 0, },
-	{'y', stats_class,		0, 0, },
-	{'Y', stats_class,		0, 0, },
-	{'z', stats_memory,		1, 0, },
-	{'Z', stats_ziplinks,		1, 0, },
-	{'?', stats_servlinks,		0, 0, },
-	{(char) 0, (void (*)()) 0, 	0, 0, }
+	{'a', stats_adns_servers, 1, 1,},
+	{'A', stats_adns_servers, 1, 1,},
+	{'b', stats_delay, 1, 1,},
+	{'B', stats_hash, 1, 1,},
+	{'c', stats_connect, 0, 0,},
+	{'C', stats_connect, 0, 0,},
+	{'d', stats_tdeny, 1, 0,},
+	{'D', stats_deny, 1, 0,},
+	{'e', stats_exempt, 1, 0,},
+	{'E', stats_events, 1, 1,},
+	{'f', fd_dump, 1, 1,},
+	{'F', fd_dump, 1, 1,},
+	{'g', stats_pending_glines, 1, 0,},
+	{'G', stats_glines, 1, 0,},
+	{'h', stats_hubleaf, 0, 0,},
+	{'H', stats_hubleaf, 0, 0,},
+	{'i', stats_auth, 0, 0,},
+	{'I', stats_auth, 0, 0,},
+	{'k', stats_tklines, 0, 0,},
+	{'K', stats_klines, 0, 0,},
+	{'l', stats_ltrace, 0, 0,},
+	{'L', stats_ltrace, 0, 0,},
+	{'m', stats_messages, 0, 0,},
+	{'M', stats_messages, 0, 0,},
+	{'o', stats_oper, 0, 0,},
+	{'O', stats_oper, 0, 0,},
+	{'p', stats_operedup, 0, 0,},
+	{'P', stats_ports, 0, 0,},
+	{'q', stats_tresv, 1, 0,},
+	{'Q', stats_resv, 1, 0,},
+	{'r', stats_usage, 1, 0,},
+	{'R', stats_usage, 1, 0,},
+	{'t', stats_tstats, 1, 0,},
+	{'T', stats_tstats, 1, 0,},
+	{'u', stats_uptime, 0, 0,},
+	{'U', stats_shared, 1, 0,},
+	{'v', stats_servers, 0, 0,},
+	{'V', stats_servers, 0, 0,},
+	{'x', stats_tgecos, 1, 0,},
+	{'X', stats_gecos, 1, 0,},
+	{'y', stats_class, 0, 0,},
+	{'Y', stats_class, 0, 0,},
+	{'z', stats_memory, 1, 0,},
+	{'Z', stats_ziplinks, 1, 0,},
+	{'?', stats_servlinks, 0, 0,},
+	{(char) 0, (void (*)()) 0, 0, 0,}
 };
 
 /*
@@ -211,10 +210,10 @@
 			last_used = CurrentTime;
 	}
 
-	if(hunt_server (client_p, source_p, ":%s STATS %s :%s", 2, parc, parv) != HUNTED_ISME)
+	if(hunt_server(client_p, source_p, ":%s STATS %s :%s", 2, parc, parv) != HUNTED_ISME)
 		return 0;
 
-	for (i = 0; stats_cmd_table[i].handler; i++)
+	for(i = 0; stats_cmd_table[i].handler; i++)
 	{
 		if(stats_cmd_table[i].letter == statchar)
 		{
@@ -222,25 +221,24 @@
 			/* Called for remote clients and for local opers, so check need_admin
 			 * and need_oper
 			 */
-			if((stats_cmd_table[i].need_admin && !IsOperAdmin (source_p)) ||
-			   (stats_cmd_table[i].need_oper && !IsOper (source_p)))
+			if((stats_cmd_table[i].need_admin && !IsOperAdmin(source_p)) ||
+			   (stats_cmd_table[i].need_oper && !IsOper(source_p)))
 			{
 				sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
-						   form_str (ERR_NOPRIVILEGES));
+						   form_str(ERR_NOPRIVILEGES));
 				break;
 			}
 
 			/* Blah, stats L needs the parameters, none of the others do.. */
 			if(statchar == 'L' || statchar == 'l')
-				stats_cmd_table[i].handler (source_p, parc, parv);
+				stats_cmd_table[i].handler(source_p, parc, parv);
 			else
-				stats_cmd_table[i].handler (source_p);
+				stats_cmd_table[i].handler(source_p);
 		}
 	}
 
 	/* Send the end of stats notice, and the stats_spy */
-	sendto_one_numeric(source_p, RPL_ENDOFSTATS, 
-			   form_str(RPL_ENDOFSTATS), statchar);
+	sendto_one_numeric(source_p, RPL_ENDOFSTATS, form_str(RPL_ENDOFSTATS), statchar);
 
 	if((statchar != 'L') && (statchar != 'l'))
 		stats_spy(source_p, statchar, NULL);
@@ -249,9 +247,9 @@
 }
 
 static void
-stats_adns_servers (struct Client *source_p)
+stats_adns_servers(struct Client *source_p)
 {
-	report_adns_servers (source_p);
+	report_adns_servers(source_p);
 }
 
 static void
@@ -264,11 +262,9 @@
 	HASH_WALK(i, U_MAX, ptr, ndTable)
 	{
 		nd = ptr->data;
-		sendto_one_notice(source_p, "Delaying: %s for %ld",
-				nd->name, (long) nd->expire);
+		sendto_one_notice(source_p, "Delaying: %s for %ld", nd->name, (long) nd->expire);
 	}
-	HASH_WALK_END
-}
+HASH_WALK_END}
 
 static void
 stats_hash(struct Client *source_p)
@@ -285,11 +281,9 @@
 	dlink_node *ptr;
 
 	if((ConfigFileEntry.stats_c_oper_only || 
-	    (ConfigServerHide.flatten_links && !IsExemptShide(source_p))) &&
-	    !IsOper(source_p))
+	    (ConfigServerHide.flatten_links && !IsExemptShide(source_p))) && !IsOper(source_p))
 	{
-		sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
-				   form_str(ERR_NOPRIVILEGES));
+		sendto_one_numeric(source_p, ERR_NOPRIVILEGES, form_str(ERR_NOPRIVILEGES));
 		return;
 	}
 
@@ -318,15 +312,13 @@
 
 		*s = '\0';
 
-		sendto_one_numeric(source_p, RPL_STATSCLINE, 
-				form_str(RPL_STATSCLINE),
+		sendto_one_numeric(source_p, RPL_STATSCLINE, form_str(RPL_STATSCLINE),
 #ifndef HIDE_SERVERS_IPS
 				server_p->host,
 #else
 				"*@127.0.0.1", 
 #endif
-				buf, server_p->name,
-				server_p->port, server_p->class_name);
+				   buf, server_p->name, server_p->port, server_p->class_name);
 	}
 }
 
@@ -337,16 +329,16 @@
  * side effects - client is given temp dline list.
  */
 static void
-stats_tdeny (struct Client *source_p)
+stats_tdeny(struct Client *source_p)
 {
 	char *host, *pass, *user, *oper_reason;
 	struct AddressRec *arec;
 	struct ConfItem *aconf;
 	int i;
 
-	for (i = 0; i < ATABLE_SIZE; i++)
+	for(i = 0; i < ATABLE_SIZE; i++)
 	{
-		for (arec = atable[i]; arec; arec = arec->next)
+		for(arec = atable[i]; arec; arec = arec->next)
 		{
 			if(arec->type == CONF_DLINE)
 			{
@@ -355,10 +347,11 @@
 				if(!(aconf->flags & CONF_FLAGS_TEMPORARY))
 					continue;
 
-				get_printable_kline(source_p, aconf, &host, &pass, &user, &oper_reason);
+				get_printable_kline(source_p, aconf, &host, &pass, &user,
+						    &oper_reason);
 
 				sendto_one_numeric(source_p, RPL_STATSDLINE, 
-						   form_str (RPL_STATSDLINE),
+						   form_str(RPL_STATSDLINE),
 						   'd', host, pass,
 						   oper_reason ? "|" : "",
 						   oper_reason ? oper_reason : "");
@@ -374,16 +367,16 @@
  * side effects - client is given dline list.
  */
 static void
-stats_deny (struct Client *source_p)
+stats_deny(struct Client *source_p)
 {
 	char *host, *pass, *user, *oper_reason;
 	struct AddressRec *arec;
 	struct ConfItem *aconf;
 	int i;
 
-	for (i = 0; i < ATABLE_SIZE; i++)
+	for(i = 0; i < ATABLE_SIZE; i++)
 	{
-		for (arec = atable[i]; arec; arec = arec->next)
+		for(arec = atable[i]; arec; arec = arec->next)
 		{
 			if(arec->type == CONF_DLINE)
 			{
@@ -392,10 +385,11 @@
 				if(aconf->flags & CONF_FLAGS_TEMPORARY)
 					continue;
 
-				get_printable_kline(source_p, aconf, &host, &pass, &user, &oper_reason);
+				get_printable_kline(source_p, aconf, &host, &pass, &user,
+						    &oper_reason);
 
 				sendto_one_numeric(source_p, RPL_STATSDLINE, 
-						   form_str (RPL_STATSDLINE),
+						   form_str(RPL_STATSDLINE),
 						   'D', host, pass,
 						   oper_reason ? "|" : "",
 						   oper_reason ? oper_reason : "");
@@ -421,19 +415,18 @@
 
 	if(ConfigFileEntry.stats_e_disabled)
 	{
-		sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
-				   form_str (ERR_NOPRIVILEGES));
+		sendto_one_numeric(source_p, ERR_NOPRIVILEGES, form_str(ERR_NOPRIVILEGES));
 		return;
 	}
 
-	for (i = 0; i < ATABLE_SIZE; i++)
+	for(i = 0; i < ATABLE_SIZE; i++)
 	{
-		for (arec = atable[i]; arec; arec = arec->next)
+		for(arec = atable[i]; arec; arec = arec->next)
 		{
 			if(arec->type == CONF_EXEMPTDLINE)
 			{
 				aconf = arec->aconf;
-				get_printable_conf (aconf, &name, &host, &pass,
+				get_printable_conf(aconf, &name, &host, &pass,
 						    &user, &port, &classname);
 
 				sendto_one_numeric(source_p, RPL_STATSDLINE, 
@@ -441,13 +434,14 @@
 						   'e', host, pass, "", "");
 			}
 		}
-	}}
+	}
+}
 
 
 static void
-stats_events (struct Client *source_p)
+stats_events(struct Client *source_p)
 {
-	show_events (source_p);
+	show_events(source_p);
 }
 
 /* stats_pending_glines()
@@ -457,7 +451,7 @@
  * side effects - client is shown list of pending glines
  */
 static void
-stats_pending_glines (struct Client *source_p)
+stats_pending_glines(struct Client *source_p)
 {
 	if(ConfigFileEntry.glines)
 	{
@@ -466,12 +460,12 @@
 		char timebuffer[MAX_DATE_STRING];
 		struct tm *tmptr;
 
-		DLINK_FOREACH (pending_node, pending_glines.head)
+		DLINK_FOREACH(pending_node, pending_glines.head)
 		{
 			glp_ptr = pending_node->data;
 
-			tmptr = localtime (&glp_ptr->time_request1);
-			strftime (timebuffer, MAX_DATE_STRING, "%Y/%m/%d %H:%M:%S", tmptr);
+			tmptr = localtime(&glp_ptr->time_request1);
+			strftime(timebuffer, MAX_DATE_STRING, "%Y/%m/%d %H:%M:%S", tmptr);
 
 			sendto_one_notice(source_p,
 				    ":1) %s!%s@%s on %s requested gline at %s for %s@%s [%s]",
@@ -482,8 +476,8 @@
 
 			if(glp_ptr->oper_nick2[0])
 			{
-				tmptr = localtime (&glp_ptr->time_request2);
-				strftime (timebuffer, MAX_DATE_STRING, "%Y/%m/%d %H:%M:%S", tmptr);
+				tmptr = localtime(&glp_ptr->time_request2);
+				strftime(timebuffer, MAX_DATE_STRING, "%Y/%m/%d %H:%M:%S", tmptr);
 				sendto_one_notice(source_p,
 					    ":2) %s!%s@%s on %s requested gline at %s for %s@%s [%s]",
 					    glp_ptr->oper_nick2,
@@ -493,7 +487,7 @@
 			}
 		}
 
-		if(dlink_list_length (&pending_glines) > 0)
+		if(dlink_list_length(&pending_glines) > 0)
 			sendto_one_notice(source_p, ":End of Pending G-lines");
 	}
 	else
@@ -508,14 +502,14 @@
  * side effects - client is shown list of glines
  */
 static void
-stats_glines (struct Client *source_p)
+stats_glines(struct Client *source_p)
 {
 	if(ConfigFileEntry.glines)
 	{
 		dlink_node *gline_node;
 		struct ConfItem *kill_ptr;
 
-		DLINK_FOREACH_PREV (gline_node, glines.tail)
+		DLINK_FOREACH_PREV(gline_node, glines.tail)
 		{
 			kill_ptr = gline_node->data;
 
@@ -534,17 +528,15 @@
 
 
 static void
-stats_hubleaf (struct Client *source_p)
+stats_hubleaf(struct Client *source_p)
 {
 	struct remote_conf *hub_p;
 	dlink_node *ptr;
 
 	if((ConfigFileEntry.stats_h_oper_only || 
-	    (ConfigServerHide.flatten_links && !IsExemptShide(source_p))) &&
-	    !IsOper(source_p))
+	    (ConfigServerHide.flatten_links && !IsExemptShide(source_p))) && !IsOper(source_p))
 	{
-		sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
-				   form_str (ERR_NOPRIVILEGES));
+		sendto_one_numeric(source_p, ERR_NOPRIVILEGES, form_str(ERR_NOPRIVILEGES));
 		return;
 	}
 
@@ -554,45 +546,42 @@
 
 		if(hub_p->flags & CONF_HUB)
 			sendto_one_numeric(source_p, RPL_STATSHLINE,
-					form_str(RPL_STATSHLINE),
-					hub_p->host, hub_p->server);
+					   form_str(RPL_STATSHLINE), hub_p->host, hub_p->server);
 		else
 			sendto_one_numeric(source_p, RPL_STATSLLINE,
-					form_str(RPL_STATSLLINE),
-					hub_p->host, hub_p->server);
+					   form_str(RPL_STATSLLINE), hub_p->host, hub_p->server);
 	}
 }
 
 
 static void
-stats_auth (struct Client *source_p)
+stats_auth(struct Client *source_p)
 {
 	/* Oper only, if unopered, return ERR_NOPRIVS */
-	if((ConfigFileEntry.stats_i_oper_only == 2) && !IsOper (source_p))
-		sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
-				   form_str (ERR_NOPRIVILEGES));
+	if((ConfigFileEntry.stats_i_oper_only == 2) && !IsOper(source_p))
+		sendto_one_numeric(source_p, ERR_NOPRIVILEGES, form_str(ERR_NOPRIVILEGES));
 
 	/* If unopered, Only return matching auth blocks */
-	else if((ConfigFileEntry.stats_i_oper_only == 1) && !IsOper (source_p))
+	else if((ConfigFileEntry.stats_i_oper_only == 1) && !IsOper(source_p))
 	{
 		struct ConfItem *aconf;
 		char *name, *host, *pass, *user, *classname;
 		int port;
 
-		if(MyConnect (source_p))
-			aconf = find_conf_by_address (source_p->host,
-						      (struct sockaddr *)&source_p->localClient->ip,
+		if(MyConnect(source_p))
+			aconf = find_conf_by_address(source_p->host,
+						     (struct sockaddr *) &source_p->localClient->ip,
 						      CONF_CLIENT,
 						      source_p->localClient->ip.ss_family,
 						      source_p->username);
 		else
-			aconf = find_conf_by_address (source_p->host, NULL, CONF_CLIENT,
+			aconf = find_conf_by_address(source_p->host, NULL, CONF_CLIENT,
 						      0, source_p->username);
 
 		if(aconf == NULL)
 			return;
 
-		get_printable_conf (aconf, &name, &host, &pass, &user, &port, &classname);
+		get_printable_conf(aconf, &name, &host, &pass, &user, &port, &classname);
 
 		sendto_one_numeric(source_p, RPL_STATSILINE, form_str(RPL_STATSILINE),
 				   name, show_iline_prefix(source_p, aconf, user),
@@ -601,32 +590,31 @@
 
 	/* Theyre opered, or allowed to see all auth blocks */
 	else
-		report_auth (source_p);
+		report_auth(source_p);
 }
 
 
 static void
-stats_tklines (struct Client *source_p)
+stats_tklines(struct Client *source_p)
 {
 	/* Oper only, if unopered, return ERR_NOPRIVS */
-	if((ConfigFileEntry.stats_k_oper_only == 2) && !IsOper (source_p))
-		sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
-				   form_str (ERR_NOPRIVILEGES));
+	if((ConfigFileEntry.stats_k_oper_only == 2) && !IsOper(source_p))
+		sendto_one_numeric(source_p, ERR_NOPRIVILEGES, form_str(ERR_NOPRIVILEGES));
 
 	/* If unopered, Only return matching klines */
-	else if((ConfigFileEntry.stats_k_oper_only == 1) && !IsOper (source_p))
+	else if((ConfigFileEntry.stats_k_oper_only == 1) && !IsOper(source_p))
 	{
 		struct ConfItem *aconf;
 		char *host, *pass, *user, *oper_reason;
 
-		if(MyConnect (source_p))
-			aconf = find_conf_by_address (source_p->host,
-						      (struct sockaddr *)&source_p->localClient->ip,
+		if(MyConnect(source_p))
+			aconf = find_conf_by_address(source_p->host,
+						     (struct sockaddr *) &source_p->localClient->ip,
 						      CONF_KILL,
 						      source_p->localClient->ip.ss_family,
 						      source_p->username);
 		else
-			aconf = find_conf_by_address (source_p->host, NULL, CONF_KILL,
+			aconf = find_conf_by_address(source_p->host, NULL, CONF_KILL,
 						      0, source_p->username);
 
 		if(aconf == NULL)
@@ -663,43 +651,41 @@
 	char *user;
 	char *oper_reason;
 
-	DLINK_FOREACH (ptr, tkline_list->head)
+	DLINK_FOREACH(ptr, tkline_list->head)
 	{
 		aconf = ptr->data;
 
 		get_printable_kline(source_p, aconf, &host, &pass, &user, &oper_reason);
 
 		sendto_one_numeric(source_p, RPL_STATSKLINE,
-				   form_str (RPL_STATSKLINE),
+				   form_str(RPL_STATSKLINE),
 				   'k', host, user, pass,
-				   oper_reason ? "|" : "",
-				   oper_reason ? oper_reason : "");
+				   oper_reason ? "|" : "", oper_reason ? oper_reason : "");
 	}
 }
 
 static void
-stats_klines (struct Client *source_p)
+stats_klines(struct Client *source_p)
 {
 	/* Oper only, if unopered, return ERR_NOPRIVS */
-	if((ConfigFileEntry.stats_k_oper_only == 2) && !IsOper (source_p))
-		sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
-				   form_str (ERR_NOPRIVILEGES));
+	if((ConfigFileEntry.stats_k_oper_only == 2) && !IsOper(source_p))
+		sendto_one_numeric(source_p, ERR_NOPRIVILEGES, form_str(ERR_NOPRIVILEGES));
 
 	/* If unopered, Only return matching klines */
-	else if((ConfigFileEntry.stats_k_oper_only == 1) && !IsOper (source_p))
+	else if((ConfigFileEntry.stats_k_oper_only == 1) && !IsOper(source_p))
 	{
 		struct ConfItem *aconf;
 		char *host, *pass, *user, *oper_reason;
 
 		/* search for a kline */
-		if(MyConnect (source_p))
-			aconf = find_conf_by_address (source_p->host,
-						      (struct sockaddr *)&source_p->localClient->ip,
+		if(MyConnect(source_p))
+			aconf = find_conf_by_address(source_p->host,
+						     (struct sockaddr *) &source_p->localClient->ip,
 						      CONF_KILL,
 						      source_p->localClient->ip.ss_family,
 						      source_p->username);
 		else
-			aconf = find_conf_by_address (source_p->host, NULL, CONF_KILL,
+			aconf = find_conf_by_address(source_p->host, NULL, CONF_KILL,
 						      0, source_p->username);
 
 		if(aconf == NULL)
@@ -717,7 +703,7 @@
 	}
 	/* Theyre opered, or allowed to see all klines */
 	else
-		report_Klines (source_p);
+		report_Klines(source_p);
 }
 
 static void
@@ -734,8 +720,7 @@
 
 	if(!IsOper(source_p) && ConfigFileEntry.stats_o_oper_only)
 	{
-		sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
-				   form_str (ERR_NOPRIVILEGES));
+		sendto_one_numeric(source_p, ERR_NOPRIVILEGES, form_str(ERR_NOPRIVILEGES));
 		return;
 	}
 
@@ -758,23 +743,23 @@
  * side effects - client is shown a list of active opers
  */
 static void
-stats_operedup (struct Client *source_p)
+stats_operedup(struct Client *source_p)
 {
 	struct Client *target_p;
 	dlink_node *oper_ptr;
 
-	DLINK_FOREACH (oper_ptr, oper_list.head)
+	DLINK_FOREACH(oper_ptr, oper_list.head)
 	{
 		target_p = oper_ptr->data;
 
 		if(IsOperInvis(target_p) && !IsOper(source_p))
 			continue;
 
-		if(MyClient (source_p) && IsOper (source_p))
+		if(MyClient(source_p) && IsOper(source_p))
 		{
 			sendto_one_numeric(source_p, RPL_STATSDEBUG,
 					   "p :[%c][%s] %s (%s@%s) Idle: %d",
-					   IsAdmin (target_p) ? 'A' : 'O',
+					   IsAdmin(target_p) ? 'A' : 'O',
 					   get_oper_privs(target_p->flags2),
 					   target_p->name, target_p->username, target_p->host,
 					   (int) (CurrentTime - target_p->localClient->last));
@@ -783,27 +768,25 @@
 		{
 			sendto_one_numeric(source_p, RPL_STATSDEBUG,
 					   "p :[%c] %s (%s@%s) Idle: %d",
-					   IsAdmin (target_p) ? 'A' : 'O',
+					   IsAdmin(target_p) ? 'A' : 'O',
 					   target_p->name, target_p->username, target_p->host,
 					   (int) (CurrentTime - target_p->localClient->last));
 		}
 	}
 
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
-			   "p :%ld OPER(s)",
-			   dlink_list_length (&oper_list));
+			   "p :%ld OPER(s)", dlink_list_length(&oper_list));
 
-	stats_p_spy (source_p);
+	stats_p_spy(source_p);
 }
 
 static void
-stats_ports (struct Client *source_p)
+stats_ports(struct Client *source_p)
 {
-	if(!IsOper (source_p) && ConfigFileEntry.stats_P_oper_only)
-		sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
-				   form_str (ERR_NOPRIVILEGES));
+	if(!IsOper(source_p) && ConfigFileEntry.stats_P_oper_only)
+		sendto_one_numeric(source_p, ERR_NOPRIVILEGES, form_str(ERR_NOPRIVILEGES));
 	else
-		show_ports (source_p);
+		show_ports(source_p);
 }
 
 static void
@@ -830,8 +813,7 @@
 					form_str(RPL_STATSQLINE),
 					'q', aconf->name, aconf->passwd);
 	}
-	HASH_WALK_END
-}
+HASH_WALK_END}
 
 
 static void
@@ -858,11 +840,10 @@
 					form_str(RPL_STATSQLINE),
 					'Q', aconf->name, aconf->passwd);
 	}
-	HASH_WALK_END
-}
+HASH_WALK_END}
 
 static void
-stats_usage (struct Client *source_p)
+stats_usage(struct Client *source_p)
 {
 #ifndef __VMS
 	struct rusage rus;
@@ -887,8 +868,7 @@
 #else
 	if(getrusage(RUSAGE_SELF, &rus) == -1)
 	{
-		sendto_one_notice(source_p, ":Getruseage error: %s.",
-				  strerror(errno));
+		sendto_one_notice(source_p, ":Getruseage error: %s.", strerror(errno));
 		return;
 	}
 	secs = rus.ru_utime.tv_sec + rus.ru_stime.tv_sec;
@@ -904,8 +884,7 @@
 			   (int) (secs / 60), (int) (secs % 60),
 			   (int) (rus.ru_utime.tv_sec / 60),
 			   (int) (rus.ru_utime.tv_sec % 60),
-			   (int) (rus.ru_stime.tv_sec / 60), 
-			   (int) (rus.ru_stime.tv_sec % 60));
+			   (int) (rus.ru_stime.tv_sec / 60), (int) (rus.ru_stime.tv_sec % 60));
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
 			   "R :RSS %ld ShMem %ld Data %ld Stack %ld",
 			   rus.ru_maxrss, (rus.ru_ixrss / rup), 
@@ -914,38 +893,33 @@
 			   "R :Swaps %d Reclaims %d Faults %d",
 			   (int) rus.ru_nswap, (int) rus.ru_minflt, (int) rus.ru_majflt);
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
-			   "R :Block in %d out %d",
-			   (int) rus.ru_inblock, (int) rus.ru_oublock);
+			   "R :Block in %d out %d", (int) rus.ru_inblock, (int) rus.ru_oublock);
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
-			   "R :Msg Rcv %d Send %d",
-			   (int) rus.ru_msgrcv, (int) rus.ru_msgsnd);
+			   "R :Msg Rcv %d Send %d", (int) rus.ru_msgrcv, (int) rus.ru_msgsnd);
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
 			   "R :Signals %d Context Vol. %d Invol %d",
-			   (int) rus.ru_nsignals, (int) rus.ru_nvcsw, 
-			   (int) rus.ru_nivcsw);
+			   (int) rus.ru_nsignals, (int) rus.ru_nvcsw, (int) rus.ru_nivcsw);
 #endif /* __VMS */
 }
 
 static void
-stats_tstats (struct Client *source_p)
+stats_tstats(struct Client *source_p)
 {
-	tstats (source_p);
+	tstats(source_p);
 }
 
 static void
-stats_uptime (struct Client *source_p)
+stats_uptime(struct Client *source_p)
 {
 	time_t now;
 
 	now = CurrentTime - startup_time;
 	sendto_one_numeric(source_p, RPL_STATSUPTIME, 
-			   form_str (RPL_STATSUPTIME),
-			   now / 86400, (now / 3600) % 24, 
-			   (now / 60) % 60, now % 60);
+			   form_str(RPL_STATSUPTIME),
+			   now / 86400, (now / 3600) % 24, (now / 60) % 60, now % 60);
 	sendto_one_numeric(source_p, RPL_STATSCONN,
-			   form_str (RPL_STATSCONN),
-			   MaxConnectionCount, MaxClientCount, 
-			   Count.totalrestartcount);
+			   form_str(RPL_STATSCONN),
+			   MaxConnectionCount, MaxClientCount, Count.totalrestartcount);
 }
 
 struct shared_flags
@@ -954,21 +928,20 @@
 	char has;
 	char hasnt;
 };
-static struct shared_flags shared_flagtable[] =
-{
-	{ SHARED_KLINE,		'K', 'k' },
-	{ SHARED_UNKLINE,	'U', 'u' },
-	{ SHARED_XLINE,		'X', 'x' },
-	{ SHARED_UNXLINE,	'Y', 'y' },
-	{ SHARED_RESV,		'Q', 'q' },
-	{ SHARED_UNRESV,	'R', 'r' },
-	{ SHARED_LOCOPS,	'L', 'l' },
-	{ 0,			'\0', '\0' }
+static struct shared_flags shared_flagtable[] = {
+	{SHARED_KLINE, 'K', 'k'},
+	{SHARED_UNKLINE, 'U', 'u'},
+	{SHARED_XLINE, 'X', 'x'},
+	{SHARED_UNXLINE, 'Y', 'y'},
+	{SHARED_RESV, 'Q', 'q'},
+	{SHARED_UNRESV, 'R', 'r'},
+	{SHARED_LOCOPS, 'L', 'l'},
+	{0, '\0', '\0'}
 };
 
 
 static void
-stats_shared (struct Client *source_p)
+stats_shared(struct Client *source_p)
 {
 	struct remote_conf *shared_p;
 	dlink_node *ptr;
@@ -996,8 +969,7 @@
 
 		sendto_one_numeric(source_p, RPL_STATSULINE, 
 					form_str(RPL_STATSULINE),
-					shared_p->server, shared_p->username,
-					shared_p->host, buf);
+				   shared_p->server, shared_p->username, shared_p->host, buf);
 	}
 
 	DLINK_FOREACH(ptr, cluster_conf_list.head)
@@ -1019,8 +991,7 @@
 		*p = '\0';
 
 		sendto_one_numeric(source_p, RPL_STATSULINE, 
-					form_str(RPL_STATSULINE),
-					shared_p->server, "*", "*", buf);
+				   form_str(RPL_STATSULINE), shared_p->server, "*", "*", buf);
 	}
 }
 
@@ -1031,7 +1002,7 @@
  * side effects - client is shown lists of who connected servers
  */
 static void
-stats_servers (struct Client *source_p)
+stats_servers(struct Client *source_p)
 {
 	struct Client *target_p;
 	dlink_node *ptr;
@@ -1039,15 +1010,13 @@
 	int days, hours, minutes;
 	int j = 0;
 
-	if(ConfigServerHide.flatten_links && !IsOper(source_p) &&
-	   !IsExemptShide(source_p))
+	if(ConfigServerHide.flatten_links && !IsOper(source_p) && !IsExemptShide(source_p))
 	{
-		sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
-				   form_str (ERR_NOPRIVILEGES));
+		sendto_one_numeric(source_p, ERR_NOPRIVILEGES, form_str(ERR_NOPRIVILEGES));
 		return;
 	}
 
-	DLINK_FOREACH (ptr, serv_list.head)
+	DLINK_FOREACH(ptr, serv_list.head)
 	{
 		target_p = ptr->data;
 
@@ -1067,13 +1036,11 @@
 				   target_p->name,
 				   (target_p->serv->by[0] ? target_p->serv->by : "Remote."),
 				   (int) (CurrentTime - target_p->localClient->lasttime),
-				   (int) linebuf_len (&target_p->localClient->buf_sendq),
-				   days, (days == 1) ? "" : "s", hours, minutes, 
-				   (int) seconds);
+				   (int) linebuf_len(&target_p->localClient->buf_sendq),
+				   days, (days == 1) ? "" : "s", hours, minutes, (int) seconds);
 	}
 
-	sendto_one_numeric(source_p, RPL_STATSDEBUG,
-			   "V :%d Server(s)", j);
+	sendto_one_numeric(source_p, RPL_STATSDEBUG, "V :%d Server(s)", j);
 }
 
 static void
@@ -1089,8 +1056,7 @@
 		if(aconf->hold)
 			sendto_one_numeric(source_p, RPL_STATSXLINE,
 					form_str(RPL_STATSXLINE),
-					'x', aconf->port, aconf->name,
-					aconf->passwd);
+					   'x', aconf->port, aconf->name, aconf->passwd);
 	}
 }
 
@@ -1107,8 +1073,7 @@
 		if(!aconf->hold)
 			sendto_one_numeric(source_p, RPL_STATSXLINE,
 					form_str(RPL_STATSXLINE),
-					'X', aconf->port, aconf->name, 
-					aconf->passwd);
+					   'X', aconf->port, aconf->name, aconf->passwd);
 	}
 }
 
@@ -1116,37 +1081,36 @@
 stats_class(struct Client *source_p)
 {
 	if(ConfigFileEntry.stats_y_oper_only && !IsOper(source_p))
-		sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
-				   form_str (ERR_NOPRIVILEGES));
+		sendto_one_numeric(source_p, ERR_NOPRIVILEGES, form_str(ERR_NOPRIVILEGES));
 	else
 		report_classes(source_p);
 }
 
 static void
-stats_memory (struct Client *source_p)
+stats_memory(struct Client *source_p)
 {
-	count_memory (source_p);
+	count_memory(source_p);
 }
 
 static void
-stats_ziplinks (struct Client *source_p)
+stats_ziplinks(struct Client *source_p)
 {
 	dlink_node *ptr;
 	struct Client *target_p;
 	int sent_data = 0;
 
-	DLINK_FOREACH (ptr, serv_list.head)
+	DLINK_FOREACH(ptr, serv_list.head)
 	{
 		target_p = ptr->data;
-		if(IsCapable (target_p, CAP_ZIP))
+		if(IsCapable(target_p, CAP_ZIP))
 		{
 			/* we use memcpy(3) and a local copy of the structure to
 			 * work around a register use bug on GCC on the SPARC.
 			 * -jmallett, 04/27/2002
 			 */
 			struct ZipStats zipstats;
-			memcpy (&zipstats, &target_p->localClient->zipstats,
-				sizeof (struct ZipStats)); 
+			memcpy(&zipstats, &target_p->localClient->zipstats,
+			       sizeof(struct ZipStats));
 			sendto_one_numeric(source_p, RPL_STATSDEBUG,
 					    "Z :ZipLinks stats for %s send[%.2f%% compression "
 					    "(%lu kB data/%lu kB wire)] recv[%.2f%% compression "
@@ -1158,12 +1122,11 @@
 		}
 	}
 
-	sendto_one_numeric(source_p, RPL_STATSDEBUG,
-			   "Z :%u ziplink(s)", sent_data);
+	sendto_one_numeric(source_p, RPL_STATSDEBUG, "Z :%u ziplink(s)", sent_data);
 }
 
 static void
-stats_servlinks (struct Client *source_p)
+stats_servlinks(struct Client *source_p)
 {
 	static char Sformat[] = ":%s %d %s %s %u %u %u %u %u :%u %u %s";
 	long uptime, sendK, receiveK;
@@ -1171,17 +1134,15 @@
 	dlink_node *ptr;
 	int j = 0;
 
-	if(ConfigServerHide.flatten_links && !IsOper (source_p) &&
-	   !IsExemptShide(source_p))
+	if(ConfigServerHide.flatten_links && !IsOper(source_p) && !IsExemptShide(source_p))
 	{
-		sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
-				   form_str (ERR_NOPRIVILEGES));
+		sendto_one_numeric(source_p, ERR_NOPRIVILEGES, form_str(ERR_NOPRIVILEGES));
 		return;
 	}
 
 	sendK = receiveK = 0;
 
-	DLINK_FOREACH (ptr, serv_list.head)
+	DLINK_FOREACH(ptr, serv_list.head)
 	{
 		target_p = ptr->data;
 
@@ -1192,7 +1153,7 @@
 		sendto_one(source_p, Sformat,
 			get_id(&me, source_p), RPL_STATSLINKINFO, get_id(source_p, source_p),
 			get_server_name(target_p, SHOW_IP),
-			(int) linebuf_len (&target_p->localClient->buf_sendq),
+			   (int) linebuf_len(&target_p->localClient->buf_sendq),
 			(int) target_p->localClient->sendM,
 			(int) target_p->localClient->sendK,
 			(int) target_p->localClient->receiveM,
@@ -1200,30 +1161,27 @@
 			CurrentTime - target_p->localClient->firsttime,
 			(CurrentTime > target_p->localClient->lasttime) ? 
 			 (CurrentTime - target_p->localClient->lasttime) : 0,
-			IsOper (source_p) ? show_capabilities (target_p) : "TS");
+			   IsOper(source_p) ? show_capabilities(target_p) : "TS");
 	}
 
-	sendto_one_numeric(source_p, RPL_STATSDEBUG,
-			   "? :%u total server(s)", j);
+	sendto_one_numeric(source_p, RPL_STATSDEBUG, "? :%u total server(s)", j);
 
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
-			   "? :Sent total : %7.2f %s",
-			   _GMKv (sendK), _GMKs (sendK));
+			   "? :Sent total : %7.2f %s", _GMKv(sendK), _GMKs(sendK));
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
-			   "? :Recv total : %7.2f %s",
-			   _GMKv (receiveK), _GMKs (receiveK));
+			   "? :Recv total : %7.2f %s", _GMKv(receiveK), _GMKs(receiveK));
 
 	uptime = (CurrentTime - startup_time);
 
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
 			   "? :Server send: %7.2f %s (%4.1f K/s)",
-			   _GMKv (me.localClient->sendK), 
-			   _GMKs (me.localClient->sendK),
+			   _GMKv(me.localClient->sendK),
+			   _GMKs(me.localClient->sendK),
 			   (float) ((float) me.localClient->sendK / (float) uptime));
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
 			   "? :Server recv: %7.2f %s (%4.1f K/s)",
-			   _GMKv (me.localClient->receiveK),
-			   _GMKs (me.localClient->receiveK),
+			   _GMKv(me.localClient->receiveK),
+			   _GMKs(me.localClient->receiveK),
 			   (float) ((float) me.localClient->receiveK / (float) uptime));
 }
 
@@ -1312,8 +1270,7 @@
 }
 
 void
-stats_l_client(struct Client *source_p, struct Client *target_p,
-		char statchar)
+stats_l_client(struct Client *source_p, struct Client *target_p, char statchar)
 {
 	if(IsAnyServer(target_p))
 	{
@@ -1347,8 +1304,7 @@
 				    (int) target_p->localClient->receiveK,
 				    CurrentTime - target_p->localClient->firsttime,
 				    (CurrentTime > target_p->localClient->lasttime) ? 
-				     (CurrentTime - target_p->localClient->lasttime) : 0,
-				    "-");
+				   (CurrentTime - target_p->localClient->lasttime) : 0, "-");
 	}
 
 	else
@@ -1364,8 +1320,7 @@
 				   (int) target_p->localClient->receiveK,
 				   CurrentTime - target_p->localClient->firsttime,
 				   (CurrentTime > target_p->localClient->lasttime) ? 
-				    (CurrentTime - target_p->localClient->lasttime) : 0,
-				   "-");
+				   (CurrentTime - target_p->localClient->lasttime) : 0, "-");
 	}
 }
 
@@ -1391,7 +1346,7 @@
 	data.statchar = statchar;
 	data.name = name;
 
-	hook_call_event (doing_stats_hook, &data);
+	hook_call_event(doing_stats_hook, &data);
 }
 
 /* stats_p_spy()
@@ -1401,7 +1356,7 @@
  * side effects - call hook doing_stats_p
  */
 static void
-stats_p_spy (struct Client *source_p)
+stats_p_spy(struct Client *source_p)
 {
 	struct hook_spy_data data;
 
@@ -1409,6 +1364,5 @@
 	data.name = NULL;
 	data.statchar = 'p';
 
-	hook_call_event (doing_stats_p_hook, &data);
+	hook_call_event(doing_stats_p_hook, &data);
 }
-
Index: modules/m_svinfo.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_svinfo.c,v
retrieving revision 1.61
diff -b -u -r1.61 m_svinfo.c
--- modules/m_svinfo.c	5 Apr 2004 02:37:58 -0000	1.61
+++ modules/m_svinfo.c	19 Aug 2004 22:16:23 -0000
@@ -44,6 +44,7 @@
 };
 
 mapi_clist_av1 svinfo_clist[] = { &svinfo_msgtab, NULL };
+
 DECLARE_MODULE_AV1(svinfo, NULL, NULL, svinfo_clist, NULL, NULL, "$Revision: 1.61 $");
 
 /*
@@ -91,7 +92,8 @@
 		ilog(L_SERVER,
 		     "Link %s dropped, excessive TS delta"
 		     " (my TS=%ld, their TS=%ld, delta=%d)",
-		     log_client_name(source_p, SHOW_IP), (long) CurrentTime, (long) theirtime, deltat);
+		     log_client_name(source_p, SHOW_IP), (long) CurrentTime, (long) theirtime,
+		     deltat);
 		exit_client(source_p, source_p, source_p, "Excessive TS delta");
 		return 0;
 	}
@@ -106,4 +108,3 @@
 
 	return 0;
 }
-
Index: modules/m_tb.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/Attic/m_tb.c,v
retrieving revision 1.7
diff -b -u -r1.7 m_tb.c
--- modules/m_tb.c	5 Apr 2004 02:37:58 -0000	1.7
+++ modules/m_tb.c	19 Aug 2004 22:16:23 -0000
@@ -52,6 +52,7 @@
 };
 
 mapi_clist_av1 tb_clist[] =  { &tb_msgtab, NULL };
+
 DECLARE_MODULE_AV1(tb, NULL, NULL, tb_clist, NULL, NULL, "$Revision: 1.7 $");
 
 /* m_tb()
@@ -99,7 +100,7 @@
 		set_channel_topic(chptr, newtopic, newtopicwho, newtopicts);
 		sendto_channel_local(ALL_MEMBERS, chptr, ":%s TOPIC %s :%s",
 				     source_p->name, chptr->chname, newtopic);
-		sendto_server(client_p, chptr, CAP_TB|CAP_TS6, NOCAPS,
+		sendto_server(client_p, chptr, CAP_TB | CAP_TS6, NOCAPS,
 			      ":%s TB %s %ld %s%s:%s",
 			      use_id(source_p), chptr->chname, (long) chptr->topic_time,
 			      ConfigChannel.burst_topicwho ? chptr->topic_info : "",
Index: modules/m_testline.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_testline.c,v
retrieving revision 1.50.2.1
diff -b -u -r1.50.2.1 m_testline.c
--- modules/m_testline.c	3 Aug 2004 20:39:47 -0000	1.50.2.1
+++ modules/m_testline.c	19 Aug 2004 22:16:23 -0000
@@ -54,6 +54,7 @@
 };
 
 mapi_clist_av1 testline_clist[] = { &testline_msgtab, &testgecos_msgtab, NULL };
+
 DECLARE_MODULE_AV1(testline, NULL, NULL, testline_clist, NULL, NULL, "$Revision: 1.50.2.1 $");
 
 static int
@@ -95,14 +96,14 @@
 		host = mask;
 
 	/* parses as an IP, check for a dline */
-	if((type = parse_netmask(host, (struct sockaddr *)&ip, &host_mask)) != HM_HOST)
+	if((type = parse_netmask(host, (struct sockaddr *) &ip, &host_mask)) != HM_HOST)
 	{
 #ifdef IPV6
 		if(type == HM_IPV6)
-			aconf = find_dline((struct sockaddr *)&ip, AF_INET6);
+			aconf = find_dline((struct sockaddr *) &ip, AF_INET6);
 		else
 #endif
-			aconf = find_dline((struct sockaddr *)&ip, AF_INET);
+			aconf = find_dline((struct sockaddr *) &ip, AF_INET);
 
 		if(aconf && aconf->status & CONF_DLINE)
 		{
@@ -119,19 +120,20 @@
 
 	/* now look for a matching I/K/G */
 	if((aconf = find_address_conf(host, username ? username : "dummy",
-				(type != HM_HOST) ? (struct sockaddr *)&ip : NULL,
+				      (type != HM_HOST) ? (struct sockaddr *) &ip : NULL,
 				(type != HM_HOST) ? (
 #ifdef IPV6
-				 (type == HM_IPV6) ? AF_INET6 : 
+										(type ==
+										 HM_IPV6) ? AF_INET6
+										:
 #endif
 				  AF_INET) : 0)))
 	{
-		static char buf[HOSTLEN+USERLEN+2];
+		static char buf[HOSTLEN + USERLEN + 2];
 
 		if(aconf->status & CONF_KILL)
 		{
-			ircsnprintf(buf, sizeof(buf), "%s@%s", 
-					aconf->user, aconf->host);
+			ircsnprintf(buf, sizeof(buf), "%s@%s", aconf->user, aconf->host);
 			sendto_one(source_p, form_str(RPL_TESTLINE),
 				me.name, source_p->name,
 				(aconf->flags & CONF_FLAGS_TEMPORARY) ? 'k' : 'K',
@@ -142,8 +144,7 @@
 		}
 		else if(aconf->status & CONF_GLINE)
 		{
-			ircsnprintf(buf, sizeof(buf), "%s@%s",
-					aconf->user, aconf->host);
+			ircsnprintf(buf, sizeof(buf), "%s@%s", aconf->user, aconf->host);
 			sendto_one(source_p, form_str(RPL_TESTLINE),
 				me.name, source_p->name,
 				'G', (long) ((aconf->hold - CurrentTime) / 60),
@@ -173,8 +174,7 @@
 	}
 
 	/* nothing matches.. */
-	sendto_one(source_p, form_str(RPL_NOTESTLINE),
-			me.name, source_p->name, parv[1]);
+	sendto_one(source_p, form_str(RPL_NOTESTLINE), me.name, source_p->name, parv[1]);
 	return 0;
 }
 
@@ -185,8 +185,7 @@
 
 	if(!(aconf = find_xline(parv[1], 0)))
 	{
-		sendto_one(source_p, form_str(RPL_NOTESTLINE),
-				me.name, source_p->name, parv[1]);
+		sendto_one(source_p, form_str(RPL_NOTESTLINE), me.name, source_p->name, parv[1]);
 		return 0;
 	}
 
Index: modules/m_testmask.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_testmask.c,v
retrieving revision 1.2
diff -b -u -r1.2 m_testmask.c
--- modules/m_testmask.c	5 Apr 2004 20:01:24 -0000	1.2
+++ modules/m_testmask.c	19 Aug 2004 22:16:23 -0000
@@ -57,11 +57,11 @@
 };
 
 mapi_clist_av1 testmask_clist[] = { &testmask_msgtab, NULL };
+
 DECLARE_MODULE_AV1(testmask, NULL, NULL, testmask_clist, NULL, NULL, "$Revision: 1.2 $");
 
 static int
-mo_testmask(struct Client *client_p, struct Client *source_p,
-                        int parc, const char *parv[])
+mo_testmask(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
 	struct Client *target_p;
 	int lcount = 0;
@@ -75,8 +75,7 @@
 
 	if((hostname = strchr(username, '@')) == NULL)
 	{
-		sendto_one(source_p, ":%s NOTICE %s :Invalid parameters",
-				me.name, source_p->name);
+		sendto_one(source_p, ":%s NOTICE %s :Invalid parameters", me.name, source_p->name);
 		return 0;
 	}
 
@@ -89,8 +88,7 @@
 		if(!IsPerson(target_p))
 			continue;
 
-		if(match(username, target_p->username) &&
-		   match(hostname, target_p->host))
+		if(match(username, target_p->username) && match(hostname, target_p->host))
 		{
 			if(MyClient(target_p))
 				lcount++;
@@ -100,7 +98,6 @@
 	}
 
 	sendto_one(source_p, form_str(RPL_TESTMASK),
-			me.name, source_p->name, username, hostname,
-			lcount, gcount);
+		   me.name, source_p->name, username, hostname, lcount, gcount);
 	return 0;
 }
Index: modules/m_time.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_time.c,v
retrieving revision 1.45
diff -b -u -r1.45 m_time.c
--- modules/m_time.c	15 Mar 2004 17:58:03 -0000	1.45
+++ modules/m_time.c	19 Aug 2004 22:16:23 -0000
@@ -46,6 +46,7 @@
 };
 
 mapi_clist_av1 time_clist[] = { &time_msgtab, NULL };
+
 DECLARE_MODULE_AV1(time, NULL, NULL, time_clist, NULL, NULL, "$Revision: 1.45 $");
 
 static const char *months[] = {
@@ -72,8 +73,7 @@
 		flood_endgrace(source_p);
 
 	if(hunt_server(client_p, source_p, ":%s TIME :%s", 1, parc, parv) == HUNTED_ISME)
-		sendto_one_numeric(source_p, RPL_TIME, form_str(RPL_TIME),
-				   me.name, date());
+		sendto_one_numeric(source_p, RPL_TIME, form_str(RPL_TIME), me.name, date());
 
 	return 0;
 }
Index: modules/m_topic.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_topic.c,v
retrieving revision 1.87
diff -b -u -r1.87 m_topic.c
--- modules/m_topic.c	15 Mar 2004 17:58:03 -0000	1.87
+++ modules/m_topic.c	19 Aug 2004 22:16:23 -0000
@@ -50,6 +50,7 @@
 };
 
 mapi_clist_av1 topic_clist[] = { &topic_msgtab, NULL };
+
 DECLARE_MODULE_AV1(topic, NULL, NULL, topic_clist, NULL, NULL, "$Revision: 1.87 $");
 
 /*
Index: modules/m_trace.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_trace.c,v
retrieving revision 1.97.2.3
diff -b -u -r1.97.2.3 m_trace.c
--- modules/m_trace.c	4 Aug 2004 00:21:11 -0000	1.97.2.3
+++ modules/m_trace.c	19 Aug 2004 22:16:23 -0000
@@ -56,9 +56,10 @@
 
 mapi_clist_av1 trace_clist[] = { &trace_msgtab, NULL };
 mapi_hlist_av1 trace_hlist[] = {
-	{ "doing_trace",	&doing_trace_hook },
-	{ NULL, NULL }
+	{"doing_trace", &doing_trace_hook},
+	{NULL, NULL}
 };
+
 DECLARE_MODULE_AV1(trace, NULL, NULL, trace_clist, trace_hlist, NULL, "$Revision: 1.97.2.3 $");
 
 static int report_this_status(struct Client *source_p, struct Client *target_p, int dow,
@@ -173,8 +174,7 @@
 
 		trace_spy(source_p, tname);
 
-		sendto_one_numeric(source_p, RPL_ENDOFTRACE, 
-				   form_str(RPL_ENDOFTRACE), tname);
+		sendto_one_numeric(source_p, RPL_ENDOFTRACE, form_str(RPL_ENDOFTRACE), tname);
 		return 0;
 	}
 
@@ -192,7 +192,8 @@
 		{
 			target_p = ptr->data;
 
-			link_u[target_p->from->localClient->fd] += dlink_list_length(&target_p->serv->users);
+			link_u[target_p->from->localClient->fd] +=
+				dlink_list_length(&target_p->serv->users);
 			link_s[target_p->from->localClient->fd]++;
 		}
 	}
@@ -230,8 +231,7 @@
 					link_s[target_p->localClient->fd]);
 		}
 
-		sendto_one_numeric(source_p, RPL_ENDOFTRACE, 
-				   form_str(RPL_ENDOFTRACE), tname);
+		sendto_one_numeric(source_p, RPL_ENDOFTRACE, form_str(RPL_ENDOFTRACE), tname);
 		return 0;
 	}
 
@@ -295,8 +295,7 @@
 		/* let the user have some idea that its at the end of the
 		 * trace
 		 */
-		sendto_one_numeric(source_p, RPL_ENDOFTRACE, 
-				   form_str(RPL_ENDOFTRACE), tname);
+		sendto_one_numeric(source_p, RPL_ENDOFTRACE, form_str(RPL_ENDOFTRACE), tname);
 		return 0;
 	}
 
@@ -339,7 +338,7 @@
 	if(!MyConnect(target_p))
 		return 0;
 
-	inetntop_sock((struct sockaddr *)&target_p->localClient->ip, ip, sizeof(ip));
+	inetntop_sock((struct sockaddr *) &target_p->localClient->ip, ip, sizeof(ip));
 	class_name = get_client_class(target_p);
 
 	if(IsAnyServer(target_p))
@@ -351,15 +350,13 @@
 	{
 	case STAT_CONNECTING:
 		sendto_one_numeric(source_p, RPL_TRACECONNECTING,
-				form_str(RPL_TRACECONNECTING),
-				class_name, name);
+				   form_str(RPL_TRACECONNECTING), class_name, name);
 		cnt++;
 		break;
 
 	case STAT_HANDSHAKE:
 		sendto_one_numeric(source_p, RPL_TRACEHANDSHAKE,
-				form_str(RPL_TRACEHANDSHAKE),
-				class_name, name);
+				   form_str(RPL_TRACEHANDSHAKE), class_name, name);
 		cnt++;
 		break;
 
@@ -385,8 +382,7 @@
 		{
 			if(IsOper(target_p))
 				sendto_one_numeric(source_p, RPL_TRACEOPERATOR,
-						   form_str(RPL_TRACEOPERATOR),
-						   class_name, name,
+						   form_str(RPL_TRACEOPERATOR), class_name, name,
 #ifndef HIDE_SPOOF_IPS
 						   MyOper(source_p) ? ip :
 #endif
@@ -396,8 +392,7 @@
 
 			else
 				sendto_one_numeric(source_p, RPL_TRACEUSER, 
-						   form_str(RPL_TRACEUSER),
-						   class_name, name,
+						   form_str(RPL_TRACEUSER), class_name, name,
 #ifndef HIDE_SPOOF_IPS
 						   MyOper(source_p) ? ip :
 #endif
@@ -418,8 +413,7 @@
 
 	default:		/* ...we actually shouldn't come here... --msa */
 		sendto_one_numeric(source_p, RPL_TRACENEWTYPE, 
-				   form_str(RPL_TRACENEWTYPE), 
-				   me.name, source_p->name, name);
+				   form_str(RPL_TRACENEWTYPE), me.name, source_p->name, name);
 		cnt++;
 		break;
 	}
Index: modules/m_user.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/Attic/m_user.c,v
retrieving revision 1.43
diff -b -u -r1.43 m_user.c
--- modules/m_user.c	15 Mar 2004 17:58:03 -0000	1.43
+++ modules/m_user.c	19 Aug 2004 22:16:23 -0000
@@ -46,6 +46,7 @@
 };
 
 mapi_clist_av1 user_clist[] = { &user_msgtab, NULL };
+
 DECLARE_MODULE_AV1(user, NULL, NULL, user_clist, NULL, NULL, "$Revision: 1.43 $");
 
 static int do_local_user(struct Client *client_p, struct Client *source_p,
Index: modules/m_userhost.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_userhost.c,v
retrieving revision 1.56
diff -b -u -r1.56 m_userhost.c
--- modules/m_userhost.c	15 Mar 2004 17:58:03 -0000	1.56
+++ modules/m_userhost.c	19 Aug 2004 22:16:24 -0000
@@ -47,6 +47,7 @@
 };
 
 mapi_clist_av1 userhost_clist[] = { &userhost_msgtab, NULL };
+
 DECLARE_MODULE_AV1(userhost, NULL, NULL, userhost_clist, NULL, NULL, "$Revision: 1.56 $");
 
 /*
@@ -67,7 +68,7 @@
 	cur_len = ircsprintf(buf, form_str(RPL_USERHOST), me.name, parv[0], "");
 	t = buf + cur_len;
 
-	for (i = 1; i < 5; i++)
+	for(i = 1; i < 5; i++)
 	{
 		if(parc < i + 1)
 			break;
@@ -86,8 +87,7 @@
 						target_p->name,
 						IsOper(target_p) ? "*" : "",
 						(target_p->user->away) ? '-' : '+',
-						target_p->username,
-						target_p->sockhost);
+						target_p->username, target_p->sockhost);
 			}
 			else
 			{
Index: modules/m_users.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/Attic/m_users.c,v
retrieving revision 1.43
diff -b -u -r1.43 m_users.c
--- modules/m_users.c	15 Mar 2004 17:58:03 -0000	1.43
+++ modules/m_users.c	19 Aug 2004 22:16:24 -0000
@@ -43,6 +43,7 @@
 };
 
 mapi_clist_av1 users_clist[] = { &users_msgtab, NULL };
+
 DECLARE_MODULE_AV1(users, NULL, NULL, users_clist, NULL, NULL, "$Revision: 1.43 $");
 
 /*
@@ -57,12 +58,10 @@
 	{
 		sendto_one_numeric(source_p, RPL_LOCALUSERS,
 				   form_str(RPL_LOCALUSERS),
-				   dlink_list_length(&lclient_list), 
-				   Count.max_loc);
+				   dlink_list_length(&lclient_list), Count.max_loc);
 
 		sendto_one_numeric(source_p, RPL_GLOBALUSERS, 
-				   form_str(RPL_GLOBALUSERS),
-				   Count.total, Count.max_tot);
+				   form_str(RPL_GLOBALUSERS), Count.total, Count.max_tot);
 	}
 
 	return 0;
Index: modules/m_version.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_version.c,v
retrieving revision 1.65
diff -b -u -r1.65 m_version.c
--- modules/m_version.c	21 Apr 2004 14:16:08 -0000	1.65
+++ modules/m_version.c	19 Aug 2004 22:16:24 -0000
@@ -47,6 +47,7 @@
 };
 
 mapi_clist_av1 version_clist[] = { &version_msgtab, NULL };
+
 DECLARE_MODULE_AV1(version, NULL, NULL, version_clist, NULL, NULL, "$Revision: 1.65 $");
 
 /*
@@ -76,8 +77,7 @@
 	}
 
 	sendto_one_numeric(source_p, RPL_VERSION, form_str(RPL_VERSION),
-			   ircd_version, serno,
-			   me.name, confopts(source_p), TS_CURRENT);
+			   ircd_version, serno, me.name, confopts(source_p), TS_CURRENT);
 
 	show_isupport(source_p);
 
@@ -95,8 +95,7 @@
 	if(hunt_server(client_p, source_p, ":%s VERSION :%s", 1, parc, parv) == HUNTED_ISME)
 	{
 		sendto_one_numeric(source_p, RPL_VERSION, form_str(RPL_VERSION),
-				   ircd_version, serno, 
-				   me.name, confopts(source_p), TS_CURRENT);
+				   ircd_version, serno, me.name, confopts(source_p), TS_CURRENT);
 		show_isupport(source_p);
 	}
 
Index: modules/m_wallops.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_wallops.c,v
retrieving revision 1.56
diff -b -u -r1.56 m_wallops.c
--- modules/m_wallops.c	15 Mar 2004 17:58:03 -0000	1.56
+++ modules/m_wallops.c	19 Aug 2004 22:16:24 -0000
@@ -52,6 +52,7 @@
 };
 
 mapi_clist_av1 wallops_clist[] = { &wallops_msgtab, &operwall_msgtab, NULL };
+
 DECLARE_MODULE_AV1(wallops, NULL, NULL, wallops_clist, NULL, NULL, "$Revision: 1.56 $");
 
 /*
@@ -63,16 +64,14 @@
 {
 	if(!IsOperOperwall(source_p))
 	{
-		sendto_one(source_p, form_str(ERR_NOPRIVS),
-			   me.name, source_p->name, "operwall");
+		sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "operwall");
 		return 0;
 	}
 
 	sendto_wallops_flags(UMODE_OPERWALL, source_p, "OPERWALL - %s", parv[1]);
 	sendto_server(client_p, NULL, CAP_TS6, NOCAPS, ":%s OPERWALL :%s", 
 		      use_id(source_p), parv[1]);
-	sendto_server(client_p, NULL, NOCAPS, CAP_TS6, ":%s OPERWALL :%s", 
-		      source_p->name, parv[1]);
+	sendto_server(client_p, NULL, NOCAPS, CAP_TS6, ":%s OPERWALL :%s", source_p->name, parv[1]);
 
 	return 0;
 }
@@ -88,8 +87,7 @@
 {
 	sendto_server(client_p, NULL, CAP_TS6, NOCAPS, ":%s OPERWALL :%s",
 		      use_id(source_p), parv[1]);
-	sendto_server(client_p, NULL, NOCAPS, CAP_TS6, ":%s OPERWALL :%s",
-		      source_p->name, parv[1]);
+	sendto_server(client_p, NULL, NOCAPS, CAP_TS6, ":%s OPERWALL :%s", source_p->name, parv[1]);
 	sendto_wallops_flags(UMODE_OPERWALL, source_p, "OPERWALL - %s", parv[1]);
 
 	return 0;
@@ -109,8 +107,7 @@
 
 	sendto_server(client_p, NULL, CAP_TS6, NOCAPS, ":%s WALLOPS :%s", 
 		      use_id(source_p), parv[1]);
-	sendto_server(client_p, NULL, NOCAPS, CAP_TS6, ":%s WALLOPS :%s", 
-		      source_p->name, parv[1]);
+	sendto_server(client_p, NULL, NOCAPS, CAP_TS6, ":%s WALLOPS :%s", source_p->name, parv[1]);
 
 	return 0;
 }
Index: modules/m_who.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_who.c,v
retrieving revision 1.112
diff -b -u -r1.112 m_who.c
--- modules/m_who.c	21 Apr 2004 14:19:26 -0000	1.112
+++ modules/m_who.c	19 Aug 2004 22:16:24 -0000
@@ -51,6 +51,7 @@
 };
 
 mapi_clist_av1 who_clist[] = { &who_msgtab, NULL };
+
 DECLARE_MODULE_AV1(who, NULL, NULL, who_clist, NULL, NULL, "$Revision: 1.112 $");
 
 static void do_who_on_channel(struct Client *source_p, struct Channel *chptr,
@@ -97,8 +98,7 @@
 			do_who_on_channel(source_p, msptr->chptr, server_oper, YES);
 		}
 
-		sendto_one(source_p, form_str(RPL_ENDOFWHO),
-			   me.name, source_p->name, "*");
+		sendto_one(source_p, form_str(RPL_ENDOFWHO), me.name, source_p->name, "*");
 		return 0;
 	}
 
@@ -130,15 +130,13 @@
 			else if(!SecretChannel(chptr))
 				do_who_on_channel(source_p, chptr, server_oper, NO);
 		}
-		sendto_one(source_p, form_str(RPL_ENDOFWHO),
-			   me.name, source_p->name, mask);
+		sendto_one(source_p, form_str(RPL_ENDOFWHO), me.name, source_p->name, mask);
 		return 0;
 	}
 
 	/* '/who nick' */
 
-	if(((target_p = find_named_person(mask)) != NULL) &&
-	   (!server_oper || IsOper(target_p)))
+	if(((target_p = find_named_person(mask)) != NULL) && (!server_oper || IsOper(target_p)))
 	{
 		int isinvis = 0;
 
@@ -162,12 +160,11 @@
 		 */
 		if(lp != NULL)
 			do_who(source_p, target_p, chptr->chname,
-			       find_channel_status(lp->data, 0));
+			       find_channel_status(lp->data, 0, 1));
 		else
 			do_who(source_p, target_p, NULL, "");
 
-		sendto_one(source_p, form_str(RPL_ENDOFWHO), 
-			   me.name, source_p->name, mask);
+		sendto_one(source_p, form_str(RPL_ENDOFWHO), me.name, source_p->name, mask);
 		return 0;
 	}
 
@@ -179,10 +176,8 @@
 	{
 		if((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
 		{
-			sendto_one(source_p, form_str(RPL_LOAD2HI),
-					me.name, source_p->name, "WHO");
-			sendto_one(source_p, form_str(RPL_ENDOFWHO),
-				   me.name, source_p->name, "*");
+			sendto_one(source_p, form_str(RPL_LOAD2HI), me.name, source_p->name, "WHO");
+			sendto_one(source_p, form_str(RPL_ENDOFWHO), me.name, source_p->name, "*");
 			return 0;
 		}
 		else
@@ -198,8 +193,7 @@
 	else
 		who_global(source_p, mask, server_oper, operspy);
 
-	sendto_one(source_p, form_str(RPL_ENDOFWHO),
-		   me.name, source_p->name, mask);
+	sendto_one(source_p, form_str(RPL_ENDOFWHO), me.name, source_p->name, mask);
 
 	return 0;
 }
@@ -332,8 +326,7 @@
  * side effects - do a who on given channel
  */
 static void
-do_who_on_channel(struct Client *source_p, struct Channel *chptr,
-		  int server_oper, int member)
+do_who_on_channel(struct Client *source_p, struct Channel *chptr, int server_oper, int member)
 {
 	struct Client *target_p;
 	struct membership *msptr;
@@ -348,8 +341,7 @@
 			continue;
 
 		if(member || !IsInvisible(target_p))
-			do_who(source_p, target_p, chptr->chname,
-			       find_channel_status(msptr, 0));
+			do_who(source_p, target_p, chptr->chname, find_channel_status(msptr, 0, 1));
 	}
 }
 
@@ -376,7 +368,5 @@
 		   (chname) ? (chname) : "*",
 		   target_p->username,
 		   target_p->host, target_p->user->server, target_p->name,
-		   status, 
-		   ConfigServerHide.flatten_links ? 0 : target_p->hopcount, 
-		   target_p->info);
+		   status, ConfigServerHide.flatten_links ? 0 : target_p->hopcount, target_p->info);
 }
Index: modules/m_whois.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_whois.c,v
retrieving revision 1.140.2.2
diff -b -u -r1.140.2.2 m_whois.c
--- modules/m_whois.c	4 Aug 2004 00:21:11 -0000	1.140.2.2
+++ modules/m_whois.c	19 Aug 2004 22:16:24 -0000
@@ -46,7 +46,8 @@
 #include "hook.h"
 #include "s_newconf.h"
 
-static void do_whois(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
+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 Client *, struct Client *, int, const char **);
@@ -62,9 +63,9 @@
 
 mapi_clist_av1 whois_clist[] = { &whois_msgtab, NULL };
 mapi_hlist_av1 whois_hlist[] = {
-	{ "doing_whois",	&doing_whois_hook },
-	{ "doing_whois_global",	&doing_whois_global_hook },
-	{ NULL, NULL }
+	{"doing_whois", &doing_whois_hook},
+	{"doing_whois_global", &doing_whois_global_hook},
+	{NULL, NULL}
 };
 
 DECLARE_MODULE_AV1(whois, NULL, NULL, whois_clist, whois_hlist, NULL, "$Revision: 1.140.2.2 $");
@@ -123,8 +124,7 @@
 	if((target_p = find_client(parv[1])) == NULL)
 	{
 		sendto_one_numeric(source_p, ERR_NOSUCHSERVER,
-				   form_str(ERR_NOSUCHSERVER), 
-				   IsDigit(parv[1][0]) ? "*" : parv[1]);
+				   form_str(ERR_NOSUCHSERVER), IsDigit(parv[1][0]) ? "*" : parv[1]);
 		return 0;
 	}
 
@@ -134,8 +134,7 @@
 	if(!MyClient(target_p) && !IsMe(target_p))
 	{
 		sendto_one(target_p, ":%s WHOIS %s :%s", 
-			   get_id(source_p, target_p), 
-			   get_id(target_p, target_p), parv[2]);
+			   get_id(source_p, target_p), get_id(target_p, target_p), parv[2]);
 		return 0;
 	}
 
@@ -194,11 +193,9 @@
 	}
 	else
 		sendto_one_numeric(source_p, ERR_NOSUCHNICK,
-				   form_str(ERR_NOSUCHNICK), 
-				   IsDigit(*nick) ? "*" : parv[1]);
+				   form_str(ERR_NOSUCHNICK), IsDigit(*nick) ? "*" : parv[1]);
 
-	sendto_one_numeric(source_p, RPL_ENDOFWHOIS, 
-			   form_str(RPL_ENDOFWHOIS), parv[1]);
+	sendto_one_numeric(source_p, RPL_ENDOFWHOIS, form_str(RPL_ENDOFWHOIS), parv[1]);
 	return;
 }
 
@@ -242,8 +239,7 @@
 	a2client_p = target_p->servptr;
 
 	sendto_one_numeric(source_p, RPL_WHOISUSER, form_str(RPL_WHOISUSER),
-			   target_p->name, target_p->username, 
-			   target_p->host, target_p->info);
+			   target_p->name, target_p->username, target_p->host, target_p->info);
 
 	cur_len = mlen = ircsprintf(buf, form_str(RPL_WHOISCHANNELS), 
 				    get_id(&me, source_p), get_id(source_p, source_p), 
@@ -269,8 +265,7 @@
 
 			tlen = ircsprintf(t, "%s%s%s ",
 					visible ? "" : "!",
-					find_channel_status(msptr, 1),
-					chptr->chname);
+					  find_channel_status(msptr, 1, 1), chptr->chname);
 			t += tlen;
 			cur_len += tlen;
 		}
@@ -333,4 +328,3 @@
 
 	return;
 }
-
Index: modules/m_whowas.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_whowas.c,v
retrieving revision 1.49
diff -b -u -r1.49 m_whowas.c
--- modules/m_whowas.c	15 Mar 2004 17:58:03 -0000	1.49
+++ modules/m_whowas.c	19 Aug 2004 22:16:24 -0000
@@ -49,6 +49,7 @@
 };
 
 mapi_clist_av1 whowas_clist[] = { &whowas_msgtab, NULL };
+
 DECLARE_MODULE_AV1(whowas, NULL, NULL, whowas_clist, NULL, NULL, "$Revision: 1.49 $");
 
 /*
@@ -98,7 +99,7 @@
 
 	temp = WHOWASHASH[hash_whowas_name(nick)];
 	found = 0;
-	for (; temp; temp = temp->next)
+	for(; temp; temp = temp->next)
 	{
 		if(!irccmp(nick, temp->name))
 		{
@@ -108,8 +109,7 @@
 
 			sendto_one_numeric(source_p, RPL_WHOISSERVER,
 					   form_str(RPL_WHOISSERVER),
-					   temp->name, temp->servername,
-					   myctime(temp->logoff));
+					   temp->name, temp->servername, myctime(temp->logoff));
 			cur++;
 			found++;
 		}
@@ -118,10 +118,8 @@
 	}
 
 	if(!found)
-		sendto_one(source_p, form_str(ERR_WASNOSUCHNICK), 
-			   me.name, source_p->name, nick);
+		sendto_one(source_p, form_str(ERR_WASNOSUCHNICK), me.name, source_p->name, nick);
 
-	sendto_one(source_p, form_str(RPL_ENDOFWHOWAS), 
-		   me.name, source_p->name, parv[1]);
+	sendto_one(source_p, form_str(RPL_ENDOFWHOWAS), me.name, source_p->name, parv[1]);
 	return 0;
 }
Index: modules/m_xline.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/m_xline.c,v
retrieving revision 1.52
diff -b -u -r1.52 m_xline.c
--- modules/m_xline.c	25 May 2004 16:39:31 -0000	1.52
+++ modules/m_xline.c	19 Aug 2004 22:16:25 -0000
@@ -56,9 +56,12 @@
 static int mo_xline(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
 static int ms_xline(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
 static int me_xline(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
-static int mo_unxline(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
-static int ms_unxline(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
-static int me_unxline(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
+static int mo_unxline(struct Client *client_p, struct Client *source_p, int parc,
+		      const char *parv[]);
+static int ms_unxline(struct Client *client_p, struct Client *source_p, int parc,
+		      const char *parv[]);
+static int me_unxline(struct Client *client_p, struct Client *source_p, int parc,
+		      const char *parv[]);
 
 struct Message xline_msgtab = {
 	"XLINE", 0, 0, 0, MFLG_SLOW,
@@ -70,6 +73,7 @@
 };
 
 mapi_clist_av1 xline_clist[] =  { &xline_msgtab, &unxline_msgtab, NULL };
+
 DECLARE_MODULE_AV1(xline, NULL, NULL, xline_clist, NULL, NULL, "$Revision: 1.52 $");
 
 static int valid_xline(struct Client *, const char *, const char *);
@@ -77,8 +81,7 @@
 			const char *reason, int temp_time);
 static void write_xline(struct Client *source_p, struct ConfItem *aconf);
 static void propagate_xline(struct Client *source_p, const char *target,
-			int temp_time, const char *name, 
-			const char *type, const char *reason);
+			    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);
 
@@ -108,8 +111,7 @@
 
 	if(!IsOperXline(source_p))
 	{
-		sendto_one(source_p, form_str(ERR_NOPRIVS),
-			   me.name, source_p->name, "xline");
+		sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "xline");
 		return 0;
 	}
 
@@ -130,9 +132,9 @@
 	}
 
 	/* XLINE <gecos> ON <server> :<reason> */
-	if(parc >= loc+2 && !irccmp(parv[loc], "ON"))
+	if(parc >= loc + 2 && !irccmp(parv[loc], "ON"))
 	{
-		target_server = parv[loc+1];
+		target_server = parv[loc + 1];
 		loc += 2;
 	}
 
@@ -147,8 +149,7 @@
 
 	if(target_server != NULL)
 	{
-		propagate_xline(source_p, target_server, temp_time,
-				name, "2", reason);
+		propagate_xline(source_p, target_server, temp_time, name, "2", reason);
 
 		if(!match(target_server, me.name))
 			return 0;
@@ -199,8 +200,7 @@
 }
 
 static void
-handle_remote_xline(struct Client *source_p, int temp_time,
-			const char *name, const char *reason)
+handle_remote_xline(struct Client *source_p, int temp_time, const char *name, const char *reason)
 {
 	struct ConfItem *aconf;
 
@@ -215,8 +215,7 @@
 	if((aconf = find_xline(name, 0)) != NULL)
 	{
 		sendto_one(source_p, ":%s NOTICE %s :[%s] already X-Lined by [%s] - %s",
-				me.name, source_p->name, name, 
-				aconf->name, aconf->passwd);
+			   me.name, source_p->name, name, aconf->name, aconf->passwd);
 		return;
 	}
 
@@ -230,21 +229,18 @@
  * side effects - checks the xline for validity, erroring if needed
  */
 static int
-valid_xline(struct Client *source_p, const char *gecos,
-	    const char *reason)
+valid_xline(struct Client *source_p, const char *gecos, const char *reason)
 {
 	if(EmptyString(reason))
 	{
 		sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS),
-			   get_id(&me, source_p), 
-			   get_id(source_p, source_p), "XLINE");
+			   get_id(&me, source_p), get_id(source_p, source_p), "XLINE");
 		return 0;
 	}
 
 	if(strchr(reason, ':') != NULL)
 	{
-		sendto_one_notice(source_p,
-				  ":Invalid character ':' in comment");
+		sendto_one_notice(source_p, ":Invalid character ':' in comment");
 		return 0;
 	}
 
@@ -261,8 +257,7 @@
 }
 
 void
-apply_xline(struct Client *source_p, const char *name, const char *reason,
-		int temp_time)
+apply_xline(struct Client *source_p, const char *name, const char *reason, int temp_time)
 {
 	struct ConfItem *aconf;
 
@@ -279,11 +274,9 @@
 
 		sendto_realops_flags(UMODE_ALL, L_ALL,
 			     "%s added temporary %d min. X-Line for [%s] [%s]",
-			     get_oper_name(source_p), temp_time / 60,
-			     name, reason);
+				     get_oper_name(source_p), temp_time / 60, name, reason);
 		ilog(L_KLINE, "X %s %d %s %s",
-			get_oper_name(source_p), temp_time / 60,
-			name, reason);
+		     get_oper_name(source_p), temp_time / 60, name, reason);
 		sendto_one_notice(source_p, ":Added temporary %d min. X-Line [%s]",
 				temp_time / 60, name);
 	}
@@ -292,12 +285,10 @@
 		write_xline(source_p, aconf);
 
 		sendto_realops_flags(UMODE_ALL, L_ALL, "%s added X-Line for [%s] [%s]",
-				get_oper_name(source_p), 
-				aconf->name, aconf->passwd);
+				     get_oper_name(source_p), aconf->name, aconf->passwd);
 		sendto_one_notice(source_p, ":Added X-Line for [%s] [%s]",
 					aconf->name, aconf->passwd);
-		ilog(L_KLINE, "X %s 0 %s %s",
-			get_oper_name(source_p), name, reason);
+		ilog(L_KLINE, "X %s 0 %s %s", get_oper_name(source_p), name, reason);
 	}
 
 	dlinkAddAlloc(aconf, &xline_conf_list);
@@ -327,8 +318,7 @@
 	}
 
 	ircsprintf(buffer, "\"%s\",\"0\",\"%s\",\"%s\",%ld\n",
-		   aconf->name, aconf->passwd,
-		   get_oper_name(source_p), CurrentTime);
+		   aconf->name, aconf->passwd, get_oper_name(source_p), CurrentTime);
 
 	if(fbputs(buffer, out) == -1)
 	{
@@ -343,17 +333,14 @@
 
 static void 
 propagate_xline(struct Client *source_p, const char *target,
-		int temp_time, const char *name, const char *type,
-		const char *reason)
+		int temp_time, const char *name, const char *type, const char *reason)
 {
 	if(!temp_time)
 	{
 		sendto_match_servs(source_p, target, CAP_CLUSTER, NOCAPS,
-					"XLINE %s %s %s :%s",
-					target, name, type, reason);
+				   "XLINE %s %s %s :%s", target, name, type, reason);
 		sendto_match_servs(source_p, target, CAP_ENCAP, CAP_CLUSTER,
-				"ENCAP %s XLINE %d %s 2 :%s",
-				target, temp_time, name, reason);
+				   "ENCAP %s XLINE %d %s 2 :%s", target, temp_time, name, reason);
 	}
 	else
 		sendto_match_servs(source_p, target, CAP_ENCAP, NOCAPS,
@@ -362,8 +349,7 @@
 }
 			
 static void
-cluster_xline(struct Client *source_p, int temp_time, const char *name,
-		const char *reason)
+cluster_xline(struct Client *source_p, int temp_time, const char *name, const char *reason)
 {
 	struct remote_conf *shared_p;
 	dlink_node *ptr;
@@ -381,8 +367,7 @@
 		if(!temp_time)
 		{
 			sendto_match_servs(source_p, shared_p->server, CAP_CLUSTER, NOCAPS,
-					"XLINE %s %s 2 :%s",
-					shared_p->server, name, reason);
+					   "XLINE %s %s 2 :%s", shared_p->server, name, reason);
 			sendto_match_servs(source_p, shared_p->server, CAP_ENCAP, CAP_CLUSTER,
 					"ENCAP %s XLINE %d %s 2 :%s",
 					shared_p->server, temp_time, name, reason);
@@ -403,22 +388,19 @@
 {
 	if(!IsOperXline(source_p))
 	{
-		sendto_one(source_p, form_str(ERR_NOPRIVS),
-			   me.name, source_p->name, "xline");
+		sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "xline");
 		return 0;
 	}
 
 	if(parc == 4 && !(irccmp(parv[2], "ON")))
 	{
-		propagate_generic(source_p, "UNXLINE", parv[3], CAP_CLUSTER,
-				"%s", parv[1]);
+		propagate_generic(source_p, "UNXLINE", parv[3], CAP_CLUSTER, "%s", parv[1]);
 
 		if(match(parv[3], me.name) == 0)
 			return 0;
 	}
 	else if(dlink_list_length(&cluster_conf_list))
-		cluster_generic(source_p, "UNXLINE", SHARED_UNXLINE, CAP_CLUSTER,
-				"%s", parv[1]);
+		cluster_generic(source_p, "UNXLINE", SHARED_UNXLINE, CAP_CLUSTER, "%s", parv[1]);
 
 	if(remove_temp_xline(source_p, parv[1]))
 		return 0;
@@ -438,8 +420,7 @@
 	/* parv[0]  parv[1]        parv[2]
 	 * oper     target server  gecos
 	 */
-	propagate_generic(source_p, "UNXLINE", parv[3], CAP_CLUSTER,
-			"%s", parv[2]);
+	propagate_generic(source_p, "UNXLINE", parv[3], CAP_CLUSTER, "%s", parv[2]);
 
 	if(!match(parv[1], me.name))
 		return 0;
@@ -493,14 +474,11 @@
 
 		if(!irccmp(aconf->name, name))
 		{
-			sendto_one_notice(source_p, 
-					":X-Line for [%s] is removed",
-					name);
+			sendto_one_notice(source_p, ":X-Line for [%s] is removed", name);
 			sendto_realops_flags(UMODE_ALL, L_ALL,
 					 "%s has removed the temporary X-Line for: [%s]",
 					 get_oper_name(source_p), name);
-			ilog(L_KLINE, "UX %s %s", 
-				get_oper_name(source_p), name);
+			ilog(L_KLINE, "UX %s %s", get_oper_name(source_p), name);
 			
 			free_conf(aconf);
 			dlinkDestroy(ptr, &xline_conf_list);
@@ -532,8 +510,7 @@
 	int found_xline = 0;
 
 	filename = ConfigFileEntry.xlinefile;
-	ircsnprintf(temppath, sizeof(temppath),
-		 "%s.tmp", ConfigFileEntry.xlinefile);
+	ircsnprintf(temppath, sizeof(temppath), "%s.tmp", ConfigFileEntry.xlinefile);
 
 	if((in = fbopen(filename, "r")) == NULL)
 	{
@@ -553,7 +530,7 @@
 
 	umask(oldumask);
 
-	while (fbgets(buf, sizeof(buf), in))
+	while(fbgets(buf, sizeof(buf), in))
 	{
 		if(error_on_write)
 		{
@@ -592,8 +569,7 @@
 
 	if(error_on_write)
 	{
-		sendto_one_notice(source_p,
-				  ":Couldn't write temp xline file, aborted");
+		sendto_one_notice(source_p, ":Couldn't write temp xline file, aborted");
 		return;
 	}
 	else if(found_xline == 0)
Index: modules/core/m_die.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/core/m_die.c,v
retrieving revision 1.46
diff -b -u -r1.46 m_die.c
--- modules/core/m_die.c	15 Mar 2004 17:58:06 -0000	1.46
+++ modules/core/m_die.c	19 Aug 2004 22:16:25 -0000
@@ -47,6 +47,7 @@
 };
 
 mapi_clist_av1 die_clist[] = { &die_msgtab, NULL };
+
 DECLARE_MODULE_AV1(die, NULL, NULL, die_clist, NULL, NULL, "$Revision: 1.46 $");
 
 /*
@@ -60,8 +61,7 @@
 
 	if(!IsOperDie(source_p))
 	{
-		sendto_one(source_p, form_str(ERR_NOPRIVS),
-			   me.name, source_p->name, "die");
+		sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "die");
 		return 0;
 	}
 
Index: modules/core/m_error.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/core/m_error.c,v
retrieving revision 1.9
diff -b -u -r1.9 m_error.c
--- modules/core/m_error.c	29 Mar 2004 12:16:58 -0000	1.9
+++ modules/core/m_error.c	19 Aug 2004 22:16:25 -0000
@@ -112,8 +112,7 @@
 	else
 	{
 		sendto_realops_flags(UMODE_ALL, L_ADMIN, "ERROR :from %s via %s -- %s",
-				source_p->name, 
-				get_server_name(client_p, HIDE_IP), para);
+				     source_p->name, get_server_name(client_p, HIDE_IP), para);
 
 		if(!ConfigFileEntry.hide_error_messages)
 			sendto_realops_flags(UMODE_ALL, L_OPER,
Index: modules/core/m_join.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/core/Attic/m_join.c,v
retrieving revision 1.156
diff -b -u -r1.156 m_join.c
--- modules/core/m_join.c	25 Jul 2004 01:29:21 -0000	1.156
+++ modules/core/m_join.c	19 Aug 2004 22:16:25 -0000
@@ -52,6 +52,7 @@
 };
 
 mapi_clist_av1 join_clist[] = { &join_msgtab, NULL };
+
 DECLARE_MODULE_AV1(join, NULL, NULL, join_clist, NULL, NULL, "$Revision: 1.156 $");
 
 static void do_join_0(struct Client *client_p, struct Client *source_p);
@@ -90,15 +91,13 @@
 	 * this code has a side effect of losing keys, but..
 	 */
 	chanlist = LOCAL_COPY(parv[1]);
-	for(i = 0, name = strtoken(&p, chanlist, ","); name;
-	    name = strtoken(&p, NULL, ","))
+	for(i = 0, name = strtoken(&p, chanlist, ","); name; name = strtoken(&p, NULL, ","))
 	{
 		/* check the length and name of channel is ok */
 		if(!check_channel_name_loc(source_p, name) || (strlen(name) > LOC_CHANNELLEN))
 		{
 			sendto_one_numeric(source_p, ERR_BADCHANNAME,
-					   form_str(ERR_BADCHANNAME),
-					   (unsigned char *) name);
+					   form_str(ERR_BADCHANNAME), (unsigned char *) name);
 			continue;
 		}
 
@@ -118,7 +117,8 @@
 		}
 
 		/* see if its resv'd */
-		if((aconf = hash_find_resv(name)) && (!IsOper(source_p) || !ConfigChannel.no_oper_resvs))
+		if((aconf = hash_find_resv(name))
+		   && (!IsOper(source_p) || !ConfigChannel.no_oper_resvs))
 		{
 			sendto_one_numeric(source_p, ERR_BADCHANNAME,
 					form_str(ERR_BADCHANNAME), name);
@@ -140,7 +140,7 @@
 		if(*jbuf)
 			(void) strcat(jbuf, ",");
 		(void) strlcat(jbuf, name, sizeof(jbuf) - i - 1);
-		i += strlen(name)+1;
+		i += strlen(name) + 1;
 	}
 
 	if(parc > 2)
@@ -187,10 +187,10 @@
 		}
 
 		if((dlink_list_length(&source_p->user->channel) >= 
-					(unsigned long)ConfigChannel.max_chans_per_user) &&
+		    (unsigned long) ConfigChannel.max_chans_per_user) &&
 		   (!IsOper(source_p) || 
 		    (dlink_list_length(&source_p->user->channel) >=
-				 (unsigned long)ConfigChannel.max_chans_per_user * 3)))
+		     (unsigned long) ConfigChannel.max_chans_per_user * 3)))
 		{
 			sendto_one(source_p, form_str(ERR_TOOMANYCHANNELS),
 				   me.name, source_p->name, name);
@@ -222,8 +222,7 @@
 		/* can_join checks for +i key, bans etc */
 		if((i = can_join(source_p, chptr, key)))
 		{
-			sendto_one(source_p, form_str(i),
-				   me.name, source_p->name, name);
+			sendto_one(source_p, form_str(i), me.name, source_p->name, name);
 			if(successful_join_count > 0)
 				successful_join_count--;
 			continue;
@@ -268,15 +267,13 @@
 			sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
 				      ":%s JOIN %ld %s %s %s",
 				      use_id(source_p), (long) chptr->channelts,
-				      chptr->chname, modebuf,
-				      parabuf[0] == '\0' ? "" : parabuf);
+				      chptr->chname, modebuf, parabuf[0] == '\0' ? "" : parabuf);
 
 			sendto_server(client_p, chptr, NOCAPS, CAP_TS6,
 				      ":%s SJOIN %ld %s %s %s:%s",
 				      me.name, (long) chptr->channelts,
 				      chptr->chname, modebuf,
-				      parabuf[0] == '\0' ? "" : parabuf, 
-				      source_p->name);
+				      parabuf[0] == '\0' ? "" : parabuf, source_p->name);
 		}
 
 		del_invite(chptr, source_p);
@@ -346,7 +343,7 @@
 	mode.mode = mode.limit = 0;
 
 	s = parv[3];
-	while (*s)
+	while(*s)
 	{
 		switch (*(s++))
 		{
@@ -447,13 +444,13 @@
 		remove_our_modes(chptr, source_p);
 		sendto_channel_local(ALL_MEMBERS, chptr,
 				     ":%s NOTICE %s :*** Notice -- TS for %s changed from %ld to %ld",
-				     me.name, chptr->chname, chptr->chname, (long) oldts, (long) newts);
+				     me.name, chptr->chname, chptr->chname, (long) oldts,
+				     (long) newts);
 	}
 
 	if(*modebuf != '\0')
 		sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s %s %s",
-				     source_p->user->server,
-				     chptr->chname, modebuf, parabuf);
+				     source_p->user->server, chptr->chname, modebuf, parabuf);
 
 	*modebuf = *parabuf = '\0';
 	channel_modes(chptr, client_p, modebuf, parabuf);
@@ -468,8 +465,7 @@
 
 	sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
 		      ":%s JOIN %ld %s %s %s",
-		      source_p->id, (long) chptr->channelts, chptr->chname,
-		      modebuf, parabuf);
+		      source_p->id, (long) chptr->channelts, chptr->chname, modebuf, parabuf);
 	sendto_server(client_p, chptr, NOCAPS, CAP_TS6,
 		      ":%s SJOIN %ld %s %s %s:%s",
 		      source_p->user->server, (long) chptr->channelts,
@@ -505,7 +501,7 @@
 	   !IsOper(source_p) && !IsExemptSpambot(source_p))
 		check_spambot_warning(source_p, NULL);
 
-	while ((ptr = source_p->user->channel.head))
+	while((ptr = source_p->user->channel.head))
 	{
 		msptr = ptr->data;
 		chptr = msptr->chptr;
@@ -525,7 +521,7 @@
 
 	if(ConfigFileEntry.disable_fake_channels && !IsOper(source_p))
 	{
-		for (; *name; ++name)
+		for(; *name; ++name)
 		{
 			if(!IsChanChar(*name) || IsFakeChanChar(*name))
 				return 0;
@@ -568,7 +564,7 @@
 	int i;
 
 	/* ok, first get a list of modes we need to add */
-	for (i = 0; flags[i].letter; i++)
+	for(i = 0; flags[i].letter; i++)
 	{
 		if((mode->mode & flags[i].mode) && !(oldmode->mode & flags[i].mode))
 		{
@@ -582,7 +578,7 @@
 	}
 
 	/* now the ones we need to remove. */
-	for (i = 0; flags[i].letter; i++)
+	for(i = 0; flags[i].letter; i++)
 	{
 		if((oldmode->mode & flags[i].mode) && !(mode->mode & flags[i].mode))
 		{
@@ -699,6 +695,12 @@
 				*mbuf++ = 'v';
 			}
 		}
+		else if(is_halfop(msptr))
+		{
+			msptr->flags &= ~CHFL_HALFOP;
+			lpara[count++] = msptr->client_p->name;
+			*mbuf++ = 'h';
+		}
 		else if(is_voiced(msptr))
 		{
 			msptr->flags &= ~CHFL_VOICE;
Index: modules/core/m_kick.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/core/Attic/m_kick.c,v
retrieving revision 1.79
diff -b -u -r1.79 m_kick.c
--- modules/core/m_kick.c	14 Apr 2004 16:35:11 -0000	1.79
+++ modules/core/m_kick.c	19 Aug 2004 22:16:25 -0000
@@ -48,6 +48,7 @@
 };
 
 mapi_clist_av1 kick_clist[] = { &kick_msgtab, NULL };
+
 DECLARE_MODULE_AV1(kick, NULL, NULL, kick_clist, NULL, NULL, "$Revision: 1.79 $");
 
 /*
@@ -60,7 +61,7 @@
 static int
 m_kick(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
-	struct membership *msptr;
+	struct membership *msptr = NULL;
 	struct Client *who;
 	struct Channel *chptr;
 	int chasing = 0;
@@ -86,8 +87,7 @@
 	chptr = find_channel(name);
 	if(chptr == NULL)
 	{
-		sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
-				   form_str(ERR_NOSUCHCHANNEL), name);
+		sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL, form_str(ERR_NOSUCHCHANNEL), name);
 		return 0;
 	}
 
@@ -102,7 +102,7 @@
 			return 0;
 		}
 
-		if(!is_chanop(msptr))
+		if(!is_chanop(msptr) && !is_halfop(msptr))
 		{
 			if(MyConnect(source_p))
 			{
@@ -115,8 +115,7 @@
 			if(chptr->channelts == 0)
 			{
 				sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED),
-					   get_id(&me, source_p), 
-					   get_id(source_p, source_p), name);
+					   get_id(&me, source_p), get_id(source_p, source_p), name);
 				return 0;
 			}
 		}
@@ -153,6 +152,13 @@
 		return 0;
 	}
 
+	if(!is_halfop(msptr))
+	{
+		/* dougk_ff7
+		 * - This is getting shoved in at this point because msptr
+		 *   is getting recycled, and instead of allocate a new
+		 *   pointer, why not just do this?
+		 */
 	msptr = find_channel_membership(chptr, who);
 
 	if(msptr != NULL)
@@ -175,8 +181,7 @@
 
 		sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
 			      ":%s KICK %s %s :%s", 
-			      use_id(source_p), chptr->chname, 
-			      use_id(who), comment);
+				      use_id(source_p), chptr->chname, use_id(who), comment);
 		sendto_server(client_p, chptr, NOCAPS, CAP_TS6,
 			      ":%s KICK %s %s :%s", 
 			      source_p->name, chptr->chname, who->name, comment);
@@ -185,7 +190,50 @@
 	else
 		sendto_one_numeric(source_p, ERR_USERNOTINCHANNEL,
 				   form_str(ERR_USERNOTINCHANNEL), user, name);
+	}
+	else
+	{
+		msptr = find_channel_membership(chptr, who);
 
+		if(msptr != NULL)
+		{
+			/* jdc
+			 * - In the case of a server kicking a user (i.e. CLEARCHAN),
+			 *   the kick should show up as coming from the server which did
+			 *   the kick.
+			 * - Personally, flame and I believe that server kicks shouldn't
+			 *   be sent anyways.  Just waiting for some oper to abuse it...
+			 */
+			if(is_chanop(msptr) && MyConnect(source_p))
+			{
+				/* dougk_ff7
+				 * - A bit of logic to prevent kicks of opped users.
+				 */
+				sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED),
+					   me.name, source_p->name, name);
 	return 0;
-}
+			}
+			if(IsServer(source_p))
+				sendto_channel_local(ALL_MEMBERS, chptr, ":%s KICK %s %s :%s",
+						     source_p->name, name, who->name, comment);
+			else
+				sendto_channel_local(ALL_MEMBERS, chptr,
+						     ":%s!%s@%s KICK %s %s :%s",
+						     source_p->name, source_p->username,
+						     source_p->host, name, who->name, comment);
+
+			sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
+				      ":%s KICK %s %s :%s",
+				      use_id(source_p), chptr->chname, use_id(who), comment);
+			sendto_server(client_p, chptr, NOCAPS, CAP_TS6,
+				      ":%s KICK %s %s :%s",
+				      source_p->name, chptr->chname, who->name, comment);
+			remove_user_from_channel(msptr);
+		}
+		else
+			sendto_one_numeric(source_p, ERR_USERNOTINCHANNEL,
+					   form_str(ERR_USERNOTINCHANNEL), user, name);
+	}
 
+	return 0;
+}
Index: modules/core/m_kill.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/core/m_kill.c,v
retrieving revision 1.102
diff -b -u -r1.102 m_kill.c
--- modules/core/m_kill.c	25 May 2004 10:49:52 -0000	1.102
+++ modules/core/m_kill.c	19 Aug 2004 22:16:26 -0000
@@ -54,6 +54,7 @@
 };
 
 mapi_clist_av1 kill_clist[] = { &kill_msgtab, NULL };
+
 DECLARE_MODULE_AV1(kill, NULL, NULL, kill_clist, NULL, NULL, "$Revision: 1.102 $");
 
 /*
@@ -74,8 +75,7 @@
 
 	if(!IsOperLocalKill(source_p))
 	{
-		sendto_one(source_p, form_str(ERR_NOPRIVS),
-			   me.name, source_p->name, "local_kill");
+		sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "local_kill");
 		return 0;
 	}
 
@@ -132,8 +132,7 @@
 
 	ilog(L_KILL, "%c %s %s!%s@%s %s %s",
 		MyConnect(target_p) ? 'L' : 'G', get_oper_name(source_p),
-		target_p->name, target_p->username, target_p->host,
-		target_p->user->server, reason);
+	     target_p->name, target_p->username, target_p->host, target_p->user->server, reason);
 
 	/*
 	 ** And pass on the message to other servers. Note, that if KILL
@@ -213,12 +212,10 @@
 		if(IsDigit(*user) || (!(target_p = get_history(user, (long) KILLCHASETIMELIMIT))))
 		{
 			sendto_one_numeric(source_p, ERR_NOSUCHNICK, 
-					   form_str(ERR_NOSUCHNICK), 
-					   IsDigit(*user) ? "*" : user);
+					   form_str(ERR_NOSUCHNICK), IsDigit(*user) ? "*" : user);
 			return 0;
 		}
-		sendto_one_notice(source_p, ":KILL changed from %s to %s",
-				  user, target_p->name);
+		sendto_one_notice(source_p, ":KILL changed from %s to %s", user, target_p->name);
 		chasing = 1;
 	}
 
@@ -292,11 +289,9 @@
 	if(MyClient(source_p))
 		ircsnprintf(buffer, sizeof(buffer),
 			    "%s!%s!%s!%s (%s)",
-			    me.name, source_p->host, source_p->username,
-			    source_p->name, reason);
+			    me.name, source_p->host, source_p->username, source_p->name, reason);
 	else
-		ircsnprintf(buffer, sizeof(buffer),
-			    "%s %s", inpath, reason);
+		ircsnprintf(buffer, sizeof(buffer), "%s %s", inpath, reason);
 
 	DLINK_FOREACH(ptr, serv_list.head)
 	{
@@ -306,7 +301,6 @@
 			continue;
 
 		sendto_one(client_p, ":%s KILL %s :%s",
-			   get_id(source_p, client_p),
-			   get_id(target_p, client_p), buffer);
+			   get_id(source_p, client_p), get_id(target_p, client_p), buffer);
 	}
 }
Index: modules/core/m_message.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/core/m_message.c,v
retrieving revision 1.147.2.1
diff -b -u -r1.147.2.1 m_message.c
--- modules/core/m_message.c	3 Aug 2004 02:01:50 -0000	1.147.2.1
+++ modules/core/m_message.c	19 Aug 2004 22:16:26 -0000
@@ -56,6 +56,7 @@
 };
 
 mapi_clist_av1 message_clist[] = { &privmsg_msgtab, &notice_msgtab, NULL };
+
 DECLARE_MODULE_AV1(message, NULL, NULL, message_clist, NULL, NULL, "$Revision: 1.147.2.1 $");
 
 struct entity
@@ -97,7 +98,8 @@
 		       struct Client *source_p, struct Client *target_p, const char *text);
 
 static void handle_special(int p_or_n, const char *command,
-			 struct Client *client_p, struct Client *source_p, const char *nick, const char *text);
+			   struct Client *client_p, struct Client *source_p, const char *nick,
+			   const char *text);
 
 /*
 ** m_privmsg
@@ -165,8 +167,7 @@
 	/* Finish the flood grace period if theyre not messaging themselves
 	 * as some clients (ircN) do this as a "lag check"
 	 */
-	if(MyClient(source_p) && !IsFloodDone(source_p) &&
-	   irccmp(source_p->name, parv[1]))
+	if(MyClient(source_p) && !IsFloodDone(source_p) && irccmp(source_p->name, parv[1]))
 		flood_endgrace(source_p);
 
 	if(build_target_list(p_or_n, command, client_p, source_p, parv[1], parv[2]) < 0)
@@ -174,7 +175,7 @@
 		return 0;
 	}
 
-	for (i = 0; i < ntargets; i++)
+	for(i = 0; i < ntargets; i++)
 	{
 		switch (targets[i].type)
 		{
@@ -230,7 +231,7 @@
 
 	ntargets = 0;
 
-	for (nick = strtoken(&p, target_list, ","); nick; nick = strtoken(&p, NULL, ","))
+	for(nick = strtoken(&p, target_list, ","); nick; nick = strtoken(&p, NULL, ","))
 	{
 		char *with_prefix;
 		/*
@@ -290,10 +291,12 @@
 		type = 0;
 		with_prefix = nick;
 		/*  allow %+@ if someone wants to do that */
-		for (;;)
+		for(;;)
 		{
 			if(*nick == '@')
 				type |= CHFL_CHANOP;
+			else if(*nick == '%')
+				type |= CHFL_CHANOP | CHFL_HALFOP;
 			else if(*nick == '+')
 				type |= CHFL_CHANOP | CHFL_VOICE;
 			else
@@ -386,7 +389,7 @@
 duplicate_ptr(void *ptr)
 {
 	int i;
-	for (i = 0; i < ntargets; i++)
+	for(i = 0; i < ntargets; i++)
 		if(targets[i].ptr == ptr)
 			return YES;
 	return NO;
@@ -405,7 +408,8 @@
  */
 static void
 msg_channel(int p_or_n, const char *command,
-	    struct Client *client_p, struct Client *source_p, struct Channel *chptr, const char *text)
+	    struct Client *client_p, struct Client *source_p, struct Channel *chptr,
+	    const char *text)
 {
 	int result;
 
@@ -423,8 +427,7 @@
 		   !flood_attack_channel(p_or_n, source_p, chptr, chptr->chname))
 		{
 			sendto_channel_flags(client_p, ALL_MEMBERS, source_p, chptr, 
-					      "%s %s :%s",
-					      command, chptr->chname, text);
+					     "%s %s :%s", command, chptr->chname, text);
 		}
 	}
 	else
@@ -461,6 +464,11 @@
 		type = ONLY_CHANOPSVOICED;
 		c = '+';
 	}
+	else if(flags & CHFL_HALFOP)
+	{
+		type = ONLY_CHANOPSHALFOPS;
+		c = '%';
+	}
 	else
 	{
 		type = ONLY_CHANOPS;
@@ -505,8 +513,7 @@
 	{
 		sendto_realops_flags(UMODE_DEBUG, L_ALL,
 				"Send message to %s[%s] dropped from %s(Fake Dir)",
-				target_p->name, target_p->from->name,
-				source_p->name);
+				     target_p->name, target_p->from->name, source_p->name);
 		return;
 	}
 
@@ -564,8 +571,7 @@
 			 * and flooding    -- fl */
 			if(!MyClient(source_p) || IsOper(source_p) ||
 			   !flood_attack_client(p_or_n, source_p, target_p))
-				sendto_anywhere(target_p, source_p, command,
-						":%s", text);
+				sendto_anywhere(target_p, source_p, command, ":%s", text);
 		}
 	}
 	else if(!MyClient(source_p) || IsOper(source_p) ||
@@ -742,8 +748,7 @@
 		if(!IsMe(target_p))
 		{
 			sendto_one(target_p, ":%s %s %s :%s", 
-				   get_id(source_p, target_p), 
-				   command, nick, text);
+				   get_id(source_p, target_p), command, nick, text);
 			return;
 		}
 
@@ -775,12 +780,10 @@
 				*--host = '%';
 
 			if(count == 1)
-				sendto_anywhere(target_p, source_p, command, 
-						":%s", text);
+				sendto_anywhere(target_p, source_p, command, ":%s", text);
 			else
 				sendto_one(source_p, form_str(ERR_TOOMANYTARGETS),
-					   get_id(&me, source_p),
-					   get_id(source_p, source_p), nick);
+					   get_id(&me, source_p), get_id(source_p, source_p), nick);
 		}
 	}
 
@@ -808,7 +811,7 @@
 					   form_str(ERR_NOTOPLEVEL), nick);
 			return;
 		}
-		while (*++s)
+		while(*++s)
 			if(*s == '.' || *s == '*' || *s == '?')
 				break;
 		if(*s == '*' || *s == '?')
@@ -851,8 +854,7 @@
 			c2ptr = ptr->data;
 			if(!MyClient(c2ptr))	/* implies mine and an user */
 				continue;
-			if((!host || match(host, c2ptr->host)) &&
-			   irccmp(u, c2ptr->username) == 0)
+			if((!host || match(host, c2ptr->host)) && irccmp(u, c2ptr->username) == 0)
 			{
 				(*count)++;
 				res = c2ptr;
Index: modules/core/m_mode.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/core/m_mode.c,v
retrieving revision 1.112.2.1
diff -b -u -r1.112.2.1 m_mode.c
--- modules/core/m_mode.c	2 Aug 2004 21:15:41 -0000	1.112.2.1
+++ modules/core/m_mode.c	19 Aug 2004 22:16:27 -0000
@@ -64,6 +64,7 @@
 };
 
 mapi_clist_av1 mode_clist[] = { &mode_msgtab, &tmode_msgtab, &bmask_msgtab, NULL };
+
 DECLARE_MODULE_AV1(mode, NULL, NULL, mode_clist, NULL, NULL, "$Revision: 1.112.2.1 $");
 
 /* bitmasks for error returns, so we send once per call */
@@ -78,11 +79,10 @@
 #define SM_ERR_RPL_D            0x00000200
 
 static void set_channel_mode(struct Client *, struct Client *,
-			     struct Channel *, struct membership *,
-			     int, const char **);
+			     struct Channel *, struct membership *, int, const char **);
 
 static int add_id(struct Client *source_p, struct Channel *chptr, 
-		  const char *banid, dlink_list *list, long mode_type);
+		  const char *banid, dlink_list * list, long mode_type);
 
 static struct ChModeChange mode_changes[BUFSIZE];
 static int mode_count;
@@ -166,8 +166,7 @@
 
 	if(!check_channel_name(dest))
 	{
-		sendto_one_numeric(source_p, ERR_BADCHANNAME,
-				   form_str(ERR_BADCHANNAME), parv[1]);
+		sendto_one_numeric(source_p, ERR_BADCHANNAME, form_str(ERR_BADCHANNAME), parv[1]);
 		return 0;
 	}
 
@@ -211,8 +210,7 @@
 				flood_endgrace(source_p);
 		}
 
-		set_channel_mode(client_p, source_p, chptr, msptr, 
-			         parc - n, parv + n);
+		set_channel_mode(client_p, source_p, chptr, msptr, parc - n, parv + n);
 	}
 
 	return 0;
@@ -232,8 +230,7 @@
 		return 0;
 	}
 
-	set_channel_mode(client_p, source_p, chptr, NULL,
-			 parc - 2, parv + 2);
+	set_channel_mode(client_p, source_p, chptr, NULL, parc - 2, parv + 2);
 
 	return 0;
 }
@@ -247,9 +244,7 @@
 	/* Now, try to find the channel in question */
 	if(!IsChanPrefix(parv[2][0]) || !check_channel_name(parv[2]))
 	{
-		sendto_one_numeric(source_p, ERR_BADCHANNAME,
-				   form_str(ERR_BADCHANNAME), 
-				   parv[2]);
+		sendto_one_numeric(source_p, ERR_BADCHANNAME, form_str(ERR_BADCHANNAME), parv[2]);
 		return 0;
 	}
 
@@ -268,8 +263,7 @@
 
 	if(IsServer(source_p))
 	{
-		set_channel_mode(client_p, source_p, chptr, NULL,
-				 parc - 3, parv + 3);
+		set_channel_mode(client_p, source_p, chptr, NULL, parc - 3, parv + 3);
 	}
 	else
 	{
@@ -279,8 +273,7 @@
 		if(is_deop(msptr))
 			return 0;
 
-		set_channel_mode(client_p, source_p, chptr, msptr, 
-			         parc - 3, parv + 3);
+		set_channel_mode(client_p, source_p, chptr, msptr, parc - 3, parv + 3);
 	}
 
 	return 0;
@@ -314,7 +307,7 @@
 	if(atol(parv[1]) > chptr->channelts)
 		return 0;
 
-	switch(parv[3][0])
+	switch (parv[3][0])
 	{
 		case 'b':
 			banlist = &chptr->banlist;
@@ -341,8 +334,7 @@
 	parabuf[0] = '\0';
 	s = LOCAL_COPY(parv[4]);
 
-	mlen = ircsprintf(modebuf, ":%s MODE %s +",
-			  source_p->name, chptr->chname);
+	mlen = ircsprintf(modebuf, ":%s MODE %s +", source_p->name, chptr->chname);
 	mbuf = modebuf + mlen;
 	pbuf = parabuf;
 
@@ -365,8 +357,7 @@
 			{
 				*mbuf = '\0';
 				*(pbuf - 1) = '\0';
-				sendto_channel_local(ALL_MEMBERS, chptr, "%s %s",
-						     modebuf, parabuf);
+				sendto_channel_local(ALL_MEMBERS, chptr, "%s %s", modebuf, parabuf);
 				sendto_server(client_p, chptr, needcap, CAP_TS6,
 					      "%s %s", modebuf, parabuf);
 
@@ -398,13 +389,11 @@
 	{
 		*mbuf = '\0';
 		*(pbuf - 1) = '\0';
-		sendto_channel_local(ALL_MEMBERS, chptr, "%s %s",
-				     modebuf, parabuf);
-		sendto_server(client_p, chptr, needcap, CAP_TS6,
-			      "%s %s", modebuf, parabuf);
+		sendto_channel_local(ALL_MEMBERS, chptr, "%s %s", modebuf, parabuf);
+		sendto_server(client_p, chptr, needcap, CAP_TS6, "%s %s", modebuf, parabuf);
 	}
 
-	sendto_server(client_p, chptr, CAP_TS6|needcap, NOCAPS, ":%s BMASK %ld %s %s :%s",
+	sendto_server(client_p, chptr, CAP_TS6 | needcap, NOCAPS, ":%s BMASK %ld %s %s :%s",
 		      source_p->id, (long) chptr->channelts, chptr->chname, parv[3], parv[4]);
 	return 0;
 }
@@ -417,7 +406,7 @@
  */
 static int
 add_id(struct Client *source_p, struct Channel *chptr, const char *banid,
-       dlink_list *list, long mode_type)
+       dlink_list * list, long mode_type)
 {
 	struct Ban *actualBan;
 	static char who[BANLEN];
@@ -458,8 +447,7 @@
 
 
 	if(IsPerson(source_p))
-		ircsprintf(who, "%s!%s@%s",
-			   source_p->name, source_p->username, source_p->host);
+		ircsprintf(who, "%s!%s@%s", source_p->name, source_p->username, source_p->host);
 	else
 		strlcpy(who, source_p->name, sizeof(who));
 
@@ -483,8 +471,7 @@
  * side effects - given id is removed from the appropriate list
  */
 static int
-del_id(struct Channel *chptr, const char *banid, dlink_list *list,
-       long mode_type)
+del_id(struct Channel *chptr, const char *banid, dlink_list * list, long mode_type)
 {
 	dlink_node *ptr;
 	struct Ban *banptr;
@@ -532,7 +519,7 @@
 	if(!(s && *s))
 		return splat;
 
-	for (; *s; ++s)
+	for(; *s; ++s)
 	{
 		if(IsSpace(*s))
 		{
@@ -571,7 +558,7 @@
 
 	nick = user = host = splat;
 
-	if((size_t)BUFSIZE - mask_pos < strlen(mask) + 5)
+	if((size_t) BUFSIZE - mask_pos < strlen(mask) + 5)
 		return NULL;
 
 	old_mask_pos = mask_pos;
@@ -665,7 +652,7 @@
 {
 	u_char *s, *t, c;
 
-	for (s = t = (u_char *) arg; (c = *s); s++)
+	for(s = t = (u_char *) arg; (c = *s); s++)
 	{
 		c &= 0x7f;
 		if(c != ':' && c > ' ')
@@ -688,7 +675,7 @@
 {
 	u_char *s, *t, c;
 
-	for (s = t = (u_char *) arg; (c = *s); s++)
+	for(s = t = (u_char *) arg; (c = *s); s++)
 	{
 		c &= 0x7f;
 		if((c != 0x0a) && (c != ':') && (c != 0x0d))
@@ -719,8 +706,18 @@
 	   int alevel, int parc, int *parn,
 	   const char **parv, int *errors, int dir, char c, long mode_type)
 {
-	if(alevel != CHFL_CHANOP)
+	if(alevel != CHFL_CHANOP && alevel != CHFL_HALFOP)
+	{
+		if(!(*errors & SM_ERR_NOOPS))
+			sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED),
+				   me.name, source_p->name, chptr->chname);
+		*errors |= SM_ERR_NOOPS;
+		return;
+	}
+
+	if((mode_type & MODE_PRIVATE) && alevel == CHFL_HALFOP)
 	{
+		/* stop the mode change if it's +p and this client is only halfopped */
 		if(!(*errors & SM_ERR_NOOPS))
 			sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED),
 				   me.name, source_p->name, chptr->chname);
@@ -775,7 +772,7 @@
 	int caps;
 	int mems;
 
-	switch(mode_type)
+	switch (mode_type)
 	{
 		case CHFL_BAN:
 			list = &chptr->banlist;
@@ -799,7 +796,7 @@
 			caps = CAP_EX;
 			
 			if(ConfigChannel.use_except || (dir == MODE_DEL))
-				mems = ONLY_CHANOPS;
+			mems = ONLY_CHANOPSHALFOPS;
 			else
 				mems = ONLY_SERVERS;
 			break;
@@ -817,14 +814,13 @@
 			caps = CAP_IE;
 
 			if(ConfigChannel.use_invex || (dir == MODE_DEL))
-				mems = ONLY_CHANOPS;
+			mems = ONLY_CHANOPSHALFOPS;
 			else
 				mems = ONLY_SERVERS;
 			break;
 
 		default:
-			sendto_realops_flags(UMODE_ALL, L_ALL,
-					     "chm_ban() called with unknown type!");
+		sendto_realops_flags(UMODE_ALL, L_ALL, "chm_ban() called with unknown type!");
 			return;
 			break;
 	}
@@ -836,7 +832,7 @@
 		*errors |= errorval;
 
 		/* non-ops cant see +eI lists.. */
-		if(alevel != CHFL_CHANOP && mode_type != CHFL_BAN)
+		if((alevel != CHFL_CHANOP && alevel != CHFL_HALFOP) && mode_type != CHFL_BAN)
 		{
 			if(!(*errors & SM_ERR_NOOPS))
 				sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED),
@@ -852,12 +848,11 @@
 				   me.name, source_p->name, chptr->chname,
 				   banptr->banstr, banptr->who, banptr->when);
 		}
-		sendto_one(source_p, form_str(rpl_endlist),
-			   me.name, source_p->name, chptr->chname);
+		sendto_one(source_p, form_str(rpl_endlist), me.name, source_p->name, chptr->chname);
 		return;
 	}
 
-	if(alevel != CHFL_CHANOP)
+	if(alevel != CHFL_CHANOP && alevel != CHFL_HALFOP)
 	{
 		if(!(*errors & SM_ERR_NOOPS))
 			sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED),
@@ -948,8 +943,7 @@
 	/* empty nick */
 	if(EmptyString(opnick))
 	{
-		sendto_one_numeric(source_p, ERR_NOSUCHNICK,
-				   form_str(ERR_NOSUCHNICK), "*");
+		sendto_one_numeric(source_p, ERR_NOSUCHNICK, form_str(ERR_NOSUCHNICK), "*");
 		return;
 	}
 
@@ -986,6 +980,19 @@
 		mode_changes[mode_count].arg = targ_p->name;
 		mode_changes[mode_count++].client = targ_p;
 
+		if(mstptr->flags & CHFL_HALFOP)
+		{
+			mstptr->flags &= ~CHFL_HALFOP;	/* don't keep this around. */
+			mode_changes[mode_count].letter = 'h';
+			mode_changes[mode_count].dir = MODE_DEL;
+			mode_changes[mode_count].caps = CAP_HOPS;
+			mode_changes[mode_count].nocaps = 0;
+			mode_changes[mode_count].mems = ALL_MEMBERS;
+			mode_changes[mode_count].id = targ_p->id;
+			mode_changes[mode_count].arg = targ_p->name;
+			mode_changes[mode_count++].client = targ_p;
+		}
+
 		mstptr->flags |= CHFL_CHANOP;
 		mstptr->flags &= ~CHFL_DEOPPED;
 	}
@@ -1005,6 +1012,93 @@
 }
 
 static void
+chm_halfop(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)
+{
+	struct membership *mstptr;
+	const char *opnick;
+	struct Client *targ_p;
+
+	if((alevel != CHFL_CHANOP && chptr->mode.mode & MODE_PRIVATE) ||
+	   ((alevel != CHFL_CHANOP && alevel != CHFL_HALFOP) && !(chptr->mode.mode & MODE_PRIVATE)))
+	{
+		if(!(*errors & SM_ERR_NOOPS))
+			sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED),
+				   me.name, source_p->name, chptr->chname);
+		*errors |= SM_ERR_NOOPS;
+		return;
+	}
+
+	if((dir == MODE_QUERY) || (parc <= *parn))
+		return;
+
+	opnick = parv[(*parn)];
+	(*parn)++;
+
+	/* empty nick */
+	if(EmptyString(opnick))
+	{
+		sendto_one_numeric(source_p, ERR_NOSUCHNICK, form_str(ERR_NOSUCHNICK), "*");
+		return;
+	}
+
+	if((targ_p = find_chasing(source_p, opnick, NULL)) == NULL)
+	{
+		return;
+	}
+
+	mstptr = find_channel_membership(chptr, targ_p);
+
+	if(mstptr == NULL)
+	{
+		if(!(*errors & SM_ERR_NOTONCHANNEL))
+			sendto_one_numeric(source_p, ERR_USERNOTINCHANNEL,
+					   form_str(ERR_USERNOTINCHANNEL), opnick, chptr->chname);
+		*errors |= SM_ERR_NOTONCHANNEL;
+		return;
+	}
+
+	if(MyClient(source_p) && (++mode_limit > MAXMODEPARAMS))
+		return;
+
+	if(dir == MODE_ADD)
+	{
+		if(targ_p == source_p)
+			return;
+
+		/* always assume +o overrides +h */
+		if(mstptr->flags & CHFL_CHANOP)
+			return;
+
+		mode_changes[mode_count].letter = c;
+		mode_changes[mode_count].dir = MODE_ADD;
+		mode_changes[mode_count].caps = CAP_HOPS;
+		mode_changes[mode_count].nocaps = 0;
+		mode_changes[mode_count].mems = ALL_MEMBERS;
+		mode_changes[mode_count].id = targ_p->id;
+		mode_changes[mode_count].arg = targ_p->name;
+		mode_changes[mode_count++].client = targ_p;
+
+		mstptr->flags |= CHFL_HALFOP;
+		mstptr->flags &= ~CHFL_DEOPPED;
+	}
+	else
+	{
+		mode_changes[mode_count].letter = c;
+		mode_changes[mode_count].dir = MODE_DEL;
+		mode_changes[mode_count].caps = CAP_HOPS;
+		mode_changes[mode_count].nocaps = 0;
+		mode_changes[mode_count].mems = ALL_MEMBERS;
+		mode_changes[mode_count].id = targ_p->id;
+		mode_changes[mode_count].arg = targ_p->name;
+		mode_changes[mode_count++].client = targ_p;
+
+		mstptr->flags &= ~CHFL_HALFOP;
+	}
+}
+
+static 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)
@@ -1013,7 +1107,7 @@
 	const char *opnick;
 	struct Client *targ_p;
 
-	if(alevel != CHFL_CHANOP)
+	if(alevel != CHFL_CHANOP && alevel != CHFL_HALFOP)
 	{
 		if(!(*errors & SM_ERR_NOOPS))
 			sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED),
@@ -1031,8 +1125,7 @@
 	/* empty nick */
 	if(EmptyString(opnick))
 	{
-		sendto_one_numeric(source_p, ERR_NOSUCHNICK, 
-				   form_str(ERR_NOSUCHNICK), "*");
+		sendto_one_numeric(source_p, ERR_NOSUCHNICK, form_str(ERR_NOSUCHNICK), "*");
 		return;
 	}
 
@@ -1092,7 +1185,7 @@
 	static char limitstr[30];
 	int limit;
 
-	if(alevel != CHFL_CHANOP)
+	if(alevel != CHFL_CHANOP && alevel != CHFL_HALFOP)
 	{
 		if(!(*errors & SM_ERR_NOOPS))
 			sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED),
@@ -1148,7 +1241,7 @@
 {
 	char *key;
 
-	if(alevel != CHFL_CHANOP)
+	if(alevel != CHFL_CHANOP && alevel != CHFL_HALFOP)
 	{
 		if(!(*errors & SM_ERR_NOOPS))
 			sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED),
@@ -1186,7 +1279,7 @@
 	}
 	else if(dir == MODE_DEL)
 	{
-		if (parc > *parn)
+		if(parc > *parn)
 			(*parn)++;
 
 		if(!(*chptr->mode.key))
@@ -1206,10 +1299,9 @@
 
 struct ChannelMode
 {
-	void (*func) (struct Client *source_p, struct Channel *chptr,
+	void (*func) (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);
+		      const char **parv, int *errors, int dir, char c, long mode_type);
 	long mode_type;
 };
 
@@ -1256,7 +1348,7 @@
   {chm_ban,	CHFL_EXCEPTION },	/* e */
   {chm_nosuch,	0 },			/* f */
   {chm_nosuch,	0 },			/* g */
-  {chm_nosuch,	0 },			/* h */
+  {chm_halfop,	0 },     		/* h */
   {chm_simple,	MODE_INVITEONLY },	/* i */
   {chm_nosuch,	0 },			/* j */
   {chm_key,	0 },			/* k */
@@ -1283,6 +1375,8 @@
 {
 	if(!MyClient(source_p) || is_chanop(msptr))
 		return CHFL_CHANOP;
+	if(is_halfop(msptr))
+		return CHFL_HALFOP;
 
 	return CHFL_PEON;
 }
@@ -1295,8 +1389,7 @@
  */
 void
 set_channel_mode(struct Client *client_p, struct Client *source_p,
-		 struct Channel *chptr, struct membership *msptr,
-		 int parc, const char *parv[])
+		 struct Channel *chptr, struct membership *msptr, int parc, const char *parv[])
 {
 	static char modebuf[BUFSIZE];
 	static char parabuf[MODEBUFLEN];
@@ -1318,7 +1411,7 @@
 
 	alevel = get_channel_access(source_p, msptr);
 
-	for (; (c = *ml) != 0; ml++)
+	for(; (c = *ml) != 0; ml++)
 	{
 		switch (c)
 		{
@@ -1349,14 +1442,13 @@
 		return;
 
 	if(IsServer(source_p))
-		mlen = ircsprintf(modebuf, ":%s MODE %s ", 
-				  source_p->name, chptr->chname);
+		mlen = ircsprintf(modebuf, ":%s MODE %s ", source_p->name, chptr->chname);
 	else
 		mlen = ircsprintf(modebuf, ":%s!%s@%s MODE %s ",
 				  source_p->name, source_p->username, 
 				  source_p->host, chptr->chname);
 
-	for(j = 0, flags = ALL_MEMBERS; j < 2; j++, flags = ONLY_CHANOPS)
+	for(j = 0, flags = ALL_MEMBERS; j < 2; j++, flags = ONLY_CHANOPSHALFOPS)
 	{
 		cur_len = mlen;
 		mbuf = modebuf + mlen;
@@ -1365,17 +1457,16 @@
 		paracount = paralen = 0;
 		dir = MODE_QUERY;
 
-		for (i = 0; i < mode_count; i++)
+		for(i = 0; i < mode_count; i++)
 		{
-			if(mode_changes[i].letter == 0 ||
-			   mode_changes[i].mems != flags)
+			if(mode_changes[i].letter == 0 || mode_changes[i].mems != flags)
 				continue;
 
 			if(mode_changes[i].arg != NULL)
 			{
 				arglen = strlen(mode_changes[i].arg);
 
-				if(arglen > MODEBUFLEN-5)
+				if(arglen > MODEBUFLEN - 5)
 					continue;
 			}
 			else
@@ -1389,7 +1480,8 @@
 				*mbuf = '\0';
 
 				if(cur_len > mlen)
-					sendto_channel_local(flags, chptr, "%s %s", modebuf, parabuf);
+					sendto_channel_local(flags, chptr, "%s %s", modebuf,
+							     parabuf);
 				else
 					continue;
 
@@ -1432,4 +1524,3 @@
 	if(MyClient(source_p) || dlink_list_length(&serv_list) > 1)
 		send_cap_mode_changes(client_p, source_p, chptr, mode_changes, mode_count);
 }
-
Index: modules/core/m_nick.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/core/Attic/m_nick.c,v
retrieving revision 1.152.2.1
diff -b -u -r1.152.2.1 m_nick.c
--- modules/core/m_nick.c	3 Aug 2004 02:01:51 -0000	1.152.2.1
+++ modules/core/m_nick.c	19 Aug 2004 22:16:28 -0000
@@ -63,9 +63,11 @@
 };
 
 mapi_clist_av1 nick_clist[] = { &nick_msgtab, &uid_msgtab, NULL };
+
 DECLARE_MODULE_AV1(nick, NULL, NULL, nick_clist, NULL, NULL, "$Revision: 1.152.2.1 $");
 
-static int change_remote_nick(struct Client *, struct Client *, int, const char **, time_t, const char *);
+static int change_remote_nick(struct Client *, struct Client *, int, const char **, time_t,
+			      const char *);
 
 static int clean_nick(const char *, int loc_client);
 static int clean_username(const char *);
@@ -81,8 +83,7 @@
 				 struct Client *, int, const char **, 
 				 time_t, const char *, const char *);
 static int perform_nickchange_collides(struct Client *, struct Client *,
-				       struct Client *, int, const char **, 
-				       time_t, const char *);
+				       struct Client *, int, const char **, time_t, const char *);
 
 /* mr_nick()
  *       parv[0] = sender prefix
@@ -98,8 +99,7 @@
 	if(parc < 2 || EmptyString(parv[1]) || (parv[1][0] == '~'))
 	{
 		sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN),
-			   me.name, 
-			   EmptyString(source_p->name) ? "*" : source_p->name);
+			   me.name, EmptyString(source_p->name) ? "*" : source_p->name);
 		return 0;
 	}
 
@@ -132,9 +132,7 @@
 	if(hash_find_nd(nick))
 	{
 		sendto_one(source_p, form_str(ERR_UNAVAILRESOURCE),
-			me.name, 
-			EmptyString(source_p->name) ? "*" : source_p->name,
-			nick);
+			   me.name, EmptyString(source_p->name) ? "*" : source_p->name, nick);
 		return 0;
 	}
 
@@ -161,8 +159,7 @@
 
 	if(parc < 2 || EmptyString(parv[1]) || (parv[1][0] == '~'))
 	{
-		sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN),
-			   me.name, source_p->name);
+		sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN), me.name, source_p->name);
 		return 0;
 	}
 
@@ -183,24 +180,20 @@
 	/* check the nickname is ok */
 	if(!clean_nick(nick, 1))
 	{
-		sendto_one(source_p, form_str(ERR_ERRONEUSNICKNAME),
-			   me.name, parv[0], nick);
+		sendto_one(source_p, form_str(ERR_ERRONEUSNICKNAME), me.name, parv[0], nick);
 		return 0;
 	}
 
 	if(find_nick_resv(nick))
 	{
-		sendto_one(source_p, form_str(ERR_ERRONEUSNICKNAME),
-			   me.name, source_p->name, nick);
+		sendto_one(source_p, form_str(ERR_ERRONEUSNICKNAME), me.name, source_p->name, nick);
 		return 0;
 	}
 
 	if(hash_find_nd(nick))
 	{
 		sendto_one(source_p, form_str(ERR_UNAVAILRESOURCE),
-			me.name, 
-			EmptyString(source_p->name) ? "*" : source_p->name,
-			nick);
+			   me.name, EmptyString(source_p->name) ? "*" : source_p->name, nick);
 		return 0;
 	}
 
@@ -264,16 +257,13 @@
 		ServerStats->is_kill++;
 		sendto_realops_flags(UMODE_DEBUG, L_ALL,
 				     "Bad Nick: %s From: %s(via %s)",
-				     parv[1], source_p->user->server,
-				     client_p->name);
-		sendto_one(client_p, ":%s KILL %s :%s (Bad Nickname)",
-			   me.name, parv[1], me.name);
+				     parv[1], source_p->user->server, client_p->name);
+		sendto_one(client_p, ":%s KILL %s :%s (Bad Nickname)", me.name, parv[1], me.name);
 
 		/* bad nick change, issue kill for the old nick to the rest
 		 * of the network.
 		 */
-		kill_client_serv_butone(client_p, source_p,
-					"%s (Bad Nickname)", me.name);
+		kill_client_serv_butone(client_p, source_p, "%s (Bad Nickname)", me.name);
 		source_p->flags |= FLAGS_KILLED;
 		exit_client(client_p, source_p, &me, "Bad Nickname");
 		return 0;
@@ -322,8 +312,7 @@
 		sendto_realops_flags(UMODE_DEBUG, L_ALL,
 				     "Bad Nick: %s From: %s(via %s)",
 				     parv[1], parv[7], client_p->name);
-		sendto_one(client_p, ":%s KILL %s :%s (Bad Nickname)",
-			   me.name, parv[1], me.name);
+		sendto_one(client_p, ":%s KILL %s :%s (Bad Nickname)", me.name, parv[1], me.name);
 		return 0;
 	}
 			      
@@ -333,10 +322,8 @@
 		ServerStats->is_kill++;
 		sendto_realops_flags(UMODE_DEBUG, L_ALL,
 				"Bad user@host: %s@%s From: %s(via %s)",
-				parv[5], parv[6], parv[7],
-				client_p->name);
-		sendto_one(client_p, ":%s KILL %s :%s (Bad user@host)",
-				me.name, parv[1], me.name);
+				     parv[5], parv[6], parv[7], client_p->name);
+		sendto_one(client_p, ":%s KILL %s :%s (Bad user@host)", me.name, parv[1], me.name);
 		return 0;
 	}
 
@@ -346,8 +333,7 @@
 		char *s = LOCAL_COPY(parv[8]);
 		/* why exactly do we care? --fl */
 		sendto_realops_flags(UMODE_ALL, L_ALL,
-				"Long realname from server %s for %s", parv[7],
-				parv[1]);
+				     "Long realname from server %s for %s", parv[7], parv[1]);
 
 		s[REALLEN] = '\0';
 		parv[8] = s;
@@ -409,10 +395,8 @@
 		ServerStats->is_kill++;
 		sendto_realops_flags(UMODE_DEBUG, L_ALL,
 				     "Bad Nick: %s From: %s(via %s)",
-				     parv[1], source_p->name,
-				     client_p->name);
-		sendto_one(client_p, ":%s KILL %s :%s (Bad Nickname)",
-			   me.id, parv[8], me.name);
+				     parv[1], source_p->name, client_p->name);
+		sendto_one(client_p, ":%s KILL %s :%s (Bad Nickname)", me.id, parv[8], me.name);
 		return 0;
 	}
 
@@ -421,10 +405,8 @@
 		ServerStats->is_kill++;
 		sendto_realops_flags(UMODE_DEBUG, L_ALL,
 				     "Bad user@host: %s@%s From: %s(via %s)",
-				     parv[5], parv[6], source_p->name,
-				     client_p->name);
-		sendto_one(client_p, ":%s KILL %s :%s (Bad user@host)",
-			   me.id, parv[8], me.name);
+				     parv[5], parv[6], source_p->name, client_p->name);
+		sendto_one(client_p, ":%s KILL %s :%s (Bad user@host)", me.id, parv[8], me.name);
 		return 0;
 	}
 
@@ -433,10 +415,8 @@
 		ServerStats->is_kill++;
 		sendto_realops_flags(UMODE_DEBUG, L_ALL,
 					"Bad UID: %s From: %s(via %s)",
-					parv[8], source_p->name,
-					client_p->name);
-		sendto_one(client_p, ":%s KILL %s :%s (Bad UID)",
-				me.id, parv[8], me.name);
+				     parv[8], source_p->name, client_p->name);
+		sendto_one(client_p, ":%s KILL %s :%s (Bad UID)", me.id, parv[8], me.name);
 		return 0;
 	}
 
@@ -487,7 +467,7 @@
 	if(loc_client && IsDigit(*nick))
 		return 0;
 
-	for (; *nick; nick++)
+	for(; *nick; nick++)
 	{
 		len++;
 		if(!IsNickChar(*nick))
@@ -512,7 +492,7 @@
 {
 	int len = 0;
 
-	for (; *username; username++)
+	for(; *username; username++)
 	{
 		len++;
 
@@ -537,7 +517,7 @@
 {
 	int len = 0;
 
-	for (; *host; host++)
+	for(; *host; host++)
 	{
 		len++;
 
@@ -567,7 +547,7 @@
 			return 0;
 	}
 
-	if(len != IDLEN-1)
+	if(len != IDLEN - 1)
 		return 0;
 
 	return 1;
@@ -673,8 +653,7 @@
 		source_p->tsinfo = newts ? newts : CurrentTime;
 
 	sendto_common_channels_local(source_p, ":%s!%s@%s NICK :%s",
-				     source_p->name, source_p->username,
-				     source_p->host, nick);
+				     source_p->name, source_p->username, source_p->host, nick);
 
 	if(source_p->user)
 	{
@@ -723,8 +702,7 @@
 					me.id, uid, me.name);
 
 		/* we then need to KILL the old client everywhere */
-		kill_client_serv_butone(NULL, target_p,
-					"%s (Nick collision (new))", me.name);
+		kill_client_serv_butone(NULL, target_p, "%s (Nick collision (new))", me.name);
 		ServerStats->is_kill++;
 
 		target_p->flags |= FLAGS_KILLED;
@@ -867,8 +845,7 @@
 					   form_str(ERR_NICKCOLLISION), target_p->name);
 
 			/* kill the client who existed before hand */
-			kill_client_serv_butone(client_p, target_p, 
-					"%s (Nick collision)", me.name);
+			kill_client_serv_butone(client_p, target_p, "%s (Nick collision)", me.name);
 
 			ServerStats->is_kill++;
 
@@ -930,8 +907,7 @@
 		flag = user_modes_from_c_to_bitmask[(unsigned char) *m];
 
 		/* increment +i count if theyre invis */
-		if(!(source_p->umodes & UMODE_INVISIBLE) &&
-		   (flag & UMODE_INVISIBLE))
+		if(!(source_p->umodes & UMODE_INVISIBLE) && (flag & UMODE_INVISIBLE))
 			Count.invisi++;
 
 		/* increment opered count if theyre opered */
@@ -973,8 +949,7 @@
 				     "Bad User [%s] :%s USER %s@%s %s, != %s[%s]",
 				     client_p->name, source_p->name,
 				     source_p->username, source_p->host,
-				     user->server, target_p->name,
-				     target_p->from->name);
+				     user->server, target_p->name, target_p->from->name);
 		kill_client(client_p, source_p,
 			    "%s (NICK from wrong direction (%s != %s))",
 			    me.name, user->server, target_p->from->name);
@@ -984,4 +959,3 @@
 
 	return (introduce_client(client_p, source_p, user, nick));
 }
-
Index: modules/core/m_part.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/core/Attic/m_part.c,v
retrieving revision 1.91.4.1
diff -b -u -r1.91.4.1 m_part.c
--- modules/core/m_part.c	4 Aug 2004 00:21:14 -0000	1.91.4.1
+++ modules/core/m_part.c	19 Aug 2004 22:16:28 -0000
@@ -49,6 +49,7 @@
 };
 
 mapi_clist_av1 part_clist[] = { &part_msgtab, NULL };
+
 DECLARE_MODULE_AV1(part, NULL, NULL, part_clist, NULL, NULL, "$Revision: 1.91.4.1 $");
 
 static void part_one_client(struct Client *client_p,
@@ -79,7 +80,7 @@
 	if(MyClient(source_p) && !IsFloodDone(source_p))
 		flood_endgrace(source_p);
 
-	while (name)
+	while(name)
 	{
 		part_one_client(client_p, source_p, name, reason);
 		name = strtoken(&p, NULL, ",");
@@ -104,16 +105,14 @@
 
 	if((chptr = find_channel(name)) == NULL)
 	{
-		sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
-				   form_str(ERR_NOSUCHCHANNEL), name);
+		sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL, form_str(ERR_NOSUCHCHANNEL), name);
 		return;
 	}
 
 	msptr = find_channel_membership(chptr, source_p);
 	if(msptr == NULL)
 	{
-		sendto_one_numeric(source_p, ERR_NOTONCHANNEL,
-				   form_str(ERR_NOTONCHANNEL), name);
+		sendto_one_numeric(source_p, ERR_NOTONCHANNEL, form_str(ERR_NOTONCHANNEL), name);
 		return;
 	}
 
@@ -126,15 +125,13 @@
 	 */
 	if(reason[0] && (is_chanop(msptr) || !MyConnect(source_p) ||
 			 ((can_send(chptr, source_p, msptr) > 0 &&
-			   (source_p->localClient->firsttime + ConfigFileEntry.anti_spam_exit_message_time)
-			   < CurrentTime))))
+			   (source_p->localClient->firsttime +
+			    ConfigFileEntry.anti_spam_exit_message_time) < CurrentTime))))
 	{
 		sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
-				":%s PART %s :%s",
-				use_id(source_p), chptr->chname, reason);
+			      ":%s PART %s :%s", use_id(source_p), chptr->chname, reason);
 		sendto_server(client_p, chptr, NOCAPS, CAP_TS6,
-				":%s PART %s :%s",
-				source_p->name, chptr->chname, reason);
+			      ":%s PART %s :%s", source_p->name, chptr->chname, reason);
 		sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s PART %s :%s",
 					source_p->name, source_p->username,
 					source_p->host, chptr->chname, reason);
@@ -142,11 +139,9 @@
 	else
 	{
 		sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
-				":%s PART %s",
-				use_id(source_p), chptr->chname);
+			      ":%s PART %s", use_id(source_p), chptr->chname);
 		sendto_server(client_p, chptr, NOCAPS, CAP_TS6,
-				":%s PART %s",
-				source_p->name, chptr->chname);
+			      ":%s PART %s", source_p->name, chptr->chname);
 		sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s PART %s",
 					source_p->name, source_p->username,
 					source_p->host, chptr->chname);
Index: modules/core/m_quit.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/core/m_quit.c,v
retrieving revision 1.46.4.1
diff -b -u -r1.46.4.1 m_quit.c
--- modules/core/m_quit.c	4 Aug 2004 00:21:14 -0000	1.46.4.1
+++ modules/core/m_quit.c	19 Aug 2004 22:16:28 -0000
@@ -45,6 +45,7 @@
 };
 
 mapi_clist_av1 quit_clist[] = { &quit_msgtab, NULL };
+
 DECLARE_MODULE_AV1(quit, NULL, NULL, quit_clist, NULL, NULL, "$Revision: 1.46.4.1 $");
 
 /*
@@ -70,7 +71,8 @@
 	}
 
 	if(!IsOper(source_p) &&
-	   (source_p->localClient->firsttime + ConfigFileEntry.anti_spam_exit_message_time) > CurrentTime)
+	   (source_p->localClient->firsttime + ConfigFileEntry.anti_spam_exit_message_time) >
+	   CurrentTime)
 	{
 		exit_client(client_p, source_p, source_p, "Client Quit");
 		return 0;
Index: modules/core/m_server.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/core/m_server.c,v
retrieving revision 1.133
diff -b -u -r1.133 m_server.c
--- modules/core/m_server.c	29 Mar 2004 12:40:21 -0000	1.133
+++ modules/core/m_server.c	19 Aug 2004 22:16:28 -0000
@@ -58,6 +58,7 @@
 };
 
 mapi_clist_av1 server_clist[] = { &server_msgtab, &sid_msgtab, NULL };
+
 DECLARE_MODULE_AV1(server, NULL, NULL, server_clist, NULL, NULL, "$Revision: 1.133 $");
 
 int bogus_host(const char *host);
@@ -110,8 +111,7 @@
 			sendto_realops_flags(UMODE_ALL, L_ALL,
 					"Unauthorised server connection attempt from %s: "
 					"No entry for servername %s",
-					get_server_name(client_p, HIDE_IP),
-					name);
+					     get_server_name(client_p, HIDE_IP), name);
 
 			ilog(L_SERVER, "Access denied, No N line for server %s",
 			     log_client_name(client_p, SHOW_IP));
@@ -190,8 +190,7 @@
 	{
 		sendto_realops_flags(UMODE_ALL, L_ALL,
 				     "Attempt to re-introduce SID %s from %s%s",
-				     client_p->id, name,
-				     get_server_name(client_p, HIDE_IP));
+				     client_p->id, name, get_server_name(client_p, HIDE_IP));
 
 		sendto_one(client_p, "ERROR :SID already exists.");
 		exit_client(client_p, client_p, client_p, "SID Exists");
@@ -311,8 +310,7 @@
 	{
 		hub_p = ptr->data;
 
-		if(match(hub_p->server, client_p->name) &&
-		   match(hub_p->host, name))
+		if(match(hub_p->server, client_p->name) && match(hub_p->host, name))
 		{
 			if(hub_p->flags & CONF_HUB)
 				hlined++;
@@ -410,8 +408,7 @@
 			     "Server %s being introduced by %s", target_p->name, source_p->name);
 
 	/* quick, dirty EOB.  you know you love it. */
-	sendto_one(target_p, ":%s PING %s %s",
-			get_id(&me, target_p), me.name, target_p->name);
+	sendto_one(target_p, ":%s PING %s %s", get_id(&me, target_p), me.name, target_p->name);
 	return 0;
 }
 
@@ -478,8 +475,7 @@
 	{
 		hub_p = ptr->data;
 
-		if(match(hub_p->server, client_p->name) &&
-		   match(hub_p->host, parv[1]))
+		if(match(hub_p->server, client_p->name) && match(hub_p->host, parv[1]))
 		{
 			if(hub_p->flags & CONF_HUB)
 				hlined++;
@@ -536,16 +532,14 @@
 	sendto_server(client_p, NULL, CAP_TS6, NOCAPS,
 		      ":%s SID %s %d %s :%s%s",
 		      source_p->id, target_p->name, target_p->hopcount + 1,
-		      target_p->id,
-		      IsHidden(target_p) ? "(H) " : "", target_p->info);
+		      target_p->id, IsHidden(target_p) ? "(H) " : "", target_p->info);
 	sendto_server(client_p, NULL, NOCAPS, CAP_TS6,
 		      ":%s SERVER %s %d :%s%s",
 		      source_p->name, target_p->name, target_p->hopcount + 1,
 		      IsHidden(target_p) ? "(H) " : "", target_p->info);
 
 	sendto_realops_flags(UMODE_EXTERNAL, L_ALL,
-			     "Server %s being introduced by %s",
-			     target_p->name, source_p->name);
+			     "Server %s being introduced by %s", target_p->name, source_p->name);
 
 	/* quick, dirty EOB.  you know you love it. */
 	sendto_one(target_p, ":%s PING %s %s",
@@ -638,7 +632,7 @@
 	const char *s;
 	int dots = 0;
 
-	for (s = host; *s; s++)
+	for(s = host; *s; s++)
 	{
 		if(!IsServChar(*s))
 		{
Index: modules/core/m_sjoin.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/core/Attic/m_sjoin.c,v
retrieving revision 1.201.2.2
diff -b -u -r1.201.2.2 m_sjoin.c
--- modules/core/m_sjoin.c	14 Aug 2004 21:43:57 -0000	1.201.2.2
+++ modules/core/m_sjoin.c	19 Aug 2004 22:16:29 -0000
@@ -49,6 +49,7 @@
 };
 
 mapi_clist_av1 sjoin_clist[] = { &sjoin_msgtab, NULL };
+
 DECLARE_MODULE_AV1(sjoin, NULL, NULL, sjoin_clist, NULL, NULL, "$Revision: 1.201.2.2 $");
 
 /*
@@ -74,7 +75,7 @@
 static void set_final_mode(struct Mode *mode, struct Mode *oldmode);
 static void remove_our_modes(struct Channel *chptr, struct Client *source_p);
 static void remove_ban_list(struct Channel *chptr, struct Client *source_p,
-			    dlink_list *list, char c, int cap);
+			    dlink_list * list, char c, int cap);
 
 static int
 ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
@@ -123,7 +124,7 @@
 	newts = atol(parv[1]);
 
 	s = parv[3];
-	while (*s)
+	while(*s)
 	{
 		switch (*(s++))
 		{
@@ -163,7 +164,7 @@
 	s = parv[args + 4];
 
 	/* remove any leading spaces */
-	while (*s == ' ')
+	while(*s == ' ')
 		s++;
 
 	if(EmptyString(s))
@@ -238,8 +239,7 @@
 
 	if(*modebuf != '\0')
 		sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s %s %s",
-				     source_p->name, chptr->chname, 
-				     modebuf, parabuf);
+				     source_p->name, chptr->chname, modebuf, parabuf);
 
 	*modebuf = *parabuf = '\0';
 
@@ -254,16 +254,14 @@
 	}
 
 	mlen = ircsprintf(buf_nick, ":%s SJOIN %ld %s %s %s:",
-			  source_p->name, (long) chptr->channelts,
-			  parv[2], modebuf, parabuf);
+			  source_p->name, (long) chptr->channelts, parv[2], modebuf, parabuf);
 	ptr_nick = buf_nick + mlen;
 
 	/* working on the presumption eventually itll be more efficient to
 	 * build a TS6 buffer without checking its needed..
 	 */
 	mlen = ircsprintf(buf_uid, ":%s SJOIN %ld %s %s %s:",
-			  use_id(source_p), (long) chptr->channelts,
-			  parv[2], modebuf, parabuf);
+			  use_id(source_p), (long) chptr->channelts, parv[2], modebuf, parabuf);
 	ptr_uid = buf_uid + mlen;
 
 	mbuf = modebuf;
@@ -282,17 +280,22 @@
 		*p++ = '\0';
 	}
 
-	while (s)
+	while(s)
 	{
 		fl = 0;
 
-		for (i = 0; i < 2; i++)
+		for(i = 0; i < 2; i++)
 		{
 			if(*s == '@')
 			{
 				fl |= CHFL_CHANOP;
 				s++;
 			}
+			else if(*s == '%')
+			{
+				fl |= CHFL_HALFOP;
+				s++;
+			}
 			else if(*s == '+')
 			{
 				fl |= CHFL_VOICE;
@@ -311,8 +314,7 @@
 		if((mlen + len_nick + NICKLEN + 3) > (BUFSIZE - 3))
 		{
 			*(ptr_nick - 1) = '\0';
-			sendto_server(client_p->from, NULL, NOCAPS, CAP_TS6,
-				      "%s", buf_nick);
+			sendto_server(client_p->from, NULL, NOCAPS, CAP_TS6, "%s", buf_nick);
 			ptr_nick = buf_nick + mlen;
 			len_nick = 0;
 		}
@@ -320,8 +322,7 @@
 		if((mlen + len_uid + IDLEN + 3) > (BUFSIZE - 3))
 		{
 			*(ptr_uid - 1) = '\0';
-			sendto_server(client_p->from, NULL, CAP_TS6, NOCAPS,
-				      "%s", buf_uid);
+			sendto_server(client_p->from, NULL, CAP_TS6, NOCAPS, "%s", buf_uid);
 			ptr_uid = buf_uid + mlen;
 			len_uid = 0;
 		}
@@ -335,6 +336,13 @@
 				len_nick++;
 				len_uid++;
 			}
+			if(fl & CHFL_HALFOP)
+			{
+				*ptr_nick++ = '%';
+				*ptr_uid++ = '%';
+				len_nick++;
+				len_uid++;
+			}
 			if(fl & CHFL_VOICE)
 			{
 				*ptr_nick++ = '+';
@@ -356,6 +364,8 @@
 		{
 			if(fl & CHFL_CHANOP)
 				fl = CHFL_DEOPPED;
+			if(fl & CHFL_HALFOP)
+				fl = CHFL_DEOPPED;
 			else
 				fl = 0;
 		}
@@ -398,6 +408,11 @@
 				para[pargs++] = target_p->name;
 			}
 		}
+		else if(fl & CHFL_HALFOP)
+		{
+			*mbuf++ = 'h';
+			para[pargs++] = target_p->name;
+		}
 		else if(fl & CHFL_VOICE)
 		{
 			*mbuf++ = 'v';
@@ -445,7 +460,8 @@
 		sendto_channel_local(ALL_MEMBERS, chptr,
 				     ":%s MODE %s %s %s %s %s %s",
 				     source_p->name, chptr->chname, modebuf,
-				     para[0], CheckEmpty(para[1]), CheckEmpty(para[2]), CheckEmpty(para[3]));
+				     para[0], CheckEmpty(para[1]), CheckEmpty(para[2]),
+				     CheckEmpty(para[3]));
 	}
 
 	if(!joins)
@@ -459,10 +475,8 @@
 	*(ptr_nick - 1) = '\0';
 	*(ptr_uid - 1) = '\0';
 
-	sendto_server(client_p->from, NULL, CAP_TS6, NOCAPS,
-		      "%s", buf_uid);
-	sendto_server(client_p->from, NULL, NOCAPS, CAP_TS6,
-		      "%s", buf_nick);
+	sendto_server(client_p->from, NULL, CAP_TS6, NOCAPS, "%s", buf_uid);
+	sendto_server(client_p->from, NULL, NOCAPS, CAP_TS6, "%s", buf_nick);
 
 	/* if the source does TS6 we have to remove our bans.  Its now safe
 	 * to issue -b's to the non-ts6 servers, as the sjoin we've just
@@ -471,16 +485,13 @@
 	if(!keep_our_modes && source_p->id[0] != '\0')
 	{
 		if(dlink_list_length(&chptr->banlist) > 0)
-			remove_ban_list(chptr, source_p, &chptr->banlist,
-					'b', NOCAPS);
+			remove_ban_list(chptr, source_p, &chptr->banlist, 'b', NOCAPS);
 
 		if(dlink_list_length(&chptr->exceptlist) > 0)
-			remove_ban_list(chptr, source_p, &chptr->exceptlist,
-					'e', CAP_EX);
+			remove_ban_list(chptr, source_p, &chptr->exceptlist, 'e', CAP_EX);
 
 		if(dlink_list_length(&chptr->invexlist) > 0)
-			remove_ban_list(chptr, source_p, &chptr->invexlist,
-					'I', CAP_IE);
+			remove_ban_list(chptr, source_p, &chptr->invexlist, 'I', CAP_IE);
 	}
 
 	
@@ -512,7 +523,7 @@
 	int i;
 
 	/* ok, first get a list of modes we need to add */
-	for (i = 0; flags[i].letter; i++)
+	for(i = 0; flags[i].letter; i++)
 	{
 		if((mode->mode & flags[i].mode) && !(oldmode->mode & flags[i].mode))
 		{
@@ -526,7 +537,7 @@
 	}
 
 	/* now the ones we need to remove. */
-	for (i = 0; flags[i].letter; i++)
+	for(i = 0; flags[i].letter; i++)
 	{
 		if((oldmode->mode & flags[i].mode) && !(mode->mode & flags[i].mode))
 		{
@@ -646,6 +657,12 @@
 				*mbuf++ = 'v';
 			}
 		}
+		else if(is_halfop(msptr))
+		{
+			msptr->flags &= ~CHFL_HALFOP;
+			lpara[count++] = msptr->client_p->name;
+			*mbuf++ = 'h';
+		}
 		else if(is_voiced(msptr))
 		{
 			msptr->flags &= ~CHFL_VOICE;
@@ -693,8 +710,7 @@
  * 		  and non-TS6 servers.
  */
 static void
-remove_ban_list(struct Channel *chptr, struct Client *source_p,
-		dlink_list *list, char c, int cap)
+remove_ban_list(struct Channel *chptr, struct Client *source_p, dlink_list * list, char c, int cap)
 {
 	static char lmodebuf[BUFSIZE];
 	static char lparabuf[BUFSIZE];
@@ -707,8 +723,7 @@
 
 	pbuf = lparabuf;
 
-	cur_len = mlen = ircsprintf(lmodebuf, ":%s MODE %s -", 
-				    source_p->name, chptr->chname);
+	cur_len = mlen = ircsprintf(lmodebuf, ":%s MODE %s -", source_p->name, chptr->chname);
 	mbuf = lmodebuf + mlen;
 
 	DLINK_FOREACH_SAFE(ptr, next_ptr, list->head)
@@ -723,10 +738,8 @@
 			/* remove trailing space */
 			*(pbuf - 1) = '\0';
 
-			sendto_channel_local(ALL_MEMBERS, chptr, "%s%s",
-					     lmodebuf, lparabuf);
-			sendto_server(source_p, chptr, cap, CAP_TS6,
-				      "%s%s", lmodebuf, lparabuf);
+			sendto_channel_local(ALL_MEMBERS, chptr, "%s%s", lmodebuf, lparabuf);
+			sendto_server(source_p, chptr, cap, CAP_TS6, "%s%s", lmodebuf, lparabuf);
 
 			cur_len = mlen;
 			mbuf = lmodebuf + mlen;
@@ -743,8 +756,7 @@
 
 	*(pbuf - 1) = '\0';
 	sendto_channel_local(ALL_MEMBERS, chptr, "%s%s", lmodebuf, lparabuf);
-	sendto_server(source_p, chptr, cap, CAP_TS6,
-		      "%s%s", lmodebuf, lparabuf);
+	sendto_server(source_p, chptr, cap, CAP_TS6, "%s%s", lmodebuf, lparabuf);
 
 	list->head = list->tail = NULL;
 	list->length = 0;
Index: modules/core/m_squit.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/modules/core/m_squit.c,v
retrieving revision 1.79
diff -b -u -r1.79 m_squit.c
--- modules/core/m_squit.c	15 Mar 2004 17:58:06 -0000	1.79
+++ modules/core/m_squit.c	19 Aug 2004 22:16:29 -0000
@@ -49,6 +49,7 @@
 };
 
 mapi_clist_av1 squit_clist[] = { &squit_msgtab, NULL };
+
 DECLARE_MODULE_AV1(squit, NULL, NULL, squit_clist, NULL, NULL, "$Revision: 1.79 $");
 
 struct squit_parms
@@ -75,8 +76,7 @@
 
 	if(!IsOperRemote(source_p))
 	{
-		sendto_one(source_p, form_str(ERR_NOPRIVS),
-			   me.name, source_p->name, "remote");
+		sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "remote");
 		return 0;
 	}
 
@@ -97,8 +97,7 @@
 	}
 	else
 	{
-		sendto_one_numeric(source_p, ERR_NOSUCHSERVER,
-				   form_str(ERR_NOSUCHSERVER), parv[1]);
+		sendto_one_numeric(source_p, ERR_NOSUCHSERVER, form_str(ERR_NOSUCHSERVER), parv[1]);
 	}
 
 	return 0;
@@ -141,8 +140,7 @@
 			      ":%s WALLOPS :Remote SQUIT %s from %s (%s)",
 			      me.name, target_p->name, source_p->name, comment);
 
-		ilog(L_SERVER, "SQUIT From %s : %s (%s)", parv[0],
-		     target_p->name, comment);
+		ilog(L_SERVER, "SQUIT From %s : %s (%s)", parv[0], target_p->name, comment);
 
 	}
 	exit_client(client_p, target_p, source_p, comment);
Index: src/adns.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/adns.c,v
retrieving revision 7.69.4.1
diff -b -u -r7.69.4.1 adns.c
--- src/adns.c	3 Aug 2004 20:39:50 -0000	7.69.4.1
+++ src/adns.c	19 Aug 2004 22:16:29 -0000
@@ -51,11 +51,10 @@
 {
 	int x;
 	char buf[16];		/* XXX: adns only deals with ipv4 dns servers so this is okay */
-	for (x = 0; x < dns_state->nservers; x++)
+	for(x = 0; x < dns_state->nservers; x++)
 	{
 		inetntop(AF_INET, &dns_state->servers[x].addr.s_addr, buf, 16);
-		sendto_one_numeric(source_p, RPL_STATSALINE, 
-				   form_str(RPL_STATSALINE), buf);
+		sendto_one_numeric(source_p, RPL_STATSALINE, form_str(RPL_STATSALINE), buf);
 	}
 }
 
@@ -153,7 +152,7 @@
 	int failure = 0;
 	adns_forallqueries_begin(dns_state);
 
-	while ((q = adns_forallqueries_next(dns_state, xr)) != NULL)
+	while((q = adns_forallqueries_next(dns_state, xr)) != NULL)
 	{
 		switch (adns_check(dns_state, &q, &answer, xq))
 		{
@@ -187,7 +186,8 @@
 	}
         if(failure == 1)
         {       
-	        sendto_realops_flags(UMODE_ALL, L_ALL, "adns got a global system failure..attempting to restart resolver");
+		sendto_realops_flags(UMODE_ALL, L_ALL,
+				     "adns got a global system failure..attempting to restart resolver");
                 init_resolver();
         }
 }
@@ -219,7 +219,7 @@
 	int npollfds, i, fd;
 	adns__consistency(dns_state, 0, cc_entex);
 	npollfds = adns__pollfds(dns_state, pollfds);
-	for (i = 0; i < npollfds; i++)
+	for(i = 0; i < npollfds; i++)
 	{
 		fd = pollfds[i].fd;
 		if(pollfds[i].events & ADNS_POLLIN)
@@ -243,7 +243,8 @@
 	assert(dns_state->nservers > 0);
 #ifdef IPV6
 	if(aftype == AF_INET6)
-		result = adns_submit(dns_state, name, adns_r_addr6, adns_qf_owner, req, &req->query);
+		result = adns_submit(dns_state, name, adns_r_addr6, adns_qf_owner, req,
+				     &req->query);
 	else
 #endif
 		result = adns_submit(dns_state, name, adns_r_addr, adns_qf_owner, req, &req->query);
Index: src/balloc.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/balloc.c,v
retrieving revision 7.82
diff -b -u -r7.82 balloc.c
--- src/balloc.c	20 Jul 2004 19:29:46 -0000	7.82
+++ src/balloc.c	19 Aug 2004 22:16:30 -0000
@@ -122,12 +122,12 @@
 #ifdef DEBUG_BALLOC
 /* Check the list length the very slow way */
 static unsigned long
-slow_list_length(dlink_list *list)
+slow_list_length(dlink_list * list)
 {
 	dlink_node *ptr;
 	unsigned long count = 0;
     
-	for (ptr = list->head; ptr; ptr = ptr->next)
+	for(ptr = list->head; ptr; ptr = ptr->next)
 	{
 		count++;
 		if(count > list->length * 2)
@@ -139,7 +139,7 @@
 }
 
 static void
-bh_sanity_check_block(BlockHeap *bh, Block *block)
+bh_sanity_check_block(BlockHeap * bh, Block * block)
 {
 	unsigned long s_used, s_free;
 	s_used = slow_list_length(&block->used_list);
@@ -149,14 +149,15 @@
 	if(s_free != dlink_list_length(&block->free_list))
 		blockheap_fail("free link count doesn't match head count");
 	
-	if(dlink_list_length(&block->used_list) + dlink_list_length(&block->free_list) != bh->elemsPerBlock)
+	if(dlink_list_length(&block->used_list) + dlink_list_length(&block->free_list) !=
+	   bh->elemsPerBlock)
 		blockheap_fail("used_list + free_list != elemsPerBlock");
 }
 
 #if 0
 /* See how confused we are */
 static void
-bh_sanity_check(BlockHeap *bh)
+bh_sanity_check(BlockHeap * bh)
 {
 	Block *walker;
 	unsigned long real_alloc = 0;
@@ -179,7 +180,8 @@
 		if(s_free != dlink_list_length(&walker->free_list))
 			blockheap_fail("free link count doesn't match head count");
 		
-		if(dlink_list_length(&walker->used_list) + dlink_list_length(&walker->free_list) != bh->elemsPerBlock)
+		if(dlink_list_length(&walker->used_list) + dlink_list_length(&walker->free_list) !=
+		   bh->elemsPerBlock)
 			blockheap_fail("used_list + free_list != elemsPerBlock");
 
 		real_alloc += dlink_list_length(&walker->used_list);
@@ -307,7 +309,7 @@
 	}
 	offset = b->elems;
 	/* Setup our blocks now */
-	for (i = 0; i < bh->elemsPerBlock; i++)
+	for(i = 0; i < bh->elemsPerBlock; i++)
 	{
 		void *data;
 		newblk = (void *) offset;
@@ -430,13 +432,14 @@
 			BlockHeapGarbageCollect(bh);
 			if(bh->freeElems == 0)
 			{
-				ilog(L_MAIN, "newblock() failed and garbage collection didn't help");
+				ilog(L_MAIN,
+				     "newblock() failed and garbage collection didn't help");
 				outofmemory();	/* Well that didn't work either...bail */
 			}
 		}
 	}
 
-	for (walker = bh->base; walker != NULL; walker = walker->next)
+	for(walker = bh->base; walker != NULL; walker = walker->next)
 	{
 		if(dlink_list_length(&walker->free_list) > 0)
 		{
@@ -448,16 +451,19 @@
 			dlinkMoveNode(new_node, &walker->free_list, &walker->used_list);
 			s_assert(new_node->data != NULL);
 			if(new_node->data == NULL)
-				blockheap_fail("new_node->data is NULL and that shouldn't happen!!!");
+				blockheap_fail
+					("new_node->data is NULL and that shouldn't happen!!!");
 			memset(new_node->data, 0, bh->elemSize);
 #ifdef DEBUG_BALLOC
 			do
 			{
-				struct MemBlock *memblock = (void *) ((size_t) new_node->data - sizeof(MemBlock));
+				struct MemBlock *memblock =
+					(void *) ((size_t) new_node->data - sizeof(MemBlock));
 				if(memblock->magic == BALLOC_FREE_MAGIC)
 					memblock->magic = BALLOC_MAGIC;
 			
-			} while(0);
+			}
+			while(0);
 			bh_sanity_check_block(bh, walker);
 #endif
 			return (new_node->data);
@@ -507,8 +513,8 @@
 	{
 		blockheap_fail("double free of a block");
 		outofmemory();
-	} else 
-	if(memblock->magic != BALLOC_MAGIC)
+	}
+	else if(memblock->magic != BALLOC_MAGIC)
 	{
 		blockheap_fail("memblock->magic != BALLOC_MAGIC");
 		outofmemory();
@@ -564,7 +570,7 @@
 	last = NULL;
 	walker = bh->base;
 
-	while (walker != NULL)
+	while(walker != NULL)
 	{
 		if((dlink_list_length(&walker->free_list) == bh->elemsPerBlock) != 0)
 		{
@@ -615,7 +621,7 @@
 		return (1);
 	}
 
-	for (walker = bh->base; walker != NULL; walker = next)
+	for(walker = bh->base; walker != NULL; walker = next)
 	{
 		next = walker->next;
 		free_block(walker->elems, walker->alloc_size);
@@ -651,4 +657,3 @@
 }
 
 #endif /* NOBALLOC */
-
Index: src/cache.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/cache.c,v
retrieving revision 1.13
diff -b -u -r1.13 cache.c
--- src/cache.c	30 Mar 2004 17:24:08 -0000	1.13
+++ src/cache.c	19 Aug 2004 22:16:30 -0000
@@ -109,8 +109,7 @@
 			ircsnprintf(user_motd_changed, sizeof(user_motd_changed),
 				 "%d/%d/%d %d:%d",
 				 local_tm->tm_mday, local_tm->tm_mon + 1,
-				 1900 + local_tm->tm_year, local_tm->tm_hour,
-				 local_tm->tm_min);
+				    1900 + local_tm->tm_year, local_tm->tm_hour, local_tm->tm_min);
 	}
 
 	cacheptr = BlockHeapAlloc(cachefile_heap);
@@ -160,16 +159,14 @@
 		target_p = ptr->data;
 
 		/* skip ourselves (done in /links) and hidden servers */
-		if(IsMe(target_p) ||
-		   (IsHidden(target_p) && !ConfigServerHide.disable_hidden))
+		if(IsMe(target_p) || (IsHidden(target_p) && !ConfigServerHide.disable_hidden))
 			continue;
 
 		/* if the below is ever modified, change LINKSLINELEN */
 		links_line = MyMalloc(LINKSLINELEN);
 		ircsnprintf(links_line, LINKSLINELEN, "%s %s :1 %s",
 			   target_p->name, me.name, 
-			   target_p->info[0] ? target_p->info : 
-			    "(Unknown Location)");
+			    target_p->info[0] ? target_p->info : "(Unknown Location)");
 
 		dlinkAddTailAlloc(links_line, &links_cache_list);
 	}
@@ -209,7 +206,7 @@
 load_help(void)
 {
 	DIR *helpfile_dir = NULL;
-	struct dirent *ldirent= NULL;
+	struct dirent *ldirent = NULL;
 	char filename[MAXPATHLEN];
 	struct cachefile *cacheptr;
 
@@ -311,17 +308,13 @@
 	if(oper_motd == NULL || dlink_list_length(&oper_motd->contents) == 0)
 		return;
 
-	sendto_one(source_p, form_str(RPL_OMOTDSTART), 
-		   me.name, source_p->name);
+	sendto_one(source_p, form_str(RPL_OMOTDSTART), me.name, source_p->name);
 
 	DLINK_FOREACH(ptr, oper_motd->contents.head)
 	{
 		lineptr = ptr->data;
-		sendto_one(source_p, form_str(RPL_OMOTD),
-			   me.name, source_p->name, lineptr->data);
+		sendto_one(source_p, form_str(RPL_OMOTD), me.name, source_p->name, lineptr->data);
 	}
 
-	sendto_one(source_p, form_str(RPL_ENDOFOMOTD), 
-		   me.name, source_p->name);
+	sendto_one(source_p, form_str(RPL_ENDOFOMOTD), me.name, source_p->name);
 }
-
Index: src/channel.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/channel.c,v
retrieving revision 7.417.2.2
diff -b -u -r7.417.2.2 channel.c
--- src/channel.c	2 Aug 2004 21:15:43 -0000	7.417.2.2
+++ src/channel.c	19 Aug 2004 22:16:30 -0000
@@ -54,6 +54,7 @@
 static BlockHeap *member_heap;
 
 static int channel_capabs[] = { CAP_EX, CAP_IE, CAP_TS6 };
+
 #define NCHCAPS         (sizeof(channel_capabs)/sizeof(int))
 #define NCHCAP_COMBOS   (1 << NCHCAPS)
 
@@ -85,7 +86,7 @@
 	struct Channel *chptr;
 	chptr = BlockHeapAlloc(channel_heap);
 	DupNString(chptr->chname, chname, CHANNELLEN);
-	return(chptr);
+	return (chptr);
 }
 
 void
@@ -103,7 +104,7 @@
 	DupNString(bptr->banstr, banstr, BANLEN);
 	DupNString(bptr->who, who, BANLEN);
 	
-	return(bptr);
+	return (bptr);
 }
 
 void
@@ -147,7 +148,7 @@
  * side effects -
  */
 const char *
-find_channel_status(struct membership *msptr, int combine)
+find_channel_status(struct membership *msptr, int combine, int halfop)
 {
 	static char buffer[3];
 	char *p;
@@ -161,6 +162,25 @@
 		*p++ = '@';
 	}
 
+	if(is_halfop(msptr))
+	{
+		/* if we're not combining, this isn't getting sent
+		 * to a remote server; don't worry about the capab
+		 * check.
+		 */
+		if(!combine)
+		{
+			if(halfop)
+				return "%";
+			else
+				return "@";
+		}
+		if(halfop)
+			*p++ = '%';
+		else
+			*p++ = '@';
+	}
+
 	if(is_voiced(msptr))
 		*p++ = '+';
 
@@ -285,7 +305,7 @@
 	if(name == NULL)
 		return 0;
 
-	for (; *name; ++name)
+	for(; *name; ++name)
 	{
 		if(!IsChanChar(*name))
 			return 0;
@@ -301,7 +321,7 @@
  * side effects - list of b/e/I modes is cleared
  */
 void
-free_channel_list(dlink_list *list)
+free_channel_list(dlink_list * list)
 {
 	dlink_node *ptr;
 	dlink_node *next_ptr;
@@ -387,8 +407,7 @@
 
 		cur_len = mlen = ircsprintf(lbuf, form_str(RPL_NAMREPLY),
 					    me.name, client_p->name, 
-					    channel_pub_or_secret(chptr),
-					    chptr->chname);
+					    channel_pub_or_secret(chptr), chptr->chname);
 
 		t = lbuf + cur_len;
 
@@ -412,8 +431,7 @@
 				t = lbuf + mlen;
 			}
 
-			ircsprintf(t, "%s%s ", find_channel_status(msptr, 0),
-				   target_p->name);
+			ircsprintf(t, "%s%s ", find_channel_status(msptr, 0, 1), target_p->name);
 
 			cur_len += tlen;
 			t += tlen;
@@ -464,10 +482,8 @@
 	/* if the buffers havent been built, do it here */
 	if(s == NULL)
 	{
-		ircsprintf(src_host, "%s!%s@%s",
-			   who->name, who->username, who->host);
-		ircsprintf(src_iphost, "%s!%s@%s",
-			   who->name, who->username, who->sockhost);
+		ircsprintf(src_host, "%s!%s@%s", who->name, who->username, who->host);
+		ircsprintf(src_iphost, "%s!%s@%s", who->name, who->username, who->sockhost);
 
 		s = src_host;
 		s2 = src_iphost;
@@ -477,8 +493,7 @@
 	{
 		actualBan = ptr->data;
 		if(match(actualBan->banstr, s) ||
-		   match(actualBan->banstr, s2) || 
-		   match_cidr(actualBan->banstr, s2))
+		   match(actualBan->banstr, s2) || match_cidr(actualBan->banstr, s2))
 			break;
 		else
 			actualBan = NULL;
@@ -492,8 +507,7 @@
 
 			/* theyre exempted.. */
 			if(match(actualExcept->banstr, s) ||
-			   match(actualExcept->banstr, s2) || 
-			   match_cidr(actualExcept->banstr, s2))
+			   match(actualExcept->banstr, s2) || match_cidr(actualExcept->banstr, s2))
 			{
 				/* cache the fact theyre not banned */
 				if(msptr != NULL)
@@ -544,10 +558,8 @@
 
 	s_assert(source_p->localClient != NULL);
 
-	ircsprintf(src_host, "%s!%s@%s", 
-		   source_p->name, source_p->username, source_p->host);
-	ircsprintf(src_iphost, "%s!%s@%s",
-		   source_p->name, source_p->username, source_p->sockhost);
+	ircsprintf(src_host, "%s!%s@%s", source_p->name, source_p->username, source_p->host);
+	ircsprintf(src_iphost, "%s!%s@%s", source_p->name, source_p->username, source_p->sockhost);
 
 	if((is_banned(chptr, source_p, NULL, src_host, src_iphost)) == CHFL_BAN)
 		return (ERR_BANNEDFROMCHAN);
@@ -580,7 +592,7 @@
 		return (ERR_BADCHANNELKEY);
 
 	if(chptr->mode.limit && 
-	   dlink_list_length(&chptr->members) >= (unsigned long)chptr->mode.limit)
+	   dlink_list_length(&chptr->members) >= (unsigned long) chptr->mode.limit)
 		return (ERR_CHANNELISFULL);
 
 	return 0;
@@ -593,8 +605,7 @@
  * side effects -
  */
 int
-can_send(struct Channel *chptr, struct Client *source_p, 
-	 struct membership *msptr)
+can_send(struct Channel *chptr, struct Client *source_p, struct membership *msptr)
 {
 	if(IsServer(source_p))
 		return CAN_SEND_OPV;
@@ -613,8 +624,7 @@
 			 * they cant send.  we dont check bans here because
 			 * theres no possibility of caching them --fl
 			 */
-			if(chptr->mode.mode & MODE_NOPRIVMSGS ||
-			   chptr->mode.mode & MODE_MODERATED)
+			if(chptr->mode.mode & MODE_NOPRIVMSGS || chptr->mode.mode & MODE_MODERATED)
 				return CAN_SEND_NO;
 			else
 				return CAN_SEND_NONOP;
@@ -724,8 +734,7 @@
 
 	splitmode = 0;
 
-	sendto_realops_flags(UMODE_ALL, L_ALL,
-			     "Network rejoined, deactivating splitmode");
+	sendto_realops_flags(UMODE_ALL, L_ALL, "Network rejoined, deactivating splitmode");
 }
 
 /* check_splitmode()
@@ -741,7 +750,7 @@
 	if(splitchecking && (ConfigChannel.no_join_on_split || ConfigChannel.no_create_on_split))
 	{
 		if(!splitmode && 
-		   ((dlink_list_length(&global_serv_list) < (unsigned long)split_servers) ||
+		   ((dlink_list_length(&global_serv_list) < (unsigned long) split_servers) ||
 		    (Count.total < split_users)))
 		{
 			splitmode = 1;
@@ -751,7 +760,7 @@
 			eventAddIsh("check_splitmode", check_splitmode, NULL, 10);
 		}
 		else if(splitmode && 
-			(dlink_list_length(&global_serv_list) >= (unsigned long)split_servers) &&
+			(dlink_list_length(&global_serv_list) >= (unsigned long) split_servers) &&
 			(Count.total >= split_users))
 		{
 			/* splitmode ended, if we're delaying the
@@ -825,8 +834,7 @@
  * side effects - channels topic, topic info and TS are set.
  */
 void
-set_channel_topic(struct Channel *chptr, const char *topic,
-		  const char *topic_info, time_t topicts)
+set_channel_topic(struct Channel *chptr, const char *topic, const char *topic_info, time_t topicts)
 {
 	if(strlen(topic) > 0)
 	{
@@ -917,10 +925,10 @@
 	memset(chcap_combos, 0, sizeof(chcap_combos));
 
 	/* For every possible combination */
-	for (m = 0; m < NCHCAP_COMBOS; m++)
+	for(m = 0; m < NCHCAP_COMBOS; m++)
 	{
 		/* Check each capab */
-		for (c = y = n = 0; c < NCHCAPS; c++)
+		for(c = y = n = 0; c < NCHCAPS; c++)
 		{
 			if((m & (1 << c)) == 0)
 				n |= channel_capabs[c];
@@ -943,7 +951,7 @@
 {
 	int n;
 
-	for (n = 0; n < NCHCAP_COMBOS; n++)
+	for(n = 0; n < NCHCAP_COMBOS; n++)
 	{
 		if(IsCapable(serv_p, chcap_combos[n].cap_yes) &&
 		   NotCapable(serv_p, chcap_combos[n].cap_no))
@@ -969,7 +977,7 @@
 {
 	int n;
 
-	for (n = 0; n < NCHCAP_COMBOS; n++)
+	for(n = 0; n < NCHCAP_COMBOS; n++)
 	{
 		if(IsCapable(serv_p, chcap_combos[n].cap_yes) &&
 		   NotCapable(serv_p, chcap_combos[n].cap_no))
@@ -1001,8 +1009,7 @@
  */
 void
 send_cap_mode_changes(struct Client *client_p, struct Client *source_p,
-		      struct Channel *chptr, struct ChModeChange mode_changes[],
-		      int mode_count)
+		      struct Channel *chptr, struct ChModeChange mode_changes[], int mode_count)
 {
 	static char modebuf[BUFSIZE];
 	static char parabuf[MODEBUFLEN];
@@ -1016,7 +1023,7 @@
 	int arglen;
 
 	/* Now send to servers... */
-	for (j = 0; j < NCHCAP_COMBOS; j++)
+	for(j = 0; j < NCHCAP_COMBOS; j++)
 	{
 		if(chcap_combos[j].count == 0)
 			continue;
@@ -1040,17 +1047,26 @@
 						source_p->name, chptr->chname);
 
 		/* loop the list of - modes we have */
-		for (i = 0; i < mode_count; i++)
+		for(i = 0; i < mode_count; i++)
 		{
 			/* if they dont support the cap we need, or they do support a cap they
 			 * cant have, then dont add it to the modebuf.. that way they wont see
 			 * the mode
 			 */
-			if((mode_changes[i].letter == 0) ||
+			if(((mode_changes[i].letter == 0) ||
 				((cap & mode_changes[i].caps) != mode_changes[i].caps)
 				|| ((nocap & mode_changes[i].nocaps) != mode_changes[i].nocaps))
+			   && (mode_changes[i].caps != CAP_HOPS))
 				continue;
 
+			if((cap & CAP_HOPS) && (mode_changes[i].caps != CAP_HOPS))
+			{
+				/* we're sending to a server that doesn't
+				 * support halfops, send an equivalent. 
+				 */
+				mode_changes[i].letter = 'o';
+			}
+
 			if((cap & CAP_TS6) && !EmptyString(mode_changes[i].id))
 				arg = mode_changes[i].id;
 			else
@@ -1061,7 +1077,7 @@
 				arglen = strlen(arg);
 
 				/* dont even think about it! --fl */
-				if(arglen > MODEBUFLEN-5)
+				if(arglen > MODEBUFLEN - 5)
 					continue;
 			}
 
@@ -1074,7 +1090,7 @@
 			 */
 			if(arg && ((mc == MAXMODEPARAMS) ||
 				(arglen + pbl + 3) > sizeof(parabuf) ||
-				(arglen + pbl + mbl + 4) > BUFSIZE-5))
+				   (arglen + pbl + mbl + 4) > BUFSIZE - 5))
 			{
 				if(nc != 0)
 					sendto_server(client_p, chptr, cap, nocap,
Index: src/class.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/class.c,v
retrieving revision 7.62
diff -b -u -r7.62 class.c
--- src/class.c	12 Apr 2004 16:22:19 -0000	7.62
+++ src/class.c	19 Aug 2004 22:16:31 -0000
@@ -305,8 +305,7 @@
 				ConFreq(cltmp), MaxUsers(cltmp), 
 				MaxSendq(cltmp), MaxSendqEob(cltmp),
 				MaxLocal(cltmp), MaxIdent(cltmp),
-				MaxGlobal(cltmp), MaxIdent(cltmp),
-				CurrUsers(cltmp));
+				   MaxGlobal(cltmp), MaxIdent(cltmp), CurrUsers(cltmp));
 	}
 
 	/* also output the default class */
Index: src/client.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/client.c,v
retrieving revision 7.463.2.5
diff -b -u -r7.463.2.5 client.c
--- src/client.c	4 Aug 2004 00:21:17 -0000	7.463.2.5
+++ src/client.c	19 Aug 2004 22:16:32 -0000
@@ -62,11 +62,11 @@
 static void free_exited_clients(void *unused);
 static void exit_aborted_clients(void *unused);
 
-static int exit_remote_client(struct Client *, struct Client *, struct Client *,const char *);
-static int exit_remote_server(struct Client *, struct Client *, struct Client *,const char *);
-static int exit_local_client(struct Client *, struct Client *, struct Client *,const char *);
-static int exit_unknown_client(struct Client *, struct Client *, struct Client *,const char *);
-static int exit_local_server(struct Client *, struct Client *, struct Client *,const char *);
+static int exit_remote_client(struct Client *, struct Client *, struct Client *, const char *);
+static int exit_remote_server(struct Client *, struct Client *, struct Client *, const char *);
+static int exit_local_client(struct Client *, struct Client *, struct Client *, const char *);
+static int exit_unknown_client(struct Client *, struct Client *, struct Client *, const char *);
+static int exit_local_server(struct Client *, struct Client *, struct Client *, const char *);
 static int qs_server(struct Client *, struct Client *, struct Client *, const char *comment);
 
 static int h_local_exit_client;
@@ -185,8 +185,7 @@
 
 	if(client_p->localClient->passwd)
 	{
-		memset(client_p->localClient->passwd, 0,
-			strlen(client_p->localClient->passwd));
+		memset(client_p->localClient->passwd, 0, strlen(client_p->localClient->passwd));
 		MyFree(client_p->localClient->passwd);
 	}
 
@@ -276,7 +275,8 @@
 			   GlobalSetOptions.idletime &&
 			   !IsOper(client_p) &&
 			   !IsIdlelined(client_p) &&
-			   ((CurrentTime - client_p->localClient->last) > GlobalSetOptions.idletime))
+			   ((CurrentTime - client_p->localClient->last) >
+			    GlobalSetOptions.idletime))
 			{
 				struct ConfItem *aconf;
 
@@ -323,7 +323,8 @@
 				}
 				(void) ircsnprintf(scratch, sizeof(scratch),
 						  "Ping timeout: %d seconds",
-						  (int) (CurrentTime - client_p->localClient->lasttime));
+						   (int) (CurrentTime -
+							  client_p->localClient->lasttime));
 
 				exit_client(client_p, client_p, &me, scratch);
 				continue;
@@ -440,7 +441,9 @@
 			continue;
 
 		/* if there is a returned struct ConfItem then kill it */
-		if((aconf = find_dline((struct sockaddr *)&client_p->localClient->ip, client_p->localClient->ip.ss_family)))
+		if((aconf =
+		    find_dline((struct sockaddr *) &client_p->localClient->ip,
+			       client_p->localClient->ip.ss_family)))
 		{
 			if(aconf->status & CONF_EXEMPTDLINE)
 				continue;
@@ -520,7 +523,9 @@
 	{
 		client_p = ptr->data;
 
-		if((aconf = find_dline((struct sockaddr *)&client_p->localClient->ip,client_p->localClient->ip.ss_family)))
+		if((aconf =
+		    find_dline((struct sockaddr *) &client_p->localClient->ip,
+			       client_p->localClient->ip.ss_family)))
 		{
 			if(aconf->status & CONF_EXEMPTDLINE)
 				continue;
@@ -655,7 +660,9 @@
 		if(IsMe(client_p))
 			continue;
 
-		if((aconf = find_dline((struct sockaddr *)&client_p->localClient->ip,client_p->localClient->ip.ss_family)) != NULL)
+		if((aconf =
+		    find_dline((struct sockaddr *) &client_p->localClient->ip,
+			       client_p->localClient->ip.ss_family)) != NULL)
 		{
 			if(aconf->status & CONF_EXEMPTDLINE)
 				continue;
@@ -674,7 +681,9 @@
 	{
 		client_p = ptr->data;
 
-		if((aconf = find_dline((struct sockaddr *)&client_p->localClient->ip,client_p->localClient->ip.ss_family)) != NULL)
+		if((aconf =
+		    find_dline((struct sockaddr *) &client_p->localClient->ip,
+			       client_p->localClient->ip.ss_family)) != NULL)
 		{
 			if(aconf->status & CONF_EXEMPTDLINE)
 				continue;
@@ -862,8 +871,7 @@
 
 	if(!(who = get_history(user, (long) KILLCHASETIMELIMIT)))
 	{
-		sendto_one_numeric(source_p, ERR_NOSUCHNICK,
-				   form_str(ERR_NOSUCHNICK), user);
+		sendto_one_numeric(source_p, ERR_NOSUCHNICK, form_str(ERR_NOSUCHNICK), user);
 		return (NULL);
 	}
 	if(chasing)
@@ -914,8 +922,7 @@
 		{
 		case SHOW_IP:
 			ircsnprintf(nbuf, sizeof(nbuf), "%s[%s@%s]", 
-				   client->name, client->username, 
-				   client->sockhost);
+				    client->name, client->username, client->sockhost);
 			break;
 		case MASK_IP:
 			ircsnprintf(nbuf, sizeof(nbuf), "%s[%s@255.255.255.255]",
@@ -948,8 +955,7 @@
 #ifdef HIDE_SERVERS_IPS
 	if(EmptyString(target_p->name))
 	{
-		ircsnprintf(nbuf, sizeof(nbuf), "[%s@255.255.255.255]",
-				target_p->username);
+		ircsnprintf(nbuf, sizeof(nbuf), "[%s@255.255.255.255]", target_p->username);
 		return nbuf;
 	}
 	else
@@ -960,8 +966,7 @@
 	{
 		case SHOW_IP:
 			ircsnprintf(nbuf, sizeof(nbuf), "%s[%s@%s]",
-				target_p->name, target_p->username, 
-				target_p->sockhost);
+			    target_p->name, target_p->username, target_p->sockhost);
 			break;
 
 		case MASK_IP:
@@ -970,8 +975,7 @@
 
 		default:
 			ircsnprintf(nbuf, sizeof(nbuf), "%s[%s@%s]",
-				target_p->name, target_p->username,
-				target_p->host);
+			    target_p->name, target_p->username, target_p->host);
 	}
 
 	return nbuf;
@@ -1049,8 +1053,7 @@
 */
 static void
 recurse_send_quits(struct Client *client_p, struct Client *source_p, 
-		   struct Client *to, const char *comment,
-		   const char *myname)
+		   struct Client *to, const char *comment, const char *myname)
 {
 	struct Client *target_p;
 	dlink_node *ptr, *ptr_next;
@@ -1060,8 +1063,7 @@
 
 	if(IsCapable(to, CAP_QS))
 	{
-		sendto_one(to, "SQUIT %s :%s",
-			   get_id(source_p, to), me.name);
+		sendto_one(to, "SQUIT %s :%s", get_id(source_p, to), me.name);
 	}
 	else
 	{
@@ -1152,8 +1154,7 @@
 	{
 		to = ptr->data;
 
-		if(IsMe(to) || to == source_p->from || 
-		   (to == client_p && IsCapable(to, CAP_QS)))
+		if(IsMe(to) || to == source_p->from || (to == client_p && IsCapable(to, CAP_QS)))
 			continue;
 
 		/* MyConnect(source_p) is rotten at this point: if source_p
@@ -1206,7 +1207,7 @@
  	DLINK_FOREACH_SAFE(ptr, next, abort_list.head)
  	{
  	 	abt = ptr->data;
- 		s_assert(*((unsigned long*)abt->client) != 0xdeadbeef); /* This is lame but its a debug thing */
+		s_assert(*((unsigned long *) abt->client) != 0xdeadbeef);	/* This is lame but its a debug thing */
  	 	dlinkDelete(ptr, &abort_list);
 
  	 	if(IsAnyServer(abt->client))
@@ -1256,8 +1257,7 @@
 	dlink_node *ptr, *next_ptr;
 
 	sendto_common_channels_local(source_p, ":%s!%s@%s QUIT :%s",
-				     source_p->name,
-				     source_p->username, source_p->host, comment);
+				     source_p->name, source_p->username, source_p->host, comment);
 
 	remove_user_from_channels(source_p);
 
@@ -1309,7 +1309,7 @@
 	}
 
 	exit_generic_client(client_p, source_p, from, comment);
-	return(CLIENT_EXITED);
+	return (CLIENT_EXITED);
 }
 
 /*
@@ -1337,14 +1337,14 @@
 	dlinkAddAlloc(source_p, &dead_list);
 
 	/* Note that we don't need to add unknowns to the dead_list */
-	return(CLIENT_EXITED);
+	return (CLIENT_EXITED);
 }
 
 static int
 exit_remote_server(struct Client *client_p, struct Client *source_p, struct Client *from, 
 		  const char *comment)
 {
-	static char comment1[(HOSTLEN*2)+2];
+	static char comment1[(HOSTLEN * 2) + 2];
 	struct Client *target_p;
 	
 	if((source_p->serv) && (source_p->serv->up))
@@ -1369,8 +1369,7 @@
 	   !IsMe(target_p) && (source_p->flags & FLAGS_KILLED) == 0)
 	{
 		sendto_one(target_p, ":%s SQUIT %s :%s", 
-			   get_id(from, target_p), get_id(source_p, target_p),
-			   comment);
+			   get_id(from, target_p), get_id(source_p, target_p), comment);
 	}
 
 	if(has_id(source_p))
@@ -1413,7 +1412,7 @@
 exit_local_server(struct Client *client_p, struct Client *source_p, struct Client *from, 
 		  const char *comment)
 {
-	static char comment1[(HOSTLEN*2)+2];
+	static char comment1[(HOSTLEN * 2) + 2];
 	unsigned int sendk, recvk;
 	
 	dlinkDelete(&source_p->localClient->tnode, &serv_list);
@@ -1456,7 +1455,8 @@
 
 	sendto_realops_flags(UMODE_ALL, L_ALL, "%s was connected"
 			     " for %ld seconds.  %d/%d sendK/recvK.",
-			     source_p->name, CurrentTime - source_p->localClient->firsttime, sendk, recvk);
+			     source_p->name, CurrentTime - source_p->localClient->firsttime, sendk,
+			     recvk);
 
 	ilog(L_SERVER, "%s was connected for %ld seconds.  %d/%d sendK/recvK.",
 	     source_p->name, CurrentTime - source_p->localClient->firsttime, sendk, recvk);
@@ -1492,8 +1492,7 @@
 
 	sendto_realops_flags(UMODE_CCONN, L_ALL,
 			     "Client exiting: %s (%s@%s) [%s] [%s]",
-			     source_p->name,
-			     source_p->username, source_p->host, comment,
+			     source_p->name, source_p->username, source_p->host, comment,
 #ifdef HIDE_SPOOF_IPS
                              IsIPSpoof(source_p) ? "255.255.255.255" :
 #endif
@@ -1519,7 +1518,7 @@
 			      ":%s QUIT :%s", source_p->name, comment);
 	}
 	exit_generic_client(client_p, source_p, from, comment);
-	return(CLIENT_EXITED);
+	return (CLIENT_EXITED);
 }
 
 
@@ -1920,8 +1919,7 @@
 					     (unsigned long) user,
 					     (unsigned long) user->invited.head,
 					     (unsigned long) user->channel.head, 
-					     dlink_list_length(&user->channel),
-					     user->refcnt);
+					     dlink_list_length(&user->channel), user->refcnt);
 			s_assert(!user->refcnt);
 			s_assert(!user->invited.head);
 			s_assert(!user->channel.head);
@@ -2126,8 +2124,7 @@
 		{
 			report_error("Lost connection to %s: %d",
 					get_server_name(client_p, SHOW_IP),
-					log_client_name(client_p, SHOW_IP),
-					current_error);
+				     log_client_name(client_p, SHOW_IP), current_error);
 		}
 
 		sendto_realops_flags(UMODE_ALL, L_ALL,
Index: src/commio.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/commio.c,v
retrieving revision 1.9.2.1
diff -b -u -r1.9.2.1 commio.c
--- src/commio.c	3 Aug 2004 20:39:51 -0000	1.9.2.1
+++ src/commio.c	19 Aug 2004 22:16:33 -0000
@@ -95,13 +95,13 @@
 	/* XXX btw, fd 3 is used for profiler ! */
 #if 0
 #ifndef __VMS
-	for (i = 0; i < MAXCONNECTIONS; ++i)
+	for(i = 0; i < MAXCONNECTIONS; ++i)
 #else
-	for (i = 3; i < MAXCONNECTIONS; ++i)
+	for(i = 3; i < MAXCONNECTIONS; ++i)
 #endif
 #endif
 
-		for (i = 4; i < MAXCONNECTIONS; ++i)
+		for(i = 4; i < MAXCONNECTIONS; ++i)
 		{
 			if(fd_table[i].flags.open)
 				fd_close(i);
@@ -286,7 +286,7 @@
 	PF *hdl;
 	void *data;
 	fde_t *F;
-	for (fd = 0; fd <= highest_fd; fd++)
+	for(fd = 0; fd <= highest_fd; fd++)
 	{
 		F = &fd_table[fd];
 		if(!F->flags.open)
@@ -295,8 +295,7 @@
 			continue;
 
 		/* check flush functions */
-		if(F->flush_handler &&
-		   F->flush_timeout > 0 && F->flush_timeout < CurrentTime)
+		if(F->flush_handler && F->flush_timeout > 0 && F->flush_timeout < CurrentTime)
 		{
 			hdl = F->flush_handler;
 			data = F->flush_data;
@@ -305,8 +304,7 @@
 		}
 
 		/* check timeouts */
-		if(F->timeout_handler &&
-		   F->timeout > 0 && F->timeout < CurrentTime)
+		if(F->timeout_handler && F->timeout > 0 && F->timeout < CurrentTime)
 		{
 			/* Call timeout handler */
 			hdl = F->timeout_handler;
@@ -348,15 +346,16 @@
 #ifdef IPV6
 	if(aftype == AF_INET6)
 	{
-		struct sockaddr_in6 *in6 = (struct sockaddr_in6 *)&F->connect.hostaddr;
+		struct sockaddr_in6 *in6 = (struct sockaddr_in6 *) &F->connect.hostaddr;
 		SET_SS_LEN(F->connect.hostaddr, sizeof(struct sockaddr_in6));
 		in6->sin6_port = htons(port);
 		in6->sin6_family = AF_INET6;
 		ipptr = &in6->sin6_addr;
-	} else
+	}
+	else
 #endif
 	{
-		struct sockaddr_in *in = (struct sockaddr_in *)&F->connect.hostaddr;
+		struct sockaddr_in *in = (struct sockaddr_in *) &F->connect.hostaddr;
 		SET_SS_LEN(F->connect.hostaddr, sizeof(struct sockaddr_in));
 		in->sin_port = htons(port);
 		in->sin_family = AF_INET;
@@ -474,20 +473,20 @@
 #ifdef IPV6
 	if(reply->rrs.addr->addr.sa.sa_family == AF_INET6)
 	{
-		struct sockaddr_in6 *in6 = (struct sockaddr_in6 *)&F->connect.hostaddr;
-		memcpy(&in6->sin6_addr, &reply->rrs.addr->addr.inet6.sin6_addr, sizeof(struct in6_addr));
+		struct sockaddr_in6 *in6 = (struct sockaddr_in6 *) &F->connect.hostaddr;
+		memcpy(&in6->sin6_addr, &reply->rrs.addr->addr.inet6.sin6_addr,
+		       sizeof(struct in6_addr));
 	}
 	else
 #endif
 	{
-		struct sockaddr_in *in = (struct sockaddr_in *)&F->connect.hostaddr;
+		struct sockaddr_in *in = (struct sockaddr_in *) &F->connect.hostaddr;
 		in->sin_addr.s_addr = reply->rrs.addr->addr.inet.sin_addr.s_addr;
 	}
 
 	/* Now, call the tryconnect() routine to try a connect() */
 	MyFree(reply);
-	comm_setselect(F->fd, FDLIST_SERVER, COMM_SELECT_WRITE,
-		       comm_connect_tryconnect, NULL, 0);
+	comm_setselect(F->fd, FDLIST_SERVER, COMM_SELECT_WRITE, comm_connect_tryconnect, NULL, 0);
 }
 
 
@@ -523,7 +522,7 @@
 			comm_connect_callback(F->fd, COMM_OK);
 		else if(ignoreErrno(errno))
 			/* Ignore error? Reschedule */
-			comm_setselect(F->fd, FDLIST_SERVER, COMM_SELECT_WRITE|COMM_SELECT_RETRY,
+			comm_setselect(F->fd, FDLIST_SERVER, COMM_SELECT_WRITE | COMM_SELECT_RETRY,
 				       comm_connect_tryconnect, NULL, 0);
 		else
 			/* Error? Fail with COMM_ERR_CONNECT */
@@ -595,7 +594,8 @@
 	/* Set the socket non-blocking, and other wonderful bits */
 	if(!comm_set_nb(fd))
 	{
-		ilog(L_IOERROR, "comm_open: Couldn't set FD %d non blocking: %s", fd, strerror(errno));
+		ilog(L_IOERROR, "comm_open: Couldn't set FD %d non blocking: %s", fd,
+		     strerror(errno));
 		/* if VMS, we might be opening a file (ircd.conf, resolv.conf).
 		   VMS doesn't let us set non-blocking on a file, so it might fail. */
 #ifndef __VMS
@@ -659,7 +659,7 @@
 void
 mangle_mapped_sockaddr(struct sockaddr *in)
 {
-	struct sockaddr_in6 *in6 = (struct sockaddr_in6 *)in;								
+	struct sockaddr_in6 *in6 = (struct sockaddr_in6 *) in;
 
 	if(in->sa_family == AF_INET)
 		return;
@@ -670,7 +670,7 @@
 		memset(&in4, 0, sizeof(struct sockaddr_in));
 		in4.sin_family = AF_INET;
 		in4.sin_port = in6->sin6_port;
-		in4.sin_addr.s_addr = ((uint32_t *)&in6->sin6_addr)[3];
+		in4.sin_addr.s_addr = ((uint32_t *) & in6->sin6_addr)[3];
 		memcpy(in, &in4, sizeof(struct sockaddr_in)); 		
 	}	
 	return;
@@ -701,7 +701,7 @@
 	 * re-opening it
 	 */
 	s_assert(!opening);
-	while (highest_fd >= 0 && !fd_table[highest_fd].flags.open)
+	while(highest_fd >= 0 && !fd_table[highest_fd].flags.open)
 		highest_fd--;
 }
 
@@ -764,7 +764,7 @@
 	comm_setselect(F->fd, FDLIST_NONE, COMM_SELECT_WRITE | COMM_SELECT_READ, NULL, NULL, 0);
 	comm_setflush(F->fd, 0, NULL, NULL);
 	
-	if (F->dns_query != NULL)
+	if(F->dns_query != NULL)
 	{
 		delete_adns_queries(F->dns_query);	
 		MyFree(F->dns_query);
@@ -789,14 +789,13 @@
 {
 	int i;
 
-	for (i = 0; i <= highest_fd; i++)
+	for(i = 0; i <= highest_fd; i++)
 	{
 		if(!fd_table[i].flags.open)
 			continue;
 
 		sendto_one_numeric(source_p, RPL_STATSDEBUG, 
-				   "F :fd %-3d desc '%s'",
-				   i, fd_table[i].desc);
+				   "F :fd %-3d desc '%s'", i, fd_table[i].desc);
 	}
 }
 
@@ -874,7 +873,7 @@
 		errno = EINVAL;
 		return NULL;
 	}
-	while (*mode)
+	while(*mode)
 	{
 		switch (*mode)
 		{
@@ -1030,7 +1029,7 @@
 	if(fb->ptr == fb->endp && fbfill(fb) < 1)
 		return 0;
 	--len;
-	while (len--)
+	while(len--)
 	{
 		*p = *fb->ptr++;
 		if('\n' == *p)
Index: src/crypt.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/crypt.c,v
retrieving revision 7.9
diff -b -u -r7.9 crypt.c
--- src/crypt.c	11 Aug 2003 19:39:16 -0000	7.9
+++ src/crypt.c	19 Aug 2004 22:16:33 -0000
@@ -46,7 +46,7 @@
      unsigned long v;
      int n;
 {
-	while (--n >= 0)
+	while(--n >= 0)
 	{
 		*s++ = itoa64[v & 0x3f];
 		v >>= 6;
@@ -81,7 +81,7 @@
 		sp += strlen(magic);
 
 	/* It stops at the first '$', max 8 chars */
-	for (ep = sp; *ep && *ep != '$' && ep < (sp + 8); ep++)
+	for(ep = sp; *ep && *ep != '$' && ep < (sp + 8); ep++)
 		continue;
 
 	/* get the length of the true salt */
@@ -104,14 +104,14 @@
 	MD5Update(&ctx1, (const unsigned char *) sp, sl);
 	MD5Update(&ctx1, (const unsigned char *) pw, strlen(pw));
 	MD5Final(final, &ctx1);
-	for (pl = strlen(pw); pl > 0; pl -= MD5_SIZE)
+	for(pl = strlen(pw); pl > 0; pl -= MD5_SIZE)
 		MD5Update(&ctx, final, pl > MD5_SIZE ? MD5_SIZE : pl);
 
 	/* Don't leave anything around in vm they could use. */
 	memset(final, 0, sizeof final);
 
 	/* Then something really weird... */
-	for (i = strlen(pw); i; i >>= 1)
+	for(i = strlen(pw); i; i >>= 1)
 		if(i & 1)
 			MD5Update(&ctx, final, 1);
 		else
@@ -129,7 +129,7 @@
 	 * On a 60 Mhz Pentium this takes 34 msec, so you would
 	 * need 30 seconds to build a 1000 entry dictionary...
 	 */
-	for (i = 0; i < 1000; i++)
+	for(i = 0; i < 1000; i++)
 	{
 		MD5Init(&ctx1);
 		if(i & 1)
@@ -227,7 +227,7 @@
 {
 	unsigned int i, j;
 
-	for (i = 0, j = 0; j < len; i++, j += 4)
+	for(i = 0, j = 0; j < len; i++, j += 4)
 	{
 		output[j] = (unsigned char) (input[i] & 0xff);
 		output[j + 1] = (unsigned char) ((input[i] >> 8) & 0xff);
@@ -249,7 +249,7 @@
 {
 	unsigned int i, j;
 
-	for (i = 0, j = 0; j < len; i++, j += 4)
+	for(i = 0, j = 0; j < len; i++, j += 4)
 		output[i] =
 			((u_int32_t) input[j]) | (((u_int32_t) input[j + 1])
 						  << 8) | (((u_int32_t)
@@ -344,7 +344,7 @@
 		memcpy((void *) &context->buffer[xindex], (const void *) input, partLen);
 		MD5Transform(context->state, context->buffer);
 
-		for (i = partLen; i + 63 < inputLen; i += 64)
+		for(i = partLen; i + 63 < inputLen; i += 64)
 			MD5Transform(context->state, &input[i]);
 
 		xindex = 0;
Index: src/devpoll.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/devpoll.c,v
retrieving revision 7.32
diff -b -u -r7.32 devpoll.c
--- src/devpoll.c	30 Mar 2004 00:35:27 -0000	7.32
+++ src/devpoll.c	19 Aug 2004 22:16:33 -0000
@@ -170,8 +170,7 @@
 	if(dpfd < 0)
 	{
 		fprintf(stderr,
-		     "init_netio: Couldn't open /dev/poll - %d: %s\n",
-		     errno, strerror(errno));
+			"init_netio: Couldn't open /dev/poll - %d: %s\n", errno, strerror(errno));
 		exit(115);	/* Whee! */
 	}
 }
@@ -233,7 +232,7 @@
 
 	do
 	{
-		for (;;)
+		for(;;)
 		{
 			dopoll.dp_timeout = delay;
 			dopoll.dp_nfds = POLL_LENGTH;
@@ -251,7 +250,7 @@
 		if(num == 0)
 			continue;
 
-		for (i = 0; i < num; i++)
+		for(i = 0; i < num; i++)
 		{
 			int fd = dopoll.dp_fds[i].fd;
 			PF *hdl = NULL;
@@ -308,8 +307,7 @@
 		}
 		return COMM_OK;
 	}
-	while (0);
+	while(0);
 	/* XXX Get here, we broke! */
 	return 0;
 }
-
Index: src/epoll.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/epoll.c,v
retrieving revision 1.26
diff -b -u -r1.26 epoll.c
--- src/epoll.c	15 Mar 2004 17:58:08 -0000	1.26
+++ src/epoll.c	19 Aug 2004 22:16:33 -0000
@@ -63,8 +63,7 @@
 
 _syscall1(int, epoll_create, int, maxfds);
 _syscall4(int, epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event *, events);
-_syscall4(int, epoll_wait, int, epfd, struct epoll_event *, pevents,
-		 int, maxevents, int, timeout);
+_syscall4(int, epoll_wait, int, epfd, struct epoll_event *, pevents, int, maxevents, int, timeout);
 
 #endif /* HAVE_EPOLL_CTL */
 
@@ -182,7 +181,7 @@
 
 	if(num == 0)
 		return COMM_OK;
-	for (i = 0; i < num; i++)
+	for(i = 0; i < num; i++)
 	{
 		PF *hdl;
 		fde_t *F = pfd[i].data.ptr;
@@ -193,7 +192,8 @@
 			data = F->read_data;
 			F->read_handler = NULL;
 			F->read_data = NULL;
-			if(hdl) {
+			if(hdl)
+			{
 				hdl(F->fd, data);
 			}
 			else
@@ -211,7 +211,8 @@
 			F->write_handler = NULL;
 			F->write_data = NULL;
 
-			if(hdl) {
+			if(hdl)
+			{
 				hdl(F->fd, data);
 			}
 			else
@@ -238,11 +239,11 @@
 			ep_event.data.ptr = F;
 			if(epoll_ctl(ep, op, F->fd, &ep_event) != 0)
 			{
-				ilog(L_IOERROR, "comm_setselect(): epoll_ctl failed: %s", strerror(errno));
+				ilog(L_IOERROR, "comm_setselect(): epoll_ctl failed: %s",
+				     strerror(errno));
 			}
 		}
 					
 	}
 	return COMM_OK;
 }
-
Index: src/event.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/event.c,v
retrieving revision 7.41
diff -b -u -r7.41 event.c
--- src/event.c	15 Mar 2004 17:58:08 -0000	7.41
+++ src/event.c	19 Aug 2004 22:16:33 -0000
@@ -70,7 +70,7 @@
  */
 #ifdef __vms
 void
-ircd$schdast(unsigned int msec, int tid, void (*astadr)(__unknown_params))
+ircd$schdast(unsigned int msec, int tid, void (*astadr) (__unknown_params))
 {
 	char asctim[15];
 	$DESCRIPTOR(asctim_desc, asctim);
@@ -79,8 +79,8 @@
 	double delay = msec;
 	int tim[2];
 
-	delay_mins = (delay/1000) / 60;
-	delay_secs = (delay/1000) - (60 * delay_mins);
+	delay_mins = (delay / 1000) / 60;
+	delay_secs = (delay / 1000) - (60 * delay_mins);
 
 	ircsnprintf(asctim, sizeof(asctim), "0 :%d:%2.2f", delay_mins, delay_secs);
 	asctim_desc.dsc$w_length = strlen(asctim);
@@ -100,13 +100,15 @@
 	 * If it's not a repeating event, remove it from
 	 * the event table.
 	 */
-	if (!event_table[evtn].frequency)
+	if(!event_table[evtn].frequency)
 	{
 		event_table[evtn].name = NULL;
 		event_table[evtn].func = NULL;
 		event_table[evtn].arg = NULL;
 		event_table[evtn].active = 0;
-	} else {
+	}
+	else
+	{
 		/* Otherwise, schedule it to run again. */
 		ircd$schdast(event_table[evtn].frequency * 1000, evtn, ircd$runevt);
 	}
@@ -127,7 +129,7 @@
 	int i;
 
 	/* find first inactive index */
-	for (i = 0; i < MAX_EVENTS; i++)
+	for(i = 0; i < MAX_EVENTS; i++)
 	{
 		if(event_table[i].active == 0)
 		{
@@ -154,12 +156,12 @@
 }
 
 void
-eventAddOnce(const char *name, EVH *func, void *arg, time_t when)
+eventAddOnce(const char *name, EVH * func, void *arg, time_t when)
 {
 	int i;
 
 	/* find first inactive index */
-	for (i = 0; i < MAX_EVENTS; i++)
+	for(i = 0; i < MAX_EVENTS; i++)
 	{
 		if(event_table[i].active == 0)
 		{
@@ -170,7 +172,7 @@
 			event_table[i].frequency = 0;
 			event_table[i].active = 1;
 
-			if ((event_table[i].when < event_time_min) || (event_time_min == -1))
+			if((event_table[i].when < event_time_min) || (event_time_min == -1))
 				event_time_min = event_table[i].when;
 
 #ifdef __vms
@@ -181,8 +183,7 @@
 	}
 
 	/* erk! couldnt add to event table */
-	sendto_realops_flags(UMODE_DEBUG, L_ALL,
-			     "Unable to add event [%s] to event table", name);
+	sendto_realops_flags(UMODE_DEBUG, L_ALL, "Unable to add event [%s] to event table", name);
 }
 
 /*
@@ -244,7 +245,7 @@
 {
 	int i;
 
-	for (i = 0; i < MAX_EVENTS; i++)
+	for(i = 0; i < MAX_EVENTS; i++)
 	{
 		if(event_table[i].active && (event_table[i].when <= CurrentTime))
 		{
@@ -281,7 +282,7 @@
 
 	if(event_time_min == -1)
 	{
-		for (i = 0; i < MAX_EVENTS; i++)
+		for(i = 0; i < MAX_EVENTS; i++)
 		{
 			if(event_table[i].active &&
 			   ((event_table[i].when < event_time_min) || (event_time_min == -1)))
@@ -318,7 +319,7 @@
 {
 	int i;
 
-	for (i = 0; i < MAX_EVENTS; i++)
+	for(i = 0; i < MAX_EVENTS; i++)
 	{
 		if((event_table[i].func == func) &&
 		   (event_table[i].arg == arg) && event_table[i].active)
@@ -342,20 +343,19 @@
 
 	if(last_event_ran)
 		sendto_one_numeric(source_p, RPL_STATSDEBUG, 
-				   "E :Last event to run: %s",
-				   last_event_ran);
+				   "E :Last event to run: %s", last_event_ran);
 
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
 			   "E :Operation                    Next Execution");
 
-	for (i = 0; i < MAX_EVENTS; i++)
+	for(i = 0; i < MAX_EVENTS; i++)
 	{
 		if(event_table[i].active)
 		{
 			sendto_one_numeric(source_p, RPL_STATSDEBUG, 
 					   "E :%-28s %-4d seconds",
 					   event_table[i].name, 
-					   (int)(event_table[i].when - CurrentTime));
+					   (int) (event_table[i].when - CurrentTime));
 		}
 	}
 }
@@ -371,7 +371,7 @@
 {
 	int i;
 
-	for (i = 0; i < MAX_EVENTS; i++)
+	for(i = 0; i < MAX_EVENTS; i++)
 	{
 		if(event_table[i].when > by)
 			event_table[i].when -= by;
Index: src/getopt.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/getopt.c,v
retrieving revision 7.21
diff -b -u -r7.21 getopt.c
--- src/getopt.c	3 Jul 2004 19:48:07 -0000	7.21
+++ src/getopt.c	19 Aug 2004 22:16:34 -0000
@@ -41,7 +41,7 @@
 	char *progname = (*argv)[0];
 
 	/* loop through each argument */
-	for (;;)
+	for(;;)
 	{
 		int found = 0;
 
@@ -62,7 +62,7 @@
 		(*argv)[0]++;
 
 		/* search through our argument list, and see if it matches */
-		for (i = 0; opts[i].opt; i++)
+		for(i = 0; opts[i].opt; i++)
 		{
 			if(!strcmp(opts[i].opt, (*argv)[0]))
 			{
@@ -131,7 +131,7 @@
 	fprintf(stderr, "Usage: %s [options]\n", name);
 	fprintf(stderr, "Where valid options are:\n");
 
-	for (i = 0; myopts[i].opt; i++)
+	for(i = 0; myopts[i].opt; i++)
 	{
 		fprintf(stderr, "\t%c%-10s %-20s%s\n", OPTCHAR,
 			myopts[i].opt, (myopts[i].argtype == YESNO
Index: src/hash.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/hash.c,v
retrieving revision 7.107.2.1
diff -b -u -r7.107.2.1 hash.c
--- src/hash.c	2 Aug 2004 20:54:28 -0000	7.107.2.1
+++ src/hash.c	19 Aug 2004 22:16:34 -0000
@@ -108,12 +108,12 @@
 {
  	u_int32_t h = FNV1_32_INIT;
 
-	while (*s)
+	while(*s)
 	{
          	h ^= ToUpper(*s++);
-		h += (h<<1) + (h<<4) + (h<<7) + (h << 8) + (h << 24);
+		h += (h << 1) + (h << 4) + (h << 7) + (h << 8) + (h << 24);
 	}
-        h = (h >> bits) ^ (h & ((2^bits)-1));
+	h = (h >> bits) ^ (h & ((2 ^ bits) - 1));
 	return h;
 }
 
@@ -122,12 +122,12 @@
 {
  	u_int32_t h = FNV1_32_INIT;
 
-	while (*s)
+	while(*s)
 	{
 		h ^= *s++;
-		h += (h<<1) + (h<<4) + (h<<7) + (h << 8) + (h << 24);
+		h += (h << 1) + (h << 4) + (h << 7) + (h << 8) + (h << 24);
 	}
-        h = (h >> bits) ^ (h & ((2^bits)-1));
+	h = (h >> bits) ^ (h & ((2 ^ bits) - 1));
 	return h;
 }
 
@@ -136,12 +136,12 @@
 {
  	u_int32_t h = FNV1_32_INIT;
 	const unsigned char *x = s + len;
-	while (*s && s < x)
+	while(*s && s < x)
 	{
 		h ^= *s++;
-		h += (h<<1) + (h<<4) + (h<<7) + (h << 8) + (h << 24);
+		h += (h << 1) + (h << 4) + (h << 7) + (h << 8) + (h << 24);
 	}
-        h = (h >> bits) ^ (h & ((2^bits)-1));
+	h = (h >> bits) ^ (h & ((2 ^ bits) - 1));
 	return h;
 }
 
@@ -150,12 +150,12 @@
 {
  	u_int32_t h = FNV1_32_INIT;
 	const unsigned char *x = s + len;
-	while (*s && s < x)
+	while(*s && s < x)
 	{
          	h ^= ToUpper(*s++);
-		h += (h<<1) + (h<<4) + (h<<7) + (h << 8) + (h << 24);
+		h += (h << 1) + (h << 4) + (h << 7) + (h << 8) + (h << 24);
 	}
-        h = (h >> bits) ^ (h & ((2^bits)-1));
+	h = (h >> bits) ^ (h & ((2 ^ bits) - 1));
 	return h;
 }
 
@@ -416,8 +416,7 @@
 		free_cachefile(ptr->data);
 		dlinkDestroy(ptr, &helpTable[i]);
 	}
-	HASH_WALK_END
-}
+HASH_WALK_END}
 
 /* find_id()
  *
@@ -471,7 +470,7 @@
 	/* copy it across to give us a buffer to work on */
 	strlcpy(buf, name, sizeof(buf));
 
-	while ((s = strchr(p, '.')) != 0)
+	while((s = strchr(p, '.')) != 0)
 	{
 		*--s = '*';
 		/*
@@ -593,11 +592,10 @@
 	if(EmptyString(name))
 		return NULL;
 
-	if((source_p == NULL || !MyClient(source_p)) && 
-	   IsDigit(*name) && strlen(name) == 3)
+	if((source_p == NULL || !MyClient(source_p)) && IsDigit(*name) && strlen(name) == 3)
 	{
 		target_p = find_id(name);
-      		return(target_p);
+		return (target_p);
 	}
 
 	hashv = hash_nick(name);
@@ -606,8 +604,7 @@
 	{
 		target_p = ptr->data;
 
-		if((IsServer(target_p) || IsMe(target_p)) &&
-		   irccmp(name, target_p->name) == 0)
+		if((IsServer(target_p) || IsMe(target_p)) && irccmp(name, target_p->name) == 0)
 				return target_p;
 	}
 
@@ -773,8 +770,7 @@
 	{
 		hptr = ptr->data;
 
-		if((irccmp(name, hptr->name) == 0) &&
-		   (hptr->flags & flags))
+		if((irccmp(name, hptr->name) == 0) && (hptr->flags & flags))
 			return hptr;
 	}
 
@@ -800,8 +796,7 @@
 		free_conf(ptr->data);
 		dlinkDestroy(ptr, &resvTable[i]);
 	}
-	HASH_WALK_END
-}
+HASH_WALK_END}
 
 struct nd_entry *
 hash_find_nd(const char *name)
@@ -832,13 +827,11 @@
 	unsigned long total = 0;
 	int i;
 
-	sendto_one_numeric(source_p, RPL_STATSDEBUG,
-			"B :%s Hash Statistics", name);
+	sendto_one_numeric(source_p, RPL_STATSDEBUG, "B :%s Hash Statistics", name);
 
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
 			"B :Size: %d Empty: %d (%.3f%%)",
-			length, counts[0], 
-			(float) ((counts[0]*100) / (float) length));
+			   length, counts[0], (float) ((counts[0] * 100) / (float) length));
 
 	for(i = 1; i < 11; i++)
 	{
@@ -855,14 +848,13 @@
 	for(i = 0; i < 11; i++)
 	{
 		sendto_one_numeric(source_p, RPL_STATSDEBUG,
-				"B :Nodes with %d entries: %d",
-				i, counts[i]);
+				   "B :Nodes with %d entries: %d", i, counts[i]);
 	}
 }
 	
 
 static void
-count_hash(struct Client *source_p, dlink_list *table, int length, const char *name)
+count_hash(struct Client *source_p, dlink_list * table, int length, const char *name)
 {
 	int counts[11];
 	int deepest = 0;
Index: src/hook.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/hook.c,v
retrieving revision 7.30
diff -b -u -r7.30 hook.c
--- src/hook.c	21 May 2004 21:22:14 -0000	7.30
+++ src/hook.c	19 Aug 2004 22:16:34 -0000
@@ -35,7 +35,7 @@
 
 dlink_list hooks;
 
-static hook* find_hook_byname(const char *);
+static hook *find_hook_byname(const char *);
 
 #ifndef NDEBUG
 int h_iosend_id;
@@ -73,10 +73,10 @@
 }
 
 int
-hook_add_event(const char *name, int* id)
+hook_add_event(const char *name, int *id)
 {
 	hook *newhook;
-	if ((newhook = find_hook_byname(name)) != NULL)
+	if((newhook = find_hook_byname(name)) != NULL)
 	{
 		*id = newhook->id;
 		return 0;
@@ -134,7 +134,7 @@
 	{
 		h = node->data;
 
-		if (h->id == id)
+		if(h->id == id)
 			return h;
 	}
 	return NULL;
Index: src/hostmask.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/hostmask.c,v
retrieving revision 7.97.2.1
diff -b -u -r7.97.2.1 hostmask.c
--- src/hostmask.c	3 Aug 2004 20:39:51 -0000	7.97.2.1
+++ src/hostmask.c	19 Aug 2004 22:16:34 -0000
@@ -59,9 +59,9 @@
 		b = nb;
 	
 	if(naddr == NULL)
-		addr = (struct irc_sockaddr_storage *)&xaddr;
+		addr = (struct irc_sockaddr_storage *) &xaddr;
 	else
-		addr = (struct irc_sockaddr_storage *)naddr;
+		addr = (struct irc_sockaddr_storage *) naddr;
 	
 #ifdef IPV6
 	if(strchr(ip, ':'))
@@ -73,13 +73,15 @@
 			*b = atoi(ptr);
 			if(*b > 128)
 				*b = 128;
-		} else
+		}
+		else
 			*b = 128;
-		if(inetpton_sock(ip, (struct sockaddr *)addr) > 0)
+		if(inetpton_sock(ip, (struct sockaddr *) addr) > 0)
 			return HM_IPV6;
 		else
 			return HM_HOST;
-	} else
+	}
+	else
 #endif
 	if(strchr(text, '.'))
 	{
@@ -90,9 +92,10 @@
 			*b = atoi(ptr);
 			if(*b > 32)
 				*b = 32;
-		} else
+		}
+		else
 			*b = 32;
-		if(inetpton_sock(ip, (struct sockaddr *)addr) > 0)
+		if(inetpton_sock(ip, (struct sockaddr *) addr) > 0)
 			return HM_IPV4;
 		else
 			return HM_HOST;
@@ -139,7 +142,7 @@
 {
 	struct sockaddr_in6 *addr = (struct sockaddr_in6 *) saddr;
 	unsigned long v = 0, n;
-	for (n = 0; n < 16; n++)
+	for(n = 0; n < 16; n++)
 	{
 		if(bits >= 8)
 		{
@@ -188,7 +191,7 @@
 {
 	const char *hp = "", *p;
 
-	for (p = text + strlen(text) - 1; p >= text; p--)
+	for(p = text + strlen(text) - 1; p >= text; p--)
 		if(*p == '*' || *p == '?')
 			return hash_text(hp);
 		else if(*p == '.')
@@ -223,17 +226,15 @@
 		if(fam == AF_INET6)
 		{
 
-			for (b = 128; b >= 0; b -= 16)
+			for(b = 128; b >= 0; b -= 16)
 			{
-				for (arec = atable[hash_ipv6(addr, b)]; arec; arec = arec->next)
+				for(arec = atable[hash_ipv6(addr, b)]; arec; arec = arec->next)
 					if(arec->type == (type & ~0x1) &&
 					   arec->masktype == HM_IPV6 &&
-					   comp_with_mask_sock(addr, (struct sockaddr *)&arec->Mask.ipa.addr,
-							       arec->Mask.ipa.bits) && (type & 0x1
-											||
-											match(arec->
-											      username,
-											      username))
+					   comp_with_mask_sock(addr,
+							       (struct sockaddr *) &arec->Mask.ipa.
+							       addr, arec->Mask.ipa.bits)
+					   && (type & 0x1 || match(arec->username, username))
 					   && arec->precedence > hprecv)
 					{
 						hprecv = arec->precedence;
@@ -245,17 +246,15 @@
 #endif
 		if(fam == AF_INET)
 		{
-			for (b = 32; b >= 0; b -= 8)
+			for(b = 32; b >= 0; b -= 8)
 			{
-				for (arec = atable[hash_ipv4(addr, b)]; arec; arec = arec->next)
+				for(arec = atable[hash_ipv4(addr, b)]; arec; arec = arec->next)
 					if(arec->type == (type & ~0x1) &&
 					   arec->masktype == HM_IPV4 &&
-					   comp_with_mask_sock(addr, (struct sockaddr *)&arec->Mask.ipa.addr,
-							       arec->Mask.ipa.bits) && (type & 0x1
-											||
-											match(arec->
-											      username,
-											      username))
+					   comp_with_mask_sock(addr,
+							       (struct sockaddr *) &arec->Mask.ipa.
+							       addr, arec->Mask.ipa.bits)
+					   && (type & 0x1 || match(arec->username, username))
 					   && arec->precedence > hprecv)
 					{
 						hprecv = arec->precedence;
@@ -270,9 +269,9 @@
 		const char *p;
 		/* And yes - we have to check p after strchr and p after increment for
 		 * NULL -kre */
-		for (p = name; p != NULL;)
+		for(p = name; p != NULL;)
 		{
-			for (arec = atable[hash_text(p)]; arec; arec = arec->next)
+			for(arec = atable[hash_text(p)]; arec; arec = arec->next)
 				if((arec->type == (type & ~0x1)) &&
 				   (arec->masktype == HM_HOST) &&
 				   match(arec->Mask.hostname, name) &&
@@ -288,7 +287,7 @@
 			else
 				break;
 		}
-		for (arec = atable[0]; arec; arec = arec->next)
+		for(arec = atable[0]; arec; arec = arec->next)
 			if(arec->type == (type & ~0x1) &&
 			   arec->masktype == HM_HOST &&
 			   match(arec->Mask.hostname, name) &&
@@ -336,7 +335,7 @@
 		if(p)
 		{
 			*p = '\0';
-			kconf = find_conf_by_address(p+1, ip, CONF_KILL, aftype, iconf->name);
+			kconf = find_conf_by_address(p + 1, ip, CONF_KILL, aftype, iconf->name);
 			*p = '@';
 		}
 		else
@@ -390,7 +389,7 @@
 	if(address == NULL)
 		address = "/NOMATCH!/";
 	arec = MyMalloc(sizeof(struct AddressRec));
-	masktype = parse_netmask(address, (struct sockaddr *)&arec->Mask.ipa.addr, &bits);
+	masktype = parse_netmask(address, (struct sockaddr *) &arec->Mask.ipa.addr, &bits);
 	arec->Mask.ipa.bits = bits;
 	arec->masktype = masktype;
 #ifdef IPV6
@@ -398,7 +397,8 @@
 	{
 		/* We have to do this, since we do not re-hash for every bit -A1kmm. */
 		bits -= bits % 16;
-		arec->next = atable[(hv = hash_ipv6((struct sockaddr *)&arec->Mask.ipa.addr, bits))];
+		arec->next =
+			atable[(hv = hash_ipv6((struct sockaddr *) &arec->Mask.ipa.addr, bits))];
 		atable[hv] = arec;
 	}
 	else
@@ -407,7 +407,8 @@
 	{
 		/* We have to do this, since we do not re-hash for every bit -A1kmm. */
 		bits -= bits % 8;
-		arec->next = atable[(hv = hash_ipv4((struct sockaddr *)&arec->Mask.ipa.addr, bits))];
+		arec->next =
+			atable[(hv = hash_ipv4((struct sockaddr *) &arec->Mask.ipa.addr, bits))];
 		atable[hv] = arec;
 	}
 	else
@@ -435,13 +436,13 @@
 	unsigned long hv;
 	struct AddressRec *arec, *arecl = NULL;
 	struct irc_sockaddr_storage addr;
-	masktype = parse_netmask(address, (struct sockaddr *)&addr, &bits);
+	masktype = parse_netmask(address, (struct sockaddr *) &addr, &bits);
 #ifdef IPV6
 	if(masktype == HM_IPV6)
 	{
 		/* We have to do this, since we do not re-hash for every bit -A1kmm. */
 		bits -= bits % 16;
-		hv = hash_ipv6((struct sockaddr *)&addr, bits);
+		hv = hash_ipv6((struct sockaddr *) &addr, bits);
 	}
 	else
 #endif
@@ -449,11 +450,11 @@
 	{
 		/* We have to do this, since we do not re-hash for every bit -A1kmm. */
 		bits -= bits % 8;
-		hv = hash_ipv4((struct sockaddr *)&addr, bits);
+		hv = hash_ipv4((struct sockaddr *) &addr, bits);
 	}
 	else
 		hv = get_mask_hash(address);
-	for (arec = atable[hv]; arec; arec = arec->next)
+	for(arec = atable[hv]; arec; arec = arec->next)
 	{
 		if(arec->aconf == aconf)
 		{
@@ -485,10 +486,10 @@
 	struct AddressRec **store_next;
 	struct AddressRec *arec, *arecn;
 
-	for (i = 0; i < ATABLE_SIZE; i++)
+	for(i = 0; i < ATABLE_SIZE; i++)
 	{
 		store_next = &atable[i];
-		for (arec = atable[i]; arec; arec = arecn)
+		for(arec = atable[i]; arec; arec = arecn)
 		{
 			arecn = arec->next;
 			/* We keep the temporary K-lines and destroy the
@@ -564,8 +565,8 @@
 	struct ConfItem *aconf;
 	int i, port;
 
-	for (i = 0; i < ATABLE_SIZE; i++)
-		for (arec = atable[i]; arec; arec = arec->next)
+	for(i = 0; i < ATABLE_SIZE; i++)
+		for(arec = atable[i]; arec; arec = arec->next)
 			if(arec->type == CONF_CLIENT)
 			{
 				aconf = arec->aconf;
@@ -600,9 +601,9 @@
 	struct ConfItem *aconf = NULL;
 	int i;
 
-	for (i = 0; i < ATABLE_SIZE; i++)
+	for(i = 0; i < ATABLE_SIZE; i++)
 	{
-		for (arec = atable[i]; arec; arec = arec->next)
+		for(arec = atable[i]; arec; arec = arec->next)
 		{
 			if(arec->type == CONF_KILL)
 			{
@@ -612,10 +613,10 @@
 				if(aconf->flags & CONF_FLAGS_TEMPORARY)
 					continue;
 
-				get_printable_kline(source_p, aconf, &host, &pass, &user, &oper_reason);
+				get_printable_kline(source_p, aconf, &host, &pass, &user,
+						    &oper_reason);
 				sendto_one_numeric(source_p, RPL_STATSKLINE,
-						   form_str(RPL_STATSKLINE),
-						   'K', host, user, pass,
+						   form_str(RPL_STATSKLINE), 'K', host, user, pass,
 						   oper_reason ? "|" : "",
 						   oper_reason ? oper_reason : "");
 			}
Index: src/irc_string.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/irc_string.c,v
retrieving revision 7.72.2.2
diff -b -u -r7.72.2.2 irc_string.c
--- src/irc_string.c	4 Aug 2004 03:32:19 -0000	7.72.2.2
+++ src/irc_string.c	19 Aug 2004 22:16:35 -0000
@@ -89,7 +89,7 @@
 
 	len -= 3;		/* allow for worst case, '^A\0' */
 
-	while (*src && (len > 0))
+	while(*src && (len > 0))
 	{
 		if(*src & 0x80)	/* if high bit is set */
 		{
@@ -129,7 +129,7 @@
 	if(dest == NULL || src == NULL)
 		return NULL;
 
-	while (*src && (len > 0))
+	while(*src && (len > 0))
 	{
 		if(*src == '\t')
 		{
@@ -160,7 +160,7 @@
 	if(str)
 		pos = str;	/* new string scan */
 
-	while (pos && *pos && strchr(fs, *pos) != NULL)
+	while(pos && *pos && strchr(fs, *pos) != NULL)
 		++pos;		/* skip leading separators */
 
 	if(!pos || !*pos)
@@ -168,7 +168,7 @@
 
 	tmp = pos;		/* now, keep position of the token */
 
-	while (*pos && strchr(fs, *pos) == NULL)
+	while(*pos && strchr(fs, *pos) == NULL)
 		++pos;		/* skip content of the token */
 
 	if(*pos)
@@ -232,19 +232,19 @@
 	const char *n;
 
 	n = IpQuadTab[*a++];
-	while (*n)
+	while(*n)
 		*bufptr++ = *n++;
 	*bufptr++ = '.';
 	n = IpQuadTab[*a++];
-	while (*n)
+	while(*n)
 		*bufptr++ = *n++;
 	*bufptr++ = '.';
 	n = IpQuadTab[*a++];
-	while (*n)
+	while(*n)
 		*bufptr++ = *n++;
 	*bufptr++ = '.';
 	n = IpQuadTab[*a];
-	while (*n)
+	while(*n)
 		*bufptr++ = *n++;
 	*bufptr = '\0';
 	return buf;
@@ -330,11 +330,11 @@
 	 *      Find the longest run of 0x00's in src[] for :: shorthanding.
 	 */
 	memset(words, '\0', sizeof words);
-	for (i = 0; i < IN6ADDRSZ; i += 2)
+	for(i = 0; i < IN6ADDRSZ; i += 2)
 		words[i / 2] = (src[i] << 8) | src[i + 1];
 	best.base = -1;
 	cur.base = -1;
-	for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++)
+	for(i = 0; i < (IN6ADDRSZ / INT16SZ); i++)
 	{
 		if(words[i] == 0)
 		{
@@ -365,7 +365,7 @@
 	 * Format the result.
 	 */
 	tp = tmp;
-	for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++)
+	for(i = 0; i < (IN6ADDRSZ / INT16SZ); i++)
 	{
 		/* Are we inside the best run of 0x00's? */
 		if(best.base != -1 && i >= best.base && i < (best.base + best.len))
@@ -401,7 +401,7 @@
 	 * Check for overflow, copy, and we're done.
 	 */
 
-	if((unsigned int)(tp - tmp) > size)
+	if((unsigned int) (tp - tmp) > size)
 	{
 		return (NULL);
 	}
@@ -412,19 +412,19 @@
 int
 inetpton_sock(const char *src, struct sockaddr *dst)
 {
-	if(inetpton(AF_INET, src, &((struct sockaddr_in *)dst)->sin_addr))
+	if(inetpton(AF_INET, src, &((struct sockaddr_in *) dst)->sin_addr))
 	{
-		((struct sockaddr_in *)dst)->sin_port = 0;
-		((struct sockaddr_in *)dst)->sin_family = AF_INET;
-		SET_SS_LEN(*((struct irc_sockaddr_storage *)dst), sizeof(struct sockaddr_in));
+		((struct sockaddr_in *) dst)->sin_port = 0;
+		((struct sockaddr_in *) dst)->sin_family = AF_INET;
+		SET_SS_LEN(*((struct irc_sockaddr_storage *) dst), sizeof(struct sockaddr_in));
 		return 1;		
 	} 
 #ifdef IPV6
-	else if(inetpton(AF_INET6, src, &((struct sockaddr_in6 *)dst)->sin6_addr))
+	else if(inetpton(AF_INET6, src, &((struct sockaddr_in6 *) dst)->sin6_addr))
 	{
-		((struct sockaddr_in6 *)dst)->sin6_port = 0;
-		((struct sockaddr_in6 *)dst)->sin6_family = AF_INET6;
-		SET_SS_LEN(*((struct irc_sockaddr_storage *)dst), sizeof(struct sockaddr_in6));
+		((struct sockaddr_in6 *) dst)->sin6_port = 0;
+		((struct sockaddr_in6 *) dst)->sin6_family = AF_INET6;
+		SET_SS_LEN(*((struct irc_sockaddr_storage *) dst), sizeof(struct sockaddr_in6));
 		return 1;
 	}
 #endif
@@ -434,14 +434,14 @@
 const char *
 inetntop_sock(struct sockaddr *src, char *dst, unsigned int size)
 {
-	switch(src->sa_family)
+	switch (src->sa_family)
 	{
 		case AF_INET:
-			return(inetntop(AF_INET, &((struct sockaddr_in *)src)->sin_addr, dst, size));
+		return (inetntop(AF_INET, &((struct sockaddr_in *) src)->sin_addr, dst, size));
 			break;
 #ifdef IPV6	
 		case AF_INET6:
-			return(inetntop(AF_INET6, &((struct sockaddr_in6 *)src)->sin6_addr, dst, size));
+		return (inetntop(AF_INET6, &((struct sockaddr_in6 *) src)->sin6_addr, dst, size));
 			break;
 #endif
 		default:
@@ -449,6 +449,7 @@
 			break;
 	}
 }
+
 /* char *
  * inetntop(af, src, dst, size)
  *	convert a network format address to presentation format.
@@ -520,7 +521,7 @@
 	saw_digit = 0;
 	octets = 0;
 	*(tp = tmp) = 0;
-	while ((ch = *src++) != '\0')
+	while((ch = *src++) != '\0')
 	{
 
 		if(ch >= '0' && ch <= '9')
@@ -589,7 +590,7 @@
 	curtok = src;
 	saw_xdigit = 0;
 	val = 0;
-	while ((ch = tolower(*src++)) != '\0')
+	while((ch = tolower(*src++)) != '\0')
 	{
 		const char *pch;
 
@@ -656,7 +657,7 @@
 
 		if(tp == endp)
 			return (0);
-		for (i = 1; i <= n; i++)
+		for(i = 1; i <= n; i++)
 		{
 			endp[-i] = colonp[n - i];
 			colonp[n - i] = 0;
@@ -738,14 +739,14 @@
 	const char *s = src;
 	size_t n = siz, dlen;
 
-	while (n-- != 0 && *d != '\0')
+	while(n-- != 0 && *d != '\0')
 		d++;
 	dlen = d - dst;
 	n = siz - dlen;
 
 	if(n == 0)
 		return (dlen + strlen(s));
-	while (*s != '\0')
+	while(*s != '\0')
 	{
 		if(n != 1)
 		{
@@ -774,14 +775,14 @@
 			if((*d++ = *s++) == 0)
 				break;
 		}
-		while (--n != 0);
+		while(--n != 0);
 	}
 	/* Not enough room in dst, add NUL and traverse rest of src */
 	if(n == 0)
 	{
 		if(siz != 0)
 			*d = '\0';	/* NUL-terminate dst */
-		while (*s++)
+		while(*s++)
 			;
 	}
 
Index: src/ircd.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/ircd.c,v
retrieving revision 7.343.2.2
diff -b -u -r7.343.2.2 ircd.c
--- src/ircd.c	4 Aug 2004 00:21:17 -0000	7.343.2.2
+++ src/ircd.c	19 Aug 2004 22:16:35 -0000
@@ -165,8 +165,7 @@
 	printf("ircd: version %s\n", ircd_version);
 	printf("ircd: pid %d\n", pid);
 	printf("ircd: running in %s mode from %s\n",
-	       !server_state_foreground ? "background" : "foreground",
-	        ConfigFileEntry.dpath);
+	       !server_state_foreground ? "background" : "foreground", ConfigFileEntry.dpath);
 }
 
 /*
@@ -292,7 +291,7 @@
 {
 	time_t delay;
 #ifndef __vms
-	while (ServerRunning)
+	while(ServerRunning)
 
 	{
 		/* Run pending events, then get the number of seconds to the next
@@ -366,11 +365,9 @@
 	GlobalSetOptions.ident_timeout = IDENT_TIMEOUT;
 
 	strlcpy(GlobalSetOptions.operstring,
-		ConfigFileEntry.default_operstring,
-		sizeof(GlobalSetOptions.operstring));
+		ConfigFileEntry.default_operstring, sizeof(GlobalSetOptions.operstring));
 	strlcpy(GlobalSetOptions.adminstring,
-		ConfigFileEntry.default_adminstring,
-		sizeof(GlobalSetOptions.adminstring));
+		ConfigFileEntry.default_adminstring, sizeof(GlobalSetOptions.adminstring));
 
 	/* memset( &ConfigChannel, 0, sizeof(ConfigChannel)); */
 
@@ -544,7 +541,8 @@
 
 	if(chdir(ConfigFileEntry.dpath))
 	{
-		fprintf(stderr, "Unable to chdir to %s: %s\n", ConfigFileEntry.dpath, strerror(errno));
+		fprintf(stderr, "Unable to chdir to %s: %s\n", ConfigFileEntry.dpath,
+			strerror(errno));
 		exit(EXIT_FAILURE);
 	}
 
@@ -554,7 +552,7 @@
 	server_state_foreground = 1;
 #endif
 
-	if (testing_conf)
+	if(testing_conf)
 		server_state_foreground = 1;
 
 	/* We need this to initialise the fd array before anything else */
@@ -612,7 +610,7 @@
 	init_auth();		/* Initialise the auth code */
 	init_resolver();	/* Needs to be setup before the io loop */
 
-	if (testing_conf)
+	if(testing_conf)
 		fprintf(stderr, "\nBeginning config test\n");
 	read_conf_files(YES);	/* cold start init conf files */
 #ifndef STATIC_MODULES
@@ -650,7 +648,7 @@
 	}
 	strlcpy(me.info, ServerInfo.description, sizeof(me.info));
 
-	if (testing_conf)
+	if(testing_conf)
 	{
 		fprintf(stderr, "\nConfig testing complete.\n");
 		fflush(stderr);
@@ -696,8 +694,7 @@
 	eventAddIsh("comm_checktimeouts", comm_checktimeouts, NULL, 1);
 
 	if(ConfigServerHide.links_delay > 0)
-		eventAddIsh("cache_links", cache_links, NULL,
-			    ConfigServerHide.links_delay);
+		eventAddIsh("cache_links", cache_links, NULL, ConfigServerHide.links_delay);
 	else
 		ConfigServerHide.links_disabled = 1;
 
Index: src/ircd_signal.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/ircd_signal.c,v
retrieving revision 7.22
diff -b -u -r7.22 ircd_signal.c
--- src/ircd_signal.c	10 Sep 2003 17:41:47 -0000	7.22
+++ src/ircd_signal.c	19 Aug 2004 22:16:35 -0000
@@ -48,6 +48,7 @@
 	int status;
 	waitpid(-1, &status, WNOHANG);
 }
+
 /*
  * sigterm_handler - exit the server
  */
@@ -74,8 +75,7 @@
 {
 	free_cachefile(user_motd);
 	user_motd = cache_file(MPATH, "ircd.motd", 0);
-	sendto_realops_flags(UMODE_ALL, L_ALL,
-		"Got signal SIGUSR1, reloading ircd motd file");
+	sendto_realops_flags(UMODE_ALL, L_ALL, "Got signal SIGUSR1, reloading ircd motd file");
 }
 #endif
 
Index: src/kdparse.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/kdparse.c,v
retrieving revision 7.35
diff -b -u -r7.35 kdparse.c
--- src/kdparse.c	6 May 2004 22:23:59 -0000	7.35
+++ src/kdparse.c	19 Aug 2004 22:16:36 -0000
@@ -43,8 +43,7 @@
  */
 static void
 conf_add_fields(struct ConfItem *aconf,	const char *host_field,
-		const char *pass_field,	const char *user_field,
-		const char *operreason_field)
+		const char *pass_field, const char *user_field, const char *operreason_field)
 {
 	if(host_field != NULL)
 		DupString(aconf->host, host_field);
@@ -74,7 +73,7 @@
 	char line[BUFSIZE];
 	char *p;
 
-	while (fbgets(line, sizeof(line), file))
+	while(fbgets(line, sizeof(line), file))
 	{
 		if((p = strchr(line, '\n')) != NULL)
 			*p = '\0';
@@ -98,8 +97,7 @@
 
 		aconf = make_conf();
 		aconf->status = CONF_KILL;
-		conf_add_fields(aconf, host_field, reason_field,
-				user_field, operreason_field);
+		conf_add_fields(aconf, host_field, reason_field, user_field, operreason_field);
 
 		if(aconf->host != NULL)
 			add_conf_by_address(aconf->host, CONF_KILL, aconf->user, aconf);
@@ -123,7 +121,7 @@
 	char line[BUFSIZE];
 	char *p;
 
-	while (fbgets(line, sizeof(line), file))
+	while(fbgets(line, sizeof(line), file))
 	{
 		if((p = strchr(line, '\n')))
 			*p = '\0';
@@ -157,7 +155,7 @@
 	char line[BUFSIZE];
 	char *p;
 
-	while (fbgets(line, sizeof(line), file))
+	while(fbgets(line, sizeof(line), file))
 	{
 		if((p = strchr(line, '\n')))
 			*p = '\0';
@@ -177,8 +175,7 @@
 			continue;
 
 		/* sanity checking */
-		if((find_xline(gecos_field, 0) != NULL) ||
-		   (strchr(reason_field, ':') != NULL))
+		if((find_xline(gecos_field, 0) != NULL) || (strchr(reason_field, ':') != NULL))
 			continue;
 
 		aconf = make_conf();
@@ -200,7 +197,7 @@
 	char line[BUFSIZE];
 	char *p;
 
-	while (fbgets(line, sizeof(line), file))
+	while(fbgets(line, sizeof(line), file))
 	{
 		if((p = strchr(line, '\n')))
 			*p = '\0';
Index: src/kqueue.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/kqueue.c,v
retrieving revision 1.45
diff -b -u -r1.45 kqueue.c
--- src/kqueue.c	15 Mar 2004 17:58:08 -0000	1.45
+++ src/kqueue.c	19 Aug 2004 22:16:36 -0000
@@ -125,7 +125,8 @@
 			/* jdc -- someone needs to do error checking... */
 			if(ret == -1)
 			{
-				ilog(L_IOERROR, "kq_update_events(): kevent(): %s", strerror(errno));
+				ilog(L_IOERROR, "kq_update_events(): kevent(): %s",
+				     strerror(errno));
 				return;
 			}
 			kqoff = 0;
@@ -229,7 +230,7 @@
 		 */
 		poll_time.tv_sec = 0;
 		poll_time.tv_nsec = delay * 1000000;
-		for (;;)
+		for(;;)
 		{
 			num = kevent(kq, kqlst, kqoff, ke, KE_LENGTH, &poll_time);
 			kqoff = 0;
@@ -246,7 +247,7 @@
 		if(num == 0)
 			continue;
 
-		for (i = 0; i < num; i++)
+		for(i = 0; i < num; i++)
 		{
 			PF *hdl = NULL;
 			fde_t *F = ke[i].udata;
@@ -279,8 +280,7 @@
 		}
 		return COMM_OK;
 	}
-	while (0);		/* XXX should rip this out! -- adrian */
+	while(0);		/* XXX should rip this out! -- adrian */
 	/* XXX Get here, we broke! */
 	return 0;
 }
-
Index: src/linebuf.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/linebuf.c,v
retrieving revision 7.126
diff -b -u -r7.126 linebuf.c
--- src/linebuf.c	15 Mar 2004 17:58:08 -0000	7.126
+++ src/linebuf.c	19 Aug 2004 22:16:36 -0000
@@ -158,7 +158,7 @@
 	int orig_len = len;
 
 	/* First, skip until the first non-CRLF */
-	for (; len; len--, ch++)
+	for(; len; len--, ch++)
 	{
 		if(*ch == '\r')
 			break;
@@ -167,7 +167,7 @@
 	}
 
 	/* Then, skip until the last CRLF */
-	for (; len; len--, ch++)
+	for(; len; len--, ch++)
 	{
 		if((*ch != '\r') && (*ch != '\n'))
 			break;
@@ -217,7 +217,7 @@
 void
 linebuf_donebuf(buf_head_t * bufhead)
 {
-	while (bufhead->list.head != NULL)
+	while(bufhead->list.head != NULL)
 	{
 		linebuf_done_line(bufhead,
 				  (buf_line_t *) bufhead->list.head->data, bufhead->list.head);
@@ -270,7 +270,7 @@
 		memcpy(bufch, ch, (BUF_DATA_SIZE - bufline->len - 1));
 		bufline->buf[BUF_DATA_SIZE - 1] = '\0';
 		bufch = bufline->buf + BUF_DATA_SIZE - 2;
-		while (cpylen && (*bufch == '\r' || *bufch == '\n'))
+		while(cpylen && (*bufch == '\r' || *bufch == '\n'))
 		{
 			*bufch = '\0';
 			cpylen--;
@@ -297,7 +297,7 @@
 	}
 
 	/* Yank the CRLF off this, replace with a \0 */
-	while (cpylen && (*bufch == '\r' || *bufch == '\n'))
+	while(cpylen && (*bufch == '\r' || *bufch == '\n'))
 	{
 		*bufch = '\0';
 		cpylen--;
@@ -421,7 +421,7 @@
 	}
 
 	/* Next, the loop */
-	while (len > 0)
+	while(len > 0)
 	{
 		/* We obviously need a new buffer, so .. */
 		bufline = linebuf_new_line(bufhead);
@@ -480,14 +480,14 @@
 	if(bufline->raw && !raw)
 	{
 		/* skip leading EOL characters */
-		while (cpylen && (*start == '\r' || *start == '\n'))
+		while(cpylen && (*start == '\r' || *start == '\n'))
 		{
 			start++;
 			cpylen--;
 		}
 		/* skip trailing EOL characters */
 		ch = &start[cpylen - 1];
-		while (cpylen && (*ch == '\r' || *ch == '\n'))
+		while(cpylen && (*ch == '\r' || *ch == '\n'))
 		{
 			ch--;
 			cpylen--;
@@ -591,7 +591,7 @@
 	else
 	{
 		/* Chop trailing CRLF's .. */
-		while ((bufline->buf[len] == '\r')
+		while((bufline->buf[len] == '\r')
 		       || (bufline->buf[len] == '\n') || (bufline->buf[len] == '\0'))
 		{
 			len--;
Index: src/listener.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/listener.c,v
retrieving revision 7.110.2.1
diff -b -u -r7.110.2.1 listener.c
--- src/listener.c	3 Aug 2004 20:39:51 -0000	7.110.2.1
+++ src/listener.c	19 Aug 2004 22:16:36 -0000
@@ -47,8 +47,7 @@
 #endif
 
 #ifdef NO_IN6ADDR_ANY
-const static struct in6_addr in6addr_any =
-{ { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } };
+const static struct in6_addr in6addr_any = { {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} };
 #endif 
 
 static PF accept_connection;
@@ -82,7 +81,7 @@
 	else
 	{
 		struct Listener *prev = ListenerPollList;
-		for (; prev; prev = prev->next)
+		for(; prev; prev = prev->next)
 		{
 			if(listener == prev->next)
 			{
@@ -114,10 +113,10 @@
 
 #ifdef IPV6
 	if(listener->addr.ss_family == AF_INET6)
-		port = ntohs(((struct sockaddr_in6 *)&listener->addr)->sin6_port);
+		port = ntohs(((struct sockaddr_in6 *) &listener->addr)->sin6_port);
 	else
 #endif
-		port = ntohs(((struct sockaddr_in *)&listener->addr)->sin_port);	
+		port = ntohs(((struct sockaddr_in *) &listener->addr)->sin_port);
 
 	ircsnprintf(buf, sizeof(buf), "%s[%s/%u]", me.name, listener->name, port);
 	return buf;
@@ -134,15 +133,16 @@
 {
 	struct Listener *listener = 0;
 
-	for (listener = ListenerPollList; listener; listener = listener->next)
+	for(listener = ListenerPollList; listener; listener = listener->next)
 	{
-		sendto_one_numeric(source_p, RPL_STATSPLINE, 
-				   form_str(RPL_STATSPLINE), 'P',
+		sendto_one_numeric(source_p, RPL_STATSPLINE, form_str(RPL_STATSPLINE), 'P',
 #ifdef IPV6
-			   ntohs(listener->addr.ss_family == AF_INET ? ((struct sockaddr_in *)&listener->addr)->sin_port :
-			   	 ((struct sockaddr_in6 *)&listener->addr)->sin6_port),
+				   ntohs(listener->addr.ss_family ==
+					 AF_INET ? ((struct sockaddr_in *) &listener->addr)->
+					 sin_port : ((struct sockaddr_in6 *) &listener->addr)->
+					 sin6_port),
 #else
-			   ntohs(((struct sockaddr_in *)&listener->addr)->sin_port),
+				   ntohs(((struct sockaddr_in *) &listener->addr)->sin_port),
 #endif
 			   IsOperAdmin(source_p) ? listener->name : me.name,
 			   listener->ref_count, (listener->active) ? "active" : "disabled");
@@ -177,16 +177,18 @@
 #ifdef IPV6
 	if(listener->addr.ss_family == AF_INET6)
 	{
-		struct sockaddr_in6 *in6 = (struct sockaddr_in6 *)&listener->addr;
+		struct sockaddr_in6 *in6 = (struct sockaddr_in6 *) &listener->addr;
 		if(!IN6_ARE_ADDR_EQUAL(&in6->sin6_addr, &in6addr_any))
 		{
-			inetntop(AF_INET6, &in6->sin6_addr, listener->vhost, sizeof(listener->vhost));
+			inetntop(AF_INET6, &in6->sin6_addr, listener->vhost,
+				 sizeof(listener->vhost));
 			listener->name = listener->vhost;
 		}
-	} else
+	}
+	else
 #endif
 	{
-		struct sockaddr_in *in = (struct sockaddr_in *)&listener->addr;
+		struct sockaddr_in *in = (struct sockaddr_in *) &listener->addr;
 		if(in->sin_addr.s_addr != INADDR_ANY)
 		{
 			inetntop(AF_INET, &in->sin_addr, listener->vhost, sizeof(listener->vhost));
@@ -198,15 +200,13 @@
 	if(fd == -1)
 	{
 		report_error("opening listener socket %s:%s",
-			     get_listener_name(listener), 
-			     get_listener_name(listener), errno);
+			     get_listener_name(listener), get_listener_name(listener), errno);
 		return 0;
 	}
 	else if((HARD_FDLIMIT - 10) < fd)
 	{
 		report_error("no more connections left for listener %s:%s",
-			     get_listener_name(listener), 
-			     get_listener_name(listener), errno);
+			     get_listener_name(listener), get_listener_name(listener), errno);
 		fd_close(fd);
 		return 0;
 	}
@@ -217,8 +217,7 @@
 	if(setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *) &opt, sizeof(opt)))
 	{
 		report_error("setting SO_REUSEADDR for listener %s:%s",
-			     get_listener_name(listener), 
-			     get_listener_name(listener), errno);
+			     get_listener_name(listener), get_listener_name(listener), errno);
 		fd_close(fd);
 		return 0;
 	}
@@ -231,8 +230,7 @@
 	if(bind(fd, (struct sockaddr *) &listener->addr, GET_SS_LEN(listener->addr)))
 	{
 		report_error("binding listener socket %s:%s",
-			     get_listener_name(listener), 
-			     get_listener_name(listener), errno);
+			     get_listener_name(listener), get_listener_name(listener), errno);
 		fd_close(fd);
 		return 0;
 	}
@@ -240,16 +238,14 @@
 	if(listen(fd, RATBOX_SOMAXCONN))
 	{
 		report_error("listen failed for %s:%s", 
-			     get_listener_name(listener), 
-			     get_listener_name(listener), errno);
+			     get_listener_name(listener), get_listener_name(listener), errno);
 		fd_close(fd);
 		return 0;
 	}
 
 	if(!comm_set_nb(fd))
 		report_error(NONB_ERROR_MSG, 
-			     get_listener_name(listener), 
-			     get_listener_name(listener), errno);
+			     get_listener_name(listener), get_listener_name(listener), errno);
 
 	listener->fd = fd;
 
@@ -265,39 +261,39 @@
 	struct Listener *listener = NULL;
 	struct Listener *last_closed = NULL;
 
-	for (listener = ListenerPollList; listener; listener = listener->next)
+	for(listener = ListenerPollList; listener; listener = listener->next)
 	{
 		if(addr->ss_family != listener->addr.ss_family)
 			continue;
 		
-		switch(addr->ss_family)
+		switch (addr->ss_family)
 		{
 			case AF_INET:
 			{
-				struct sockaddr_in *in4 = (struct sockaddr_in *)addr;
-				struct sockaddr_in *lin4 = (struct sockaddr_in *)&listener->addr;
+				struct sockaddr_in *in4 = (struct sockaddr_in *) addr;
+				struct sockaddr_in *lin4 = (struct sockaddr_in *) &listener->addr;
 				if(in4->sin_addr.s_addr == lin4->sin_addr.s_addr && 
-					in4->sin_port == lin4->sin_port )
+				   in4->sin_port == lin4->sin_port)
 				{
 					if(listener->fd == -1)
 						last_closed = listener;
 					else
-						return(listener);
+						return (listener);
 				}
 				break;
 			}
 #ifdef IPV6
 			case AF_INET6:
 			{
-				struct sockaddr_in6 *in6 = (struct sockaddr_in6 *)addr;
-				struct sockaddr_in6 *lin6 =(struct sockaddr_in6 *)&listener->addr;
+				struct sockaddr_in6 *in6 = (struct sockaddr_in6 *) addr;
+				struct sockaddr_in6 *lin6 = (struct sockaddr_in6 *) &listener->addr;
 				if(IN6_ARE_ADDR_EQUAL(&in6->sin6_addr, &lin6->sin6_addr) &&
 				  in6->sin6_port == lin6->sin6_port)
 				{
 					if(listener->fd == -1)
 						last_closed = listener;
 					else
-						return(listener);
+						return (listener);
 				}
 				break;
 				
@@ -336,43 +332,47 @@
 	{
 		if(family == AF_INET)
 		{
-			if(inetpton(family, vhost_ip, &((struct sockaddr_in *)&vaddr)->sin_addr) <= 0)
+			if(inetpton(family, vhost_ip, &((struct sockaddr_in *) &vaddr)->sin_addr) <=
+			   0)
 				return;
 		} 
 #ifdef IPV6
 		else
 		{
-			if(inetpton(family, vhost_ip, &((struct sockaddr_in6 *)&vaddr)->sin6_addr) <= 0)
+			if(inetpton(family, vhost_ip, &((struct sockaddr_in6 *) &vaddr)->sin6_addr)
+			   <= 0)
 				return;
 		
 		}
 #endif
-	} else
+	}
+	else
 	{
-		switch(family)
+		switch (family)
 		{
 			case AF_INET:
-				((struct sockaddr_in *)&vaddr)->sin_addr.s_addr = INADDR_ANY;
+			((struct sockaddr_in *) &vaddr)->sin_addr.s_addr = INADDR_ANY;
 				break;
 #ifdef IPV6
 			case AF_INET6:
-				memcpy(&((struct sockaddr_in6 *)&vaddr)->sin6_addr, &in6addr_any, sizeof(struct in6_addr));
+			memcpy(&((struct sockaddr_in6 *) &vaddr)->sin6_addr, &in6addr_any,
+			       sizeof(struct in6_addr));
 				break;
 			default:
 				return;
 #endif
 		} 
 	}
-	switch(family)
+	switch (family)
 	{
 		case AF_INET:
 			SET_SS_LEN(vaddr, sizeof(struct sockaddr_in));
-			((struct sockaddr_in *)&vaddr)->sin_port = htons(port);
+		((struct sockaddr_in *) &vaddr)->sin_port = htons(port);
 			break;
 #ifdef IPV6
 		case AF_INET6:
 			SET_SS_LEN(vaddr, sizeof(struct sockaddr_in6));
-			((struct sockaddr_in6 *)&vaddr)->sin6_port = htons(port);
+		((struct sockaddr_in6 *) &vaddr)->sin6_port = htons(port);
 			break;
 #endif
 		default:
@@ -432,7 +432,7 @@
 	/*
 	 * close all 'extra' listening ports we have
 	 */
-	for (listener = ListenerPollList; listener; listener = listener_next)
+	for(listener = ListenerPollList; listener; listener = listener_next)
 	{
 		listener_next = listener->next;
 		close_listener(listener);
@@ -465,14 +465,15 @@
 	 * copy address to 'sockhost' as a string, copy it to host too
 	 * so we have something valid to put into error messages...
 	 */
-	inetntop_sock((struct sockaddr *)&new_client->localClient->ip, new_client->sockhost, 
+	inetntop_sock((struct sockaddr *) &new_client->localClient->ip, new_client->sockhost,
 		sizeof(new_client->sockhost));
 
 
 	strlcpy(new_client->host, new_client->sockhost, sizeof(new_client->host));
 
 #ifdef IPV6
-	if(new_client->localClient->ip.ss_family == AF_INET6 && ConfigFileEntry.dot_in_ip6_addr == 1)
+	if(new_client->localClient->ip.ss_family == AF_INET6
+	   && ConfigFileEntry.dot_in_ip6_addr == 1)
 	{
 		strlcat(new_client->host, ".", sizeof(new_client->host));
 	}
@@ -517,10 +518,10 @@
 	 * be accepted until some old is closed first.
 	 */
 
-	fd = comm_accept(listener->fd, (struct sockaddr *)&sai);
+	fd = comm_accept(listener->fd, (struct sockaddr *) &sai);
 
 	/* This needs to be done here, otherwise we break dlines */
-	mangle_mapped_sockaddr((struct sockaddr *)&sai);
+	mangle_mapped_sockaddr((struct sockaddr *) &sai);
 
 	if(fd < 0)
 	{
@@ -556,7 +557,7 @@
 
 	/* Do an initial check we aren't connecting too fast or with too many
 	 * from this IP... */
-	if((pe = conf_connect_allowed((struct sockaddr *)&sai, sai.ss_family)) != 0)
+	if((pe = conf_connect_allowed((struct sockaddr *) &sai, sai.ss_family)) != 0)
 	{
 		ServerStats->is_ref++;
 
@@ -570,7 +571,7 @@
 	}
 
 	ServerStats->is_ac++;
-	add_connection(listener, fd, (struct sockaddr *)&sai);
+	add_connection(listener, fd, (struct sockaddr *) &sai);
 
 	/* Re-register a new IO request for the next accept .. */
 	comm_setselect(listener->fd, FDLIST_SERVICE, COMM_SELECT_READ,
Index: src/match.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/match.c,v
retrieving revision 7.41.2.1
diff -b -u -r7.41.2.1 match.c
--- src/match.c	3 Aug 2004 20:39:51 -0000	7.41.2.1
+++ src/match.c	19 Aug 2004 22:16:37 -0000
@@ -55,10 +55,10 @@
 		return 0;
 
 	/* if the mask is "*", it matches everything */
-	if((*m == '*') && (*(m+1) == '\0'))
+	if((*m == '*') && (*(m + 1) == '\0'))
 		return 1;
 
-	while (calls++ < MATCH_MAX_CALLS)
+	while(calls++ < MATCH_MAX_CALLS)
 	{
 		if(*m == '*')
 		{
@@ -66,7 +66,7 @@
 			 * XXX - shouldn't need to spin here, the mask should have been
 			 * collapsed before match is called
 			 */
-			while (*m == '*')
+			while(*m == '*')
 				m++;
 			wild = 1;
 			ma = m;
@@ -77,7 +77,7 @@
 		{
 			if(!*n)
 				return 1;
-			for (m--; (m > (const unsigned char *) mask) && (*m == '?'); m--)
+			for(m--; (m > (const unsigned char *) mask) && (*m == '?'); m--)
 				;
 			if(*m == '*' && (m > (const unsigned char *) mask))
 				return 1;
@@ -92,7 +92,7 @@
 			 * XXX - shouldn't need to spin here, the mask should have been
 			 * collapsed before match is called
 			 */
-			while (*m == '*')
+			while(*m == '*')
 				m++;
 			return (*m == 0);
 		}
@@ -137,10 +137,10 @@
 		return 0;
 
 	/* if the mask is "*", it matches everything */
-	if((*m == '*') && (*(m+1) == '\0'))
+	if((*m == '*') && (*(m + 1) == '\0'))
 		return 1;
 
-	while (calls++ < MATCH_MAX_CALLS)
+	while(calls++ < MATCH_MAX_CALLS)
 	{
 		if(quote)
 			quote++;
@@ -158,7 +158,7 @@
 			 * XXX - shouldn't need to spin here, the mask should have been
 			 * collapsed before match is called
 			 */
-			while (*m == '*')
+			while(*m == '*')
 				m++;
 			if(*m == '\\')
 			{
@@ -179,8 +179,8 @@
 				return 1;
 			if(quote)
 				return 0;
-			for (m--; (m > (const unsigned char *) mask) && 
-					(*m == '?' || *m == '#' || *m == '@' ); m--)
+			for(m--; (m > (const unsigned char *) mask) &&
+			    (*m == '?' || *m == '#' || *m == '@'); m--)
 				;
 			if(*m == '*' && (m > (const unsigned char *) mask))
 				return 1;
@@ -197,13 +197,12 @@
 			 */
 			if(quote)
 				return 0;
-			while (*m == '*')
+			while(*m == '*')
 				m++;
 			return (*m == 0);
 		}
 		if(ToLower(*m) != ToLower(*n) && !(!quote && *m == '?') &&
-			!(!quote && *m == '@' && IsLetter(*n)) &&
-			!(!quote && *m == '#' && IsDigit(*n)))
+		   !(!quote && *m == '@' && IsLetter(*n)) && !(!quote && *m == '#' && IsDigit(*n)))
 		{
 			if(!wild)
 				return 0;
@@ -244,19 +243,19 @@
 	
 	if(addr->sa_family == AF_INET)
 	{
-		iaddr = &((struct sockaddr_in *)addr)->sin_addr;
-		idest = &((struct sockaddr_in *)dest)->sin_addr;
+		iaddr = &((struct sockaddr_in *) addr)->sin_addr;
+		idest = &((struct sockaddr_in *) dest)->sin_addr;
 	} 
 #ifdef IPV6
 	else
 	{
-		iaddr = &((struct sockaddr_in6 *)addr)->sin6_addr;
-		idest = &((struct sockaddr_in6 *)dest)->sin6_addr;
+		iaddr = &((struct sockaddr_in6 *) addr)->sin6_addr;
+		idest = &((struct sockaddr_in6 *) dest)->sin6_addr;
 	
 	} 
 #endif
 
-	return(comp_with_mask(iaddr, idest, mask));
+	return (comp_with_mask(iaddr, idest, mask));
 }
 
 
@@ -308,16 +307,16 @@
 	if(strchr(ip, ':') && strchr(ipmask, ':'))
 	{
 		aftype = AF_INET6;
-		ipptr = &((struct sockaddr_in6 *)&ipaddr)->sin6_addr;
-		maskptr = &((struct sockaddr_in6 *)&maskaddr)->sin6_addr;
+		ipptr = &((struct sockaddr_in6 *) &ipaddr)->sin6_addr;
+		maskptr = &((struct sockaddr_in6 *) &maskaddr)->sin6_addr;
 	}
 	else
 #endif
 	if(!strchr(ip, ':') && !strchr(ipmask, ':'))
 	{
 		aftype = AF_INET;
-		ipptr = &((struct sockaddr_in *)&ipaddr)->sin_addr;
-		maskptr = &((struct sockaddr_in *)&maskaddr)->sin_addr;
+		ipptr = &((struct sockaddr_in *) &ipaddr)->sin_addr;
+		maskptr = &((struct sockaddr_in *) &maskaddr)->sin_addr;
 	}
 	else
 		return 0;
@@ -344,7 +343,7 @@
 	if(p == NULL)
 		return NULL;
 
-	while ((c = *p++))
+	while((c = *p++))
 	{
 		if(c == '*')
 		{
@@ -377,7 +376,7 @@
 	if(p == NULL)
 		return NULL;
 
-	while ((c = *p++))
+	while((c = *p++))
 	{
 		if(!(f & 2) && c == '*')
 		{
@@ -417,7 +416,7 @@
 	s_assert(s1 != NULL);
 	s_assert(s2 != NULL);
 
-	while ((res = ToUpper(*str1) - ToUpper(*str2)) == 0)
+	while((res = ToUpper(*str1) - ToUpper(*str2)) == 0)
 	{
 		if(*str1 == '\0')
 			return 0;
@@ -436,7 +435,7 @@
 	s_assert(s1 != NULL);
 	s_assert(s2 != NULL);
 
-	while ((res = ToUpper(*str1) - ToUpper(*str2)) == 0)
+	while((res = ToUpper(*str1) - ToUpper(*str2)) == 0)
 	{
 		str1++;
 		str2++;
Index: src/modules.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/modules.c,v
retrieving revision 7.143
diff -b -u -r7.143 modules.c
--- src/modules.c	22 Mar 2004 22:59:59 -0000	7.143
+++ src/modules.c	19 Aug 2004 22:16:38 -0000
@@ -221,7 +221,7 @@
 {
 	int i;
 
-	for (i = 0; i < num_mods; i++)
+	for(i = 0; i < num_mods; i++)
 	{
 		if(!irccmp(modlist[i]->name, name))
 			return i;
@@ -257,12 +257,13 @@
 		return;
 	}
 
-	while ((ldirent = readdir(system_module_dir)) != NULL)
+	while((ldirent = readdir(system_module_dir)) != NULL)
 	{
         	len = strlen(ldirent->d_name);
-		if((len > 3) && !strcmp(ldirent->d_name+len-3, SHARED_SUFFIX))
+		if((len > 3) && !strcmp(ldirent->d_name + len - 3, SHARED_SUFFIX))
                 {
-		 	(void) ircsnprintf(module_fq_name, sizeof(module_fq_name), "%s/%s", AUTOMODPATH, ldirent->d_name);
+			(void) ircsnprintf(module_fq_name, sizeof(module_fq_name), "%s/%s",
+					   AUTOMODPATH, ldirent->d_name);
 		 	(void) load_a_module(module_fq_name, warn, 0);
                 }
 
@@ -283,7 +284,7 @@
 	int i;
 
 
-	for (i = 0; core_module_table[i]; i++)
+	for(i = 0; core_module_table[i]; i++)
 	{
 		ircsnprintf(module_name, sizeof(module_name), "%s/%s%s", MODPATH,
 			    core_module_table[i], SHARED_SUFFIX);
@@ -349,8 +350,7 @@
 
 	if(!IsOperAdmin(source_p))
 	{
-		sendto_one(source_p, form_str(ERR_NOPRIVS),
-			   me.name, source_p->name, "admin");
+		sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "admin");
 		return 0;
 	}
 
@@ -382,8 +382,7 @@
 
 	if(!IsOperAdmin(source_p))
 	{
-		sendto_one(source_p, form_str(ERR_NOPRIVS),
-			   me.name, source_p->name, "admin");
+		sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "admin");
 		return 0;
 	}
 
@@ -425,8 +424,7 @@
 
 	if(!IsOperAdmin(source_p))
 	{
-		sendto_one(source_p, form_str(ERR_NOPRIVS),
-			   me.name, source_p->name, "admin");
+		sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "admin");
 		return 0;
 	}
 
@@ -470,12 +468,11 @@
 
 	if(!IsOperAdmin(source_p))
 	{
-		sendto_one(source_p, form_str(ERR_NOPRIVS),
-			   me.name, source_p->name, "admin");
+		sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "admin");
 		return 0;
 	}
 
-	for (i = 0; i < num_mods; i++)
+	for(i = 0; i < num_mods; i++)
 	{
 		if(parc > 1)
 		{
@@ -509,15 +506,14 @@
 
 	if(!IsOperAdmin(source_p))
 	{
-		sendto_one(source_p, form_str(ERR_NOPRIVS),
-			   me.name, source_p->name, "admin");
+		sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "admin");
 		return 0;
 	}
 
 	sendto_one(source_p, ":%s NOTICE %s :Reloading all modules", me.name, parv[0]);
 
 	modnum = num_mods;
-	while (num_mods)
+	while(num_mods)
 		unload_one_module(modlist[0]->name, 0);
 
 	load_all_modules(0);
@@ -723,21 +719,21 @@
 			if(mheader->mapi_command_list)
 			{
 				struct Message **m;
-				for (m = mheader->mapi_command_list; *m; ++m)
+				for(m = mheader->mapi_command_list; *m; ++m)
 					mod_del_cmd(*m);
 			}
 
 			if(mheader->mapi_hook_list)
 			{
 				mapi_hlist_av1 *m;
-				for (m = mheader->mapi_hook_list; m->hapi_name; ++m)
+				for(m = mheader->mapi_hook_list; m->hapi_name; ++m)
 					hook_del_event(m->hapi_name);
 			}
 
 			if(mheader->mapi_hfn_list)
 			{
 				mapi_hfn_list_av1 *m;
-				for (m = mheader->mapi_hfn_list; m->hapi_name; ++m)
+				for(m = mheader->mapi_hfn_list; m->hapi_name; ++m)
 					hook_del_hook(m->hapi_name, m->fn);
 			}
 
@@ -845,21 +841,21 @@
 			if(mheader->mapi_command_list)
 			{
 				struct Message **m;
-				for (m = mheader->mapi_command_list; *m; ++m)
+				for(m = mheader->mapi_command_list; *m; ++m)
 					mod_add_cmd(*m);
 			}
 
 			if(mheader->mapi_hook_list)
 			{
 				mapi_hlist_av1 *m;
-				for (m = mheader->mapi_hook_list; m->hapi_name; ++m)
+				for(m = mheader->mapi_hook_list; m->hapi_name; ++m)
 					hook_add_event(m->hapi_name, m->hapi_id);
 			}
 
 			if(mheader->mapi_hfn_list)
 			{
 				mapi_hfn_list_av1 *m;
-				for (m = mheader->mapi_hfn_list; m->hapi_name; ++m)
+				for(m = mheader->mapi_hfn_list; m->hapi_name; ++m)
 					hook_add_hook(m->hapi_name, m->fn);
 			}
 
Index: src/newconf.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/newconf.c,v
retrieving revision 7.156.2.1
diff -b -u -r7.156.2.1 newconf.c
--- src/newconf.c	3 Aug 2004 20:39:51 -0000	7.156.2.1
+++ src/newconf.c	19 Aug 2004 22:16:39 -0000
@@ -188,11 +188,9 @@
 
 	if(ServerInfo.sid[0] == '\0')
 	{
-		if(!IsDigit(sid[0]) || !IsIdChar(sid[1]) ||
-		   !IsIdChar(sid[2]) || sid[3] != '\0')
+		if(!IsDigit(sid[0]) || !IsIdChar(sid[1]) || !IsIdChar(sid[2]) || sid[3] != '\0')
 		{
-			conf_report_error("Ignoring serverinfo::sid "
-					  "-- bogus sid.");
+			conf_report_error("Ignoring serverinfo::sid " "-- bogus sid.");
 			return;
 		}
 
@@ -357,8 +355,7 @@
 static void
 conf_set_log_fname_killlog(void *data)
 {
-	strlcpy(ConfigFileEntry.fname_killlog, data,
-		sizeof(ConfigFileEntry.fname_klinelog));
+	strlcpy(ConfigFileEntry.fname_killlog, data, sizeof(ConfigFileEntry.fname_klinelog));
 }
 
 static void
@@ -376,15 +373,13 @@
 static void
 conf_set_log_fname_operspylog(void *data)
 {
-	strlcpy(ConfigFileEntry.fname_operspylog, data,
-		sizeof(ConfigFileEntry.fname_operspylog));
+	strlcpy(ConfigFileEntry.fname_operspylog, data, sizeof(ConfigFileEntry.fname_operspylog));
 }
 
 static void
 conf_set_log_fname_ioerrorlog(void *data)
 {
-	strlcpy(ConfigFileEntry.fname_ioerrorlog, data,
-		sizeof(ConfigFileEntry.fname_ioerrorlog));
+	strlcpy(ConfigFileEntry.fname_ioerrorlog, data, sizeof(ConfigFileEntry.fname_ioerrorlog));
 }
 
 struct mode_table
@@ -486,7 +481,7 @@
 {
 	int i;
 
-	for (i = 0; tab[i].name; i++)
+	for(i = 0; tab[i].name; i++)
 	{
 		if(strcmp(tab[i].name, name) == 0)
 			return tab[i].mode;
@@ -498,7 +493,7 @@
 static void
 set_modes_from_table(int *modes, const char *whatis, struct mode_table *tab, conf_parm_t * args)
 {
-	for (; args; args = args->next)
+	for(; args; args = args->next)
 	{
 		int mode;
 
@@ -828,7 +823,7 @@
 conf_set_listen_port(void *data)
 {
 	conf_parm_t *args = data;
-	for (; args; args = args->next)
+	for(; args; args = args->next)
 	{
 		if((args->type & CF_MTYPE) != CF_INT)
 		{
@@ -842,7 +837,8 @@
 #ifdef IPV6
 			add_listener(args->v.number, listener_address, AF_INET6);
 #endif
-                } else
+		}
+		else
                 {
 			int family;
 #ifdef IPV6
@@ -1005,7 +1001,7 @@
 	{
 		*p = '\0';
 		user = data;
-		host = p+1;
+		host = p + 1;
 
 		if(EmptyString(user))
 		{
@@ -1125,15 +1121,13 @@
 
 	if(!IsChannelName(name))
 	{
-		conf_report_error("Ignoring channel resv %s -- invalid channel name.",
-					name);
+		conf_report_error("Ignoring channel resv %s -- invalid channel name.", name);
 		return;
 	}
 
 	if(hash_find_resv(name))
 	{
-		conf_report_error("Ignoring channel resv %s -- already resvd.",
-					name);
+		conf_report_error("Ignoring channel resv %s -- already resvd.", name);
 		return;
 	}
 
@@ -1155,15 +1149,13 @@
 
 	if(!clean_resv_nick(name))
 	{
-		conf_report_error("Ignoring nick resv %s -- invalid nick.",
-					name);
+		conf_report_error("Ignoring nick resv %s -- invalid nick.", name);
 		return;
 	}
 	
 	if(find_nick_resv(name))
 	{
-		conf_report_error("Ignoring nick resv %s -- already resvd.",
-					name);
+		conf_report_error("Ignoring nick resv %s -- already resvd.", name);
 		return;
 	}
 
@@ -1305,10 +1297,9 @@
 static void
 conf_set_connect_vhost(void *data)
 {
-	if(inetpton_sock(data, (struct sockaddr *)&yy_server->my_ipnum) <= 0)
+	if(inetpton_sock(data, (struct sockaddr *) &yy_server->my_ipnum) <= 0)
 	{
-		conf_report_error("Invalid netmask for server vhost (%s)",
-		    		  (char *) data);
+		conf_report_error("Invalid netmask for server vhost (%s)", (char *) data);
 		return;
 	}
 
@@ -1589,8 +1580,7 @@
 
 	if(find_xline(yy_aconf->name, 0) != NULL)
 	{
-		conf_report_error("Ignoring gecos block %s -- already xlined.",
-					yy_aconf->name);
+		conf_report_error("Ignoring gecos block %s -- already xlined.", yy_aconf->name);
 		free_conf(yy_aconf);
 		yy_aconf = NULL;
 		return 0;
@@ -1757,7 +1747,7 @@
 			("There is a line in the example conf that will kill your server if not removed.");
 		conf_report_error
 			("Consider actually reading/editing the conf file, and removing this line.");
-		if (!testing_conf)
+		if(!testing_conf)
 			exit(0);
 	}
 }
@@ -1786,8 +1776,7 @@
 static void
 conf_set_general_kline_reason(void *data)
 {
-	strlcpy(ConfigFileEntry.kline_reason, data,
-			sizeof(ConfigFileEntry.kline_reason));
+	strlcpy(ConfigFileEntry.kline_reason, data, sizeof(ConfigFileEntry.kline_reason));
 	
 }
 
@@ -2251,14 +2240,15 @@
 	ircvsnprintf(msg, IRCD_BUFSIZE, fmt, ap);
 	va_end(ap);
 
-	if (testing_conf)
+	if(testing_conf)
 	{
 		fprintf(stderr, "\"%s\", line %d: %s\n", current_file, lineno + 1, msg);
 		return;
 	}
 
 	ilog(L_MAIN, "\"%s\", line %d: %s", current_file, lineno + 1, msg);
-	sendto_realops_flags(UMODE_ALL, L_ALL, "\"%s\", line %d: %s", current_file, lineno + 1, msg);
+	sendto_realops_flags(UMODE_ALL, L_ALL, "\"%s\", line %d: %s", current_file, lineno + 1,
+			     msg);
 }
 
 int
@@ -2515,8 +2505,7 @@
 	add_conf_item("connect", "hub_mask", CF_QSTRING, conf_set_connect_hub_mask);
 	add_conf_item("connect", "leaf_mask", CF_QSTRING, conf_set_connect_leaf_mask);
 	add_conf_item("connect", "class", CF_QSTRING, conf_set_connect_class);
-	add_conf_item("connect", "flags", CF_STRING | CF_FLIST,
-			conf_set_connect_flags);
+	add_conf_item("connect", "flags", CF_STRING | CF_FLIST, conf_set_connect_flags);
 
 	add_top_conf("kill", conf_begin_kill, conf_end_kill);
 	add_conf_item("kill", "user", CF_QSTRING, conf_set_kill_user);
@@ -2553,18 +2542,14 @@
 	add_conf_item("general", "ts_warn_delta", CF_TIME, conf_set_general_ts_warn_delta);
 	add_conf_item("general", "ts_max_delta", CF_TIME, conf_set_general_ts_max_delta);
 	add_conf_item("general", "kline_with_reason", CF_YESNO, conf_set_general_kline_with_reason);
-	add_conf_item("general", "kline_reason", CF_QSTRING,
-		      conf_set_general_kline_reason);
-	add_conf_item("general", "kline_delay", CF_TIME,
-		      conf_set_general_kline_delay);
+	add_conf_item("general", "kline_reason", CF_QSTRING, conf_set_general_kline_reason);
+	add_conf_item("general", "kline_delay", CF_TIME, conf_set_general_kline_delay);
 	add_conf_item("general", "warn_no_nline", CF_YESNO, conf_set_general_warn_no_nline);
-	add_conf_item("general", "nick_delay", CF_TIME,
-			conf_set_general_nick_delay);
+	add_conf_item("general", "nick_delay", CF_TIME, conf_set_general_nick_delay);
 	add_conf_item("general", "non_redundant_klines", CF_YESNO,
 		      conf_set_general_non_redundant_klines);
 	add_conf_item("general", "dots_in_ident", CF_INT, conf_set_general_dots_in_ident);
-	add_conf_item("general", "stats_e_disabled", CF_YESNO,
-			conf_set_general_stats_e_disabled);
+	add_conf_item("general", "stats_e_disabled", CF_YESNO, conf_set_general_stats_e_disabled);
 	add_conf_item("general", "stats_c_oper_only", CF_YESNO, conf_set_general_stats_c_oper_only);
 	add_conf_item("general", "stats_y_oper_only", CF_YESNO, conf_set_general_stats_y_oper_only);
 	add_conf_item("general", "stats_h_oper_only", CF_YESNO, conf_set_general_stats_h_oper_only);
@@ -2575,7 +2560,8 @@
 	add_conf_item("general", "stats_i_oper_only", CF_STRING,
 		      conf_set_general_stats_i_oper_only);
 	add_conf_item("general", "map_oper_only", CF_YESNO, conf_set_general_map_oper_only);
-	add_conf_item("general", "operspy_admin_only", CF_YESNO, conf_set_general_operspy_admin_only);
+	add_conf_item("general", "operspy_admin_only", CF_YESNO,
+		      conf_set_general_operspy_admin_only);
 	add_conf_item("general", "pace_wait", CF_TIME, conf_set_general_pace_wait);
 	add_conf_item("general", "pace_wait_simple", CF_TIME, conf_set_general_pace_wait_simple);
 	add_conf_item("general", "short_motd", CF_YESNO, conf_set_general_short_motd);
Index: src/packet.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/packet.c,v
retrieving revision 7.130.2.2
diff -b -u -r7.130.2.2 packet.c
--- src/packet.c	4 Aug 2004 00:21:17 -0000	7.130.2.2
+++ src/packet.c	19 Aug 2004 22:16:39 -0000
@@ -58,7 +58,7 @@
 	{
 		int i = 0;
 
-		for (;;)
+		for(;;)
 		{
 			/* rate unknown clients at MAX_FLOOD per loop */
 			if(i >= MAX_FLOOD)
@@ -88,9 +88,10 @@
 
 	if(IsAnyServer(client_p) || IsExemptFlood(client_p))
 	{
-		while (!IsAnyDead(client_p) && (dolen = linebuf_get(&client_p->localClient->buf_recvq,
-					   readBuf, READBUF_SIZE, LINEBUF_COMPLETE,
-					   LINEBUF_PARSED)) > 0)
+		while(!IsAnyDead(client_p)
+		      && (dolen =
+			  linebuf_get(&client_p->localClient->buf_recvq, readBuf, READBUF_SIZE,
+				      LINEBUF_COMPLETE, LINEBUF_PARSED)) > 0)
 		{
 			client_dopacket(client_p, readBuf, dolen);
 		}
@@ -105,7 +106,7 @@
 		 * messages in this loop, we simply drop out of the loop prematurely.
 		 *   -- adrian
 		 */
-		for (;;)
+		for(;;)
 		{
 			/* This flood protection works as follows:
 			 *
@@ -122,14 +123,16 @@
 			 */
 			if(checkflood)
 			{
-				if(client_p->localClient->sent_parsed >= client_p->localClient->allow_read)
+				if(client_p->localClient->sent_parsed >=
+				   client_p->localClient->allow_read)
 					break;
 			}
 
 			/* allow opers 4 times the amount of messages as users. why 4?
 			 * why not. :) --fl_
 			 */
-			else if(client_p->localClient->sent_parsed >= (4 * client_p->localClient->allow_read))
+			else if(client_p->localClient->sent_parsed >=
+				(4 * client_p->localClient->allow_read))
 				break;
 
 			dolen = linebuf_get(&client_p->localClient->
@@ -249,9 +252,9 @@
 		reply->command = tmp[0];
 	}
 
-	for (replydef = slinkrpltab; replydef->handler; replydef++)
+	for(replydef = slinkrpltab; replydef->handler; replydef++)
 	{
-		if((int)replydef->replyid == reply->command)
+		if((int) replydef->replyid == reply->command)
 			break;
 	}
 
Index: src/parse.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/parse.c,v
retrieving revision 7.182
diff -b -u -r7.182 parse.c
--- src/parse.c	24 Jun 2004 23:10:43 -0000	7.182
+++ src/parse.c	19 Aug 2004 22:16:40 -0000
@@ -53,7 +53,7 @@
 
 static void do_numeric(char[], struct Client *, struct Client *, int, char **);
 
-static int handle_command(struct Message *, struct Client *, struct Client *, int, const char**);
+static int handle_command(struct Message *, struct Client *, struct Client *, int, const char **);
 
 static int cmd_hash(const char *p);
 static struct Message *hash_parse(const char *);
@@ -72,7 +72,7 @@
 	int x = 1;
 
 	parv[x] = NULL;
-	while (*buf == ' ')	/* skip leading spaces */
+	while(*buf == ' ')	/* skip leading spaces */
 		buf++;
 	if(*buf == '\0')	/* ignore all-space args */
 		return x;
@@ -98,12 +98,12 @@
 			else
 				return x;
 		}
-		while (*buf == ' ')
+		while(*buf == ' ')
 			buf++;
 		if(*buf == '\0')
 			return x;
 	}
-	while (x < MAXPARA - 1);
+	while(x < MAXPARA - 1);
 
 	if(*p == ':')
 		p++;
@@ -133,7 +133,7 @@
 	if(IsAnyDead(client_p))
 		return;
 
-	for (ch = pbuffer; *ch == ' '; ch++)	/* skip spaces */
+	for(ch = pbuffer; *ch == ' '; ch++)	/* skip spaces */
 		/* null statement */ ;
 
 	para[0] = from->name;
@@ -174,7 +174,7 @@
 				return;
 			}
 		}
-		while (*ch == ' ')
+		while(*ch == ' ')
 			ch++;
 	}
 
@@ -259,10 +259,11 @@
 		return;
 	}
 
-	if(handle_command(mptr, client_p, from, i, /* XXX discards const!!! */ (const char **)para) < -1)
+	if(handle_command(mptr, client_p, from, i,	/* XXX discards const!!! */
+			  (const char **) para) < -1)
 	{
 		char *p;
-		for (p = pbuffer; p <= end; p += 8)
+		for(p = pbuffer; p <= end; p += 8)
 		{
 			/* HACK HACK */
 			/* Its expected this nasty code can be removed
@@ -270,7 +271,7 @@
 			 */
 			if((unsigned long) (p + 8) > (unsigned long) end)
 			{
-				for (; p <= end; p++)
+				for(; p <= end; p++)
 				{
 					ilog(L_MAIN, "%02x |%c", p[0], p[0]);
 				}
@@ -298,7 +299,7 @@
  */
 static int
 handle_command(struct Message *mptr, struct Client *client_p,
-	       struct Client *from, int i, const char* hpara[MAXPARA])
+	       struct Client *from, int i, const char *hpara[MAXPARA])
 {
 	struct MessageEntry ehandler;
 	MessageHandler handler = 0;
@@ -335,8 +336,7 @@
 		{
 			sendto_one(client_p, form_str(ERR_NEEDMOREPARAMS),
 				   me.name, 
-				   EmptyString(client_p->name) ? "*" : client_p->name, 
-				   mptr->cmd);
+				   EmptyString(client_p->name) ? "*" : client_p->name, mptr->cmd);
 			if(MyClient(client_p))
 				return (1);
 			else
@@ -423,7 +423,7 @@
 
 	msgindex = cmd_hash(msg->cmd);
 
-	for (ptr = msg_hash_table[msgindex]; ptr; ptr = ptr->next)
+	for(ptr = msg_hash_table[msgindex]; ptr; ptr = ptr->next)
 	{
 		if(strcasecmp(msg->cmd, ptr->cmd) == 0)
 			return;	/* Its already added */
@@ -465,7 +465,7 @@
 
 	msgindex = cmd_hash(msg->cmd);
 
-	for (ptr = msg_hash_table[msgindex]; ptr; ptr = ptr->next)
+	for(ptr = msg_hash_table[msgindex]; ptr; ptr = ptr->next)
 	{
 		if(strcasecmp(msg->cmd, ptr->cmd) == 0)
 		{
@@ -495,7 +495,7 @@
 
 	msgindex = cmd_hash(cmd);
 
-	for (ptr = msg_hash_table[msgindex]; ptr; ptr = ptr->next)
+	for(ptr = msg_hash_table[msgindex]; ptr; ptr = ptr->next)
 	{
 		if(strcasecmp(cmd, ptr->cmd) == 0)
 			return (ptr->msg);
@@ -518,7 +518,7 @@
 {
 	int hash_val = 0;
 
-	while (*p)
+	while(*p)
 	{
 		hash_val += ((int) (*p) & 0xDF);
 		p++;
@@ -540,9 +540,9 @@
 	int i;
 	struct MessageHash *ptr;
 
-	for (i = 0; i < MAX_MSG_HASH; i++)
+	for(i = 0; i < MAX_MSG_HASH; i++)
 	{
-		for (ptr = msg_hash_table[i]; ptr; ptr = ptr->next)
+		for(ptr = msg_hash_table[i]; ptr; ptr = ptr->next)
 		{
 			s_assert(ptr->msg != NULL);
 			s_assert(ptr->cmd != NULL);
@@ -583,8 +583,7 @@
 				     source_p->name,
 				     source_p->username,
 				     source_p->host,
-				     source_p->from->name,
-				     get_server_name(client_p, SHOW_IP));
+				     source_p->from->name, get_server_name(client_p, SHOW_IP));
 	}
 }
 
@@ -604,8 +603,7 @@
 	 * #XX		is a SID (SQUIT)
 	 * meep.foo	is a server (SQUIT)
 	 */
-	if((IsDigit(lsender[0]) && slen == 3) || 
-	   (strchr(lsender, '.') != NULL))
+	if((IsDigit(lsender[0]) && slen == 3) || (strchr(lsender, '.') != NULL))
 	{
 		sendto_realops_flags(UMODE_DEBUG, L_ALL,
 				     "Unknown prefix (%s) from %s, Squitting %s",
@@ -613,8 +611,7 @@
 
 		sendto_one(client_p,
 			   ":%s SQUIT %s :(Unknown prefix (%s) from %s)",
-			   get_id(&me, client_p), lsender, 
-			   lbuffer, client_p->name);
+			   get_id(&me, client_p), lsender, lbuffer, client_p->name);
 	}
 	else
 		sendto_one(client_p, ":%s KILL %s :%s (Unknown Client)", 
@@ -662,7 +659,7 @@
 		char *t = buffer;	/* Current position within the buffer */
 		int i;
 		int tl;		/* current length of presently being built string in t */
-		for (i = 2; i < (parc - 1); i++)
+		for(i = 2; i < (parc - 1); i++)
 		{
 			tl = ircsprintf(t, " %s", parv[i]);
 			t += tl;
@@ -695,8 +692,7 @@
 			/* note, now we send PING on server connect, we can
 			 * also get ERR_NOSUCHSERVER..
 			 */
-			if(atoi(numeric) != ERR_NOSUCHNICK &&
-			   atoi(numeric) != ERR_NOSUCHSERVER)
+			if(atoi(numeric) != ERR_NOSUCHNICK && atoi(numeric) != ERR_NOSUCHSERVER)
 				sendto_realops_flags(UMODE_ALL, L_ADMIN,
 						     "*** %s(via %s) sent a %s numeric to me: %s",
 						     source_p->name,
@@ -717,8 +713,7 @@
 
 		/* Fake it for server hiding, if its our client */
 		sendto_one(target_p, ":%s %s %s%s", 
-			   get_id(source_p, target_p), numeric, 
-			   get_id(target_p, target_p), buffer);
+			   get_id(source_p, target_p), numeric, get_id(target_p, target_p), buffer);
 		return;
 	}
 	else if((chptr = find_channel(parv[1])) != NULL)
Index: src/patricia.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/patricia.c,v
retrieving revision 7.21.6.2
diff -b -u -r7.21.6.2 patricia.c
--- src/patricia.c	6 Aug 2004 17:40:00 -0000	7.21.6.2
+++ src/patricia.c	19 Aug 2004 22:16:40 -0000
@@ -307,7 +307,7 @@
 		patricia_node_t **Xsp = Xstack;
 		patricia_node_t *Xrn = patricia->head;
 
-		while (Xrn)
+		while(Xrn)
 		{
 			patricia_node_t *l = Xrn->l;
 			patricia_node_t *r = Xrn->r;
@@ -395,7 +395,7 @@
 	addr = prefix_touchar(prefix);
 	bitlen = prefix->bitlen;
 
-	while (node->bit < bitlen)
+	while(node->bit < bitlen)
 	{
 
 		if(BIT_TEST(addr[node->bit >> 3], 0x80 >> (node->bit & 0x07)))
@@ -472,7 +472,7 @@
 	addr = prefix_touchar(prefix);
 	bitlen = prefix->bitlen;
 
-	while (node->bit < bitlen)
+	while(node->bit < bitlen)
 	{
 
 		if(node->prefix)
@@ -532,7 +532,7 @@
 	if(cnt <= 0)
 		return (NULL);
 
-	while (--cnt >= 0)
+	while(--cnt >= 0)
 	{
 		node = stack[cnt];
 #ifdef PATRICIA_DEBUG
@@ -595,7 +595,7 @@
 	bitlen = prefix->bitlen;
 	node = patricia->head;
 
-	while (node->bit < bitlen || node->prefix == NULL)
+	while(node->bit < bitlen || node->prefix == NULL)
 	{
 
 		if(node->bit < patricia->maxbits &&
@@ -641,7 +641,7 @@
 	/* find the first bit different */
 	check_bit = (node->bit < bitlen) ? node->bit : bitlen;
 	differ_bit = 0;
-	for (i = 0; i * 8 < check_bit; i++)
+	for(i = 0; i * 8 < check_bit; i++)
 	{
 		if((r = (addr[i] ^ test_addr[i])) == 0)
 		{
@@ -649,7 +649,7 @@
 			continue;
 		}
 		/* I know the better way, but for now */
-		for (j = 0; j < 8; j++)
+		for(j = 0; j < 8; j++)
 		{
 			if(BIT_TEST(r, (0x80 >> j)))
 				break;
@@ -666,7 +666,7 @@
 #endif /* PATRICIA_DEBUG */
 
 	parent = node->parent;
-	while (parent && parent->bit >= differ_bit)
+	while(parent && parent->bit >= differ_bit)
 	{
 		node = parent;
 		parent = node->parent;
@@ -931,10 +931,10 @@
 	void *ipptr = NULL;
 #ifdef IPV6
 	if(in->sa_family == AF_INET6)
-		ipptr = &((struct sockaddr_in6 *)in)->sin6_addr;	
+		ipptr = &((struct sockaddr_in6 *) in)->sin6_addr;
 	 else
 #endif
-		ipptr = &((struct sockaddr_in *)in)->sin_addr;
+		ipptr = &((struct sockaddr_in *) in)->sin_addr;
 	
 	prefix = New_Prefix(in->sa_family, ipptr, bitlen);
 
@@ -1021,17 +1021,19 @@
 #ifndef IPV6
 	len = 32;
 	family = AF_INET;
-	ipptr = &((struct sockaddr_in *)ip)->sin_addr;
+	ipptr = &((struct sockaddr_in *) ip)->sin_addr;
 #else
 	if(ip->sa_family == AF_INET6)
 	{
 		len = 128;
 		family = AF_INET6;
-		ipptr = &((struct sockaddr_in6 *)ip)->sin6_addr;
-	} else {
+		ipptr = &((struct sockaddr_in6 *) ip)->sin6_addr;
+	}
+	else
+	{
 		len = 32;
 		family = AF_INET;
-		ipptr = &((struct sockaddr_in *)ip)->sin_addr;
+		ipptr = &((struct sockaddr_in *) ip)->sin_addr;
 	}
 #endif
 	
Index: src/poll.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/poll.c,v
retrieving revision 7.78
diff -b -u -r7.78 poll.c
--- src/poll.c	15 Jun 2004 03:15:00 -0000	7.78
+++ src/poll.c	19 Aug 2004 22:16:41 -0000
@@ -79,7 +79,7 @@
 poll_findslot(void)
 {
 	int i;
-	for (i = 0; i < MAXCONNECTIONS; i++)
+	for(i = 0; i < MAXCONNECTIONS; i++)
 	{
 		if(pollfd_list.pollfds[i].fd == -1)
 		{
@@ -131,7 +131,7 @@
 
 				/* update pollfd_list.maxindex here */
 				if(comm_index == pollfd_list.maxindex)
-					while (pollfd_list.maxindex >= 0 &&
+					while(pollfd_list.maxindex >= 0 &&
 					       pollfd_list.pollfds[pollfd_list.maxindex].fd == -1)
 						pollfd_list.maxindex--;
 			}
@@ -155,7 +155,7 @@
 {
 	int fd;
 
-	for (fd = 0; fd < MAXCONNECTIONS; fd++)
+	for(fd = 0; fd < MAXCONNECTIONS; fd++)
 	{
 		pollfd_list.pollfds[fd].fd = -1;
 	}
@@ -236,13 +236,14 @@
 		empty_count = 0;
 		ndelay = 0;
 	}
-	else {
-		ndelay = ++empty_count * 15000 ;
+	else
+	{
+		ndelay = ++empty_count * 15000;
 		if(ndelay > delay * 1000)
 			ndelay = delay * 1000;	
 	}
 	
-	for (;;)
+	for(;;)
 	{
 		/* XXX kill that +1 later ! -- adrian */
 		if(ndelay > 0)
@@ -264,7 +265,7 @@
 	if(num == 0)
 		return 0;
 	/* XXX we *could* optimise by falling out after doing num fds ... */
-	for (ci = 0; ci < pollfd_list.maxindex + 1; ci++)
+	for(ci = 0; ci < pollfd_list.maxindex + 1; ci++)
 	{
 		fde_t *F;
 		int revents;
@@ -292,4 +293,3 @@
 	}
 	return 0;
 }
-
Index: src/qio.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/Attic/qio.c,v
retrieving revision 7.5
diff -b -u -r7.5 qio.c
--- src/qio.c	15 Mar 2004 17:58:08 -0000	7.5
+++ src/qio.c	19 Aug 2004 22:16:41 -0000
@@ -59,7 +59,7 @@
 ircd$ast_handler_write(int fd)
 {
 	fde_t *F = &fd_table[fd];
-	if (!F->write_handler)
+	if(!F->write_handler)
 		return 0;
 	F->write_handler(fd, F->write_data);
 	return 0;
@@ -70,7 +70,7 @@
 {
 	fde_t *F = &fd_table[fd];
 
-	if (!F->read_handler)
+	if(!F->read_handler)
 		return 0;
 
 	F->read_handler(fd, F->read_data);
@@ -82,28 +82,27 @@
 {
 	long status;
 
-	if (decc$get_sdc(fd) == 0)
+	if(decc$get_sdc(fd) == 0)
 		return;
 
 	status = sys$qiow(0, decc$get_sdc(fd), IO$_SETMODE | IO$M_WRTATTN,
 			  iosb, 0, 0, 0, 0, 0, 0, 0, 0);
-	if (!$VMS_STATUS_SUCCESS(status))
+	if(!$VMS_STATUS_SUCCESS(status))
 		sys$exit(status);
 
 	status = sys$qiow(0, decc$get_sdc(fd), IO$_SETMODE | IO$M_WRTATTN,
 			  iosb, 0, 0, ircd$ast_handler_write, fd, 0, 0, 0, 0);
-	if (!$VMS_STATUS_SUCCESS(status))
+	if(!$VMS_STATUS_SUCCESS(status))
 		sys$exit(status);
 }
 
 static void
 ircd$remove_ast_write(int fd)
 {
-	if (decc$get_sdc(fd) == 0)
+	if(decc$get_sdc(fd) == 0)
 		return;
 
-	sys$qiow(0, decc$get_sdc(fd), IO$_SETMODE | IO$M_WRTATTN,
-		 iosb, 0, 0, 0, 0, 0, 0, 0, 0);
+	sys$qiow(0, decc$get_sdc(fd), IO$_SETMODE | IO$M_WRTATTN, iosb, 0, 0, 0, 0, 0, 0, 0, 0);
 }
 
 static void
@@ -111,28 +110,27 @@
 {
 	long status;
 
-	if (decc$get_sdc(fd) == 0)
+	if(decc$get_sdc(fd) == 0)
 		return;
 
 	status = sys$qiow(0, decc$get_sdc(fd), IO$_SETMODE | IO$M_READATTN,
 			  iosb, 0, 0, 0, 0, 0, 0, 0, 0);
-	if (!$VMS_STATUS_SUCCESS(status))
+	if(!$VMS_STATUS_SUCCESS(status))
 		sys$exit(status);
 
 	status = sys$qiow(0, decc$get_sdc(fd), IO$_SETMODE | IO$M_READATTN,
 			  iosb, 0, 0, ircd$ast_handler_read, fd, 0, 0, 0, 0);
-	if (!$VMS_STATUS_SUCCESS(status))
+	if(!$VMS_STATUS_SUCCESS(status))
 		sys$exit(status);
 }
 
 static void
 ircd$remove_ast_read(int fd)
 {
-	if (decc$get_sdc(fd) == 0)
+	if(decc$get_sdc(fd) == 0)
 		return;
 
-	sys$qiow(0, decc$get_sdc(fd), IO$_SETMODE | IO$M_READATTN,
-		iosb, 0, 0, 0, 0, 0, 0, 0, 0);
+	sys$qiow(0, decc$get_sdc(fd), IO$_SETMODE | IO$M_READATTN, iosb, 0, 0, 0, 0, 0, 0, 0, 0);
 }
 
 /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
@@ -168,7 +166,7 @@
 
 	if(type & COMM_SELECT_READ)
 	{
-		if (handler)
+		if(handler)
 			ircd$install_ast_read(fd);
 		else
 			ircd$remove_ast_read(fd);
@@ -178,7 +176,7 @@
 	}
 	if(type & COMM_SELECT_WRITE)
 	{
-		if (handler)
+		if(handler)
 			ircd$install_ast_write(fd);
 		else
 			ircd$remove_ast_write(fd);
Index: src/reject.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/reject.c,v
retrieving revision 1.25.2.1
diff -b -u -r1.25.2.1 reject.c
--- src/reject.c	3 Aug 2004 20:39:51 -0000	1.25.2.1
+++ src/reject.c	19 Aug 2004 22:16:41 -0000
@@ -62,7 +62,8 @@
 		 * ends up on the dead_list and the abort_list --fl
 		 */
 		if(!IsIOError(client_p))
-			sendto_one(client_p, "ERROR :Closing Link: %s (*** Banned (cache))", client_p->host);
+			sendto_one(client_p, "ERROR :Closing Link: %s (*** Banned (cache))",
+				   client_p->host);
 
  	  	close_connection(client_p);
         	SetDead(client_p);
@@ -117,7 +118,7 @@
 	if(ConfigFileEntry.reject_after_count == 0 || ConfigFileEntry.reject_ban_time == 0)
 		return;
 
-	if((pnode = match_ip(reject_tree, (struct sockaddr *)&client_p->localClient->ip)) != NULL)
+	if((pnode = match_ip(reject_tree, (struct sockaddr *) &client_p->localClient->ip)) != NULL)
 	{
 		rdata = pnode->data;
 		rdata->time = CurrentTime;
@@ -130,7 +131,8 @@
 		if(client_p->localClient->ip.ss_family == AF_INET6)
 			bitlen = 128;
 #endif
-		pnode = make_and_lookup_ip(reject_tree, (struct sockaddr *)&client_p->localClient->ip, bitlen);
+		pnode = make_and_lookup_ip(reject_tree,
+					   (struct sockaddr *) &client_p->localClient->ip, bitlen);
 		pnode->data = rdata = MyMalloc(sizeof(struct reject_data));
 		dlinkAddTail(pnode, &rdata->rnode, &reject_list);
 		rdata->time = CurrentTime;
@@ -149,7 +151,7 @@
 	   ConfigFileEntry.reject_duration == 0)
 		return 0;
 		
-	pnode = match_ip(reject_tree, (struct sockaddr *)&client_p->localClient->ip);
+	pnode = match_ip(reject_tree, (struct sockaddr *) &client_p->localClient->ip);
 	if(pnode != NULL)
 	{
 		rdata = pnode->data;
@@ -159,7 +161,8 @@
 		{
 			ServerStats->is_rej++;
 			SetReject(client_p);
-			comm_setselect(client_p->localClient->fd, FDLIST_NONE, COMM_SELECT_WRITE | COMM_SELECT_READ, NULL, NULL, 0);
+			comm_setselect(client_p->localClient->fd, FDLIST_NONE,
+				       COMM_SELECT_WRITE | COMM_SELECT_READ, NULL, NULL, 0);
 			SetClosing(client_p);
 			dlinkMoveNode(&client_p->localClient->tnode, &unknown_list, &delay_exit);
 			return 1;
@@ -169,7 +172,8 @@
 	return 0;
 }
 
-void flush_reject(void)
+void
+flush_reject(void)
 {
 	dlink_node *ptr, *next;
 	patricia_node_t *pnode;
Index: src/restart.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/restart.c,v
retrieving revision 7.32
diff -b -u -r7.32 restart.c
--- src/restart.c	15 Mar 2004 17:58:08 -0000	7.32
+++ src/restart.c	19 Aug 2004 22:16:41 -0000
@@ -69,7 +69,7 @@
 	 * bah, for now, the program ain't coming back to here, so forcibly
 	 * close everything the "wrong" way for now, and just LEAVE...
 	 */
-	for (i = 0; i < MAXCONNECTIONS; ++i)
+	for(i = 0; i < MAXCONNECTIONS; ++i)
 		close(i);
 
 	unlink(pidFileName);
Index: src/s_auth.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/s_auth.c,v
retrieving revision 7.166.2.3
diff -b -u -r7.166.2.3 s_auth.c
--- src/s_auth.c	4 Aug 2004 00:21:17 -0000	7.166.2.3
+++ src/s_auth.c	19 Aug 2004 22:16:41 -0000
@@ -59,8 +59,7 @@
  * this replaces the original sendheader macros
  */
 
-static const char *HeaderMessages[] =
-{
+static const char *HeaderMessages[] = {
 	"NOTICE AUTH :*** Looking up your hostname...",
 	"NOTICE AUTH :*** Found your hostname",
 	"NOTICE AUTH :*** Couldn't look up your hostname",
@@ -181,7 +180,8 @@
 			strlcpy(auth->client->host, *reply->rrs.str, sizeof(auth->client->host));
 			sendheader(auth->client, REPORT_FIN_DNS);
 		}
-		else {
+		else
+		{
 			sendheader(auth->client, REPORT_HOST_TOOLONG);
 		}
 		MyFree(reply);
@@ -195,15 +195,20 @@
 			struct Client *client = auth->client;
 			auth->ip6_int = 1;
 			MyFree(reply);
-			if(adns_getaddr((struct sockaddr *)&client->localClient->ip, client->localClient->ip.ss_family, &auth->dns_query, 1))
+			if(adns_getaddr
+			   ((struct sockaddr *) &client->localClient->ip,
+			    client->localClient->ip.ss_family, &auth->dns_query, 1))
 			{
 				ClearDNSPending(auth);
 				sendheader(auth->client, REPORT_FAIL_DNS);
-			} else {
+			}
+			else
+			{
 				SetDNSPending(auth);
 				return;
 			}
-		} else
+		}
+		else
 #endif
 		sendheader(auth->client, REPORT_FAIL_DNS);
 	}
@@ -283,17 +288,17 @@
 	 * and machines with multiple IP addresses are common now
 	 */
 	memset(&localaddr, 0, locallen);
-	getsockname(auth->client->localClient->fd,
-		    (struct sockaddr *) &localaddr, &locallen);
+	getsockname(auth->client->localClient->fd, (struct sockaddr *) &localaddr, &locallen);
 	
-	mangle_mapped_sockaddr((struct sockaddr *)&localaddr);
+	mangle_mapped_sockaddr((struct sockaddr *) &localaddr);
 #ifdef IPV6
 	if(localaddr.ss_family == AF_INET6)
 	{
-		((struct sockaddr_in6 *)&localaddr)->sin6_port = 0;
-	} else
+		((struct sockaddr_in6 *) &localaddr)->sin6_port = 0;
+	}
+	else
 #endif
-	((struct sockaddr_in *)&localaddr)->sin_port = 0;
+		((struct sockaddr_in *) &localaddr)->sin_port = 0;
 	
 	auth->fd = fd;
 	SetAuthConnect(auth);
@@ -385,7 +390,8 @@
 	sendheader(client, REPORT_DO_DNS);
 
 	/* No DNS cache now, remember? -- adrian */
-	if(adns_getaddr((struct sockaddr *)&client->localClient->ip, client->localClient->ip.ss_family,
+	if(adns_getaddr
+	   ((struct sockaddr *) &client->localClient->ip, client->localClient->ip.ss_family,
 		     &auth->dns_query, 0))
 	{
 #ifdef IPV6
@@ -394,7 +400,9 @@
 		{
 			auth->ip6_int = 1;
 			SetDNSPending(auth);
-			if(adns_getaddr((struct sockaddr *)&client->localClient->ip, client->localClient->ip.ss_family, &auth->dns_query, 1))
+			if(adns_getaddr
+			   ((struct sockaddr *) &client->localClient->ip,
+			    client->localClient->ip.ss_family, &auth->dns_query, 1))
 			{
 				ClearDNSPending(auth);
 				sendheader(client, REPORT_FAIL_DNS);
@@ -544,10 +552,10 @@
 		{
 			t = auth->client->username;
 
-			while (*s == '~' || *s == '^')
+			while(*s == '~' || *s == '^')
 				s++;
 
-			for (count = USERLEN; *s && count; s++)
+			for(count = USERLEN; *s && count; s++)
 			{
 				if(*s == '@')
 				{
Index: src/s_conf.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/s_conf.c,v
retrieving revision 7.470.2.1
diff -b -u -r7.470.2.1 s_conf.c
--- src/s_conf.c	3 Aug 2004 20:39:52 -0000	7.470.2.1
+++ src/s_conf.c	19 Aug 2004 22:16:42 -0000
@@ -166,8 +166,7 @@
 
 	if((i = verify_access(source_p, username)))
 	{
-		ilog(L_FUSER, "Access denied: %s[%s]", 
-		     source_p->name, source_p->sockhost);
+		ilog(L_FUSER, "Access denied: %s[%s]", source_p->name, source_p->sockhost);
 	}
 	
 	switch (i)
@@ -220,8 +219,7 @@
 		sendto_realops_flags(UMODE_FULL, L_ALL,
 				"I-line is full for %s!%s%s@%s (%s).",
 				source_p->name, IsGotId(source_p) ? "" : "~",
-				source_p->username, source_p->host,
-				source_p->sockhost);
+				     source_p->username, source_p->host, source_p->sockhost);
 
 		ilog(L_FUSER, "Too many connections from %s!%s%s@%s.", 
 			source_p->name, IsGotId(source_p) ? "" : "~",
@@ -237,10 +235,12 @@
 			int port = -1;
 #ifdef IPV6
 			if(source_p->localClient->ip.ss_family == AF_INET6)
-				port = ((struct sockaddr_in6 *)&source_p->localClient->listener)->sin6_port;
+				port = ((struct sockaddr_in6 *) &source_p->localClient->listener)->
+					sin6_port;
 			else
 #endif
-				port = ((struct sockaddr_in *)&source_p->localClient->listener)->sin_port;
+				port = ((struct sockaddr_in *) &source_p->localClient->listener)->
+					sin_port;
 			
 			ServerStats->is_ref++;
 			/* jdc - lists server name & port connections are on */
@@ -298,13 +298,16 @@
 	if(IsGotId(client_p))
 	{
 		aconf = find_address_conf(client_p->host, client_p->username,
-					  (struct sockaddr *)&client_p->localClient->ip,client_p->localClient->ip.ss_family);
+					  (struct sockaddr *) &client_p->localClient->ip,
+					  client_p->localClient->ip.ss_family);
 	}
 	else
 	{
 		strlcpy(non_ident, "~", sizeof(non_ident));
 		strlcat(non_ident, username, sizeof(non_ident));
-		aconf = find_address_conf(client_p->host, non_ident, (struct sockaddr *)&client_p->localClient->ip,client_p->localClient->ip.ss_family);
+		aconf = find_address_conf(client_p->host, non_ident,
+					  (struct sockaddr *) &client_p->localClient->ip,
+					  client_p->localClient->ip.ss_family);
 	}
 
 	if(aconf == NULL)
@@ -332,8 +335,7 @@
 			if(IsConfSpoofNotice(aconf))
 			{
 				sendto_realops_flags(UMODE_ALL, L_ALL,
-						"%s spoofing: %s as %s",
-						client_p->name,
+						     "%s spoofing: %s as %s", client_p->name,
 #ifdef HIDE_SPOOF_IPS
 						aconf->name,
 #else
@@ -345,13 +347,12 @@
 			/* user@host spoof */
 			if((p = strchr(aconf->name, '@')) != NULL)
 			{
-				char *host = p+1;
+				char *host = p + 1;
 				*p = '\0';
 
 				strlcpy(client_p->username, aconf->name,
 					sizeof(client_p->username));
-				strlcpy(client_p->host, host,
-					sizeof(client_p->host));
+				strlcpy(client_p->host, host, sizeof(client_p->host));
 				*p = '@';
 			}
 			else
@@ -405,17 +406,18 @@
 	if(ConfCidrAmount(aconf) == 0 || ConfCidrBitlen(aconf) == 0)
 		return -1;
 
-	pnode = match_ip(ConfIpLimits(aconf), (struct sockaddr *)&client_p->localClient->ip);
+	pnode = match_ip(ConfIpLimits(aconf), (struct sockaddr *) &client_p->localClient->ip);
 
 	if(pnode == NULL)
-		pnode = make_and_lookup_ip(ConfIpLimits(aconf), (struct sockaddr *)&client_p->localClient->ip, ConfCidrBitlen(aconf));
+		pnode = make_and_lookup_ip(ConfIpLimits(aconf),
+					   (struct sockaddr *) &client_p->localClient->ip,
+					   ConfCidrBitlen(aconf));
 
 	s_assert(pnode != NULL);
 
 	if(pnode != NULL)
 	{
-		if(((long) pnode->data) >= ConfCidrAmount(aconf)
-		   && !IsConfExemptLimits(aconf))
+		if(((long) pnode->data) >= ConfCidrAmount(aconf) && !IsConfExemptLimits(aconf))
 		{
 			/* This should only happen if the limits are set to 0 */
 			if((unsigned long) pnode->data == 0)
@@ -439,7 +441,7 @@
 	if(ConfCidrAmount(aconf) == 0 || ConfCidrBitlen(aconf) == 0)
 		return;
 
-	pnode = match_ip(ConfIpLimits(aconf), (struct sockaddr *)&client_p->localClient->ip);
+	pnode = match_ip(ConfIpLimits(aconf), (struct sockaddr *) &client_p->localClient->ip);
 	if(pnode == NULL)
 		return;
 
@@ -584,7 +586,8 @@
 		}
 		else
 		{
-			sendto_one(client_p, ":%s NOTICE %s :*** I: line is full, but you have an >I: line!", 
+			sendto_one(client_p,
+				   ":%s NOTICE %s :*** I: line is full, but you have an >I: line!",
 			                      me.name, client_p->name);
 			SetExemptLimits(client_p);
 		}
@@ -733,7 +736,7 @@
 
 	ConfigFileEntry.oper_umodes = UMODE_LOCOPS | UMODE_SERVNOTICE |
 		UMODE_OPERWALL | UMODE_WALLOP;
-	ConfigFileEntry.oper_only_umodes = UMODE_DEBUG|UMODE_OPERSPY;
+	ConfigFileEntry.oper_only_umodes = UMODE_DEBUG | UMODE_OPERSPY;
 
 	ConfigChannel.use_except = YES;
 	ConfigChannel.use_invex = YES;
@@ -1038,8 +1041,7 @@
 	}
 
 	ircsnprintf(buffer, sizeof(buffer), "%s!%s@%s{%s}",
-		   client_p->name, client_p->username, 
-		   client_p->host, client_p->servptr->name);
+		    client_p->name, client_p->username, client_p->host, client_p->servptr->name);
 	return buffer;
 }
 
@@ -1076,8 +1078,7 @@
 
 void
 get_printable_kline(struct Client *source_p, struct ConfItem *aconf, 
-		    char **host, char **reason,
-		    char **user, char **oper_reason)
+		    char **host, char **reason, char **user, char **oper_reason)
 {
 	static char null[] = "<NULL>";
 
@@ -1331,7 +1332,8 @@
 	{
 		ircsnprintf(buffer, sizeof(buffer),
 			   "\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",%ld\n", host,
-			   reason, oper_reason, current_date, get_oper_name(source_p), CurrentTime);
+			    reason, oper_reason, current_date, get_oper_name(source_p),
+			    CurrentTime);
 	}
 	else if(type == RESV_TYPE)
 	{
@@ -1354,8 +1356,7 @@
 		{
 			sendto_realops_flags(UMODE_ALL, L_ALL,
 					"%s added K-Line for [%s@%s] [%s]",
-					get_oper_name(source_p), user, 
-					host, reason);
+					     get_oper_name(source_p), user, host, reason);
 			ilog(L_KLINE, "K %s 0 %s %s %s",
 				get_oper_name(source_p), user, host, reason);
 		}
@@ -1366,12 +1367,10 @@
 					get_oper_name(source_p), user,
 					host, reason, oper_reason);
 			ilog(L_KLINE, "K %s 0 %s %s %s|%s",
-				get_oper_name(source_p), user, host,
-				reason, oper_reason);
+			     get_oper_name(source_p), user, host, reason, oper_reason);
 		}
 
-		sendto_one_notice(source_p, ":Added K-Line [%s@%s]",
-				  user, host);
+		sendto_one_notice(source_p, ":Added K-Line [%s@%s]", user, host);
 	}
 	else if(type == DLINE_TYPE)
 	{
@@ -1380,18 +1379,15 @@
 			sendto_realops_flags(UMODE_ALL, L_ALL,
 					"%s added D-Line for [%s] [%s]",
 					get_oper_name(source_p), host, reason);
-			ilog(L_KLINE, "D %s 0 %s %s",
-				get_oper_name(source_p), host, reason);
+			ilog(L_KLINE, "D %s 0 %s %s", get_oper_name(source_p), host, reason);
 		}
 		else
 		{
 			sendto_realops_flags(UMODE_ALL, L_ALL,
 					"%s added D-Line for [%s] [%s|%s]",
-					get_oper_name(source_p), host, 
-					reason, oper_reason);
+					     get_oper_name(source_p), host, reason, oper_reason);
 			ilog(L_KLINE, "D %s 0 %s %s|%s",
-				get_oper_name(source_p), host, 
-				reason, oper_reason);
+			     get_oper_name(source_p), host, reason, oper_reason);
 		}
 
 		sendto_one(source_p,
@@ -1404,11 +1400,9 @@
 		sendto_realops_flags(UMODE_ALL, L_ALL,
 				"%s added RESV for [%s] [%s]",
 				get_oper_name(source_p), host, reason);
-		ilog(L_KLINE, "R %s 0 %s %s",
-			get_oper_name(source_p), host, reason);
+		ilog(L_KLINE, "R %s 0 %s %s", get_oper_name(source_p), host, reason);
 
-		sendto_one_notice(source_p, ":Added RESV for [%s] [%s]",
-				  host, reason);
+		sendto_one_notice(source_p, ":Added RESV for [%s] [%s]", host, reason);
 	}
 }
 
Index: src/s_log.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/s_log.c,v
retrieving revision 7.69
diff -b -u -r7.69 s_log.c
--- src/s_log.c	25 May 2004 10:49:57 -0000	7.69
+++ src/s_log.c	19 Aug 2004 22:16:42 -0000
@@ -58,19 +58,18 @@
 	FBFILE **logfile;
 };
 
-static struct log_struct log_table[LAST_LOGFILE] =
-{
-	{ NULL, 				&log_main	},
-	{ ConfigFileEntry.fname_userlog,	&log_user	},
-	{ ConfigFileEntry.fname_fuserlog,	&log_fuser	},
-	{ ConfigFileEntry.fname_operlog,	&log_oper	},
-	{ ConfigFileEntry.fname_foperlog,	&log_foper	},
-	{ ConfigFileEntry.fname_serverlog,	&log_server	},
-	{ ConfigFileEntry.fname_killlog,	&log_kill	},
-	{ ConfigFileEntry.fname_klinelog,	&log_kline	},
-	{ ConfigFileEntry.fname_glinelog,	&log_gline	},
-	{ ConfigFileEntry.fname_operspylog,	&log_operspy	},
-	{ ConfigFileEntry.fname_ioerrorlog,	&log_ioerror	}
+static struct log_struct log_table[LAST_LOGFILE] = {
+	{NULL, &log_main},
+	{ConfigFileEntry.fname_userlog, &log_user},
+	{ConfigFileEntry.fname_fuserlog, &log_fuser},
+	{ConfigFileEntry.fname_operlog, &log_oper},
+	{ConfigFileEntry.fname_foperlog, &log_foper},
+	{ConfigFileEntry.fname_serverlog, &log_server},
+	{ConfigFileEntry.fname_killlog, &log_kill},
+	{ConfigFileEntry.fname_klinelog, &log_kline},
+	{ConfigFileEntry.fname_glinelog, &log_gline},
+	{ConfigFileEntry.fname_operspylog, &log_operspy},
+	{ConfigFileEntry.fname_ioerrorlog, &log_ioerror}
 };
 
 void
@@ -136,17 +135,13 @@
 	/* if its not my client its already propagated */
 	if(MyClient(source_p))
 		sendto_match_servs(source_p, "*", CAP_ENCAP, NOCAPS,
-				   "ENCAP * OPERSPY %s %s",
-				   token, arg ? arg : "");
+				   "ENCAP * OPERSPY %s %s", token, arg ? arg : "");
 
 	sendto_realops_flags(UMODE_OPERSPY,
 			     ConfigFileEntry.operspy_admin_only ? L_ADMIN : L_ALL,
-			     "OPERSPY %s %s %s",
-			     get_oper_name(source_p), token,
-			     arg ? arg : "");
+			     "OPERSPY %s %s %s", get_oper_name(source_p), token, arg ? arg : "");
 
-	ilog(L_OPERSPY, "OPERSPY %s %s %s",
-	     get_oper_name(source_p), token, arg ? arg : "");
+	ilog(L_OPERSPY, "OPERSPY %s %s %s", get_oper_name(source_p), token, arg ? arg : "");
 }
 
 const char *
@@ -159,8 +154,7 @@
 	lt = localtime(&ltime);
 
 	ircsnprintf(buf, sizeof(buf), "%d/%d/%d %02d.%02d",
-		    lt->tm_year + 1900, lt->tm_mon + 1,
-		    lt->tm_mday, lt->tm_hour, lt->tm_min);
+		    lt->tm_year + 1900, lt->tm_mon + 1, lt->tm_mday, lt->tm_hour, lt->tm_min);
 
 	return buf;
 }
Index: src/s_newconf.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/s_newconf.c,v
retrieving revision 7.45.2.1
diff -b -u -r7.45.2.1 s_newconf.c
--- src/s_newconf.c	3 Aug 2004 20:39:52 -0000	7.45.2.1
+++ src/s_newconf.c	19 Aug 2004 22:16:43 -0000
@@ -164,8 +164,7 @@
 }
 
 int
-find_shared_conf(const char *username, const char *host, 
-		const char *server, int flags)
+find_shared_conf(const char *username, const char *host, const char *server, int flags)
 {
 	struct remote_conf *shared_p;
 	dlink_node *ptr;
@@ -178,8 +177,7 @@
 			continue;
 
 		if(match(shared_p->username, username) &&
-		   match(shared_p->host, host) &&
-		   match(shared_p->server, server))
+		   match(shared_p->host, host) && match(shared_p->server, server))
 			return YES;
 
 	}
@@ -209,12 +207,9 @@
 	ircvsnprintf(buffer, sizeof(buffer), format, args);
 	va_end(args);
 
-	sendto_match_servs(source_p, target, cap, NOCAPS,
-			"%s %s %s",
-			command, target, buffer);
+	sendto_match_servs(source_p, target, cap, NOCAPS, "%s %s %s", command, target, buffer);
 	sendto_match_servs(source_p, target, CAP_ENCAP, cap,
-			"ENCAP %s %s %s",
-			target, command, buffer);
+			   "ENCAP %s %s %s", target, command, buffer);
 }
 			
 void
@@ -238,11 +233,9 @@
 			continue;
 
 		sendto_match_servs(source_p, shared_p->server, cap, NOCAPS,
-				"%s %s %s",
-				command, shared_p->server, buffer);
+				   "%s %s %s", command, shared_p->server, buffer);
 		sendto_match_servs(source_p, shared_p->server, CAP_ENCAP, cap,
-				"ENCAP %s %s %s",
-				shared_p->server, command, buffer);
+				   "ENCAP %s %s %s", shared_p->server, command, buffer);
 	}
 }
 
@@ -279,11 +272,11 @@
 {
 	struct oper_conf *oper_p;
 	struct irc_sockaddr_storage ip, cip;
-	char addr[HOSTLEN+1];
+	char addr[HOSTLEN + 1];
 	int bits, cbits;
 	dlink_node *ptr;
 
-	parse_netmask(locip, (struct sockaddr *)&cip, &cbits);
+	parse_netmask(locip, (struct sockaddr *) &cip, &cbits);
 
 	DLINK_FOREACH(ptr, oper_conf_list.head)
 	{
@@ -295,12 +288,13 @@
 
 		strlcpy(addr, oper_p->host, sizeof(addr));
 
-		if(parse_netmask(addr, (struct sockaddr *)&ip, &bits) != HM_HOST)
+		if(parse_netmask(addr, (struct sockaddr *) &ip, &bits) != HM_HOST)
 		{
 			if(ip.ss_family != cip.ss_family)
 				continue;
 
-			if(!comp_with_mask_sock((struct sockaddr *)&ip, (struct sockaddr *)&cip, bits))
+			if(!comp_with_mask_sock
+			   ((struct sockaddr *) &ip, (struct sockaddr *) &cip, bits))
 				continue;
 		}
 		else if(!match(oper_p->host, host))
@@ -318,23 +312,22 @@
 	char has;
 	char hasnt;
 };
-static struct oper_flags oper_flagtable[] =
-{
-	{ OPER_GLINE,		'G', 'g' },
-	{ OPER_KLINE,		'K', 'k' },
-	{ OPER_XLINE,		'X', 'x' },
-	{ OPER_GLOBKILL,	'O', 'o' },
-	{ OPER_LOCKILL,		'C', 'c' },
-	{ OPER_REMOTE,		'R', 'r' },
-	{ OPER_UNKLINE,		'U', 'u' },
-	{ OPER_REHASH,		'H', 'h' },
-	{ OPER_DIE,		'D', 'd' },
-	{ OPER_ADMIN,		'A', 'a' },
-	{ OPER_NICKS,		'N', 'n' },
-	{ OPER_OPERWALL,	'L', 'l' },
-	{ OPER_SPY,		'S', 's' },
-	{ OPER_INVIS,		'P', 'p' },
-	{ 0,			'\0', '\0' }
+static struct oper_flags oper_flagtable[] = {
+	{OPER_GLINE, 'G', 'g'},
+	{OPER_KLINE, 'K', 'k'},
+	{OPER_XLINE, 'X', 'x'},
+	{OPER_GLOBKILL, 'O', 'o'},
+	{OPER_LOCKILL, 'C', 'c'},
+	{OPER_REMOTE, 'R', 'r'},
+	{OPER_UNKLINE, 'U', 'u'},
+	{OPER_REHASH, 'H', 'h'},
+	{OPER_DIE, 'D', 'd'},
+	{OPER_ADMIN, 'A', 'a'},
+	{OPER_NICKS, 'N', 'n'},
+	{OPER_OPERWALL, 'L', 'l'},
+	{OPER_SPY, 'S', 's'},
+	{OPER_INVIS, 'P', 'p'},
+	{0, '\0', '\0'}
 };
 
 const char *
@@ -414,16 +407,17 @@
 #ifdef IPV6
 		if(reply->type ==  adns_r_addr6)
 		{
-			struct sockaddr_in6 *in6 = (struct sockaddr_in6 *)&server_p->ipnum;
+			struct sockaddr_in6 *in6 = (struct sockaddr_in6 *) &server_p->ipnum;
 			SET_SS_LEN(server_p->ipnum, sizeof(struct sockaddr_in6));
 			in6->sin6_family = AF_INET6;
 			in6->sin6_port = 0;
-			memcpy(&in6->sin6_addr, &reply->rrs.addr->addr.inet6.sin6_addr, sizeof(struct in6_addr));
+			memcpy(&in6->sin6_addr, &reply->rrs.addr->addr.inet6.sin6_addr,
+			       sizeof(struct in6_addr));
 		}
 		else
 #endif
 		{
-			struct sockaddr_in *in = (struct sockaddr_in *)&server_p->ipnum;
+			struct sockaddr_in *in = (struct sockaddr_in *) &server_p->ipnum;
 			SET_SS_LEN(server_p->ipnum, sizeof(struct sockaddr_in));
 			in->sin_family = AF_INET;
 			in->sin_port = 0;
@@ -451,8 +445,7 @@
 
 	if(server_p->class == default_class)
 	{
-		conf_report_error("Warning connect::class invalid for %s",
-				server_p->name);
+		conf_report_error("Warning connect::class invalid for %s", server_p->name);
 
 		MyFree(server_p->class_name);
 		DupString(server_p->class_name, "default");
@@ -461,7 +454,7 @@
 	if(strchr(server_p->host, '*') || strchr(server_p->host, '?'))
 		return;
 
-	if(inetpton_sock(server_p->host, (struct sockaddr *)&server_p->ipnum) > 0)
+	if(inetpton_sock(server_p->host, (struct sockaddr *) &server_p->ipnum) > 0)
 		return;
 
 	server_p->dns_query = MyMalloc(sizeof(struct DNSQuery));
@@ -542,8 +535,7 @@
 				get_oper_name(source_p), name, newval);
 	}
 	else
-		sendto_one(source_p, ":%s NOTICE %s :Can't find %s",
-				me.name, source_p->name, name);
+		sendto_one(source_p, ":%s NOTICE %s :Can't find %s", me.name, source_p->name, name);
 }
 
 struct ConfItem *
@@ -601,7 +593,7 @@
 	if(*nick == '-' || IsDigit(*nick))
 		return 0;
 
-	while ((tmpch = *nick++))
+	while((tmpch = *nick++))
 	{
 		if(tmpch == '?' || tmpch == '@' || tmpch == '#')
 			q++;
@@ -675,7 +667,7 @@
 	if(result > (24 * 60 * 7 * 4))
 		result = (24 * 60 * 7 * 4);
 
-	return(result * 60);
+	return (result * 60);
 }
 
 static void
@@ -701,9 +693,7 @@
 			dlinkDestroy(ptr, &resvTable[i]);
 		}
 	}
-	HASH_WALK_END
-
-	DLINK_FOREACH_SAFE(ptr, next_ptr, resv_conf_list.head)
+	HASH_WALK_END DLINK_FOREACH_SAFE(ptr, next_ptr, resv_conf_list.head)
 	{
 		aconf = ptr->data;
 
@@ -737,7 +727,7 @@
 unsigned long
 get_nd_count(void)
 {
-	return(dlink_list_length(&nd_list));
+	return (dlink_list_length(&nd_list));
 }
 
 
@@ -787,4 +777,3 @@
 		free_nd_entry(nd);
 	}
 }
-
Index: src/s_serv.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/s_serv.c,v
retrieving revision 7.406.2.2
diff -b -u -r7.406.2.2 s_serv.c
--- src/s_serv.c	4 Aug 2004 00:21:17 -0000	7.406.2.2
+++ src/s_serv.c	19 Aug 2004 22:16:44 -0000
@@ -87,18 +87,19 @@
  */
 struct Capability captab[] = {
 /*  name     cap     */
-	{ "QS",		CAP_QS },
-	{ "EX",		CAP_EX },
-	{ "CHW",	CAP_CHW},
-	{ "IE", 	CAP_IE},
-	{ "KLN",	CAP_KLN},
-	{ "GLN",	CAP_GLN},
-	{ "KNOCK",	CAP_KNOCK},
-	{ "ZIP",	CAP_ZIP},
-	{ "TB",		CAP_TB},
-	{ "UNKLN",	CAP_UNKLN},
-	{ "CLUSTER",	CAP_CLUSTER},
-	{ "ENCAP",	CAP_ENCAP },
+	{"QS", CAP_QS},
+	{"EX", CAP_EX},
+	{"CHW", CAP_CHW},
+	{"IE", CAP_IE},
+	{"KLN", CAP_KLN},
+	{"GLN", CAP_GLN},
+	{"KNOCK", CAP_KNOCK},
+	{"ZIP", CAP_ZIP},
+	{"TB", CAP_TB},
+	{"UNKLN", CAP_UNKLN},
+	{"CLUSTER", CAP_CLUSTER},
+	{"ENCAP", CAP_ENCAP},
+	{"HOPS", CAP_HOPS},
 	{0, 0}
 };
 
@@ -294,8 +295,7 @@
 		{
 			if(!IsDigit(parv[server][0]))
 				sendto_one_numeric(source_p, ERR_NOSUCHSERVER,
-						   form_str(ERR_NOSUCHSERVER),
-						   parv[server]);
+						   form_str(ERR_NOSUCHSERVER), parv[server]);
 			return (HUNTED_NOSUCH);
 		}
 		else
@@ -318,8 +318,7 @@
 		if(!IsRegistered(target_p))
 		{
 			sendto_one_numeric(source_p, ERR_NOSUCHSERVER,
-					   form_str(ERR_NOSUCHSERVER),
-					   parv[server]);
+					   form_str(ERR_NOSUCHSERVER), parv[server]);
 			return HUNTED_NOSUCH;
 		}
 
@@ -426,12 +425,9 @@
 	 */
 #ifndef HIDE_SERVERS_IPS
 	sendto_realops_flags(UMODE_ALL, L_ALL,
-			"Connection to %s[%s] activated.",
-			server_p->name, server_p->host);
+			     "Connection to %s[%s] activated.", server_p->name, server_p->host);
 #else
-	sendto_realops_flags(UMODE_ALL, L_ALL,
-			"Connection to %s activated",
-			server_p->name);
+	sendto_realops_flags(UMODE_ALL, L_ALL, "Connection to %s activated", server_p->name);
 #endif
 
 	serv_connect(server_p, 0);
@@ -469,8 +465,7 @@
 
 		/* XXX: Fix me for IPv6 */
 		/* XXX sockhost is the IPv4 ip as a string */
-		if(match(tmp_p->host, client_p->host) ||
-		   match(tmp_p->host, client_p->sockhost))
+		if(match(tmp_p->host, client_p->host) || match(tmp_p->host, client_p->sockhost))
 		{
 			error = -2;
 
@@ -508,10 +503,10 @@
 #ifdef IPV6
 	if(client_p->localClient->ip.ss_family == AF_INET6)
 	{
-		if(IN6_IS_ADDR_UNSPECIFIED(&((struct sockaddr_in6 *)&server_p->ipnum)->sin6_addr))
+		if(IN6_IS_ADDR_UNSPECIFIED(&((struct sockaddr_in6 *) &server_p->ipnum)->sin6_addr))
 		{
-			memcpy(&((struct sockaddr_in6 *)&server_p->ipnum)->sin6_addr, 
-				&((struct sockaddr_in6 *)&client_p->localClient->ip)->sin6_addr, 
+			memcpy(&((struct sockaddr_in6 *) &server_p->ipnum)->sin6_addr,
+			       &((struct sockaddr_in6 *) &client_p->localClient->ip)->sin6_addr,
 				sizeof(struct in6_addr)); 
 			SET_SS_LEN(server_p->ipnum, sizeof(struct sockaddr_in6));
 		} 
@@ -519,10 +514,11 @@
 	else
 #endif
 	{
-		if(((struct sockaddr_in *)&server_p->ipnum)->sin_addr.s_addr == INADDR_NONE)
+		if(((struct sockaddr_in *) &server_p->ipnum)->sin_addr.s_addr == INADDR_NONE)
 		{
-			((struct sockaddr_in *)&server_p->ipnum)->sin_addr.s_addr = 
-				((struct sockaddr_in *)&client_p->localClient->ip)->sin_addr.s_addr;
+			((struct sockaddr_in *) &server_p->ipnum)->sin_addr.s_addr =
+				((struct sockaddr_in *) &client_p->localClient->ip)->sin_addr.
+				s_addr;
 		}
 		SET_SS_LEN(server_p->ipnum, sizeof(struct sockaddr_in));
 	}
@@ -549,7 +545,7 @@
 
 	t = msgbuf;
 
-	for (cap = captab; cap->name; ++cap)
+	for(cap = captab; cap->name; ++cap)
 	{
 		if(cap->cap & cap_can_send)
 		{
@@ -571,7 +567,7 @@
  * side effects - client is sent a list of +b, or +e, or +I modes
  */
 static void
-burst_modes_TS5(struct Client *client_p, char *chname, dlink_list *list, char flag)
+burst_modes_TS5(struct Client *client_p, char *chname, dlink_list * list, char flag)
 {
 	dlink_node *ptr;
 	struct Ban *banptr;
@@ -627,8 +623,7 @@
  * side effects - client is sent a list of +b, +e, or +I modes
  */
 static void
-burst_modes_TS6(struct Client *client_p, struct Channel *chptr, 
-		dlink_list *list, char flag)
+burst_modes_TS6(struct Client *client_p, struct Channel *chptr, dlink_list * list, char flag)
 {
 	dlink_node *ptr;
 	struct Ban *banptr;
@@ -658,7 +653,7 @@
 			}
 
 			/* chop off trailing space and send.. */
-			*(t-1) = '\0';
+			*(t - 1) = '\0';
 			sendto_one(client_p, "%s", buf);
 			cur_len = mlen;
 			t = buf + mlen;
@@ -672,7 +667,7 @@
 	/* cant ever exit the loop above without having modified buf,
 	 * chop off trailing space and send.
 	 */
-	*(t-1) = '\0';
+	*(t - 1) = '\0';
 	sendto_one(client_p, "%s", buf);
 }
 
@@ -721,8 +716,7 @@
 			   target_p->user->server, target_p->info);
 
 		if(ConfigFileEntry.burst_away && !EmptyString(target_p->user->away))
-			sendto_one(client_p, ":%s AWAY :%s",
-				   target_p->name, target_p->user->away);
+			sendto_one(client_p, ":%s AWAY :%s", target_p->name, target_p->user->away);
 	}
 
 	DLINK_FOREACH(ptr, global_channel_list.head)
@@ -744,7 +738,8 @@
 		channel_modes(chptr, client_p, modebuf, parabuf);
 
 		cur_len = mlen = ircsprintf(buf, ":%s SJOIN %ld %s %s %s:", me.name,
-				(long) chptr->channelts, chptr->chname, modebuf, parabuf);
+					    (long) chptr->channelts, chptr->chname, modebuf,
+					    parabuf);
 
 		t = buf + mlen;
 
@@ -755,6 +750,8 @@
 			tlen = strlen(msptr->client_p->name) + 1;
 			if(is_chanop(msptr))
 				tlen++;
+			if(is_halfop(msptr))
+				tlen++;
 			if(is_voiced(msptr))
 				tlen++;
 
@@ -767,8 +764,9 @@
 				t = buf + mlen;
 			}
 
-			ircsprintf(t, "%s%s ", find_channel_status(msptr, 1), 
-				   msptr->client_p->name);
+			ircsprintf(t, "%s%s ", find_channel_status(msptr, 1,
+								   (IsCapable(client_p, CAP_HOPS)) ?
+								   1 : 0), msptr->client_p->name);
 
 			cur_len += tlen;
 			t += tlen;
@@ -791,8 +789,7 @@
 			sendto_one(client_p, ":%s TB %s %ld %s%s:%s",
 				   me.name, chptr->chname, (long) chptr->topic_time,
 				   ConfigChannel.burst_topicwho ? chptr->topic_info : "",
-				   ConfigChannel.burst_topicwho ? " " : "",
-				   chptr->topic);
+				   ConfigChannel.burst_topicwho ? " " : "", chptr->topic);
 	}
 }
 
@@ -853,8 +850,7 @@
 
 		if(ConfigFileEntry.burst_away && !EmptyString(target_p->user->away))
 			sendto_one(client_p, ":%s AWAY :%s",
-				   use_id(target_p),
-				   target_p->user->away);
+				   use_id(target_p), target_p->user->away);
 	}
 
 	DLINK_FOREACH(ptr, global_channel_list.head)
@@ -876,7 +872,8 @@
 		channel_modes(chptr, client_p, modebuf, parabuf);
 
 		cur_len = mlen = ircsprintf(buf, ":%s SJOIN %ld %s %s %s:", me.name,
-				(long) chptr->channelts, chptr->chname, modebuf, parabuf);
+					    (long) chptr->channelts, chptr->chname, modebuf,
+					    parabuf);
 
 		t = buf + mlen;
 
@@ -887,18 +884,22 @@
 			tlen = strlen(use_id(msptr->client_p)) + 1;
 			if(is_chanop(msptr))
 				tlen++;
+			if(is_halfop(msptr))
+				tlen++;
 			if(is_voiced(msptr))
 				tlen++;
 
 			if(cur_len + tlen >= BUFSIZE - 3)
 			{
-				*(t-1) = '\0';
+				*(t - 1) = '\0';
 				sendto_one(client_p, "%s", buf);
 				cur_len = mlen;
 				t = buf + mlen;
 			}
 
-			ircsprintf(t, "%s%s ", find_channel_status(msptr, 1), 
+			ircsprintf(t, "%s%s ", find_channel_status(msptr, 1,
+								   (IsCapable(client_p, CAP_HOPS) ?
+								    1 : 0)),
 				   use_id(msptr->client_p));
 
 			cur_len += tlen;
@@ -906,26 +907,23 @@
 		}
 
 		/* remove trailing space */
-		*(t-1) = '\0';
+		*(t - 1) = '\0';
 		sendto_one(client_p, "%s", buf);
 
 		if(dlink_list_length(&chptr->banlist) > 0)
 			burst_modes_TS6(client_p, chptr, &chptr->banlist, 'b');
 
-		if(IsCapable(client_p, CAP_EX) &&
-		   dlink_list_length(&chptr->exceptlist) > 0)
+		if(IsCapable(client_p, CAP_EX) && dlink_list_length(&chptr->exceptlist) > 0)
 			burst_modes_TS6(client_p, chptr, &chptr->exceptlist, 'e');
 
-		if(IsCapable(client_p, CAP_IE) &&
-		   dlink_list_length(&chptr->invexlist) > 0)
+		if(IsCapable(client_p, CAP_IE) && dlink_list_length(&chptr->invexlist) > 0)
 			burst_modes_TS6(client_p, chptr, &chptr->invexlist, 'I');
 
 		if(IsCapable(client_p, CAP_TB) && chptr->topic != NULL)
 			sendto_one(client_p, ":%s TB %s %ld %s%s:%s",
 				   me.id, chptr->chname, (long) chptr->topic_time,
 				   ConfigChannel.burst_topicwho ? chptr->topic_info : "",
-				   ConfigChannel.burst_topicwho ? " " : "",
-				   chptr->topic);
+				   ConfigChannel.burst_topicwho ? " " : "", chptr->topic);
 	}
 }
 
@@ -956,7 +954,7 @@
 		return msgbuf;
 	}
 
-	for (cap = captab; cap->cap; ++cap)
+	for(cap = captab; cap->cap; ++cap)
 	{
 		if(cap->cap & target_p->serv->caps)
 		{
@@ -1042,8 +1040,7 @@
 				sendto_one(client_p, "PASS %s TS %d :%s", 
 					   server_p->spasswd, TS_CURRENT, me.id);
 			else
-				sendto_one(client_p, "PASS %s :TS",
-					   server_p->spasswd);
+				sendto_one(client_p, "PASS %s :TS", server_p->spasswd);
 		}
 
 		/* pass info to new server */
@@ -1122,8 +1119,7 @@
 	/* Show the real host/IP to admins */
 	sendto_realops_flags(UMODE_ALL, L_ALL,
 			"Link with %s established: (%s) link",
-			get_server_name(client_p, SHOW_IP),
-			show_capabilities(client_p));
+			     get_server_name(client_p, SHOW_IP), show_capabilities(client_p));
 
 	ilog(L_SERVER, "Link with %s established: (%s) link",
 	     log_client_name(client_p, SHOW_IP), show_capabilities(client_p));
@@ -1157,8 +1153,7 @@
 				   me.id, client_p->name, client_p->id,
 				   IsHidden(client_p) ? "(H) " : "", client_p->info);
 
-			if(IsCapable(target_p, CAP_ENCAP) &&
-			   !EmptyString(client_p->serv->fullcaps))
+			if(IsCapable(target_p, CAP_ENCAP) && !EmptyString(client_p->serv->fullcaps))
 				sendto_one(target_p, ":%s ENCAP * GCAP :%s",
 					client_p->id, client_p->serv->fullcaps);
 		}
@@ -1168,8 +1163,7 @@
 				   me.name, client_p->name,
 				   IsHidden(client_p) ? "(H) " : "", client_p->info);
 
-			if(IsCapable(target_p, CAP_ENCAP) &&
-			   !EmptyString(client_p->serv->fullcaps))
+			if(IsCapable(target_p, CAP_ENCAP) && !EmptyString(client_p->serv->fullcaps))
 				sendto_one(target_p, ":%s ENCAP * GCAP :%s",
 					client_p->name, client_p->serv->fullcaps);
 		}
@@ -1213,11 +1207,9 @@
 				   target_p->name, target_p->hopcount + 1,
 				   IsHidden(target_p) ? "(H) " : "", target_p->info);
 
-		if(IsCapable(client_p, CAP_ENCAP) && 
-		   !EmptyString(target_p->serv->fullcaps))
+		if(IsCapable(client_p, CAP_ENCAP) && !EmptyString(target_p->serv->fullcaps))
 			sendto_one(client_p, ":%s ENCAP * GCAP :%s",
-					get_id(target_p, client_p),
-					target_p->serv->fullcaps);
+				   get_id(target_p, client_p), target_p->serv->fullcaps);
 	}
 
 	if(has_id(client_p))
@@ -1252,7 +1244,7 @@
 		iobuf[c++] = SLINKCMD_START_ZIP_OUT;
 	}
 
-	while (MyConnect(server))
+	while(MyConnect(server))
 	{
 		linecount++;
 
@@ -1272,16 +1264,14 @@
 			break;
 	}
 
-	while (MyConnect(server))
+	while(MyConnect(server))
 	{
 		linecount++;
 
 		iobuf = MyRealloc(iobuf, (c + BUF_DATA_SIZE + 64));
 
 		/* store data in c+3 to allow for SLINKCMD_INJECT_RECVQ and len u16 */
-		linelen = linebuf_get(&server->localClient->buf_sendq, 
-				      (char *) (iobuf + c + 3), READBUF_SIZE, 
-				      LINEBUF_PARTIAL, LINEBUF_PARSED);	/* include partial lines */
+		linelen = linebuf_get(&server->localClient->buf_sendq, (char *) (iobuf + c + 3), READBUF_SIZE, LINEBUF_PARTIAL, LINEBUF_PARSED);	/* include partial lines */
 
 		if(linelen)
 		{
@@ -1330,7 +1320,7 @@
 #ifdef HAVE_SOCKETPAIR
 	if(socketpair(AF_UNIX, SOCK_STREAM, 0, ctrl_fds) < 0)
 #else
-	if(inet_socketpair(AF_INET,SOCK_STREAM, 0, ctrl_fds) < 0)
+	if(inet_socketpair(AF_INET, SOCK_STREAM, 0, ctrl_fds) < 0)
 #endif
 		goto fork_error;
 
@@ -1340,7 +1330,7 @@
 #ifdef HAVE_SOCKETPAIR
 	if(socketpair(AF_UNIX, SOCK_STREAM, 0, data_fds) < 0)
 #else
-	if(inet_socketpair(AF_INET,SOCK_STREAM, 0, data_fds) < 0)
+	if(inet_socketpair(AF_INET, SOCK_STREAM, 0, data_fds) < 0)
 #endif
 		goto fork_error;
 
@@ -1354,11 +1344,12 @@
 	else if(ret == 0)
 	{
 		/* set our fds as non blocking and close everything else */
-		for (i = 0; i < HARD_FDLIMIT; i++)
+		for(i = 0; i < HARD_FDLIMIT; i++)
 		{
 				
 
-			if((i == ctrl_fds[1]) || (i == data_fds[1]) || (i == server->localClient->fd)) 
+			if((i == ctrl_fds[1]) || (i == data_fds[1])
+			   || (i == server->localClient->fd))
 			{
 				comm_set_nb(i);
 			}
@@ -1402,16 +1393,14 @@
 		{
 			report_error(NONB_ERROR_MSG,
 					get_server_name(server, SHOW_IP),
-					log_client_name(server, SHOW_IP),
-					errno);
+				     log_client_name(server, SHOW_IP), errno);
 		}
 
 		if(!comm_set_nb(server->localClient->ctrlfd))
 		{
 			report_error(NONB_ERROR_MSG,
 					get_server_name(server, SHOW_IP),
-					log_client_name(server, SHOW_IP),
-					errno);
+				     log_client_name(server, SHOW_IP), errno);
 		}
 
 		fd_open(server->localClient->ctrlfd, FD_SOCKET, NULL);
@@ -1469,7 +1458,7 @@
 		return 0;
 
 	/* log */
-	inetntop_sock((struct sockaddr *)&server_p->ipnum, buf, sizeof(buf));
+	inetntop_sock((struct sockaddr *) &server_p->ipnum, buf, sizeof(buf));
 	ilog(L_SERVER, "Connect to *[%s] @%s", server_p->name, buf);
 
 	/*
@@ -1517,16 +1506,14 @@
 	{
 		report_error(NONB_ERROR_MSG,
 				get_server_name(client_p, SHOW_IP),
-				log_client_name(client_p, SHOW_IP),
-				errno);
+			     log_client_name(client_p, SHOW_IP), errno);
 	}
 
 	if(!comm_set_buffers(client_p->localClient->fd, READBUF_SIZE))
 	{
 		report_error(SETBUF_ERROR_MSG,
 				get_server_name(client_p, SHOW_IP),
-				log_client_name(client_p, SHOW_IP),
-				errno);
+			     log_client_name(client_p, SHOW_IP), errno);
 	}
 
 	/*
@@ -1566,14 +1553,14 @@
 	if(ServerConfVhosted(server_p))
 	{
 		memcpy(&myipnum, &server_p->my_ipnum, sizeof(myipnum));
-		((struct sockaddr_in *)&myipnum)->sin_port = 0;
+		((struct sockaddr_in *) &myipnum)->sin_port = 0;
 		myipnum.ss_family = server_p->my_ipnum.ss_family;
 				
 	}
 	else if(server_p->ipnum.ss_family == AF_INET && ServerInfo.specific_ipv4_vhost)
 	{
 		memcpy(&myipnum, &ServerInfo.ip, sizeof(myipnum));
-		((struct sockaddr_in *)&myipnum)->sin_port = 0;
+		((struct sockaddr_in *) &myipnum)->sin_port = 0;
 		myipnum.ss_family = AF_INET;
 		SET_SS_LEN(myipnum, sizeof(struct sockaddr_in));
 	}
@@ -1582,7 +1569,7 @@
 	else if((server_p->ipnum.ss_family == AF_INET6) && ServerInfo.specific_ipv6_vhost)
 	{
 		memcpy(&myipnum, &ServerInfo.ip6, sizeof(myipnum));
-		((struct sockaddr_in6 *)&myipnum)->sin6_port = 0;
+		((struct sockaddr_in6 *) &myipnum)->sin6_port = 0;
 		myipnum.ss_family = AF_INET6;
 		SET_SS_LEN(myipnum, sizeof(struct sockaddr_in6));
 	}
@@ -1630,17 +1617,18 @@
 #ifdef IPV6
 	if(fd_table[fd].connect.hostaddr.ss_family == AF_INET6)
 	{
-		struct sockaddr_in6 *lip = (struct sockaddr_in6 *)&client_p->localClient->ip;
-		struct sockaddr_in6 *hip = (struct sockaddr_in6 *)&fd_table[fd].connect.hostaddr;	
+		struct sockaddr_in6 *lip = (struct sockaddr_in6 *) &client_p->localClient->ip;
+		struct sockaddr_in6 *hip = (struct sockaddr_in6 *) &fd_table[fd].connect.hostaddr;
 		memcpy(&lip->sin6_addr, &hip->sin6_addr, sizeof(struct in6_addr));
 		SET_SS_LEN(client_p->localClient->ip, sizeof(struct sockaddr_in6));
 		SET_SS_LEN(fd_table[fd].connect.hostaddr, sizeof(struct sockaddr_in6));
 
-	} else
+	}
+	else
 #else
 	{
-		struct sockaddr_in *lip = (struct sockaddr_in *)&client_p->localClient->ip;
-		struct sockaddr_in *hip = (struct sockaddr_in *)&fd_table[fd].connect.hostaddr;	
+		struct sockaddr_in *lip = (struct sockaddr_in *) &client_p->localClient->ip;
+		struct sockaddr_in *hip = (struct sockaddr_in *) &fd_table[fd].connect.hostaddr;
 		lip->sin_addr.s_addr = hip->sin_addr.s_addr;
 		SET_SS_LEN(client_p->localClient->ip, sizeof(struct sockaddr_in));
 		SET_SS_LEN(fd_table[fd].connect.hostaddr, sizeof(struct sockaddr_in));
@@ -1655,8 +1643,7 @@
 		 */
 		if(status == COMM_ERR_TIMEOUT)
 			sendto_realops_flags(UMODE_ALL, L_ALL,
-					"Error connecting to %s[%s]: %s",
-					client_p->name, 
+					     "Error connecting to %s[%s]: %s", client_p->name,
 #ifdef HIDE_SERVERS_IPS
 					"255.255.255.255",
 #else
@@ -1665,8 +1652,7 @@
 					comm_errstr(status));
 		else
 			sendto_realops_flags(UMODE_ALL, L_ALL,
-					"Error connecting to %s[%s]: %s (%s)",
-					client_p->name,
+					     "Error connecting to %s[%s]: %s (%s)", client_p->name,
 #ifdef HIDE_SERVERS_IPS
 					"255.255.255.255",
 #else
@@ -1700,8 +1686,7 @@
 			sendto_one(client_p, "PASS %s TS %d :%s", 
 				   server_p->spasswd, TS_CURRENT, me.id);
 		else
-			sendto_one(client_p, "PASS %s :TS",
-				   server_p->spasswd);
+			sendto_one(client_p, "PASS %s :TS", server_p->spasswd);
 	}
 
 	/* pass my info to the new server */
@@ -1710,8 +1695,7 @@
 			  | (ServerConfTb(server_p) ? CAP_TB : 0));
 
 	sendto_one(client_p, "SERVER %s 1 :%s%s",
-		   me.name,
-		   ConfigServerHide.hidden ? "(H) " : "", me.info);
+		   me.name, ConfigServerHide.hidden ? "(H) " : "", me.info);
 
 	/* 
 	 * If we've been marked dead because a send failed, just exit
@@ -1748,13 +1732,15 @@
 		errno = EAFNOSUPPORT;
 		return -1;
 	}
-	if(((sv[0] = socket(AF_INET, SOCK_STREAM, 0)) < 0) || ((sv[1] = socket(AF_INET, SOCK_STREAM, 0)) < 0))
+	if(((sv[0] = socket(AF_INET, SOCK_STREAM, 0)) < 0)
+	   || ((sv[1] = socket(AF_INET, SOCK_STREAM, 0)) < 0))
 		return -1;
 	
 	addr1.sin_port = htons(port_no);
 	addr1.sin_family = AF_INET;
 	addr1.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
-	while ((rc = bind (sv[0], (struct sockaddr *) &addr1, sizeof (addr1))) < 0 && errno == EADDRINUSE)
+	while((rc = bind(sv[0], (struct sockaddr *) &addr1, sizeof(addr1))) < 0
+	      && errno == EADDRINUSE)
 		addr1.sin_port = htons(++port_no);
 	
 	if(rc < 0)
@@ -1770,7 +1756,7 @@
 	addr2.sin_port = htons(port_no);
 	addr2.sin_family = AF_INET;
 	addr2.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
-	if(connect (sv[1], (struct sockaddr *) &addr2, sizeof (addr2)) < 0) 
+	if(connect(sv[1], (struct sockaddr *) &addr2, sizeof(addr2)) < 0)
 	{
 		close(sv[0]);
 		close(sv[1]);
@@ -1786,7 +1772,7 @@
 	close(sv[0]);
 	sv[0] = fd;
 	
-	return(0);
+	return (0);
 
 }
 #endif
Index: src/s_stats.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/Attic/s_stats.c,v
retrieving revision 7.36.2.1
diff -b -u -r7.36.2.1 s_stats.c
--- src/s_stats.c	4 Aug 2004 00:21:17 -0000	7.36.2.1
+++ src/s_stats.c	19 Aug 2004 22:16:44 -0000
@@ -125,37 +125,26 @@
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
 			"T :rejected %u delaying %lu", 
 			sp->is_rej, dlink_list_length(&delay_exit));
+	sendto_one_numeric(source_p, RPL_STATSDEBUG, "T :nicks being delayed %lu", get_nd_count());
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
-			"T :nicks being delayed %lu",
-			get_nd_count());
+			   "T :unknown commands %u prefixes %u", sp->is_unco, sp->is_unpf);
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
-			   "T :unknown commands %u prefixes %u",
-			   sp->is_unco, sp->is_unpf);
+			   "T :nick collisions %u unknown closes %u", sp->is_kill, sp->is_ni);
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
-			   "T :nick collisions %u unknown closes %u",
-			   sp->is_kill, sp->is_ni);
+			   "T :wrong direction %u empty %u", sp->is_wrdi, sp->is_empt);
+	sendto_one_numeric(source_p, RPL_STATSDEBUG, "T :numerics seen %u", sp->is_num);
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
-			   "T :wrong direction %u empty %u", 
-			   sp->is_wrdi, sp->is_empt);
-	sendto_one_numeric(source_p, RPL_STATSDEBUG,
-			   "T :numerics seen %u", sp->is_num);
-	sendto_one_numeric(source_p, RPL_STATSDEBUG,
-			   "T :auth successes %u fails %u",
-			   sp->is_asuc, sp->is_abad);
+			   "T :auth successes %u fails %u", sp->is_asuc, sp->is_abad);
 	sendto_one_numeric(source_p, RPL_STATSDEBUG, "T :Client Server");
-	sendto_one_numeric(source_p, RPL_STATSDEBUG,
-			   "T :connected %u %u", sp->is_cl, sp->is_sv);
+	sendto_one_numeric(source_p, RPL_STATSDEBUG, "T :connected %u %u", sp->is_cl, sp->is_sv);
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
 			   "T :bytes sent %d.%uK %d.%uK",
-			   (int) sp->is_cks, sp->is_cbs, 
-			   (int) sp->is_sks, sp->is_sbs);
+			   (int) sp->is_cks, sp->is_cbs, (int) sp->is_sks, sp->is_sbs);
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
 			   "T :bytes recv %d.%uK %d.%uK",
-			   (int) sp->is_ckr, sp->is_cbr, 
-			   (int) sp->is_skr, sp->is_sbr);
+			   (int) sp->is_ckr, sp->is_cbr, (int) sp->is_skr, sp->is_sbr);
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
-			   "T :time connected %d %d",
-			   (int) sp->is_cti, (int) sp->is_sti);
+			   "T :time connected %d %d", (int) sp->is_cti, (int) sp->is_sti);
 }
 
 void
@@ -295,31 +284,25 @@
 
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
 			   "z :Classes %u(%lu)",
-			   class_count, 
-			   (unsigned long) class_count * sizeof(struct Class));
+			   class_count, (unsigned long) class_count * sizeof(struct Class));
 
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
-			   "z :Channels %u(%d)",
-			   channel_count, (int) channel_memory);
+			   "z :Channels %u(%d)", channel_count, (int) channel_memory);
 
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
-			   "z :Bans %u(%d)",
-			   channel_bans, (int) channel_ban_memory);
+			   "z :Bans %u(%d)", channel_bans, (int) channel_ban_memory);
 
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
-			   "z :Exceptions %u(%d)",
-			   channel_except, (int) channel_except_memory);
+			   "z :Exceptions %u(%d)", channel_except, (int) channel_except_memory);
 
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
-			   "z :Invex %u(%d)",
-			   channel_invex, (int) channel_invex_memory);
+			   "z :Invex %u(%d)", channel_invex, (int) channel_invex_memory);
 
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
 			   "z :Channel members %u(%lu) invite %u(%lu)",
 			   channel_users,
 			   (unsigned long) channel_users * sizeof(dlink_node),
-			   channel_invites, 
-			   (unsigned long) channel_invites * sizeof(dlink_node));
+			   channel_invites, (unsigned long) channel_invites * sizeof(dlink_node));
 
 	total_channel_memory = channel_memory +
 		channel_ban_memory +
@@ -327,32 +310,30 @@
 
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
 			   "z :Whowas users %ld(%ld)",
-			   (long)wwu, (long) (wwu * sizeof(struct User)));
+			   (long) wwu, (long) (wwu * sizeof(struct User)));
 
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
-			   "z :Whowas array %u(%d)",
-			   NICKNAMEHISTORYLENGTH, (int) wwm);
+			   "z :Whowas array %u(%d)", NICKNAMEHISTORYLENGTH, (int) wwm);
 
 	totww = wwu * sizeof(struct User) + wwm;
 
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
 			   "z :Hash: client %u(%ld) chan %u(%ld)",
-			   U_MAX, (long)(U_MAX * sizeof(dlink_list)), 
-			   CH_MAX, (long)(CH_MAX * sizeof(dlink_list)));
+			   U_MAX, (long) (U_MAX * sizeof(dlink_list)),
+			   CH_MAX, (long) (CH_MAX * sizeof(dlink_list)));
 
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
-			   "z :linebuf %ld(%ld)",
-			   (long)linebuf_count, (long)linebuf_memory_used);
+			   "z :linebuf %ld(%ld)", (long) linebuf_count, (long) linebuf_memory_used);
 
 	count_scache(&number_servers_cached, &mem_servers_cached);
 
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
 			   "z :scache %ld(%ld)",
-			   (long)number_servers_cached, (long)mem_servers_cached);
+			   (long) number_servers_cached, (long) mem_servers_cached);
 
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
 			   "z :hostname hash %d(%ld)",
-			   HOST_MAX, (long)HOST_MAX * sizeof(dlink_list));
+			   HOST_MAX, (long) HOST_MAX * sizeof(dlink_list));
 
 	total_memory = totww + total_channel_memory + conf_memory +
 		class_count * sizeof(struct Class);
@@ -360,15 +341,14 @@
 	total_memory += mem_servers_cached;
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
 			   "z :Total: whowas %d channel %d conf %d", 
-			   (int) totww, (int) total_channel_memory, 
-			   (int) conf_memory);
+			   (int) totww, (int) total_channel_memory, (int) conf_memory);
 
 	count_local_client_memory(&local_client_count, &local_client_memory_used);
 	total_memory += local_client_memory_used;
 
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
 			   "z :Local client Memory in use: %ld(%ld)",
-			   (long)local_client_count, (long)local_client_memory_used);
+			   (long) local_client_count, (long) local_client_memory_used);
 
 
 	count_remote_client_memory(&remote_client_count, &remote_client_memory_used);
@@ -376,8 +356,7 @@
 
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
 			   "z :Remote client Memory in use: %ld(%ld)",
-			   (long)remote_client_count,
-			   (long)remote_client_memory_used);
+			   (long) remote_client_count, (long) remote_client_memory_used);
 
 	sendto_one_numeric(source_p, RPL_STATSDEBUG,
 			   "z :TOTAL: %d Available:  Current max RSS: %lu",
Index: src/s_user.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/s_user.c,v
retrieving revision 7.323.2.2
diff -b -u -r7.323.2.2 s_user.c
--- src/s_user.c	3 Aug 2004 20:39:52 -0000	7.323.2.2
+++ src/s_user.c	19 Aug 2004 22:16:45 -0000
@@ -178,13 +178,11 @@
 			   Count.invisi, dlink_list_length(&global_serv_list));
 
 	if(Count.oper > 0)
-		sendto_one_numeric(source_p, RPL_LUSEROP, 
-				   form_str(RPL_LUSEROP), Count.oper);
+		sendto_one_numeric(source_p, RPL_LUSEROP, form_str(RPL_LUSEROP), Count.oper);
 
 	if(dlink_list_length(&unknown_list) > 0)
 		sendto_one_numeric(source_p, RPL_LUSERUNKNOWN, 
-				   form_str(RPL_LUSERUNKNOWN),
-				   dlink_list_length(&unknown_list));
+				   form_str(RPL_LUSERUNKNOWN), dlink_list_length(&unknown_list));
 
 	if(dlink_list_length(&global_channel_list) > 0)
 		sendto_one_numeric(source_p, RPL_LUSERCHANNELS, 
@@ -192,27 +190,24 @@
 				   dlink_list_length(&global_channel_list));
 
 	sendto_one_numeric(source_p, RPL_LUSERME, form_str(RPL_LUSERME),
-			   dlink_list_length(&lclient_list),
-			   dlink_list_length(&serv_list));
+			   dlink_list_length(&lclient_list), dlink_list_length(&serv_list));
 
 	sendto_one_numeric(source_p, RPL_LOCALUSERS, 
 			   form_str(RPL_LOCALUSERS),
-			   dlink_list_length(&lclient_list),
-			   Count.max_loc);
+			   dlink_list_length(&lclient_list), Count.max_loc);
 
 	sendto_one_numeric(source_p, RPL_GLOBALUSERS, form_str(RPL_GLOBALUSERS),
 			   Count.total, Count.max_tot);
 
 	sendto_one_numeric(source_p, RPL_STATSCONN,
 			   form_str(RPL_STATSCONN),
-			   MaxConnectionCount, MaxClientCount, 
-			   Count.totalrestartcount);
+			   MaxConnectionCount, MaxClientCount, Count.totalrestartcount);
 
-	if(dlink_list_length(&lclient_list) > (unsigned long)MaxClientCount)
+	if(dlink_list_length(&lclient_list) > (unsigned long) MaxClientCount)
 		MaxClientCount = dlink_list_length(&lclient_list);
 
 	if((dlink_list_length(&lclient_list) + dlink_list_length(&serv_list)) >
-	   (unsigned long)MaxConnectionCount)
+	   (unsigned long) MaxConnectionCount)
 		MaxConnectionCount = dlink_list_length(&lclient_list) + 
 					dlink_list_length(&serv_list);
 
@@ -266,13 +261,14 @@
 */
 
 int
-register_local_user(struct Client *client_p, struct Client *source_p, const char *nick, const char *username)
+register_local_user(struct Client *client_p, struct Client *source_p, const char *nick,
+		    const char *username)
 {
 	struct ConfItem *aconf;
 	struct User *user = source_p->user;
 	char tmpstr2[IRCD_BUFSIZE];
 	char ipaddr[HOSTIPLEN];
-	char myusername[USERLEN+1];
+	char myusername[USERLEN + 1];
 	int status;
 
 	s_assert(NULL != source_p);
@@ -374,7 +370,7 @@
 			if(!IsNoTilde(aconf))
 				source_p->username[i++] = '~';
 
-			while (*p && i < USERLEN)
+			while(*p && i < USERLEN)
 			{
 				if(*p != '[')
 					source_p->username[i++] = *p;
@@ -426,9 +422,9 @@
 	 */
 	/* Except "F:" clients */
 	if(((dlink_list_length(&lclient_list) + 1) >= 
-	   ((unsigned long)GlobalSetOptions.maxclients + MAX_BUFFER) ||
+	    ((unsigned long) GlobalSetOptions.maxclients + MAX_BUFFER) ||
            (dlink_list_length(&lclient_list) + 1) >= 
-	    ((unsigned long)GlobalSetOptions.maxclients - 5)) && !(IsExemptLimits(source_p)))
+	    ((unsigned long) GlobalSetOptions.maxclients - 5)) && !(IsExemptLimits(source_p)))
 	{
 		sendto_realops_flags(UMODE_FULL, L_ALL,
 				     "Too many clients, rejecting %s[%s].", nick, source_p->host);
@@ -454,8 +450,7 @@
 	/* end of valid user name check */
 
 	/* kline exemption extends to xline too */
-	if(!IsExemptKline(source_p) &&
-	   find_xline(source_p->info, 1) != NULL)
+	if(!IsExemptKline(source_p) && find_xline(source_p->info, 1) != NULL)
 	{
 		ServerStats->is_ref++;
 		add_reject(source_p);
@@ -472,7 +467,7 @@
 	if(IsAnyDead(client_p))
 		return CLIENT_EXITED;
 
-	inetntop_sock((struct sockaddr *)&source_p->localClient->ip, ipaddr, sizeof(ipaddr));
+	inetntop_sock((struct sockaddr *) &source_p->localClient->ip, ipaddr, sizeof(ipaddr));
 
 	sendto_realops_flags(UMODE_CCONN, L_ALL,
 			     "Client connecting: %s (%s@%s) [%s] {%s} [%s]",
@@ -511,7 +506,7 @@
 
 	s_assert(source_p->localClient != NULL);
 
-	if(dlink_list_length(&lclient_list) > (unsigned long)Count.max_loc)
+	if(dlink_list_length(&lclient_list) > (unsigned long) Count.max_loc)
 	{
 		Count.max_loc = dlink_list_length(&lclient_list);
 		if(!(Count.max_loc % 10))
@@ -533,7 +528,8 @@
  *		  from a remote connect.
  */
 int
-introduce_client(struct Client *client_p, struct Client *source_p, struct User *user, const char *nick)
+introduce_client(struct Client *client_p, struct Client *source_p, struct User *user,
+		 const char *nick)
 {
 	static char ubuf[12];
 
@@ -559,7 +555,8 @@
 			sockhost[0] = '0';
 			sockhost[1] = '\0';
 			strlcat(sockhost, source_p->sockhost, sizeof(sockhost));
-		} else
+		}
+		else
 			strcpy(sockhost, source_p->sockhost);
 		
 		sendto_server(client_p, NULL, CAP_TS6, NOCAPS,
@@ -568,8 +565,7 @@
 			      source_p->hopcount + 1,
 			      (long) source_p->tsinfo, ubuf,
 			      source_p->username, source_p->host,
-			      IsIPSpoof(source_p) ? "0" : sockhost,
-			      source_p->id, source_p->info);
+			      IsIPSpoof(source_p) ? "0" : sockhost, source_p->id, source_p->info);
 
 		sendto_server(client_p, NULL, NOCAPS, CAP_TS6,
 			      "NICK %s %d %ld %s %s %s %s :%s",
@@ -614,7 +610,7 @@
 	if('.' == *p || ':' == *p)
 		return NO;
 
-	while (*p)
+	while(*p)
 	{
 		if(!IsHostChar(*p))
 			return NO;
@@ -624,7 +620,7 @@
 	}
 
 	if(found_sep == 0)
-		return(NO);
+		return (NO);
 
 	return (YES);
 }
@@ -662,7 +658,7 @@
 	if(!IsAlNum(*p))
 		return NO;
 
-	while (*++p)
+	while(*++p)
 	{
 		if((*p == '.') && ConfigFileEntry.dots_in_ident)
 		{
@@ -821,7 +817,7 @@
 		m = buf;
 		*m++ = '+';
 
-		for (i = 0; user_modes[i].letter && (m - buf < BUFSIZE - 4); i++)
+		for(i = 0; user_modes[i].letter && (m - buf < BUFSIZE - 4); i++)
 			if(source_p->umodes & user_modes[i].mode)
 				*m++ = user_modes[i].letter;
 		*m = '\0';
@@ -835,8 +831,8 @@
 	/*
 	 * parse mode change string(s)
 	 */
-	for (p = &parv[2]; p && *p; p++)
-		for (pm = *p; *pm; pm++)
+	for(p = &parv[2]; p && *p; p++)
+		for(pm = *p; *pm; pm++)
 			switch (*pm)
 			{
 			case '+':
@@ -966,7 +962,7 @@
 	m = umode_buf;
 	*m = '\0';
 
-	for (i = 0; user_modes[i].letter; i++)
+	for(i = 0; user_modes[i].letter; i++)
 	{
 		flag = user_modes[i].mode;
 
@@ -1023,8 +1019,7 @@
 		if((target_p != client_p) && (target_p != source_p) && (*buf))
 		{
 			sendto_one(target_p, ":%s MODE %s :%s",
-				   get_id(source_p, target_p), 
-				   get_id(source_p, target_p), buf);
+				   get_id(source_p, target_p), get_id(source_p, target_p), buf);
 		}
 	}
 
@@ -1065,8 +1060,7 @@
 			   "NOTICE %s :*** Notice -- Please read the motd if you haven't read it",
 			   source_p->name);
 
-		sendto_one(source_p, form_str(RPL_MOTDSTART), 
-			   me.name, source_p->name, me.name);
+		sendto_one(source_p, form_str(RPL_MOTDSTART), me.name, source_p->name, me.name);
 
 		sendto_one(source_p, form_str(RPL_MOTD),
 			   me.name, source_p->name, "*** This is the short motd ***");
Index: src/scache.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/scache.c,v
retrieving revision 7.24
diff -b -u -r7.24 scache.c
--- src/scache.c	15 Mar 2004 17:58:08 -0000	7.24
+++ src/scache.c	19 Aug 2004 22:16:45 -0000
@@ -68,7 +68,7 @@
 	int hash_value;
 
 	hash_value = 0;
-	while (*string)
+	while(*string)
 	{
 		hash_value += ToLower(*string++);
 	}
@@ -91,7 +91,7 @@
 	SCACHE *ptr;
 
 	ptr = scache_hash[hash_index = sc_hash(name)];
-	for (; ptr; ptr = ptr->next)
+	for(; ptr; ptr = ptr->next)
 	{
 		if(!irccmp(ptr->name, name))
 			return (ptr->name);
@@ -123,10 +123,10 @@
 	*number_servers_cached = 0;
 	*mem_servers_cached = 0;
 
-	for (i = 0; i < SCACHE_HASH_SIZE; i++)
+	for(i = 0; i < SCACHE_HASH_SIZE; i++)
 	{
 		scache_ptr = scache_hash[i];
-		while (scache_ptr)
+		while(scache_ptr)
 		{
 			*number_servers_cached = *number_servers_cached + 1;
 			*mem_servers_cached = *mem_servers_cached +
Index: src/select.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/select.c,v
retrieving revision 7.41
diff -b -u -r7.41 select.c
--- src/select.c	15 Apr 2004 01:45:31 -0000	7.41
+++ src/select.c	19 Aug 2004 22:16:45 -0000
@@ -170,7 +170,7 @@
 	memcpy(&tmpreadfds, &select_readfds, sizeof(fd_set));
 	memcpy(&tmpwritefds, &select_writefds, sizeof(fd_set));
 
-	for (;;)
+	for(;;)
 	{
 		to.tv_sec = 0;
 		to.tv_usec = delay * 1000;
@@ -190,7 +190,7 @@
 		return 0;
 
 	/* XXX we *could* optimise by falling out after doing num fds ... */
-	for (fd = 0; fd < highest_fd + 1; fd++)
+	for(fd = 0; fd < highest_fd + 1; fd++)
 	{
 		F = &fd_table[fd];
 
@@ -220,4 +220,3 @@
 	}
 	return 0;
 }
-
Index: src/send.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/send.c,v
retrieving revision 7.280
diff -b -u -r7.280 send.c
--- src/send.c	7 Jun 2004 00:39:45 -0000	7.280
+++ src/send.c	19 Aug 2004 22:16:46 -0000
@@ -58,7 +58,7 @@
  * side effects - linebuf is attached to client
  */
 static int
-_send_linebuf(struct Client *to, buf_head_t *linebuf)
+_send_linebuf(struct Client *to, buf_head_t * linebuf)
 {
 	if(IsMe(to))
 	{
@@ -81,8 +81,7 @@
 
 			ilog(L_SERVER, "Max SendQ limit exceeded for %s: %u > %lu",
 			     log_client_name(to, SHOW_IP),
-			     linebuf_len(&to->localClient->buf_sendq), 
-			     get_sendq(to));
+			     linebuf_len(&to->localClient->buf_sendq), get_sendq(to));
 		}
 
 		if(IsClient(to))
@@ -107,7 +106,8 @@
 	to->localClient->sendM += 1;
 	me.localClient->sendM += 1;
 	if(linebuf_len(&to->localClient->buf_sendq) > 0)
-		comm_setselect(to->localClient->fd, FDLIST_IDLECLIENT, COMM_SELECT_WRITE, send_queued_write, to, 0);
+		comm_setselect(to->localClient->fd, FDLIST_IDLECLIENT, COMM_SELECT_WRITE,
+			       send_queued_write, to, 0);
 	return 0;
 }
 
@@ -118,7 +118,7 @@
  * side effects - client has linebuf attached
  */
 static void
-send_linebuf_remote(struct Client *to, struct Client *from, buf_head_t *linebuf)
+send_linebuf_remote(struct Client *to, struct Client *from, buf_head_t * linebuf)
 {
 	if(to->from)
 		to = to->from;
@@ -139,8 +139,7 @@
 				     to->name, to->username, to->host,
 				     from->name, from->username, from->host, to->from->name);
 		kill_client_serv_butone(NULL, to, "%s (%s[%s@%s] Ghosted %s)",
-					me.name, to->name, to->username,
-					to->host, to->from->name);
+					me.name, to->name, to->username, to->host, to->from->name);
 
 		to->flags |= FLAGS_KILLED;
 
@@ -179,7 +178,7 @@
 
 	if(linebuf_len(&to->localClient->buf_sendq))
 	{
-		while ((retlen =
+		while((retlen =
 			linebuf_flush(to->localClient->fd, &to->localClient->buf_sendq)) > 0)
 		{
 			/* We have some data written .. update counters */
@@ -214,12 +213,11 @@
 		}
 	}
 	if(ignoreErrno(errno))
-		flags = COMM_SELECT_WRITE|COMM_SELECT_RETRY;
+		flags = COMM_SELECT_WRITE | COMM_SELECT_RETRY;
 	else
 		flags = COMM_SELECT_WRITE;
 	if(linebuf_len(&to->localClient->buf_sendq))
-	comm_setselect(fd, FDLIST_IDLECLIENT, flags,
-			       send_queued_write, to, 0);
+		comm_setselect(fd, FDLIST_IDLECLIENT, flags, send_queued_write, to, 0);
 }
 
 /* send_queued_slink_write()
@@ -282,7 +280,8 @@
 	/* if we have any more data, reschedule a write */
 	if(to->localClient->slinkq_len)
 		comm_setselect(to->localClient->ctrlfd, FDLIST_IDLECLIENT,
-			       COMM_SELECT_WRITE|COMM_SELECT_RETRY, send_queued_slink_write, to, 0);
+			       COMM_SELECT_WRITE | COMM_SELECT_RETRY, send_queued_slink_write, to,
+			       0);
 }
 
 /* sendto_one()
@@ -349,8 +348,7 @@
 	va_start(args, pattern);
 	linebuf_putmsg(&linebuf, pattern, &args,
 		       ":%s %s %s ",
-		       get_id(source_p, target_p),
-		       command, get_id(target_p, target_p));
+		       get_id(source_p, target_p), command, get_id(target_p, target_p));
 	va_end(args);
 
 	_send_linebuf(dest_p, &linebuf);
@@ -388,8 +386,7 @@
 	linebuf_newbuf(&linebuf);
 	va_start(args, pattern);
 	linebuf_putmsg(&linebuf, pattern, &args,
-		       ":%s NOTICE %s ",
-		       get_id(&me, target_p), get_id(target_p, target_p));
+		       ":%s NOTICE %s ", get_id(&me, target_p), get_id(target_p, target_p));
 	va_end(args);
 
 	_send_linebuf(dest_p, &linebuf);
@@ -428,9 +425,7 @@
 	linebuf_newbuf(&linebuf);
 	va_start(args, pattern);
 	linebuf_putmsg(&linebuf, pattern, &args,
-		       ":%s %03d %s ",
-		       get_id(&me, target_p),
-		       numeric, get_id(target_p, target_p));
+		       ":%s %03d %s ", get_id(&me, target_p), numeric, get_id(target_p, target_p));
 	va_end(args);
 
 	_send_linebuf(dest_p, &linebuf);
@@ -527,13 +522,10 @@
 	va_start(args, pattern);
 
 	if(IsServer(source_p))
-		linebuf_putmsg(&linebuf_local, pattern, &args,
-			       ":%s ", source_p->name);
+		linebuf_putmsg(&linebuf_local, pattern, &args, ":%s ", source_p->name);
 	else
 		linebuf_putmsg(&linebuf_local, pattern, &args,
-			       ":%s!%s@%s ",
-			       source_p->name, source_p->username, 
-			       source_p->host);
+			       ":%s!%s@%s ", source_p->name, source_p->username, source_p->host);
 
 	linebuf_putmsg(&linebuf_name, pattern, &args, ":%s ", source_p->name);
 	linebuf_putmsg(&linebuf_id, pattern, &args, ":%s ", use_id(source_p));
@@ -658,8 +650,7 @@
 			msptr = uptr->data;
 			target_p = msptr->client_p;
 
-			if(IsIOError(target_p) ||
-			   target_p->serial == current_serial)
+			if(IsIOError(target_p) || target_p->serial == current_serial)
 				continue;
 
 			target_p->serial = current_serial;
@@ -701,8 +692,7 @@
 	va_start(args, pattern);
 
 	if(IsServer(source_p))
-		linebuf_putmsg(&linebuf_local, pattern, &args, ":%s ", 
-			       source_p->name);
+		linebuf_putmsg(&linebuf_local, pattern, &args, ":%s ", source_p->name);
 	else
 		linebuf_putmsg(&linebuf_local, pattern, &args, ":%s!%s@%s ",
 			       source_p->name, source_p->username, source_p->host);
@@ -834,19 +824,16 @@
 	{
 		if(IsServer(source_p))
 			linebuf_putmsg(&linebuf, pattern, &args, ":%s %s %s ",
-				       source_p->name, command, 
-				       target_p->name);
+				       source_p->name, command, target_p->name);
 		else
 			linebuf_putmsg(&linebuf, pattern, &args, 
 				       ":%s!%s@%s %s %s ", 
 				       source_p->name, source_p->username,
-				       source_p->host, command,
-				       target_p->name);
+				       source_p->host, command, target_p->name);
 	}
 	else
 		linebuf_putmsg(&linebuf, pattern, &args, ":%s %s %s ",
-			       get_id(source_p, target_p), command,
-			       get_id(target_p, target_p));
+			       get_id(source_p, target_p), command, get_id(target_p, target_p));
 	va_end(args);
 
 	if(MyClient(target_p))
@@ -875,8 +862,7 @@
 	linebuf_newbuf(&linebuf);
 
 	va_start(args, pattern);
-	linebuf_putmsg(&linebuf, pattern, &args, 
-		       ":%s NOTICE * :*** Notice -- ", me.name);
+	linebuf_putmsg(&linebuf, pattern, &args, ":%s NOTICE * :*** Notice -- ", me.name);
 	va_end(args);
 
 	DLINK_FOREACH_SAFE(ptr, next_ptr, oper_list.head)
@@ -992,10 +978,8 @@
 	linebuf_newbuf(&linebuf_id);
 	
 	va_start(args, pattern);
-	linebuf_putmsg(&linebuf_name, pattern, &args, ":%s KILL %s :",
-		       me.name, target_p->name);
-	linebuf_putmsg(&linebuf_id, pattern, &args, ":%s KILL %s :",
-		       use_id(&me), use_id(target_p));
+	linebuf_putmsg(&linebuf_name, pattern, &args, ":%s KILL %s :", me.name, target_p->name);
+	linebuf_putmsg(&linebuf_id, pattern, &args, ":%s KILL %s :", use_id(&me), use_id(target_p));
 	va_end(args);
 
 	DLINK_FOREACH_SAFE(ptr, next_ptr, serv_list.head)
Index: src/snprintf.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/snprintf.c,v
retrieving revision 1.13
diff -b -u -r1.13 snprintf.c
--- src/snprintf.c	14 Oct 2003 16:34:22 -0000	1.13
+++ src/snprintf.c	19 Aug 2004 22:16:46 -0000
@@ -285,7 +285,7 @@
 	int written = 0;	/* bytes written so far */
 	int maxbytes = bytes - 1;
 
-	while ((ch = *format++) && (written < maxbytes))
+	while((ch = *format++) && (written < maxbytes))
 	{
 		if(ch == '%')
 		{
@@ -302,7 +302,7 @@
 			{
 				const char *str = va_arg(args, const char *);
 
-				while ((*dest = *str))
+				while((*dest = *str))
 				{
 					++dest;
 					++str;
@@ -376,23 +376,23 @@
 
 					str = IntTable[num - (quotient * TABLE_MAX)];
 
-					while ((*digitptr = *str))
+					while((*digitptr = *str))
 					{
 						++digitptr;
 						++str;
 					}
 				}
-				while ((num = quotient) != 0);
+				while((num = quotient) != 0);
 
 				/*
 				 * If the last quotient was a 1 or 2 digit number, there
 				 * will be one or more leading zeroes in TempBuffer[] -
 				 * get rid of them.
 				 */
-				while (*(digitptr - 1) == '0')
+				while(*(digitptr - 1) == '0')
 					--digitptr;
 
-				while (digitptr != TempBuffer)
+				while(digitptr != TempBuffer)
 				{
 					*dest++ = *--digitptr;
 					if(++written >= maxbytes)
@@ -435,18 +435,18 @@
 
 					str = IntTable[num - (quotient * TABLE_MAX)];
 
-					while ((*digitptr = *str))
+					while((*digitptr = *str))
 					{
 						++digitptr;
 						++str;
 					}
 				}
-				while ((num = quotient) != 0);
+				while((num = quotient) != 0);
 
-				while (*(digitptr - 1) == '0')
+				while(*(digitptr - 1) == '0')
 					--digitptr;
 
-				while (digitptr != TempBuffer)
+				while(digitptr != TempBuffer)
 				{
 					*dest++ = *--digitptr;
 					if(++written >= maxbytes)
@@ -484,18 +484,18 @@
 
 						str = IntTable[num - (quotient * TABLE_MAX)];
 
-						while ((*digitptr = *str))
+						while((*digitptr = *str))
 						{
 							++digitptr;
 							++str;
 						}
 					}
-					while ((num = quotient) != 0);
+					while((num = quotient) != 0);
 
-					while (*(digitptr - 1) == '0')
+					while(*(digitptr - 1) == '0')
 						--digitptr;
 
-					while (digitptr != TempBuffer)
+					while(digitptr != TempBuffer)
 					{
 						*dest++ = *--digitptr;
 						if(++written >= maxbytes)
@@ -503,9 +503,9 @@
 					}
 
 					continue;
-				} else	/* if (*format == 'u') */
-
-				if(*format == 'd')
+				}
+				else
+					/* if (*format == 'u') */ if(*format == 'd')
 				{
 					long num = va_arg(args, long);
 					long quotient;
@@ -536,18 +536,18 @@
 
 						str = IntTable[num - (quotient * TABLE_MAX)];
 
-						while ((*digitptr = *str))
+						while((*digitptr = *str))
 						{
 							++digitptr;
 							++str;
 						}
 					}
-					while ((num = quotient) != 0);
+					while((num = quotient) != 0);
 
-					while (*(digitptr - 1) == '0')
+					while(*(digitptr - 1) == '0')
 						--digitptr;
 
-					while (digitptr != TempBuffer)
+					while(digitptr != TempBuffer)
 					{
 						*dest++ = *--digitptr;
 						if(++written >= maxbytes)
@@ -555,15 +555,16 @@
 					}
 
 					continue;
-				} else	/* if (*format == 'd') */
+				}
+				else	/* if (*format == 'd') */
 				{
 					int ret;
 					format -= 2;
-					#ifdef HAVE_VSNPRINTF
+#ifdef HAVE_VSNPRINTF
 						ret = vsnprintf(dest, maxbytes - written, format, args);
-					#else
+#else
 						ret = vsprintf(dest, format, args);
-					#endif
+#endif
 					dest += ret;
 					written += ret;
 					break;
@@ -583,11 +584,11 @@
 				 */
 
 				format -= 2;
-                                #ifdef HAVE_VSNPRINTF
+#ifdef HAVE_VSNPRINTF
                                 	ret = vsnprintf(dest, maxbytes - written, format, args);
-                                #else
+#else
                                 	ret = vsprintf(dest, format, args);
-				#endif
+#endif
 				dest += ret;
 				written += ret;
 
@@ -631,7 +632,7 @@
 	char ch;
 	int written = 0;	/* bytes written so far */
 
-	while ((ch = *format++))
+	while((ch = *format++))
 	{
 		if(ch == '%')
 		{
@@ -648,7 +649,7 @@
 			{
 				const char *str = va_arg(args, const char *);
 
-				while ((*dest = *str))
+				while((*dest = *str))
 				{
 					++dest;
 					++str;
@@ -721,23 +722,23 @@
 
 					str = IntTable[num - (quotient * TABLE_MAX)];
 
-					while ((*digitptr = *str))
+					while((*digitptr = *str))
 					{
 						++digitptr;
 						++str;
 					}
 				}
-				while ((num = quotient) != 0);
+				while((num = quotient) != 0);
 
 				/*
 				 * If the last quotient was a 1 or 2 digit number, there
 				 * will be one or more leading zeroes in TempBuffer[] -
 				 * get rid of them.
 				 */
-				while (*(digitptr - 1) == '0')
+				while(*(digitptr - 1) == '0')
 					--digitptr;
 
-				while (digitptr != TempBuffer)
+				while(digitptr != TempBuffer)
 				{
 					*dest++ = *--digitptr;
 					++written;
@@ -779,18 +780,18 @@
 
 					str = IntTable[num - (quotient * TABLE_MAX)];
 
-					while ((*digitptr = *str))
+					while((*digitptr = *str))
 					{
 						++digitptr;
 						++str;
 					}
 				}
-				while ((num = quotient) != 0);
+				while((num = quotient) != 0);
 
-				while (*(digitptr - 1) == '0')
+				while(*(digitptr - 1) == '0')
 					--digitptr;
 
-				while (digitptr != TempBuffer)
+				while(digitptr != TempBuffer)
 				{
 					*dest++ = *--digitptr;
 					++written;
@@ -827,18 +828,18 @@
 
 						str = IntTable[num - (quotient * TABLE_MAX)];
 
-						while ((*digitptr = *str))
+						while((*digitptr = *str))
 						{
 							++digitptr;
 							++str;
 						}
 					}
-					while ((num = quotient) != 0);
+					while((num = quotient) != 0);
 
-					while (*(digitptr - 1) == '0')
+					while(*(digitptr - 1) == '0')
 						--digitptr;
 
-					while (digitptr != TempBuffer)
+					while(digitptr != TempBuffer)
 					{
 						*dest++ = *--digitptr;
 						++written;
@@ -877,18 +878,18 @@
 
 						str = IntTable[num - (quotient * TABLE_MAX)];
 
-						while ((*digitptr = *str))
+						while((*digitptr = *str))
 						{
 							++digitptr;
 							++str;
 						}
 					}
-					while ((num = quotient) != 0);
+					while((num = quotient) != 0);
 
-					while (*(digitptr - 1) == '0')
+					while(*(digitptr - 1) == '0')
 						--digitptr;
 
-					while (digitptr != TempBuffer)
+					while(digitptr != TempBuffer)
 					{
 						*dest++ = *--digitptr;
 						++written;
Index: src/tools.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/tools.c,v
retrieving revision 7.44
diff -b -u -r7.44 tools.c
--- src/tools.c	12 Apr 2004 17:19:44 -0000	7.44
+++ src/tools.c	19 Aug 2004 22:16:46 -0000
@@ -44,10 +44,10 @@
 mem_frob(void *data, int len)
 {
 	unsigned long x = 0xdeadbeef;
-	unsigned char *b = (unsigned char *)&x;
+	unsigned char *b = (unsigned char *) &x;
 	int i;
 	char *cdata = data;
-	for (i = 0; i < len; i++)
+	for(i = 0; i < len; i++)
 	{
 		*cdata = b[i % 4];
 		cdata++;
@@ -78,7 +78,7 @@
 dlink_node *
 make_dlink_node(void)
 {
-	return(BlockHeapAlloc(dnode_heap));
+	return (BlockHeapAlloc(dnode_heap));
 }
 
 /*
@@ -95,5 +95,3 @@
 
 	BlockHeapFree(dnode_heap, ptr);
 }
-
-
Index: src/whowas.c
===================================================================
RCS file: /cvsroot/ircd-ratbox/src/whowas.c,v
retrieving revision 7.30
diff -b -u -r7.30 whowas.c
--- src/whowas.c	15 Mar 2004 17:58:08 -0000	7.30
+++ src/whowas.c	19 Aug 2004 22:16:46 -0000
@@ -104,7 +104,7 @@
 {
 	struct Whowas *temp, *next;
 
-	for (temp = client_p->whowas; temp; temp = next)
+	for(temp = client_p->whowas; temp; temp = next)
 	{
 		next = temp->cnext;
 		temp->online = NULL;
@@ -121,7 +121,7 @@
 	timelimit = CurrentTime - timelimit;
 	blah = hash_whowas_name(nick);
 	temp = WHOWASHASH[blah];
-	for (; temp; temp = temp->next)
+	for(; temp; temp = temp->next)
 	{
 		if(irccmp(nick, temp->name))
 			continue;
@@ -143,7 +143,7 @@
 	/* count the number of used whowas structs in 'u' */
 	/* count up the memory used of whowas structs in um */
 
-	for (i = 0, tmp = &WHOWAS[0]; i < NICKNAMEHISTORYLENGTH; i++, tmp++)
+	for(i = 0, tmp = &WHOWAS[0]; i < NICKNAMEHISTORYLENGTH; i++, tmp++)
 		if(tmp->hashv != -1)
 		{
 			u++;
@@ -159,12 +159,12 @@
 {
 	int i;
 
-	for (i = 0; i < NICKNAMEHISTORYLENGTH; i++)
+	for(i = 0; i < NICKNAMEHISTORYLENGTH; i++)
 	{
 		memset((void *) &WHOWAS[i], 0, sizeof(struct Whowas));
 		WHOWAS[i].hashv = -1;
 	}
-	for (i = 0; i < WW_MAX; i++)
+	for(i = 0; i < WW_MAX; i++)
 		WHOWASHASH[i] = NULL;
 }
 
