Loading...
Searching...
No Matches
25#ifndef CS_COMMON_MBUF_H_
26#define CS_COMMON_MBUF_H_
31#if defined(__cplusplus)
35#ifndef MBUF_SIZE_MULTIPLIER
36#define MBUF_SIZE_MULTIPLIER 1.5
39#ifndef MBUF_SIZE_MAX_HEADROOM
41#define MBUF_SIZE_MAX_HEADROOM BUFSIZ
43#define MBUF_SIZE_MAX_HEADROOM 1024
58void mbuf_init(
struct mbuf *,
size_t initial_capacity);
61void mbuf_free(
struct mbuf *);
68size_t mbuf_append(
struct mbuf *,
const void *data,
size_t data_size);
76size_t mbuf_append_and_free(
struct mbuf *,
void *data,
size_t data_size);
85size_t mbuf_insert(
struct mbuf *,
size_t,
const void *,
size_t);
88void mbuf_remove(
struct mbuf *,
size_t data_size);
96void mbuf_resize(
struct mbuf *,
size_t new_size);
99void mbuf_move(
struct mbuf *from,
struct mbuf *to);
102void mbuf_clear(
struct mbuf *);
105void mbuf_trim(
struct mbuf *);
107#if defined(__cplusplus)