PostgreSQL Source Code  git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
json.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * json.h
4  * Declarations for JSON data type support.
5  *
6  * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * src/include/utils/json.h
10  *
11  *-------------------------------------------------------------------------
12  */
13 
14 #ifndef JSON_H
15 #define JSON_H
16 
17 #include "lib/stringinfo.h"
18 
19 /* functions in json.c */
20 extern void escape_json(StringInfo buf, const char *str);
21 extern void escape_json_with_len(StringInfo buf, const char *str, int len);
22 extern void escape_json_text(StringInfo buf, const text *txt);
23 extern char *JsonEncodeDateTime(char *buf, Datum value, Oid typid,
24  const int *tzp);
25 extern bool to_json_is_immutable(Oid typoid);
26 extern Datum json_build_object_worker(int nargs, const Datum *args, const bool *nulls,
27  const Oid *types, bool absent_on_null,
28  bool unique_keys);
29 extern Datum json_build_array_worker(int nargs, const Datum *args, const bool *nulls,
30  const Oid *types, bool absent_on_null);
31 extern bool json_validate(text *json, bool check_unique_keys, bool throw_error);
32 
33 #endif /* JSON_H */
struct typedefs * types
Definition: ecpg.c:29
const char * str
static struct @160 value
void escape_json_text(StringInfo buf, const text *txt)
Definition: json.c:1736
Datum json_build_array_worker(int nargs, const Datum *args, const bool *nulls, const Oid *types, bool absent_on_null)
Definition: json.c:1344
void escape_json_with_len(StringInfo buf, const char *str, int len)
Definition: json.c:1631
Datum json_build_object_worker(int nargs, const Datum *args, const bool *nulls, const Oid *types, bool absent_on_null, bool unique_keys)
Definition: json.c:1224
char * JsonEncodeDateTime(char *buf, Datum value, Oid typid, const int *tzp)
Definition: json.c:310
bool json_validate(text *json, bool check_unique_keys, bool throw_error)
Definition: json.c:1812
void escape_json(StringInfo buf, const char *str)
Definition: json.c:1602
bool to_json_is_immutable(Oid typoid)
Definition: json.c:700
const void size_t len
static char * buf
Definition: pg_test_fsync.c:72
uintptr_t Datum
Definition: postgres.h:64
unsigned int Oid
Definition: postgres_ext.h:31
Definition: c.h:692