diff -r e5fbb8f9edbe -r 0a08f79c320d src/network.h --- a/src/network.h Wed Feb 05 14:07:43 2014 +0100 +++ b/src/network.h Sun Feb 23 21:03:35 2014 +0100 @@ -36,16 +36,18 @@ #ifdef __cplusplus extern "C" { #endif + +#define NETCODE_GAMEINFO 1 typedef struct { - int fd; + int fd; /* -1, if we are the client */ struct sockaddr address; socklen_t address_len; } Client; typedef struct { int fd; - struct addrinfo* info; + struct addrinfo* info; /* NULL, if we are the server */ Client *client; } Server; @@ -56,6 +58,10 @@ int net_destroy(Server *server); int net_connect(Server *server); +void net_send(int socket, uint32_t code, void *data, size_t len); +int net_recieve_code(int socket); +void net_recieve_data(int socket, void *data, size_t len); + #ifdef __cplusplus }