buggy code (2)
[webserver.git] / server.h
1 #ifndef __SERVER_H__
2 #define __SERVER_H__
3
4 #ifdef _WIN32 /* Windows */
5 #include <ws2tcpip.h>
6 typedef SOCKET socket_t;
7 #else /* Posix */
8 typedef int socket_t;
9 #define INVALID_SOCKET -1
10 #endif
11
12 void init_network_context (void);
13 void terminate_network_context (void);
14
15 socket_t open_listening_socket (int port);
16 socket_t accept_incoming_connection (socket_t sock);
17
18 void close_socket (socket_t sock);
19
20 int receive_data (socket_t sock, unsigned char **pdata);
21 int send_data (socket_t sock, unsigned char *data, int len);
22
23 #endif /* __SERVER_H__ */
24
25 /* vim: set ts=4 sw=4 et: */
26
27 /* vim: set ts=4 sw=4 et: */