PostgreSQL Source Code: src/include/common/jsonapi.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef JSONAPI_H
15#define JSONAPI_H
16
18{
33
35{
61
62
65
66
67
68
69
70#ifdef JSONAPI_USE_PQEXPBUFFER
71#define jsonapi_StrValType PQExpBufferData
72#else
73#define jsonapi_StrValType StringInfoData
74#endif
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97#define JSONLEX_FREE_STRUCT (1 << 0)
98#define JSONLEX_FREE_STRVAL (1 << 1)
99#define JSONLEX_CTX_OWNS_TOKENS (1 << 2)
101{
113 const char *line_start;
120
121
122
123
124
125
126
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
152{
164
165
166
167
168
169
170
171
172
173
176
179 const char *json,
180 size_t len,
181 bool is_last);
182
183
185
186
187
188
189
190
191
192
193
194
196 int *elements);
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
219 const char *json,
220 size_t len,
222 bool need_escapes);
223
224
225
226
227
228
231 bool need_escapes);
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
250 bool owned_by_context);
251
253
254
256
257
259
260
261
262
263
264
266
267#endif
JsonParseErrorType pg_parse_json_incremental(JsonLexContext *lex, const JsonSemAction *sem, const char *json, size_t len, bool is_last)
JsonLexContext * makeJsonLexContextIncremental(JsonLexContext *lex, int encoding, bool need_escapes)
bool IsValidJsonNumber(const char *str, size_t len)
struct JsonLexContext JsonLexContext
JsonParseErrorType(* json_struct_action)(void *state)
JsonParseErrorType(* json_aelem_action)(void *state, bool isnull)
JsonParseErrorType pg_parse_json(JsonLexContext *lex, const JsonSemAction *sem)
#define jsonapi_StrValType
@ JSON_EXPECTED_ARRAY_FIRST
@ JSON_UNICODE_HIGH_SURROGATE
@ JSON_EXPECTED_OBJECT_FIRST
@ JSON_UNICODE_CODE_POINT_ZERO
@ JSON_INVALID_LEXER_TYPE
@ JSON_UNICODE_ESCAPE_FORMAT
@ JSON_UNICODE_UNTRANSLATABLE
@ JSON_EXPECTED_OBJECT_NEXT
@ JSON_EXPECTED_ARRAY_NEXT
@ JSON_UNICODE_HIGH_ESCAPE
@ JSON_UNICODE_LOW_SURROGATE
JsonParseErrorType(* json_ofield_action)(void *state, char *fname, bool isnull)
JsonLexContext * makeJsonLexContextCstringLen(JsonLexContext *lex, const char *json, size_t len, int encoding, bool need_escapes)
void setJsonLexContextOwnsTokens(JsonLexContext *lex, bool owned_by_context)
PGDLLIMPORT const JsonSemAction nullSemAction
@ JSON_TOKEN_OBJECT_START
JsonParseErrorType json_lex(JsonLexContext *lex)
JsonParseErrorType(* json_scalar_action)(void *state, char *token, JsonTokenType tokentype)
char * json_errdetail(JsonParseErrorType error, JsonLexContext *lex)
JsonParseErrorType json_count_array_elements(JsonLexContext *lex, int *elements)
void freeJsonLexContext(JsonLexContext *lex)
struct JsonSemAction JsonSemAction
const char * prev_token_terminator
struct jsonapi_StrValType * strval
struct jsonapi_StrValType * errormsg
JsonIncrementalState * inc_state
const char * token_terminator
json_struct_action array_end
json_struct_action object_start
json_ofield_action object_field_start
json_aelem_action array_element_start
json_scalar_action scalar
json_aelem_action array_element_end
json_struct_action array_start
json_struct_action object_end
json_ofield_action object_field_end