aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_json.h
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2011-10-07 11:05:45 +0100
committerIan Campbell <ian.campbell@citrix.com>2011-10-07 11:05:45 +0100
commit93e240f0966324dee6b02d249f3e3a9e5ecf9d19 (patch)
treeec76c5e9da6c2cfc58233be168aa9c83934e34a2 /tools/libxl/libxl_json.h
parentee3665984b795ee3a4f56cf3d93ca697ce857f6f (diff)
downloadxen-93e240f0966324dee6b02d249f3e3a9e5ecf9d19.tar.gz
xen-93e240f0966324dee6b02d249f3e3a9e5ecf9d19.tar.bz2
xen-93e240f0966324dee6b02d249f3e3a9e5ecf9d19.zip
libxl: IDL: autogenerate functions to produce JSON from libxl data structures.
Two functions are provided. TYPE_gen_json exposes an interface which is compatible with the YAGL generator infrastructure. TYPE_to_string uses this to produce a pretty printed string. The TYPE_gen_json functions are defined in a new header libxl_json.h which is not exposed via libxl.h due to the use of YAGL datatypes to avoid poluting the namespace us libxl users which don't use the library themselves. If a libxl user is interested in integrating at the YAGL level then it should #include this file itself. Also update testidl to generate a random version of each IDL datastructure and convert it to JSON. Unfortunately this requires a libxl_ctx and therefore the test must be run on a Xen system now. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
Diffstat (limited to 'tools/libxl/libxl_json.h')
-rw-r--r--tools/libxl/libxl_json.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/libxl/libxl_json.h b/tools/libxl/libxl_json.h
new file mode 100644
index 0000000000..0715019ca5
--- /dev/null
+++ b/tools/libxl/libxl_json.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2011 Citrix Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#ifndef LIBXL_JSON_H
+#define LIBXL_JSON_H
+
+#include <yajl/yajl_gen.h>
+
+#include <_libxl_types_json.h>
+#include <_libxl_types_internal_json.h>
+
+#endif /* LIBXL_JSON_H */