X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=win%2Finspircd_win32wrapper.h;h=85572fd64fdd6595768b073e8910d82808bf4b3e;hb=433044e8fc6ae601c0c5b8439494afee9f2e6be6;hp=a1eba11e9714b0cf2b5449f9a727199f8543eaef;hpb=6d03943426dcce76ba66567a9b18425a5ebb4c0c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/win/inspircd_win32wrapper.h b/win/inspircd_win32wrapper.h index a1eba11e9..85572fd64 100644 --- a/win/inspircd_win32wrapper.h +++ b/win/inspircd_win32wrapper.h @@ -1,16 +1,24 @@ -/* +------------------------------------+ - * | Inspire Internet Relay Chat Daemon | - * +------------------------------------+ +/* + * InspIRCd -- Internet Relay Chat Daemon + * + * Copyright (C) 2007 Dennis Friis + * Copyright (C) 2007 Craig Edwards + * Copyright (C) 2007 Robin Burchell * - * InspIRCd: (C) 2002-2009 InspIRCd Development Team - * See: http://wiki.inspircd.org/Credits + * This file is part of InspIRCd. InspIRCd is free software: you can + * redistribute it and/or modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation, version 2. * - * This program is free but copyrighted software; see - * the file COPYING for details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * --------------------------------------------------- + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ + /* Windows Port Wrapper Functions/Definitions By Burlex */ @@ -100,6 +108,8 @@ typedef unsigned __int32 uint32_t; #include #include #include +#include +#include #ifdef ENABLE_CRASHDUMPS #include @@ -138,6 +148,8 @@ CoreExport const char * insp_inet_ntop(int af, const void * src, char * dst, soc /* Since when does the ISO C++ standard *remove* C functions?! */ #define mkdir(file,mode) _mkdir(file) +#define strncasecmp strnicmp + /* Unix-style sleep (argument is in seconds) */ __inline void sleep(int seconds) { Sleep(seconds * 1000); } @@ -163,7 +175,7 @@ struct option }; extern int optind; extern char optarg[514]; -int getopt_long_only (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind); +int getopt_long(int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind); /* Module Loading */ #define dlopen(path, state) (void*)LoadLibrary(path) @@ -187,11 +199,18 @@ struct DIR bool first; }; +struct timespec +{ + time_t tv_sec; + long tv_nsec; +}; + CoreExport DIR * opendir(const char * path); CoreExport dirent * readdir(DIR * handle); CoreExport void closedir(DIR * handle); -CoreExport int gettimeofday(struct timeval * tv, void * tz); +const int CLOCK_REALTIME = 0; +CoreExport int clock_gettime(int clock, struct timespec * tv); /* Disable these stupid warnings.. */ #pragma warning(disable:4800) @@ -214,6 +233,7 @@ typedef unsigned long long uint64_t; typedef signed char int8_t; typedef signed long int32_t; typedef signed long long int64_t; +typedef signed long ssize_t; /* Shared memory allocation functions */ void * ::operator new(size_t iSize); @@ -226,6 +246,8 @@ class ServerConfig; /* Look up the nameserver in use from the registry on windows */ CoreExport std::string FindNameServerWin(); +#define DISABLE_WRITEV + /* Clear a windows console */ CoreExport void ClearConsole(); @@ -235,11 +257,14 @@ CoreExport void WindowsForkKillOwner(); CoreExport void ChangeWindowsSpecificPointers(); -CoreExport bool ValidateWindowsDnsServer(ServerConfig* conf, const char* tag, const char* value, ValueItem &data); +CoreExport void FindDNS(std::string& server); CoreExport bool initwmi(); CoreExport void donewmi(); CoreExport int getcpu(); +CoreExport int random(); +CoreExport void srandom(unsigned seed); +CoreExport int gettimeofday(timeval *tv, void *); #endif