ncc: use label identifiers more carefully
[neatcc.git] / mem.h
blob74e092f4b962b00ad5dd828033d385014024da02
1 /* variable length memory buffer */
2 struct mem {
3 char *s; /* allocated buffer */
4 int sz; /* buffer size */
5 int n; /* length of data stored in s */
6 };
8 void mem_init(struct mem *mem);
9 void mem_done(struct mem *mem);
10 void mem_cut(struct mem *mem, int pos);
11 void *mem_buf(struct mem *mem);
12 void mem_put(struct mem *mem, void *buf, int len);
13 void mem_putc(struct mem *mem, int c);
14 void mem_putz(struct mem *mem, int sz);
15 void mem_cpy(struct mem *mem, int off, void *buf, int len);
16 int mem_len(struct mem *mem);