diff options
Diffstat (limited to 'buf.h')
-rw-r--r-- | buf.h | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -0,0 +1,21 @@ +#ifndef _BUF_INCLUDE +#define _BUF_INCLUDE + +typedef struct buf_node buf_node; +typedef struct buf buf; + +buf* newbuf(size_t cap); + +void addchrbuf(buf* buffer, char chr); // front +void addstrbuf(buf* buffer, char* str); +char remchrbuf(buf* buffer); +char* remstrbuf(buf* buffer, int ct); + +void prechrbuf(buf* buffer, char chr); // back +void prestrbuf(buf* buffer, char* str); +char shfchrbuf(buf* buffer); +char* shfstrbuf(buf* buffer, int ct); + +char* strpeekbuf(buf* buffer, int loc); + +#endif |