aboutsummaryrefslogtreecommitdiff
path: root/buf.h
blob: 9b2a996101a7053b506404c74afb8b01ab99ab21 (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
#include <stdlib.h>

typedef struct buf_node buf_node;
typedef struct buf buf;

buf* newbuf(size_t cap);

size_t buflen(buf* buffer);

char popchrbuf(buf* buffer);
char* popstrbuf(buf* buffer, size_t ct);

void inschrbuf(buf* buffer, char chr);
void insstrbuf(buf* buffer, char* str);

char* peekstrbuf(buf* buffer, size_t loc, size_t len);
char peekchrbuf(buf* buffer, size_t loc);

#endif