[Xcb] [patch] Define and use the opcode numbers.

Jamey Sharp jamey at minilop.net
Wed Aug 23 11:20:39 PDT 2006

On Fri, Aug 18, 2006 at 04:21:46PM -0400, Zephaniah E. Hull wrote:
> Hard coding the opcode numbers in the function just makes it harder to
> figure out what's going on, but much more to the point, not defining the
> opcodes in the header makes it impossible to use the generated headers
> instead of the x11proto headers in the server.

That's a really good argument. :-) A further patch to replace hardcoded
opcodes in the rest of XCB's implementation would be welcome as well --
I think the only one is in xcb_out.c, in XCBSendRequest.

> -      <do-request ref="XCB{$ext}{$req/@name}Req" opcode="{$req/@opcode}"
> +      <do-request ref="XCB{$ext}{$req/@name}Req" opcode="XCB_{$ext}{@name}"

My only issue is with this naming convention. I know Xlib uses
X_{ext}{name}, but mixing underscores and camel-caps is just wrong. (I
regret having even used camel-caps in XCB, which I did because Xlib did,
but I'm not changing that now.)

Of course, XCB{ext}{name} is already used for the request functions. How
about, for example, XCBCreateWindowOpcode, or perhaps

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20060823/59a64fa3/attachment.pgp

More information about the Xcb mailing list