summaryrefslogtreecommitdiffstats
path: root/libs/enet/include/enet/unix.h
diff options
context:
space:
mode:
authorBernd Wachter <bwachter-tmw@lart.info>2010-08-13 19:14:33 +0300
committerBernd Wachter <bwachter-mana@lart.info>2010-08-15 00:34:50 +0300
commit3a6ff85e8f03960fc0709ed1cb203a44b8c4d6b5 (patch)
treed23df8e53f5868e450e98fdc266b1c8a36f1a386 /libs/enet/include/enet/unix.h
parentab0933b5a4c6cd3ca9f6b13bd011c7e0bf4e546e (diff)
downloadmanaserv-3a6ff85e8f03960fc0709ed1cb203a44b8c4d6b5.tar.gz
manaserv-3a6ff85e8f03960fc0709ed1cb203a44b8c4d6b5.tar.xz
manaserv-3a6ff85e8f03960fc0709ed1cb203a44b8c4d6b5.zip
Add enet files
Diffstat (limited to 'libs/enet/include/enet/unix.h')
-rw-r--r--libs/enet/include/enet/unix.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/libs/enet/include/enet/unix.h b/libs/enet/include/enet/unix.h
new file mode 100644
index 0000000..087015e
--- /dev/null
+++ b/libs/enet/include/enet/unix.h
@@ -0,0 +1,45 @@
+/**
+ @file unix.h
+ @brief ENet Unix header
+*/
+#ifndef __ENET_UNIX_H__
+#define __ENET_UNIX_H__
+
+#include <stdlib.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <unistd.h>
+
+typedef int ENetSocket;
+
+enum
+{
+ ENET_SOCKET_NULL = -1
+};
+
+#define ENET_HOST_TO_NET_16(value) (htons (value)) /**< macro that converts host to net byte-order of a 16-bit value */
+#define ENET_HOST_TO_NET_32(value) (htonl (value)) /**< macro that converts host to net byte-order of a 32-bit value */
+
+#define ENET_NET_TO_HOST_16(value) (ntohs (value)) /**< macro that converts net to host byte-order of a 16-bit value */
+#define ENET_NET_TO_HOST_32(value) (ntohl (value)) /**< macro that converts net to host byte-order of a 32-bit value */
+
+typedef struct
+{
+ void * data;
+ size_t dataLength;
+} ENetBuffer;
+
+#define ENET_CALLBACK
+
+#define ENET_API extern
+
+typedef fd_set ENetSocketSet;
+
+#define ENET_SOCKETSET_EMPTY(sockset) FD_ZERO (& (sockset))
+#define ENET_SOCKETSET_ADD(sockset, socket) FD_SET (socket, & (sockset))
+#define ENET_SOCKETSET_REMOVE(sockset, socket) FD_CLEAR (socket, & (sockset))
+#define ENET_SOCKETSET_CHECK(sockset, socket) FD_ISSET (socket, & (sockset))
+
+#endif /* __ENET_UNIX_H__ */
+