summaryrefslogtreecommitdiff
path: root/lib/stringbuf.h
blob: cc48fac9562097864cae9a81cfd1e70cda4fa8bd (plain)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef _STRINGBUF_H_
#define _STRINGBUF_H_

/** \file lib/stringbuf.h
 *
 */

/**
 */
typedef /*@abstract@*/ struct StringBufRec *StringBuf;

#ifdef __cplusplus
extern "C" {
#endif

/**
 */
/*@only@*/ StringBuf newStringBuf(void);

/**
 */
void freeStringBuf( /*@only@*/ StringBuf sb);

/**
 */
void truncStringBuf(StringBuf sb);

/**
 */
/*@observer@*/ char *getStringBuf(StringBuf sb);

/**
 */
void stripTrailingBlanksStringBuf(StringBuf sb);

/**
 */
#define appendStringBuf(sb, s)     appendStringBufAux(sb, s, 0)

/**
 */
#define appendLineStringBuf(sb, s) appendStringBufAux(sb, s, 1)

/**
 */
void appendStringBufAux(StringBuf sb, const char *s, int nl);

#ifdef __cplusplus
}
#endif

#endif	/* _STRINGBUF_H_ */