From 78e387bae384a7addf851e40fd45198df10121d3 Mon Sep 17 00:00:00 2001
From: Mark Dilger <mark.dilger@enterprisedb.com>
Date: Thu, 23 Jan 2020 08:59:46 -0800
Subject: [PATCH 09/11] Relocating jsonapi.h

Moving jsonapi.h to src/include/common

In preparation for exposing this header for both frontend
and backend use, moving it to src/include/common, and
changing the #includes in other files to match.
---
 contrib/hstore/hstore_io.c              | 2 +-
 src/backend/tsearch/to_tsany.c          | 2 +-
 src/backend/tsearch/wparser.c           | 2 +-
 src/backend/utils/adt/json.c            | 1 +
 src/backend/utils/adt/jsonapi.c         | 3 ++-
 src/backend/utils/adt/jsonb.c           | 1 +
 src/backend/utils/adt/jsonb_util.c      | 2 +-
 src/backend/utils/adt/jsonfuncs.c       | 3 ++-
 src/include/{utils => common}/jsonapi.h | 2 +-
 src/include/utils/jsonfuncs.h           | 2 +-
 10 files changed, 12 insertions(+), 8 deletions(-)
 rename src/include/{utils => common}/jsonapi.h (99%)

diff --git a/contrib/hstore/hstore_io.c b/contrib/hstore/hstore_io.c
index 10ec392775..f3174f2995 100644
--- a/contrib/hstore/hstore_io.c
+++ b/contrib/hstore/hstore_io.c
@@ -7,13 +7,13 @@
 
 #include "access/htup_details.h"
 #include "catalog/pg_type.h"
+#include "common/jsonapi.h"
 #include "funcapi.h"
 #include "hstore.h"
 #include "lib/stringinfo.h"
 #include "libpq/pqformat.h"
 #include "utils/builtins.h"
 #include "utils/json.h"
-#include "utils/jsonapi.h"
 #include "utils/jsonb.h"
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
diff --git a/src/backend/tsearch/to_tsany.c b/src/backend/tsearch/to_tsany.c
index adf181c191..1fe67c4c99 100644
--- a/src/backend/tsearch/to_tsany.c
+++ b/src/backend/tsearch/to_tsany.c
@@ -13,10 +13,10 @@
  */
 #include "postgres.h"
 
+#include "common/jsonapi.h"
 #include "tsearch/ts_cache.h"
 #include "tsearch/ts_utils.h"
 #include "utils/builtins.h"
-#include "utils/jsonapi.h"
 #include "utils/jsonfuncs.h"
 
 
diff --git a/src/backend/tsearch/wparser.c b/src/backend/tsearch/wparser.c
index c7499a94ac..88005c0519 100644
--- a/src/backend/tsearch/wparser.c
+++ b/src/backend/tsearch/wparser.c
@@ -16,11 +16,11 @@
 #include "catalog/namespace.h"
 #include "catalog/pg_type.h"
 #include "commands/defrem.h"
+#include "common/jsonapi.h"
 #include "funcapi.h"
 #include "tsearch/ts_cache.h"
 #include "tsearch/ts_utils.h"
 #include "utils/builtins.h"
-#include "utils/jsonapi.h"
 #include "utils/jsonfuncs.h"
 #include "utils/varlena.h"
 
diff --git a/src/backend/utils/adt/json.c b/src/backend/utils/adt/json.c
index 743dafea4a..8333711988 100644
--- a/src/backend/utils/adt/json.c
+++ b/src/backend/utils/adt/json.c
@@ -14,6 +14,7 @@
 #include "postgres.h"
 
 #include "catalog/pg_type.h"
+#include "common/jsonapi.h"
 #include "funcapi.h"
 #include "libpq/pqformat.h"
 #include "miscadmin.h"
diff --git a/src/backend/utils/adt/jsonapi.c b/src/backend/utils/adt/jsonapi.c
index 75e71ba376..ee26dc324f 100644
--- a/src/backend/utils/adt/jsonapi.c
+++ b/src/backend/utils/adt/jsonapi.c
@@ -13,9 +13,10 @@
  */
 #include "postgres.h"
 
+#include "common/jsonapi.h"
 #include "common/pg_wchar.h"
 #include "miscadmin.h"
-#include "utils/jsonapi.h"
+#include "utils/mbutils.h"
 
 /*
  * The context of the parser is maintained by the recursive descent
diff --git a/src/backend/utils/adt/jsonb.c b/src/backend/utils/adt/jsonb.c
index c912f8932d..d1d4542f74 100644
--- a/src/backend/utils/adt/jsonb.c
+++ b/src/backend/utils/adt/jsonb.c
@@ -15,6 +15,7 @@
 #include "access/htup_details.h"
 #include "access/transam.h"
 #include "catalog/pg_type.h"
+#include "common/jsonapi.h"
 #include "funcapi.h"
 #include "libpq/pqformat.h"
 #include "miscadmin.h"
diff --git a/src/backend/utils/adt/jsonb_util.c b/src/backend/utils/adt/jsonb_util.c
index b33c3ef43c..edec657cd3 100644
--- a/src/backend/utils/adt/jsonb_util.c
+++ b/src/backend/utils/adt/jsonb_util.c
@@ -15,12 +15,12 @@
 
 #include "catalog/pg_collation.h"
 #include "catalog/pg_type.h"
+#include "common/jsonapi.h"
 #include "miscadmin.h"
 #include "utils/builtins.h"
 #include "utils/datetime.h"
 #include "utils/hashutils.h"
 #include "utils/json.h"
-#include "utils/jsonapi.h"
 #include "utils/jsonb.h"
 #include "utils/memutils.h"
 #include "utils/varlena.h"
diff --git a/src/backend/utils/adt/jsonfuncs.c b/src/backend/utils/adt/jsonfuncs.c
index 971ef6e630..d5e2c56f14 100644
--- a/src/backend/utils/adt/jsonfuncs.c
+++ b/src/backend/utils/adt/jsonfuncs.c
@@ -18,6 +18,7 @@
 
 #include "access/htup_details.h"
 #include "catalog/pg_type.h"
+#include "common/jsonapi.h"
 #include "common/pg_wchar.h"
 #include "fmgr.h"
 #include "funcapi.h"
@@ -27,10 +28,10 @@
 #include "utils/builtins.h"
 #include "utils/hsearch.h"
 #include "utils/json.h"
-#include "utils/jsonapi.h"
 #include "utils/jsonb.h"
 #include "utils/jsonfuncs.h"
 #include "utils/lsyscache.h"
+#include "utils/mbutils.h"
 #include "utils/memutils.h"
 #include "utils/syscache.h"
 #include "utils/typcache.h"
diff --git a/src/include/utils/jsonapi.h b/src/include/common/jsonapi.h
similarity index 99%
rename from src/include/utils/jsonapi.h
rename to src/include/common/jsonapi.h
index 4d69b18495..da20ffce64 100644
--- a/src/include/utils/jsonapi.h
+++ b/src/include/common/jsonapi.h
@@ -6,7 +6,7 @@
  * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * src/include/utils/jsonapi.h
+ * src/include/common/jsonapi.h
  *
  *-------------------------------------------------------------------------
  */
diff --git a/src/include/utils/jsonfuncs.h b/src/include/utils/jsonfuncs.h
index b993f38409..1f1b4029cb 100644
--- a/src/include/utils/jsonfuncs.h
+++ b/src/include/utils/jsonfuncs.h
@@ -14,7 +14,7 @@
 #ifndef JSONFUNCS_H
 #define JSONFUNCS_H
 
-#include "utils/jsonapi.h"
+#include "common/jsonapi.h"
 #include "utils/jsonb.h"
 
 /*
-- 
2.21.1 (Apple Git-122.3)

