MCPcopy Create free account
hub / github.com/apache/cloudberry / makeJsonLexContextCstringLen

Function makeJsonLexContextCstringLen

src/common/jsonapi.c:154–166  ·  view source on GitHub ↗

* makeJsonLexContextCstringLen * * lex constructor, with or without StringInfo object for de-escaped lexemes. * * Without is better as it makes the processing faster, so only make one * if really required. */

Source from the content-addressed store, hash-verified

152 * if really required.
153 */
154JsonLexContext *
155makeJsonLexContextCstringLen(char *json, int len, int encoding, bool need_escapes)
156{
157 JsonLexContext *lex = palloc0(sizeof(JsonLexContext));
158
159 lex->input = lex->token_terminator = lex->line_start = json;
160 lex->line_number = 1;
161 lex->input_length = len;
162 lex->input_encoding = encoding;
163 if (need_escapes)
164 lex->strval = makeStringInfo();
165 return lex;
166}
167
168/*
169 * pg_parse_json

Callers 7

jsonb_from_cstringFunction · 0.85
makeJsonLexContextFunction · 0.85
populate_array_jsonFunction · 0.85
get_json_object_as_hashFunction · 0.85
json_recvFunction · 0.85
json_parse_manifestFunction · 0.85

Calls 2

makeStringInfoFunction · 0.85
palloc0Function · 0.70

Tested by

no test coverage detected