xref: /freebsd/contrib/less/xbuf.h (revision 9f27341c336aa12f6c7163c17e646e76c813b689)
1 #ifndef XBUF_H_
2 #define XBUF_H_
3 
4 struct xbuffer
5 {
6 	unsigned char *data;
7 	int end;
8 	int size;
9 };
10 
11 void xbuf_init(struct xbuffer *xbuf);
12 void xbuf_deinit(struct xbuffer *xbuf);
13 void xbuf_reset(struct xbuffer *xbuf);
14 void xbuf_add_byte(struct xbuffer *xbuf, unsigned char b);
15 void xbuf_add_data(struct xbuffer *xbuf, unsigned char *data, int len);
16 int xbuf_pop(struct xbuffer *xbuf);
17 char *xbuf_char_data(struct xbuffer *xbuf);
18 
19 #endif
20