fully remove lang stuff from win32
This commit is contained in:
parent
1646449e3e
commit
1f9e1e7817
3 changed files with 12 additions and 34 deletions
29
src/lang.c
29
src/lang.c
|
@ -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 @@ char TranslatedLang[STRSIZE];
|
|||
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 @@ void LANGfini()
|
|||
LANGCloseDatabase(i);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
#else /* HAVE_DB_H */
|
||||
#include "lang.h"
|
||||
void LANGinit(int debug, char *dbpath, LANGDebugFunc debugfunc)
|
||||
{
|
||||
|
@ -466,4 +449,4 @@ void LANGinit(int debug, char *dbpath, LANGDebugFunc debugfunc)
|
|||
void LANGfini()
|
||||
{
|
||||
}
|
||||
#endif /* 0 */
|
||||
#endif /* HAVE_DB_H */
|
||||
|
|
14
src/main.c
14
src/main.c
|
@ -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 @@ int main( int argc, char *argv[] )
|
|||
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 @@ void do_exit( NS_EXIT_TYPE exitcode, char *quitmsg )
|
|||
}
|
||||
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 );
|
||||
|
|
|
@ -221,9 +221,6 @@
|
|||
<File
|
||||
RelativePath=".\ircstring.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\lang.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\list.c">
|
||||
</File>
|
||||
|
|
Reference in a new issue