summaryrefslogtreecommitdiff
path: root/src/sbuf.h
blob: a6ff01c8d04df83c01dbbe26e4a11be4a57acf25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef _SBUF_H
#define _SBUF_H

#include <stdlib.h>

struct 
sbuf
{
  char *data;
  size_t len;
  size_t maxsz;
};

struct sbuf *sbuf_new (size_t initsz);
void sbuf_free (struct sbuf *b);
char *sbuf_concat (struct sbuf *b, const char *str);
char *sbuf_copy (struct sbuf *b, const char *str);
char *sbuf_clear (struct sbuf *b);
char *sbuf_get (struct sbuf *b);

#endif /* _SBUF_H */