[Xcb] xml description: removal of <op> fields

Thomas Hunger hto at arcor.de
Tue Feb 20 14:12:15 PST 2007


Hello,

in the xml-description there are list fields which look like

    <list type="VISUALTYPE" name="visuals">
      <fieldref>visuals_len</fieldref>
    </list>

sometimes with some expression to calculate the length:

    <list type="KEYSYM" name="keysyms">
      <op op="*">
        <fieldref>length</fieldref>
        <value>4</value>
      </op>
    </list>

This is very verbose and only sensible if other languages than c 
implement the binary protocol. I believe that most language bindings 
will wrap the existing c functions. That means the lists could be 
rewritten to:

<list type="VISUALTYPE" name="visuals" length="visuals_len" />
<list type="KEYSYM" name="keysyms" length="length*4" />

or more complex:

<list type="void" name="data" length="data_len*format/8">

This is imo easier to think, write and parse. 

There is also an  <exprfield> with operator tags inside. I'd like to 
change this from

    <exprfield type="BOOL" name="odd_length">
      <op op="&amp;">
        <fieldref>string_len</fieldref><value>1</value>
      </op>
    </exprfield>

to:
    <field type="BOOL" name="odd_length" value="string_len &amp; 1" />

What do you think?
Tom


More information about the Xcb mailing list