enet: unix.h Source File

enet

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

unix.h
Go to the documentation of this file.
1
5 #ifndef __ENET_UNIX_H__
6 #define __ENET_UNIX_H__
7
8 #include <stdlib.h>
9 #include <sys/time.h>
10 #include <sys/types.h>
11 #include <sys/socket.h>
12 #include <netinet/in.h>
13 #include <unistd.h>
14
15 #ifdef MSG_MAXIOVLEN
16 #define ENET_BUFFER_MAXIMUM MSG_MAXIOVLEN
17 #endif
18
19 typedef int ENetSocket;
20
21 #define ENET_SOCKET_NULL -1
22
23 #define ENET_HOST_TO_NET_16(value) (htons (value))
24 #define ENET_HOST_TO_NET_32(value) (htonl (value))
26 #define ENET_NET_TO_HOST_16(value) (ntohs (value))
27 #define ENET_NET_TO_HOST_32(value) (ntohl (value))
29 typedef struct
30 {
31 void * data;
32 size_t dataLength;
33 } ENetBuffer;
34
35 #define ENET_CALLBACK
36
37 #define ENET_API extern
38
39 typedef fd_set ENetSocketSet;
40
41 #define ENET_SOCKETSET_EMPTY(sockset) FD_ZERO (& (sockset))
42 #define ENET_SOCKETSET_ADD(sockset, socket) FD_SET (socket, & (sockset))
43 #define ENET_SOCKETSET_REMOVE(sockset, socket) FD_CLR (socket, & (sockset))
44 #define ENET_SOCKETSET_CHECK(sockset, socket) FD_ISSET (socket, & (sockset))
45
46 #endif /* __ENET_UNIX_H__ */
47
ENetBuffer
Definition: unix.h:29