summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortrystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2005-02-06 19:18:15 +0000
committertrystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2005-02-06 19:18:15 +0000
commit9b3a357193a020c53624b29f84e0bca4795722f0 (patch)
treebe1a500c8a469dad8164a72d1266780ac8c28510
parentf8ac398b86ea6a26dba62064d9810796466e4118 (diff)
BUILD : 1.7.8 (565) BUGS : 293 NOTES : Merge of Win32 branch into the main, support for Unreal +I, German language updated, fixed bug vidents not updating, Setting and Removal of sqlines on forbid or drop
git-svn-id: svn://svn.anope.org/anope/trunk@567 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@417 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--Changes10
-rw-r--r--docs/WIN32.txt149
-rw-r--r--include/commands.h4
-rw-r--r--include/datafiles.h2
-rw-r--r--include/extern.h28
-rw-r--r--include/makefile.win3225
-rw-r--r--include/modules.h133
-rw-r--r--include/resource.h20
-rw-r--r--include/services.h65
-rw-r--r--include/sockets.h47
-rw-r--r--include/sysconf.h.win3251
-rw-r--r--include/threads.h67
-rw-r--r--include/version.sh.c215
-rw-r--r--lang/Makefile.win3275
-rw-r--r--lang/de.l75
-rw-r--r--lang/langcomp.c3
-rw-r--r--lang/langtool.c14
-rw-r--r--makefile.inc.win32174
-rw-r--r--makefile.win32156
-rw-r--r--src/anope-icon.icobin0 -> 7406 bytes
-rw-r--r--src/bahamut.c4
-rw-r--r--src/base64.c2
-rw-r--r--src/channels.c16
-rw-r--r--src/chanserv.c8
-rw-r--r--src/compat.c35
-rw-r--r--src/datafiles.c89
-rw-r--r--src/dreamforge.c4
-rw-r--r--src/hybrid.c4
-rw-r--r--src/init.c45
-rw-r--r--src/language.c4
-rw-r--r--src/log.c49
-rw-r--r--src/main.c29
-rw-r--r--src/makefile.win32107
-rw-r--r--src/memory.c16
-rw-r--r--src/modules.c47
-rw-r--r--src/modules/makefile.inc.win322
-rw-r--r--src/modules/makefile.win3224
-rw-r--r--src/mypasql.c122
-rw-r--r--src/mypasql.def10
-rw-r--r--src/nickserv.c9
-rw-r--r--src/plexus.c4
-rw-r--r--src/proxy.c101
-rw-r--r--src/ptlink.c4
-rw-r--r--src/rageircd.c13
-rw-r--r--src/ratbox.c9
-rw-r--r--src/sockutil.c177
-rw-r--r--src/solidircd.c4
-rw-r--r--src/tools/anopesmtp.c17
-rw-r--r--src/tools/smtp.h33
-rw-r--r--src/ultimate2.c4
-rw-r--r--src/ultimate3.c6
-rw-r--r--src/unreal31.c6
-rw-r--r--src/unreal32.c15
-rw-r--r--src/users.c6
-rw-r--r--src/viagra.c6
-rw-r--r--src/win32.rc91
-rw-r--r--version.log7
57 files changed, 2186 insertions, 256 deletions
diff --git a/Changes b/Changes
index 7abe77cb3..d71de8a2e 100644
--- a/Changes
+++ b/Changes
@@ -1,10 +1,20 @@
Anope Version S V N
-------------------
Provided by Anope Dev. <dev@anope.org> - 2005
+02/05 A Support for Unreal 3.2 +I channel mode. [ #00]
+02/03 A Merged anope-win32 branch into the main, now Win32 ready [ #00]
+02/05 F Change Ident function did not update the vident [#293]
01/30 F ChanServ help to reflect the avaiable commands. [ #00]
01/30 F ChanServ still used some commands that were not valid on all ircd [ #00]
01/30 F Compiling modules under Mac OSX. [#285]
+Provided by crazytoon <da.crew@gmx.net> - 2005
+02/05 A Updated German language file [ #00]
+
+Provided by BarkerJr <barkerjr@barkerjr.net> - 2005
+02/05 A Setting and Removal of SQLINEs on forbid of Channels and Nicks [ #00]
+
+
Anope Version 1.7.8
-------------------
Provided by Anope Dev. <dev@anope.org> - 2005
diff --git a/docs/WIN32.txt b/docs/WIN32.txt
new file mode 100644
index 000000000..21adb7e41
--- /dev/null
+++ b/docs/WIN32.txt
@@ -0,0 +1,149 @@
+Anope for Windows
+
+1. Building the source
+2. Installation
+3. Compiling modules
+4. Credits
+
+=========================================================================
+= 1. Building from the ground up =
+=========================================================================
+
+ If you want to build Anope on the Win32 system you will need to obtain
+the following items.
+
+1. Download the files required
+
+- Current Anope source:
+ http://zero.org:7467/viewcvs/trunk.tar.gz
+
+If you have Visual C++ 6, 7 or .NET skip ahead to step 2, else download
+the following free components from Microsoft. Once downloaded install these packages
+
+- VCToolKit:
+ http://download.microsoft.com/download/3/9/b/39bac755-0a1e-4d0b-b72c-3a158b7444c4/VCToolkitSetup.exe
+
+- .NET Framework 1.1 Redistributable:
+ http://download.microsoft.com/download/a/a/c/aac39226-8825-44ce-90e3-bf8203e74006/dotnetfx.exe
+
+- .NET Framework SDK 1.1:
+ http://download.microsoft.com/download/5/2/0/5202f918-306e-426d-9637-d7ee26fbe507/setup.exe
+
+- Core SDK for the needed libraries:
+ http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
+
+- MySQL for Windows - needed if building for mysql
+ http://www.mysql.com
+
+
+2. Unpack the Anope tarball with your favorite uncompression program (winzip or winrar)
+
+3. Open Makefile.inc.win32 in the main directory with a text editor (notepad or notepad clones)
+
+ A. change the line "IRCD=" to match the ircd that you want to build, and place that number
+ after the = so if your building Unreal 3.2 (#10), you would change the line to read
+ "IRCD=10"
+
+ B. If you are building for MySQL change USE_MYSQL to equal 1 (ie.. USE_MYSQL=1), the next
+ two lines you must enter the path to the MySQL installation. MYSQL_INC, and MYSQL_LIB,
+ You can define the path one of two ways, either with \ or / if you use \ you must add
+ a secondary \ so c:\mysql would be c:\\mysql
+
+ C. To use Anope build in Proxy scan you can change PROXY_SCANNER to be equal to 1
+ (ie.. PROXY_SCANNER=1), note the proxy scan is not the best and its recommended to use
+ another thrid party scanner.
+
+ D. If you are using Visual Studio 6, this next line can be very important. If you are an
+ error during compile about "unresolved external symbol __ftol2", remove the # in front
+ of VC6=/QIfist and attempt to compile again.
+
+ E. When compiling if you get an error about 'Cannot find wsock32.lib' or 'Cannot find
+ msvcrt.lib' You need to define the libpath, in the LIBPATH directive. You can define
+ the path one of two ways, either with \ or / if you use \ you must add a secondary \
+ so c:\mysql would be c:\\sdk\lib be sure to remove the # in front of LFLAGS
+
+ F. Most import is to set the DATDEST to be the folder name where data will be stored.
+ This does not need to be the full path just the folder under the main executable
+ in which data will exist. In our example we will use "data"
+
+4. You are now ready to compile, bring up the Visual C++ toolkit command prompt, this
+ will launch a dos command prompt like window, which will set the enviroment properties
+ need to make Anope. Change directories to where you unpacked the source code in step 2.
+ At the prompt type
+
+ nmake -f Makefile.win32
+
+ Once you are back at the command prompt again, if there have been no
+ errors, you are ready to go, should you encounter errors check how to adjust
+ the makefile.inc.win32 to help resolve the issue.
+
+5. Anope will install the files where the belong. The only thing you need to do
+ is rename "data/example.conf" to be "services.conf"
+
+You have now complete the building phase of Anope for Windows. Move to the
+section related to setting up Anope.
+
+=========================================================================
+= 2. Installation =
+=========================================================================
+
+ Since Anope for Windows does not use a visual interface, you must do
+the configuration before getting to far into this.
+
+Open services.conf, and make the following edits
+
+A. RemoteServer : this is the address to your ircd, along with the port
+ and password. You should consult your ircd documentation
+ on how to link ircds.
+B. ServicesRoot : Remove the # and change the names to your nick so you
+ can take control of services once they are online.
+
+If you are unsure of the settings, You can go to the dos command prompt
+and run "anope.exe -nofork -debug" and watch the information as it
+attempts to connect.
+
+To launch services you can do it one of two ways, if you are sure that the
+configuration information is correct, simply double clicking on it will
+cause it to start, no window will come up. You can start at the dos prompt
+and type in "anope.exe" if services are successful in starting up
+the dos prompt will seem to hang, at this point you can close the dos
+window
+
+=========================================================================
+= 3. Compiling Modules =
+=========================================================================
+
+ If you want to build other modules. You will need to modify the
+Makefile.inc.win32
+
+ A. When compiling if you get an error about 'Cannot find wsock32.lib'
+ or 'Cannot find msvcrt.lib' You need to define the libpath, in the
+ LIBPATH directive. You can define the path one of two ways, either
+ with \ or / if you use \ you must add a secondary \ so c:\mysql
+ would be c:\\sdk\lib be sure to remove the # in front of LFLAGS
+
+ B. Add modules fine the line of "SRCS=" add the name of the file to
+ the end of the line. So if you have two files
+
+ "SRCS=file.c file2.c"
+
+When that is done, use the same command prompt you set up in Part 1,
+change directores to the src/modules folder and type
+
+nmake -f Makefile.win32
+
+Copy the *.dll files that get created to the "data/modules/runtime"
+folder.
+
+=========================================================================
+= 4. Credits =
+=========================================================================
+
+ Anope is based on the code of Epona and IRCServices see README for
+full list of developers.
+
+ Anope Winodws code is provided by
+
+ Dominick Meglio <codemastr@unrealircd.com>
+ Trystan Scott Lee <trystan@nomadirc.net>
+ Chris Hogben <heinz@anope.org> \ No newline at end of file
diff --git a/include/commands.h b/include/commands.h
index 703842690..ec08a44a9 100644
--- a/include/commands.h
+++ b/include/commands.h
@@ -27,8 +27,8 @@ extern void help_cmd(char *service, User *u, Command *list,
char *name);
extern void do_run_cmd(char *service, User * u, Command *c,const char *cmd);
extern void do_help_cmd(char *service, User * u, Command *c,const char *cmd);
-extern void mod_help_cmd(char *service, User *u, CommandHash *cmdTable[],const char *cmd);
-extern void mod_run_cmd(char *service, User *u, CommandHash *cmdTable[],const char *cmd);
+extern MDE void mod_help_cmd(char *service, User *u, CommandHash *cmdTable[],const char *cmd);
+extern MDE void mod_run_cmd(char *service, User *u, CommandHash *cmdTable[],const char *cmd);
extern char *mod_current_module_name;
/*************************************************************************/
diff --git a/include/datafiles.h b/include/datafiles.h
index 32f168ca1..e25b3416a 100644
--- a/include/datafiles.h
+++ b/include/datafiles.h
@@ -15,7 +15,9 @@
#ifndef DATAFILES_H
#define DATAFILES_H
+#ifndef _WIN32
#include <sys/param.h>
+#endif
/*************************************************************************/
diff --git a/include/extern.h b/include/extern.h
index 410236363..40e275da2 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -17,7 +17,15 @@
#include "slist.h"
+#ifndef _WIN32
#define E extern
+#else
+#ifndef MODULE_COMPILE
+#define E extern __declspec(dllexport)
+#else
+#define E extern __declspec(dllimport)
+#endif
+#endif
E char *uplink;
@@ -200,7 +208,9 @@ E char *strerror(int errnum);
#if !HAVE_STRSIGNAL
char *strsignal(int signum);
#endif
-
+#ifdef _WIN32
+char *sockstrerror(int error);
+#endif
/**** config.c ****/
@@ -660,7 +670,7 @@ E int process_numlist(const char *numstr, int *count_ret,
range_callback_t callback, User * u, ...);
E int isValidHost(const char *host, int type);
-E int isvalidchar(char c);
+E int isvalidchar(const char c);
E char *myStrGetToken(const char *str, const char dilim, int token_number);
E char *myStrGetOnlyToken(const char *str, const char dilim,
@@ -877,14 +887,14 @@ E int32 total_read, total_written;
E int32 read_buffer_len(void);
E int32 write_buffer_len(void);
-E int sgetc(int s);
-E char *sgets(char *buf, int len, int s);
-E char *sgets2(char *buf, int len, int s);
-E int sread(int s, char *buf, int len);
-E int sputs(char *str, int s);
-E int sockprintf(int s, char *fmt, ...);
+E int sgetc(ano_socket_t s);
+E char *sgets(char *buf, int len, ano_socket_t s);
+E char *sgets2(char *buf, int len, ano_socket_t s);
+E int sread(ano_socket_t s, char *buf, int len);
+E int sputs(char *str, ano_socket_t s);
+E int sockprintf(ano_socket_t s, char *fmt, ...);
E int conn(const char *host, int port, const char *lhost, int lport);
-E void disconn(int s);
+E void disconn(ano_socket_t s);
/**** users.c ****/
diff --git a/include/makefile.win32 b/include/makefile.win32
new file mode 100644
index 000000000..b186c578c
--- /dev/null
+++ b/include/makefile.win32
@@ -0,0 +1,25 @@
+# Make file for Win32
+#
+# (C) 2003-2005 Anope Team
+# Contact us at info@anope.org
+#
+# Please read COPYING and README for further details.
+#
+# Based on the original code of Epona by Lara.
+# Based on the original code of Services by Andy Church.
+#
+# $Id:$
+#
+
+###########################################################################
+
+clean:
+ -@erase language.h
+
+spotless: clean
+ -@erase sysconf.h version.h
+
+distclean: spotless
+
+
+FRC:
diff --git a/include/modules.h b/include/modules.h
index 2a3025586..91bdb7a88 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -18,6 +18,34 @@
#include "services.h"
#include <stdio.h>
+/* Cross OS compatibility macros */
+#ifdef _WIN32
+typedef HMODULE ano_module_t;
+
+#define ano_modopen(file) LoadLibrary(file)
+/* ano_moderr in modules.c */
+#define ano_modsym(file, symbol) (void *)GetProcAddress(file, symbol)
+#define ano_modclose(file) FreeLibrary(file) ? 0 : 1
+#define ano_modclearerr() SetLastError(0)
+#define MODULE_EXT ".dll"
+
+#else
+typedef void * ano_module_t;
+
+#ifdef HAS_RTLD_LOCAL
+#define ano_modopen(file) dlopen(file, RTLD_LAZY|RTLD_LOCAL)
+#else
+#define ano_modopen(file) dlopen(file, RTLD_LAZY)
+#endif
+#define ano_moderr() dlerror()
+#define ano_modsym(file, symbol) dlsym(file, DL_PREFIX symbol)
+#define ano_modclose(file) dlclose(file)
+#define ano_modclearerr() errno = 0
+#define MODULE_EXT ".so"
+
+#endif
+
+
/*************************************************************************/
#define CMD_HASH(x) (((x)[0]&31)<<5 | ((x)[1]&31)) /* Will gen a hash from a string :) */
#define MAX_CMD_HASH 1024
@@ -53,7 +81,18 @@
#define MOD_ERR_NOSERVICE 12
#define MOD_ERR_NO_MOD_NAME 13
- /*************************************************************************/
+/*************************************************************************/
+/* Macros to export the Module API functions/variables */
+#ifndef _WIN32
+#define MDE
+#else
+#ifndef MODULE_COMPILE
+#define MDE __declspec(dllexport)
+#else
+#define MDE __declspec(dllimport)
+#endif
+#endif
+/*************************************************************************/
/* Structure for information about a *Serv command. */
@@ -66,14 +105,14 @@ typedef struct MessageHash_ MessageHash;
typedef struct ModuleCallBack_ ModuleCallBack;
-extern CommandHash *HOSTSERV[MAX_CMD_HASH];
-extern CommandHash *BOTSERV[MAX_CMD_HASH];
-extern CommandHash *MEMOSERV[MAX_CMD_HASH];
-extern CommandHash *NICKSERV[MAX_CMD_HASH];
-extern CommandHash *CHANSERV[MAX_CMD_HASH];
-extern CommandHash *HELPSERV[MAX_CMD_HASH];
-extern CommandHash *OPERSERV[MAX_CMD_HASH];
-extern MessageHash *IRCD[MAX_CMD_HASH];
+extern MDE CommandHash *HOSTSERV[MAX_CMD_HASH];
+extern MDE CommandHash *BOTSERV[MAX_CMD_HASH];
+extern MDE CommandHash *MEMOSERV[MAX_CMD_HASH];
+extern MDE CommandHash *NICKSERV[MAX_CMD_HASH];
+extern MDE CommandHash *CHANSERV[MAX_CMD_HASH];
+extern MDE CommandHash *HELPSERV[MAX_CMD_HASH];
+extern MDE CommandHash *OPERSERV[MAX_CMD_HASH];
+extern MDE MessageHash *IRCD[MAX_CMD_HASH];
struct Module_ {
char *name;
@@ -173,62 +212,62 @@ Module *findModule(char *name); /* Find a module */
int loadModule(Module *m,User *u); /* Load the given module into the program */
int unloadModule(Module *m, User *u); /* Unload the given module from the pro */
int prepForUnload(Module *m); /* Prepare the module for unload */
-void moduleAddVersion(char *version);
-void moduleAddAuthor(char *author);
+MDE void moduleAddVersion(char *version);
+MDE void moduleAddAuthor(char *author);
void modules_init(void);
void modules_delayed_init(void);
void moduleCallBackPrepForUnload(char *mod_name);
-void moduleCallBackDeleteEntry(ModuleCallBack * prev);
-char *moduleGetLastBuffer(void);
-void moduleSetHelpHelp(void (*func) (User * u));
-void moduleDisplayHelp(int service, User *u);
-void moduleSetHostHelp(void (*func) (User * u));
-void moduleSetOperHelp(void (*func) (User * u));
-void moduleSetBotHelp(void (*func) (User * u));
-void moduleSetMemoHelp(void (*func) (User * u));
-void moduleSetChanHelp(void (*func) (User * u));
-void moduleSetNickHelp(void (*func) (User * u));
-int moduleAddHelp(Command * c, int (*func) (User * u));
-int moduleAddRegHelp(Command * c, int (*func) (User * u));
-int moduleAddOperHelp(Command * c, int (*func) (User * u));
-int moduleAddAdminHelp(Command * c, int (*func) (User * u));
-int moduleAddRootHelp(Command * c, int (*func) (User * u));
+MDE void moduleCallBackDeleteEntry(ModuleCallBack * prev);
+MDE char *moduleGetLastBuffer(void);
+MDE void moduleSetHelpHelp(void (*func) (User * u));
+MDE void moduleDisplayHelp(int service, User *u);
+MDE void moduleSetHostHelp(void (*func) (User * u));
+MDE void moduleSetOperHelp(void (*func) (User * u));
+MDE void moduleSetBotHelp(void (*func) (User * u));
+MDE void moduleSetMemoHelp(void (*func) (User * u));
+MDE void moduleSetChanHelp(void (*func) (User * u));
+MDE void moduleSetNickHelp(void (*func) (User * u));
+MDE int moduleAddHelp(Command * c, int (*func) (User * u));
+MDE int moduleAddRegHelp(Command * c, int (*func) (User * u));
+MDE int moduleAddOperHelp(Command * c, int (*func) (User * u));
+MDE int moduleAddAdminHelp(Command * c, int (*func) (User * u));
+MDE int moduleAddRootHelp(Command * c, int (*func) (User * u));
/*************************************************************************/
/*************************************************************************/
/* Command Managment Functions */
-Command *createCommand(const char *name,int (*func)(User *u),int (*has_priv)(User *u),int help_all, int help_reg, int help_oper, int help_admin,int help_root);
-int destroyCommand(Command *c); /* destroy a command */
-int addCoreCommand(CommandHash *cmdTable[], Command *c); /* Add a command to a command table */
-int moduleAddCommand(CommandHash *cmdTable[], Command *c, int pos);
-int addCommand(CommandHash *cmdTable[], Command *c,int pos);
-int delCommand(CommandHash *cmdTable[], Command *c,char *mod_name); /* Del a command from a cmd table */
-int moduleDelCommand(CommandHash *cmdTable[],char *name); /* Del a command from a cmd table */
+MDE Command *createCommand(const char *name,int (*func)(User *u),int (*has_priv)(User *u),int help_all, int help_reg, int help_oper, int help_admin,int help_root);
+MDE int destroyCommand(Command *c); /* destroy a command */
+MDE int addCoreCommand(CommandHash *cmdTable[], Command *c); /* Add a command to a command table */
+MDE int moduleAddCommand(CommandHash *cmdTable[], Command *c, int pos);
+MDE int addCommand(CommandHash *cmdTable[], Command *c,int pos);
+MDE int delCommand(CommandHash *cmdTable[], Command *c,char *mod_name); /* Del a command from a cmd table */
+MDE int moduleDelCommand(CommandHash *cmdTable[],char *name); /* Del a command from a cmd table */
Command *findCommand(CommandHash *cmdTable[], const char *name); /* Find a command */
/*************************************************************************/
/*************************************************************************/
/* Message Managment Functions */
-Message *createMessage(char *name,int (*func)(char *source, int ac, char **av));
+MDE Message *createMessage(char *name,int (*func)(char *source, int ac, char **av));
Message *findMessage(MessageHash *msgTable[], const char *name); /* Find a Message */
-int addMessage(MessageHash *msgTable[], Message *m, int pos); /* Add a Message to a Message table */
+MDE int addMessage(MessageHash *msgTable[], Message *m, int pos); /* Add a Message to a Message table */
int addCoreMessage(MessageHash *msgTable[], Message *m); /* Add a Message to a Message table */
-int moduleAddMessage(Message *m, int pos);
+MDE int moduleAddMessage(Message *m, int pos);
int delMessage(MessageHash *msgTable[], Message *m, char *mod_name); /* Del a Message from a msg table */
-int moduleDelMessage(char *name);
+MDE int moduleDelMessage(char *name);
int destroyMessage(Message *m); /* destroy a Message*/
Message *findMessage(MessageHash *msgTable[], const char *name);
/*************************************************************************/
-int moduleAddCallback(char *name,time_t when,int (*func)(int argc, char *argv[]),int argc, char **argv);
-void moduleDelCallback(char *name);
-void moduleCallBackRun(void);
-
-char *moduleGetData(ModuleData **md, char *key); /* Get the value for this key from this struct */
-int moduleAddData(ModuleData **md, char *key, char *value); /* Set the value for this key for this struct */
-void moduleDelData(ModuleData **md, char *key); /* Delete this key/value pair */
-void moduleDelAllData(ModuleData **md); /* Delete all key/value pairs for this module for this struct */
-void moduleCleanStruct(ModuleData **moduleData); /* Clean a moduleData hash */
+MDE int moduleAddCallback(char *name,time_t when,int (*func)(int argc, char *argv[]),int argc, char **argv);
+MDE void moduleDelCallback(char *name);
+MDE void moduleCallBackRun(void);
+
+MDE char *moduleGetData(ModuleData **md, char *key); /* Get the value for this key from this struct */
+MDE int moduleAddData(ModuleData **md, char *key, char *value); /* Set the value for this key for this struct */
+MDE void moduleDelData(ModuleData **md, char *key); /* Delete this key/value pair */
+MDE void moduleDelAllData(ModuleData **md); /* Delete all key/value pairs for this module for this struct */
+MDE void moduleCleanStruct(ModuleData **moduleData); /* Clean a moduleData hash */
void moduleDelAllDataMod(Module *m); /* remove all module data from all structs for this module */
int moduleDataDebug(ModuleData **md); /* Allow for debug output of a moduleData struct */
-boolean moduleMinVersion(int major,int minor,int patch,int build); /* Checks if the current version of anope is before or after a given verison */
+MDE boolean moduleMinVersion(int major,int minor,int patch,int build); /* Checks if the current version of anope is before or after a given verison */
/*************************************************************************/
diff --git a/include/resource.h b/include/resource.h
new file mode 100644
index 000000000..2f3b54bfc
--- /dev/null
+++ b/include/resource.h
@@ -0,0 +1,20 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by Win32GUI.rc
+//
+#define VER_ANOPE 1
+#define MANIFEST_RESOURCE_ID 2
+#define ICON_APP 129
+
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NO_MFC 1
+#define _APS_NEXT_RESOURCE_VALUE 152
+#define _APS_NEXT_COMMAND_VALUE 40061
+#define _APS_NEXT_CONTROL_VALUE 1167
+#define _APS_NEXT_SYMED_VALUE 104
+#endif
+#endif
diff --git a/include/services.h b/include/services.h
index 4523e2e34..730c04f3d 100644
--- a/include/services.h
+++ b/include/services.h
@@ -37,24 +37,60 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+
+/* Windows does not have:
+ * unistd.h, grp.h,
+ * netdb.h, netinet/in.h,
+ * sys/socket.h, sys/time.h
+ * Windows requires:
+ * winsock.h
+ * -- codemastr
+ */
+
+#ifndef _WIN32
#include <unistd.h>
+#endif
+
#include <signal.h>
#include <time.h>
#include <errno.h>
+
+#ifndef _WIN32
#include <grp.h>
+#endif
+
#include <limits.h>
+
+#ifndef _WIN32
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/socket.h>
+#else
+#include <winsock.h>
+#include <windows.h>
+#endif
+
#include <sys/stat.h> /* for umask() on some systems */
#include <sys/types.h>
+
+#ifndef _WIN32
#include <sys/time.h>
+#endif
+
+#ifdef _WIN32
+#include <sys/timeb.h>
+#include <direct.h>
+#include <io.h>
+#endif
+
#include <fcntl.h>