aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/net.h
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-04-29 15:46:10 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-04-29 15:46:10 +0200
commit04172ee7460f81bebb3c82ac2497c25f64ac2bf4 (patch)
tree11adc6215ec29ad6acea75931ce36cc22b2b3290 /src/net.h
parentmake struct client opaque (diff)
downloadcimple-04172ee7460f81bebb3c82ac2497c25f64ac2bf4.tar.gz
cimple-04172ee7460f81bebb3c82ac2497c25f64ac2bf4.zip
net: add struct buf
Diffstat (limited to '')
-rw-r--r--src/net.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/net.h b/src/net.h
index b6dd174..185f10b 100644
--- a/src/net.h
+++ b/src/net.h
@@ -16,9 +16,17 @@ int net_accept(int fd);
int net_connect(const char *host, const char *port);
int net_send_all(int fd, const void *, size_t);
-int net_send_buf(int fd, const void *, uint32_t);
-
int net_recv_all(int fd, void *, size_t);
-int net_recv_buf(int fd, void **, uint32_t *);
+
+struct buf;
+
+int buf_create(struct buf **, const void *, uint32_t);
+void buf_destroy(struct buf *);
+
+uint32_t buf_get_size(const struct buf *);
+void *buf_get_data(const struct buf *);
+
+int net_send_buf(int fd, const struct buf *);
+int net_recv_buf(int fd, struct buf **);
#endif