|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v8 16/17] libxl_json: Remove libxl__json_object_append_to from header
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@xxxxxxxxxx>
---
Notes:
v8:
New follow-up patch
tools/libxl/libxl_internal.h | 5 -----
tools/libxl/libxl_json.c | 9 +++++----
2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index c4968ca135..f1e5c2c980 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -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
diff --git a/tools/libxl/libxl_json.c b/tools/libxl/libxl_json.c
index cd78313df2..9b8ef2cab9 100644
--- a/tools/libxl/libxl_json.c
+++ b/tools/libxl/libxl_json.c
@@ -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;
--
Anthony PERARD
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |