diff options
author | kartofen <mladenovnasko0@gmail.com> | 2023-01-26 14:58:09 +0200 |
---|---|---|
committer | kartofen <mladenovnasko0@gmail.com> | 2023-01-26 14:58:09 +0200 |
commit | 5e1ae8b33873661b669eda509fcd000f8a964126 (patch) | |
tree | 6099bee318d9f0033949d23a3eeded6974d34b35 /src/server.h |
very simple work withs html based on file path
Diffstat (limited to 'src/server.h')
-rw-r--r-- | src/server.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/server.h b/src/server.h new file mode 100644 index 0000000..f5107b5 --- /dev/null +++ b/src/server.h @@ -0,0 +1,17 @@ +#ifndef SERVER_H +#define SERVER_H + +typedef struct sock_t sock_t; +struct sock_t; + +int server_start(char *port, sock_t *sock); +int server_accept(sock_t *sock, sock_t *conn); + +ssize_t server_send(sock_t *sock, char *buf, size_t sz); +ssize_t server_recv(sock_t *sock, char *buf, size_t sz); +char *server_connection_ip(sock_t *conn); + +sock_t *server_sock_create(); +void server_sock_close(sock_t *s); + +#endif |