summary refs log tree commit diff
path: root/buf.h
blob: 59c521b7485fa2bf78f43295b7be617ba2797470 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef BUF_H
#define BUF_H

#include <stddef.h>

typedef struct buf {
	size_t sz, cap;
	char *buf;
} buf_t;

void buf_init(buf_t *, size_t);
void buf_grow(buf_t *, size_t);
void buf_free(buf_t *);

void buf_cat(buf_t *b, const char *src, size_t n);
void buf_catc(buf_t *b, char c);

#endif