[Xcb] XML-XCB: language-neutral bit constants
Ian Osgood
iano at quirkster.com
Tue Mar 14 11:23:46 PST 2006
On Mar 14, 2006, at 10:56 AM, Jeremy A. Kolb wrote:
> On Tue, 14 Mar 2006, Ian Osgood wrote:
>
>>
>>> From: Ian Osgood <iano at quirkster.com>
>>>
>>> (BTW: I'd like to try my hand at this XSLT stuff with a better
>>> construct
>>> for bitmask constants.
>>
>> I came up with <bit bit="n"/>, which replaces:
>>
>> <op op="<<"><value>1</value><value>n</value></op>
>>
>> Unless there are objections, I'll push my changes to xproto.xml,
>> xcb.xsd, and c-client.xsl.
>>
>> Ian
>>
>>
>
> Are you replacing the op tag? Because that's a bad idea.
>
> I would change that to lbit or something since i may be possible to
> shift
> right as well.
>
> Jeremy
I'm adding a convenience function for one usage of the op="<<"
tag (see above). <op> itself is unmodified. I realize that
changing the name of operators & and << would result in
lots of breakage in the extensions. I like your idea of renaming
them, though. :)
<bit> is for addressing a bit in a word. The C idiom is (1<<n), but
other languages name this "shl(1,n)" or have built in bit addressing
syntax (Pascal, Modula, and Oberon's sets for instance).
This is in preparation for moving constants from X.h to enumerations
in xproto.xml.
Ian
More information about the Xcb
mailing list