[NeoStats-Devel] [Commits] r2761 - in trunk: include modules/connectserv modules/hostserv modules/limitserv modules/operlog modules/quoteserv modules/statserv modules/textserv src

[email protected] Sun, 21 Aug 2005 08:53:30 +1000
Newsgroups gmane.comp.neostats.devel
Message-ID <[email protected]>
Author: Mark
Date: Sun Aug 21 06:53:26 2005
New Revision: 2761

Modified:
   trunk/include/exclude.h
   trunk/include/ircprotocol.h
   trunk/include/modules.h
   trunk/include/neostats.h
   trunk/include/protocol.h
   trunk/modules/connectserv/cs.c
   trunk/modules/hostserv/hostserv.c
   trunk/modules/limitserv/main.c
   trunk/modules/operlog/main.c
   trunk/modules/quoteserv/main.c
   trunk/modules/statserv/htmlstats.c
   trunk/modules/statserv/server.c
   trunk/modules/statserv/statserv.c
   trunk/modules/statserv/tld.c
   trunk/modules/statserv/version.c
   trunk/modules/textserv/main.c
   trunk/src/botinfo.c
   trunk/src/commands.c
   trunk/src/dcc.c
   trunk/src/exclude.c
   trunk/src/ircprotocol.c
   trunk/src/ircrecv.c
   trunk/src/ircsend.c
   trunk/src/misc.c
   trunk/src/modes.c
   trunk/src/modules.c
   trunk/src/nsmemory.c
   trunk/src/numerics.c
   trunk/src/servers.c
   trunk/src/services.c
   trunk/src/settings.c
Log:
additional comments and tidy ups

Modified: trunk/include/exclude.h
==============================================================================
--- trunk/include/exclude.h	(original)
+++ trunk/include/exclude.h	Sun Aug 21 06:53:26 2005
@@ -33,6 +33,6 @@
 void ns_do_exclude_chan( Channel *c );
 void ns_do_exclude_server( Client *s );
 void ns_do_exclude_user( Client *u );
-int ns_cmd_exclude( const CmdParams *cmdparams );
+int ns_cmd_exclude( CmdParams *cmdparams );
 
 #endif /* _EXCLUDE_H_ */

Modified: trunk/include/ircprotocol.h
==============================================================================
--- trunk/include/ircprotocol.h	(original)
+++ trunk/include/ircprotocol.h	Sun Aug 21 06:53:26 2005
@@ -24,7 +24,7 @@
 #define _IRCPROTOCOL_H_
 
 int InitIrcd( void );
-int FiniIrcd( void );
+void FiniIrcd( void );
 int irc_connect( const char *name, const int numeric, const char *infoline, const char *pass, const time_t tsboot, const time_t tslink );
 int irc_nick( const char *nick, const char *user, const char *host, const char *realname, const char *modes );
 int irc_server( const char *name, const int numeric, const char *infoline );

Modified: trunk/include/modules.h
==============================================================================
--- trunk/include/modules.h	(original)
+++ trunk/include/modules.h	Sun Aug 21 06:53:26 2005
@@ -32,9 +32,9 @@
 int unload_module( const char *module_name, Client * u );
 void unload_modules( void );
 int ns_cmd_modlist( CmdParams* cmdparams );
-void ModulesVersion( const char* nick, const char *remoteserver );
+void AllModuleVersions( const char* nick, const char *remoteserver );
 int SynchModule( Module* module_ptr );
-int SynchAllModules( void );
+void SynchAllModules( void );
 void assign_mod_number( Module *mod_ptr );
 void insert_module( Module *mod_ptr );
 void load_module_error( const Client *target, const char *module_name, const char *fmt, ... );

Modified: trunk/include/neostats.h
==============================================================================
--- trunk/include/neostats.h	(original)
+++ trunk/include/neostats.h	Sun Aug 21 06:53:26 2005
@@ -1176,10 +1176,9 @@
 #define FATAL_ERROR(error_text) fatal_error(__FILE__, __LINE__, __PRETTY_FUNCTION__,(error_text) ); 
 
 /* nsmemory.c */
-
-EXPORTFUNC void *ns_malloc( const int size );
-EXPORTFUNC void *ns_calloc( const int size );
-EXPORTFUNC void *ns_realloc( void *ptr, const int size );
+EXPORTFUNC void *ns_malloc( int size );
+EXPORTFUNC void *ns_calloc( int size );
+EXPORTFUNC void *ns_realloc( void *ptr, int size );
 EXPORTFUNC void _ns_free( void **ptr );
 #define ns_free( ptr ) _ns_free( ( void **) &( ptr ) );
 
@@ -1311,11 +1310,11 @@
 
 /* chans.c */
 EXPORTFUNC Channel *FindChannel( const char *chan );
-EXPORTFUNC int test_cmode( Channel *c, const unsigned int mode );
+EXPORTFUNC int test_cmode( const Channel *c, unsigned int mode );
 EXPORTFUNC int IsChannelMember( const Channel *c, const Client *u );
 EXPORTFUNC int test_cumode( const char *chan, const char *nick, const int flag );
 EXPORTFUNC Channel *GetRandomChannel( void );
-EXPORTFUNC Client *GetRandomChannelMember(int uge, Channel *c);
+EXPORTFUNC Client *GetRandomChannelMember( int uge, Channel *c );
 EXPORTFUNC char *GetRandomChannelKey( int length );
 
 #define IsChanOp( chan, nick ) test_cumode( chan, nick, CUMODE_CHANOP )
@@ -1465,11 +1464,12 @@
 EXPORTFUNC int GetChannelList( ChannelListHandler handler, void *v );
 typedef int (*ChannelMemberHandler) ( Channel *c, ChannelMember *m, void *v );
 EXPORTFUNC int GetChannelMembers( Channel *c, ChannelMemberHandler handler, void *v );
-
 typedef int (*UserListHandler) ( Client *u, void *v );
 EXPORTFUNC int GetUserList( UserListHandler handler, void *v );
 typedef int (*ServerListHandler) ( Client *s, void *v );
 EXPORTFUNC int GetServerList( ServerListHandler handler, void *v );
+typedef int (*ModuleListHandler) ( Module *module_ptr, void *v );
+EXPORTFUNC int GetModuleList (ModuleListHandler handler, void *v );
 
 EXPORTFUNC hash_t *GetServerHash( void );
 EXPORTFUNC hash_t *GetBanHash( void );

Modified: trunk/include/protocol.h
==============================================================================
--- trunk/include/protocol.h	(original)
+++ trunk/include/protocol.h	Sun Aug 21 06:53:26 2005
@@ -225,7 +225,7 @@
 EXPORTVAR extern ircd_server ircd_srv;
 
 EXPORTFUNC int ircsplitbuf( char *buf, char ***argv, int colon_special );
-EXPORTFUNC void process_ircd_cmd( int cmdptr, char *cmd, char *origin, char **av, int ac );
+EXPORTFUNC void process_ircd_cmd( int cmdptr, const char *cmd, char *origin, char **av, int ac );
 
 /* IRCD protocol module API */
 EXPORTFUNC void _m_private( char *origin, char **argv, int argc, int cmdptr );
@@ -398,9 +398,9 @@
 MODULEFUNC void send_stats( const char *source, const char type, const char *target );
 MODULEFUNC void send_version( const char *source, const char *target );
 
-MODULEFUNC void cloakhost( char *host );
+MODULEFUNC void cloakhost( const char *host );
 
-EXPORTFUNC void send_cmd( char *fmt, ... )__attribute__( ( format( printf, 1, 2 ) ) ); /* 2=format 3=params */
+EXPORTFUNC void send_cmd( const char *fmt, ... )__attribute__( ( format( printf, 1, 2 ) ) ); /* 2=format 3=params */
 
 MODULEFUNC int parse (void *notused, void *rline, size_t len);
 

Modified: trunk/modules/connectserv/cs.c
==============================================================================
--- trunk/modules/connectserv/cs.c	(original)
+++ trunk/modules/connectserv/cs.c	Sun Aug 21 06:53:26 2005
@@ -299,7 +299,7 @@
  *  signon event handler
  *  report signons
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -319,7 +319,7 @@
  *  quit event handler
  *  report quits
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -340,7 +340,7 @@
  *  local kill event handler
  *  report local kills
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -359,7 +359,7 @@
  *  global kill event handler
  *  report global kills
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -378,7 +378,7 @@
  *  server kill event handler
  *  report server kills
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -396,7 +396,7 @@
  *
  *  report mode changes
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -427,7 +427,7 @@
  *  umode event handler
  *  report umode changes
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -478,7 +478,7 @@
  *  smode event handler
  *  report smode changes
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -526,7 +526,7 @@
  *  nick change event handler
  *  report nick changes
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -545,7 +545,7 @@
  *  away event handler
  *  report away
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -564,7 +564,7 @@
  *  server connect event handler
  *  report server connects
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -581,7 +581,7 @@
  *  server quit event handler
  *  report server quits
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -599,8 +599,8 @@
  *  Set callback for exclusions
  *  Enable or disable exclude event flag
  *
- *  @cmdparams pointer to commands param struct
- *  @cmdparams reason for SET
+ *  @params cmdparams pointer to commands param struct
+ *  @params reason for SET
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -619,8 +619,8 @@
  *  Set callback for sign watch
  *  Enable or disable events associated with sign on/off
  *
- *  @cmdparams pointer to commands param struct
- *  @cmdparams reason for SET
+ *  @params cmdparams pointer to commands param struct
+ *  @params reason for SET
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -648,8 +648,8 @@
  *  Set callback for kill watch
  *  Enable or disable events associated with kills
  *
- *  @cmdparams pointer to commands param struct
- *  @cmdparams reason for SET
+ *  @params cmdparams pointer to commands param struct
+ *  @params reason for SET
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -679,8 +679,8 @@
  *  Set callback for mode watch
  *  Enable or disable events associated with modes
  *
- *  @cmdparams pointer to commands param struct
- *  @cmdparams reason for SET
+ *  @params cmdparams pointer to commands param struct
+ *  @params reason for SET
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -708,8 +708,8 @@
  *  Set callback for nick watch
  *  Enable or disable events associated with nick changes
  *
- *  @cmdparams pointer to commands param struct
- *  @cmdparams reason for SET
+ *  @params cmdparams pointer to commands param struct
+ *  @params reason for SET
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -735,8 +735,8 @@
  *  Set callback for away watch
  *  Enable or disable events associated with away events
  *
- *  @cmdparams pointer to commands param struct
- *  @cmdparams reason for SET
+ *  @params cmdparams pointer to commands param struct
+ *  @params reason for SET
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -762,8 +762,8 @@
  *  Set callback for server watch
  *  Enable or disable events associated with server connects/quits
  *
- *  @cmdparams pointer to commands param struct
- *  @cmdparams reason for SET
+ *  @params cmdparams pointer to commands param struct
+ *  @params reason for SET
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */

Modified: trunk/modules/hostserv/hostserv.c
==============================================================================
--- trunk/modules/hostserv/hostserv.c	(original)
+++ trunk/modules/hostserv/hostserv.c	Sun Aug 21 06:53:26 2005
@@ -150,7 +150,7 @@
  *  @return results of strcmp
  */
 
-int findnick( const void *key1, const void *key2 )
+static int findnick( const void *key1, const void *key2 )
 {
 	const vhostentry *vhost = key1;
 	return( ircstrcasecmp( vhost->nick,( char * )key2 ) );
@@ -203,7 +203,17 @@
 	return NS_SUCCESS;
 }
 
-int new_dbvhost( void *data, int size )
+/** @brief new_dbvhost
+ *
+ *  Table load handler
+ *
+ *  @param data pointer to table row data
+ *  @param size of loaded data
+ *
+ *  @return NS_TRUE to abort load or NS_FALSE to continue loading
+ */
+
+static int new_dbvhost( void *data, int size )
 {
 	vhostentry *vhe;
 
@@ -570,6 +580,8 @@
 	char *buf;
 
 	SET_SEGV_LOCATION();
+	if( cmdparams->ac < 3 )
+		return NS_ERR_NEED_MORE_PARAMS;
 	if( hash_lookup( banhash, cmdparams->av[1] ) != NULL ) {
 		irc_prefmsg( hs_bot, cmdparams->source, 
 			"%s already exists in the banned vhost list", cmdparams->av[1] );
@@ -608,6 +620,8 @@
 	hscan_t hs;
 
 	SET_SEGV_LOCATION();
+	if( cmdparams->ac < 2 )
+		return NS_ERR_NEED_MORE_PARAMS;
 	hash_scan_begin( &hs, banhash );
 	while( ( hn = hash_scan_next( &hs ) ) != NULL ) {
 		ban =( banentry * )hnode_get( hn );
@@ -642,19 +656,12 @@
 static int hs_cmd_bans( CmdParams *cmdparams )
 {
 	SET_SEGV_LOCATION();
-	if( !ircstrcasecmp( cmdparams->av[0], "LIST" ) ) {
+	if( !ircstrcasecmp( cmdparams->av[0], "LIST" ) )
 		return hs_cmd_bans_list( cmdparams );
-	} else if( !ircstrcasecmp( cmdparams->av[0], "ADD" ) ) {
-		if( cmdparams->ac < 3 ) {
-			return NS_ERR_NEED_MORE_PARAMS;
-		}
+	if( !ircstrcasecmp( cmdparams->av[0], "ADD" ) )
 		return hs_cmd_bans_add( cmdparams );
-	} else if( !ircstrcasecmp( cmdparams->av[0], "DEL" ) ) {
-		if( cmdparams->ac < 2 ) {
-			return NS_ERR_NEED_MORE_PARAMS;
-		}
+	if( !ircstrcasecmp( cmdparams->av[0], "DEL" ) )
 		return hs_cmd_bans_del( cmdparams );
-	}
 	return NS_ERR_SYNTAX_ERROR;
 }
 
@@ -694,9 +701,9 @@
 		return NS_SUCCESS;
 	}
 	irc_prefmsg( hs_bot, cmdparams->source, "Error, hostname mismatch" );
-	irc_chanalert( hs_bot, "%s tried to change the password for %s, but the hosts do not match( %s -> %s )",
+	irc_chanalert( hs_bot, "%s tried to change the password for %s, but the hosts do not match (%s -> %s)",
 			cmdparams->source->name, vhe->nick, cmdparams->source->user->hostname, vhe->host );
-	nlog( LOG_WARNING, "%s tried to change the password for %s but the hosts do not match( %s -> %s )",
+	nlog( LOG_WARNING, "%s tried to change the password for %s but the hosts do not match (%s -> %s)",
 			cmdparams->source->name, vhe->nick, cmdparams->source->user->hostname, vhe->host );
 	return NS_SUCCESS;
 }

Modified: trunk/modules/limitserv/main.c
==============================================================================
--- trunk/modules/limitserv/main.c	(original)
+++ trunk/modules/limitserv/main.c	Sun Aug 21 06:53:26 2005
@@ -391,7 +391,7 @@
  *  join event handler
  *  join channels if we need to and manage limit on channels
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -417,7 +417,7 @@
  *  part event handler
  *  manage limit on channels
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */

Modified: trunk/modules/operlog/main.c
==============================================================================
--- trunk/modules/operlog/main.c	(original)
+++ trunk/modules/operlog/main.c	Sun Aug 21 06:53:26 2005
@@ -153,7 +153,7 @@
  *  globops handler
  *  log globops
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -170,7 +170,7 @@
  *  chatops handler
  *  log chatops
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -187,7 +187,7 @@
  *  wallops handler
  *  log wallops
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -204,7 +204,7 @@
  *  local kill handler
  *  log local kill
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -221,7 +221,7 @@
  *  local kill handler
  *  log local kill
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -238,7 +238,7 @@
  *  local kill handler
  *  log local kill
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -255,7 +255,7 @@
  *  mode handler
  *  log operator mode
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */

Modified: trunk/modules/quoteserv/main.c
==============================================================================
--- trunk/modules/quoteserv/main.c	(original)
+++ trunk/modules/quoteserv/main.c	Sun Aug 21 06:53:26 2005
@@ -483,7 +483,7 @@
  *
  *  QUOTE command handler
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *    cmdparams->av[0] = target nick
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
@@ -499,7 +499,7 @@
  *  signon event handler
  *  Send quote on signon if enabled
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -514,8 +514,8 @@
  *  Set callback for exclusions
  *  Enable or disable exclude event flag
  *
- *  @cmdparams pointer to commands param struct
- *  @cmdparams reason for SET
+ *  @params cmdparams pointer to commands param struct
+ *  @params reason for SET
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -534,8 +534,8 @@
  *  Set callback for signonquote
  *  Enable or disable events associated with signonquote
  *
- *  @cmdparams pointer to commands param struct
- *  @cmdparams reason for SET
+ *  @params cmdparams pointer to commands param struct
+ *  @params reason for SET
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */

Modified: trunk/modules/statserv/htmlstats.c
==============================================================================
--- trunk/modules/statserv/htmlstats.c	(original)
+++ trunk/modules/statserv/htmlstats.c	Sun Aug 21 06:53:26 2005
@@ -147,7 +147,7 @@
 static void serverlisthandler( const serverstat *ss, const void *v )
 {
 	os_fprintf( opf, "<tr><td height=\"4\"></td>\n" );
-	os_fprintf( opf, "<td height=\"4\"><a href=#%s> %s( %s )</a></td></tr>\n",
+	os_fprintf( opf, "<td height=\"4\"><a href=#%s> %s (%s)</a></td></tr>\n",
 		ss->name, ss->name,( ss->s ) ? "ONLINE" : "OFFLINE" );
 }
 
@@ -184,11 +184,11 @@
 		os_fprintf( opf, "<tr><td>Last Seen:</td><td colspan = 2>%s</td></tr>\n",
 			sftime( ss->ts_lastseen ) );
 	} else {
-		os_fprintf( opf,"<tr><td>Current Users:</td><td>%d( %d%% )</td><td>Max %d at %s</td></tr>\n",
+		os_fprintf( opf,"<tr><td>Current Users:</td><td>%d (%d%%)</td><td>Max %d at %s</td></tr>\n",
 			ss->users.current,( int )( ( ( float ) ss->users.current /( float ) networkstats.users.current ) * 100 ),
 			ss->users.alltime.max, sftime( ss->users.alltime.ts_max ) );
 		os_fprintf( opf,
-			"<tr><td>Current Opers:</td><td>%d( %d%% )</td><td>Max %d at %s</td></tr>\n",
+			"<tr><td>Current Opers:</td><td>%d (%d%%)</td><td>Max %d at %s</td></tr>\n",
 			ss->opers.current,( int )( ( ( float ) ss->opers.current /( float ) networkstats.opers.current ) * 100 ),
 			ss->opers.alltime.max, sftime( ss->opers.alltime.ts_max ) );
 	}
@@ -238,28 +238,28 @@
 	os_fprintf( opf, "<tr><th><b></b></th><th><b>Total</b></th><th><b>Current</b></th><th><b>Average</b></th><th><b>Max</b></th><th><b>Max Time</b></th></tr>\n" );
 	os_fprintf( opf, "<tr><td>Users:</td>\n" );
 	os_fprintf( opf, "<td>%d</td>\n", networkstats.users.alltime.runningtotal );
-	os_fprintf( opf, "<td>%d( %d%% )</td>\n", networkstats.users.current,
+	os_fprintf( opf, "<td>%d (%d%%)</td>\n", networkstats.users.current,
 		GetAllTimePercent( &networkstats.users ) );
 	os_fprintf( opf, "<td>%d</td>\n", networkstats.users.alltime.average );
 	os_fprintf( opf, "<td>%d</td>\n", networkstats.users.alltime.max );
 	os_fprintf( opf, "<td>%s</td></tr>\n", sftime( networkstats.users.alltime.ts_max ) );
 	os_fprintf( opf, "<tr><td>Channels:</td>\n" );
 	os_fprintf( opf, "<td>%d</td>\n", networkstats.channels.alltime.runningtotal );
-	os_fprintf( opf, "<td>%i( %d%% )</td>\n", networkstats.channels.current,
+	os_fprintf( opf, "<td>%i (%d%%)</td>\n", networkstats.channels.current,
 		GetAllTimePercent( &networkstats.channels ) );
 	os_fprintf( opf, "<td>%i</td>\n", networkstats.channels.alltime.average );
 	os_fprintf( opf, "<td>%d</td>\n", networkstats.channels.alltime.max );
 	os_fprintf( opf, "<td>%s</td></tr>\n", sftime( networkstats.channels.alltime.ts_max ) );
 	os_fprintf( opf, "<tr><td>Opers:</td>\n" );
 	os_fprintf( opf, "<td>%d</td>\n", networkstats.opers.alltime.runningtotal );
-	os_fprintf( opf, "<td>%i( %d%% )</td>\n", networkstats.opers.current,
+	os_fprintf( opf, "<td>%i (%d%%)</td>\n", networkstats.opers.current,
 		GetAllTimePercent( &networkstats.opers ) );
 	os_fprintf( opf, "<td>%i</td>\n", networkstats.opers.alltime.average );
 	os_fprintf( opf, "<td>%i</td>\n", networkstats.opers.alltime.max );
 	os_fprintf( opf, "<td>%s</td></tr>\n", sftime( networkstats.opers.alltime.ts_max ) );
 	os_fprintf( opf, "<td>Servers:</td>\n" );
 	os_fprintf( opf, "<td>%d</td>\n", networkstats.servers.alltime.runningtotal );
-	os_fprintf( opf, "<td>%d( %d%% )</td>\n", networkstats.servers.current,
+	os_fprintf( opf, "<td>%d (%d%%)</td>\n", networkstats.servers.current,
 		GetAllTimePercent( &networkstats.servers ) );
 	os_fprintf( opf, "<td>%d</td>\n", networkstats.servers.alltime.average );
 	os_fprintf( opf, "<td>%d</td>\n", networkstats.servers.alltime.max );
@@ -283,28 +283,28 @@
 	os_fprintf( opf, "<tr><th><b></b></th><th><b>Total</b><th><b>Current</b><th><b>Average</b></th><th><b>Max</b></th><th><b>Max Time</b></th></tr>\n" );
 	os_fprintf( opf, "<tr><td>Users:</td>\n" );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.users.daily.runningtotal );
-	os_fprintf( opf, "<td>%-2d( %d%% )</td>\n", networkstats.users.current,
+	os_fprintf( opf, "<td>%-2d (%d%%)</td>\n", networkstats.users.current,
 		GetDailyPercent( &networkstats.users ) );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.users.daily.average );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.users.daily.max );
 	os_fprintf( opf, "<td>%s</td></tr>\n", sftime( networkstats.users.daily.ts_max ) );
 	os_fprintf( opf, "<tr><td>Channels:</td>\n" );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.channels.daily.runningtotal );
-	os_fprintf( opf, "<td>%-2d( %d%% )</td>\n", networkstats.channels.current,
+	os_fprintf( opf, "<td>%-2d (%d%%)</td>\n", networkstats.channels.current,
 		GetDailyPercent( &networkstats.channels ) );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.channels.daily.average );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.channels.daily.max );
 	os_fprintf( opf, "<td>%s</td></tr>\n", sftime( networkstats.channels.daily.ts_max ) );
 	os_fprintf( opf, "<tr><td>Opers:</td>\n" );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.opers.daily.runningtotal );
-	os_fprintf( opf, "<td>%-2d( %d%% )</td>\n", networkstats.opers.current,
+	os_fprintf( opf, "<td>%-2d (%d%%)</td>\n", networkstats.opers.current,
 		GetDailyPercent( &networkstats.opers ) );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.opers.daily.average );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.opers.daily.max );
 	os_fprintf( opf, "<td>%s</td></tr>\n", sftime( networkstats.opers.daily.ts_max ) );
 	os_fprintf( opf, "<tr><td>Servers:</td>\n" );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.servers.daily.runningtotal );
-	os_fprintf( opf, "<td>%-2d( %d%% )</td>\n", networkstats.servers.current,
+	os_fprintf( opf, "<td>%-2d (%d%%)</td>\n", networkstats.servers.current,
 		GetDailyPercent( &networkstats.servers ) );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.servers.daily.average );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.servers.daily.max );
@@ -327,28 +327,28 @@
 	os_fprintf( opf, "<tr><th><b></b></th><th><b>Total</b><th><b>Current</b><th><b>Average</b></th><th><b>Max</b></th><th><b>Max Time</b></th></tr>\n" );
 	os_fprintf( opf, "<tr><td>Users:</td>\n" );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.users.weekly.runningtotal );
-	os_fprintf( opf, "<td>%-2d( %d%% )</td>\n", networkstats.users.current,
+	os_fprintf( opf, "<td>%-2d (%d%%)</td>\n", networkstats.users.current,
 		GetWeeklyPercent( &networkstats.users ) );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.users.weekly.average );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.users.weekly.max );
 	os_fprintf( opf, "<td>%s</td></tr>\n", sftime( networkstats.users.weekly.ts_max ) );
 	os_fprintf( opf, "<tr><td>Channels:</td>\n" );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.channels.weekly.runningtotal );
-	os_fprintf( opf, "<td>%-2d( %d%% )</td>\n", networkstats.channels.current,
+	os_fprintf( opf, "<td>%-2d (%d%%)</td>\n", networkstats.channels.current,
 		GetWeeklyPercent( &networkstats.channels ) );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.channels.weekly.average );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.channels.weekly.max );
 	os_fprintf( opf, "<td>%s</td></tr>\n", sftime( networkstats.channels.weekly.ts_max ) );
 	os_fprintf( opf, "<tr><td>Opers:</td>\n" );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.opers.weekly.runningtotal );
-	os_fprintf( opf, "<td>%-2d( %d%% )</td>\n", networkstats.opers.current,
+	os_fprintf( opf, "<td>%-2d (%d%%)</td>\n", networkstats.opers.current,
 		GetWeeklyPercent( &networkstats.opers ) );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.opers.weekly.average );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.opers.weekly.max );
 	os_fprintf( opf, "<td>%s</td></tr>\n", sftime( networkstats.opers.weekly.ts_max ) );
 	os_fprintf( opf, "<tr><td>Servers:</td>\n" );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.servers.weekly.runningtotal );
-	os_fprintf( opf, "<td>%-2d( %d%% )</td>\n", networkstats.servers.current,
+	os_fprintf( opf, "<td>%-2d (%d%%)</td>\n", networkstats.servers.current,
 		GetWeeklyPercent( &networkstats.servers ) );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.servers.weekly.average );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.servers.weekly.max );
@@ -371,28 +371,28 @@
 	os_fprintf( opf, "<tr><th><b></b></th><th><b>Total</b><th><b>Current</b><th><b>Average</b></th><th><b>Max</b></th><th><b>Max Time</b></th></tr>\n" );
 	os_fprintf( opf, "<tr><td>Users:</td>\n" );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.users.monthly.runningtotal );
-	os_fprintf( opf, "<td>%-2d( %d%% )</td>\n", networkstats.users.current,
+	os_fprintf( opf, "<td>%-2d (%d%%)</td>\n", networkstats.users.current,
 		GetMonthlyPercent( &networkstats.users ) );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.users.monthly.average );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.users.monthly.max );
 	os_fprintf( opf, "<td>%s</td></tr>\n", sftime( networkstats.users.monthly.ts_max ) );
 	os_fprintf( opf, "<tr><td>Channels:</td>\n" );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.channels.monthly.runningtotal );
-	os_fprintf( opf, "<td>%-2d( %d%% )</td>\n", networkstats.channels.current,
+	os_fprintf( opf, "<td>%-2d (%d%%)</td>\n", networkstats.channels.current,
 		GetMonthlyPercent( &networkstats.channels ) );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.channels.monthly.average );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.channels.monthly.max );
 	os_fprintf( opf, "<td>%s</td></tr>\n", sftime( networkstats.channels.monthly.ts_max ) );
 	os_fprintf( opf, "<tr><td>Opers:</td>\n" );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.opers.monthly.runningtotal );
-	os_fprintf( opf, "<td>%-2d( %d%% )</td>\n", networkstats.opers.current,
+	os_fprintf( opf, "<td>%-2d (%d%%)</td>\n", networkstats.opers.current,
 		GetMonthlyPercent( &networkstats.opers ) );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.opers.monthly.average );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.opers.monthly.max );
 	os_fprintf( opf, "<td>%s</td></tr>\n", sftime( networkstats.opers.monthly.ts_max ) );
 	os_fprintf( opf, "<tr><td>Servers:</td>\n" );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.servers.monthly.runningtotal );
-	os_fprintf( opf, "<td>%-2d( %d%% )</td>\n", networkstats.servers.current,
+	os_fprintf( opf, "<td>%-2d (%d%%)</td>\n", networkstats.servers.current,
 		GetMonthlyPercent( &networkstats.servers ) );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.servers.monthly.average );
 	os_fprintf( opf, "<td>%-2d</td>\n", networkstats.servers.monthly.max );
@@ -748,7 +748,7 @@
 int ss_cmd_forcehtml( CmdParams *cmdparams )
 {
 	nlog( LOG_NOTICE, "%s!%s@%s forced an update of the HTML file.",
-		    cmdparams->source->name, cmdparams->source->user->username, cmdparams->source->user->hostname );
+		cmdparams->source->name, cmdparams->source->user->username, cmdparams->source->user->hostname );
 	HTMLOutput();
 	return NS_SUCCESS;
 }

Modified: trunk/modules/statserv/server.c
==============================================================================
--- trunk/modules/statserv/server.c	(original)
+++ trunk/modules/statserv/server.c	Sun Aug 21 06:53:26 2005
@@ -95,7 +95,7 @@
 	serverstat *ss;
 
 	SET_SEGV_LOCATION();
-	dlog( DEBUG2, "new_server_stat( %s )", name );
+	dlog( DEBUG2, "new_server_stat (%s)", name );
 	if( hash_isfull( serverstathash ) )
 	{
 		nlog( LOG_CRITICAL, "StatServ Server hash is full!" );
@@ -122,7 +122,7 @@
 
 	stats =( serverstat * )hnode_find( serverstathash, name );
 	if( !stats )
-		dlog( DEBUG2, "findserverstats( %s ) - not found", name );
+		dlog( DEBUG2, "findserverstats (%s) - not found", name );
 	return stats;
 }
 
@@ -216,7 +216,7 @@
 {
 	serverstat *ss;
 
-	dlog( DEBUG2, "AddServerStat( %s )", s->name );
+	dlog( DEBUG2, "AddServerStat (%s)", s->name );
 	ss = findserverstats( s->name );
 	if( !ss )
 		ss = new_server_stat( s->name );
@@ -350,7 +350,7 @@
 	while( ( sn = hash_scan_next( &hs ) ) )
 	{
 		s = hnode_get( sn );
-		printf( "%d %s %s( %s )\n", level, s->name, s->uplink ? s->uplink->name : "", uplink );
+		printf( "%d %s %s (%s)\n", level, s->name, s->uplink ? s->uplink->name : "", uplink );
 		ss =( serverstat * ) GetServerModValue( s );
 		if( ( level == 0 ) &&( s->uplinkname[0] == 0 ) )
 		{
@@ -430,7 +430,7 @@
 	while( ( sn = hash_scan_next( &hs ) ) )
 	{
 		ss = hnode_get( sn );
-		irc_prefmsg( ss_bot, cmdparams->source, "%s( %s )", ss->name, 
+		irc_prefmsg( ss_bot, cmdparams->source, "%s (%s)", ss->name, 
 			( ss->s ) ? "ONLINE" : "OFFLINE" );
 	}
 	irc_prefmsg( ss_bot,cmdparams->source, "End of list." );
@@ -567,7 +567,7 @@
 		uptime = s->server->uptime +( me.now - me.ts_boot );
 		irc_prefmsg( ss_bot, cmdparams->source, "Version: %s", s->version );
 		irc_prefmsg( ss_bot, cmdparams->source, "Uptime:  %ld day%s, %02ld:%02ld:%02ld",( uptime / TS_ONE_DAY ),( ( uptime / TS_ONE_DAY ) == 1 ) ? "" : "s",( ( uptime / TS_ONE_HOUR ) % 24 ),( ( uptime / TS_ONE_MINUTE ) % TS_ONE_MINUTE ),( uptime % 60 ) );
-		irc_prefmsg( ss_bot, cmdparams->source, "Current Users: %-3d( %d%% )", 
+		irc_prefmsg( ss_bot, cmdparams->source, "Current Users: %-3d (%d%%)", 
 			s->server->users, 
 			( int )( ( float ) s->server->users /( float ) networkstats.users.current * 100 ) );
 	}
@@ -675,7 +675,7 @@
  *  @param data pointer to table row data
  *  @param size of loaded data
  *
- *  @return none
+ *  @return NS_TRUE to abort load or NS_FALSE to continue loading
  */
 
 int LoadServerStats( void *data, int size ) 

Modified: trunk/modules/statserv/statserv.c
==============================================================================
--- trunk/modules/statserv/statserv.c	(original)
+++ trunk/modules/statserv/statserv.c	Sun Aug 21 06:53:26 2005
@@ -247,8 +247,8 @@
  *  Set callback for SET HTML
  *  Enable or disable html output
  *
- *  @cmdparams pointer to commands param struct
- *  @cmdparams reason for SET
+ *  @params cmdparams pointer to commands param struct
+ *  @params reason for SET
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -277,8 +277,8 @@
  *  Set callback for SET HTMLPATH
  *  Change html output path
  *
- *  @cmdparams pointer to commands param struct
- *  @cmdparams reason for SET
+ *  @params cmdparams pointer to commands param struct
+ *  @params reason for SET
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -307,8 +307,8 @@
  *  Set callback for SET HTMLTIME
  *  Change html output time
  *
- *  @cmdparams pointer to commands param struct
- *  @cmdparams reason for SET
+ *  @params cmdparams pointer to commands param struct
+ *  @params reason for SET
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
@@ -327,8 +327,8 @@
  *  Set callback for exclusions
  *  Enable or disable exclude event flag
  *
- *  @cmdparams pointer to commands param struct
- *  @cmdparams reason for SET
+ *  @params cmdparams pointer to commands param struct
+ *  @params reason for SET
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */

Modified: trunk/modules/statserv/tld.c
==============================================================================
--- trunk/modules/statserv/tld.c	(original)
+++ trunk/modules/statserv/tld.c	Sun Aug 21 06:53:26 2005
@@ -139,7 +139,7 @@
 void TLDReport( const TLD *tld, const void *v )
 {
 	irc_prefmsg( ss_bot, ( Client * ) v, 
-		"%3s \2%3d\2( %d%% ) -> %s ---> Daily Total: %d",
+		"%3s \2%3d\2 (%d%%) -> %s ---> Daily Total: %d",
 		tld->tld, tld->users.alltime.max, ( int )( ( float ) tld->users.current / ( float ) networkstats.users.current ) * 100,
 		tld->country, tld->users.current );
 }
@@ -300,7 +300,7 @@
  *  @param data pointer to table row data
  *  @param size of loaded data
  *
- *  @return
+ *  @return NS_TRUE to abort load or NS_FALSE to continue loading
  */
 
 static int new_tld( void *data, int size )

Modified: trunk/modules/statserv/version.c
==============================================================================
--- trunk/modules/statserv/version.c	(original)
+++ trunk/modules/statserv/version.c	Sun Aug 21 06:53:26 2005
@@ -105,7 +105,7 @@
  *  @param data pointer to table row data
  *  @param size of loaded data
  *
- *  @return
+ *  @return NS_TRUE to abort load or NS_FALSE to continue loading
  */
 
 static int new_ctcpversion( void *data, int size )

Modified: trunk/modules/textserv/main.c
==============================================================================
--- trunk/modules/textserv/main.c	(original)
+++ trunk/modules/textserv/main.c	Sun Aug 21 06:53:26 2005
@@ -840,7 +840,7 @@
  *    cmdparams->av[0] = target nick
  *    cmdparams->av[1 - cmdparams->ac] = message
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */

Modified: trunk/src/botinfo.c
==============================================================================
--- trunk/src/botinfo.c	(original)
+++ trunk/src/botinfo.c	Sun Aug 21 06:53:26 2005
@@ -46,8 +46,8 @@
  *  SET nick callback
  *  Command subsystem use only.
  *
- *  @cmdparams pointer to commands param struct
- *  @cmdparams reason for SET
+ *  @params cmdparams pointer to commands param struct
+ *  @params reason for SET
  *
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
@@ -66,8 +66,8 @@
  *  SET user callback
  *  Command subsystem use only.
  *
- *  @cmdparams pointer to commands param struct
- *  @cmdparams reason for SET
+ *  @params cmdparams pointer to commands param struct
+ *  @params reason for SET
  *
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
@@ -86,8 +86,8 @@
  *  SET host callback
  *  Command subsystem use only.
  *
- *  @cmdparams pointer to commands param struct
- *  @cmdparams reason for SET
+ *  @params cmdparams pointer to commands param struct
+ *  @params reason for SET
  *
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
@@ -106,8 +106,8 @@
  *  SET realname callback
  *  Command subsystem use only.
  *
- *  @cmdparams pointer to commands param struct
- *  @cmdparams reason for SET
+ *  @params cmdparams pointer to commands param struct
+ *  @params reason for SET
  *
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
@@ -130,8 +130,8 @@
  *  Add bot info settings to SET command
  *  Command subsystem use only.
  *
- *  @cmdparams pointer to bot
- *  @cmdparams pointer to bot info structure
+ *  @params cmdparams pointer to bot
+ *  @params cmdparams pointer to bot info structure
  *
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
@@ -157,7 +157,7 @@
  *  Delete bot info settings from SET command
  *  Command subsystem use only.
  *
- *  @cmdparams pointer to bot
+ *  @params cmdparams pointer to bot
  *
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */

Modified: trunk/src/commands.c
==============================================================================
--- trunk/src/commands.c	(original)
+++ trunk/src/commands.c	Sun Aug 21 06:53:26 2005
@@ -90,6 +90,7 @@
  *	calculate ulevel
  *
  *  @param pointer to command structure
+ *
  *  @return command user level requires
  */
 

Modified: trunk/src/dcc.c
==============================================================================
--- trunk/src/dcc.c	(original)
+++ trunk/src/dcc.c	Sun Aug 21 06:53:26 2005
@@ -84,7 +84,7 @@
 
 	if( ( socketfd = sock_connect( SOCK_STREAM, dcc->ip, port ) ) == NS_FAILURE )
 	{
-		nlog( LOG_WARNING, "Error Connecting to DCC Host %s( %s:%d )", dcc->user->hostname, inet_ntoa( dcc->ip ), port );
+		nlog( LOG_WARNING, "Error Connecting to DCC Host %s (%s:%d)", dcc->user->hostname, inet_ntoa( dcc->ip ), port );
 		DelDCCClient( dcc );
 		return NS_FAILURE;
 	}			

Modified: trunk/src/exclude.c
==============================================================================
--- trunk/src/exclude.c	(original)
+++ trunk/src/exclude.c	Sun Aug 21 06:53:26 2005
@@ -104,18 +104,19 @@
 	exclude = ns_calloc( sizeof( Exclude ) );
 	os_memcpy( exclude, data, sizeof( Exclude ) );
 	lnode_create_append( exclude_list, exclude );
-	dlog( DEBUG2, "Added exclusion %s( %d ) by %s on %d", exclude->pattern, exclude->type, exclude->addedby,( int )exclude->addedon );
+	dlog( DEBUG2, "Added exclusion %s (%d) by %s on %d", exclude->pattern, exclude->type, exclude->addedby,( int )exclude->addedon );
 }
 
 /** @brief new_global_exclude
  *
+ *  Table load handler
  *  Database row handler to load global exclude data
  *  Exclusion sub system use only
  *
- *  @param data exclude data
- *  @param size of data
+ *  @param data pointer to table row data
+ *  @param size of loaded data
  *
- *  @return none
+ *  @return NS_TRUE to abort load or NS_FALSE to continue loading
  */
 
 static int new_global_exclude( const void *data, int size )
@@ -126,13 +127,14 @@
 
 /** @brief new_mod_exclude
  *
+ *  Table load handler
  *  Database row handler to load module exclude data
  *  Exclusion sub system use only
  *
- *  @param data exclude data
- *  @param size of data
+ *  @param data pointer to table row data
+ *  @param size of loaded data
  *
- *  @return none
+ *  @return NS_TRUE to abort load or NS_FALSE to continue loading
  */
 
 static int new_mod_exclude( const void *data, int size )
@@ -321,9 +323,9 @@
 	ns_free( buf );
 	/* if we get here, then exclude is valid */
 	lnode_create_append( exclude_list, exclude );
-	irc_prefmsg( cmdparams->bot, cmdparams->source, __( "Added %s( %s ) to exclusion list", cmdparams->source ), exclude->pattern, cmdparams->av[1] );
+	irc_prefmsg( cmdparams->bot, cmdparams->source, __( "Added %s (%s) to exclusion list", cmdparams->source ), exclude->pattern, cmdparams->av[1] );
 	if( nsconfig.cmdreport )
-		irc_chanalert( cmdparams->bot, _( "%s added %s( %s ) to the exclusion list" ), cmdparams->source->name, exclude->pattern, cmdparams->av[1] );
+		irc_chanalert( cmdparams->bot, _( "%s added %s (%s) to the exclusion list" ), cmdparams->source->name, exclude->pattern, cmdparams->av[1] );
 	/* now save the exclusion list */
 	DBAStore( "exclusions", exclude->pattern,( void * )exclude, sizeof( Exclude ) );
 	return NS_SUCCESS;
@@ -455,7 +457,7 @@
 	while( node != NULL )
 	{
 		exclude = lnode_get( node );			
-		irc_prefmsg( cmdparams->bot, cmdparams->source, __( "%s( %s ) Added by %s on %s for %s", cmdparams->source ), exclude->pattern, ExcludeDesc[exclude->type], exclude->addedby, sftime( exclude->addedon ), exclude->reason );
+		irc_prefmsg( cmdparams->bot, cmdparams->source, __( "%s (%s) Added by %s on %s for %s", cmdparams->source ), exclude->pattern, ExcludeDesc[exclude->type], exclude->addedby, sftime( exclude->addedon ), exclude->reason );
 		node = list_next( exclude_list, node );
 	}
 	irc_prefmsg( cmdparams->bot, cmdparams->source, __( "End of list.", cmdparams->source ) );
@@ -506,7 +508,7 @@
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
 
-int ns_cmd_exclude( const CmdParams *cmdparams ) 
+int ns_cmd_exclude( CmdParams *cmdparams ) 
 {
 	SET_SEGV_LOCATION();
 	if( !ircstrcasecmp( cmdparams->av[0], "ADD" ) )

Modified: trunk/src/ircprotocol.c
==============================================================================
--- trunk/src/ircprotocol.c	(original)
+++ trunk/src/ircprotocol.c	Sun Aug 21 06:53:26 2005
@@ -52,29 +52,37 @@
 void *protocol_module_handle;
 irc_cmd *cmd_list;
 
-/** @brief process ircd commands
+/** @brief process_ircd_cmd
  *
- * 
+ *  process ircd commands
  *
- *  @param none
+ *  @param cmdptr source flag
+ *  @param cmd command string
+ *  @param origin of command
+ *  @param av array of arguments
+ *  @param ac count of args in av
  *
  *  @return none
  */
 
-EXPORTFUNC void process_ircd_cmd( int cmdptr, char *cmd, char *origin, char **av, int ac )
+void process_ircd_cmd( int cmdptr, const char *cmd, char *origin, char **av, int ac )
 {
 	irc_cmd *ircd_cmd_ptr;
 	irc_cmd *intrinsic_cmd_ptr;
 
 	SET_SEGV_LOCATION();
 	ircd_cmd_ptr = cmd_list;
-	while( ircd_cmd_ptr->name ) {
+	while( ircd_cmd_ptr->name )
+	{
 		if( !ircstrcasecmp( *ircd_cmd_ptr->name, cmd ) || 
 		 ( ( ircd_srv.protocol & PROTOCOL_TOKEN ) && ircd_cmd_ptr->token && !ircstrcasecmp( *ircd_cmd_ptr->token, cmd ) ) ) {
-			if( ircd_cmd_ptr->handler ) {
+			if( ircd_cmd_ptr->handler )
+			{
 				dlog( DEBUG3, "process_ircd_cmd: running command %s", *ircd_cmd_ptr->name );
 				ircd_cmd_ptr->handler( origin, av, ac, cmdptr );
-			} else {
+			}
+			else
+			{
 				dlog( DEBUG3, "process_ircd_cmd: ignoring command %s", cmd );
 			}
 			ircd_cmd_ptr->usage++;
@@ -83,7 +91,8 @@
 		ircd_cmd_ptr ++;
 	}
 	intrinsic_cmd_ptr = intrinsic_cmd_list;
-	while( intrinsic_cmd_ptr->handler ) {
+	while( intrinsic_cmd_ptr->handler )
+	{
 		if( *intrinsic_cmd_ptr->name )
 		{
 			if( !ircstrcasecmp( *intrinsic_cmd_ptr->name, cmd ) || 
@@ -99,12 +108,16 @@
 	}
 	ircd_cmd_ptr = numeric_cmd_list;	
 	/* Process numeric replies */
-	while( ircd_cmd_ptr->name ) {
-		if( !ircstrcasecmp( *ircd_cmd_ptr->name, cmd ) ) {
+	while( ircd_cmd_ptr->name )
+	{
+		if( !ircstrcasecmp( *ircd_cmd_ptr->name, cmd ) )
+		{
 			if( ircd_cmd_ptr->handler ) {
 				dlog( DEBUG3, "process_ircd_cmd: running command %s", *ircd_cmd_ptr->name );
 				ircd_cmd_ptr->handler( origin, av, ac, cmdptr );
-			} else {
+			}
+			else
+			{
 				dlog( DEBUG3, "process_ircd_cmd: ignoring command %s", cmd );
 			}
 			ircd_cmd_ptr->usage++;
@@ -118,14 +131,16 @@
 
 /** @brief parse
  *
- * 
+ *  parser
  *
- *  @param none
+ *  @param notused
+ *  @param rline
+ *  @param len
  *
- *  @return none
+ *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
 
-int parse( void *arg, void *rline, size_t len )
+int parse( void *notused, void *rline, size_t len )
 {
 	char origin[64], cmd[64], *coreLine;
 	char *line = (char *)rline;
@@ -138,7 +153,8 @@
 		return NS_FAILURE;
 	dlog( DEBUG1, "------------------------BEGIN PARSE-------------------------" );
 	dlog( DEBUGRX, "RX: %s", line );
-	if( *line == ':' ) {
+	if( *line == ':' )
+	{
 		coreLine = strpbrk( line, " " );
 		if( !coreLine )
 			return NS_FAILURE;
@@ -147,17 +163,22 @@
 		strlcpy( origin, line + 1, sizeof( origin ) );
 		memmove( line, coreLine, strnlen( coreLine, BUFSIZE ) + 1 );
 		cmdptr = 1;
-	} else {
+	}
+	else
+	{
 		cmdptr = 0;
 		*origin = 0;
 	}
 	if( !*line )
 		return NS_FAILURE;
 	coreLine = strpbrk( line, " " );
-	if( coreLine ) {
+	if( coreLine )
+	{
 		*coreLine = 0;
 		while( isspace( *++coreLine ) );
-	} else {
+	}
+	else
+	{
 		coreLine = line + strlen( line );
 	}
 	strlcpy( cmd, line, sizeof( cmd ) ); 
@@ -171,8 +192,20 @@
 	return NS_SUCCESS;
 }
 
-/* :<source> <command> <param1> <paramN> :<last parameter> */
-/* <source> <command> <param1> <paramN> :<last parameter> */
+/** @brief parsep10
+ *
+ *  P10 parser
+ *  formats:
+ *    :<source> <command> <param1> <paramN> :<last parameter>
+ *    <source> <command> <param1> <paramN> :<last parameter>
+ *
+ *  @param notused
+ *  @param rline
+ *  @param len
+ *
+ *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
+ */
+
 int parsep10( void *notused, void *rline, size_t len )
 {
 	char origin[64], cmd[64], *coreLine;
@@ -187,12 +220,17 @@
 	dlog( DEBUG1, "------------------------BEGIN PARSE-------------------------" );
 	dlog( DEBUGRX, "%s", line );
 	coreLine = strpbrk( line, " " );
-	if( coreLine ) {
+	if( coreLine )
+	{
 		*coreLine = 0;
 		while( isspace( *++coreLine ) );
-	} else
+	}
+	else
+	{
 		coreLine = line + strlen( line );
-	if( ( !ircstrcasecmp( line, "SERVER" ) ) ||( !ircstrcasecmp( line, "PASS" ) ) ) {
+	}
+	if( ( !ircstrcasecmp( line, "SERVER" ) ) ||( !ircstrcasecmp( line, "PASS" ) ) )
+	{
 		strlcpy( cmd, line, sizeof( cmd ) );
 		dlog( DEBUG1, "cmd   : %s", cmd );
 		dlog( DEBUG1, "args  : %s", coreLine );
@@ -203,25 +241,29 @@
 		 if config uplink name does not match our uplinks server name we can
 		 never find the uplink!
 		*/
-		if( strcmp( cmd, "SERVER" ) == 0 ) {
+		if( strcmp( cmd, "SERVER" ) == 0 )
 			strlcpy( me.uplink, av[0], MAXHOST );
-		}
-	} else {
+	}
+	else
+	{
 		strlcpy( origin, line, sizeof( origin ) );	
 		cmdptr = 0;
 		line = strpbrk( coreLine, " " );
-		if( line ) {
+		if( line )
+		{
 			*line = 0;
 			while( isspace( *++line ) );
-		} /*else
-			coreLine = line + strlen( line );*/
+		} 
+		/*else
+		{
+			coreLine = line + strlen( line );
+		}*/
 		strlcpy( cmd, coreLine, sizeof( cmd ) );
 		dlog( DEBUG1, "origin: %s", origin );
 		dlog( DEBUG1, "cmd   : %s", cmd );
 		dlog( DEBUG1, "args  : %s", line );
-		if( line ) {
+		if( line )
 			ac = ircsplitbuf( line, &av, 1 );
-		}
 		dlog( DEBUG1, "0 %d", ac );
 	}
 	process_ircd_cmd( cmdptr, cmd, origin, av, ac );
@@ -242,27 +284,30 @@
 static int InitIrcdProtocol( void )
 {
 	protocol_info = ns_dlsym( protocol_module_handle, "protocol_info" );
-	if( !protocol_info ) {
+	if( !protocol_info )
+	{
 		nlog( LOG_CRITICAL, "Unable to find protocol_info in protocol module %s", protocol_path );
 		return NS_FAILURE;	
 	}
-	if( protocol_info->required & PROTOCOL_CLIENTMODE ) {
+	if( protocol_info->required & PROTOCOL_CLIENTMODE )
 		nsconfig.singlebotmode = 1;
-	}
 	strlcpy( me.servicescmode, protocol_info->services_cmode, MODESIZE );
 	strlcpy( me.servicesumode, protocol_info->services_umode, MODESIZE );
 	/* set min protocol */
 	ircd_srv.protocol = protocol_info->required;
 	/* Allow protocol module to "override" the parser */
 	irc_parse = ns_dlsym( protocol_module_handle, "parse" );
-	if( irc_parse == NULL ) {
+	/* Use internal parser */
+	if( irc_parse == NULL )
+	{
 		if( ircd_srv.protocol & PROTOCOL_P10 )
 			irc_parse = parsep10;
 		else
 			irc_parse = parse;
 	}
 	cmd_list = ns_dlsym( protocol_module_handle, "cmd_list" );
-	if( !cmd_list ) {
+	if( !cmd_list )
+	{
 		nlog( LOG_CRITICAL, "Unable to find command list in selected IRCd module" );
 		return NS_FAILURE;	
 	}
@@ -290,9 +335,8 @@
 	user_umodes = ns_dlsym( protocol_module_handle, "user_umodes" );
 	/* Not required */
 	user_smodes = ns_dlsym( protocol_module_handle, "user_smodes" );
-	if( user_smodes ) {
+	if( user_smodes )
 		ircd_srv.features |= FEATURE_USERSMODES;
-	}
 	if( InitModeTables( chan_umodes, chan_modes, user_umodes, user_smodes ) != NS_SUCCESS ) 
 		return NS_FAILURE;
 	return NS_SUCCESS;
@@ -315,14 +359,14 @@
 	ircsnprintf( protocol_path, 255, "%s/%s%s", MOD_PATH, me.protocol,MOD_STDEXT );
 	nlog( LOG_NORMAL, "Using protocol module %s", protocol_path );
 	protocol_module_handle = ns_dlopen( protocol_path, RTLD_NOW || RTLD_GLOBAL );
-	if( !protocol_module_handle ) {
+	if( !protocol_module_handle )
+	{
 		nlog( LOG_CRITICAL, "Unable to load protocol module %s", protocol_path );
 		return NS_FAILURE;	
 	}
 	/* Setup protocol options */
-	if( InitIrcdProtocol() != NS_SUCCESS ) {
+	if( InitIrcdProtocol() != NS_SUCCESS )
 		return NS_FAILURE;	
-	}
 	/* Setup IRCD function calls */
 	if( InitIrcdSymbols() != NS_SUCCESS ) 
 		return NS_FAILURE;
@@ -332,16 +376,30 @@
 	return NS_SUCCESS;
 }
 
-int FiniIrcd ( void ) {
-	ns_dlclose(protocol_module_handle);
-	return NS_SUCCESS;
+/** @brief FiniIrcd
+ *
+ *  fini ircd
+ *
+ *  @param none
+ *
+ *  @return none
+ */
+
+void FiniIrcd( void )
+{
+	ns_dlclose( protocol_module_handle );
 }
 
 /** @brief HaveFeature
  *
+ *  Check to see if a feature is supported
+ *
+ *  @param mask of features to check
+ *
  *  @return 1 if have else 0
  */
+
 int HaveFeature( int mask )
 {
-	return( ircd_srv.features&mask );
+	return( ircd_srv.features & mask );
 }

Modified: trunk/src/ircrecv.c
==============================================================================
--- trunk/src/ircrecv.c	(original)
+++ trunk/src/ircrecv.c	Sun Aug 21 06:53:26 2005
@@ -1403,7 +1403,7 @@
 {
 	SET_SEGV_LOCATION();
 	irc_numeric( RPL_VERSION, nick, "%s :%s -> %s %s", me.version, me.name, ns_module_info.build_date, ns_module_info.build_time );
-	ModulesVersion( nick, remoteserver );
+	AllModuleVersions( nick, remoteserver );
 }
 
 /** @brief Display our MOTD Message of the Day from the external neostats.motd file 

Modified: trunk/src/ircsend.c
==============================================================================
--- trunk/src/ircsend.c	(original)
+++ trunk/src/ircsend.c	Sun Aug 21 06:53:26 2005
@@ -599,7 +599,7 @@
  *
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
-void send_cmd( char *fmt, ... )
+void send_cmd( const char *fmt, ... )
 {
 	va_list ap;
 	char buf[BUFSIZE];

Modified: trunk/src/misc.c
==============================================================================
--- trunk/src/misc.c	(original)
+++ trunk/src/misc.c	Sun Aug 21 06:53:26 2005
@@ -257,7 +257,7 @@
 
 	buf = ns_malloc( BUFSIZE );
 	if( from >= ac ) {
-		dlog( DEBUG1, "joinbuf: from( %d ) >= ac( %d )", from, ac );
+		dlog( DEBUG1, "joinbuf: from (%d) >= ac (%d)", from, ac );
 		strlcpy( buf, "( null )", BUFSIZE );
 	}
 	else {

Modified: trunk/src/modes.c
==============================================================================
--- trunk/src/modes.c	(original)
+++ trunk/src/modes.c	Sun Aug 21 06:53:26 2005
@@ -461,11 +461,10 @@
  * @param c channel to check
  * @param mode is the mode to check, as a LONG
  *
- * @returns 1 on match, 0 on no match, -1 on error
+ * @return 1 on match, 0 on no match, -1 on error
  *
 */
-int
-test_cmode (Channel *c, const unsigned int mask)
+int test_cmode(const Channel *c, unsigned int mask)
 {
 	ModesParm *m;
 	lnode_t *mn;

Modified: trunk/src/modules.c
==============================================================================
--- trunk/src/modules.c	(original)
+++ trunk/src/modules.c	Sun Aug 21 06:53:26 2005
@@ -51,115 +51,171 @@
 /* @brief Module hash list */
 static hash_t *modulehash;
 
-/** @brief Initialise module list hashes
+/** @brief GetModuleList
  *
- * For core use only, initialises module list hashes
+ *  Calls handler for all modules
  *
- * @param none
- * 
- * @return none
-*/
+ *  @params handler to call
+ *  @params v additional data to send to handler
+ *
+ *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
+ */
+
+int GetModuleList( ModuleListHandler handler, void *v )
+{
+	Module *module_ptr;
+	hscan_t ms;
+	hnode_t *mn;
+
+	SET_SEGV_LOCATION();
+	hash_scan_begin( &ms, modulehash );
+	while( ( mn = hash_scan_next( &ms ) ) != NULL )
+	{
+		module_ptr = hnode_get( mn );
+		if( handler( module_ptr, v ) == NS_TRUE )
+			break;
+	}
+	return NS_SUCCESS;
+}
+
+/** @brief InitModules
+ *
+ *  initialises module list hashes
+ *  For core use only
+ *
+ *  @params none
+ *
+ *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
+ */
+
 int InitModules( void )
 {
 	SET_SEGV_LOCATION();
-	modulehash = hash_create (NUM_MODULES, 0, 0);
-	if(!modulehash) {
-		nlog (LOG_CRITICAL, "Unable to create module hash");
+	modulehash = hash_create( NUM_MODULES, 0, 0 );
+	if( !modulehash ) {
+		nlog( LOG_CRITICAL, "Unable to create module hash" );
 		return NS_FAILURE;
 	}
 	return NS_SUCCESS;
 }
 
-void FiniModules (void) 
+/** @brief FiniModules
+ *
+ *  Fini module subsystem
+ *
+ *  @params none
+ *
+ *  @return none
+ */
+
+void FiniModules( void ) 
 {
-	hash_destroy(modulehash);
+	hash_destroy( modulehash );
 }
 
-/** @brief SynchModule 
+/** @brief SynchModule
  *
- * 
+ *  Synch module
+ *
+ *  @params module_ptr pointer to module to synch
  *
- * @return none
+ *  @return result of ModSynch
  */
-int SynchModule (Module* module_ptr)
+
+int SynchModule( Module* module_ptr )
 {
 	int err = NS_SUCCESS; /*FAILURE;*/
-	int (*ModSynch) (void);
+	int( *ModSynch )( void );
 
 #ifdef USE_PERL	
 	/* only standard modules get a sync */
-	if (IS_STD_MOD(module_ptr)) {
+	if( IS_STD_MOD( module_ptr ) ) {
 #endif
 		module_ptr->insynch = 1;
-		ModSynch = ns_dlsym ((int *) module_ptr->handle, "ModSynch");
-		if (ModSynch) {
-			SET_RUN_LEVEL(module_ptr);
-			err = (*ModSynch)(); 
+		ModSynch = ns_dlsym( ( int * ) module_ptr->handle, "ModSynch" );
+		if( ModSynch ) {
+			SET_RUN_LEVEL( module_ptr );
+			err =( *ModSynch )(); 
 			RESET_RUN_LEVEL();
 		}
 		SET_SEGV_LOCATION();
 		module_ptr->synched = 1;
 #ifdef USE_PERL
 	} else {
-		err = perl_sync_module(module_ptr);
+		err = perl_sync_module( module_ptr );
 	}
 #endif
 	return err;
 }
 	
-/** @brief SynchAllModule 
+/** @brief SynchAllModule
  *
- * 
+ *  Synch all modules
+ *
+ *  @params none
  *
- * @return none
+ *  @return none
  */
-int SynchAllModules (void)
+
+void SynchAllModules( void )
 {
 	Module *module_ptr;
 	hscan_t ms;
 	hnode_t *mn;
 
 	SET_SEGV_LOCATION();
-	hash_scan_begin (&ms, modulehash);
-	while ((mn = hash_scan_next (&ms)) != NULL) {
-		module_ptr = hnode_get (mn);
-		if (SynchModule (module_ptr) != NS_SUCCESS) {
-			unload_module (module_ptr->info->name, NULL);
+	hash_scan_begin( &ms, modulehash );
+	while( ( mn = hash_scan_next( &ms ) ) != NULL ) {
+		module_ptr = hnode_get( mn );
+		if( SynchModule( module_ptr ) != NS_SUCCESS ) {
+			unload_module( module_ptr->info->name, NULL );
 		}
 	}
-	return NS_SUCCESS;
 }
 
-
-/** @brief 
+/** @brief ModuleVersion
  *
- * 
+ *  report module versions
+ *
+ *  @params module_ptr pointer to module to report
+ *  @params v nick to send to
  *
- * @return none
+ *  @return none
  */
-void
-ModulesVersion (const char* nick, const char *remoteserver)
+
+int ModuleVersion( Module *module_ptr, void *v )
 {
-	Module *module_ptr;
-	hscan_t ms;
-	hnode_t *mn;
+	irc_numeric( RPL_VERSION, (char *)v, _( "Module %s version: %s %s %s" ),
+		module_ptr->info->name, module_ptr->info->version, 
+		module_ptr->info->build_date, module_ptr->info->build_time );
+	return NS_FALSE;
+}
 
-	SET_SEGV_LOCATION();
-	hash_scan_begin (&ms, modulehash);
-	while ((mn = hash_scan_next (&ms)) != NULL) {
-		module_ptr = hnode_get (mn);
-		irc_numeric (RPL_VERSION, nick,
-			_("Module %s version: %s %s %s"),
-			module_ptr->info->name, module_ptr->info->version, 
-			module_ptr->info->build_date, module_ptr->info->build_time);
-	}
+/** @brief AllModuleVersions
+ *
+ *  report module versions
+ *
+ *  @params nick
+ *  @params remoteserver
+ *
+ *  @return none
+ */
+
+void AllModuleVersions( const char* nick, const char *remoteserver )
+{
+	GetModuleList( ModuleVersion, (void *)nick );
 }
 
-/** @brief 
+/** @brief load_module_error
  *
- * 
+ *  report load module error
+ *
+ *  @params target
+ *  @params module_name
+ *  @params fmt
+ *  @params ...
  *
- * @return none
+ *  @return none
  */
 
 void load_module_error( const Client *target, const char *module_name, const char *fmt, ... )
@@ -167,155 +223,167 @@
 	static char buf[BUFSIZE];
 	va_list ap;
 
-	va_start (ap, fmt);
-	ircvsnprintf (buf, BUFSIZE, fmt, ap);
-	va_end (ap);
-	if (target) {
-		irc_prefmsg (ns_botptr, target, __("Unable to load module %s: %s", u), module_name, buf);
+	va_start( ap, fmt );
+	ircvsnprintf( buf, BUFSIZE, fmt, ap );
+	va_end( ap );
+	if( target ) {
+		irc_prefmsg( ns_botptr, target, __( "Unable to load module %s: %s", u ), module_name, buf );
 	}
-	nlog (LOG_WARNING, buf);
+	nlog( LOG_WARNING, buf );
 }
 
-/** @brief 
+/** @brief ns_load_module
  *
- * @param 
- * 
- * @return
+ *  determine the type of module based on extension
+ *  and then call the relevent procedure to load it
+ *
+ *  @params modfilename name of module to load
+ *  @params u client requesting load
+ *
+ *  @return pointer to loaded module
  */
-Module *load_stdmodule (const char *modfilename, Client * u)
+
+Module *load_stdmodule( const char *modfilename, Client * u )
 {
 	int err;
 	void *handle;
 	ModuleInfo *infoptr = NULL;
 	ModuleEvent *eventlistptr = NULL;
 	Module *mod_ptr = NULL;
-	int (*ModInit) (void);
+	int( *ModInit )( void );
 	CmdParams *cmd;
 
 	SET_SEGV_LOCATION();
-	if (hash_isfull (modulehash)) {
-		load_module_error( u, modfilename, __("module list is full", u) );
+	if( hash_isfull( modulehash ) ) {
+		load_module_error( u, modfilename, __( "module list is full", u ) );
 		return NULL;
 	} 
-	handle = ns_dlopen (modfilename, RTLD_NOW || RTLD_GLOBAL);
-	if (!handle) {
+	handle = ns_dlopen( modfilename, RTLD_NOW || RTLD_GLOBAL );
+	if( !handle ) {
 		load_module_error( u, modfilename, ns_dlerrormsg, modfilename );
 		return NULL;
 	}
-	infoptr = ns_dlsym (handle, "module_info");
-	if(infoptr == NULL) {
-		load_module_error( u, modfilename, __("missing module_info", u) );
-		ns_dlclose (handle);
+	infoptr = ns_dlsym( handle, "module_info" );
+	if( infoptr == NULL ) {
+		load_module_error( u, modfilename, __( "missing module_info", u ) );
+		ns_dlclose( handle );
 		return NULL;
 	}
 	/* Check module was built for this version of NeoStats */
-	if( ircstrncasecmp (NEOSTATS_VERSION, infoptr->neostats_version, VERSIONSIZE) !=0 ) {
-		load_module_error( u, modfilename, __("module built with an old version of NeoStats and must be rebuilt.", u)  );
-		ns_dlclose (handle);
+	if( ircstrncasecmp( NEOSTATS_VERSION, infoptr->neostats_version, VERSIONSIZE ) !=0 ) {
+		load_module_error( u, modfilename, __( "module built with an old version of NeoStats and must be rebuilt.", u ) );
+		ns_dlclose( handle );
 		return NULL;
 	}
-	if( !infoptr->copyright || ircstrcasecmp (infoptr->copyright[0], "Copyright (c) <year>, <your name>") ==0 ) {
-		load_module_error( u, modfilename, __("missing copyright text.", u) );
-		ns_dlclose (handle);
+	if( !infoptr->copyright || ircstrcasecmp( infoptr->copyright[0], "Copyright( c ) <year>, <your name>" ) ==0 ) {
+		load_module_error( u, modfilename, __( "missing copyright text.", u ) );
+		ns_dlclose( handle );
 		return NULL;
 	}	
-	if( !infoptr->about_text || ircstrcasecmp (infoptr->about_text[0], "About your module") ==0 ) {
-		load_module_error( u, modfilename, __("missing about text.", u) );
-		ns_dlclose (handle);
+	if( !infoptr->about_text || ircstrcasecmp( infoptr->about_text[0], "About your module" ) ==0 ) {
+		load_module_error( u, modfilename, __( "missing about text.", u ) );
+		ns_dlclose( handle );
 		return NULL;
 	}	
 	/* Check that the Module hasn't already been loaded */
-	if (hash_lookup (modulehash, infoptr->name)) {
-		ns_dlclose (handle);
-		load_module_error( u, modfilename, __("already loaded", u) );
+	if( hash_lookup( modulehash, infoptr->name ) ) {
+		ns_dlclose( handle );
+		load_module_error( u, modfilename, __( "already loaded", u ) );
 		return NULL;
 	}
 	/* Check we have require PROTOCOL/FEATURE support for module */
-	if((infoptr->features & ircd_srv.features) != infoptr->features) {
-		load_module_error( u, modfilename, __("Required module features not available on this IRCd.", u), modfilename );
-		ns_dlclose (handle);
+	if( ( infoptr->features & ircd_srv.features ) != infoptr->features ) {
+		load_module_error( u, modfilename, __( "Required module features not available on this IRCd.", u ), modfilename );
+		ns_dlclose( handle );
 		return NULL;
 	}
-	/* Lookup ModInit (replacement for library __init() call */
-	ModInit = ns_dlsym ((int *) handle, "ModInit");
-	if (!ModInit) {
-		load_module_error( u, modfilename, __("missing ModInit.", u) );
-		ns_dlclose (handle);
+	/* Lookup ModInit( replacement for library __init() call */
+	ModInit = ns_dlsym( ( int * ) handle, "ModInit" );
+	if( !ModInit ) {
+		load_module_error( u, modfilename, __( "missing ModInit.", u ) );
+		ns_dlclose( handle );
 		return NULL;
 	}
 	/* Allocate module */
-	mod_ptr = (Module *) ns_calloc (sizeof (Module));
-	dlog(DEBUG1, "Module internal name: %s", infoptr->name);
-	dlog(DEBUG1, "Module description: %s", infoptr->description);
+	mod_ptr =( Module * ) ns_calloc( sizeof( Module ) );
+	dlog( DEBUG1, "Module internal name: %s", infoptr->name );
+	dlog( DEBUG1, "Module description: %s", infoptr->description );
 	mod_ptr->info = infoptr;
 	mod_ptr->handle = handle;
-	insert_module(mod_ptr);
+	insert_module( mod_ptr );
 #ifdef USE_PERL
 	mod_ptr->modtype = MOD_STANDARD;
 #endif
 	/* Extract pointer to event list */
-	eventlistptr = ns_dlsym (handle, "module_events");
-	if(eventlistptr) {
-		SET_RUN_LEVEL(mod_ptr);
-		AddEventList (eventlistptr);
+	eventlistptr = ns_dlsym( handle, "module_events" );
+	if( eventlistptr ) {
+		SET_RUN_LEVEL( mod_ptr );
+		AddEventList( eventlistptr );
 		RESET_RUN_LEVEL();
 	}
     /* For Auth modules, register auth function */
-	if (infoptr->flags & MODULE_FLAG_AUTH) {
-		if (AddAuthModule (mod_ptr) != NS_SUCCESS) {
-			load_module_error( u, modfilename, __("Unable to load auth module: %s missing ModAuthUser function",u), infoptr->name );
-			unload_module(mod_ptr->info->name, NULL);
+	if( infoptr->flags & MODULE_FLAG_AUTH ) {
+		if( AddAuthModule( mod_ptr ) != NS_SUCCESS ) {
+			load_module_error( u, modfilename, __( "Unable to load auth module: %s missing ModAuthUser function",u ), infoptr->name );
+			unload_module( mod_ptr->info->name, NULL );
 			return NULL;
 		}
 	}
     /* Module side user authentication for e.g. SecureServ helpers 
      * Not available on auth modules */
-	if (!(infoptr->flags & MODULE_FLAG_AUTH)) {
-		mod_ptr->authcb = ns_dlsym ((int *) handle, "ModAuthUser");
+	if( !( infoptr->flags & MODULE_FLAG_AUTH ) ) {
+		mod_ptr->authcb = ns_dlsym( ( int * ) handle, "ModAuthUser" );
 	}
 	/* assign a module number to this module */
-	assign_mod_number(mod_ptr);
+	assign_mod_number( mod_ptr );
 
 	SET_SEGV_LOCATION();
-	SET_RUN_LEVEL(mod_ptr);
+	SET_RUN_LEVEL( mod_ptr );
 	DBAOpenDatabase();
-	err = (*ModInit)(); 
+	err =( *ModInit )(); 
 	RESET_RUN_LEVEL();
-	if (err < 1 || mod_ptr->error) {
-		load_module_error( u, modfilename, __("See %s.log for further information.",u), mod_ptr->info->name );
-		unload_module(mod_ptr->info->name, NULL);
+	if( err < 1 || mod_ptr->error ) {
+		load_module_error( u, modfilename, __( "See %s.log for further information.",u ), mod_ptr->info->name );
+		unload_module( mod_ptr->info->name, NULL );
 		return NULL;
 	}
-	if (infoptr->flags & MODULE_FLAG_LOCAL_EXCLUDES) 
+	if( infoptr->flags & MODULE_FLAG_LOCAL_EXCLUDES ) 
 	{
-		InitModExcludes(mod_ptr);
+		InitModExcludes( mod_ptr );
 	}
 	SET_SEGV_LOCATION();
 
 	/* Let this module know we are online if we are! */
-	if (IsNeoStatsSynched()) {
-		if (SynchModule (mod_ptr) != NS_SUCCESS || mod_ptr->error)
+	if( IsNeoStatsSynched() ) {
+		if( SynchModule( mod_ptr ) != NS_SUCCESS || mod_ptr->error )
 		{
-			load_module_error( u, modfilename, __("See %s.log for further information.", u), mod_ptr->info->name );
-			unload_module(mod_ptr->info->name, NULL);
+			load_module_error( u, modfilename, __( "See %s.log for further information.", u ), mod_ptr->info->name );
+			unload_module( mod_ptr->info->name, NULL );
 			return NULL;
 		}
 	}
-	cmd = ns_calloc (sizeof(CmdParams));
-	cmd->param = (char*)infoptr->name;
-	SendAllModuleEvent(EVENT_MODULELOAD, cmd);
-	ns_free(cmd);
-	if (u) {
-		irc_prefmsg (ns_botptr, u, __("Module %s loaded, %s",u), infoptr->name, infoptr->description);
-		irc_globops (NULL, _("Module %s loaded"), infoptr->name);
+	cmd = ns_calloc( sizeof( CmdParams ) );
+	cmd->param =( char* )infoptr->name;
+	SendAllModuleEvent( EVENT_MODULELOAD, cmd );
+	ns_free( cmd );
+	if( u ) {
+		irc_prefmsg( ns_botptr, u, __( "Module %s loaded, %s",u ), infoptr->name, infoptr->description );
+		irc_globops( NULL, _( "Module %s loaded" ), infoptr->name );
 	}
 	return mod_ptr;
 }
 
-/** @brief determine the type of module based on extension and then
- * call the relevent procedure to load it
+/** @brief ns_load_module
+ *
+ *  determine the type of module based on extension
+ *  and then call the relevent procedure to load it
+ *
+ *  @params modfilename name of module to load
+ *
+ *  @return pointer to loaded module
  */
-Module *ns_load_module(const char *modfilename, Client * u)
+
+Module *ns_load_module( const char *modfilename, Client * u )
 { 
 	char path[255];
 	char loadmodname[255];
@@ -324,238 +392,258 @@
 	strlcpy( loadmodname, modfilename, 255 );
 	strlwr( loadmodname );
 	ircsnprintf( path, 255, "%s/%s%s", MOD_PATH, loadmodname, MOD_STDEXT );
-	if (stat(path, &buf) != -1) {
-		return load_stdmodule(path, u);
+	if( stat( path, &buf ) != -1 ) {
+		return load_stdmodule( path, u );
 	}
 #ifdef USE_PERL
-	ircsnprintf (path, 255, "%s/%s%s", MOD_PATH, loadmodname, MOD_PERLEXT);
-	if (stat(path, &buf) != -1) {
+	ircsnprintf( path, 255, "%s/%s%s", MOD_PATH, loadmodname, MOD_PERLEXT );
+	if( stat( path, &buf ) != -1 ) {
 		Module *mod;
-		mod = load_perlmodule(path, u);
-		mod->info->build_date = ns_malloc(10);
-		strftime((char *)mod->info->build_date, 9, "%d/%m/%y", gmtime(&buf.st_mtime));
-		mod->info->build_time = ns_malloc(11);
-		strftime((char *)mod->info->build_time, 10, "%H:%M", gmtime(&buf.st_mtime));
+		mod = load_perlmodule( path, u );
+		mod->info->build_date = ns_malloc( 10 );
+		strftime( ( char * )mod->info->build_date, 9, "%d/%m/%y", gmtime( &buf.st_mtime ) );
+		mod->info->build_time = ns_malloc( 11 );
+		strftime( ( char * )mod->info->build_time, 10, "%H:%M", gmtime( &buf.st_mtime ) );
 		return mod;
 	}
 #endif
 	/* if we get here, ehhh, doesn't exist */
-	load_module_error( u, modfilename, __("Module file not found", u));
+	load_module_error( u, modfilename, __( "Module file not found", u ) );
 	return NULL;
 
 }
 
-/** @brief generate module number and assign it
+/** @brief insert_module
  *
- * @param mod_ptr module pointer 
+ *  generate module number and assign it
  *
- * @return Nothing 
+ *  @params mod_ptr module pointer 
+ *
+ *  @return none
  */
 
 void assign_mod_number( Module *mod_ptr )
 {
 	int moduleindex = 0;
 
-	while (ModList[moduleindex] != NULL)
+	while( ModList[moduleindex] != NULL )
 		moduleindex++;
 	ModList[moduleindex] = mod_ptr;
 	mod_ptr->modnum = moduleindex;
-	dlog(DEBUG1, "Assigned %d to module %s for modulenum", moduleindex, mod_ptr->info->name);
+	dlog( DEBUG1, "Assigned %d to module %s for modulenum", moduleindex, mod_ptr->info->name );
 }
 
-/** @brief insert module pointer into module hash. 
+/** @brief insert_module
+ *
+ *  insert module pointer into module hash. 
  *
- * @param mod_ptr module pointer 
+ *  @params mod_ptr module pointer 
  *
- * @return Nothing 
+ *  @return none
  */
 
-void insert_module(Module *mod_ptr)
+void insert_module( Module *mod_ptr )
 {
-	hnode_create_insert (modulehash, mod_ptr, mod_ptr->info->name);
+	hnode_create_insert( modulehash, mod_ptr, mod_ptr->info->name );
 }
 
+/** @brief ReportModuleInfo
+ *
+ *  MODLIST helper
+ *  report module info
+ *
+ *  @params module_ptr pointer to module to report
+ *  @params v client to send to
+ *
+ *  @return none
+ */
 
+int ReportModuleInfo( Module *module_ptr, void *v )
+{
+	Client *u = (Client *)v;
+	irc_prefmsg( ns_botptr, u, __( "Module: %d %s (%s)", u ), module_ptr->modnum, module_ptr->info->name, module_ptr->info->version );
+	irc_prefmsg( ns_botptr, u, "      : %s", module_ptr->info->description );
+	return NS_FALSE;
+}
 
-/** @brief 
+/** @brief ns_cmd_modlist
  *
- * @param 
- * 
- * @return
+ *  MODLIST command handler
+ *
+ *  @params cmdparams pointer to commands param struct
+ *
+ *  @return NS_SUCCESS if suceeds else NS_FAILURE
  */
-int
-ns_cmd_modlist (CmdParams* cmdparams)
-{
-	Module *mod_ptr = NULL;
-	hnode_t *mn;
-	hscan_t hs;
 
+int ns_cmd_modlist( CmdParams* cmdparams )
+{
 	SET_SEGV_LOCATION();
-	hash_scan_begin (&hs, modulehash);
-	while ((mn = hash_scan_next (&hs)) != NULL) {
-		mod_ptr = hnode_get (mn);
-		irc_prefmsg (ns_botptr, cmdparams->source, __("Module: %d %s (%s)", cmdparams->source), mod_ptr->modnum, mod_ptr->info->name, mod_ptr->info->version);
-		irc_prefmsg (ns_botptr, cmdparams->source, "      : %s", mod_ptr->info->description);
-	}
-	irc_prefmsg (ns_botptr, cmdparams->source, __("End of Module List", cmdparams->source));
+	GetModuleList( ReportModuleInfo, (void *)cmdparams->source );
+	irc_prefmsg( ns_botptr, cmdparams->source, __( "End of Module List", cmdparams->source ) );
 	return 0;
 }
 
-/** @brief 
+/** @brief unload_module
+ *
+ *  Unloads module
  *
- * @param 
+ *  @param modname name of module to unload
+ *  @param u pointer to client requesting unload if appropriate
  * 
- * @return
- */
-int
-unload_module (const char *modname, Client * u)
+ *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
+*/
+
+int unload_module( const char *modname, Client * u )
 {
 	Module *mod_ptr;
 	hnode_t *modnode;
 	int moduleindex;
-	int (*ModFini) ( void );
+	int( *ModFini )( void );
 	CmdParams *cmdparams;
 
 	SET_SEGV_LOCATION();
 	/* Check to see if module is loaded */
-	modnode = hash_lookup (modulehash, modname);
-	if (!modnode) {
-		if (u) {
-			irc_prefmsg (ns_botptr, u, __("Module %s not loaded, try /msg %s modlist", u), modname, ns_botptr->name);
-			irc_chanalert (ns_botptr, _("%s tried to unload %s but its not loaded"), u->name, modname);
+	modnode = hash_lookup( modulehash, modname );
+	if( !modnode ) {
+		if( u ) {
+			irc_prefmsg( ns_botptr, u, __( "Module %s not loaded, try /msg %s modlist", u ), modname, ns_botptr->name );
+			irc_chanalert( ns_botptr, _( "%s tried to unload %s but its not loaded" ), u->name, modname );
 		}
 		return NS_FAILURE;
 	}
-	mod_ptr = hnode_get (modnode);
-	irc_chanalert (ns_botptr, _("Unloading module %s"), modname);
-	if (mod_ptr->info->flags & MODULE_FLAG_AUTH)
+	mod_ptr = hnode_get( modnode );
+	irc_chanalert( ns_botptr, _( "Unloading module %s" ), modname );
+	if( mod_ptr->info->flags & MODULE_FLAG_AUTH )
 	{
-		DelAuthModule (mod_ptr);
+		DelAuthModule( mod_ptr );
 	}
 	moduleindex = mod_ptr->modnum;
 	/* canx any DNS queries used by this module */
-	canx_dns (mod_ptr);
+	canx_dns( mod_ptr );
 	/* Delete any timers used by this module */
-	del_timers (mod_ptr);
+	del_timers( mod_ptr );
 	/* Delete any sockets used by this module */
-	del_sockets (mod_ptr);
+	del_sockets( mod_ptr );
 	/* Delete any associated event list */
 	FreeEventList( mod_ptr );
 	/* Remove from the module hash so we dont call events for this module 
 	 * during signoff 
 	 */
-	dlog(DEBUG1, "Deleting Module %s from Hash", modname);
-	hash_delete (modulehash, modnode);		
-	hnode_destroy (modnode);
+	dlog( DEBUG1, "Deleting Module %s from Hash", modname );
+	hash_delete( modulehash, modnode );		
+	hnode_destroy( modnode );
 
 	/* now determine if its perl, or standard module */
-	if (IS_STD_MOD(mod_ptr)) {
-		/* call ModFini (replacement for library __fini() call */
-		ModFini = ns_dlsym ((int *) mod_ptr->handle, "ModFini");
-		if (ModFini) {
-			SET_RUN_LEVEL(mod_ptr);
-			(*ModFini)();
+	if( IS_STD_MOD( mod_ptr ) ) {
+		/* call ModFini( replacement for library __fini() call */
+		ModFini = ns_dlsym( ( int * ) mod_ptr->handle, "ModFini" );
+		if( ModFini ) {
+			SET_RUN_LEVEL( mod_ptr );
+			( *ModFini )();
 			RESET_RUN_LEVEL();
 			SET_SEGV_LOCATION();
 		}
 #if USE_PERL
 	} else {
-		PerlModFini(mod_ptr);
+		PerlModFini( mod_ptr );
 #endif
 	}
 	/* Delete any bots used by this module. Done after ModFini, so the bot 
 	 * can still send messages during ModFini 
 	 */
-	DelModuleBots (mod_ptr);
+	DelModuleBots( mod_ptr );
 	/* Close module */
-	irc_globops (NULL, _("%s Module unloaded"), modname);
-	SET_RUN_LEVEL(mod_ptr);
-	if (mod_ptr->info->flags & MODULE_FLAG_LOCAL_EXCLUDES) 
+	irc_globops( NULL, _( "%s Module unloaded" ), modname );
+	SET_RUN_LEVEL( mod_ptr );
+	if( mod_ptr->info->flags & MODULE_FLAG_LOCAL_EXCLUDES ) 
 	{
-		FiniModExcludes(mod_ptr);
+		FiniModExcludes( mod_ptr );
 	}
-	cmdparams = ns_calloc (sizeof(CmdParams));
-	cmdparams->param = (char*)modname;
-	SendAllModuleEvent(EVENT_MODULEUNLOAD, cmdparams);
-	ns_free(cmdparams);
+	cmdparams = ns_calloc( sizeof( CmdParams ) );
+	cmdparams->param =( char* )modname;
+	SendAllModuleEvent( EVENT_MODULEUNLOAD, cmdparams );
+	ns_free( cmdparams );
 	RESET_RUN_LEVEL();
 
-	SET_RUN_LEVEL(mod_ptr);
+	SET_RUN_LEVEL( mod_ptr );
 	DBACloseDatabase();
 
 
-	if (IS_STD_MOD(mod_ptr)) {
-		ns_dlclose (mod_ptr->handle);
+	if( IS_STD_MOD( mod_ptr ) ) {
+		ns_dlclose( mod_ptr->handle );
 #ifdef USE_PERL
 	} else {
-		unload_perlmod(mod_ptr);
+		unload_perlmod( mod_ptr );
 #endif
 	}
 	RESET_RUN_LEVEL();
-	ns_free (mod_ptr);
+	ns_free( mod_ptr );
 	/* free the module number */
-	if (moduleindex >= 0) {
-		dlog(DEBUG1, "Free %d from Module Numbers", moduleindex);
+	if( moduleindex >= 0 ) {
+		dlog( DEBUG1, "Free %d from Module Numbers", moduleindex );
 		ModList[moduleindex] = NULL;
 	}
 	/* Cleanup moddata */
-	CleanupUserModdata (moduleindex);
-	CleanupServerModdata (moduleindex);
-	CleanupChannelModdata (moduleindex);
+	CleanupUserModdata( moduleindex );
+	CleanupServerModdata( moduleindex );
+	CleanupChannelModdata( moduleindex );
 	return NS_SUCCESS;
 }
 
-/** @brief unload all loaded modules
+/** @brief unload_modules
  *
- * Unloads all loaded modules
+ *  Unloads all loaded modules
  *
- * @param none
+ *  @param none
  * 
- * @return none
+ *  @return none
 */
-void unload_modules(void)
+
+void unload_modules( void )
 {
 	Module *mod_ptr;
 	hscan_t ms;
 	hnode_t *mn;
 
 	/* Walk through hash list unloading each module */
-	hash_scan_begin (&ms, modulehash);
-	while ((mn = hash_scan_next (&ms)) != NULL) {
-		mod_ptr = hnode_get (mn);
-		unload_module (mod_ptr->info->name, NULL);
+	hash_scan_begin( &ms, modulehash );
+	while( ( mn = hash_scan_next( &ms ) ) != NULL ) {
+		mod_ptr = hnode_get( mn );
+		unload_module( mod_ptr->info->name, NULL );
 	}
 }
 
-/** @brief 
+/** @brief ModuleConfig
  *
- * @param 
- * 
- * @return
+ *  Load module configuration
+ *
+ *  @param set_ptr pointer to module settings
+ *
+ *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
-int
-ModuleConfig(bot_setting* set_ptr)
+
+int ModuleConfig( bot_setting* set_ptr )
 {
 	SET_SEGV_LOCATION();
-	while(set_ptr->option)
+	while( set_ptr->option )
 	{
-		switch(set_ptr->type) {
+		switch( set_ptr->type ) {
 			case SET_TYPE_BOOLEAN:
-				if (DBAFetchConfigBool (set_ptr->option, set_ptr->varptr) != NS_SUCCESS) {
-					*(int *)set_ptr->varptr = (int)set_ptr->defaultval;
-					DBAStoreConfigBool (set_ptr->option, set_ptr->varptr);
+				if( DBAFetchConfigBool( set_ptr->option, set_ptr->varptr ) != NS_SUCCESS ) {
+					*( int * )set_ptr->varptr =( int )set_ptr->defaultval;
+					DBAStoreConfigBool( set_ptr->option, set_ptr->varptr );
 				}
-				if(set_ptr->handler) {
-					set_ptr->handler(NULL, SET_LOAD);
+				if( set_ptr->handler ) {
+					set_ptr->handler( NULL, SET_LOAD );
 				}
 				break;
 			case SET_TYPE_INT:
-				if (DBAFetchConfigInt (set_ptr->option, set_ptr->varptr) != NS_SUCCESS) {
-					*(int *)set_ptr->varptr = (int)set_ptr->defaultval;
-					DBAStoreConfigInt(set_ptr->option, set_ptr->varptr);
+				if( DBAFetchConfigInt( set_ptr->option, set_ptr->varptr ) != NS_SUCCESS ) {
+					*( int * )set_ptr->varptr =( int )set_ptr->defaultval;
+					DBAStoreConfigInt( set_ptr->option, set_ptr->varptr );
 				}
-				if(set_ptr->handler) {
-					set_ptr->handler(NULL, SET_LOAD);
+				if( set_ptr->handler ) {
+					set_ptr->handler( NULL, SET_LOAD );
 				}
 				break;
 			case SET_TYPE_STRING:
@@ -566,24 +654,24 @@
 			case SET_TYPE_HOST:
 			case SET_TYPE_REALNAME:
 			case SET_TYPE_IPV4:
-				if(	DBAFetchConfigStr (set_ptr->option, set_ptr->varptr, set_ptr->max) != NS_SUCCESS) {
+				if( 	DBAFetchConfigStr( set_ptr->option, set_ptr->varptr, set_ptr->max ) != NS_SUCCESS ) {
 					if( set_ptr->defaultval ) {
-						strlcpy(set_ptr->varptr, set_ptr->defaultval, set_ptr->max);
+						strlcpy( set_ptr->varptr, set_ptr->defaultval, set_ptr->max );
 					}
-					DBAStoreConfigStr (set_ptr->option, set_ptr->varptr, set_ptr->max);
+					DBAStoreConfigStr( set_ptr->option, set_ptr->varptr, set_ptr->max );
 				}
-				if(set_ptr->handler) {
-					set_ptr->handler(NULL, SET_LOAD);
+				if( set_ptr->handler ) {
+					set_ptr->handler( NULL, SET_LOAD );
 				}
 				break;			
 			case SET_TYPE_CUSTOM:
-				if(set_ptr->handler) {
-					set_ptr->handler(NULL, SET_LOAD);
+				if( set_ptr->handler ) {
+					set_ptr->handler( NULL, SET_LOAD );
 				}
 				break;
 			default:
-				nlog(LOG_WARNING, "Unsupported SET type %d in ModuleConfig %s", 
-					set_ptr->type, set_ptr->option);
+				nlog( LOG_WARNING, "Unsupported SET type %d in ModuleConfig %s", 
+					set_ptr->type, set_ptr->option );
 				break;
 		}
 		set_ptr++;
@@ -591,7 +679,16 @@
 	return NS_SUCCESS;
 }
 
-hash_t *GetModuleHash (void)
+/** @brief GetModuleHash
+ *
+ *  Get module hash pointer
+ *
+ *  @param none
+ *
+ *  @return module hash pointer
+ */
+
+hash_t *GetModuleHash( void )
 {
 	return modulehash;
 }

Modified: trunk/src/nsmemory.c
==============================================================================
--- trunk/src/nsmemory.c	(original)
+++ trunk/src/nsmemory.c	Sun Aug 21 06:53:26 2005
@@ -27,98 +27,107 @@
 #include "main.h"
 #include "services.h"
 
-/** @brief NeoStats wrapper for malloc.
+/** @brief ns_malloc
  *
- * Allocates memory for internal variables. 
- * If enough memory can't be allocated, exit the program 
+ *  NeoStats wrapper for malloc.
+ *  Allocates memory for internal variables. 
+ *  If enough memory can't be allocated, exit the program 
  *
- * @param size The amount of memory to alloc
+ *  @param size of memory to alloc
  *
- * @returns pointer to allocated buffer
+ *  @return pointer to allocated buffer
  */
 
-void *ns_malloc (const int size)
+void *ns_malloc( int size )
 {
-	unsigned int allocsize;
 	void *buf;
-	allocsize = size;
-	if (!allocsize) {
-		dlog( DEBUG2, "ns_malloc: illegal attempt to allocate 0 bytes!");
-		allocsize = 1;
-	}
-	buf = malloc (allocsize);
-	if (!buf) {
-		nlog (LOG_CRITICAL, "ns_malloc: out of memory.");
-		do_exit (NS_EXIT_ERROR, "Out of memory");
+
+	if( !size )
+	{
+		dlog( DEBUG2, "ns_malloc: illegal attempt to allocate 0 bytes!" );
+		size = 1;
+	}
+	buf = malloc( size );
+	if( !buf )
+	{
+		nlog( LOG_CRITICAL, "ns_malloc: out of memory." );
+		do_exit( NS_EXIT_ERROR, "Out of memory" );
 	}
 	return buf;
 }
 
-/** @brief NeoStats wrapper for calloc.
+/** @brief ns_calloc
  *
- * Allocates memory for internal variables. 
- * If enough memory can't be allocated, exit the program 
+ *	NeoStats wrapper for calloc.
+ *	Allocates memory for internal variables. 
+ *	If enough memory can't be allocated, exit the program 
  *
- * @param size The amount of memory to alloc
+ *	@param size of memory to alloc
  *
- * @returns pointer to allocated buffer
+ *	@return pointer to allocated buffer
  */
 
-void *ns_calloc (const int size)
+void *ns_calloc( int size )
 {
 	void *buf;
-	unsigned int allocsize;
 
-	allocsize = size;
-	if (!allocsize) {
-		dlog( DEBUG2, "ns_calloc: illegal attempt to allocate 0 bytes!");
-		allocsize = 1;
-	}
-	buf = calloc (1, allocsize);
-	if (!buf) {
-		nlog (LOG_CRITICAL, "ns_calloc: out of memory.");
-		do_exit (NS_EXIT_ERROR, "Out of memory");
+	if( !size )
+	{
+		dlog( DEBUG2, "ns_calloc: illegal attempt to allocate 0 bytes!" );
+		size = 1;
+	}
+	buf = calloc( 1, size );
+	if( !buf )
+	{
+		nlog( LOG_CRITICAL, "ns_calloc: out of memory." );
+		do_exit( NS_EXIT_ERROR, "Out of memory" );
 	}
 	return buf;
 }
 
-/** @brief NeoStats wrapper for realloc.
+/** @brief ns_realloc
  *
- * Reallocates memory
- * If enough memory can't be allocated, exit the program 
+ *  NeoStats wrapper for realloc.
+ *  Reallocates memory
+ *  If enough memory can't be allocated, exit the program 
  *
- * @param size The amount of memory to realloc
+ *  @param ptr to existing allocation
+ *  @param size of memory to realloc
  *
- * @returns pointer to allocated buffer
+ *  @return pointer to allocated buffer
  */
 
-void *ns_realloc (void* ptr, const int size)
+void *ns_realloc( void* ptr, int size )
 {
 	void *newptr;
-	newptr = realloc (ptr, size);
-	if (!newptr) {
-		nlog (LOG_CRITICAL, "ns_realloc: out of memory.");
-		do_exit (NS_EXIT_ERROR, "Out of memory");
+
+	newptr = realloc( ptr, size );
+	if( !newptr )
+	{
+		nlog( LOG_CRITICAL, "ns_realloc: out of memory." );
+		do_exit( NS_EXIT_ERROR, "Out of memory" );
 	}
 	return newptr;
 }
 
-/** @brief NeoStats wrapper for free.
+/** @brief _ns_free
  *
- * Free memory associated with pointer.
- * If NULL pointer log error and ignore free
+ *  NeoStats wrapper for free.
+ *  Free memory associated with pointer.
+ *  If NULL pointer log error and ignore free
  *
- * @param size Pointer to buffer to free
+ *  @param ptr to buffer to free
  *
- * @returns none
+ *  @returns none
  */
 
-void _ns_free (void **ptr)
+void _ns_free( void **ptr )
 {
-	if (!*ptr) {
-		dlog( DEBUG2, "ns_free: illegal attempt to free NULL pointer");
+	if( !*ptr )
+	{
+		dlog( DEBUG2, "ns_free: illegal attempt to free NULL pointer" );
 		return;
 	}
-	free (*ptr);
+	free( *ptr );
 	*ptr = 0;
 }

Modified: trunk/src/numerics.c
==============================================================================
--- trunk/src/numerics.c	(original)
+++ trunk/src/numerics.c	Sun Aug 21 06:53:26 2005
@@ -65,9 +65,8 @@
 	if( !origin )
 		return;
 	s = FindServer( origin );
-	if( s ) {
+	if( s )
 		strlcpy( s->version, argv[1], MAXHOST );
-	}
 }
 
 /** @brief _m_numeric242

Modified: trunk/src/servers.c
==============================================================================
--- trunk/src/servers.c	(original)
+++ trunk/src/servers.c	Sun Aug 21 06:53:26 2005
@@ -33,7 +33,6 @@
 
 #define SERVER_TABLE_SIZE	-1
 
-config nsconfig;
 static hash_t *serverhash;
 /** @brief Module data flags */
 static unsigned int fservermoddata = 0;
@@ -163,8 +162,7 @@
 	return NULL;
 }
 
-Client *
-FindServer (const char *name)
+Client *FindServer (const char *name)
 {
 	hnode_t *sn;
 

Modified: trunk/src/services.c
==============================================================================
--- trunk/src/services.c	(original)
+++ trunk/src/services.c	Sun Aug 21 06:53:26 2005
@@ -57,6 +57,7 @@
 
 static int services_event_ctcpversion( CmdParams *cmdparams );
 
+config nsconfig;
 tme me;
 
 static char quitmsg[BUFSIZE];

Modified: trunk/src/settings.c
==============================================================================
--- trunk/src/settings.c	(original)
+++ trunk/src/settings.c	Sun Aug 21 06:53:26 2005
@@ -63,7 +63,7 @@
  *  Process SET LIST command
  *  SET subsystem use only.
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
@@ -128,7 +128,7 @@
  *  Report successful SET command
  *  SET subsystem use only.
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *  @set_ptr pointer to setting struct
  *  @new_setting string with new value
  *
@@ -158,7 +158,7 @@
  *  SET handler for boolean
  *  SET subsystem use only.
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *  @set_ptr pointer to setting struct
  *
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
@@ -197,7 +197,7 @@
  *  SET handler for int
  *  SET subsystem use only.
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *  @set_ptr pointer to setting struct
  *
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
@@ -241,7 +241,7 @@
  *  SET handler for string
  *  SET subsystem use only.
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *  @set_ptr pointer to setting struct
  *
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
@@ -265,7 +265,7 @@
  *  SET handler for channel
  *  SET subsystem use only.
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *  @set_ptr pointer to setting struct
  *
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
@@ -294,7 +294,7 @@
  *  SET handler for msg
  *  SET subsystem use only.
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *  @set_ptr pointer to setting struct
  *
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
@@ -317,7 +317,7 @@
  *  SET handler for nick
  *  SET subsystem use only.
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *  @set_ptr pointer to setting struct
  *
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
@@ -341,7 +341,7 @@
  *  SET handler for user
  *  SET subsystem use only.
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *  @set_ptr pointer to setting struct
  *
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
@@ -365,7 +365,7 @@
  *  SET handler for host
  *  SET subsystem use only.
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *  @set_ptr pointer to setting struct
  *
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
@@ -394,7 +394,7 @@
  *  SET handler for realname
  *  SET subsystem use only.
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *  @set_ptr pointer to setting struct
  *
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
@@ -417,7 +417,7 @@
  *  SET handler for ipv4
  *  SET subsystem use only.
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *  @set_ptr pointer to setting struct
  *
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
@@ -441,7 +441,7 @@
  *  SET handler for boolean
  *  SET subsystem use only.
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *  @set_ptr pointer to setting struct
  *
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
@@ -460,7 +460,7 @@
  *  SET handler
  *  SET subsystem use only.
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
@@ -516,7 +516,7 @@
  *  Add a single set option
  *  SET subsystem use only.
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
@@ -533,7 +533,7 @@
  *  delete a single set option
  *  SET subsystem use only.
  *
- *  @cmdparams pointer to commands param struct
+ *  @params cmdparams pointer to commands param struct
  *  @set_ptr pointer to setting struct
  *
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not