summaryrefslogtreecommitdiff
path: root/lib/stringbuf.h
blob: 08dbf0222570aaa96c19661857522480498d48bc (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
53
54
55
56
57
58
59
#ifndef _STRINGBUF_H_
#define _STRINGBUF_H_

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

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

#ifdef __cplusplus
extern "C" {
#endif

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

/**
 */
/*@null@*/ StringBuf freeStringBuf( /*@only@*/ /*@null@*/ StringBuf sb)
	/*@modifies sb @*/;

/**
 */
/*@unused@*/
void truncStringBuf(StringBuf sb)
	/*@modifies sb @*/;

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

/**
 */
void stripTrailingBlanksStringBuf(StringBuf sb)
	/*@modifies 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)
	/*@modifies sb @*/;

#ifdef __cplusplus
}
#endif

#endif	/* _STRINGBUF_H_ */