2020-12-05 11:26:32 +00:00
|
|
|
#pragma once
|
|
|
|
|
2022-07-01 17:28:06 +01:00
|
|
|
#include "arch.h"
|
2020-12-05 11:26:32 +00:00
|
|
|
|
|
|
|
struct mg_iobuf {
|
2021-08-30 13:06:45 +01:00
|
|
|
unsigned char *buf; // Pointer to stored data
|
2021-08-28 08:08:54 +01:00
|
|
|
size_t size; // Total size available
|
|
|
|
size_t len; // Current number of bytes
|
2020-12-05 11:26:32 +00:00
|
|
|
};
|
|
|
|
|
2021-01-29 12:32:34 +00:00
|
|
|
int mg_iobuf_init(struct mg_iobuf *, size_t);
|
|
|
|
int mg_iobuf_resize(struct mg_iobuf *, size_t);
|
2020-12-05 11:26:32 +00:00
|
|
|
void mg_iobuf_free(struct mg_iobuf *);
|
2021-08-28 08:08:54 +01:00
|
|
|
size_t mg_iobuf_add(struct mg_iobuf *, size_t, const void *, size_t, size_t);
|
2021-08-27 10:25:24 +01:00
|
|
|
size_t mg_iobuf_del(struct mg_iobuf *, size_t ofs, size_t len);
|