]>
git.ipfire.org Git - thirdparty/kmod.git/blob - shared/scratchbuf.h
6 #include <shared/macro.h>
9 * Buffer abstract data type
17 void scratchbuf_init(struct scratchbuf
*buf
, char *stackbuf
, size_t size
);
18 int scratchbuf_alloc(struct scratchbuf
*buf
, size_t sz
);
19 void scratchbuf_release(struct scratchbuf
*buf
);
21 /* Return a C string */
22 static inline char *scratchbuf_str(struct scratchbuf
*buf
)
27 #define SCRATCHBUF_INITIALIZER(buf_) { \
29 .size = sizeof(buf_) + _array_size_chk(buf_), \