mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-21 13:56:59 +08:00
The major change here is that we no longer include jsonb.h into jsonapi.h. The reason that was necessary is that jsonapi.h included several prototypes functions in jsonfuncs.c that depend on the Jsonb type. Move those prototypes to a new header, jsonfuncs.h, and include it where needed. The other change is that JsonEncodeDateTime is now declared in json.h rather than jsonapi.h. Taken together, these steps eliminate all dependencies of jsonapi.h on backend-only data types and header files, so that it can potentially be included in frontend code.
25 lines
661 B
C
25 lines
661 B
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* json.h
|
|
* Declarations for JSON data type support.
|
|
*
|
|
* Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
*
|
|
* src/include/utils/json.h
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
|
|
#ifndef JSON_H
|
|
#define JSON_H
|
|
|
|
#include "lib/stringinfo.h"
|
|
|
|
/* functions in json.c */
|
|
extern void escape_json(StringInfo buf, const char *str);
|
|
extern char *JsonEncodeDateTime(char *buf, Datum value, Oid typid,
|
|
const int *tzp);
|
|
|
|
#endif /* JSON_H */
|