1 /* variable length memory buffer */
3 char *s
; /* allocated buffer */
4 int sz
; /* buffer size */
5 int n
; /* length of data stored in s */
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
);