[Xcb] [PATCH proto 1/5] xcbgen: support paramref in the parser

Christian Linhart chris at demorecorder.com
Sun Sep 7 17:29:06 PDT 2014


>From the perspective of the parser,
paramref is similar to fieldref, but has a type attribute.
---
 xcbgen/expr.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xcbgen/expr.py b/xcbgen/expr.py
index bdb930b..bcbcea3 100644
--- a/xcbgen/expr.py
+++ b/xcbgen/expr.py
@@ -60,14 +60,18 @@ class Expression(object):
             self.lenfield_name = elt.get('name') + '_len'
             self.lenfield_type = 'CARD32'
 
         elif elt.tag == 'fieldref':
             # Standard list with a fieldref
             self.lenfield_name = elt.text
 
+        elif elt.tag == 'paramref':
+            self.lenfield_name = elt.text
+            self.lenfield_type = elt.get('type')
+
         elif elt.tag == 'valueparam':
             # Value-mask.  The length bitmask is described by attributes.
             self.lenfield_name = elt.get('value-mask-name')
             self.lenfield_type = elt.get('value-mask-type')
             self.lenwire = True
             self.bitfield = True
 
-- 
2.0.1



More information about the Xcb mailing list