diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2012-07-06 13:17:40 +0100 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2012-07-06 13:17:40 +0100 |
commit | 618a40391f353f236c007038147a7b3771032f15 (patch) | |
tree | 267bb62e7d4ced046abafc8bfc49d63fe3d9706d /tools/libxl/idl.py | |
parent | 334f50ccc4e3f3a045874de9aca77adc76e900be (diff) | |
download | xen-618a40391f353f236c007038147a7b3771032f15.tar.gz xen-618a40391f353f236c007038147a7b3771032f15.tar.bz2 xen-618a40391f353f236c007038147a7b3771032f15.zip |
libxl: add a new Array type to the IDL
And make all the required infrastructure updates to enable this.
Since there are currently no uses of this type there is no change to
the generated code.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Tested-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/libxl/idl.py')
-rw-r--r-- | tools/libxl/idl.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/libxl/idl.py b/tools/libxl/idl.py index 4bc67f256f..7d95e3f871 100644 --- a/tools/libxl/idl.py +++ b/tools/libxl/idl.py @@ -266,6 +266,17 @@ string = Builtin("char *", namespace = None, dispose_fn = "free", json_fn = "libxl__string_gen_json", autogenerate_json = False) +class Array(Type): + """An array of the same type""" + def __init__(self, elem_type, lenvar_name, **kwargs): + kwargs.setdefault('dispose_fn', 'free') + Type.__init__(self, namespace=elem_type.namespace, typename=elem_type.rawname + " *", **kwargs) + + lv_kwargs = dict([(x.lstrip('lenvar_'),y) for (x,y) in kwargs.items() if x.startswith('lenvar_')]) + + self.lenvar = Field(integer, lenvar_name, **lv_kwargs) + self.elem_type = elem_type + class OrderedDict(dict): """A dictionary which remembers insertion order. |