]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/socketengines/socketengine_poll.h
Add contents of LDFLAGS in addition to CXXFLAGS
[user/henk/code/inspircd.git] / include / socketengines / socketengine_poll.h
index 4669ecfbac315a414f729801a96e5cfc47834df1..df1100d095fb78cf2991d9c488adc6ee00f621b4 100644 (file)
@@ -2,8 +2,8 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
 #include "inspircd_config.h"
 #include "inspircd.h"
 #include "socketengine.h"
-#ifndef __USE_XOPEN
-        #define __USE_XOPEN /* fuck every fucking OS ever made. needed by poll.h to work.*/
+
+#ifndef WINDOWS
+       #ifndef __USE_XOPEN
+           #define __USE_XOPEN /* fuck every fucking OS ever made. needed by poll.h to work.*/
+       #endif
+       #include <poll.h>
+       #include <sys/poll.h>
+#else
+       /* *grumble* */
+       #define struct pollfd WSAPOLLFD
+       #define poll WSAPoll
 #endif
-#include <poll.h>
-#include <sys/poll.h>
 
 class InspIRCd;
 
@@ -36,6 +43,9 @@ private:
        /** These are used by poll() to hold socket events
         */
        struct pollfd *events;
+       /** This map maps fds to an index in the events array.
+        */
+       std::map<int, unsigned int> fd_mappings;
 public:
        /** Create a new PollEngine
         * @param Instance The creator of this object
@@ -45,6 +55,7 @@ public:
         */
        virtual ~PollEngine();
        virtual bool AddFd(EventHandler* eh);
+       virtual EventHandler* GetRef(int fd);
        virtual int GetMaxFds();
        virtual int GetRemainingFds();
        virtual bool DelFd(EventHandler* eh, bool force = false);