[NeoStats-Devel] [Commits] r2412 - in trunk: . include modules/template modules/templateauth src src/protocol

[email protected]
Newsgroups gmane.comp.neostats.devel
Message-ID <[email protected]>
Author: Mark
Date: Fri Apr  1 06:27:12 2005
New Revision: 2412

Modified:
   trunk/ChangeLog
   trunk/include/configwin32.h
   trunk/modules/template/template.c
   trunk/modules/templateauth/templateauth.c
   trunk/src/auth.c
   trunk/src/botinfo.c
   trunk/src/channels.c
   trunk/src/commands.c
   trunk/src/confuse.c
   trunk/src/ircd.c
   trunk/src/main.c
   trunk/src/modes.c
   trunk/src/modules.c
   trunk/src/protocol/ircup10.c
   trunk/src/settings.c
   trunk/src/sock.c
   trunk/src/support.c
   trunk/src/transfer.c
Log:
more oscalls fixups, stricter module loading and command setup, fix template copyright text

Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	(original)
+++ trunk/ChangeLog	Fri Apr  1 06:27:12 2005
@@ -4,6 +4,11 @@
 Fish (F), Mark (M), DeadNotBuried (D)
 ===============================================================================
 * NeoStats * Version 3.0.a3-dev
+ - Module command setup is now more strict. Commands will not be added if the
+   main help text or the one line help text is not set. (M)
+ - Module loads are now more strict. About text and copyright text are required
+   and if the code is based on the template text, this must be changed before
+   the module will load. (M)
  - Fix FNMATCH error on configure (we don't use fnmatch) (F)
  - Fix SET RECVQ. (M)
  - More work on ossocket layer. (M)

Modified: trunk/include/configwin32.h
==============================================================================
--- trunk/include/configwin32.h	(original)
+++ trunk/include/configwin32.h	Fri Apr  1 06:27:12 2005
@@ -517,7 +517,6 @@
 /* Additional Win32 specifics */
 #define strcasecmp stricmp 
 #define strncasecmp strnicmp 
-#define bcopy(a, b, c) memcpy(b, a, c)
 #define index strchr
 #define rindex strrchr
 #define __PRETTY_FUNCTION__ __FUNCTION__

Modified: trunk/modules/template/template.c
==============================================================================
--- trunk/modules/template/template.c	(original)
+++ trunk/modules/template/template.c	Fri Apr  1 06:27:12 2005
@@ -38,11 +38,24 @@
 
 /** 
  *  Example copyright text
+ *  You must change this or your module will not load.
  */
+
 const char* template_copyright[] = 
 {
-	"Copyright (c) 1999-2005, NeoStats",
-	"http://www.neostats.net/",
+	"Copyright (c) <year>, <your name>",
+	NULL
+};
+
+/** 
+ *  Example about text
+ *  Returned by an intrinsic command when a user requests
+ *  /msg botname about
+ *  You must change this or your module will not load.
+ */
+
+const char *template_about[] = {
+	"About your module",
 	NULL
 };
 
@@ -73,18 +86,6 @@
 	NULL
 };
 
-/** 
- *  Example about text
- *  Returned by an intrinsic command when a user requests
- *  /msg botname about
- */
-const char* template_about[] = 
-{
-	"Template is an example module to demonstrate features",
-	"of the NeoStats API available to module coders",
-	NULL
-};
-
 /** Module Info definition 
  *	This describes the module to the NeoStats core and provides information
  *  to end users when modules are queried.

Modified: trunk/modules/templateauth/templateauth.c
==============================================================================
--- trunk/modules/templateauth/templateauth.c	(original)
+++ trunk/modules/templateauth/templateauth.c	Fri Apr  1 06:27:12 2005
@@ -32,10 +32,25 @@
  */
 #include "neostats.h"
 
-/** Copyright info */
+/** 
+ *  Example copyright text
+ *  You must change this or your module will not load.
+ */
+
 const char *template_copyright[] = {
-	"Copyright (c) 1999-2005, NeoStats",
-	"http://www.neostats.net/",
+	"Copyright (c) <year>, <your name>",
+	NULL
+};
+
+/** 
+ *  Example about text
+ *  Returned by an intrinsic command when a user requests
+ *  /msg botname about
+ *  You must change this or your module will not load.
+ */
+
+const char *template_about[] = {
+	"About your module",
 	NULL
 };
 
@@ -45,7 +60,7 @@
 	"TemplateAuth",
 	"Template Authentication Module",
 	template_copyright,
-	NULL,
+	template_about,
 	NEOSTATS_VERSION,
 	CORE_MODULE_VERSION,
 	__DATE__,

Modified: trunk/src/auth.c
==============================================================================
--- trunk/src/auth.c	(original)
+++ trunk/src/auth.c	Fri Apr  1 06:27:12 2005
@@ -189,6 +189,6 @@
 int InitAuth( void )
 {
 	/* Clear the module list */
-	memset( AuthModList, 0, sizeof( AuthModList ) );
+	os_memset( AuthModList, 0, sizeof( AuthModList ) );
 	return NS_SUCCESS;
 }

Modified: trunk/src/botinfo.c
==============================================================================
--- trunk/src/botinfo.c	(original)
+++ trunk/src/botinfo.c	Fri Apr  1 06:27:12 2005
@@ -140,7 +140,7 @@
 {
 	bot_ptr->bot_info_settings = ns_calloc( sizeof( bot_info_settings ) );
 	if( bot_ptr->bot_info_settings ) {
-		memcpy( bot_ptr->bot_info_settings, bot_info_settings, sizeof( bot_info_settings ) );
+		os_memcpy( bot_ptr->bot_info_settings, bot_info_settings, sizeof( bot_info_settings ) );
 		bot_ptr->bot_info_settings[0].varptr = &botinfo->nick;
 		bot_ptr->bot_info_settings[1].varptr = &botinfo->altnick;
 		bot_ptr->bot_info_settings[2].varptr = &botinfo->user;

Modified: trunk/src/channels.c
==============================================================================
--- trunk/src/channels.c	(original)
+++ trunk/src/channels.c	Fri Apr  1 06:27:12 2005
@@ -88,7 +88,7 @@
 
 void PartAllChannels( Client *u, const char *reason )
 {
-	memset( quitreason, 0, BUFSIZE );
+	os_memset( quitreason, 0, BUFSIZE );
 	if( reason ) {
 		strlcpy( quitreason, reason, BUFSIZE );
 		strip_mirc_codes( quitreason );

Modified: trunk/src/commands.c
==============================================================================
--- trunk/src/commands.c	(original)
+++ trunk/src/commands.c	Fri Apr  1 06:27:12 2005
@@ -137,7 +137,7 @@
 
 void msg_error_need_more_params( CmdParams *cmdparams )
 {
-	irc_prefmsg( cmdparams->bot, cmdparams->source, __( "Syntax error: insufficient parameters", cmdparams->source ) );
+	irc_prefmsg( cmdparams->bot, cmdparams->source, __( "Insufficient parameters", cmdparams->source ) );
 	irc_prefmsg( cmdparams->bot, cmdparams->source, __( "/msg %s HELP %s for more information", cmdparams->source ), 
 		cmdparams->bot->name, cmdparams->cmd );
 }
@@ -226,6 +226,16 @@
 			cmd_ptr->cmd );
 		return NS_FAILURE;
 	}
+	if( !cmd_ptr->onelinehelp ) {
+		nlog( LOG_ERROR, "add_bot_cmd: missing oneline help text, command %s not added", 
+			cmd_ptr->cmd );
+		return NS_FAILURE;
+	}
+	if( !cmd_ptr->helptext ) {
+		nlog( LOG_ERROR, "add_bot_cmd: missing help text, command %s not added", 
+			cmd_ptr->cmd );
+		return NS_FAILURE;
+	}
 	/* Seems OK, add the command */
 	hnode_create_insert( cmd_hash, cmd_ptr, cmd_ptr->cmd );
 	snprintf( confcmd, 32, "command%s", cmd_ptr->cmd );
@@ -592,11 +602,7 @@
 							irc_prefmsg( cmdparams->bot, cmdparams->source, __( "\2Additional commands available to %s:\2", cmdparams->source ), curlevelmsg );
 							donemsg = 1;
 						}
-						if( !cmd_ptr->onelinehelp ) {
-							irc_prefmsg( cmdparams->bot, cmdparams->source, __( "    %-20s *** Missing help text ***",cmdparams->source ), cmd_ptr->cmd );
-						} else {					
-							irc_prefmsg( cmdparams->bot, cmdparams->source, "    %-20s %s", cmd_ptr->cmd, cmd_ptr->onelinehelp );
-						}
+						irc_prefmsg( cmdparams->bot, cmdparams->source, "    %-20s %s", cmd_ptr->cmd, cmd_ptr->onelinehelp );
 					}
 				}
 				if( lowlevel >= userlevel ) {
@@ -653,11 +659,7 @@
 				msg_permission_denied( cmdparams, NULL );
 				return NS_ERR_NO_PERMISSION;
 			}		
-			if( !cmd_ptr->helptext ) {
-				irc_prefmsg( cmdparams->bot, cmdparams->source, __( "Missing help text for command", cmdparams->source ) );
-			} else {
-				irc_prefmsg_list( cmdparams->bot, cmdparams->source, cmd_ptr->helptext );
-			}
+			irc_prefmsg_list( cmdparams->bot, cmdparams->source, cmd_ptr->helptext );
 			return NS_SUCCESS;
 		}
 	}
@@ -710,7 +712,7 @@
  */
 static int bot_cmd_about( CmdParams *cmdparams )
 {
-	if( cmdparams->bot->moduleptr && cmdparams->bot->moduleptr->info->about_text ) {
+	if( cmdparams->bot->moduleptr ) {
 		irc_prefmsg_list( cmdparams->bot, cmdparams->source, cmdparams->bot->moduleptr->info->about_text );
 	}
 	return NS_SUCCESS;
@@ -735,7 +737,7 @@
  */
 static int bot_cmd_credits( CmdParams *cmdparams )
 {
-	if( cmdparams->bot->moduleptr && cmdparams->bot->moduleptr->info->copyright ) {
+	if( cmdparams->bot->moduleptr ) {
 		irc_prefmsg_list( cmdparams->bot, cmdparams->source, 
 			cmdparams->bot->moduleptr->info->copyright );
 	}

Modified: trunk/src/confuse.c
==============================================================================
--- trunk/src/confuse.c	(original)
+++ trunk/src/confuse.c	Fri Apr  1 06:27:12 2005
@@ -349,7 +349,7 @@
                                   (opt->nvalues+1) * sizeof(cfg_value_t *));
     assert(opt->values);
     opt->values[opt->nvalues] = (cfg_value_t *)malloc(sizeof(cfg_value_t));
-    memset(opt->values[opt->nvalues], 0, sizeof(cfg_value_t));
+    os_memset(opt->values[opt->nvalues], 0, sizeof(cfg_value_t));
     return opt->values[opt->nvalues++];
 }
 
@@ -369,8 +369,8 @@
     int n = cfg_numopts(opts);
 
     dupopts = (cfg_opt_t *)malloc((n+1) * sizeof(cfg_opt_t));
-    memset(dupopts, 0, (n+1) * sizeof(cfg_opt_t));
-    memcpy(dupopts, opts, n * sizeof(cfg_opt_t));
+    os_memset( dupopts, 0, (n+1) * sizeof( cfg_opt_t ) );
+    os_memcpy( dupopts, opts, n * sizeof( cfg_opt_t ) );
 
     for(i = 0; i < n; i++)
     {
@@ -640,7 +640,7 @@
                 cfg_free(val->section);
                 val->section = (cfg_t *)malloc(sizeof(cfg_t));
                 assert(val->section);
-                memset(val->section, 0, sizeof(cfg_t));
+                os_memset(val->section, 0, sizeof(cfg_t));
                 val->section->name = strdup(opt->name);
                 val->section->opts = cfg_dupopt_array(opt->subopts);
                 val->section->flags = cfg->flags;
@@ -1058,7 +1058,7 @@
 
     cfg = (cfg_t *)malloc(sizeof(cfg_t));
     assert(cfg);
-    memset(cfg, 0, sizeof(cfg_t));
+    os_memset(cfg, 0, sizeof(cfg_t));
 
     cfg->name = strdup("root");
     cfg->opts = cfg_dupopt_array(opts);

Modified: trunk/src/ircd.c
==============================================================================
--- trunk/src/ircd.c	(original)
+++ trunk/src/ircd.c	Fri Apr  1 06:27:12 2005
@@ -310,7 +310,7 @@
 int InitIrcd( void )
 {
 	/* Clear IRCD info */
-	memset( &ircd_srv, 0, sizeof( ircd_srv ) );
+	os_memset( &ircd_srv, 0, sizeof( ircd_srv ) );
 	/* Open protocol module */
 	ircsnprintf( protocol_path, 255, "%s/%s%s", MOD_PATH, me.protocol,MOD_EXT );
 	nlog( LOG_NORMAL, "Using protocol module %s", protocol_path );

Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c	(original)
+++ trunk/src/main.c	Fri Apr  1 06:27:12 2005
@@ -167,7 +167,7 @@
 static int InitMe( void )
 {
 	/* set some defaults before we parse the config file */
-	memset( &me, 0, sizeof( me ) );
+	os_memset( &me, 0, sizeof( me ) );
 	/* initialise version */
 	strlcpy( me.version, NEOSTATS_VERSION, VERSIONSIZE );
 	/* our default lang is always -1 */
@@ -176,7 +176,7 @@
 	me.now = me.ts_boot = time( NULL );
 	ircsnprintf( me.strnow, STR_TIME_T_SIZE, "%lu", ( long )me.now );
 	/* Clear config */
-	memset( &nsconfig, 0 , sizeof( config ) );
+	os_memset( &nsconfig, 0 , sizeof( config ) );
 	/* Default reconnect time */
 	nsconfig.r_time = 10;
 	/* Debug mode overrides */

Modified: trunk/src/modes.c
==============================================================================
--- trunk/src/modes.c	(original)
+++ trunk/src/modes.c	Fri Apr  1 06:27:12 2005
@@ -134,19 +134,19 @@
 InitModeTables (const mode_init* chan_umodes, const mode_init* chan_modes, const mode_init* user_umodes, const mode_init* user_smodes)
 {
 	/* build cmode lookup table */
-	memset(&ircd_cmodes, 0, sizeof(ircd_cmodes));
+	os_memset(&ircd_cmodes, 0, sizeof(ircd_cmodes));
 	dlog(DEBUG4, "Build channel mode table...");
 	ircd_supported_cmodes = BuildModeTable (ircd_cmode_char_map, ircd_cmodes, chan_modes, 0);
 	/* build cumode lookup table */
 	dlog(DEBUG4, "Build channel user mode table...");
 	ircd_supported_cumodes = BuildModeTable (ircd_cmode_char_map, ircd_cmodes, chan_umodes, NICKPARAM);
 	/* build umode lookup table */
-	memset(&ircd_umodes, 0, sizeof(ircd_umodes));
+	os_memset(&ircd_umodes, 0, sizeof(ircd_umodes));
 	dlog(DEBUG4, "Build user mode table...");
 	ircd_supported_umodes = BuildModeTable (ircd_umode_char_map, ircd_umodes, user_umodes, 0);
 	/* build smode lookup table */
 	if (user_smodes) {
-		memset(&ircd_smodes, 0, sizeof(ircd_smodes));
+		os_memset(&ircd_smodes, 0, sizeof(ircd_smodes));
 		dlog(DEBUG4, "Build user smode table...");
 		ircd_supported_smodes = BuildModeTable (ircd_smode_char_map, ircd_smodes, user_smodes, 0);
 	}

Modified: trunk/src/modules.c
==============================================================================
--- trunk/src/modules.c	(original)
+++ trunk/src/modules.c	Fri Apr  1 06:27:12 2005
@@ -284,6 +284,16 @@
 		ns_dlclose (dl_handle);
 		return NULL;
 	}
+	if( !info_ptr->copyright || ircstrcasecmp (info_ptr->copyright[0], "Copyright (c) <year>, <your name>") ==0 ) {
+		load_module_error (u, __("Unable to load module: missing copyright text.", u), modfilename);
+		ns_dlclose (dl_handle);
+		return NULL;
+	}	
+	if( !info_ptr->about_text || ircstrcasecmp (info_ptr->about_text[0], "About your module") ==0 ) {
+		load_module_error (u, __("Unable to load module: missing about text.", u), modfilename);
+		ns_dlclose (dl_handle);
+		return NULL;
+	}	
 	/* Check that the Module hasn't already been loaded */
 	if (hash_lookup (modulehash, info_ptr->name)) {
 		ns_dlclose (dl_handle);

Modified: trunk/src/protocol/ircup10.c
==============================================================================
--- trunk/src/protocol/ircup10.c	(original)
+++ trunk/src/protocol/ircup10.c	Fri Apr  1 06:27:12 2005
@@ -321,7 +321,7 @@
 send_server_connect (const char *name, const int numeric, const char *infoline, const char *pass, const unsigned long tsboot, const unsigned long tslink)
 {
 	/* Reset our numeric buffer */
-	memset(neonicknumerics, 0 , sizeof(neonicknumerics));
+	os_memset( neonicknumerics, 0 , sizeof( neonicknumerics ) );
 	inttobase64(neostatsbase64, numeric, 2);
 	send_cmd ("%s %s", MSG_PASS, pass);
     send_cmd ("%s %s 1 %lu %lu J10 %s]]] +s :%s", MSG_SERVER, name, tsboot, tslink, neostatsbase64, infoline);

Modified: trunk/src/settings.c
==============================================================================
--- trunk/src/settings.c	(original)
+++ trunk/src/settings.c	Fri Apr  1 06:27:12 2005
@@ -33,19 +33,19 @@
 #include "botinfo.h"
 #include "settings.h"
 
-typedef int( *bot_cmd_set_handler )( CmdParams *cmdparams, bot_setting* set_ptr );
+typedef int( *bot_cmd_set_handler )( CmdParams *cmdparams, bot_setting *set_ptr );
 
-static int bot_cmd_set_boolean( CmdParams *cmdparams, bot_setting* set_ptr );
-static int bot_cmd_set_int( CmdParams *cmdparams, bot_setting* set_ptr );
-static int bot_cmd_set_string( CmdParams *cmdparams, bot_setting* set_ptr );
-static int bot_cmd_set_channel( CmdParams *cmdparams, bot_setting* set_ptr );
-static int bot_cmd_set_msg( CmdParams *cmdparams, bot_setting* set_ptr );
-static int bot_cmd_set_nick( CmdParams *cmdparams, bot_setting* set_ptr );
-static int bot_cmd_set_user( CmdParams *cmdparams, bot_setting* set_ptr );
-static int bot_cmd_set_host( CmdParams *cmdparams, bot_setting* set_ptr );
-static int bot_cmd_set_realname( CmdParams *cmdparams, bot_setting* set_ptr );
-static int bot_cmd_set_ipv4( CmdParams *cmdparams, bot_setting* set_ptr );
-static int bot_cmd_set_custom( CmdParams *cmdparams, bot_setting* set_ptr );
+static int bot_cmd_set_boolean( CmdParams *cmdparams, bot_setting *set_ptr );
+static int bot_cmd_set_int( CmdParams *cmdparams, bot_setting *set_ptr );
+static int bot_cmd_set_string( CmdParams *cmdparams, bot_setting *set_ptr );
+static int bot_cmd_set_channel( CmdParams *cmdparams, bot_setting *set_ptr );
+static int bot_cmd_set_msg( CmdParams *cmdparams, bot_setting *set_ptr );
+static int bot_cmd_set_nick( CmdParams *cmdparams, bot_setting *set_ptr );
+static int bot_cmd_set_user( CmdParams *cmdparams, bot_setting *set_ptr );
+static int bot_cmd_set_host( CmdParams *cmdparams, bot_setting *set_ptr );
+static int bot_cmd_set_realname( CmdParams *cmdparams, bot_setting *set_ptr );
+static int bot_cmd_set_ipv4( CmdParams *cmdparams, bot_setting *set_ptr );
+static int bot_cmd_set_custom( CmdParams *cmdparams, bot_setting *set_ptr );
 
 static bot_cmd_set_handler bot_cmd_set_handlers[] = 
 {
@@ -76,7 +76,7 @@
 {
 	hnode_t *setnode;
 	hscan_t hs;
-	bot_setting* set_ptr;
+	bot_setting *set_ptr;
 	int userlevel;
 
 	irc_prefmsg( cmdparams->bot, cmdparams->source, __( "Current %s settings:", cmdparams->source ), cmdparams->bot->name );
@@ -139,7 +139,7 @@
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
 
-static int bot_cmd_set_report( CmdParams *cmdparams, bot_setting* set_ptr, char *new_setting )
+static int bot_cmd_set_report( CmdParams *cmdparams, bot_setting *set_ptr, char *new_setting )
 {
 	if( nsconfig.cmdreport ) {
 		irc_chanalert( cmdparams->bot, _( "%s set to %s by \2%s\2" ), 
@@ -168,7 +168,7 @@
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
 
-static int bot_cmd_set_boolean( CmdParams *cmdparams, bot_setting* set_ptr )
+static int bot_cmd_set_boolean( CmdParams *cmdparams, bot_setting *set_ptr )
 {
 	int newsetting;
 
@@ -207,7 +207,7 @@
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
 
-static int bot_cmd_set_int( CmdParams *cmdparams, bot_setting* set_ptr )
+static int bot_cmd_set_int( CmdParams *cmdparams, bot_setting *set_ptr )
 {
 	int intval;
 
@@ -251,7 +251,7 @@
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
 
-static int bot_cmd_set_string( CmdParams *cmdparams, bot_setting* set_ptr )
+static int bot_cmd_set_string( CmdParams *cmdparams, bot_setting *set_ptr )
 {
 	/* Module specific handling */
 	if( set_ptr->handler ) {
@@ -275,7 +275,7 @@
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
 
-static int bot_cmd_set_channel( CmdParams *cmdparams, bot_setting* set_ptr )
+static int bot_cmd_set_channel( CmdParams *cmdparams, bot_setting *set_ptr )
 {
 	if( ValidateChannel( cmdparams->av[1] ) == NS_FAILURE ) {
 		irc_prefmsg( cmdparams->bot, cmdparams->source, 
@@ -304,7 +304,7 @@
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
 
-static int bot_cmd_set_msg( CmdParams *cmdparams, bot_setting* set_ptr )
+static int bot_cmd_set_msg( CmdParams *cmdparams, bot_setting *set_ptr )
 {
 	char *buf;
 
@@ -327,7 +327,7 @@
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
 
-static int bot_cmd_set_nick( CmdParams *cmdparams, bot_setting* set_ptr )
+static int bot_cmd_set_nick( CmdParams *cmdparams, bot_setting *set_ptr )
 {
 	if( ValidateNick( cmdparams->av[1] ) == NS_FAILURE ) {
 		irc_prefmsg( cmdparams->bot, cmdparams->source, 
@@ -351,7 +351,7 @@
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
 
-static int bot_cmd_set_user( CmdParams *cmdparams, bot_setting* set_ptr )
+static int bot_cmd_set_user( CmdParams *cmdparams, bot_setting *set_ptr )
 {
 	if( ValidateUser( cmdparams->av[1] ) == NS_FAILURE ) {
 		irc_prefmsg( cmdparams->bot, cmdparams->source, 
@@ -375,7 +375,7 @@
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
 
-static int bot_cmd_set_host( CmdParams *cmdparams, bot_setting* set_ptr )
+static int bot_cmd_set_host( CmdParams *cmdparams, bot_setting *set_ptr )
 {
 	if( !index( cmdparams->av[1], '.' ) ) {
 		irc_prefmsg( cmdparams->bot, cmdparams->source, 
@@ -404,7 +404,7 @@
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
 
-static int bot_cmd_set_realname( CmdParams *cmdparams, bot_setting* set_ptr )
+static int bot_cmd_set_realname( CmdParams *cmdparams, bot_setting *set_ptr )
 {
 	char *buf;
 
@@ -427,7 +427,7 @@
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
 
-static int bot_cmd_set_ipv4( CmdParams *cmdparams, bot_setting* set_ptr )
+static int bot_cmd_set_ipv4( CmdParams *cmdparams, bot_setting *set_ptr )
 {
 	if( !inet_addr( cmdparams->av[1] ) ) {
 		irc_prefmsg( cmdparams->bot, cmdparams->source, 
@@ -451,7 +451,7 @@
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
 
-static int bot_cmd_set_custom( CmdParams *cmdparams, bot_setting* set_ptr )
+static int bot_cmd_set_custom( CmdParams *cmdparams, bot_setting *set_ptr )
 {
 	if( set_ptr->handler ) {
 		set_ptr->handler( cmdparams, SET_CHANGE );
@@ -472,7 +472,7 @@
 int bot_cmd_set( CmdParams *cmdparams )
 {
 	bot_cmd_set_handler set_handler;
-	bot_setting* set_ptr;
+	bot_setting *set_ptr;
 	int userlevel;
 
 	if( cmdparams->ac < 1 ) {
@@ -491,7 +491,7 @@
 	if( cmdparams->ac < 2 ) {
 		return NS_ERR_SYNTAX_ERROR;
 	} 
-	set_ptr= ( bot_setting* )hnode_find( cmdparams->bot->botsettings, cmdparams->av[0] );
+	set_ptr= ( bot_setting *)hnode_find( cmdparams->bot->botsettings, cmdparams->av[0] );
 	if( set_ptr ) {
 		if( userlevel < set_ptr->ulevel ) {
 			msg_permission_denied( cmdparams, cmdparams->av[0] );
@@ -525,7 +525,7 @@
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
 
-static int add_bot_setting( hash_t *set_hash, bot_setting* set_ptr ) 
+static int add_bot_setting( hash_t *set_hash, bot_setting *set_ptr ) 
 {
 	hnode_create_insert( set_hash, set_ptr, set_ptr->option );
 	dlog( DEBUG3, "add_bot_setting: added a new set option %s", set_ptr->option );
@@ -543,7 +543,7 @@
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
 
-static int del_bot_setting( hash_t *set_hash, bot_setting* set_ptr ) 
+static int del_bot_setting( hash_t *set_hash, bot_setting *set_ptr ) 
 {
 	hnode_t *setnode;
 	
@@ -567,7 +567,7 @@
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
 
-int add_bot_setting_list( Bot* bot_ptr, bot_setting* set_ptr ) 
+int add_bot_setting_list( Bot* bot_ptr, bot_setting *set_ptr ) 
 {
 	if( !set_ptr ) {
 		return NS_FAILURE;
@@ -600,7 +600,7 @@
  *  @return NS_SUCCESS if succeeds, NS_FAILURE if not 
  */
 
-int del_bot_setting_list( Bot* bot_ptr, bot_setting* set_ptr ) 
+int del_bot_setting_list( Bot* bot_ptr, bot_setting *set_ptr ) 
 {
 	/* If no bot pointer return failure */
 	if( !bot_ptr ) {

Modified: trunk/src/sock.c
==============================================================================
--- trunk/src/sock.c	(original)
+++ trunk/src/sock.c	Fri Apr  1 06:27:12 2005
@@ -474,12 +474,12 @@
 	}
 	me.dobind = 0;
 	/* bind to a local ip */
-	memset (&me.lsa, 0, sizeof (me.lsa));
+	os_memset( &me.lsa, 0, sizeof( me.lsa ) );
 	if (me.local[0] != 0) {
 		if ((hp = gethostbyname (me.local)) == NULL) {
 			nlog (LOG_WARNING, "Couldn't bind to IP address %s", me.local);
 		} else {
-			memcpy ((char *) &me.lsa.sin_addr, hp->h_addr, hp->h_length);
+			os_memcpy( ( char * ) &me.lsa.sin_addr, hp->h_addr, hp->h_length );
 			me.lsa.sin_family = hp->h_addrtype;
 			me.dobind = 1;
 		}

Modified: trunk/src/support.c
==============================================================================
--- trunk/src/support.c	(original)
+++ trunk/src/support.c	Fri Apr  1 06:27:12 2005
@@ -140,7 +140,7 @@
 
 	/* memcpy the desired amount */
 	if (copycount > 0) {
-		memcpy(dst + lendst, src, copycount);
+		os_memcpy( ( dst + lendst ), src, copycount );
 		dst[lendst + copycount] = 0;
 	}
 	
@@ -171,7 +171,7 @@
 	dup = (char*)ns_malloc(count+1);
 	
 	/* Copy string into created buffer */
-	memcpy(dup, src, count);
+	os_memcpy( dup, src, count );
 	dup[count] = 0;
 	
 	/* Return pointer to duplicated string */

Modified: trunk/src/transfer.c
==============================================================================
--- trunk/src/transfer.c	(original)
+++ trunk/src/transfer.c	Fri Apr  1 06:27:12 2005
@@ -89,7 +89,7 @@
 					neotrans->savemem = newbuf;
 				}
 			}
-			memcpy((char *)&neotrans->savemem[neotrans->savemempos], transferptr, size);
+			os_memcpy( (char *)&neotrans->savemem[neotrans->savemempos], transferptr, size );
 			neotrans->savemempos += size;
 			writesize = nmemb;
 			break;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.