libxl: IDL: autogenerate functions to produce JSON from libxl data structures.
authorIan Campbell <ian.campbell@citrix.com>
Fri, 7 Oct 2011 10:05:45 +0000 (11:05 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 7 Oct 2011 10:05:45 +0000 (11:05 +0100)
commit93e240f0966324dee6b02d249f3e3a9e5ecf9d19
treeec76c5e9da6c2cfc58233be168aa9c83934e34a2
parentee3665984b795ee3a4f56cf3d93ca697ce857f6f
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>
tools/libxl/Makefile
tools/libxl/gentest.py
tools/libxl/gentypes.py
tools/libxl/idl.txt
tools/libxl/libxl.h
tools/libxl/libxl_internal.h
tools/libxl/libxl_json.c
tools/libxl/libxl_json.h [new file with mode: 0644]
tools/libxl/libxl_types.idl
tools/libxl/libxltypes.py