aboutsummaryrefslogtreecommitdiffstats
path: root/xstring.h
blob: be1160046eb895100f7ac4557c87a6af7295c7b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef CTIMELINE_XSTRING_H
#define CTIMELINE_XSTRING_H

#define INIT_LEN_STRING 32

typedef struct tag_string {
	char *s;
	int len;
	int capacity;
} string;

string *string_alloc(string *str, const char *text);
string *string_nalloc(string *str, const char *text,
					size_t text_len);
void string_release(string *str);
void string_reset(string *str);
void string_addch(string *str, int ch);
void string_addstr(string *str, const char *src, size_t src_len);

#endif /* CTIMELINE_XSTRING_H */