src/network.h

changeset 224
93e0e89496fe
parent 194
619f07c95894
equal deleted inserted replaced
223:e2519b3dd5e7 224:93e0e89496fe
31 #define TCHESS_NETWORK_H 31 #define TCHESS_NETWORK_H
32 32
33 #include <sys/socket.h> 33 #include <sys/socket.h>
34 #include <stdint.h> 34 #include <stdint.h>
35 35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 #define NETCODE_ACCEPT 0x01 36 #define NETCODE_ACCEPT 0x01
41 #define NETCODE_DECLINE 0x02 37 #define NETCODE_DECLINE 0x02
42 #define NETCODE_GAMEINFO 0x10 38 #define NETCODE_GAMEINFO 0x10
43 #define NETCODE_PGNDATA 0x11 39 #define NETCODE_PGNDATA 0x11
44 #define NETCODE_MOVE 0x20 40 #define NETCODE_MOVE 0x20
154 150
155 static inline uint32_t net_htonl(uint32_t l) { 151 static inline uint32_t net_htonl(uint32_t l) {
156 return net_ntohl(l); 152 return net_ntohl(l);
157 } 153 }
158 154
159 #ifdef __cplusplus
160 }
161 #endif
162
163 #endif /* TCHESS_NETWORK_H */ 155 #endif /* TCHESS_NETWORK_H */
164 156

mercurial