35 main(
int argc,
char **argv)
50 if (strcmp(argv[1],
"-i") == 0)
56 sscanf(argv[1],
"%d", &iter);
58 if ((json_file = fopen(argv[2],
PG_BINARY_R)) == NULL)
59 pg_fatal(
"Could not open input file '%s': %m", argv[2]);
61 while ((n_read = fread(buff, 1, 6000, json_file)) > 0)
66 for (
int i = 0;
i < iter;
i++)
84 pg_fatal(
"unexpected result %d (expecting %d) on parse",
JsonParseErrorType pg_parse_json_incremental(JsonLexContext *lex, const JsonSemAction *sem, const char *json, size_t len, bool is_last)
JsonParseErrorType pg_parse_json(JsonLexContext *lex, const JsonSemAction *sem)
const JsonSemAction nullSemAction
JsonLexContext * makeJsonLexContextCstringLen(JsonLexContext *lex, const char *json, size_t len, int encoding, bool need_escapes)
void freeJsonLexContext(JsonLexContext *lex)
JsonLexContext * makeJsonLexContextIncremental(JsonLexContext *lex, int encoding, bool need_escapes)
void pg_logging_init(const char *argv0)
void appendBinaryStringInfo(StringInfo str, const void *data, int datalen)
void initStringInfo(StringInfo str)
int main(int argc, char **argv)