mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
libxl: idl: support new "private" type attribute
This provides for fields in libxl datatypes which are only present in the C version of structures and are used only by libxl itself. This is useful when a libxl datatype wants to contain fields which are used by libxl internally and which are only present in the structure to avoid additional memory allocation inconvenience. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
This commit is contained in:
1 parent
46f6034c3d
commit
eee7480fdf
3 files changed
+11
-1
No files matched your search
@@ -129,6 +129,8 @@ static PyObject *Py%(rawname)s_new(PyTypeObject *type, PyObject *args, PyObject
|
||||
|
||||
l.append('static PyGetSetDef Py%s_getset[] = {'%ty.rawname)
|
||||
for f in ty.fields:
|
||||
if f.type.private:
|
||||
continue
|
||||
l.append(' { .name = "%s", '%f.name)
|
||||
if ty.marshal_out():
|
||||
l.append(' .get = (getter)py_%s_%s_get, '%(ty.rawname, f.name))
|
||||
@@ -295,9 +297,13 @@ _hidden int genwrap__ll_set(PyObject *v, long long *val, long long mask);
|
||||
|
||||
""" % tuple((' '.join(sys.argv),) + (os.path.split(decls)[-1:]),))
|
||||
for ty in types:
|
||||
if ty.private:
|
||||
continue
|
||||
if isinstance(ty, libxltypes.Aggregate):
|
||||
f.write('/* Attribute get/set functions for %s */\n'%ty.typename)
|
||||
for a in ty.fields:
|
||||
if a.type.private:
|
||||
continue
|
||||
if ty.marshal_out():
|
||||
f.write(py_attrib_get(ty,a))
|
||||
if ty.marshal_in():
|
||||
|
||||