[Xcb] new "length" element needs a type?
Uli Schlachter
psychon at znc.in
Mon Sep 20 14:21:25 UTC 2021
Hi,
Am 20.09.21 um 16:12 schrieb Tycho Andersen:
> On Mon, Sep 20, 2021 at 04:05:11PM +0200, Uli Schlachter wrote:
>> Am 19.09.21 um 15:34 schrieb Tycho Andersen:
>>> There is a new length element for structs documented in c36dde3f4535
>>> ("Add element to specify expression that defines length of a struct")
>>> with a first use introduced in f0db8b7d31a3 ("xinput: Add length
>>> specification for DeviceClass struct"), but as near as I can tell
>>> there's no type information for this, either in the docs or in this
>>> particular usage.
>>
>> Why does there need to be a type? Other uses of expressions in the XML
>> are also untyped.
>>
>> For example:
>>
>> <struct name="SetupAuthenticate">
>> <field type="CARD8" name="status" /> <!-- always 2 -> Authenticate -->
>> <pad bytes="5" />
>> <field type="CARD16" name="length" />
>> <list type="char" name="reason">
>> <op op="*">
>> <fieldref>length</fieldref>
>> <value>4</value>
>> </op>
>> </list>
>> </struct>
>>
>> Here, the length of the list is 4*length and there is again no explicit
>> type given for the length.
>
> Huh? The length field has type="CARD16" doesn't it?
>
> The list itself as type="char". Which thing here doesn't have an
> explicit type?
Nothing. So perhaps I am misunderstanding you.
What does not have an explicit type with the new <length> element? The
field "len" has type="CARD16", doesn't it? Put differently: What is the
difference to SetupAuthenticate above?
<struct name="DeviceClass">
<length>
<op op="*">
<fieldref>len</fieldref>
<value>4</value>
</op>
</length>
<field type="CARD16" name="type" enum="DeviceClassType" />
<field type="CARD16" name="len" />
[...]
</struct>
Cheers,
Uli
--
- He wants the impossible...!
- That's the short definition of 'captain'.
More information about the Xcb
mailing list