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

Barton C Massey bart at cs.pdx.edu
Tue Feb 20 18:59:06 PST 2007


It's a reasonable suggestion, but we've been down that road
before.  People with languages very unlike C really do want
to implement the protocol directly.

In retrospect, X C Binding was a lousy name, but hey, who
knew?

	Bart

In message <200702202312.15471.hto at arcor.de> you wrote:
> 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
> _______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb


More information about the Xcb mailing list