]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Windows support. Tested and working to compile on freebsd and linux. Next step is...
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 19 May 2007 15:56:42 +0000 (15:56 +0000)
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 19 May 2007 15:56:42 +0000 (15:56 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7043 e03df62e-2008-0410-955e-edbf42e46eb7

213 files changed:
configure
include/base.h
include/channels.h
include/command_parse.h
include/commands/cmd_stats.h
include/commands/cmd_whois.h
include/commands/cmd_whowas.h
include/configreader.h
include/connection.h
include/ctables.h
include/cull_list.h
include/dns.h
include/dynamic.h
include/exitcodes.h
include/hash_map.h
include/hashcomp.h
include/inspircd.h
include/inspsocket.h
include/inspstring.h
include/mode.h
include/modules.h
include/snomasks.h
include/socket.h
include/socketengine.h
include/timer.h
include/typedefs.h
include/users.h
include/wildcard.h
include/xline.h
src/cmd_admin.cpp
src/cmd_away.cpp
src/cmd_clearcache.cpp
src/cmd_commands.cpp
src/cmd_connect.cpp
src/cmd_die.cpp
src/cmd_eline.cpp
src/cmd_gline.cpp
src/cmd_info.cpp
src/cmd_invite.cpp
src/cmd_ison.cpp
src/cmd_join.cpp
src/cmd_kick.cpp
src/cmd_kill.cpp
src/cmd_kline.cpp
src/cmd_links.cpp
src/cmd_list.cpp
src/cmd_loadmodule.cpp
src/cmd_lusers.cpp
src/cmd_map.cpp
src/cmd_mode.cpp
src/cmd_modules.cpp
src/cmd_motd.cpp
src/cmd_names.cpp
src/cmd_nick.cpp
src/cmd_notice.cpp
src/cmd_oper.cpp
src/cmd_part.cpp
src/cmd_pass.cpp
src/cmd_ping.cpp
src/cmd_pong.cpp
src/cmd_privmsg.cpp
src/cmd_qline.cpp
src/cmd_quit.cpp
src/cmd_rehash.cpp
src/cmd_reloadmodule.cpp
src/cmd_restart.cpp
src/cmd_rules.cpp
src/cmd_server.cpp
src/cmd_squit.cpp
src/cmd_stats.cpp
src/cmd_summon.cpp
src/cmd_time.cpp
src/cmd_topic.cpp
src/cmd_trace.cpp
src/cmd_unloadmodule.cpp
src/cmd_user.cpp
src/cmd_userhost.cpp
src/cmd_users.cpp
src/cmd_version.cpp
src/cmd_wallops.cpp
src/cmd_who.cpp
src/cmd_whois.cpp
src/cmd_whowas.cpp
src/cmd_zline.cpp
src/command_parse.cpp
src/configreader.cpp
src/dns.cpp
src/dynamic.cpp
src/hashcomp.cpp
src/helperfuncs.cpp
src/inspircd.cpp
src/inspsocket.cpp
src/inspstring.cpp
src/modules.cpp
src/modules/extra/m_ssl_gnutls.cpp
src/modules/extra/m_ssl_openssl.cpp
src/modules/m_alias.cpp
src/modules/m_alltime.cpp
src/modules/m_antibear.cpp
src/modules/m_antibottler.cpp
src/modules/m_auditorium.cpp
src/modules/m_banexception.cpp
src/modules/m_banredirect.cpp
src/modules/m_blockamsg.cpp
src/modules/m_blockcaps.cpp
src/modules/m_blockcolor.cpp
src/modules/m_botmode.cpp
src/modules/m_cban.cpp
src/modules/m_censor.cpp
src/modules/m_cgiirc.cpp
src/modules/m_chancreate.cpp
src/modules/m_chanfilter.cpp
src/modules/m_chanprotect.cpp
src/modules/m_check.cpp
src/modules/m_chghost.cpp
src/modules/m_chgident.cpp
src/modules/m_cloaking.cpp
src/modules/m_clones.cpp
src/modules/m_conn_join.cpp
src/modules/m_conn_umodes.cpp
src/modules/m_conn_waitpong.cpp
src/modules/m_connflood.cpp
src/modules/m_dccallow.cpp
src/modules/m_deaf.cpp
src/modules/m_denychans.cpp
src/modules/m_devoice.cpp
src/modules/m_dnsbl.cpp
src/modules/m_filter.cpp
src/modules/m_filter.h
src/modules/m_foobar.cpp
src/modules/m_globalload.cpp
src/modules/m_globops.cpp
src/modules/m_helpop.cpp
src/modules/m_hidechans.cpp
src/modules/m_hideoper.cpp
src/modules/m_hostchange.cpp
src/modules/m_http_client.cpp
src/modules/m_httpd.cpp
src/modules/m_httpd_stats.cpp
src/modules/m_ident.cpp
src/modules/m_invisible.cpp
src/modules/m_inviteexception.cpp
src/modules/m_joinflood.cpp
src/modules/m_jumpserver.cpp
src/modules/m_kicknorejoin.cpp
src/modules/m_knock.cpp
src/modules/m_lockserv.cpp
src/modules/m_md5.cpp
src/modules/m_messageflood.cpp
src/modules/m_namesx.cpp
src/modules/m_nicklock.cpp
src/modules/m_noctcp.cpp
src/modules/m_noinvite.cpp
src/modules/m_nokicks.cpp
src/modules/m_nonicks.cpp
src/modules/m_nonotice.cpp
src/modules/m_oper_hash.cpp
src/modules/m_operchans.cpp
src/modules/m_operjoin.cpp
src/modules/m_operlevels.cpp
src/modules/m_operlog.cpp
src/modules/m_opermodes.cpp
src/modules/m_opermotd.cpp
src/modules/m_override.cpp
src/modules/m_randquote.cpp
src/modules/m_redirect.cpp
src/modules/m_regonlycreate.cpp
src/modules/m_remove.cpp
src/modules/m_restrictbanned.cpp
src/modules/m_restrictchans.cpp
src/modules/m_restrictmsg.cpp
src/modules/m_safelist.cpp
src/modules/m_sajoin.cpp
src/modules/m_samode.cpp
src/modules/m_sanick.cpp
src/modules/m_sapart.cpp
src/modules/m_saquit.cpp
src/modules/m_securelist.cpp
src/modules/m_seenicks.cpp
src/modules/m_services.cpp
src/modules/m_services_account.cpp
src/modules/m_sethost.cpp
src/modules/m_setident.cpp
src/modules/m_setidle.cpp
src/modules/m_setname.cpp
src/modules/m_sha256.cpp
src/modules/m_showwhois.cpp
src/modules/m_silence.cpp
src/modules/m_silence_ext.cpp
src/modules/m_spanningtree/main.cpp
src/modules/m_spanningtree/treesocket1.cpp
src/modules/m_spanningtree/treesocket2.cpp
src/modules/m_spanningtree/utils.h
src/modules/m_spy.cpp
src/modules/m_ssl_dummy.cpp
src/modules/m_sslmodes.cpp
src/modules/m_stripcolor.cpp
src/modules/m_svshold.cpp
src/modules/m_swhois.cpp
src/modules/m_taxonomy.cpp
src/modules/m_testcommand.cpp
src/modules/m_timedbans.cpp
src/modules/m_tline.cpp
src/modules/m_uhnames.cpp
src/modules/m_uninvite.cpp
src/modules/m_userip.cpp
src/modules/m_vhost.cpp
src/modules/m_watch.cpp
src/modules/m_xmlsocket.cpp
src/socket.cpp
src/socketengine.cpp
src/users.cpp
src/wildcard.cpp

index 57eeb61ba458c534a9edfe60158b8915bcb859d9..e1bcc153d55f46b65f769f3724ac3a115c72245a 100755 (executable)
--- a/configure
+++ b/configure
@@ -965,6 +965,10 @@ sub writefiles {
 #ifndef __CONFIGURATION_AUTO__
 #define __CONFIGURATION_AUTO__
 
+/* this is for windows support. */
+#define CoreExport /**/
+#define DllExport /**/
+
 #define CONFIG_FILE "$config{CONFIG_DIR}/inspircd.conf"
 #define MOD_PATH "$config{MODULE_DIR}"
 #define VERSION "$version"
index bea7075a02e7e506dab3c148d135be7dc8356b74..2259953b83818c174773dbd3b0219e6adef8d4c3 100644 (file)
@@ -27,7 +27,7 @@ class InspIRCd;
 
 /** The base class for all inspircd classes
 */ 
-class classbase
+class CoreExport classbase
 {
  public:
        /** Time that the object was instantiated (used for TS calculation etc)
@@ -48,7 +48,7 @@ class classbase
  * a flags variable, and each module defining bits within the flag as 'theirs' as it is less prone to conflict and
  * supports arbitary data storage).
  */
-class Extensible : public classbase
+class CoreExport Extensible : public classbase
 {
        /** Private data store
         */
@@ -153,7 +153,7 @@ public:
  * Use BoolSet::Set and BoolSet::Get to set and get bools in the bitmask,
  * and Unset and Invert for special operations upon them.
  */
-class BoolSet : public classbase
+class CoreExport BoolSet : public classbase
 {
        char bits;
 
index f68f838894e8defb9460763bd09f99c1bc10f049..8cee75b9ca0a442d2d079be93c04ada9b190b9be 100644 (file)
@@ -110,7 +110,7 @@ typedef std::map<userrec*, std::vector<prefixtype> > prefixlist;
  * This class represents a channel, and contains its name, modes, time created, topic, topic set time,
  * etc, and an instance of the BanList type.
  */
-class chanrec : public Extensible
+class CoreExport chanrec : public Extensible
 {
  private:
 
index 5750416db1806208e408af97170db3935dd713ed..2ffb30ee6e52ec50cc34c4ca8db1941fa4566435 100644 (file)
@@ -28,7 +28,7 @@ typedef std::map<std::string, void*> SharedObjectList;
  * call command handlers by name, and chop up comma seperated
  * parameters into multiple calls.
  */
-class CommandParser : public classbase
+class CoreExport CommandParser : public classbase
 {
  private:
        /** The creator of this class
index 6b090ef6097f04649a6005443f19221ad259c4c1..0aa98e35988685045eeb0301746b1b71e6c42d87 100644 (file)
@@ -23,7 +23,7 @@
 #include "users.h"
 #include "channels.h"
 
-void DoStats(InspIRCd* Instance, char statschar, userrec* user, string_list &results);
+DllExport void DoStats(InspIRCd* Instance, char statschar, userrec* user, string_list &results);
 
 /** Handle /STATS
  */
index ab67788777cb87b591d85132113d92b51cd0a962..cd1f75c51bc78f8dbf28463d7575a6aa12b12d98 100644 (file)
@@ -23,7 +23,7 @@
 #include "channels.h"
 
 const char* Spacify(char* n);
-void do_whois(InspIRCd* Instance, userrec* user, userrec* dest,unsigned long signon, unsigned long idle, const char* nick);
+DllExport void do_whois(InspIRCd* Instance, userrec* user, userrec* dest,unsigned long signon, unsigned long idle, const char* nick);
 
 /** Handle /WHOIS
  */
index ccbe40493db43438aa52f2146c0b96d46150cbea..8b31c3e7af61233b37d596cd035ce66452a6e6ec 100644 (file)
@@ -33,14 +33,14 @@ enum Internals
 };
 
 /* Forward ref for timer */
-class MaintainTimer;
+class WhoWasMaintainTimer;
 
 /* Forward ref for typedefs */
 class WhoWasGroup;
 
 /** InspTimer that is used to maintain the whowas list, called once an hour
  */
-MaintainTimer* timer;
+extern WhoWasMaintainTimer* timer;
 
 /** A group of users related by nickname
  */
@@ -110,12 +110,12 @@ class WhoWasGroup : public classbase
        ~WhoWasGroup();
 };
 
-class MaintainTimer : public InspTimer
+class WhoWasMaintainTimer : public InspTimer
 {
   private:
        InspIRCd* ServerInstance;
   public:
-       MaintainTimer(InspIRCd* Instance, long interval)
+       WhoWasMaintainTimer(InspIRCd* Instance, long interval)
        : InspTimer(interval, Instance->Time(), true), ServerInstance(Instance)
        {
        }
index 772de2177d06307996b5f3e38c37e0a8e3a2be36..096d1843afaabaf9e83a071d04d08003518b9607 100644 (file)
@@ -180,7 +180,7 @@ typedef std::map<irc::string,char*> operclass_t;
  * and storage of the configuration data needed to run the ircd, such as
  * the servername, connect classes, /ADMIN data, MOTDs and filenames etc.
  */
-class ServerConfig : public Extensible
+class CoreExport ServerConfig : public Extensible
 {
   private:
        /** Creator/owner
@@ -663,7 +663,7 @@ class ServerConfig : public Extensible
        
 };
 
-bool InitializeDisabledCommands(const char* data, InspIRCd* ServerInstance);
+CoreExport bool InitializeDisabledCommands(const char* data, InspIRCd* ServerInstance);
 
 bool InitTypes(ServerConfig* conf, const char* tag);
 bool InitClasses(ServerConfig* conf, const char* tag);
index 5f72fbde0ec3cc43042597ce3608884f5314647f..65d3424478a7d8ccd8b79a7cefc950c5c8208127 100644 (file)
@@ -22,7 +22,7 @@
 /** connection is the base class of userrec, and holds basic user properties.
  * This can be extended for holding other user-like objects in the future.
  */
-class connection : public EventHandler
+class CoreExport connection : public EventHandler
 {
  public:
        /** Hostname of connection.
index 92a0659afac915f9f9fd4d5a94c8e57589dc175b..affef58d95e66c4e06c69f4908942d653a598a76 100644 (file)
@@ -44,7 +44,7 @@ enum CmdResult
 /** A structure that defines a command. Every command available
  * in InspIRCd must be defined as derived from command_t.
  */
-class command_t : public Extensible
+class CoreExport command_t : public Extensible
 {
  protected:
        /** Owner/Creator object
index bea75c86dd29b2d08c330f2b9a4ec03c55a01be8..8901c5ea4248be3f33bb013f34248e2c924c2bf1 100644 (file)
@@ -29,7 +29,7 @@ class InspIRCd;
  * a list of users which are to be culled when a long
  * operation (such as a netsplit) has completed.
  */
-class CullItem : public classbase
+class CoreExport CullItem : public classbase
 {
  private:
        /** Holds a pointer to the user,
@@ -84,7 +84,7 @@ class CullItem : public classbase
  * you attempt to add the same user twice, then the second
  * attempt will be ignored.
  */
-class CullList : public classbase
+class CoreExport CullList : public classbase
 {
  private:
        /** Creator of this CullList
index f12dbdb1ec96133620b49099824619bab63fe7ef..d823a04a802e7b234a21b570992dfab88725ffb0 100644 (file)
@@ -52,7 +52,7 @@ class Module;
 /**
  * Result status, used internally
  */
-class DNSResult : public classbase
+class CoreExport DNSResult : public classbase
 {
  public:
        /** Result ID
@@ -84,7 +84,7 @@ typedef std::pair<unsigned char*, std::string> DNSInfo;
 
 /** Cached item stored in the query cache.
  */
-class CachedQuery
+class CoreExport CachedQuery
 {
  public:
        /** The cached result data, an IP or hostname
@@ -108,14 +108,18 @@ class CachedQuery
         */
        int CalcTTLRemaining()
        {
-               int n = expires - time(NULL);
+               int n = (int)expires - (int)time(NULL);
                return (n < 0 ? 0 : n);
        }
 };
 
 /** DNS cache information. Holds IPs mapped to hostnames, and hostnames mapped to IPs.
  */
+#ifndef WIN32
 typedef nspace::hash_map<irc::string, CachedQuery, nspace::hash<irc::string> > dnscache;
+#else
+typedef nspace::hash_map<irc::string, CachedQuery, nspace::hash_compare<irc::string> > dnscache;
+#endif
 
 /**
  * Error types that class Resolver can emit to its error method.
@@ -144,7 +148,7 @@ class DNSHeader;
 /**
  * A DNS Resource Record (rr)
  */
-class ResourceRecord;
+struct ResourceRecord;
 
 /**
  * Query and resource record types
@@ -189,7 +193,7 @@ enum ForceProtocol
  * can occur by calling virtual methods, one is a success situation, and the other
  * an error situation.
  */
-class Resolver : public Extensible
+class CoreExport Resolver : public Extensible
 {
  protected:
        /**
@@ -319,7 +323,7 @@ class Resolver : public Extensible
  * back to Resolver objects, based upon the request ID. You
  * should never use this class yourself.
  */
-class DNS : public EventHandler
+class CoreExport DNS : public EventHandler
 {
  private:
 
index f2efce0f0ffb677a75c98959cdbbc22ee9268b2b..e4d1b4a059b9e5fef9a1f4d40b25209078c22ff3 100644 (file)
@@ -27,7 +27,7 @@ class InspIRCd;
 /** The DLLManager class is able to load a module file by filename,
  * and locate its init_module symbol.
  */
-class DLLManager
+class CoreExport DLLManager
 {
  public:
        /** This constructor loads the module using dlopen()
@@ -82,7 +82,7 @@ class DLLManager
 /** This class is a specialized form of DLLManager designed to load InspIRCd modules.
  * It's job is to call the init_module function and receive a factory pointer.
  */
-class DLLFactoryBase : public DLLManager
+class CoreExport DLLFactoryBase : public DLLManager
 {
  public:
        /** Default constructor.
@@ -111,7 +111,7 @@ class DLLFactoryBase : public DLLManager
  * This template is a container for ModuleFactory itself, so that it may 'plug' into ModuleFactory
  * and provide module loading capabilities transparently.
  */
-template <class T> class DLLFactory : public DLLFactoryBase
+template <class T> class CoreExport DLLFactory : public DLLFactoryBase
 {
  public:
        /** Default constructor.
index 65329c47c2eb582efa9b160d097de41ec9910b0a..692e731e0923da6de24e25e9dd370d04f63fd2f6 100644 (file)
@@ -38,24 +38,6 @@ enum ExitStatus
 /** Array that maps exit codes (ExitStatus types) to
  * human-readable strings to be shown on shutdown.
  */
-const char* ExitCodes[] =
-{
-       "No error", /* 0 */
-       "DIE command", /* 1 */
-       "execv() failed", /* 2 */
-       "Internal error", /* 3 */
-       "Config file error", /* 4 */
-       "Logfile error", /* 5 */
-       "Fork failed", /* 6 */
-       "Bad commandline parameters", /* 7 */
-       "No ports could be bound", /* 8 */
-       "Can't write PID file", /* 9 */
-       "SocketEngine could not initialize", /* 10 */
-       "Refusing to start up as root", /* 11 */
-       "Found a <die> tag!", /* 12 */
-       "Couldn't load module on startup", /* 13 */
-       "", /* 14 */
-       "Received SIGTERM", /* 15 */
-};
+extern const char * ExitCodes[];
 
 #endif
index 01646d71ad1404b733f7456ffb6563252e1a46c0..ad38d426aac39abe7e3d4446acb82667f2115a76 100644 (file)
 
 #include "inspircd_config.h"
 
+#ifndef WIN32
 #include <ext/hash_map>
 #define nspace __gnu_cxx
+#else
+#include <hash_map>
+#define nspace stdext
+using stdext::hash_map;
+#endif
 
 #endif
index b903f774885540c407b36f54faa2f6e42b4b5f8f..aa3504994088df4c30b1635941fafd66fd34c070 100644 (file)
@@ -58,28 +58,6 @@ unsigned const char lowermap[256] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
 };
 #endif
 
-/** Because of weirdness in g++, before 3.x this was namespace std. It's now __gnu_cxx.
- * This is a #define'd alias.
- */
-namespace nspace
-{
-       /** Convert a string to lower case respecting RFC1459
-        * @param n A string to lowercase
-        */
-       void strlower(char *n);
-
-       /** Hashing function to hash std::string without respect to case
-        */
-        template<> struct hash<std::string>
-        {
-               /** Hash a std::string using RFC1459 case sensitivity rules
-                * @param s A string to hash
-                * @return The hash value
-                */
-                size_t operator()(const string &s) const;
-        };
-}
-
 /** The irc namespace contains a number of helper classes.
  */
 namespace irc
@@ -103,7 +81,7 @@ namespace irc
         * std::string, or a const char** array, using overloaded
         * constructors.
         */
-       class stringjoiner
+       class CoreExport stringjoiner
        {
         private:
                /** Output string
@@ -142,7 +120,7 @@ namespace irc
         * It can then reproduce this list, clamped to a maximum of MAXMODES
         * values per line.
         */
-       class modestacker
+       class CoreExport modestacker
        {
         private:
                /** The mode sequence and its parameters
@@ -213,7 +191,7 @@ namespace irc
         * list will be ":item". This is to allow for parsing 'source' fields
         * from data.
         */
-       class tokenstream
+       class CoreExport tokenstream
        {
         private:
                /** Original string
@@ -245,7 +223,7 @@ namespace irc
         * the next token, until none remain, at which point the method returns
         * an empty string.
         */
-       class sepstream : public classbase
+       class CoreExport sepstream : public classbase
        {
         private:
                /** Original string
@@ -284,7 +262,7 @@ namespace irc
 
        /** A derived form of sepstream, which seperates on commas
         */
-       class commasepstream : public sepstream
+       class CoreExport commasepstream : public sepstream
        {
         public:
                commasepstream(const std::string &source) : sepstream(source, ',')
@@ -294,7 +272,7 @@ namespace irc
 
        /** A derived form of sepstream, which seperates on spaces
         */
-       class spacesepstream : public sepstream
+       class CoreExport spacesepstream : public sepstream
        {
         public:
                spacesepstream(const std::string &source) : sepstream(source, ' ')
@@ -310,7 +288,7 @@ namespace irc
         * start or end < 0) then GetToken() will return the first element
         * of the pair of numbers.
         */
-       class portparser : public classbase
+       class CoreExport portparser : public classbase
        {
         private:
                /** Used to split on commas
@@ -414,7 +392,7 @@ namespace irc
         * };
         * \endcode
         */
-       class dynamicbitmask : public classbase
+       class CoreExport dynamicbitmask : public classbase
        {
         private:
                /** Data bits. We start with four of these,
@@ -503,48 +481,129 @@ namespace irc
 
                /** Compare two strings of size n
                 */
-               static int compare(const char* str1, const char* str2, size_t n);
+               static CoreExport int compare(const char* str1, const char* str2, size_t n);
 
                /** Find a char within a string up to position n
                 */
-               static const char* find(const char* s1, int  n, char c);
+               static CoreExport const char* find(const char* s1, int  n, char c);
        };
 
-       std::string hex(const unsigned char *raw, size_t rawsz);
+       CoreExport std::string hex(const unsigned char *raw, size_t rawsz);
 
        /** This typedef declares irc::string based upon irc_char_traits
         */
        typedef basic_string<char, irc_char_traits, allocator<char> > string;
 
-       const char* Spacify(const char* n);
+       CoreExport const char* Spacify(const char* n);
 }
 
 /* Define operators for using >> and << with irc::string to an ostream on an istream. */
 /* This was endless fun. No. Really. */
 /* It was also the first core change Ommeh made, if anyone cares */
-std::ostream& operator<<(std::ostream &os, const irc::string &str);
-std::istream& operator>>(std::istream &is, irc::string &str);
+inline std::ostream& operator<<(std::ostream &os, const irc::string &str) { return os << str.c_str(); }
+inline std::istream& operator>>(std::istream &is, irc::string &str)
+{
+       std::string tmp;
+       is >> tmp;
+       str = tmp.c_str();
+       return is;
+}
 
 /* Define operators for + and == with irc::string to std::string for easy assignment
  * and comparison - Brain
  */
-std::string operator+ (std::string& leftval, irc::string& rightval);
-irc::string operator+ (irc::string& leftval, std::string& rightval);
-bool operator== (const std::string& leftval, const irc::string& rightval);
-bool operator== (const irc::string& leftval, const std::string& rightval);
+inline std::string operator+ (std::string& leftval, irc::string& rightval)
+{
+       return leftval + std::string(rightval.c_str());
+}
+
+inline irc::string operator+ (irc::string& leftval, std::string& rightval)
+{
+       return leftval + irc::string(rightval.c_str());
+}
+
+inline bool operator== (const std::string& leftval, const irc::string& rightval)
+{
+       return (leftval.c_str() == rightval);
+}
+
+inline bool operator== (const irc::string& leftval, const std::string& rightval)
+{
+       return (leftval == rightval.c_str());
+}
+
+inline std::string assign(const irc::string &other) { return other.c_str(); }
+inline irc::string assign(const std::string &other) { return other.c_str(); }
+inline std::string& trim(std::string &str)
+{
+       std::string::size_type start = str.find_first_not_of(" ");
+       std::string::size_type end = str.find_last_not_of(" ");
+       if (start == std::string::npos || end == std::string::npos)
+               str = "";
+       else
+               str = str.substr(start, end-start+1);
+
+       return str;
+}
 
-std::string assign(const irc::string &other);
-irc::string assign(const std::string &other);
-std::string& trim(std::string &str);
+/* Hashing stuff is totally different on vc++'s hash_map implementation, so to save a buttload of #ifdefs we'll just
+   do it all at once - Burlex */
 
 namespace nspace
 {
        /** Hashing function to hash irc::string
         */
+#ifdef WINDOWS
+       template<> class CoreExport hash_compare<irc::string, std::less<irc::string> >
+       {
+       public:
+               enum { bucket_size = 4, min_buckets = 8 };                      // Got these numbers from the CRT source,
+                                                                                                                       // if anyone wants to change them feel free.
+               bool operator()(const irc::string & s1, const irc::string & s2) const
+               {
+                       if(s1.length() != s2.length()) return true;
+                       return (irc::irc_char_traits::compare(s1.c_str(), s2.c_str(), s1.length()) < 0);
+               }
+               
+               size_t operator()(const irc::string & s) const;
+       };
+
+       template<> class CoreExport hash_compare<std::string, std::less<std::string> >
+       {
+       public:
+               enum { bucket_size = 4, min_buckets = 8 };
+               bool operator()(const std::string & s1, const std::string & s2) const
+               {
+                       if(s1.length() != s2.length()) return true;
+                       return (irc::irc_char_traits::compare(s1.c_str(), s2.c_str(), s1.length()) < 0);
+               }
+               
+               /** Hash a std::string using RFC1459 case sensitivity rules
+               * @param s A string to hash
+               * @return The hash value
+               */
+               size_t operator()(const std::string & s) const;
+       };
+#else
        template<> struct hash<irc::string>
        {
                size_t operator()(const irc::string &s) const;
        };
+
+       template<> struct hash<std::string>
+       {
+               /** Hash a std::string using RFC1459 case sensitivity rules
+               * @param s A string to hash
+               * @return The hash value
+               */
+               size_t operator()(const string &s) const;
+       };
+#endif
+
+       /** Convert a string to lower case respecting RFC1459
+       * @param n A string to lowercase
+       */
+       void strlower(char *n);
 }
 
 #endif
index d81116a1ddf1dafa46b68c05f4e899293d9e440a..fa9b8ed562be5e195ca991ade1d3dd0dfd10b484 100644 (file)
 #ifndef __INSPIRCD_H__
 #define __INSPIRCD_H__
 
+#ifndef WIN32
+#define DllExport 
+#define CoreExport 
+#define printf_c printf
+#else
+#include "inspircd_win32wrapper.h"
+#undef DELETE
+#undef ERROR
+#endif
+
 #include <time.h>
 #include <string>
 #include <sstream>
@@ -216,7 +226,7 @@ class InspIRCd;
  * I/O (linux seems to, as does freebsd) this will default to
  * blocking behaviour.
  */
-class FileLogger : public EventHandler
+class CoreExport FileLogger : public EventHandler
 {
  protected:
        /** The creator/owner of this object
@@ -284,7 +294,7 @@ class XLineManager;
  * program in terms of ram usage (basically, you could create
  * an obese forkbomb built from recursively spawning irc servers!)
  */
-class InspIRCd : public classbase
+class CoreExport InspIRCd : public classbase
 {
  private:
        /** Holds a string describing the last module error to occur
index 03b674b7aa0608cabf6bcd55888dbb2d38011523..03acad4a1ca667fc30067a2a60473ac9681d6556 100644 (file)
@@ -43,7 +43,7 @@ using irc::sockets::insp_aton;
 
 /** Used to time out socket connections
  */
-class SocketTimeout : public InspTimer
+class CoreExport SocketTimeout : public InspTimer
 {
  private:
        InspSocket* sock;
@@ -65,7 +65,7 @@ class SocketTimeout : public InspTimer
  * and use the InspSocket constructors to establish connections
  * and bindings.
  */
-class InspSocket : public EventHandler
+class CoreExport InspSocket : public EventHandler
 {
  public:
 
index 5562b3d77b7fa3101654cf069572c4e0039e8b5b..1e6ba68e666063f0b6be56211170909f155f10a9 100644 (file)
 #define __IN_INSPSTRING_H
 
 #include "inspircd_config.h"
+#include <string.h>
 #include <cstddef>
 
 #ifndef HAS_STRLCPY
-size_t strlcpy(char *dst, const char *src, size_t siz);
-size_t strlcat(char *dst, const char *src, size_t siz);
+CoreExport size_t strlcpy(char *dst, const char *src, size_t siz);
+CoreExport size_t strlcat(char *dst, const char *src, size_t siz);
 #endif
 
-int charlcat(char* x,char y,int z);
-bool charremove(char* mp, char remove);
+CoreExport int charlcat(char* x,char y,int z);
+CoreExport bool charremove(char* mp, char remove);
+inline char * strnewdup(const char * s1)
+{
+       size_t len = strlen(s1) + 1;
+       char * p = new char[len];
+       memcpy(p, s1, len);
+       return p;
+}
 
 #endif
index 2875d853ea72af62c272c7602962b407e8b1d064..8e5c105ceec0c53c068c45f5448aca64ba0e0c26 100644 (file)
@@ -90,7 +90,7 @@ typedef std::pair<bool,std::string> ModePair;
  * mode is expected to have a parameter, then this is
  * equivalent to returning MODEACTION_DENY.
  */
-class ModeHandler : public Extensible
+class CoreExport ModeHandler : public Extensible
 {
  protected:
        InspIRCd* ServerInstance;
@@ -279,7 +279,7 @@ class ModeHandler : public Extensible
  * and attach it to the mode using Server::AddModeWatcher and Server::DelModeWatcher.
  * A ModeWatcher will be called both before and after the mode change.
  */
-class ModeWatcher : public Extensible
+class CoreExport ModeWatcher : public Extensible
 {
  protected:
        InspIRCd* ServerInstance;
@@ -347,7 +347,7 @@ typedef std::vector<ModeWatcher*>::iterator ModeWatchIter;
  * parses client to server MODE strings for user and channel modes, and performs
  * processing for the 004 mode list numeric, amongst other things.
  */
-class ModeParser : public classbase
+class CoreExport ModeParser : public classbase
 {
  private:
        InspIRCd* ServerInstance;
index c873111ad45100ce4b37ec915cd7f664b2d9892e..bba71365dcab416cef800c4bf3f9d7ada682652a 100644 (file)
@@ -187,8 +187,11 @@ typedef std::map<std::string, std::pair<int, modulelist> > interfacelist;
 #define FD_MAGIC_NUMBER -42
 
 // useful macros
-
+#ifdef WINDOWS
+#define IS_LOCAL(x) ((x->GetFd() > -1))
+#else
 #define IS_LOCAL(x) ((x->GetFd() > -1) && (x->GetFd() <= MAX_DESCRIPTORS))
+#endif
 #define IS_REMOTE(x) (x->GetFd() < 0)
 #define IS_MODULE_CREATED(x) (x->GetFd() == FD_MAGIC_NUMBER)
 #define IS_OPER(x) (*x->oper)
@@ -198,7 +201,7 @@ typedef std::map<std::string, std::pair<int, modulelist> > interfacelist;
  *  The four members (set by the constructor only) indicate details as to the version number
  *  of a module. A class of type Version is returned by the GetVersion method of the Module class.
  */
-class Version : public classbase
+class CoreExport Version : public classbase
 {
  public:
         const int Major, Minor, Revision, Build, Flags, API;
@@ -209,7 +212,7 @@ class Version : public classbase
  * This class is used to represent a basic data structure which is passed
  * between modules for safe inter-module communications.
  */
-class ModuleMessage : public Extensible
+class CoreExport ModuleMessage : public Extensible
 {
  public:
        virtual ~ModuleMessage() {};
@@ -220,7 +223,7 @@ class ModuleMessage : public Extensible
  * using the Send() method, which will call the given module's OnRequest
  * method with this class as its parameter.
  */
-class Request : public ModuleMessage
+class CoreExport Request : public ModuleMessage
 {
  protected:
        /** This member holds a pointer to arbitary data set by the emitter of the message
@@ -282,7 +285,7 @@ class Request : public ModuleMessage
  * using the Send() method, which will trigger the OnEvent method in
  * all modules passing the object as its parameter.
  */
-class Event : public ModuleMessage
+class CoreExport Event : public ModuleMessage
 {
  protected:
        /** This member holds a pointer to arbitary data set by the emitter of the message
@@ -324,7 +327,7 @@ class Event : public ModuleMessage
  * be loaded. If this happens, the error message returned by ModuleException::GetReason will be displayed to the user
  * attempting to load the module, or dumped to the console if the ircd is currently loading for the first time.
  */
-class CoreException : public std::exception
+class CoreExport CoreException : public std::exception
 {
  protected:
        /** Holds the error message to be displayed
@@ -361,7 +364,7 @@ class CoreException : public std::exception
        }
 };
 
-class ModuleException : public CoreException
+class CoreExport ModuleException : public CoreException
 {
  public:
        /** Default constructor, just uses the error mesage 'Module threw an exception'.
@@ -403,7 +406,7 @@ enum Implementation {       I_OnUserConnect, I_OnUserQuit, I_OnUserDisconnect, I_OnUse
  *  its methods will be called when irc server events occur. class inherited from module must be
  *  instantiated by the ModuleFactory class (see relevent section) for the module to be initialised.
  */
-class Module : public Extensible
+class CoreExport Module : public Extensible
 {
  protected:
        InspIRCd* ServerInstance;
@@ -1389,7 +1392,7 @@ class Module : public Extensible
  * Constructing the class using one parameter allows you to specify a path to your own configuration
  * file, otherwise, inspircd.conf is read.
  */
-class ConfigReader : public classbase
+class CoreExport ConfigReader : public classbase
 {
   protected:
        InspIRCd* ServerInstance;
@@ -1506,7 +1509,7 @@ class ConfigReader : public classbase
  * Either use the constructor type with one parameter to load a file into memory
  * at construction, or use the LoadFile method to load a file.
  */
-class FileReader : public classbase
+class CoreExport FileReader : public classbase
 {
        InspIRCd* ServerInstance;
        /** The file contents
@@ -1577,7 +1580,7 @@ class FileReader : public classbase
  * In most cases, the simple class shown in the example module m_foobar.so will suffice for most
  * modules.
  */
-class ModuleFactory : public classbase
+class CoreExport ModuleFactory : public classbase
 {
  public:
        /** The default constructor does nothing.
index 6763095411bbf0d396f2980fc775dc246d1a820b..db8be55f88cf7babb10368c2e3acd01144b620fd 100644 (file)
@@ -28,7 +28,7 @@ typedef std::map<char, std::string> SnoList;
  * Modules and the core can enable and disable snomask characters. If they do,
  * then sending snomasks using these characters becomes possible.
  */
-class SnomaskManager : public Extensible
+class CoreExport SnomaskManager : public Extensible
 {
  private:
        /** Creator/owner
index 88478f2e3dcf3d1d9d7ebda704d814f5a405d41e..de0b0510bf67d8998f715c3e41de92b230b691b7 100644 (file)
@@ -14,6 +14,8 @@
 #ifndef INSPIRCD_SOCKET_H
 #define INSPIRCD_SOCKET_H
 
+#ifndef WIN32
+
 #include <arpa/inet.h>
 #include <sys/time.h>
 #include <sys/resource.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <netdb.h>
+
+#else
+
+#include "inspircd_win32wrapper.h"
+
+#endif
+
 #include <errno.h>
 #include "inspircd_config.h"
 #include "socketengine.h"
 
+/* Accept Define */
+#ifdef CONFIG_USE_IOCP
+#define _accept(s, addr, addrlen) __accept_socket(s, addr, addrlen, m_acceptEvent)
+#define _getsockname(fd, sockptr, socklen) __getsockname(fd, sockptr, socklen, m_acceptEvent)
+#else
+#define _accept accept
+#define _getsockname getsockname
+#endif
+
 namespace irc
 {
        /** This namespace contains various protocol-independent helper classes.
@@ -72,7 +90,7 @@ namespace irc
                 * @returns True if the first mask_bits of address matches the first
                 * mask_bits of mask.
                 */
-               bool MatchCIDRBits(unsigned char* address, unsigned char* mask, unsigned int mask_bits);
+               CoreExport bool MatchCIDRBits(unsigned char* address, unsigned char* mask, unsigned int mask_bits);
 
                /** Match CIDR, without matching username/nickname parts.
                 *
@@ -83,7 +101,7 @@ namespace irc
                 * @param cidr_mask The human readable mask, e.g. 1.2.0.0/16
                 * @return True if the mask matches the address
                 */
-               bool MatchCIDR(const char* address, const char* cidr_mask);
+               CoreExport bool MatchCIDR(const char* address, const char* cidr_mask);
 
                /** Match CIDR, including an optional username/nickname part.
                 *
@@ -96,7 +114,7 @@ namespace irc
                 * @param cidr_mask The human readable mask, e.g. *\@1.2.0.0/16
                 * @return True if the mask matches the address
                 */
-               bool MatchCIDR(const char* address, const char* cidr_mask, bool match_with_username);
+               CoreExport bool MatchCIDR(const char* address, const char* cidr_mask, bool match_with_username);
 
                /** Convert an insp_inaddr into human readable form.
                 * 
@@ -104,7 +122,7 @@ namespace irc
                 * @return A human-readable address. IPV6 addresses
                 * will be shortened to remove fields which are 0.
                 */
-               const char* insp_ntoa(insp_inaddr n);
+               CoreExport const char* insp_ntoa(insp_inaddr n);
 
                /** Convert a human-readable address into an insp_inaddr.
                 * 
@@ -119,24 +137,24 @@ namespace irc
 
                 * or any other number upon failure.
                 */
-               int insp_aton(const char* a, insp_inaddr* n);
+               CoreExport int insp_aton(const char* a, insp_inaddr* n);
 
                /** Make a socket file descriptor a blocking socket
                 * @param s A valid file descriptor
                 */
-               void Blocking(int s);
+               CoreExport void Blocking(int s);
 
                /** Make a socket file descriptor into a nonblocking socket
                 * @param s A valid file descriptor
                 */
-               void NonBlocking(int s);
+               CoreExport void NonBlocking(int s);
 
                /** Create a new valid file descriptor using socket()
                 * @return On return this function will return a value >= 0 for success,
                 * or a negative value upon failure (negative values are invalid file
                 * descriptors)
                 */
-               int OpenTCPSocket(char* addr, int socktype = SOCK_STREAM);
+               CoreExport int OpenTCPSocket(char* addr, int socktype = SOCK_STREAM);
        };
 };
 
@@ -144,7 +162,7 @@ namespace irc
  * It will create a new userrec for every valid connection
  * and assign it a file descriptor.
  */
-class ListenSocket : public EventHandler
+class CoreExport ListenSocket : public EventHandler
 {
  protected:
        /** The creator/owner of this object
index 729f5e0909a8fb66275857bb28cd5bd1c8f8fb57..0ff6e89eda5dd20c96d51ed96df600ad81097bea 100644 (file)
@@ -54,7 +54,7 @@ class InspIRCd;
  * must have a file descriptor. What this file descriptor
  * is actually attached to is completely up to you.
  */
-class EventHandler : public Extensible
+class CoreExport EventHandler : public Extensible
 {
  protected:
        /** File descriptor.
@@ -129,6 +129,21 @@ class EventHandler : public Extensible
         * and EVENT_WRITE for write events.
         */
        virtual void HandleEvent(EventType et, int errornum = 0) = 0;
+
+#ifdef WINDOWS
+
+       /** "Fake" file descriptor. This is windows-specific.
+        */
+       int m_internalFd;
+
+       /** Pointer to read event. We delete this so the buffer can't be used
+        * after the socket is deleted, and so it doesn't leak memory
+        */
+       void * m_readEvent;
+       void * m_writeEvent;
+       void * m_acceptEvent;
+
+#endif
 };
 
 /** Provides basic file-descriptor-based I/O support.
@@ -149,7 +164,7 @@ class EventHandler : public Extensible
  * have to be aware of which SocketEngine derived
  * class they are using.
  */
-class SocketEngine : public Extensible
+class CoreExport SocketEngine : public Extensible
 {
 protected:
        /** Owner/Creator
@@ -242,14 +257,14 @@ public:
         * @param fd The event handler to look for
         * @return True if this fd has an event handler
         */
-       bool HasFd(int fd);
+       virtual bool HasFd(int fd);
 
        /** Returns the EventHandler attached to a specific fd.
         * If the fd isnt in the socketengine, returns NULL.
         * @param fd The event handler to look for
         * @return A pointer to the event handler, or NULL
         */
-       EventHandler* GetRef(int fd);
+       virtual EventHandler* GetRef(int fd);
 
        /** Waits for events and dispatches them to handlers.
         * Please note that this doesnt wait long, only
index 46ad5f439ccf3591466b6bfa9326bf6976801ded..3fb2ed32b9e56937fe76b448f0a7e96703f5f68b 100644 (file)
@@ -26,7 +26,7 @@ class InspIRCd;
  * your object (which you should override) will be called
  * at the given time.
  */
-class InspTimer : public Extensible
+class CoreExport InspTimer : public Extensible
 {
  private:
        /** The triggering time
@@ -104,7 +104,7 @@ class InspTimer : public Extensible
  * This will ensure timers are not missed, as well as removing timers that have
  * expired and allowing the addition of new ones.
  */
-class TimerManager : public Extensible
+class CoreExport TimerManager : public Extensible
 {
  protected:
        /** A group of timers all set to trigger at the same time
index 840c840cfba6e23b77f896f92dc13409aebd421a..d59c6ad7f02aac7a54575bcf72f208bfefafc4e9 100644 (file)
 #include "modules.h"
 #include "globals.h"
 
+#ifndef WIN32
 typedef nspace::hash_map<std::string, userrec*, nspace::hash<string>, irc::StrHashComp> user_hash;
 typedef nspace::hash_map<std::string, chanrec*, nspace::hash<string>, irc::StrHashComp> chan_hash;
+#else
+typedef nspace::hash_map<std::string, userrec*, nspace::hash_compare<string, less<string> > > user_hash;
+typedef nspace::hash_map<std::string, chanrec*, nspace::hash_compare<string, less<string> > > chan_hash;
+#endif
 
-typedef std::vector<std::string> servernamelist;
+typedef std::vector<std::string*> servernamelist;
 typedef std::deque<std::string> file_cache;
 
 #endif
index e12079315270ba14019fd855bbb342d709b0c83e..e76c886762662739ce6d11e8cdae45fceb229c0c 100644 (file)
@@ -46,7 +46,11 @@ enum UserModes {
 };
 
 enum RegistrationState {
+
+#ifndef WIN32   // Burlex: This is already defined in win32, luckily it is still 0.
        REG_NONE = 0,           /* Has sent nothing */
+#endif
+
        REG_USER = 1,           /* Has sent USER */
        REG_NICK = 2,           /* Has sent NICK */
        REG_NICKUSER = 3,       /* Bitwise combination of REG_NICK and REG_USER */
@@ -57,7 +61,7 @@ class InspIRCd;
 
 /** Derived from Resolver, and performs user forward/reverse lookups.
  */
-class UserResolver : public Resolver
+class CoreExport UserResolver : public Resolver
 {
  private:
        /** User this class is 'attached' to.
@@ -75,7 +79,7 @@ class UserResolver : public Resolver
 
 /** Holds information relevent to &lt;connect allow&gt; and &lt;connect deny&gt; tags in the config file.
  */
-class ConnectClass : public classbase
+class CoreExport ConnectClass : public classbase
 {
  private:
        /** Type of line, either CC_ALLOW or CC_DENY
@@ -249,7 +253,7 @@ typedef UserChanList::iterator UCListIter;
 
 class userrec;
 
-class VisData
+class CoreExport VisData
 {
  public:
        VisData();
@@ -264,7 +268,7 @@ class VisData
  * by nickname, or the FindDescriptor method of the InspIRCd class to find a specific user by their
  * file descriptor value.
  */
-class userrec : public connection
+class CoreExport userrec : public connection
 {
  private:
        /** Pointer to creator.
index 90660c6eff0952acdbb4cf3b2aa2720e6682440a..196350134a55c4c5730dc4fc6b0327c3c42b1542 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "inspircd_config.h"
 
-bool match(const char *str, const char *mask);
-bool match(const char *str, const char *mask, bool use_cidr_match);
-bool match(bool case_sensitive, const char *str, const char *mask);
-bool match(bool case_sensitive, const char *str, const char *mask, bool use_cidr_match);
+CoreExport bool match(const char *str, const char *mask);
+CoreExport bool match(const char *str, const char *mask, bool use_cidr_match);
+CoreExport bool match(bool case_sensitive, const char *str, const char *mask);
+CoreExport bool match(bool case_sensitive, const char *str, const char *mask, bool use_cidr_match);
index 0aa831670582eba64814083a5fe5047bcb96a940..0b4ef6e127263b872ec632f222caf9874666f53b 100644 (file)
@@ -31,7 +31,7 @@ const int APPLY_ALL           = APPLY_GLINES | APPLY_KLINES | APPLY_QLINES | APPLY_ZLINES
 
 /** XLine is the base class for ban lines such as G lines and K lines.
  */
-class XLine : public classbase
+class CoreExport XLine : public classbase
 {
   public:
 
@@ -71,7 +71,7 @@ class XLine : public classbase
 
 /** KLine class
  */
-class KLine : public XLine
+class CoreExport KLine : public XLine
 {
   public:
        /** Hostmask (ident@host) to match against
@@ -95,7 +95,7 @@ class KLine : public XLine
 
 /** GLine class
  */
-class GLine : public XLine
+class CoreExport GLine : public XLine
 {
   public:
        /** Hostmask (ident@host) to match against
@@ -119,7 +119,7 @@ class GLine : public XLine
 
 /** ELine class
  */
-class ELine : public XLine
+class CoreExport ELine : public XLine
 {
   public:
         /** Hostmask (ident@host) to match against
@@ -143,7 +143,7 @@ class ELine : public XLine
 
 /** ZLine class
  */
-class ZLine : public XLine
+class CoreExport ZLine : public XLine
 {
   public:
        /** IP Address (xx.yy.zz.aa) to match against
@@ -164,7 +164,7 @@ class ZLine : public XLine
 
 /** QLine class
  */
-class QLine : public XLine
+class CoreExport QLine : public XLine
 {
   public:
        /** Nickname to match against.
@@ -202,7 +202,7 @@ typedef std::pair<std::string, std::string> IdentHostPair;
 
 /** XLineManager is a class used to manage glines, klines, elines, zlines and qlines.
  */
-class XLineManager
+class CoreExport XLineManager
 {
  protected:
        /** The owner/creator of this class
index 24f91ed5305092d2f6c7661cd9711e25ac82d4f3..bbd4e02872e1f518591e25cdae828faa581bbf43 100644 (file)
@@ -16,7 +16,7 @@
 #include "commands/cmd_admin.h"
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_admin(Instance);
 }
index 7a780c5a5867c940aed9553c93e23f5950ae60d3..874881119cf776e6353938de7f38a888a2d5613d 100644 (file)
@@ -16,7 +16,7 @@
 #include "modules.h"
 #include "commands/cmd_away.h"
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_away(Instance);
 }
index df1bd53427f5a4d8a316eed9ce61b2c5efa51c80..eecf3267f66609319c4ed83c3ea6e56f82c58e22 100644 (file)
@@ -15,7 +15,7 @@
 #include "users.h"
 #include "commands/cmd_clearcache.h"
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_clearcache(Instance);
 }
index 848070e40593134c31bdd0f8ca71abd404f2f8f0..fc95de5f1b24be420f18b333eddc731eac32b910 100644 (file)
@@ -17,7 +17,7 @@
 
 /** Handle /COMMANDS
  */
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_commands(Instance);
 }
index ac62b0bd13ec388776712d54f4820d4a47691341..1a04e77131150608f9ba43949e8f25855d99dff6 100644 (file)
@@ -18,7 +18,7 @@
  * This is handled by the server linking module, if necessary. Do not remove this stub.
  */
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_connect(Instance);
 }
index 95df4ab5657b370be8ad6e6c694f6f524dd5c0c3..12311480da7995aa9ccb0b083e82157bca7f3a90 100644 (file)
@@ -16,7 +16,7 @@
 #include "commands/cmd_die.h"
 #include "exitcodes.h"
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_die(Instance);
 }
index ed7525e05a5c3419d9bfc548a0970cb030a3b6d9..f7031a108c0e4f2fa3517416fe0c0d81988fc89c 100644 (file)
@@ -17,7 +17,7 @@
 #include "xline.h"
 #include "commands/cmd_eline.h"
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_eline(Instance);
 }
index 98f088c8ba61de4e2720704a5d1d225897abd5f5..a171fca854d73e8f9a73cf9a81bbb45887be903f 100644 (file)
@@ -17,7 +17,7 @@
 #include "xline.h"
 #include "commands/cmd_gline.h"
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_gline(Instance);
 }
index 16030df7c249570e20b11120c906ccac1bdbe982..4b359607c69ed10359f4776160dfbc3e554a8800 100644 (file)
@@ -16,7 +16,7 @@
 #include "modules.h"
 #include "commands/cmd_info.h"
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_info(Instance);
 }
@@ -41,7 +41,7 @@ CmdResult cmd_info::Handle (const char** parameters, int pcnt, userrec *user)
        user->WriteServ( "371 %s :        typobox43   Jazza", user->nick);
        user->WriteServ( "371 %s :        jamie       LeaChim", user->nick);
        user->WriteServ( "371 %s :        satmd       nenolod", user->nick);
-       user->WriteServ( "371 %s :        HiroP", user->nick);
+       user->WriteServ( "371 %s :        HiroP       Burlex", user->nick);
        user->WriteServ( "371 %s : ", user->nick);
        user->WriteServ( "371 %s :\2Quality Assurance\2:", user->nick);
        user->WriteServ( "371 %s :        Bricker     owine", user->nick);
index 21f9e91cc16cc0dbb4944ded25a2aa41b7ff074d..c9d4b2d8a2bd13b2e78be461b5e1b3d2a4b2eb67 100644 (file)
@@ -16,7 +16,7 @@
 #include "modules.h"
 #include "commands/cmd_invite.h"
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_invite(Instance);
 }
index fde8666ff156a96b710115bd5805ab1fd3ba3f32..5ab03ba27944fb3ed889c46a7fedd857815d5080 100644 (file)
@@ -15,7 +15,7 @@
 #include "inspircd.h"
 #include "commands/cmd_ison.h"
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_ison(Instance);
 }
index 8c24c7bcb1dad066e031073187f33b7c69e094cc..218e0f7b8b33229c28f675d35b9648fb90521369 100644 (file)
@@ -15,7 +15,7 @@
 #include "users.h"
 #include "commands/cmd_join.h"
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_join(Instance);
 }
index c11d934f9d7ab6bf8deb41e90ef7cb9626efc499..27552f66c8a03f7031603a6061b23dfd1360fc2a 100644 (file)
@@ -15,7 +15,7 @@
 #include "inspircd.h"
 #include "commands/cmd_kick.h"
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_kick(Instance);
 }
index 00d584ddf0089ca016df4b4697618e30899d1787..82ca9744053889fa33aa85374ad7769a7d1153d3 100644 (file)
@@ -18,7 +18,7 @@
 #include "wildcard.h"
 #include "commands/cmd_kill.h"
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_kill(Instance);
 }
index e7ec7b61791be510aa6777d93e2fd238fd65e8cb..670cb29501dda14c871df03315815aa897489846 100644 (file)
@@ -17,7 +17,7 @@
 #include "xline.h"
 #include "commands/cmd_kline.h"
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_kline(Instance);
 }
index 81a6b0b021e71c3ddf670d61f93b9cefbc16bdc4..1fe1bdcc0a0633d29fcde09307d0dc2bcefb7179 100644 (file)
@@ -16,7 +16,7 @@
 #include "modules.h"
 #include "commands/cmd_links.h"
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_links(Instance);
 }
index 78e586aabe896ec2c7dedb4b01e9ce6e392ea134..d89def24f2faaf7193cca5a0e63d412fd5e5c431 100644 (file)
@@ -18,7 +18,7 @@
 
 /** Handle /LIST
  */
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_list(Instance);
 }
index 2462cf463ea1a32d3a023437d8efc701e4c2cc29..08179d120bab506b2d9dc828270ae058c5fce379 100644 (file)
@@ -15,7 +15,7 @@
 #include "users.h"
 #include "commands/cmd_loadmodule.h"
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_loadmodule(Instance);
 }
index 8a1d64c0fe93c8f55cdf3c277ed3542cf6176b41..c2ad9de49d6e86a10ab8d9a1ee94d271e1b6a8de 100644 (file)
@@ -15,7 +15,7 @@
 #include "inspircd.h"
 #include "commands/cmd_lusers.h"
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_lusers(Instance);
 }
index 83ff89d6d8630a66b85caaa81feff33059240644..0b7132c8f755234d63856c65bd60b8c2519f644c 100644 (file)
@@ -15,7 +15,7 @@
 #include "users.h"
 #include "commands/cmd_map.h"
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_map(Instance);
 }
index 31309549c389f8a984e34646e26b5dfbbaead807..f48b81e3e4ed0e71718451e2cc3973134f15954d 100644 (file)
@@ -15,7 +15,7 @@
 #include "users.h"
 #include "commands/cmd_mode.h"
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_mode(Instance);
 }
index 916f480fd8e6777d3c429c177de0321c0b5c1c0b..be236fcd92dec16ffbb6b6a6e315befe829339d1 100644 (file)
@@ -34,7 +34,7 @@ char* itab[] = {
        "OnPostCommand", "OnPostJoin", "OnWhoisLine", "OnBuildExemptList", "OnRawSocketConnect", "OnGarbageCollect", NULL
 };
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_modules(Instance);
 }
index 48edaec5e2c4a067dc75583d8c0da86e153b472d..0691e1abac58a8e0908705005630352de67e6bd9 100644 (file)
@@ -14,7 +14,7 @@
 #include "users.h"
 #include "commands/cmd_motd.h"
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_motd(Instance);
 }
index b07e43f3f2ba165af109ca9f40fdef916ec68d20..fe61c4dea3f6c61aba99004adac1323e7b7ce4e9 100644 (file)
@@ -15,7 +15,7 @@
 #include "users.h"
 #include "commands/cmd_names.h"
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_names(Instance);
 }
index 05a66cbfc5a0b86f372b2744f84d0887de3abf46..55ad50ec68d025358263ddeabbb5a0e76905c015 100644 (file)
@@ -18,7 +18,7 @@
 #include "xline.h"
 #include "commands/cmd_nick.h"
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_nick(Instance);
 }
index d2834d2ff1cc149b6b18077b018ebf34961629d5..0f084ffc31afb72bf8ce90152dad41d0bed32039 100644 (file)
@@ -19,7 +19,7 @@
 
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_notice(Instance);
 }
index 59b35deba024e8081876df8d978bd117b6b55559..8e3520d6ca81e36c0b8b6efeb67aeb67f2ef5db0 100644 (file)
@@ -33,7 +33,7 @@ bool OneOfMatches(const char* host, const char* ip, const char* hostlist)
        return false;
 }
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_oper(Instance);
 }
index 9741cd4fce97376f0bf2121eb66cd7df2803d4d3..7152a3c176dbef6ebc95b12965f1468b871d6983 100644 (file)
@@ -17,7 +17,7 @@
 
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_part(Instance);
 }
index 05f9114e092993b8f2bc0f0161e0343d7ee8dda2..22cea2c0f01d0889c6cebe0fbb81a08da2381f27 100644 (file)
@@ -16,7 +16,7 @@
 
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_pass(Instance);
 }
index 1f6e2bdfa9762cea728da944b95dd6e69a3fe608..cb09f68be1bda84c91606e1f3d7fb9c84f6a7e5e 100644 (file)
@@ -17,7 +17,7 @@
 
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_ping(Instance);
 }
index bd75d1c184645908c1f144dec04a7012516652f1..fee5f1d48fb1a96961a7c617ac4dd9ff3f786ae7 100644 (file)
@@ -16,7 +16,7 @@
 
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_pong(Instance);
 }
index 6eedf52765f3c80551f100008fee421e9399dce3..a99f8a594cfe4224a255f2a1f02fa52897f022ff 100644 (file)
@@ -20,7 +20,7 @@
 
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport  command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_privmsg(Instance);
 }
index fdb714b975dcbe32b79486919c2a7c34d135c79b..2fea4cbd6319cf0b3ec680cea50dd9930cbe85fc 100644 (file)
@@ -19,7 +19,7 @@
 
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_qline(Instance);
 }
index 5e2c023b76a8e0cb9c81930c9feb964b483b392b..a859c179017d6b0b4e8ecfd98ad9f66b7624ab2b 100644 (file)
@@ -19,7 +19,7 @@
 
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_quit(Instance);
 }
index 4d4b97c8ed245299d2a05a8b3656dfbb76128aa7..8298aa020b82d9b1132088d000c187d124a712b0 100644 (file)
@@ -18,7 +18,7 @@
 
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_rehash(Instance);
 }
index 067dee4a2ce3d8ba3919e0f24dc93424dbbfbd9b..41da0c40d9b95aca82af4f461b50fdc5c42d70d0 100644 (file)
@@ -15,7 +15,7 @@
 #include "users.h"
 #include "commands/cmd_reloadmodule.h"
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_reloadmodule(Instance);
 }
index 106531e792b98d98b9574c5632b615fdc12c84d5..80ad4918449610f4dc2951bdc572a2fc351133f2 100644 (file)
@@ -17,7 +17,7 @@
 
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_restart(Instance);
 }
index 60a5bf0a8c67f35f46eee6655fc889b1548a5914..2a45a728b9a7cf5265c4cb0a2ee4dccbd834d316 100644 (file)
@@ -16,7 +16,7 @@
 
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_rules(Instance);
 }
index acc68a605b09ea3309620484745a18bdf14451cb..4c644861af01af5c30844018e486c5002d3121ce 100644 (file)
@@ -17,7 +17,7 @@
 
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_server(Instance);
 }
index f2c9c01ef93477ef709911c2810262da03d837f5..3ddb601613bd6949628f92a7ed53352bb328af2f 100644 (file)
@@ -19,7 +19,7 @@
  */
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_squit(Instance);
 }
index 24fa7e7ec04e5d9ea2d26f756c562b7165bfd831..55b7e68eb56c536bca55efed396eef1c7d597d77 100644 (file)
@@ -13,7 +13,9 @@
 
 #include "inspircd.h"
 #include "configreader.h"
+#ifndef WIN32
 #include <sys/resource.h>
+#endif
 #include "users.h"
 #include "modules.h"
 #include "xline.h"
@@ -21,7 +23,7 @@
 #include "commands/cmd_whowas.h"
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_stats(Instance);
 }
@@ -39,7 +41,7 @@ CmdResult cmd_stats::Handle (const char** parameters, int pcnt, userrec *user)
        return CMD_SUCCESS;
 }
 
-void DoStats(InspIRCd* ServerInstance, char statschar, userrec* user, string_list &results)
+DllExport void DoStats(InspIRCd* ServerInstance, char statschar, userrec* user, string_list &results)
 {
        std::string sn = ServerInstance->Config->ServerName;
 
@@ -171,12 +173,18 @@ void DoStats(InspIRCd* ServerInstance, char statschar, userrec* user, string_lis
                /* stats z (debug and memory info) */
                case 'z':
                {
-                       rusage R;
+#ifndef WIN32
+            rusage R;
                        results.push_back(sn+" 240 "+user->nick+" :InspIRCd(CLASS) "+ConvToStr(sizeof(InspIRCd))+" bytes");
                        results.push_back(sn+" 249 "+user->nick+" :Users(HASH_MAP) "+ConvToStr(ServerInstance->clientlist->size())+" ("+ConvToStr(ServerInstance->clientlist->size()*sizeof(userrec))+" bytes, "+ConvToStr(ServerInstance->clientlist->bucket_count())+" buckets)");
                        results.push_back(sn+" 249 "+user->nick+" :Channels(HASH_MAP) "+ConvToStr(ServerInstance->chanlist->size())+" ("+ConvToStr(ServerInstance->chanlist->size()*sizeof(chanrec))+" bytes, "+ConvToStr(ServerInstance->chanlist->bucket_count())+" buckets)");
                        results.push_back(sn+" 249 "+user->nick+" :Commands(VECTOR) "+ConvToStr(ServerInstance->Parser->cmdlist.size())+" ("+ConvToStr(ServerInstance->Parser->cmdlist.size()*sizeof(command_t))+" bytes)");
-
+#else
+            results.push_back(sn+" 240 "+user->nick+" :InspIRCd(CLASS) "+ConvToStr(sizeof(InspIRCd))+" bytes");
+            results.push_back(sn+" 249 "+user->nick+" :Users(HASH_MAP) "+ConvToStr(ServerInstance->clientlist->size())+" ("+ConvToStr(ServerInstance->clientlist->size()*sizeof(userrec))+" bytes)");
+            results.push_back(sn+" 249 "+user->nick+" :Channels(HASH_MAP) "+ConvToStr(ServerInstance->chanlist->size())+" ("+ConvToStr(ServerInstance->chanlist->size()*sizeof(chanrec))+" bytes)");
+            results.push_back(sn+" 249 "+user->nick+" :Commands(VECTOR) "+ConvToStr(ServerInstance->Parser->cmdlist.size())+" ("+ConvToStr(ServerInstance->Parser->cmdlist.size()*sizeof(command_t))+" bytes)");
+#endif
                        if (!ServerInstance->Config->WhoWasGroupSize == 0 && !ServerInstance->Config->WhoWasMaxGroups == 0)
                        {
                                command_t* whowas_command = ServerInstance->Parser->GetHandler("WHOWAS");
@@ -199,7 +207,8 @@ void DoStats(InspIRCd* ServerInstance, char statschar, userrec* user, string_lis
                        results.push_back(sn+" 249 "+user->nick+" :Modules(VECTOR) "+ConvToStr(ServerInstance->modules.size())+" ("+ConvToStr(ServerInstance->modules.size()*sizeof(Module))+" bytes)");
                        results.push_back(sn+" 249 "+user->nick+" :ClassFactories(VECTOR) "+ConvToStr(ServerInstance->factory.size())+" ("+ConvToStr(ServerInstance->factory.size()*sizeof(ircd_module))+" bytes)");
 
-                       if (!getrusage(0,&R))   /* RUSAGE_SELF */
+#ifndef WIN32
+            if (!getrusage(0,&R))      /* RUSAGE_SELF */
                        {
                                results.push_back(sn+" 249 "+user->nick+" :Total allocation: "+ConvToStr(R.ru_maxrss)+"K");
                                results.push_back(sn+" 249 "+user->nick+" :Signals:          "+ConvToStr(R.ru_nsignals));
@@ -218,6 +227,7 @@ void DoStats(InspIRCd* ServerInstance, char statschar, userrec* user, string_lis
                                snprintf(percent, 30, "%03.5f%%", per);
                                results.push_back(sn+" 249 "+user->nick+" :CPU Usage: "+percent);
                        }
+#endif
                }
                break;
        
index 840f6dd02fa0eaab019730a430bb8e6435aa5722..a136bcc15be98ed579cd2ca39c48b38ddfa899da 100644 (file)
@@ -16,7 +16,7 @@
 
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_summon(Instance);
 }
index 535bf48a5b434700ed278b17899c9c29ad1e0003..ca636934555ff56fa3a6c77781f1c1f26e9f192c 100644 (file)
@@ -17,7 +17,7 @@
 
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_time(Instance);
 }
index dfd03a65183884f9db9a9a1ba8e846053a5cf7a2..06036fe010cf0d298356f90c7d8809e65007555e 100644 (file)
 #include "users.h"
 #include "modules.h"
 #include "commands/cmd_topic.h"
+#include "inspircd.h"
 
 
-
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_topic(Instance);
 }
index 1582385793f63d7ea40c95ebfb646c39a8775507..a80a19b0420921a2096f7e3e398f724e25b7865d 100644 (file)
@@ -17,7 +17,7 @@
 
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_trace(Instance);
 }
index 715ff4fcbbc80d5128cb3237aff8255efd60bc1c..44c2133e7005ebc2e817ce5a3cb5767e1026c2d5 100644 (file)
@@ -17,7 +17,7 @@
 
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_unloadmodule(Instance);
 }
index c0195f56e03bf2db9a8119237ebc2c5316ae03ca..386d0e5e8904502d0fb485170b1cf23916e34656 100644 (file)
@@ -17,7 +17,7 @@
 
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_user(Instance);
 }
index 6f31ad6a7d1edfb57e62bdf6f828177126f4a64c..b05bfd6f6eada9ec1fbb57665eb2f207050ff054 100644 (file)
@@ -17,7 +17,7 @@
 
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_userhost(Instance);
 }
index d9382d0667114d5dc8616b401a61bb92390ac4d9..e49abccb240d0e8765b19c35532bb9f3c4e2f99a 100644 (file)
@@ -16,7 +16,7 @@
 
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_users(Instance);
 }
index c6b156652e3b47bac2b1ff23cfd64c48d681d51f..599b7bf75aaf6f2ab777561e941bebf7dd70d5d9 100644 (file)
@@ -18,7 +18,7 @@
 
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_version(Instance);
 }
index 909dfb2ba324407959227a3fff3ef3934f912a18..7c1c25f55c663c83dd4d582582ae9aacc523fde2 100644 (file)
@@ -17,7 +17,7 @@
 
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_wallops(Instance);
 }
index de504faf253d12a6a92144ca71732751d64c059e..028ce3121451cc66ddd7292562d5a536937fa9b3 100644 (file)
@@ -110,7 +110,7 @@ bool cmd_who::whomatch(userrec* user, const char* matchtext)
 
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_who(Instance);
 }
index a634e5967cbceead16490630bb7ce67ad7d6988f..897ec60ac262d313a9b09591538a078c094e0a58 100644 (file)
@@ -89,7 +89,7 @@ void do_whois(InspIRCd* ServerInstance, userrec* user, userrec* dest,unsigned lo
 
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_whois(Instance);
 }
index 4886c9800e8127e6133b4c555b9d0b5b6ca40ff9..4bf6df8ca4416d76d294fb531402468e3ef61418 100644 (file)
@@ -15,7 +15,9 @@
 #include "users.h"
 #include "commands/cmd_whowas.h"
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+WhoWasMaintainTimer * timer;
+
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_whowas(Instance);
 }
@@ -24,7 +26,7 @@ cmd_whowas::cmd_whowas(InspIRCd* Instance)
 : command_t(Instance, "WHOWAS", 0, 1)
 {
        syntax = "<nick>{,<nick>}";
-       timer = new MaintainTimer(Instance, 3600);
+       timer = new WhoWasMaintainTimer(Instance, 3600);
        Instance->Timers->AddTimer(timer);
 }
 
@@ -326,7 +328,7 @@ WhoWasGroup::~WhoWasGroup()
 }
 
 /* every hour, run this function which removes all entries older than Config->WhoWasMaxKeep */
-void MaintainTimer::Tick(time_t t)
+void WhoWasMaintainTimer::Tick(time_t t)
 {
        command_t* whowas_command = ServerInstance->Parser->GetHandler("WHOWAS");
        if (whowas_command)
index 70ca81664a67a2972f4e743226e68fa477230104..1f8076a77485142d9356913d208002ab39294e75 100644 (file)
@@ -20,7 +20,7 @@
 
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_zline(Instance);
 }
index 444e6f78b232ca29ef7b73934d9f00c074a0c8dd..be94c09952822447b10f47f49c003b439c143012 100644 (file)
@@ -14,8 +14,6 @@
 #include "inspircd.h"
 #include "configreader.h"
 #include <algorithm>
-#include <dirent.h>
-#include <dlfcn.h>
 #include "users.h"
 #include "modules.h"
 #include "wildcard.h"
 #include "socket.h"
 #include "command_parse.h"
 
+/* Directory Searching for Unix-Only */
+#ifndef WIN32
+#include <dirent.h>
+#include <dlfcn.h>
+#endif
+
 bool InspIRCd::ULine(const char* server)
 {
        if (!server)
index 6e728c31117a0db2ef1796a4b47a759d6424afdd..392c7eb297a68b156c6f0d02b642800eb29c93fc 100644 (file)
@@ -1538,6 +1538,10 @@ char* ServerConfig::CleanFilename(char* name)
 
 bool ServerConfig::DirValid(const char* dirandfile)
 {
+#ifdef WINDOWS
+       return true;
+#endif
+
        char work[1024];
        char buffer[1024];
        char otherdir[1024];
@@ -1576,7 +1580,6 @@ bool ServerConfig::DirValid(const char* dirandfile)
        if (strlen(otherdir) >= t)
        {
                otherdir[t] = '\0';
-
                if (!strcmp(otherdir,work))
                {
                        return true;
index c04ab4cc174e3de42164f76adbd674d3d5fbe054..df79eba24096b1e255512ccddfb874d4237bd176 100644 (file)
@@ -21,11 +21,16 @@ Please do not assume that firedns works like this,
 looks like this, walks like this or tastes like this.
 */
 
+#ifndef WIN32
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <errno.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
+#else
+#include "inspircd_win32wrapper.h"
+#endif
+
 #include "dns.h"
 #include "inspircd.h"
 #include "socketengine.h"
@@ -238,7 +243,7 @@ int DNSRequest::SendRequests(const DNSHeader *header, const int length, QueryTyp
        memcpy(&addr.sin_addr.s_addr, &dnsobj->myserver4, sizeof(addr.sin_addr));
        addr.sin_family = AF_INET;
        addr.sin_port = htons(DNS::QUERY_PORT);
-       if (sendto(dnsobj->GetFd(), payload, length + 12, 0, (sockaddr *) &addr, sizeof(addr)) != length+12)
+       if (sendto(dnsobj->GetFd(), (const char*)payload, length + 12, 0, (sockaddr *) &addr, sizeof(addr)) != length+12)
                return -1;
 #endif
 
@@ -619,7 +624,7 @@ DNSResult DNS::GetResult()
        const char* ipaddr_from;
        unsigned short int port_from = 0;
 
-       int length = recvfrom(this->GetFd(),buffer,sizeof(DNSHeader),0,from,&x);
+       int length = recvfrom(this->GetFd(),(char*)buffer,sizeof(DNSHeader),0,from,&x);
 
        /* Did we get the whole header? */
        if (length < 12)
@@ -1146,6 +1151,7 @@ void DNS::CleanResolvers(Module* module)
 /** Generate pseudo-random number */
 unsigned long DNS::PRNG()
 {
+#ifndef WIN32
        unsigned long val = 0;
        timeval n;
        serverstats* s = ServerInstance->stats;
@@ -1154,5 +1160,13 @@ unsigned long DNS::PRNG()
        val = val + s->statsCollisions ^ s->statsDnsGood - s->statsDnsBad;
        val += (s->statsConnects ^ (unsigned long)s->statsSent ^ (unsigned long)s->statsRecv) - ServerInstance->Config->ports.size();
        return val;
+#else
+    unsigned long val = 0;
+    serverstats* s = ServerInstance->stats;
+    val = (time(NULL) ^ GetCurrentProcessId() ^ GetCurrentThreadId() ^ (this->currid++)) ^ s->statsAccept + time(NULL);
+    val = val + s->statsCollisions ^ s->statsDnsGood - s->statsDnsBad;
+    val += (s->statsConnects ^ (unsigned long)s->statsSent ^ (unsigned long)s->statsRecv);
+    return val;
+#endif
 }
 
index 0d719755a7b373748ce768ea6a5f3fc8a884aebe..ab1e6fa9b9ff2b53697dc08afcc2da0630012845 100644 (file)
 
 #include "configreader.h"
 #include "dynamic.h"
+#ifndef WIN32
 #include <dlfcn.h>
+#endif
+
 #include "inspircd.h"
 
 DLLManager::DLLManager(InspIRCd* ServerInstance, const char *fname)
index 8212dcaa341cf0a7ac38d15dbd9990ba4483cb8f..a0394b0f95667d61e8ae710f9136694dc004ee87 100644 (file)
 
 #include "inspircd.h"
 #include "hashcomp.h"
+#ifndef WIN32
 #include <ext/hash_map>
 #define nspace __gnu_cxx
+#else
+#include <hash_map>
+#define nspace stdext
+using stdext::hash_map;
+#endif
 
 /******************************************************
  *
@@ -61,7 +67,11 @@ void nspace::strlower(char *n)
        }
 }
 
+#ifndef WIN32
 size_t nspace::hash<string>::operator()(const string &s) const
+#else
+size_t nspace::hash_compare<string, std::less<string> >::operator()(const string &s) const
+#endif
 {
        /* XXX: NO DATA COPIES! :)
         * The hash function here is practically
@@ -75,7 +85,11 @@ size_t nspace::hash<string>::operator()(const string &s) const
        return t;
 }
 
+#ifndef WIN32
 size_t nspace::hash<irc::string>::operator()(const irc::string &s) const
+#else
+size_t nspace::hash_compare<irc::string, std::less<irc::string> >::operator()(const irc::string &s) const
+#endif
 {
        register size_t t = 0;
        for (irc::string::const_iterator x = s.begin(); x != s.end(); ++x) /* ++x not x++, as its faster */
@@ -138,26 +152,6 @@ int irc::irc_char_traits::compare(const char* str1, const char* str2, size_t n)
        return 0;
 }
 
-std::string operator+ (std::string& leftval, irc::string& rightval)
-{
-       return leftval + std::string(rightval.c_str());
-}
-
-irc::string operator+ (irc::string& leftval, std::string& rightval)
-{
-       return leftval + irc::string(rightval.c_str());
-}
-
-bool operator== (const std::string& leftval, const irc::string& rightval)
-{
-       return (leftval.c_str() == rightval);
-}
-
-bool operator== (const irc::string& leftval, const std::string& rightval)
-{
-       return (leftval == rightval.c_str());
-}
-
 const char* irc::irc_char_traits::find(const char* s1, int  n, char c)
 {
        while(n-- > 0 && lowermap[(unsigned char)*s1] != lowermap[(unsigned char)c])
@@ -165,20 +159,6 @@ const char* irc::irc_char_traits::find(const char* s1, int  n, char c)
        return s1;
 }
 
-/* See hashcomp.h if you care about these... */
-std::ostream& operator<<(std::ostream &os, const irc::string &str)
-{
-       return os << str.c_str();
-}
-
-std::istream& operator>>(std::istream &is, irc::string &str)
-{
-       std::string tmp;
-       is >> tmp;
-       str = tmp.c_str();
-       return is;
-}
-
 irc::tokenstream::tokenstream(const std::string &source) : tokens(source), last_pushed(false)
 {
        /* Record starting position and current position */
@@ -286,8 +266,9 @@ std::string irc::hex(const unsigned char *raw, size_t rawsz)
        /* EWW! This used to be using sprintf, which is WAY inefficient. -Special */
        
        const char *hex = "0123456789abcdef";
-       
-       char buf[rawsz*2+1];
+
+       std::string buf;
+       buf.reserve(rawsz * 2 + 1);
 
        size_t i, j;
        for (i = 0, j = 0; j < rawsz; ++j)
@@ -300,7 +281,7 @@ std::string irc::hex(const unsigned char *raw, size_t rawsz)
        return buf;
 }
 
-const char* irc::Spacify(const char* n)
+CoreExport const char* irc::Spacify(const char* n)
 {
        static char x[MAXBUF];
        strlcpy(x,n,MAXBUF);
@@ -614,24 +595,3 @@ unsigned char irc::dynamicbitmask::GetSize()
        return bits_size;
 }
 
-std::string assign(const irc::string &other)
-{
-       return other.c_str();
-}
-
-irc::string assign(const std::string &other)
-{
-       return other.c_str();
-}
-
-std::string& trim(std::string &str)
-{
-       std::string::size_type start = str.find_first_not_of(" ");
-       std::string::size_type end = str.find_last_not_of(" ");
-       if (start == std::string::npos || end == std::string::npos)
-               str = "";
-       else
-               str = str.substr(start, end-start+1);
-
-       return str;
-}
index 6e5f616bd37800b40d8abff9d2585a1b5e668b6f..d79b18c9ddc5eed71c7f8abd3c1606cb90629549 100644 (file)
@@ -486,16 +486,16 @@ void InspIRCd::LoadAllModules()
        for (int count = 0; count < Config->ConfValueEnum(Config->config_data, "module"); count++)
        {
                Config->ConfValue(Config->config_data, "module", "name", count, configToken, MAXBUF);
-               printf("[\033[1;32m*\033[0m] Loading module:\t\033[1;32m%s\033[0m\n",configToken);
+               printf_c("[\033[1;32m*\033[0m] Loading module:\t\033[1;32m%s\033[0m\n",configToken);
                
                if (!this->LoadModule(configToken))             
                {
                        this->Log(DEFAULT,"There was an error loading the module '%s': %s", configToken, this->ModuleError());
-                       printf("\n[\033[1;31m*\033[0m] There was an error loading the module '%s': %s\n\n", configToken, this->ModuleError());
+                       printf_c("\n[\033[1;31m*\033[0m] There was an error loading the module '%s': %s\n\n", configToken, this->ModuleError());
                        Exit(EXIT_STATUS_MODULE);
                }
        }
-       printf("\nA total of \033[1;32m%d\033[0m module%s been loaded.\n", this->ModCount+1, this->ModCount+1 == 1 ? " has" : "s have");
+       printf_c("\nA total of \033[1;32m%d\033[0m module%s been loaded.\n", this->ModCount+1, this->ModCount+1 == 1 ? " has" : "s have");
        this->Log(DEFAULT,"Total loaded modules: %d", this->ModCount+1);
 }
 
index 069c8634d0c86ee8de854e916aac5326ccedac91..ade05f3ef146a91f16ac2c7144e8fb15fec09fa1 100644 (file)
 #include "inspircd.h"
 #include "configreader.h"
 #include <signal.h>
+#ifndef WIN32
 #include <dirent.h>
+#include <unistd.h>
+#endif
 #include <exception>
 #include <fstream>
-#include <unistd.h>
 #include "modules.h"
 #include "mode.h"
 #include "xline.h"
 #include "typedefs.h"
 #include "command_parse.h"
 #include "exitcodes.h"
+
+#ifndef WIN32
 #include <dlfcn.h>
 #include <getopt.h>
-
+#endif
 
 using irc::sockets::NonBlocking;
 using irc::sockets::Blocking;
@@ -39,32 +43,64 @@ using irc::sockets::insp_sockaddr;
 
 InspIRCd* SI = NULL;
 
+/* Burlex: Moved from exitcodes.h -- due to duplicate symbols */
+const char* ExitCodes[] =
+{
+       "No error", /* 0 */
+               "DIE command", /* 1 */
+               "execv() failed", /* 2 */
+               "Internal error", /* 3 */
+               "Config file error", /* 4 */
+               "Logfile error", /* 5 */
+               "Fork failed", /* 6 */
+               "Bad commandline parameters", /* 7 */
+               "No ports could be bound", /* 8 */
+               "Can't write PID file", /* 9 */
+               "SocketEngine could not initialize", /* 10 */
+               "Refusing to start up as root", /* 11 */
+               "Found a <die> tag!", /* 12 */
+               "Couldn't load module on startup", /* 13 */
+               "", /* 14 */
+               "Received SIGTERM", /* 15 */
+};
+
 void InspIRCd::AddServerName(const std::string &servername)
 {
-       if(find(servernames.begin(), servernames.end(), servername) == servernames.end())
-               servernames.push_back(servername); /* Wasn't already there. */
+       servernamelist::iterator itr = servernames.begin();
+       for(; itr != servernames.end(); ++itr)
+               if(**itr == servername)
+                       return;
+
+       string * ns = new string(servername);
+       servernames.push_back(ns);
 }
 
 const char* InspIRCd::FindServerNamePtr(const std::string &servername)
 {
-       servernamelist::iterator iter = find(servernames.begin(), servernames.end(), servername);
-
-       if(iter == servernames.end())
-       {
-               AddServerName(servername);
-               iter = --servernames.end();
-       }
-
-       return iter->c_str();
+       servernamelist::iterator itr = servernames.begin();
+       for(; itr != servernames.end(); ++itr)
+               if(**itr == servername)
+                       return (*itr)->c_str();
+
+       servernames.push_back(new string(servername));
+       itr = --servernames.end();
+       return (*itr)->c_str();
 }
 
 bool InspIRCd::FindServerName(const std::string &servername)
 {
-       return (find(servernames.begin(), servernames.end(), servername) != servernames.end());
+       servernamelist::iterator itr = servernames.begin();
+       for(; itr != servernames.end(); ++itr)
+               if(**itr == servername)
+                       return true;
+    return false;
 }
 
 void InspIRCd::Exit(int status)
 {
+#ifdef WINDOWS
+       CloseIPC();
+#endif
        if (SI)
        {
                SI->SendError("Exiting with status " + ConvToStr(status) + " (" + std::string(ExitCodes[status]) + ")");
@@ -112,6 +148,15 @@ void InspIRCd::Cleanup()
 
        /* Close logging */
        this->Logger->Close();
+
+       /* Cleanup Server Names */
+       for(servernamelist::iterator itr = servernames.begin(); itr != servernames.end(); ++itr)
+               delete (*itr);
+
+#ifdef WINDOWS
+       /* WSACleanup */
+       WSACleanup();
+#endif
 }
 
 void InspIRCd::Restart(const std::string &reason)
@@ -124,7 +169,11 @@ void InspIRCd::Restart(const std::string &reason)
        this->Cleanup();
 
        /* Figure out our filename (if theyve renamed it, we're boned) */
+#ifdef WINDOWS
+       std::string me = Config->MyDir + "inspircd.exe";
+#else
        std::string me = Config->MyDir + "/inspircd";
+#endif
 
        if (execv(me.c_str(), Config->argv) == -1)
        {
@@ -135,10 +184,10 @@ void InspIRCd::Restart(const std::string &reason)
 
 void InspIRCd::Start()
 {
-       printf("\033[1;32mInspire Internet Relay Chat Server, compiled %s at %s\n",__DATE__,__TIME__);
-       printf("(C) InspIRCd Development Team.\033[0m\n\n");
-       printf("Developers:\t\t\033[1;32mBrain, FrostyCoolSlug, w00t, Om, Special, pippijn, peavey\033[0m\n");
-       printf("Others:\t\t\t\033[1;32mSee /INFO Output\033[0m\n");
+       printf_c("\033[1;32mInspire Internet Relay Chat Server, compiled %s at %s\n",__DATE__,__TIME__);
+       printf_c("(C) InspIRCd Development Team.\033[0m\n\n");
+       printf_c("Developers:\t\t\033[1;32mBrain, FrostyCoolSlug, w00t, Om, Special, pippijn, peavey\033[0m\n");
+       printf_c("Others:\t\t\t\033[1;32mSee /INFO Output\033[0m\n");
 }
 
 void InspIRCd::Rehash(int status)
@@ -195,11 +244,13 @@ void InspIRCd::CloseLog()
 
 void InspIRCd::SetSignals()
 {
+#ifndef WIN32
        signal(SIGALRM, SIG_IGN);
        signal(SIGHUP, InspIRCd::Rehash);
        signal(SIGPIPE, SIG_IGN);
-       signal(SIGTERM, InspIRCd::Exit);
        signal(SIGCHLD, SIG_IGN);
+#endif
+       signal(SIGTERM, InspIRCd::Exit);
 }
 
 void InspIRCd::QuickExit(int status)
@@ -209,6 +260,29 @@ void InspIRCd::QuickExit(int status)
 
 bool InspIRCd::DaemonSeed()
 {
+#ifdef WINDOWS
+       // Create process, with argument --service
+       STARTUPINFO si;
+       PROCESS_INFORMATION pi;
+       memset(&si, 0, sizeof(si));
+       memset(&pi, 0, sizeof(pi));
+       SHELLEXECUTEINFO sh = {0};
+       sh.cbSize = sizeof(sh);
+       sh.fMask = SEE_MASK_NOCLOSEPROCESS;
+       sh.hwnd = 0;
+       sh.lpVerb = 0;
+       sh.lpDirectory = 0;
+       sh.hInstApp = 0;
+       sh.nShow = SW_SHOW;
+       sh.lpFile = "inspircd.exe";
+       sh.lpParameters = "--service";
+       if(!ShellExecuteEx(&sh))
+               return false;
+
+       CloseHandle(sh.hProcess);
+       exit(0);
+       return true;
+#else
        signal(SIGTERM, InspIRCd::QuickExit);
 
        int childpid;
@@ -247,6 +321,7 @@ bool InspIRCd::DaemonSeed()
        }
 
        return true;
+#endif
 }
 
 void InspIRCd::WritePID(const std::string &filename)
@@ -284,13 +359,20 @@ std::string InspIRCd::GetRevision()
 InspIRCd::InspIRCd(int argc, char** argv)
        : ModCount(-1), duration_m(60), duration_h(60*60), duration_d(60*60*24), duration_w(60*60*24*7), duration_y(60*60*24*365), GlobalCulls(this)
 {
+#ifdef WINDOWS
+       WSADATA wsadata;
+       WSAStartup(MAKEWORD(2,0), &wsadata);
+#endif
+
        int found_ports = 0;
        FailedPortList pl;
-       int do_version = 0, do_nofork = 0, do_debug = 0, do_nolog = 0, do_root = 0;    /* flag variables */
+       int do_version = 0, do_nofork = 0, do_debug = 0, do_nolog = 0, do_root = 0, is_service = 0;    /* flag variables */
        char c = 0;
 
        modules.resize(255);
        factory.resize(255);
+       memset(&server, 0, sizeof(server));
+       memset(&client, 0, sizeof(client));
 
        this->unregistered_count = 0;
 
@@ -322,6 +404,7 @@ InspIRCd::InspIRCd(int argc, char** argv)
                { "nolog",      no_argument,            &do_nolog,      1       },
                { "runasroot",  no_argument,            &do_root,       1       },
                { "version",    no_argument,            &do_version,    1       },
+               { "service", no_argument, &is_service, 1 },
                { 0, 0, 0, 0 }
        };
 
@@ -350,6 +433,11 @@ InspIRCd::InspIRCd(int argc, char** argv)
                }
        }
 
+#ifdef WINDOWS
+       if(is_service)
+               FreeConsole();
+#endif
+
        if (do_version)
        {
                printf("\n%s r%s\n", VERSION, REVISION);
@@ -400,7 +488,7 @@ InspIRCd::InspIRCd(int argc, char** argv)
 
        if (!Config->nofork)
        {
-               if (!this->DaemonSeed())
+               if (!is_service && !this->DaemonSeed())
                {
                        printf("ERROR: could not go into daemon mode. Shutting down.\n");
                        Log(DEFAULT,"ERROR: could not go into daemon mode. Shutting down.");
@@ -452,7 +540,7 @@ InspIRCd::InspIRCd(int argc, char** argv)
                        printf("%d.\tIP: %s\tPort: %lu\n", j, i->first.empty() ? "<all>" : i->first.c_str(), (unsigned long)i->second);
                }
        }
-
+#ifndef WINDOWS
        if (!Config->nofork)
        {
                if (kill(getppid(), SIGTERM) == -1)
@@ -479,11 +567,15 @@ InspIRCd::InspIRCd(int argc, char** argv)
                        Log(DEFAULT,"Keeping pseudo-tty open as we are running in the foreground.");
                }
        }
-
+#endif
        printf("\nInspIRCd is now running!\n");
        Log(DEFAULT,"Startup complete.");
 
        this->WritePID(Config->PID);
+
+#ifdef WINDOWS
+       InitIPC();
+#endif
 }
 
 std::string InspIRCd::GetVersionString()
@@ -857,7 +949,9 @@ bool InspIRCd::LoadModule(const char* filename)
 
 void InspIRCd::DoOneIteration(bool process_module_sockets)
 {
-       static rusage ru;
+#ifndef WIN32
+    static rusage ru;
+#endif
 
        /* time() seems to be a pretty expensive syscall, so avoid calling it too much.
         * Once per loop iteration is pleanty.
@@ -888,12 +982,15 @@ void InspIRCd::DoOneIteration(bool process_module_sockets)
                        FOREACH_MOD_I(this,I_OnBackgroundTimer,OnBackgroundTimer(TIME));
                        Timers->TickMissedTimers(TIME);
                }
-
+#ifndef WIN32
                if (!getrusage(0, &ru))
                {
                        gettimeofday(&this->stats->LastSampled, NULL);
                        this->stats->LastCPU = ru.ru_utime;
                }
+#else
+               CheckIPC(this);
+#endif
        }
 
        /* Call the socket engine to wait on the active
@@ -1026,6 +1123,9 @@ void FileLogger::WriteLogLine(const std::string &line)
        if (log)
        {
                int written = fprintf(log,"%s",buffer.c_str());
+#ifdef WINDOWS
+               buffer = "";
+#else
                if ((written >= 0) && (written < (int)buffer.length()))
                {
                        buffer.erase(0, buffer.length());
@@ -1041,7 +1141,7 @@ void FileLogger::WriteLogLine(const std::string &line)
                        /* Wrote the whole buffer, and no need for write callback */
                        buffer = "";
                }
-
+#endif
                if (writeops++ % 20)
                {
                        fflush(log);
@@ -1053,12 +1153,18 @@ void FileLogger::Close()
 {
        if (log)
        {
-               int flags = fcntl(fileno(log), F_GETFL, 0);
+               /* Burlex: Windows assumes nonblocking on FILE* pointers anyway, and also "file" fd's aren't the same
+                          as socket fd's. */
+#ifndef WIN32
+        int flags = fcntl(fileno(log), F_GETFL, 0);
                fcntl(fileno(log), F_SETFL, flags ^ O_NONBLOCK);
+#endif
                if (buffer.size())
                        fprintf(log,"%s",buffer.c_str());
 
+#ifndef WINDOWS
                ServerInstance->SE->DelFd(this);
+#endif
 
                fflush(log);
                fclose(log);
index 3face10f6f462ea16cdf76e2006920f608931161..43eaec04a76a1bb02b97aad506a81ab5870bdbe6 100644 (file)
@@ -152,8 +152,8 @@ void InspSocket::SetQueues(int nfd)
        // attempt to increase socket sendq and recvq as high as its possible
        int sendbuf = 32768;
        int recvbuf = 32768;
-       setsockopt(nfd,SOL_SOCKET,SO_SNDBUF,(const void *)&sendbuf,sizeof(sendbuf));
-       setsockopt(nfd,SOL_SOCKET,SO_RCVBUF,(const void *)&recvbuf,sizeof(sendbuf));
+       setsockopt(nfd,SOL_SOCKET,SO_SNDBUF,(const char *)&sendbuf,sizeof(sendbuf));
+       setsockopt(nfd,SOL_SOCKET,SO_RCVBUF,(const char *)&recvbuf,sizeof(sendbuf));
 }
 
 /* Most irc servers require you to specify the ip you want to bind to.
@@ -335,10 +335,13 @@ bool InspSocket::DoConnect()
                ((sockaddr_in*)addr)->sin_port = htons(this->port);
        }
 #endif
-
+#ifndef WIN32
        int flags = fcntl(this->fd, F_GETFL, 0);
        fcntl(this->fd, F_SETFL, flags | O_NONBLOCK);
-
+#else
+    unsigned long flags = 0;
+    ioctlsocket(this->fd, FIONBIO, &flags);
+#endif
        if (connect(this->fd, (sockaddr*)addr, size) == -1)
        {
                if (errno != EINPROGRESS)
@@ -402,7 +405,11 @@ std::string InspSocket::GetIP()
 
 char* InspSocket::Read()
 {
+#ifdef WINDOWS
+       if ((fd < 0) || (m_internalFd > MAX_DESCRIPTORS))
+#else
        if ((fd < 0) || (fd > MAX_DESCRIPTORS))
+#endif
                return NULL;
 
        int n = 0;
@@ -515,7 +522,11 @@ bool InspSocket::FlushWriteBuffer()
                        while (outbuffer.size() && (errno != EAGAIN))
                        {
                                /* Send a line */
+#ifndef WIN32
                                int result = write(this->fd,outbuffer[0].c_str(),outbuffer[0].length());
+#else
+                int result = send(this->fd,outbuffer[0].c_str(),outbuffer[0].length(), 0);
+#endif
                                if (result > 0)
                                {
                                        if ((unsigned int)result >= outbuffer[0].length())
@@ -589,6 +600,11 @@ void SocketTimeout::Tick(time_t now)
 
 bool InspSocket::Poll()
 {
+#ifdef WINDOWS
+       if(Instance->SE->GetRef(this->fd) != this)
+               return false;
+       int incoming = -1;
+#else
        if (this->Instance->SE->GetRef(this->fd) != this)
                return false;
 
@@ -596,13 +612,14 @@ bool InspSocket::Poll()
 
        if ((fd < 0) || (fd > MAX_DESCRIPTORS))
                return false;
-
+#endif
        switch (this->state)
        {
                case I_CONNECTING:
                        /* Our socket was in write-state, so delete it and re-add it
                         * in read-state.
                         */
+#ifndef WINDOWS
                        if (this->fd > -1)
                        {
                                this->Instance->SE->DelFd(this);
@@ -610,6 +627,9 @@ bool InspSocket::Poll()
                                if (!this->Instance->SE->AddFd(this))
                                        return false;
                        }
+#else
+                       this->SetState(I_CONNECTED);
+#endif
                        if (Instance->Config->GetIOHook(this))
                        {
                                try
@@ -632,7 +652,7 @@ bool InspSocket::Poll()
                        if ((!*this->host) || strchr(this->host, ':'))
                                length = sizeof(sockaddr_in6);
 #endif
-                       incoming = accept (this->fd, client, &length);
+                       incoming = _accept (this->fd, client, &length);
 #ifdef IPV6
                        if ((!*this->host) || strchr(this->host, ':'))
                        {
index d8df39e1883f9d4fd95b77a20c22a27fa395a0b0..f5f607609db6c7bdc873886972b91e69017fbd14 100644 (file)
@@ -12,7 +12,6 @@
  */
 
 #include "inspstring.h"
-#include <string.h>
 
 /*
  * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -42,7 +41,7 @@
  */
  
 #ifndef HAS_STRLCPY
-size_t strlcat(char *dst, const char *src, size_t siz)
+CoreExport size_t strlcat(char *dst, const char *src, size_t siz)
 {
   char *d = dst;
   const char *s = src;
@@ -72,7 +71,7 @@ size_t strlcat(char *dst, const char *src, size_t siz)
   return(dlen + (s - src)); /* count does not include NUL */
 }
 
-size_t strlcpy(char *dst, const char *src, size_t siz)
+CoreExport size_t strlcpy(char *dst, const char *src, size_t siz)
 {
   char *d = dst;
   const char *s = src;
@@ -101,7 +100,7 @@ size_t strlcpy(char *dst, const char *src, size_t siz)
 }
 #endif
 
-int charlcat(char* x,char y,int z)
+CoreExport int charlcat(char* x,char y,int z)
 {
        char* x__n = x;
        int v = 0;
@@ -118,7 +117,7 @@ int charlcat(char* x,char y,int z)
        return v;
 }
 
-bool charremove(char* mp, char remove)
+CoreExport bool charremove(char* mp, char remove)
 {
        char* mptr = mp;
        bool shift_down = false;
index c2adb157595ab701485309c51ce04cc3ec4ef13d..cc334d4f7321d9749dfacfc37f44fb4715a0cb2d 100644 (file)
@@ -378,7 +378,7 @@ bool InspIRCd::MatchText(const std::string &sliteral, const std::string &spatter
 
 bool InspIRCd::CallCommandHandler(const std::string &commandname, const char** parameters, int pcnt, userrec* user)
 {
-       return this->Parser->CallHandler(commandname,parameters,pcnt,user);
+       return (this->Parser->CallHandler(commandname,parameters,pcnt,user) != CMD_INVALID);
 }
 
 bool InspIRCd::IsValidModuleCommand(const std::string &commandname, int pcnt, userrec* user)
index 5d95e75cf4d0576d56d39c9a9bd3cb6eccdb0ad0..436b0f3646d841b8fe95fd35809a2ff6b378c062 100644 (file)
 
 #include "transport.h"
 
+#ifdef WINDOWS
+#pragma comment(lib, "libgnutls-13.lib")
+#undef MAX_DESCRIPTORS
+#define MAX_DESCRIPTORS 10000
+#endif
+
 /* $ModDesc: Provides SSL support for clients */
 /* $CompileFlags: exec("libgnutls-config --cflags") */
 /* $LinkerFlags: rpath("libgnutls-config --libs") exec("libgnutls-config --libs") */
@@ -85,7 +91,7 @@ class ModuleSSLGnuTLS : public Module
  public:
 
        ModuleSSLGnuTLS(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                ServerInstance->PublishInterface("InspSocketHook", this);
 
@@ -837,7 +843,7 @@ class ModuleSSLGnuTLSFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleSSLGnuTLSFactory;
 }
index e073eba816b5de32954ce7f3f7b32c70bd8bff55..90e9c9ab683938a10a54e0d2a016ab5f7bd99f78 100644 (file)
 #include <openssl/ssl.h>
 #include <openssl/err.h>
 
+#ifdef WINDOWS
+#include <openssl/applink.c>
+#endif
+
 #include "inspircd_config.h"
 #include "configreader.h"
 #include "users.h"
 
 #include "transport.h"
 
+#ifdef WINDOWS
+#pragma comment(lib, "libeay32MTd")
+#pragma comment(lib, "ssleay32MTd")
+#undef MAX_DESCRIPTORS
+#define MAX_DESCRIPTORS 10000
+#endif
+
 /* $ModDesc: Provides SSL support for clients */
 /* $CompileFlags: pkgconfversion("openssl","0.9.7") pkgconfincludes("openssl","/openssl/ssl.h","") */
 /* $LinkerFlags: rpath("pkg-config --libs openssl") pkgconflibs("openssl","/libssl.so","-lssl -lcrypto -ldl") */
@@ -122,7 +133,7 @@ class ModuleSSLOpenSSL : public Module
        InspIRCd* PublicInstance;
 
        ModuleSSLOpenSSL(InspIRCd* Me)
-               : Module::Module(Me), PublicInstance(Me)
+               : Module(Me), PublicInstance(Me)
        {
                ServerInstance->PublishInterface("InspSocketHook", this);
 
@@ -855,7 +866,7 @@ class ModuleSSLOpenSSLFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleSSLOpenSSLFactory;
 }
index a901ab16515a72b091024ccc554e6914e54908b1..827aeaf30d05b9289bc53cc0f62064eab2823ce9 100644 (file)
@@ -75,7 +75,7 @@ class ModuleAlias : public Module
  public:
        
        ModuleAlias(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                ReadAliases();
                pars.resize(127);
@@ -289,7 +289,7 @@ class ModuleAliasFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleAliasFactory;
 }
index 04ae63b17556d6dc87662eb7ee07110affb9e359..a24e3c97931a6d8f2143d0592dfaf53538f36aab 100644 (file)
@@ -64,7 +64,7 @@ class Modulealltime : public Module
        cmd_alltime *mycommand;
  public:
        Modulealltime(InspIRCd *Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                mycommand = new cmd_alltime(ServerInstance);
                ServerInstance->AddCommand(mycommand);
@@ -99,7 +99,7 @@ class ModulealltimeFactory : public ModuleFactory
 };
 
 
-extern "C" void *init_module(void)
+extern "C" DllExport void *init_module(void)
 {
        return new ModulealltimeFactory;
 }
index 90e515d33a9d9405c2b904138a1f8d1c686689d1..f0affea7e427e4f773574ac2323377d9c7e80064 100644 (file)
@@ -24,7 +24,7 @@ class ModuleAntiBear : public Module
  private:
 
  public:
-       ModuleAntiBear(InspIRCd* Me) : Module::Module(Me)
+       ModuleAntiBear(InspIRCd* Me) : Module(Me)
        {
                
        }
@@ -99,7 +99,7 @@ class ModuleAntiBearFactory : public ModuleFactory
 // class for this library
 //
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleAntiBearFactory;
 }
index 27225edac9df49df6d0cf06c9878d663718b92e3..93a5691efdca7d0f43a66521aeabdf21a8f7ca17 100644 (file)
@@ -22,7 +22,7 @@ class ModuleAntiBottler : public Module
 {
  public:
        ModuleAntiBottler(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
        }
@@ -116,7 +116,7 @@ class ModuleAntiBottlerFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleAntiBottlerFactory;
 }
index 166d1bcc44c3fdea69a984d2721b51319425c3c4..15ef1943eaafb24e90a3592daf654860b7f7522b 100644 (file)
@@ -54,7 +54,7 @@ class ModuleAuditorium : public Module
        CUList except_list;
  public:
        ModuleAuditorium(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                aum = new AuditoriumMode(ServerInstance);
                if (!ServerInstance->AddMode(aum, 'u'))
@@ -206,7 +206,7 @@ class ModuleAuditoriumFactory : public ModuleFactory
        
 };
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleAuditoriumFactory;
 }
index a340a5ce73167531a75081342deaeac52a239034..3fc192cb5eb510158fb6d80642b5dd7db584e963 100644 (file)
@@ -49,7 +49,7 @@ class ModuleBanException : public Module
 
 public:
        ModuleBanException(InspIRCd* Me)
-       : Module::Module(Me)
+       : Module(Me)
        {
                be = new BanException(ServerInstance);
                if (!ServerInstance->AddMode(be, 'e'))
@@ -170,7 +170,7 @@ class ModuleBanExceptionFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleBanExceptionFactory;
 }
index 2d9deedc6a6510b4ddb8d866abb99ddae23e58c4..ffe7724e26d7d929a7c2a08b6d9779b3b0359f5a 100644 (file)
@@ -191,7 +191,7 @@ class ModuleBanRedirect : public Module
        
  public:
        ModuleBanRedirect(InspIRCd* Me)
-       : Module::Module(Me), Srv(Me)
+       : Module(Me), Srv(Me)
        {
                re = new BanRedirect(Me);
                nofollow = false;
@@ -337,7 +337,7 @@ class ModuleBanRedirectFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleBanRedirectFactory;
 }
index 39e3c16b1128b3cefbf384fe482639b8900cfa77..f1a388890f8a3a2c154b9d48b7a9f158f7a36462 100644 (file)
@@ -45,7 +45,7 @@ class ModuleBlockAmsg : public Module
        int ForgetDelay;
        BlockAction action;
 public:
-       ModuleBlockAmsg(InspIRCd* Me) : Module::Module(Me)
+       ModuleBlockAmsg(InspIRCd* Me) : Module(Me)
        {
                
                this->OnRehash(NULL,"");
@@ -192,7 +192,7 @@ class ModuleBlockAmsgFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleBlockAmsgFactory;
 }
index e984087d8bdae9df4eeea27291ddd399bc78284c..a3991177b161bbe9003b4019f6e0a45506b1e2c1 100644 (file)
@@ -58,7 +58,7 @@ class ModuleBlockCAPS : public Module
        char capsmap[256];
 public:
        
-       ModuleBlockCAPS(InspIRCd* Me) : Module::Module(Me)
+       ModuleBlockCAPS(InspIRCd* Me) : Module(Me)
        {
                OnRehash(NULL,"");
                bc = new BlockCaps(ServerInstance);
@@ -160,7 +160,7 @@ class ModuleBlockCAPSFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleBlockCAPSFactory;
 }
index 219637fb958c6a0198f521e37f4dff47e3ceef42..c63a44ea7ca931a0992f11b2e5b401f36a8fa6e3 100644 (file)
@@ -56,7 +56,7 @@ class ModuleBlockColour : public Module
        BlockColor *bc;
  public:
  
-       ModuleBlockColour(InspIRCd* Me) : Module::Module(Me)
+       ModuleBlockColour(InspIRCd* Me) : Module(Me)
        {
                bc = new BlockColor(ServerInstance);
                if (!ServerInstance->AddMode(bc, 'c'))
@@ -137,7 +137,7 @@ class ModuleBlockColourFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleBlockColourFactory;
 }
index ea6d1e60ab87f81c65456e8f55e49bc9cafe7c89..a4cebc4c79dcb8354fc7e469c88ba086ad016c99 100644 (file)
@@ -57,7 +57,7 @@ class ModuleBotMode : public Module
        BotMode* bm;
  public:
        ModuleBotMode(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                bm = new BotMode(ServerInstance);
@@ -112,7 +112,7 @@ class ModuleBotModeFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleBotModeFactory;
 }
index e6e3b92b07b012d6bf4b3662622276088d576942..9aaf5fc6db74f037ad4d1298194bdbf92be503b9 100644 (file)
@@ -127,7 +127,7 @@ class ModuleCBan : public Module
        
 
  public:
-       ModuleCBan(InspIRCd* Me) : Module::Module(Me)
+       ModuleCBan(InspIRCd* Me) : Module(Me)
        {
                
                mycommand = new cmd_cban(Me);
@@ -266,7 +266,7 @@ class ModuleCBanFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleCBanFactory;
 }
index c378080a542eec6d4eb03bc4de978fe58703e8ce..ae254a1204cc23d1a1d029d2b6fcb00ad3995915 100644 (file)
@@ -92,7 +92,7 @@ class ModuleCensor : public Module
  
  public:
        ModuleCensor(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                /* Read the configuration file on startup.
                 */
@@ -213,7 +213,7 @@ class ModuleCensorFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleCensorFactory;
 }
index b3cc248398460895952a7991c94c3129802143e3..671588d186d2712c5b40de71760ed895bb47e902 100644 (file)
 #include <vector>
 #include <string>
 #include <stdlib.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include "users.h"
 #include "modules.h"
 #include "dns.h"
 #include "inspircd.h"
+#ifndef WINDOWS
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#endif
 
 /* $ModDesc: Change user's hosts connecting from known CGI:IRC hosts */
 
@@ -127,7 +129,7 @@ class ModuleCgiIRC : public Module
        bool NotifyOpers;
        CGIHostlist Hosts;
 public:
-       ModuleCgiIRC(InspIRCd* Me) : Module::Module(Me)
+       ModuleCgiIRC(InspIRCd* Me) : Module(Me)
        {
                
                OnRehash(NULL,"");
@@ -518,7 +520,7 @@ class ModuleCgiIRCFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleCgiIRCFactory;
 }
index e9e95a924578e49b8f2de81f9327ad5cadac9e83..1efdf2996b240f7d43b8a7709b14fee4379a5308 100644 (file)
@@ -23,7 +23,7 @@ class ModuleChanCreate : public Module
  private:
  public:
        ModuleChanCreate(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                ServerInstance->SNO->EnableSnomask('j', "CHANCREATE");
        }
@@ -70,7 +70,7 @@ class ModuleChanCreateFactory : public ModuleFactory
        
 };
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleChanCreateFactory;
 }
index 3c16b013d0550aba81666a84608b2fb70331df2a..4008eb34937821328098103dccfe3cf6e2c82462 100644 (file)
@@ -67,7 +67,7 @@ class ModuleChanFilter : public Module
  public:
  
        ModuleChanFilter(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                cf = new ChanFilter(ServerInstance);
                if (!ServerInstance->AddMode(cf, 'g'))
@@ -172,7 +172,7 @@ class ModuleChanFilterFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleChanFilterFactory;
 }
index 81cf34c0c4e0b5d8f69e9334e5457468012a5513..5ba18a2bfb95bd8b23d76ee42d14edb5134195dc 100644 (file)
@@ -303,7 +303,7 @@ class ModuleChanProtect : public Module
  public:
  
        ModuleChanProtect(InspIRCd* Me)
-               : Module::Module(Me), FirstInGetsFounder(false), QAPrefixes(false), DeprivSelf(false), DeprivOthers(false), booting(true)
+               : Module(Me), FirstInGetsFounder(false), QAPrefixes(false), DeprivSelf(false), DeprivOthers(false), booting(true)
        {       
                /* Load config stuff */
                OnRehash(NULL,"");
@@ -548,7 +548,7 @@ class ModuleChanProtectFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleChanProtectFactory;
 }
index 7a7fe570bb39f809f31aee7343a4577ebf93a6af..d12513af906bc98526e401f45cdb0f7a20b37623 100644 (file)
@@ -162,7 +162,7 @@ class ModuleCheck : public Module
  private:
        cmd_check *mycommand;
  public:
-       ModuleCheck(InspIRCd* Me) : Module::Module(Me)
+       ModuleCheck(InspIRCd* Me) : Module(Me)
        {
                
                mycommand = new cmd_check(ServerInstance);
@@ -205,7 +205,7 @@ class ModuleCheckFactory : public ModuleFactory
        
 };
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleCheckFactory;
 }
index 45eaaa37827052b958d7e0f9a7c32f5eaa3d9e6a..f3f7f6387e6b6cc1cc488527e18c098150f8b465 100644 (file)
@@ -78,7 +78,7 @@ class ModuleChgHost : public Module
        char hostmap[256];
  public:
        ModuleChgHost(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                OnRehash(NULL,"");
                mycommand = new cmd_chghost(ServerInstance, hostmap);
@@ -134,7 +134,7 @@ class ModuleChgHostFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleChgHostFactory;
 }
index 43bb34b319b3a9f2e1234dc1cba4f05b83fdf906..8c251b2bcee269081e191934154f1c6209d47384 100644 (file)
@@ -60,7 +60,7 @@ class ModuleChgIdent : public Module
        
        
 public:
-       ModuleChgIdent(InspIRCd* Me) : Module::Module(Me)
+       ModuleChgIdent(InspIRCd* Me) : Module(Me)
        {
                mycommand = new cmd_chgident(ServerInstance);
                ServerInstance->AddCommand(mycommand);
@@ -98,7 +98,7 @@ class ModuleChgIdentFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleChgIdentFactory;
 }
index e53124aa0069e2afc7eeb437ad305d21d2d7435a..1b688842699ba8292bf847dc654ef10f2b5e64e9 100644 (file)
@@ -271,7 +271,7 @@ class ModuleCloaking : public Module
 
  public:
        ModuleCloaking(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                ServerInstance->UseInterface("HashRequest");
 
@@ -336,7 +336,7 @@ class ModuleCloakingFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleCloakingFactory;
 }
index e51680a7f1699f8c66c2b8d463cfcabaf63d0088..afb0c3a4b0d040e11bbe087df3e7bab6968f2970 100644 (file)
@@ -74,7 +74,7 @@ class ModuleClones : public Module
  private:
        cmd_clones *mycommand;
  public:
-       ModuleClones(InspIRCd* Me) : Module::Module(Me)
+       ModuleClones(InspIRCd* Me) : Module(Me)
        {
                
                mycommand = new cmd_clones(ServerInstance);
@@ -117,7 +117,7 @@ class ModuleClonesFactory : public ModuleFactory
        
 };
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleClonesFactory;
 }
index a2c45641cedff1895fda72e756f45ab36b981cec..b125a772bd48c4e0e27c03f92a968d22af1af2ad 100644 (file)
@@ -46,7 +46,7 @@ class ModuleConnJoin : public Module
 
        public:
                ModuleConnJoin(InspIRCd* Me)
-                       : Module::Module(Me)
+                       : Module(Me)
                {
                        OnRehash(NULL, "");
                }
@@ -104,7 +104,7 @@ class ModuleConnJoinFactory : public ModuleFactory
                }
 };
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleConnJoinFactory;
 }
index 2226f9776c7b0ce503c34ef727d3b1a102cf77fd..1973820cdf7fc9b94400ed67cd510f48f5b59ef8 100644 (file)
@@ -29,7 +29,7 @@ class ModuleModesOnConnect : public Module
 
  public:
        ModuleModesOnConnect(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                Conf = new ConfigReader(ServerInstance);
@@ -79,7 +79,7 @@ class ModuleModesOnConnect : public Module
                                                tokens.push_back(buf);
 
                                        int size = tokens.size() + 1;
-                                       const char* modes[size];
+                                       const char** modes = new const char*[size];
                                        modes[0] = user->nick;
                                        modes[1] = tokens[0].c_str();
 
@@ -95,6 +95,7 @@ class ModuleModesOnConnect : public Module
                                        }
 
                                        ServerInstance->Parser->CallHandler("MODE", modes, size, user);
+                    delete [] modes;
                                }
                                break;
                        }
@@ -123,7 +124,7 @@ class ModuleModesOnConnectFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleModesOnConnectFactory;
 }
index 1c263212572f2bd1fbed4814ce8b3c8e1e53c3e8..9370b993190b2f6f6dff393bdaedb815bd9a6694 100644 (file)
@@ -29,7 +29,7 @@ class ModuleWaitPong : public Module
 
  public:
        ModuleWaitPong(InspIRCd* Me)
-        : Module::Module(Me), Instance(Me), extenstr("waitpong_pingstr")
+        : Module(Me), Instance(Me), extenstr("waitpong_pingstr")
        {
                OnRehash(NULL,"");
        }
@@ -166,7 +166,7 @@ class ModuleWaitPongFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleWaitPongFactory;
 }
index c834605b0622419790586676f3269c1ad03be4ef..1cfacf480dddfb3d34a3dbebab2845a7fefc3f15 100644 (file)
@@ -31,7 +31,7 @@ private:
        
 
 public:
-       ModuleConnFlood(InspIRCd* Me) : Module::Module(Me)
+       ModuleConnFlood(InspIRCd* Me) : Module(Me)
        {
                
                InitConf();
@@ -137,7 +137,7 @@ public:
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleConnFloodFactory;
 }
index 23d259f6c55b8bcc64cb761a21ac04d4194bbe76..367a3769ebefe59697cf536d9f08058900c42b0c 100644 (file)
@@ -254,7 +254,7 @@ class ModuleDCCAllow : public Module
  public:
 
        ModuleDCCAllow(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                Conf = new ConfigReader(ServerInstance);
                mycommand = new cmd_dccallow(ServerInstance);
@@ -507,7 +507,7 @@ class ModuleDCCAllowFactory : public ModuleFactory
 
 };
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleDCCAllowFactory;
 }
index 0be919e65cddd2c8405abb02dcb9cf4f009e8c32..109916881015fc85dec9037bf419c61cbf27f5a6 100644 (file)
@@ -53,7 +53,7 @@ class ModuleDeaf : public Module
        User_d* m1;
  public:
        ModuleDeaf(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                m1 = new User_d(ServerInstance);
                if (!ServerInstance->AddMode(m1, 'd'))
@@ -152,7 +152,7 @@ class ModuleDeafFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleDeafFactory;
 }
index db42ab43ace3673cc8aaa89162c57708127baebf..d143bffbf7c81f2a7423402e4f065501d07ded0e 100644 (file)
@@ -28,7 +28,7 @@ class ModuleDenyChannels : public Module
        ConfigReader *Conf;
 
  public:
-       ModuleDenyChannels(InspIRCd* Me) : Module::Module(Me)
+       ModuleDenyChannels(InspIRCd* Me) : Module(Me)
        {
                
                Conf = new ConfigReader(ServerInstance);
@@ -98,7 +98,7 @@ class ModuleDenyChannelsFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleDenyChannelsFactory;
 }
index 7400d2212c409b61ce85dfbd685301bb32ff05dc..3c21a64f617ebd60e85efea36ccb1c0d8c53fd59 100644 (file)
@@ -62,7 +62,7 @@ class ModuleDeVoice : public Module
 {
        cmd_devoice *mycommand;
  public:
-       ModuleDeVoice(InspIRCd* Me) : Module::Module(Me)
+       ModuleDeVoice(InspIRCd* Me) : Module(Me)
        {
 
                mycommand = new cmd_devoice(ServerInstance);
@@ -99,7 +99,7 @@ class ModuleDeVoiceFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleDeVoiceFactory;
 }
index 3c6260a72465305b6998245f87dac284de2f65c7..d53706af36d1f7324b7b92c46da0d9e23cd26d46 100644 (file)
  * ---------------------------------------------------
  */
 
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <stdint.h>
 #include "inspircd.h"
 #include "xline.h"
 #include "dns.h"
 #include "channels.h"
 #include "modules.h"
 
+#ifndef WINDOWS
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <stdint.h>
+#endif
+
 /* $ModDesc: Provides handling of DNS blacklists */
 
 /* Class holding data for a single entry */
@@ -167,7 +170,7 @@ class ModuleDNSBL : public Module
                return DNSBLConfEntry::I_UNKNOWN;
        }
  public:
-       ModuleDNSBL(InspIRCd *Me) : Module::Module(Me)
+       ModuleDNSBL(InspIRCd *Me) : Module(Me)
        {
                ReadConf();
        }
@@ -360,7 +363,7 @@ class ModuleDNSBLFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleDNSBLFactory;
 }
index 133406ccb7e33d9f4fd51a898cb98e19ef565000..b0c932ada1c88f3c9aaa09aa5318e93342abc94e 100644 (file)
@@ -31,7 +31,7 @@ class ModuleFilter : public FilterBase
 
  public:
        ModuleFilter(InspIRCd* Me)
-       : FilterBase::FilterBase(Me, "m_filter.so")
+       : FilterBase(Me, "m_filter.so")
        {
                OnRehash(NULL,"");
        }
@@ -155,7 +155,7 @@ class ModuleFilterFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleFilterFactory;
 }
index 5797cc3109ef58f690e0ed6dabb7da39785b5d98..dbe8b4342d91e6bed77680e80812f73fc62b0197 100644 (file)
@@ -148,7 +148,7 @@ class cmd_filter : public command_t
        }
 };
 
-FilterBase::FilterBase(InspIRCd* Me, const std::string &source) : Module::Module(Me)
+FilterBase::FilterBase(InspIRCd* Me, const std::string &source) : Module(Me)
 {
        filtcommand = new cmd_filter(this, Me, source);
        ServerInstance->AddCommand(filtcommand);
index a42275127de9634d7d45497033c383cf2bac133d..cd0b15bd99ed71cea299515a911a4298c0a69ae9 100644 (file)
@@ -34,7 +34,7 @@ class ModuleFoobar : public Module
         
  public:
        ModuleFoobar(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                // The constructor just makes a copy of the server class
        
@@ -124,7 +124,7 @@ class ModuleFoobarFactory : public ModuleFactory
 // class for this library
 //
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleFoobarFactory;
 }
index ca945b496c8d90404f61e2c65f41fbad05c73b9b..7cc38eaa11da3ef3818cfe2f7318053719fdc66a 100644 (file)
@@ -117,7 +117,7 @@ class ModuleGlobalLoad : public Module
        cmd_greloadmodule *mycommand3;
        
  public:
-       ModuleGlobalLoad(InspIRCd* Me) : Module::Module(Me)
+       ModuleGlobalLoad(InspIRCd* Me) : Module(Me)
        {
                
                mycommand = new cmd_gloadmodule(ServerInstance);
@@ -158,7 +158,7 @@ class ModuleGlobalLoadFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleGlobalLoadFactory;
 }
index 7e4d88d9471867bc1091a879b82d03e997bde714..4dbe8dfb598f41fab19e56f0052ff6c619231081 100644 (file)
@@ -52,7 +52,7 @@ class ModuleGlobops : public Module
        cmd_globops* mycommand;
  public:
        ModuleGlobops(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                mycommand = new cmd_globops(ServerInstance);
                ServerInstance->AddCommand(mycommand);
@@ -94,7 +94,7 @@ class ModuleGlobopsFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleGlobopsFactory;
 }
index f82004f162f09fb022e1dc62825ca6aab9aa9dbf..5a02f2bf08291d84626de06fb67d1a2d84554e0a 100644 (file)
@@ -116,7 +116,7 @@ class ModuleHelpop : public Module
 
        public:
                ModuleHelpop(InspIRCd* Me)
-                       : Module::Module(Me)
+                       : Module(Me)
                {
                        ReadConfig();
                        ho = new Helpop(ServerInstance);
@@ -206,7 +206,7 @@ class ModuleHelpopFactory : public ModuleFactory
        
 };
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleHelpopFactory;
 }
index a2bc4aa548653b5f9dc4aa54c2b3708c4bf628bf..cf7c95c0fafff8ce3b42dac60514c520ecf12c72 100644 (file)
@@ -58,7 +58,7 @@ class ModuleHideChans : public Module
        HideChans* hm;
  public:
        ModuleHideChans(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                hm = new HideChans(ServerInstance);
@@ -110,7 +110,7 @@ class ModuleHideChansFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleHideChansFactory;
 }
index ce627f44800025a61f35e4458bdfa4bafdaede94..afc2e6cfaedd2ff910f61812993d77e4b2dc1546 100644 (file)
@@ -57,7 +57,7 @@ class ModuleHideOper : public Module
        HideOper* hm;
  public:
        ModuleHideOper(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                hm = new HideOper(ServerInstance);
@@ -109,7 +109,7 @@ class ModuleHideOperFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleHideOperFactory;
 }
index 473a35d124e9e8a4a5347267d5bd56b241c6595f..d2e51a187748ae1beae92465d08bd8343a1110eb 100644 (file)
@@ -41,7 +41,7 @@ class ModuleHostChange : public Module
         
  public:
        ModuleHostChange(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                Conf = new ConfigReader(ServerInstance);
                OnRehash(NULL,"");
@@ -160,7 +160,7 @@ class ModuleHostChangeFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleHostChangeFactory;
 }
index e3c50ef82022876ae00deb1403e296ca466159ee..2cb890a1e08a77f259cb7e680a2eb65b9e595d64 100644 (file)
@@ -75,7 +75,7 @@ class ModuleHTTPClient : public Module
        HTTPList sockets;
 
        ModuleHTTPClient(InspIRCd *Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
        }
        
@@ -360,7 +360,7 @@ class ModuleHTTPClientFactory : public ModuleFactory
        }
 };
 
-extern "C" void *init_module(void)
+extern "C" DllExport void *init_module(void)
 {
        return new ModuleHTTPClientFactory;
 }
index 3342ba37d425690fa365649f6d9b36fe47ca033a..49c8d8803c73de8ce7b9d4fdcdaabcf8a303c27a 100644 (file)
@@ -378,7 +378,7 @@ class ModuleHttpServer : public Module
                }
        }
 
-       ModuleHttpServer(InspIRCd* Me) : Module::Module(Me)
+       ModuleHttpServer(InspIRCd* Me) : Module(Me)
        {
                ReadConfig();
        }
@@ -437,7 +437,7 @@ class ModuleHttpServerFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleHttpServerFactory;
 }
index a72c94c4725d599277390eea9195ff3ef91569e0..e800b3d98c54253dd5d190e59957699e2757cb4d 100644 (file)
@@ -45,7 +45,7 @@ class ModuleHttpStats : public Module
                this->stylesheet = c.ReadValue("httpstats", "stylesheet", 0);
        }
 
-       ModuleHttpStats(InspIRCd* Me) : Module::Module(Me)
+       ModuleHttpStats(InspIRCd* Me) : Module(Me)
        {
                
                ReadConfig();
@@ -258,7 +258,7 @@ class ModuleHttpStatsFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleHttpStatsFactory;
 }
index cf0f41383e92884c0be502b694ef66dd0ada6086..00d12b8ec69d42c719c1f71df9a569fa0151ea86 100644 (file)
@@ -205,7 +205,7 @@ class ModuleIdent : public Module
        }
 
        ModuleIdent(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
 
                ReadSettings();
@@ -349,7 +349,7 @@ class ModuleIdentFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleIdentFactory;
 }
index 0f9578666b3d7ce6df210e522687eb05bd2c147c..30a20f2ed4967f1bb8f636d8b1b2363b67affd92 100644 (file)
@@ -147,7 +147,7 @@ class ModuleInvisible : public Module
        InvisibleDeOper* ido;
  public:
        ModuleInvisible(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                conf = new ConfigReader(ServerInstance);
                qm = new InvisibleMode(ServerInstance);
@@ -292,7 +292,7 @@ class ModuleInvisibleFactory : public ModuleFactory
        
 };
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleInvisibleFactory;
 }
index 8cca13b1e95f72573d21af91bf29f4520e20fd9c..88c2c507f76213b38077350ec435bd48796ecbd0 100644 (file)
@@ -168,7 +168,7 @@ class ModuleInviteExceptionFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleInviteExceptionFactory;
 }
index 358f3e08c768bab1101a32df652226c107eb8cf5..f6b5f4b90a6340bb58fc159bd287875760cced0e 100644 (file)
@@ -218,7 +218,7 @@ class ModuleJoinFlood : public Module
  public:
  
        ModuleJoinFlood(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                jf = new JoinFlood(ServerInstance);
@@ -305,7 +305,7 @@ class ModuleJoinFloodFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleJoinFloodFactory;
 }
index d48223ffb155a154d95f3b987cc2ee3d246e338b..f21fb8e3a185aa93ed131c2855e88ed625950474 100644 (file)
@@ -128,7 +128,7 @@ class ModuleJumpServer : public Module
        cmd_jumpserver* js;
  public:
        ModuleJumpServer(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                js = new cmd_jumpserver(ServerInstance);
@@ -181,7 +181,7 @@ class ModuleJumpServerFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleJumpServerFactory;
 }
index 87e8646ec47e2eb1dc1db77f23bb1dd91504f857..a38d260bb6938cae7b6cad756b95ee78ba547c05 100644 (file)
@@ -129,7 +129,7 @@ class ModuleKickNoRejoin : public Module
 public:
  
        ModuleKickNoRejoin(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                kr = new KickRejoin(ServerInstance);
@@ -245,7 +245,7 @@ class ModuleKickNoRejoinFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleKickNoRejoinFactory;
 }
index 70480e188a8debad501392f420a04ebee9d26195..a725844b746362f27653e6061b37245a1769adc9 100644 (file)
@@ -103,7 +103,7 @@ class ModuleKnock : public Module
        cmd_knock* mycommand;
        Knock* kn;
  public:
-       ModuleKnock(InspIRCd* Me) : Module::Module(Me)
+       ModuleKnock(InspIRCd* Me) : Module(Me)
        {
                
                kn = new Knock(ServerInstance);
@@ -150,7 +150,7 @@ class ModuleKnockFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleKnockFactory;
 }
index f3ac9334765e4a96e6359a6740a4e48772969902..8a8471aa5822057cea61bbafa2eee53360c3a2a8 100644 (file)
@@ -84,7 +84,7 @@ private:
        }
 
 public:
-       ModuleLockserv(InspIRCd* Me) : Module::Module(Me)
+       ModuleLockserv(InspIRCd* Me) : Module(Me)
        {
                ResetLocked();
                lockcommand = new cmd_lockserv(ServerInstance, locked);
@@ -146,7 +146,7 @@ public:
        }
 };
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleLockservFactory;
 }
index d43204b99238cefec3d0f8e9974d96be97621494..19b351e0cc033fb0486e3a034bf11192556eec25 100644 (file)
@@ -270,7 +270,7 @@ class ModuleMD5 : public Module
  public:
 
        ModuleMD5(InspIRCd* Me)
-               : Module::Module(Me), key(NULL), chars(NULL)
+               : Module(Me), key(NULL), chars(NULL)
        {
                ServerInstance->PublishInterface("HashRequest", this);
        }
@@ -341,7 +341,7 @@ class ModuleMD5Factory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleMD5Factory;
 }
index 6f3beb5125593ac3149bed117baf5c1f0b969498..ae458a0d6eb93a0f2b59c7209ef05075f748ce0b 100644 (file)
@@ -196,7 +196,7 @@ class ModuleMsgFlood : public Module
  public:
  
        ModuleMsgFlood(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                mf = new MsgFlood(ServerInstance);
@@ -309,7 +309,7 @@ class ModuleMsgFloodFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleMsgFloodFactory;
 }
index db8270cb9a6380f02959010c47653aa19e94d106..f078aa8bfa7db7615eeb647ecbab2faf8e609679 100644 (file)
@@ -25,7 +25,7 @@ class ModuleNamesX : public Module
  public:
        
        ModuleNamesX(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
        }
 
@@ -143,7 +143,7 @@ class ModuleNamesXFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleNamesXFactory;
 }
index dd51be1ccc98f21dc5e483daaed3425b1a0e8096..f80bff5b186c415046fafad678fb3415a2fbbe69 100644 (file)
@@ -112,7 +112,7 @@ class ModuleNickLock : public Module
        char* n;
  public:
        ModuleNickLock(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                cmd1 = new cmd_nicklock(ServerInstance);
@@ -181,7 +181,7 @@ class ModuleNickLockFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleNickLockFactory;
 }
index 029a950651e51127a1ba0c6ae39e5d8e0030895d..7ac9e0824ab13750a0e2206e9eb1edb2f8be3f86 100644 (file)
@@ -56,7 +56,7 @@ class ModuleNoCTCP : public Module
  public:
  
        ModuleNoCTCP(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                nc = new NoCTCP(ServerInstance);
@@ -126,7 +126,7 @@ class ModuleNoCTCPFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleNoCTCPFactory;
 }
index 0b4e1723b552f1f44b7db9eecbb4735449377906..db3ae400f70f56208de18b18033bbef88f030e33 100644 (file)
@@ -51,7 +51,7 @@ class ModuleNoInvite : public Module
        NoInvite *ni;
  public:
 
-       ModuleNoInvite(InspIRCd* Me) : Module::Module(Me)
+       ModuleNoInvite(InspIRCd* Me) : Module(Me)
        {
                ni = new NoInvite(ServerInstance);
                if (!ServerInstance->AddMode(ni, 'V'))
@@ -104,7 +104,7 @@ class ModuleNoInviteFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleNoInviteFactory;
 }
index c5ad179e8a64fdcd21d19b05c1c043d2144c78e3..975d86e3bf81165b92d76a34b6b110ff22919a20 100644 (file)
@@ -57,7 +57,7 @@ class ModuleNoKicks : public Module
  public:
  
        ModuleNoKicks(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                nk = new NoKicks(ServerInstance);
@@ -124,7 +124,7 @@ class ModuleNoKicksFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleNoKicksFactory;
 }
index 103d07c2a5eb46eca8774c5eff9f6a8cd56f285b..1ac82ed29c31bfdfcc8da5ea2e4bde2124eaf7b1 100644 (file)
@@ -53,7 +53,7 @@ class ModuleNoNickChange : public Module
        NoNicks* nn;
  public:
        ModuleNoNickChange(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                nn = new NoNicks(ServerInstance);
@@ -120,7 +120,7 @@ class ModuleNoNickChangeFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleNoNickChangeFactory;
 }
index 31d423996a76cd974644b84efc50cf3fd864a0a3..528eeb0f4e276a8475abeb65ac3a775b21ed7923 100644 (file)
@@ -53,7 +53,7 @@ class ModuleNoNotice : public Module
  public:
  
        ModuleNoNotice(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                nt = new NoNotice(ServerInstance);
@@ -120,7 +120,7 @@ class ModuleNoNoticeFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleNoNoticeFactory;
 }
index 8c9ca0556faf3f48c8d985bcf9c1c427cf7aca1e..80869898cc0445fcc60efeb905ae90ab025c95aa 100644 (file)
@@ -79,7 +79,7 @@ class ModuleOperHash : public Module
  public:
 
        ModuleOperHash(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
 
                /* Read the config file first */
@@ -182,7 +182,7 @@ class ModuleOperHashFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleOperHashFactory;
 }
index 6b89332be4c2aa39fb5802331d4f944987587756..15ef0faf93a944e4d41f7be8767c5d7f1b14a970 100644 (file)
@@ -53,7 +53,7 @@ class ModuleOperChans : public Module
        OperChans* oc;
  public:
        ModuleOperChans(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                                
                oc = new OperChans(ServerInstance);
@@ -114,7 +114,7 @@ class ModuleOperChansFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleOperChansFactory;
 }
index c733bd3a11573da32df26c1a5a5200c6170ebc2d..12c17745a83a9d804d16b6388a1cb27cb763addf 100644 (file)
@@ -44,7 +44,7 @@ class ModuleOperjoin : public Module
                }
 
        public:
-               ModuleOperjoin(InspIRCd* Me) : Module::Module(Me)
+               ModuleOperjoin(InspIRCd* Me) : Module(Me)
                {
                        OnRehash(NULL, "");
                }
@@ -104,7 +104,7 @@ class ModuleOperjoinFactory : public ModuleFactory
                }
 };
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleOperjoinFactory;
 }
index 1291b28de9d7c4eb09254861e25d248acc3b0cbb..8832596f63161292540d049a4f4130b11269956a 100644 (file)
@@ -33,7 +33,7 @@ class ModuleOperLevels : public Module
        public:
 
                ModuleOperLevels(InspIRCd* Me)
-                       : Module::Module(Me)
+                       : Module(Me)
                {
 
                        
@@ -117,7 +117,7 @@ class ModuleOperLevelsFactory : public ModuleFactory
 
 };
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleOperLevelsFactory;
 }
index 1954153405630a56f5fa4e66e76b246ce2255bc8..ce6e7aea4188a7fbcbdbd9243ec1aa1c38176b10 100644 (file)
@@ -24,7 +24,7 @@ class ModuleOperLog : public Module
  private:
         
  public:
-       ModuleOperLog(InspIRCd* Me) : Module::Module(Me)
+       ModuleOperLog(InspIRCd* Me) : Module(Me)
        {
                
        }
@@ -94,7 +94,7 @@ class ModuleOperLogFactory : public ModuleFactory
  
 };
  
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleOperLogFactory;
 }
index 43c271c3d15e0cb120247dc495b3fffbf04067da..30f6fef9cbefdc24d59bf33556e27645818d999d 100644 (file)
@@ -29,7 +29,7 @@ class ModuleModesOnOper : public Module
 
  public:
        ModuleModesOnOper(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                Conf = new ConfigReader(ServerInstance);
@@ -82,7 +82,7 @@ class ModuleModesOnOper : public Module
                                                tokens.push_back(buf);
 
                                        int size = tokens.size() + 1;
-                                       const char* modes[size];
+                                       char** modes = new char*[size];
                                        modes[0] = user->nick;
                                        modes[1] = (char*)tokens[0].c_str();
 
@@ -103,7 +103,8 @@ class ModuleModesOnOper : public Module
                                                n.push_back(modes[j]);
                                        }
                                        rmode.Send(ServerInstance);
-                                       ServerInstance->SendMode(modes, size, user);
+                                       ServerInstance->SendMode((const char**)modes, size, user);
+                                       delete [] modes;
                                }
                                break;
                        }
@@ -132,7 +133,7 @@ class ModuleModesOnOperFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleModesOnOperFactory;
 }
index 447468cafa9196a107e570a4d01a583abf071135..f08b287bdee4b65f42f661137e05c435f130e73e 100644 (file)
@@ -81,7 +81,7 @@ class ModuleOpermotd : public Module
        }
        
        ModuleOpermotd(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                opermotd = NULL;
                mycommand = new cmd_opermotd(ServerInstance);
@@ -132,7 +132,7 @@ class ModuleOpermotdFactory : public ModuleFactory
        }
 };
 
-extern "C" void* init_module(void)
+extern "C" DllExport void* init_module(void)
 {
        return new ModuleOpermotdFactory;
 }
index 31b52e853fd18a65f0fb89bf6a86f75b2a1197e8..e7f4241940431f196f58b0de476c20aace05a103 100644 (file)
@@ -33,7 +33,7 @@ class ModuleOverride : public Module
  public:
  
        ModuleOverride(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {               
                // read our config options (main config file)
                OnRehash(NULL,"");
@@ -311,7 +311,7 @@ class ModuleOverrideFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleOverrideFactory;
 }
index 2eb5539b8ce63632055d71fa076dd3cad6b92a07..701e5da91857423ef5ddf3204b84a0778825ea83 100644 (file)
@@ -81,7 +81,7 @@ class ModuleRandQuote : public Module
        ConfigReader *conf;
  public:
        ModuleRandQuote(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                conf = new ConfigReader(ServerInstance);
@@ -157,7 +157,7 @@ class ModuleRandQuoteFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleRandQuoteFactory;
 }
index e09c9b33b184294abcafa94854e7c4b5b737ffb6..492d39e58f242dee488ba5a45abaa267868f5fa0 100644 (file)
@@ -104,7 +104,7 @@ class ModuleRedirect : public Module
  public:
  
        ModuleRedirect(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                re = new Redirect(ServerInstance);
@@ -177,7 +177,7 @@ class ModuleRedirectFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleRedirectFactory;
 }
index 9874936d82c9fe203c2bf2c470fb865e4c6437dc..f4738ef08bea5b79b0c1650e4089bb945f0d13d3 100644 (file)
@@ -22,7 +22,7 @@ class ModuleRegOnlyCreate : public Module
 {
  public:
        ModuleRegOnlyCreate(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
        }
 
@@ -78,7 +78,7 @@ class ModuleRegOnlyCreateFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleRegOnlyCreateFactory;
 }
index e5c433b8437b4f647e3640454f62d2113dd8a221..56a54fc37980de873dbb9e916a6142eb8424a946 100644 (file)
@@ -249,7 +249,7 @@ class ModuleRemove : public Module
        
  public:
        ModuleRemove(InspIRCd* Me)
-       : Module::Module(Me)
+       : Module(Me)
        {
                mycommand = new cmd_remove(ServerInstance, supportnokicks);
                mycommand2 = new cmd_fpart(ServerInstance, supportnokicks);
@@ -308,7 +308,7 @@ class ModuleRemoveFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleRemoveFactory;
 }
index b891d5659cd5ebf80df31d576796119e18f5123f..6f0e991e5a1a6394f9f97cfcd9a62f3c1e3ed46c 100644 (file)
@@ -23,7 +23,7 @@ class ModuleRestrictBanned : public Module
 {
  private:
  public:
-       ModuleRestrictBanned(InspIRCd* Me) : Module::Module(Me)
+       ModuleRestrictBanned(InspIRCd* Me) : Module(Me)
        {
        }
        
@@ -116,7 +116,7 @@ class ModuleRestrictBannedFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleRestrictBannedFactory;
 }
index 68fb7357769d076214361b5e724ffe349c82e09d..eab419c46dfba4ab8aa87f421554f79c5ae965a1 100644 (file)
@@ -43,7 +43,7 @@ class ModuleRestrictChans : public Module
 
  public:
        ModuleRestrictChans(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                ReadConfig();
@@ -105,7 +105,7 @@ class ModuleRestrictChansFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleRestrictChansFactory;
 }
index ce62296acb89d676616a2583a4fed841ae363210..e04366b59ae88b2481c52ba6742167db10e78c2d 100644 (file)
@@ -29,7 +29,7 @@ class ModuleRestrictMsg : public Module
  public:
  
        ModuleRestrictMsg(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
        }
@@ -96,7 +96,7 @@ class ModuleRestrictMsgFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleRestrictMsgFactory;
 }
index 424d012561e07122ba9d40e080c1cdf252253c96..2bcb77a91e64b2ce6c6dd750d7fef799b0ba3c54 100644 (file)
@@ -43,7 +43,7 @@ class ModuleSafeList : public Module
        int global_listing;
        int LimitList;
  public:
-       ModuleSafeList(InspIRCd* Me) : Module::Module(Me)
+       ModuleSafeList(InspIRCd* Me) : Module(Me)
        {
                OnRehash(NULL, "");
        }
@@ -285,7 +285,7 @@ class ModuleSafeListFactory : public ModuleFactory
  
 };
  
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleSafeListFactory;
 }
index b91b1a2f00063deac016c562b373840b04543752..decce5aef363f2c9579ee3e7c51299458da6a8bd 100644 (file)
@@ -96,7 +96,7 @@ class ModuleSajoin : public Module
        cmd_sajoin*     mycommand;
  public:
        ModuleSajoin(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                mycommand = new cmd_sajoin(ServerInstance);
@@ -135,7 +135,7 @@ class ModuleSajoinFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleSajoinFactory;
 }
index ddce91d51e443f636c08c1beebf8370b0b937b87..89956a17d5ffcde29f363d84b9eae270ae2c6775 100644 (file)
@@ -79,7 +79,7 @@ class ModuleSaMode : public Module
        cmd_samode*     mycommand;
  public:
        ModuleSaMode(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                mycommand = new cmd_samode(ServerInstance);
@@ -116,7 +116,7 @@ class ModuleSaModeFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleSaModeFactory;
 }
index 43cb9e6daa1755e2909113bd59f2bed4f6e97bee..34d9f9ab58a65e412a1db02e86e408c8ad58858d 100644 (file)
@@ -78,7 +78,7 @@ class ModuleSanick : public Module
        cmd_sanick*     mycommand;
  public:
        ModuleSanick(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                mycommand = new cmd_sanick(ServerInstance);
@@ -117,7 +117,7 @@ class ModuleSanickFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleSanickFactory;
 }
index 01df5c1be8a05500c4290805cee36448756beb79..680b4b4d45f60fae2c2a350e4facb9dbb9aae39e 100644 (file)
@@ -93,7 +93,7 @@ class ModuleSapart : public Module
        cmd_sapart*     mycommand;
  public:
        ModuleSapart(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                mycommand = new cmd_sapart(ServerInstance);
@@ -132,7 +132,7 @@ class ModuleSapartFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleSapartFactory;
 }
index 5806f43bf694982bc97745502443a05465f46471..a7cacac5c0f5a3cb85d0e906b7f00ffa8dd029f8 100644 (file)
@@ -63,7 +63,7 @@ class ModuleSaquit : public Module
        cmd_saquit*     mycommand;
  public:
        ModuleSaquit(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                mycommand = new cmd_saquit(ServerInstance);
@@ -102,7 +102,7 @@ class ModuleSaquitFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleSaquitFactory;
 }
index 8be50dffea6448cf8154b1de1fa088c2d7dad984..319b58603524d0ddd01b0e8780cd9aac77797867 100644 (file)
@@ -26,7 +26,7 @@ class ModuleSecureList : public Module
        std::vector<std::string> allowlist;
        time_t WaitTime;
  public:
-       ModuleSecureList(InspIRCd* Me) : Module::Module(Me)
+       ModuleSecureList(InspIRCd* Me) : Module(Me)
        {
                OnRehash(NULL,"");
        }
@@ -118,7 +118,7 @@ class ModuleSecureListFactory : public ModuleFactory
  
 };
  
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleSecureListFactory;
 }
index 2e632a5ba1c2d4d7711f8dee36397e156ab1a212..959a62b31d694910dee294a20c8e37e894881d2c 100644 (file)
@@ -24,7 +24,7 @@ class ModuleSeeNicks : public Module
 {
  public:
        ModuleSeeNicks(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                ServerInstance->SNO->EnableSnomask('n',"NICK");
                ServerInstance->SNO->EnableSnomask('N',"REMOTENICK");
@@ -71,7 +71,7 @@ class ModuleSeeNicksFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleSeeNicksFactory;
 }
index 7e6e3121c6a9fd79efe5717a8acabcd05201e8e2..b8638d94a3f9a742dee71eab39e8585597ac4d85 100644 (file)
@@ -173,7 +173,7 @@ class ModuleServices : public Module
        User_R* m5;
  public:
        ModuleServices(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                m1 = new Channel_r(ServerInstance);
@@ -326,7 +326,7 @@ class ModuleServicesFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleServicesFactory;
 }
index 6defa1e2e5badd1d10ae168601815f48ab7b4546..17c0b2bd903dc1e8d72a33ae87b2077ec7484b83 100644 (file)
@@ -116,7 +116,7 @@ class ModuleServicesAccount : public Module
        AChannel_M* m2;
        AUser_R* m3;
  public:
-       ModuleServicesAccount(InspIRCd* Me) : Module::Module(Me)
+       ModuleServicesAccount(InspIRCd* Me) : Module(Me)
        {
                
                m1 = new AChannel_R(ServerInstance);
@@ -349,7 +349,7 @@ class ModuleServicesAccountFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleServicesAccountFactory;
 }
index 6e984a62eab2aab8f38e3ab1c8a9a4a3c9d380a8..62b6bda833a153fc066809d4bdde97b05702427c 100644 (file)
@@ -67,7 +67,7 @@ class ModuleSetHost : public Module
        char hostmap[256];
  public:
        ModuleSetHost(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {       
                OnRehash(NULL,"");
                mycommand = new cmd_sethost(ServerInstance, hostmap);
@@ -122,7 +122,7 @@ class ModuleSetHostFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleSetHostFactory;
 }
index a56aec0d1d0589f400cedf7dd327569226008ee4..f46c7112cf30bb1011f9fd52071c1f08724a6f54 100644 (file)
@@ -58,7 +58,7 @@ class ModuleSetIdent : public Module
        cmd_setident*   mycommand;
        
  public:
-       ModuleSetIdent(InspIRCd* Me) : Module::Module(Me)
+       ModuleSetIdent(InspIRCd* Me) : Module(Me)
        {
                
                mycommand = new cmd_setident(ServerInstance);
@@ -97,7 +97,7 @@ class ModuleSetIdentFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleSetIdentFactory;
 }
index 76a1ea3e52482ec1046aed75cc2ca149c9f6819e..6539bbdc8876b0c47d429ce1b1ae5880eaa516a6 100644 (file)
@@ -55,7 +55,7 @@ class ModuleSetIdle : public Module
        cmd_setidle*    mycommand;
  public:
        ModuleSetIdle(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                mycommand = new cmd_setidle(ServerInstance);
@@ -93,7 +93,7 @@ class ModuleSetIdleFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleSetIdleFactory;
 }
index bb78d6a0f29b9b42877aa9e1763e3b0d0b34f639..8661d9f2cb935527fffb760c4e3781db20fa8063 100644 (file)
@@ -52,7 +52,7 @@ class ModuleSetName : public Module
        cmd_setname*    mycommand;
  public:
        ModuleSetName(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                mycommand = new cmd_setname(ServerInstance);
@@ -91,7 +91,7 @@ class ModuleSetNameFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleSetNameFactory;
 }
index 6ba625a412673444f729c7ab90fff99e0a912610..6e1ac0e56aa9dc033e8728c45623687c25a41d2a 100644 (file)
@@ -139,7 +139,7 @@ uint32_t sha256_k[64] =
 
 class ModuleSHA256 : public Module
 {
-       void SHA256Init(struct SHA256Context *ctx, const unsigned int* key)
+       void SHA256Init(SHA256Context *ctx, const unsigned int* key)
        {
                if (key)
                {
@@ -155,7 +155,7 @@ class ModuleSHA256 : public Module
                ctx->tot_len = 0;
        }
 
-       void SHA256Transform(struct SHA256Context *ctx, unsigned char *message, unsigned int block_nb)
+       void SHA256Transform(SHA256Context *ctx, unsigned char *message, unsigned int block_nb)
        {
                uint32_t w[64];
                uint32_t wv[8];
@@ -189,7 +189,7 @@ class ModuleSHA256 : public Module
                }
        }
        
-       void SHA256Update(struct SHA256Context *ctx, unsigned char *message, unsigned int len)
+       void SHA256Update(SHA256Context *ctx, unsigned char *message, unsigned int len)
        {
                unsigned int rem_len = SHA256_BLOCK_SIZE - ctx->len;
                memcpy(&ctx->block[ctx->len], message, rem_len);
@@ -209,7 +209,7 @@ class ModuleSHA256 : public Module
                ctx->tot_len += (block_nb + 1) << 6;
        }
        
-       void SHA256Final(struct SHA256Context *ctx, unsigned char *digest)
+       void SHA256Final(SHA256Context *ctx, unsigned char *digest)
        {
                unsigned int block_nb = (1 + ((SHA256_BLOCK_SIZE - 9) < (ctx->len % SHA256_BLOCK_SIZE)));
                unsigned int len_b = (ctx->tot_len + ctx->len) << 3;
@@ -226,7 +226,7 @@ class ModuleSHA256 : public Module
        {
                // Generate the hash
                unsigned char bytehash[SHA256_DIGEST_SIZE];
-               struct SHA256Context ctx;
+               SHA256Context ctx;
                SHA256Init(&ctx, key);
                SHA256Update(&ctx, (unsigned char *)src, (unsigned int)len);
                SHA256Final(&ctx, bytehash);
@@ -244,7 +244,7 @@ class ModuleSHA256 : public Module
 
  public:
 
-       ModuleSHA256(InspIRCd* Me) : Module::Module(Me), key(NULL), chars(NULL)
+       ModuleSHA256(InspIRCd* Me) : Module(Me), key(NULL), chars(NULL)
        {
                ServerInstance->PublishInterface("HashRequest", this);
        }
@@ -313,7 +313,7 @@ public:
 
 };
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleSHA256Factory;
 }
index 2b83243c110499d2ca74d6df3decbc0949670b05..70c9865e17a12c2cdf00f75f8dbbdeb782519de0 100644 (file)
@@ -59,7 +59,7 @@ class ModuleShowwhois : public Module
 
  public:
 
-       ModuleShowwhois(InspIRCd* Me) : Module::Module(Me)
+       ModuleShowwhois(InspIRCd* Me) : Module(Me)
        {
                
                sw = new SeeWhois(ServerInstance);
@@ -124,7 +124,7 @@ class ModuleShowwhoisFactory : public ModuleFactory
 
 };
 
-extern "C" void* init_module()
+extern "C" DllExport void* init_module()
 {
        return new ModuleShowwhoisFactory;
 }
index 42b7f96e9ef9df79dacffc6f7f8ff441137eed31..773d28ecec5991222301d6f5f578f27d24e5985d 100644 (file)
@@ -136,7 +136,7 @@ class ModuleSilence : public Module
  public:
  
        ModuleSilence(InspIRCd* Me)
-               : Module::Module(Me), maxsilence(32)
+               : Module(Me), maxsilence(32)
        {
                OnRehash(NULL, "");
                mycommand = new cmd_silence(ServerInstance, maxsilence);
@@ -235,7 +235,7 @@ class ModuleSilenceFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleSilenceFactory;
 }
index e58e626c71f7464b36da365549c80f548d1c6408..8b7ac9fbee0af0c0dc70a557104147d8540d7bc3 100644 (file)
@@ -243,7 +243,7 @@ class ModuleSilence : public Module
  public:
  
        ModuleSilence(InspIRCd* Me)
-               : Module::Module(Me), maxsilence(32)
+               : Module(Me), maxsilence(32)
        {
                OnRehash(NULL, "");
                mycommand = new cmd_silence(ServerInstance,maxsilence);
@@ -393,7 +393,7 @@ class ModuleSilenceFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleSilenceFactory;
 }
index d037b7101ccf401b88ec8b24b3678363055b6a34..50de7da64446d979d9aa1aa07a908bdad30ba6d1 100644 (file)
@@ -37,7 +37,7 @@
 /* $ModDep: m_spanningtree/timesynctimer.h m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h m_spanningtree/rconnect.h */
 
 ModuleSpanningTree::ModuleSpanningTree(InspIRCd* Me)
-       : Module::Module(Me), max_local(0), max_global(0)
+       : Module(Me), max_local(0), max_global(0)
 {
        ServerInstance->UseInterface("InspSocketHook");
        Utils = new SpanningTreeUtilities(Me, this);
@@ -1379,7 +1379,7 @@ class ModuleSpanningTreeFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleSpanningTreeFactory;
 }
index b858061cb0e1970e550950db32850c78b39be228..27737c7ff1b5c68cb9bec4abd2c1e67e8c682c3b 100644 (file)
@@ -294,12 +294,18 @@ std::string TreeSocket::RandString(unsigned int length)
 {
        char* randombuf = new char[length+1];
        std::string out;
+#ifdef WINDOWS
+       int fd = -1;
+#else
        int fd = open("/dev/urandom", O_RDONLY, 0);
+#endif
 
        if (fd >= 0)
        {
+#ifndef WINDOWS
                read(fd, randombuf, length);
                close(fd);
+#endif
        }
        else
        {
index afba5b96a7c71188694506e2233760a5e9cfb8ea..da4dd5d4c4afc8f905e3ad7c0f02ae3620a93eab 100644 (file)
@@ -1496,19 +1496,13 @@ bool TreeSocket::ProcessLine(std::string &line)
                                        {
                                                strparams[q] = params[q].c_str();
                                        }
-                                       switch (this->Instance->CallCommandHandler(command.c_str(), strparams, params.size(), who))
+                                       if(!this->Instance->CallCommandHandler(command.c_str(), strparams, params.size(), who))
                                        {
-                                               case CMD_INVALID:
-                                                       this->SendError("Unrecognised command '"+std::string(command.c_str())+"' -- possibly loaded mismatched modules");
-                                                       return false;
-                                               break;
-                                               case CMD_FAILURE:
-                                                       return true;
-                                               break;
-                                               default:
-                                                       /* CMD_SUCCESS and CMD_USER_DELETED fall through here */
-                                               break;
+                                               this->SendError("Unrecognised command '"+std::string(command.c_str())+"' -- possibly loaded mismatched modules");
+                                               return false;
                                        }
+                                       else
+                                               return true;
                                }
                                else
                                {
index 1c94e264fecbdb8050074017717a168a7a73bffa..cb783a81a16bcf2393d1bcc4f9e28b67a48ba91f 100644 (file)
@@ -29,7 +29,11 @@ class ModuleSpanningTree;
 /* This hash_map holds the hash equivalent of the server
  * tree, used for rapid linear lookups.
  */
+#ifdef WINDOWS
+typedef nspace::hash_map<std::string, TreeServer*, nspace::hash_compare<string, less<string> > > server_hash;
+#else
 typedef nspace::hash_map<std::string, TreeServer*, nspace::hash<string>, irc::StrHashComp> server_hash;
+#endif
 
 typedef std::map<TreeServer*,TreeServer*> TreeServerList;
 
index f0c361d82ad6e2bdb7dd004a2c15852c36f9e4d4..356000f97cf68624d774ed3f1512fdb5a3b03a12 100644 (file)
@@ -142,7 +142,7 @@ class ModuleSpy : public Module
        cmd_spylist *mycommand;
        cmd_spynames *mycommand2;
  public:
-       ModuleSpy(InspIRCd* Me) : Module::Module(Me)
+       ModuleSpy(InspIRCd* Me) : Module(Me)
        {
                
                mycommand = new cmd_spylist(ServerInstance);
@@ -181,7 +181,7 @@ class ModuleSpyFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleSpyFactory;
 }
index 6f1ee47891cb061ebdf17f83282fcd133d39a91c..9995e7524f925f7edd3129b7fc29f9bf26532d7f 100644 (file)
@@ -24,7 +24,7 @@ class ModuleSSLDummy : public Module
        char* dummy;
  public:
        
-       ModuleSSLDummy(InspIRCd* Me)    : Module::Module(Me)
+       ModuleSSLDummy(InspIRCd* Me)    : Module(Me)
        {
                
        }
@@ -100,7 +100,7 @@ class ModuleSSLDummyFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleSSLDummyFactory;
 }
index 36f1e428ab2d5f5b053aad24c0f2094e8c9a9f02..92f623fe1e149d60c0f19973090655cc9e8be0d6 100644 (file)
@@ -73,7 +73,7 @@ class ModuleSSLModes : public Module
        
  public:
        ModuleSSLModes(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
 
@@ -139,7 +139,7 @@ class ModuleSSLModesFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleSSLModesFactory;
 }
index 76bc56ef5d6df97e3ad47aa8e7703bbbcf62c5c9..e3ee3fe2fb5c8abc2e52b35dc0d23a03bc492255 100644 (file)
@@ -90,7 +90,7 @@ class ModuleStripColor : public Module
        UserStripColor *usc;
  
  public:
-       ModuleStripColor(InspIRCd* Me) : Module::Module(Me)
+       ModuleStripColor(InspIRCd* Me) : Module(Me)
        {
                usc = new UserStripColor(ServerInstance);
                csc = new ChannelStripColor(ServerInstance);
@@ -224,7 +224,7 @@ class ModuleStripColorFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleStripColorFactory;
 }
index abef3d713f11a8b3052b435089e9930858f6c127..5e0f072f8860e97198ef19dff45db8151d2127bc 100644 (file)
@@ -153,7 +153,7 @@ class ModuleSVSHold : public Module
        
 
  public:
-       ModuleSVSHold(InspIRCd* Me) : Module::Module(Me)
+       ModuleSVSHold(InspIRCd* Me) : Module(Me)
        {
                mycommand = new cmd_svshold(Me);
                ServerInstance->AddCommand(mycommand);
@@ -290,7 +290,7 @@ class ModuleSVSHoldFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleSVSHoldFactory;
 }
index a79b1d10ae997c38f36d88862b3bb495cbc78a91..193191ab5723e285874e5d08636bee65a01ea307 100644 (file)
@@ -81,7 +81,7 @@ class ModuleSWhois : public Module
        ConfigReader* Conf;
        
  public:
-       ModuleSWhois(InspIRCd* Me) : Module::Module(Me)
+       ModuleSWhois(InspIRCd* Me) : Module(Me)
        {
                
                Conf = new ConfigReader(ServerInstance);
@@ -275,7 +275,7 @@ class ModuleSWhoisFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleSWhoisFactory;
 }
index c573e77610d03e1505f62d857f1c84f53280f886..9fb38d98e075b1938f4030ab57b5f12c165fb547 100644 (file)
@@ -62,7 +62,7 @@ class ModuleTaxonomy : public Module
        bool claimed;
  public:
        ModuleTaxonomy(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                // Create a new command
@@ -116,7 +116,7 @@ class ModuleTaxonomyFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleTaxonomyFactory;
 }
index 015c8b1df615063f88baad682c44117c5e77af7f..e32e5f8469f899a558fa633488199c7e863b997d 100644 (file)
@@ -80,7 +80,7 @@ class ModuleTestCommand : public Module
        cmd_woot* newcommand;
  public:
        ModuleTestCommand(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                // Create a new command
@@ -123,7 +123,7 @@ class ModuleTestCommandFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleTestCommandFactory;
 }
index ec257d1e156ae70d397216c44016a00db700c2ad..a1fb41439e2898f04fe270c525e312ee32d44f6e 100644 (file)
@@ -115,7 +115,7 @@ class ModuleTimedBans : public Module
        cmd_tban* mycommand;
  public:
        ModuleTimedBans(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                mycommand = new cmd_tban(ServerInstance);
@@ -224,7 +224,7 @@ class ModuleTimedBansFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleTimedBansFactory;
 }
index 801218377066286e78aece23fd19774370a0b97e..b5017ea2dfef90403ab8ae8edd1a25beecaa4717 100644 (file)
@@ -73,7 +73,7 @@ class ModuleTLine : public Module
        cmd_tline* newcommand;
  public:
        ModuleTLine(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                newcommand = new cmd_tline(ServerInstance);
@@ -114,7 +114,7 @@ class ModuleTLineFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleTLineFactory;
 }
index 3663ab4ca488e08a5295478da8cf574c4c494f74..a3caf70825cc19f32df2c56c98fe0fb6e8fccd2a 100644 (file)
@@ -26,7 +26,7 @@ class ModuleUHNames : public Module
  public:
        
        ModuleUHNames(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
        }
 
@@ -113,7 +113,7 @@ class ModuleUHNamesFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleUHNamesFactory;
 }
index a81952f10a6afe173505b99f716374baff5c36a4..babc4dc9f86e69f05228ec2f8542e04af3147dfb 100644 (file)
@@ -87,7 +87,7 @@ class ModuleUninvite : public Module
 
  public:
 
-       ModuleUninvite(InspIRCd* Me) : Module::Module(Me)
+       ModuleUninvite(InspIRCd* Me) : Module(Me)
        {
                
                mycommand = new cmd_uninvite(ServerInstance);
@@ -124,7 +124,7 @@ class ModuleUninviteFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleUninviteFactory;
 }
index beab03e7e76fa8a519fe175701f6d4c5486d61cd..b623c39bae209a87568cc698d14812fb747954fb 100644 (file)
@@ -56,7 +56,7 @@ class ModuleUserIP : public Module
        cmd_userip* mycommand;
  public:
        ModuleUserIP(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                mycommand = new cmd_userip(ServerInstance);
@@ -105,7 +105,7 @@ class ModuleUserIPFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleUserIPFactory;
 }
index 0a08c7194a8584f4ce95829d10a45aceb2a74646..02926dbfabab539b869fbc8a9069a6aed05220dd 100644 (file)
@@ -61,7 +61,7 @@ class ModuleVHost : public Module
        cmd_vhost* mycommand;
         
  public:
-       ModuleVHost(InspIRCd* Me) : Module::Module(Me)
+       ModuleVHost(InspIRCd* Me) : Module(Me)
        {
                
                Conf = new ConfigReader(ServerInstance);
@@ -113,7 +113,7 @@ class ModuleVHostFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleVHostFactory;
 }
index b46d80b54422a68ce2880afa46c666d8d5ac5f70..ef0f897d268ce61c1e86062fd969525560698cd3 100644 (file)
  * of users using WATCH.
  */
 
+#ifdef WINDOWS
+typedef nspace::hash_map<irc::string, std::deque<userrec*>, nspace::hash_compare<irc::string, less<irc::string> > >     watchentries;
+#else
 typedef nspace::hash_map<irc::string, std::deque<userrec*>, nspace::hash<irc::string> >     watchentries;
+#endif
 typedef std::map<irc::string, std::string>                                                  watchlist;
 
 /* Who's watching each nickname.
@@ -301,7 +305,7 @@ class Modulewatch : public Module
  public:
 
        Modulewatch(InspIRCd* Me)
-               : Module::Module(Me), maxwatch(32)
+               : Module(Me), maxwatch(32)
        {
                OnRehash(NULL, "");
                whos_watching_me = new watchentries();
@@ -480,7 +484,7 @@ class ModulewatchFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModulewatchFactory;
 }
index 1cf9fafa21387959c543634c08c280a49f521125..3603f2fb5c5cdbd9a32605cb10dab72dfa7a1174 100644 (file)
@@ -29,7 +29,7 @@ class ModuleXMLSocket : public Module
  public:
 
        ModuleXMLSocket(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                OnRehash(NULL,"");
        }
@@ -146,7 +146,7 @@ class ModuleXMLSocket : public Module
                        return -1;
 
                /* We want to alter the buffer, so we have to make a copy */
-               char tmpbuffer[count+1];
+               char * tmpbuffer = new char[count + 1];
                memcpy(tmpbuffer, buffer, count);
 
                /* XXX: This will actually generate lines "looking\0\0like\0\0this"
@@ -160,6 +160,7 @@ class ModuleXMLSocket : public Module
                                tmpbuffer[n] = 0;
 
                user->AddWriteBuf(std::string(tmpbuffer,count));
+               delete [] tmpbuffer;
 
                return 1;
        }
@@ -184,7 +185,7 @@ class ModuleXMLSocketFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleXMLSocketFactory;
 }
index 2e7d04fdf75edc2cac34bcb37aa547c8570c465c..5882a1c0f693d157ed4dfd31d44ef1cd18612675 100644 (file)
@@ -25,7 +25,7 @@ using namespace irc::sockets;
  * ((-1) << (8 - (mask % 8)))
  * But imho, it sucks in comparison to a nice neat lookup table.
  */
-const char inverted_bits[8] = {        0x00, /* 00000000 - 0 bits - never actually used */
+const unsigned char inverted_bits[8] = {       0x00, /* 00000000 - 0 bits - never actually used */
                                0x80, /* 10000000 - 1 bits */
                                0xC0, /* 11000000 - 2 bits */
                                0xE0, /* 11100000 - 3 bits */
@@ -89,9 +89,9 @@ void ListenSocket::HandleEvent(EventType et, int errornum)
        uslen = sizeof(sockaddr_in);
        length = sizeof(sockaddr_in);
 #endif
-       incomingSockfd = accept (this->GetFd(), (sockaddr*)client, &length);
+       incomingSockfd = _accept (this->GetFd(), (sockaddr*)client, &length);
 
-       if ((incomingSockfd > -1) && (!getsockname(incomingSockfd, sock_us, &uslen)))
+       if ((incomingSockfd > -1) && (!_getsockname(incomingSockfd, sock_us, &uslen)))
        {
                char buf[MAXBUF];
 #ifdef IPV6
@@ -303,14 +303,24 @@ bool irc::sockets::MatchCIDR(const char* address, const char* cidr_mask, bool ma
 
 void irc::sockets::Blocking(int s)
 {
-       int flags = fcntl(s, F_GETFL, 0);
+#ifndef WIN32
+    int flags = fcntl(s, F_GETFL, 0);
        fcntl(s, F_SETFL, flags ^ O_NONBLOCK);
+#else
+    unsigned long opt = 0;
+    ioctlsocket(s, FIONBIO, &opt);
+#endif
 }
 
 void irc::sockets::NonBlocking(int s)
 {
-       int flags = fcntl(s, F_GETFL, 0);
+#ifndef WIN32
+    int flags = fcntl(s, F_GETFL, 0);
        fcntl(s, F_SETFL, flags | O_NONBLOCK);
+#else
+    unsigned long opt = 1;
+    ioctlsocket(s, FIONBIO, &opt);
+#endif
 }
 
 /** This will bind a socket to a port. It works for UDP/TCP.
@@ -458,11 +468,11 @@ int irc::sockets::OpenTCPSocket(char* addr, int socktype)
        }
        else
        {
-               setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
+               setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (char*)&on, sizeof(on));
                /* This is BSD compatible, setting l_onoff to 0 is *NOT* http://web.irc.org/mla/ircd-dev/msg02259.html */
                linger.l_onoff = 1;
                linger.l_linger = 1;
-               setsockopt(sockfd, SOL_SOCKET, SO_LINGER, &linger,sizeof(linger));
+               setsockopt(sockfd, SOL_SOCKET, SO_LINGER, (char*)&linger,sizeof(linger));
                return (sockfd);
        }
 }
index 668335e6b17c0abcee8ed42a92415c7e23ab9efb..48f7e11bf611d7e2f05df7af0d2e2dd7260c59b7 100644 (file)
@@ -62,7 +62,7 @@ bool SocketEngine::HasFd(int fd)
 EventHandler* SocketEngine::GetRef(int fd)
 {
        if ((fd < 0) || (fd > MAX_DESCRIPTORS))
-               return false;
+               return 0;
        return ref[fd];
 }
 
index 645e07046a3ce674573c24f3ecae272be739b6e1..e79d27c8b74cfc70290235b97c4fd70bd538a2ec 100644 (file)
@@ -61,7 +61,7 @@ bool DoType(ServerConfig* conf, const char* tag, char** entries, ValueList &valu
        const char* TypeName = values[0].GetString();
        const char* Classes = values[1].GetString();
 
-       conf->opertypes[TypeName] = strdup(Classes);
+       conf->opertypes[TypeName] = strnewdup(Classes);
        return true;
 }
 
@@ -70,7 +70,7 @@ bool DoClass(ServerConfig* conf, const char* tag, char** entries, ValueList &val
        const char* ClassName = values[0].GetString();
        const char* CommandList = values[1].GetString();
 
-       conf->operclass[ClassName] = strdup(CommandList);
+       conf->operclass[ClassName] = strnewdup(CommandList);
        return true;
 }
 
@@ -473,7 +473,11 @@ int userrec::ReadData(void* buffer, size_t size)
 {
        if (IS_LOCAL(this))
        {
+#ifndef WIN32
                return read(this->fd, buffer, size);
+#else
+        return recv(this->fd, (char*)buffer, size, 0);
+#endif
        }
        else
                return 0;
@@ -714,7 +718,11 @@ void userrec::FlushWriteBuf()
                if ((sendq.length()) && (this->fd != FD_MAGIC_NUMBER))
                {
                        int old_sendq_length = sendq.length();
-                       int n_sent = write(this->fd, this->sendq.data(), this->sendq.length());
+#ifndef WIN32
+            int n_sent = write(this->fd, this->sendq.data(), this->sendq.length());
+#else
+            int n_sent = send(this->fd, (const char*)this->sendq.data(), this->sendq.length(), 0);
+#endif
                        if (n_sent == -1)
                        {
                                if (errno == EAGAIN)
@@ -934,11 +942,13 @@ void userrec::AddClient(InspIRCd* Instance, int socket, int port, bool iscached,
         * which for the time being is a physical impossibility (even the largest networks dont have more
         * than about 10,000 users on ONE server!)
         */
+#ifndef WINDOWS
        if ((unsigned int)socket >= MAX_DESCRIPTORS)
        {
                userrec::QuitUser(Instance, New, "Server is full");
                return;
        }
+#endif
 
        New->exempt = (Instance->XLines->matches_exception(New) != NULL);
        if (!New->exempt)
@@ -1336,7 +1346,11 @@ const char* userrec::GetIPString(char* buf)
  */
 void userrec::Write(std::string text)
 {
+#ifdef WINDOWS
+       if ((this->fd < 0) || (this->m_internalFd > MAX_DESCRIPTORS))
+#else
        if ((this->fd < 0) || (this->fd > MAX_DESCRIPTORS))
+#endif
                return;
 
        try
index f888b68cfb7943883d54ab7d86bb73ba264c1161..3ea64bd2cefce394386655875f86e6dde2353530 100644 (file)
@@ -28,7 +28,7 @@ using irc::sockets::MatchCIDR;
 // (unattributed to any author) all over the 'net.
 // For now, we'll just consider this public domain.
 
-bool csmatch(const char *str, const char *mask)
+CoreExport bool csmatch(const char *str, const char *mask)
 {
        unsigned char *cp = NULL, *mp = NULL;
        unsigned char* string = (unsigned char*)str;
@@ -77,7 +77,7 @@ bool csmatch(const char *str, const char *mask)
        return !*wild;
 }
 
-bool match(const char *str, const char *mask)
+CoreExport bool match(const char *str, const char *mask)
 {
        unsigned char *cp = NULL, *mp = NULL;
        unsigned char* string = (unsigned char*)str;
@@ -127,21 +127,21 @@ bool match(const char *str, const char *mask)
 }
 
 /* Overloaded function that has the option of using cidr */
-bool match(const char *str, const char *mask, bool use_cidr_match)
+CoreExport bool match(const char *str, const char *mask, bool use_cidr_match)
 {
        if (use_cidr_match && MatchCIDR(str, mask, true))
                return true;
        return match(str, mask);
 }
 
-bool match(bool case_sensitive, const char *str, const char *mask, bool use_cidr_match)
+CoreExport bool match(bool case_sensitive, const char *str, const char *mask, bool use_cidr_match)
 {
        if (use_cidr_match && MatchCIDR(str, mask, true))
                return true;
        return csmatch(str, mask);
 }
 
-bool match(bool case_sensitive, const char *str, const char *mask)
+CoreExport bool match(bool case_sensitive, const char *str, const char *mask)
 {
        return case_sensitive ? csmatch(str, mask) : match(str, mask);
 }