out: exit if there is no room for more relocations or symbols
[neatcc.git] / mem.h
blob7e30c5b34ac3a591ececf39569aca52ac2c0c464
1 /* variable length 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);