From ce0425b162d0a8c168e1fbab5324fb1cbca4b6b7 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Fri, 24 Jan 2020 09:58:37 -0800 Subject: Adjust src/include/utils/jsonapi.h so it's not backend-only. 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. --- src/include/utils/json.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/include/utils/json.h') diff --git a/src/include/utils/json.h b/src/include/utils/json.h index 20b52944919..4345fbdc316 100644 --- a/src/include/utils/json.h +++ b/src/include/utils/json.h @@ -18,5 +18,7 @@ /* 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 */ -- cgit v1.2.3