PostgreSQL Source Code
git master
|
#include "lib/stringinfo.h"
Go to the source code of this file.
Data Structures | |
struct | JsonLexContext |
struct | JsonSemAction |
Typedefs | |
typedef enum JsonTokenType | JsonTokenType |
typedef enum JsonParseErrorType | JsonParseErrorType |
typedef struct JsonLexContext | JsonLexContext |
typedef JsonParseErrorType(* | json_struct_action) (void *state) |
typedef JsonParseErrorType(* | json_ofield_action) (void *state, char *fname, bool isnull) |
typedef JsonParseErrorType(* | json_aelem_action) (void *state, bool isnull) |
typedef JsonParseErrorType(* | json_scalar_action) (void *state, char *token, JsonTokenType tokentype) |
typedef struct JsonSemAction | JsonSemAction |
Functions | |
JsonParseErrorType | pg_parse_json (JsonLexContext *lex, JsonSemAction *sem) |
JsonParseErrorType | json_count_array_elements (JsonLexContext *lex, int *elements) |
JsonLexContext * | makeJsonLexContextCstringLen (char *json, int len, int encoding, bool need_escapes) |
JsonParseErrorType | json_lex (JsonLexContext *lex) |
char * | json_errdetail (JsonParseErrorType error, JsonLexContext *lex) |
bool | IsValidJsonNumber (const char *str, int len) |
Variables | |
PGDLLIMPORT JsonSemAction | nullSemAction |
typedef JsonParseErrorType(* json_aelem_action) (void *state, bool isnull) |
typedef JsonParseErrorType(* json_ofield_action) (void *state, char *fname, bool isnull) |
typedef JsonParseErrorType(* json_scalar_action) (void *state, char *token, JsonTokenType tokentype) |
typedef JsonParseErrorType(* json_struct_action) (void *state) |
typedef struct JsonLexContext JsonLexContext |
typedef enum JsonParseErrorType JsonParseErrorType |
typedef struct JsonSemAction JsonSemAction |
typedef enum JsonTokenType JsonTokenType |
enum JsonParseErrorType |
Definition at line 36 of file jsonapi.h.
enum JsonTokenType |
bool IsValidJsonNumber | ( | const char * | str, |
int | len | ||
) |
Definition at line 105 of file jsonapi.c.
References JsonLexContext::input, JsonLexContext::input_length, json_lex_number(), len, generate_unaccent_rules::str, and unconstify.
Referenced by datum_to_json(), hstore_to_json_loose(), and hstore_to_jsonb_loose().
JsonParseErrorType json_count_array_elements | ( | JsonLexContext * | lex, |
int * | elements | ||
) |
Definition at line 209 of file jsonapi.c.
References json_lex(), JSON_PARSE_ARRAY_NEXT, JSON_PARSE_ARRAY_START, JSON_SUCCESS, JSON_TOKEN_ARRAY_END, JSON_TOKEN_ARRAY_START, JSON_TOKEN_COMMA, lex_expect(), JsonLexContext::lex_level, lex_peek(), nullSemAction, parse_array_element(), JsonLexContext::strval, and JsonLexContext::token_type.
Referenced by get_array_start().
char* json_errdetail | ( | JsonParseErrorType | error, |
JsonLexContext * | lex | ||
) |
Definition at line 1136 of file jsonapi.c.
References _, elog(), ERROR, error(), extract_token(), GetDatabaseEncodingName(), JSON_ESCAPING_INVALID, JSON_ESCAPING_REQUIRED, JSON_EXPECTED_ARRAY_FIRST, JSON_EXPECTED_ARRAY_NEXT, JSON_EXPECTED_COLON, JSON_EXPECTED_END, JSON_EXPECTED_JSON, JSON_EXPECTED_MORE, JSON_EXPECTED_OBJECT_FIRST, JSON_EXPECTED_OBJECT_NEXT, JSON_EXPECTED_STRING, JSON_INVALID_TOKEN, JSON_SEM_ACTION_FAILED, JSON_SUCCESS, JSON_UNICODE_CODE_POINT_ZERO, JSON_UNICODE_ESCAPE_FORMAT, JSON_UNICODE_HIGH_ESCAPE, JSON_UNICODE_HIGH_SURROGATE, JSON_UNICODE_LOW_SURROGATE, JSON_UNICODE_UNTRANSLATABLE, psprintf(), and JsonLexContext::token_terminator.
Referenced by json_errsave_error().
JsonParseErrorType json_lex | ( | JsonLexContext * | lex | ) |
Definition at line 552 of file jsonapi.c.
References if(), JsonLexContext::input, JsonLexContext::input_length, JSON_ALPHANUMERIC_CHAR, JSON_INVALID_TOKEN, json_lex_number(), json_lex_string(), JSON_SUCCESS, JSON_TOKEN_ARRAY_END, JSON_TOKEN_ARRAY_START, JSON_TOKEN_COLON, JSON_TOKEN_COMMA, JSON_TOKEN_END, JSON_TOKEN_FALSE, JSON_TOKEN_NULL, JSON_TOKEN_NUMBER, JSON_TOKEN_OBJECT_END, JSON_TOKEN_OBJECT_START, JSON_TOKEN_STRING, JSON_TOKEN_TRUE, JsonLexContext::line_number, JsonLexContext::line_start, JsonLexContext::prev_token_terminator, JsonLexContext::token_start, JsonLexContext::token_terminator, and JsonLexContext::token_type.
Referenced by json_count_array_elements(), json_typeof(), lex_expect(), parse_array(), parse_object(), parse_object_field(), parse_scalar(), and pg_parse_json().
JsonLexContext* makeJsonLexContextCstringLen | ( | char * | json, |
int | len, | ||
int | encoding, | ||
bool | need_escapes | ||
) |
Definition at line 145 of file jsonapi.c.
References encoding, JsonLexContext::input, JsonLexContext::input_encoding, JsonLexContext::input_length, len, JsonLexContext::line_number, JsonLexContext::line_start, makeStringInfo(), palloc0(), JsonLexContext::strval, and JsonLexContext::token_terminator.
Referenced by get_json_object_as_hash(), json_parse_manifest(), json_recv(), jsonb_from_cstring(), makeJsonLexContext(), and populate_array_json().
JsonParseErrorType pg_parse_json | ( | JsonLexContext * | lex, |
JsonSemAction * | sem | ||
) |
Definition at line 169 of file jsonapi.c.
References json_lex(), JSON_PARSE_END, JSON_SUCCESS, JSON_TOKEN_ARRAY_START, JSON_TOKEN_END, JSON_TOKEN_OBJECT_START, lex_expect(), lex_peek(), parse_array(), parse_object(), and parse_scalar().
Referenced by json_parse_manifest(), and pg_parse_json_or_errsave().
|
extern |
Definition at line 57 of file jsonapi.c.
Referenced by json_count_array_elements(), json_in(), and json_recv().