Rev | Line | |
---|
[134] | 1 | /** |
---|
| 2 | @file unix.h |
---|
| 3 | @brief ENet Unix header |
---|
| 4 | */ |
---|
| 5 | #ifndef __ENET_UNIX_H__ |
---|
| 6 | #define __ENET_UNIX_H__ |
---|
| 7 | |
---|
| 8 | #include <stdlib.h> |
---|
| 9 | #include <sys/types.h> |
---|
| 10 | #include <netinet/in.h> |
---|
| 11 | |
---|
| 12 | typedef int ENetSocket; |
---|
| 13 | |
---|
| 14 | enum |
---|
| 15 | { |
---|
| 16 | ENET_SOCKET_NULL = -1 |
---|
| 17 | }; |
---|
| 18 | |
---|
| 19 | #define ENET_HOST_TO_NET_16(value) (htons (value)) /**< macro that converts host to net byte-order of a 16-bit value */ |
---|
| 20 | #define ENET_HOST_TO_NET_32(value) (htonl (value)) /**< macro that converts host to net byte-order of a 32-bit value */ |
---|
| 21 | |
---|
| 22 | #define ENET_NET_TO_HOST_16(value) (ntohs (value)) /**< macro that converts net to host byte-order of a 16-bit value */ |
---|
| 23 | #define ENET_NET_TO_HOST_32(value) (ntohl (value)) /**< macro that converts net to host byte-order of a 32-bit value */ |
---|
| 24 | |
---|
| 25 | typedef struct |
---|
| 26 | { |
---|
| 27 | void * data; |
---|
| 28 | size_t dataLength; |
---|
| 29 | } ENetBuffer; |
---|
| 30 | |
---|
| 31 | #define ENET_CALLBACK |
---|
| 32 | |
---|
| 33 | #define ENET_API extern |
---|
| 34 | |
---|
| 35 | #endif /* __ENET_UNIX_H__ */ |
---|
| 36 | |
---|
Note: See
TracBrowser
for help on using the repository browser.