Artifact 364399cab8561bb00876b73903a933e025a8fdc91445d9c440ea9bcb51faf6aa:
- File clib/buffer.h — part of check-in [f7c93df9f4] at 2024-07-10 19:07:16 on branch trunk — periodic update (user: lexi, size: 436) [annotate] [blame] [check-ins using]
#pragma once #include "type.h" typedef struct buffer { size_t sz, run; char* ptr; } buffer; void buffer_init(buffer* b); buffer buffer_mk(); void buffer_push(buffer* b, strp const data); strp buffer_crush(buffer* b, size_t max); strp buffer_str(buffer* b); size_t buffer_pushs(buffer* b, char const* data); #define buffer_pushl(b, d) (buffer_push(b, (strp){sizeof(d),(d)})) void buffer_clear(buffer* b); void buffer_del(buffer* b);