1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 #ifndef STRBUF_H
30 #define STRBUF_H
31
32 #include <cx/string.h>
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38
39 typedef struct _strbuf {
40 char *ptr;
41 size_t length;
42 size_t size;
43 }
sbuf_t;
44
45 sbuf_t* sbuf_new(
size_t size);
46
47 void sbuf_puts(
sbuf_t *buf,
char *str);
48
49 void sbuf_put(
sbuf_t *buf,
char chr);
50
51 void sbuf_append(
sbuf_t *buf, cxstring str);
52
53 void sbuf_free(
sbuf_t *buf);
54
55 #ifdef __cplusplus
56 }
57 #endif
58
59 #endif
60