#ifndef _buf_h_ #define _buf_h_ typedef struct { char *buf; char *start; int size; int usize; int isize, dummy; } buf_type; /* input */ void buf_reset(buf_type *buf); int buf_get_int(buf_type *buf); char *buf_get_str(buf_type *buf); float buf_get_float(buf_type *buf); int buf_size(buf_type *buf); /* output */ void buf_put_start(buf_type *buf); void buf_put_int(buf_type *buf, int val); void buf_put_str(buf_type *buf, const char *str); void buf_put_float(buf_type *buf, float val); void buf_put_end(buf_type *buf); /* common */ buf_type *buf_create(size_t size); void buf_free(buf_type *buf); #endif