2019-08-11 15:31:54 -04:00
|
|
|
// Copyright 2019 Lassi Kortela
|
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
|
|
|
|
struct buf {
|
|
|
|
size_t cap;
|
|
|
|
size_t fill;
|
|
|
|
char *bytes;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct buf *buf_new(void);
|
|
|
|
char *buf_resb(struct buf *buf, size_t nbyte);
|
2019-08-14 06:39:11 -04:00
|
|
|
void buf_put_ios(struct buf *buf, struct ios *ios);
|
2019-08-11 15:31:54 -04:00
|
|
|
void buf_putc(struct buf *buf, int c);
|
|
|
|
void buf_putb(struct buf *buf, const void *bytes, size_t nbyte);
|
|
|
|
void buf_puts(struct buf *buf, const char *s);
|
|
|
|
void buf_putu(struct buf *buf, uint64_t u);
|
|
|
|
void buf_free(struct buf *buf);
|