diff options
Diffstat (limited to 'src/tsocket.h')
-rw-r--r-- | src/tsocket.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/tsocket.h b/src/tsocket.h new file mode 100644 index 0000000..5028b04 --- /dev/null +++ b/src/tsocket.h @@ -0,0 +1,19 @@ +#include <netinet/in.h> + +#ifndef __TSOCKET_H +#define __TSOCKET_H + +struct tsocket { + int fd; + const char *addr; + int port; +}; +typedef struct tsocket tsocket_t; + +struct tsocket *tsocket_create(); +int tsocket_bind(struct tsocket *sock, const char *addr, int hostport); +int tsocket_listen(struct tsocket *sock); +struct tsocket *tsocket_accept(struct tsocket *sock); +void tsocket_destroy(struct tsocket *sock); + +#endif |