aboutsummaryrefslogtreecommitdiff
path: root/buf.h
blob: 7323b83d7f78d6cee02e1a9629ae9ad63834b980 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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