1 /*-------------------------------------------------------------------------
2  *
3  * json.h
4  *	  Declarations for JSON data type support.
5  *
6  * Portions Copyright (c) 1996-2016, 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 "fmgr.h"
18 #include "lib/stringinfo.h"
19 
20 /* functions in json.c */
21 extern Datum json_in(PG_FUNCTION_ARGS);
22 extern Datum json_out(PG_FUNCTION_ARGS);
23 extern Datum json_recv(PG_FUNCTION_ARGS);
24 extern Datum json_send(PG_FUNCTION_ARGS);
25 extern Datum array_to_json(PG_FUNCTION_ARGS);
26 extern Datum array_to_json_pretty(PG_FUNCTION_ARGS);
27 extern Datum row_to_json(PG_FUNCTION_ARGS);
28 extern Datum row_to_json_pretty(PG_FUNCTION_ARGS);
29 extern Datum to_json(PG_FUNCTION_ARGS);
30 
31 extern Datum json_agg_transfn(PG_FUNCTION_ARGS);
32 extern Datum json_agg_finalfn(PG_FUNCTION_ARGS);
33 
34 extern Datum json_object_agg_finalfn(PG_FUNCTION_ARGS);
35 extern Datum json_object_agg_transfn(PG_FUNCTION_ARGS);
36 
37 extern Datum json_build_object(PG_FUNCTION_ARGS);
38 extern Datum json_build_object_noargs(PG_FUNCTION_ARGS);
39 extern Datum json_build_array(PG_FUNCTION_ARGS);
40 extern Datum json_build_array_noargs(PG_FUNCTION_ARGS);
41 
42 extern Datum json_object(PG_FUNCTION_ARGS);
43 extern Datum json_object_two_arg(PG_FUNCTION_ARGS);
44 
45 extern void escape_json(StringInfo buf, const char *str);
46 
47 extern Datum json_typeof(PG_FUNCTION_ARGS);
48 
49 /* functions in jsonfuncs.c */
50 extern Datum json_object_field(PG_FUNCTION_ARGS);
51 extern Datum json_object_field_text(PG_FUNCTION_ARGS);
52 extern Datum json_array_element(PG_FUNCTION_ARGS);
53 extern Datum json_array_element_text(PG_FUNCTION_ARGS);
54 extern Datum json_extract_path(PG_FUNCTION_ARGS);
55 extern Datum json_extract_path_text(PG_FUNCTION_ARGS);
56 extern Datum json_object_keys(PG_FUNCTION_ARGS);
57 extern Datum json_array_length(PG_FUNCTION_ARGS);
58 extern Datum json_each(PG_FUNCTION_ARGS);
59 extern Datum json_each_text(PG_FUNCTION_ARGS);
60 extern Datum json_array_elements(PG_FUNCTION_ARGS);
61 extern Datum json_array_elements_text(PG_FUNCTION_ARGS);
62 extern Datum json_populate_record(PG_FUNCTION_ARGS);
63 extern Datum json_populate_recordset(PG_FUNCTION_ARGS);
64 extern Datum json_to_record(PG_FUNCTION_ARGS);
65 extern Datum json_to_recordset(PG_FUNCTION_ARGS);
66 extern Datum json_strip_nulls(PG_FUNCTION_ARGS);
67 
68 extern Datum jsonb_object_field(PG_FUNCTION_ARGS);
69 extern Datum jsonb_object_field_text(PG_FUNCTION_ARGS);
70 extern Datum jsonb_array_element(PG_FUNCTION_ARGS);
71 extern Datum jsonb_array_element_text(PG_FUNCTION_ARGS);
72 extern Datum jsonb_extract_path(PG_FUNCTION_ARGS);
73 extern Datum jsonb_extract_path_text(PG_FUNCTION_ARGS);
74 extern Datum jsonb_object_keys(PG_FUNCTION_ARGS);
75 extern Datum jsonb_array_length(PG_FUNCTION_ARGS);
76 extern Datum jsonb_each(PG_FUNCTION_ARGS);
77 extern Datum jsonb_each_text(PG_FUNCTION_ARGS);
78 extern Datum jsonb_array_elements_text(PG_FUNCTION_ARGS);
79 extern Datum jsonb_array_elements(PG_FUNCTION_ARGS);
80 extern Datum jsonb_populate_record(PG_FUNCTION_ARGS);
81 extern Datum jsonb_populate_recordset(PG_FUNCTION_ARGS);
82 extern Datum jsonb_to_record(PG_FUNCTION_ARGS);
83 extern Datum jsonb_to_recordset(PG_FUNCTION_ARGS);
84 extern Datum jsonb_strip_nulls(PG_FUNCTION_ARGS);
85 
86 #endif   /* JSON_H */
87