]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
libxl_json: Remove libxl__json_object_append_to from header
authorAnthony PERARD <anthony.perard@citrix.com>
Fri, 4 Jan 2019 13:53:21 +0000 (13:53 +0000)
committerWei Liu <wei.liu2@citrix.com>
Fri, 11 Jan 2019 14:57:52 +0000 (14:57 +0000)
It isn't possible to use libxl__json_object_append_to() outside of
libxl_json.c as there is no way to allocate a struct libxl__yajl_ctx.
So also remove libxl__yajl_ctx typedef from the internal header.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_internal.h
tools/libxl/libxl_json.c

index c21d475102818eabc38679bdf6228d732a60039d..bf3b85b01358d0d634573ed7991c27c4bed9537a 100644 (file)
@@ -2071,8 +2071,6 @@ typedef struct {
     libxl__json_object *obj;
 } libxl__json_map_node;
 
-typedef struct libxl__yajl_ctx libxl__yajl_ctx;
-
 static inline bool libxl__json_object_is_null(const libxl__json_object *o)
 {
     return o != NULL && o->type == JSON_NULL;
@@ -2159,9 +2157,6 @@ static inline long long libxl__json_object_get_integer(const libxl__json_object
  */
 _hidden libxl__json_object *libxl__json_object_alloc(libxl__gc *gc_opt,
                                                      libxl__json_node_type type);
-_hidden int libxl__json_object_append_to(libxl__gc *gc_opt,
-                                         libxl__json_object *obj,
-                                         libxl__yajl_ctx *ctx);
 _hidden libxl__json_object *libxl__json_array_get(const libxl__json_object *o,
                                                   int i);
 _hidden
index cd78313df254b8dbe234d9812c4ab8068563879f..9b8ef2cab916ad1e8f2444727ee1fc87fa608d42 100644 (file)
@@ -23,7 +23,7 @@
 
 /* #define DEBUG_ANSWER */
 
-struct libxl__yajl_ctx {
+typedef struct libxl__yajl_ctx {
     libxl__gc *gc;
     yajl_handle hand;
     libxl__json_object *head;
@@ -31,7 +31,7 @@ struct libxl__yajl_ctx {
 #ifdef DEBUG_ANSWER
     yajl_gen g;
 #endif
-};
+} libxl__yajl_ctx;
 
 #ifdef DEBUG_ANSWER
 #if YAJL_VERSION < 20000
@@ -463,8 +463,9 @@ libxl__json_object *libxl__json_object_alloc(libxl__gc *gc,
     return obj;
 }
 
-int libxl__json_object_append_to(libxl__gc *gc, libxl__json_object *obj,
-                                 libxl__yajl_ctx *ctx)
+static int libxl__json_object_append_to(libxl__gc *gc,
+                                        libxl__json_object *obj,
+                                        libxl__yajl_ctx *ctx)
 {
     libxl__json_object *dst = ctx->current;