#include #include "es.h" void es_init(ES *e) { e->b = 0; e->a = 0; e->l = 0; } int es_len(const ES *e) { return(e->l); } unsigned char *es_buf(const ES *e) { return(e->b); } void es_append_1(ES *e, unsigned char c) { if (e->l >= e->a) e->b = realloc(e->b,e->a=e->l+8); e->b[e->l++] = c; } void es_clear(ES *e) { e->l = 0; } void es_done(ES *e) { free(e->b); es_init(e); }