diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2023-04-29 15:46:10 +0200 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2023-04-29 15:46:10 +0200 |
commit | 04172ee7460f81bebb3c82ac2497c25f64ac2bf4 (patch) | |
tree | 11adc6215ec29ad6acea75931ce36cc22b2b3290 /src/net.h | |
parent | make struct client opaque (diff) | |
download | cimple-04172ee7460f81bebb3c82ac2497c25f64ac2bf4.tar.gz cimple-04172ee7460f81bebb3c82ac2497c25f64ac2bf4.zip |
net: add struct buf
Diffstat (limited to 'src/net.h')
-rw-r--r-- | src/net.h | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -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 |