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"
|
#include "neostats.h"
|
||||||
|
#if 0 /* Temp since berkeley is causing too many problems */
|
||||||
|
/* #if defined HAVE_DB_H && !defined WIN32 */
|
||||||
#ifdef HAVE_STRINGS_H
|
#ifdef HAVE_STRINGS_H
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#endif
|
#endif /* HAVE_STRINGS_H */
|
||||||
#if 0 /* Temp since berkeley is causing too many problems */
|
|
||||||
#ifdef HAVE_DB_H
|
#ifdef HAVE_DB_H
|
||||||
#include <db.h>
|
#include <db.h>
|
||||||
#endif
|
#endif /* HAVE_DB_H */
|
||||||
#include "lang.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 dbkey;
|
||||||
static DBT dbdata;
|
static DBT dbdata;
|
||||||
static int dbret;
|
static int dbret;
|
||||||
|
@ -65,14 +57,6 @@ char TranslatedLang[STRSIZE];
|
||||||
hash_t *langcache[MAXLANG];
|
hash_t *langcache[MAXLANG];
|
||||||
static void* LANGGetData(void* key, int lang);
|
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, ...) {
|
static void LANGDebug(char *file, int line, char *func, int err, char *fmt, ...) {
|
||||||
va_list ap;
|
va_list ap;
|
||||||
char buf[800];
|
char buf[800];
|
||||||
|
@ -456,8 +440,7 @@ void LANGfini()
|
||||||
LANGCloseDatabase(i);
|
LANGCloseDatabase(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#else /* HAVE_DB_H */
|
||||||
#else
|
|
||||||
#include "lang.h"
|
#include "lang.h"
|
||||||
void LANGinit(int debug, char *dbpath, LANGDebugFunc debugfunc)
|
void LANGinit(int debug, char *dbpath, LANGDebugFunc debugfunc)
|
||||||
{
|
{
|
||||||
|
@ -466,4 +449,4 @@ void LANGinit(int debug, char *dbpath, LANGDebugFunc debugfunc)
|
||||||
void LANGfini()
|
void LANGfini()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#endif /* 0 */
|
#endif /* HAVE_DB_H */
|
||||||
|
|
14
src/main.c
14
src/main.c
|
@ -52,22 +52,21 @@
|
||||||
#include "perlmod.h"
|
#include "perlmod.h"
|
||||||
#endif /* USE_PERL */
|
#endif /* USE_PERL */
|
||||||
|
|
||||||
|
#define PID_FILENAME "neostats.pid"
|
||||||
|
|
||||||
static void do_reconnect( void );
|
static void do_reconnect( void );
|
||||||
static int in_do_exit = 0;
|
static int in_do_exit = 0;
|
||||||
#define PID_FILENAME "neostats.pid"
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
void *( *old_malloc )( size_t );
|
void *( *old_malloc )( size_t );
|
||||||
void( *old_free )( void * );
|
void( *old_free )( void * );
|
||||||
#endif /* WIN32 */
|
#endif /* WIN32 */
|
||||||
|
|
||||||
typedef struct exit_report
|
struct
|
||||||
{
|
{
|
||||||
int exit_code;
|
int exit_code;
|
||||||
char *exit_message;
|
char *exit_message;
|
||||||
}exit_report;
|
} exit_reports[]=
|
||||||
|
|
||||||
exit_report exit_reports[]=
|
|
||||||
{
|
{
|
||||||
/* NS_EXIT_NORMAL */
|
/* NS_EXIT_NORMAL */
|
||||||
{ EXIT_SUCCESS, "Normal shut down subsystems" },
|
{ EXIT_SUCCESS, "Normal shut down subsystems" },
|
||||||
|
@ -356,11 +355,10 @@ int main( int argc, char *argv[] )
|
||||||
return NS_FAILURE;
|
return NS_FAILURE;
|
||||||
if( !me.servicehost[0] )
|
if( !me.servicehost[0] )
|
||||||
strlcpy( me.servicehost, me.name, sizeof( me.name ) );
|
strlcpy( me.servicehost, me.name, sizeof( me.name ) );
|
||||||
|
#ifndef WIN32
|
||||||
/* initialize Lang Subsystem */
|
/* initialize Lang Subsystem */
|
||||||
ircsnprintf( dbpath, MAXPATH, "%s/data/lang.db", NEO_PREFIX );
|
ircsnprintf( dbpath, MAXPATH, "%s/data/lang.db", NEO_PREFIX );
|
||||||
LANGinit( 1, dbpath, NULL );
|
LANGinit( 1, dbpath, NULL );
|
||||||
|
|
||||||
#ifndef WIN32
|
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
/* if we are compiled with debug, or forground switch was specified, DONT FORK */
|
/* if we are compiled with debug, or forground switch was specified, DONT FORK */
|
||||||
if( !nsconfig.foreground )
|
if( !nsconfig.foreground )
|
||||||
|
@ -504,13 +502,13 @@ void do_exit( NS_EXIT_TYPE exitcode, char *quitmsg )
|
||||||
}
|
}
|
||||||
FiniDBA();
|
FiniDBA();
|
||||||
FiniLogs();
|
FiniLogs();
|
||||||
LANGfini();
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
/* restore pcre lib malloc pointers */
|
/* restore pcre lib malloc pointers */
|
||||||
pcre_malloc = old_malloc;
|
pcre_malloc = old_malloc;
|
||||||
pcre_free = old_free;
|
pcre_free = old_free;
|
||||||
#endif /* WIN32 */
|
#endif /* WIN32 */
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
|
LANGfini();
|
||||||
if( ( exitcode == NS_EXIT_RECONNECT && nsconfig.r_time > 0 ) || exitcode == NS_EXIT_RELOAD ) {
|
if( ( exitcode == NS_EXIT_RECONNECT && nsconfig.r_time > 0 ) || exitcode == NS_EXIT_RELOAD ) {
|
||||||
sleep( nsconfig.r_time );
|
sleep( nsconfig.r_time );
|
||||||
execve( "./bin/neostats", NULL, NULL );
|
execve( "./bin/neostats", NULL, NULL );
|
||||||
|
|
|
@ -221,9 +221,6 @@
|
||||||
<File
|
<File
|
||||||
RelativePath=".\ircstring.c">
|
RelativePath=".\ircstring.c">
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath=".\lang.c">
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath=".\list.c">
|
RelativePath=".\list.c">
|
||||||
</File>
|
</File>
|
||||||
|
|
Reference in a new issue