summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2011-05-17 11:44:53 -0600
committerEric Blake <eblake@redhat.com>2011-05-18 08:40:28 -0600
commitee57a3c7cfa1d2f0b892670a7fe5a6b0887c61ae (patch)
treeb14a50934fb524deb82f518a3a04b51e8943cd80
parentec00edbdee73b793feada979c53df862b1f52f08 (diff)
downloadlibvirt-python-split-ee57a3c7cfa1d2f0b892670a7fe5a6b0887c61ae.tar.gz
libvirt-python-split-ee57a3c7cfa1d2f0b892670a7fe5a6b0887c61ae.tar.xz
libvirt-python-split-ee57a3c7cfa1d2f0b892670a7fe5a6b0887c61ae.zip
libvirt.h: consolidate typed parameter handling
The new type is identical to the three old types that it replaces, and by creating a common type, this allows future patches to share common code that manipulates typed parameters. This change is backwards-compatible in API (recompilation works without any edits) and ABI (an older client that has not been recompiled uses the same layout) for code using only public names; only code using private names (those beginning with _) will have to adapt. * include/libvirt/libvirt.h.in (virTypedParameterType) (VIR_TYPED_PARAM_FIELD_LENGTH, _virTypedParameter): New enum, macro, and type. (virSchedParameter, virBlkioParameter, virMemoryParameter): Rewrite in terms of a common type, while keeping all old public names for backwards compatibility. (struct _virSchedParameter, struct _virBlkioParameter) (struct _virMemoryParameter): Delete - these are private names. * python/generator.py (enum): Cope with the refactoring.
-rwxr-xr-xgenerator.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/generator.py b/generator.py
index 9f9deb2..1741bba 100755
--- a/generator.py
+++ b/generator.py
@@ -154,6 +154,18 @@ def function(name, desc, ret, args, file, cond):
def enum(type, name, value):
if not enums.has_key(type):
enums[type] = {}
+ if value == 'VIR_TYPED_PARAM_INT':
+ value = 1
+ elif value == 'VIR_TYPED_PARAM_UINT':
+ value = 2
+ elif value == 'VIR_TYPED_PARAM_LLONG':
+ value = 3
+ elif value == 'VIR_TYPED_PARAM_ULLONG':
+ value = 4
+ elif value == 'VIR_TYPED_PARAM_DOUBLE':
+ value = 5
+ elif value == 'VIR_TYPED_PARAM_BOOLEAN':
+ value = 6
enums[type][name] = value
#######################################################################