PostgreSQL Source Code: src/include/lib/stringinfo.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18#ifndef STRINGINFO_H
19#define STRINGINFO_H
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
47{
53
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112#define STRINGINFO_DEFAULT_SIZE 1024
113
114
115
116
117
119
120
121
122
123
124
125
127
128
129
130
131
132
134
135
136
137
138
139
140
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156static inline void
158{
161 str->maxlen = 0;
162 str->cursor = 0;
163}
164
165
166
167
168
169
170
171
172
173
174static inline void
176{
178
182 str->cursor = 0;
183}
184
185
186
187
188
189
191
192
193
194
195
196
197
198
200
201
202
203
204
205
206
207
208
209
211
212
213
214
215
216
218
219
220
221
222
223
225
226
227
228
229
230
231#define appendStringInfoCharMacro(str,ch) \
232 (((str)->len + 1 >= (str)->maxlen) ? \
233 appendStringInfoChar(str, ch) : \
234 (void)((str)->data[(str)->len] = (ch), (str)->data[++(str)->len] = '\0'))
235
236
237
238
239
241
242
243
244
245
246
248 const void *data, int datalen);
249
250
251
252
253
254
256 const void *data, int datalen);
257
258
259
260
261
263
264
265
266
267
269
270#endif
#define pg_attribute_printf(f, a)
Assert(PointerIsAligned(start, uint64))
void appendStringInfo(StringInfo str, const char *fmt,...) pg_attribute_printf(2
static void initStringInfoFromString(StringInfo str, char *data, int len)
void destroyStringInfo(StringInfo str)
StringInfo makeStringInfo(void)
struct StringInfoData StringInfoData
StringInfoData * StringInfo
void int void appendStringInfoString(StringInfo str, const char *s)
void resetStringInfo(StringInfo str)
void enlargeStringInfo(StringInfo str, int needed)
StringInfo makeStringInfoExt(int initsize)
void appendBinaryStringInfoNT(StringInfo str, const void *data, int datalen)
void appendBinaryStringInfo(StringInfo str, const void *data, int datalen)
void int appendStringInfoVA(StringInfo str, const char *fmt, va_list args) pg_attribute_printf(2
static void initReadOnlyStringInfo(StringInfo str, char *data, int len)
void appendStringInfoSpaces(StringInfo str, int count)
void initStringInfoExt(StringInfo str, int initsize)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)