From fb62a55d2fafa4df5dec7c730df635758db2dd70 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Thu, 19 Jan 2017 18:29:55 +0100 Subject: Add more tcp functions from roomserver --- tcp.c | 33 +++++++++++++++++++++++++++++++-- tcp.h | 5 ++++- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/tcp.c b/tcp.c index ae3d704..65da79d 100644 --- a/tcp.c +++ b/tcp.c @@ -31,7 +31,7 @@ i64 tcp_read_line(int sock,char **buf,i64 *bufsz){ } } -i64 sock_read_data(int sock,char *buf,i64 length){ +i64 tcp_read_data(int sock,char *buf,i64 length){ i64 got=0; while(got //Unless specified otherwise, functions return -1 on error or socket closure. @@ -15,6 +15,9 @@ i64 tcp_send_str(int sock,const char *str); i64 tcp_send_line(int sock,const char *str); i64 tcp_send_line_f(int sock,const char *format,...) __attribute__((format (printf,2,3))); +i64 tcp_send_list(int sock,const char *tag,const char *const *list,i64 len); +i64 tcp_send_int(int sock,const char *tag,i64 value); + i64 tcp_read_ok(int sock,const char *tag); -- cgit v1.2.3