[NeoStats-Devel] [Commits] r2673 - trunk/src

[email protected]
Newsgroups gmane.comp.neostats.devel
Message-ID <[email protected]>
Author: Mark
Date: Sun Jul 17 06:30:50 2005
New Revision: 2673

Modified:
   trunk/src/lang.c
   trunk/src/main.c
   trunk/src/neostats.vcproj
Log:
fully remove lang stuff from win32

Modified: trunk/src/lang.c
==============================================================================
--- trunk/src/lang.c	(original)
+++ trunk/src/lang.c	Sun Jul 17 06:30:50 2005
@@ -23,24 +23,16 @@
 */
 
 #include "neostats.h"
+#if 0 /* Temp since berkeley is causing too many problems */
+/* #if defined HAVE_DB_H && !defined WIN32 */
 #ifdef HAVE_STRINGS_H
 #include <strings.h>
-#endif
-#if 0 /* Temp since berkeley is causing too many problems */
+#endif /* HAVE_STRINGS_H */
 #ifdef HAVE_DB_H
 #include <db.h>
-#endif
+#endif /* HAVE_DB_H */
 #include "lang.h"
 
-#if (!defined HAVE_DB_H) || (defined WIN32)
-void LANGinit(int debug, char *dbpath, LANGDebugFunc debugfunc) 
-{
-}
-
-void LANGfini() 
-{
-}
-#else
 static DBT dbkey;
 static DBT dbdata;
 static int dbret;
@@ -65,14 +57,6 @@
 hash_t *langcache[MAXLANG];
 static void* LANGGetData(void* key, int lang);
 
-#if (defined WIN32)
-#define LANGDEBUG
-#define LANGERROR
-#else
-#define LANGDEBUG(fmt,...) LANGDebug(__FILE__, __LINE__, __FUNCTION__, 0, fmt, __VA_ARGS__)
-#define LANGERROR(fmt,...) LANGDebug(__FILE__, __LINE__, __FUNCTION__, 1, fmt, __VA_ARGS__)
-#endif
-
 static void LANGDebug(char *file, int line, char *func, int err, char *fmt, ...) {
 	va_list ap;
 	char buf[800];
@@ -456,8 +440,7 @@
 		LANGCloseDatabase(i);
 	}
 }
-#endif
-#else
+#else /* HAVE_DB_H */
 #include "lang.h"
 void LANGinit(int debug, char *dbpath, LANGDebugFunc debugfunc) 
 {
@@ -466,4 +449,4 @@
 void LANGfini() 
 {
 }
-#endif /* 0 */
+#endif /* HAVE_DB_H */

Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c	(original)
+++ trunk/src/main.c	Sun Jul 17 06:30:50 2005
@@ -52,22 +52,21 @@
 #include "perlmod.h"
 #endif /* USE_PERL */
 
+#define PID_FILENAME	"neostats.pid"
+
 static void do_reconnect( void );
 static int in_do_exit = 0;
-#define PID_FILENAME	"neostats.pid"
 
 #ifdef WIN32
 void *( *old_malloc )( size_t );
 void( *old_free )( void * );
 #endif /* WIN32 */
 
-typedef struct exit_report
+struct
 {
 	int exit_code;
 	char *exit_message;
-}exit_report;
-
-exit_report exit_reports[]=
+} exit_reports[]=
 {
 	/* NS_EXIT_NORMAL */
 	{ EXIT_SUCCESS, "Normal shut down subsystems" },
@@ -356,11 +355,10 @@
 		return NS_FAILURE;
 	if( !me.servicehost[0] )
 		strlcpy( me.servicehost, me.name, sizeof( me.name ) );
+#ifndef WIN32
 	/* initialize Lang Subsystem */
 	ircsnprintf( dbpath, MAXPATH, "%s/data/lang.db", NEO_PREFIX );
 	LANGinit( 1, dbpath, NULL );
-
-#ifndef WIN32
 #ifndef DEBUG
 	/* if we are compiled with debug, or forground switch was specified, DONT FORK */
 	if( !nsconfig.foreground )
@@ -504,13 +502,13 @@
 	}
 	FiniDBA();
 	FiniLogs();
-	LANGfini();
 #ifdef WIN32
 	/* restore pcre lib malloc pointers */
 	pcre_malloc = old_malloc;
 	pcre_free = old_free;
 #endif /* WIN32 */
 #ifndef WIN32
+	LANGfini();
 	if( ( exitcode == NS_EXIT_RECONNECT && nsconfig.r_time > 0 ) || exitcode == NS_EXIT_RELOAD ) {
 		sleep( nsconfig.r_time );
 		execve( "./bin/neostats", NULL, NULL );

Modified: trunk/src/neostats.vcproj
==============================================================================
--- trunk/src/neostats.vcproj	(original)
+++ trunk/src/neostats.vcproj	Sun Jul 17 06:30:50 2005
@@ -222,9 +222,6 @@
 				RelativePath=".\ircstring.c">
 			</File>
 			<File
-				RelativePath=".\lang.c">
-			</File>
-			<File
 				RelativePath=".\list.c">
 			</File>
 			<File
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.