[NeoStats-Devel] [Commits] r2729 - in trunk: include src
[email protected] Sun, 14 Aug 2005 09:01:42 +1000
| Newsgroups | gmane.comp.neostats.devel |
|---|---|
| Message-ID | <[email protected]> |
Author: Mark
Date: Sun Aug 14 07:01:39 2005
New Revision: 2729
Modified:
trunk/include/ircprotocol.h
trunk/src/conf.c
trunk/src/ircsend.c
trunk/src/main.c
trunk/src/sock.c
Log:
fix casts to correct types
Modified: trunk/include/ircprotocol.h
==============================================================================
--- trunk/include/ircprotocol.h (original)
+++ trunk/include/ircprotocol.h Sun Aug 14 07:01:39 2005
@@ -25,7 +25,7 @@
int InitIrcd( void );
int FiniIrcd( void );
-int irc_connect( const char *name, const int numeric, const char *infoline, const char *pass, const unsigned long tsboot, const unsigned long tslink );
+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 );
int irc_squit( const char *server, const char *quitmsg );
Modified: trunk/src/conf.c
==============================================================================
--- trunk/src/conf.c (original)
+++ trunk/src/conf.c Sun Aug 14 07:01:39 2005
@@ -133,6 +133,7 @@
/** @brief ConfParseError
*
* Report configuration parse error
+ * Config subsystem use only
*
* @param err error value from parse
*
@@ -166,6 +167,7 @@
/** @brief set_config_values
*
* set initial NeoStats config based on config file
+ * Config subsystem use only
*
* @param cfg pointer to config struct
*
@@ -183,15 +185,19 @@
/* Connect To */
if (cfg_size (cfg, "Servers|IpAddress") <= 0)
{
+#ifndef WIN32
printf ("ERROR: No Server was configured for Linking. Please fix this\n");
- exit (-1);
+#endif /* WIN32 */
+ return NS_FAILURE;
}
strlcpy (me.uplink, cfg_getstr (cfg, "Servers|IpAddress"), sizeof (me.uplink));
/* Connect Pass */
if (cfg_size (cfg, "Servers|Password") <= 0)
{
+#ifndef WIN32
printf ("ERROR: No Password was specified for Linking. Please fix this\n");
- exit (-1);
+#endif /* WIN32 */
+ return NS_FAILURE;
}
strlcpy (nsconfig.pass, cfg_getstr (cfg, "Servers|Password"), sizeof (nsconfig.pass));
dlog( DEBUG6, "NeoStats ServerName: %s", me.name );
@@ -253,6 +259,7 @@
dlog( DEBUG6, " %s", cfg_getnstr( cfg, "Modules|ModuleName", i ));
}
dlog( DEBUG6, "-----------------------------------------------" );
+ return NS_SUCCESS;
}
/** @brief ConfLoad
@@ -281,7 +288,11 @@
cfg_free( cfg );
return NS_FAILURE;
}
- set_config_values( cfg );
+ if( set_config_values( cfg ) != NS_SUCCESS )
+ {
+ cfg_free( cfg );
+ return NS_FAILURE;
+ }
cfg_free( cfg );
#ifndef WIN32
printf( "Sucessfully loaded config file, booting NeoStats\n" );
@@ -327,6 +338,7 @@
/** @brief cb_verify_chan
*
* Verify channel name configuration value
+ * Config subsystem use only
*
* @param cfg pointer to config structure
* @param opt pointer to option
@@ -347,6 +359,7 @@
/** @brief cb_verify_numeric
*
* Verify server numeric configuration value
+ * Config subsystem use only
*
* @param cfg pointer to config structure
* @param opt pointer to option
@@ -369,6 +382,7 @@
/** @brief cb_verify_bind
*
* Verify bindto configuration value
+ * Config subsystem use only
*
* @param cfg pointer to config structure
* @param opt pointer to option
@@ -410,6 +424,7 @@
/** @brief cb_verify_file
*
* Verify file exists
+ * Config subsystem use only
*
* @param cfg pointer to config structure
* @param opt pointer to option
@@ -448,6 +463,7 @@
/** @brief cb_verify_log
*
* Verify log filename format configuration value
+ * Config subsystem use only
*
* @param cfg pointer to config structure
* @param opt pointer to option
@@ -484,6 +500,7 @@
/** @brief cb_noload
*
* Verify NOLOAD configuration value
+ * Config subsystem use only
*
* @param cfg pointer to config structure
* @param opt pointer to option
@@ -504,6 +521,7 @@
/** @brief cb_verify_host
*
* Verify hostname/ip address configuration value
+ * Config subsystem use only
*
* @param cfg pointer to config structure
* @param opt pointer to option
@@ -524,6 +542,7 @@
/** @brief cb_verify_settime
*
* Verify settime configuration value
+ * Config subsystem use only
*
* @param cfg pointer to config structure
* @param opt pointer to option
@@ -546,6 +565,7 @@
/** @brief cb_module
*
* Add module to list of modules to load
+ * Config subsystem use only
*
* @param name of module
*
Modified: trunk/src/ircsend.c
==============================================================================
--- trunk/src/ircsend.c (original)
+++ trunk/src/ircsend.c Sun Aug 14 07:01:39 2005
@@ -92,7 +92,7 @@
static void( *irc_send_server )( const char *source, const char *name, const int numeric, const char *infoline );
static void( *irc_send_squit )( const char *server, const char *quitmsg );
static void( *irc_send_nick )( const char *nick, const unsigned long ts, const char *newmode, const char *ident, const char *host, const char *server, const char *realname );
-static void( *irc_send_server_connect )( const char *name, const int numeric, const char *infoline, const char *pass, unsigned long tsboot, unsigned long tslink );
+static void( *irc_send_server_connect )( const char *name, const int numeric, const char *infoline, const char *pass, time_t tsboot, time_t tslink );
static void( *irc_send_netinfo )( const char *source, const char *maxglobalcnt, const unsigned long ts, const int prot, const char *cloak, const char *netname );
static void( *irc_send_snetinfo )( const char *source, const char *maxglobalcnt, const unsigned long ts, const int prot, const char *cloak, const char *netname );
static void( *irc_send_svinfo )( const int tscurrent, const int tsmin, const unsigned long tsnow );
@@ -640,7 +640,7 @@
* @return NS_SUCCESS if succeeds, NS_FAILURE if not
*/
-int irc_connect( const char *name, const int numeric, const char *infoline, const char *pass, const unsigned long tsboot, const unsigned long tslink )
+int irc_connect( const char *name, const int numeric, const char *infoline, const char *pass, const time_t tsboot, const time_t tslink )
{
irc_send_server_connect( name, numeric, infoline, pass, tsboot, tslink );
return NS_SUCCESS;
Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c (original)
+++ trunk/src/main.c Sun Aug 14 07:01:39 2005
@@ -531,8 +531,8 @@
execve( "./bin/neostats", NULL, NULL );
return_code = EXIT_FAILURE; /* exit code to error */
}
-#endif /* !WIN32 */
remove( PID_FILENAME );
+#endif /* !WIN32 */
exit( return_code );
}
Modified: trunk/src/sock.c
==============================================================================
--- trunk/src/sock.c (original)
+++ trunk/src/sock.c Sun Aug 14 07:01:39 2005
@@ -197,7 +197,7 @@
} else {
me.servsock=add_linemode_socket("IRCd", mysock, irc_parse, irc_sock_error, NULL);
/* Call the IRC specific function send_server_connect to login as a server to IRC */
- irc_connect (me.name, me.numeric, me.infoline, nsconfig.pass, (unsigned long)me.ts_boot, (unsigned long)me.now);
+ irc_connect (me.name, me.numeric, me.infoline, nsconfig.pass, me.ts_boot, me.now);
#ifndef WIN32
read_loop ();
#endif