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

Zephaniah E. Hull warp at aehallh.com
Thu Aug 24 09:35:41 PDT 2006

On Wed, Aug 23, 2006 at 11:20:39AM -0700, Jamey Sharp wrote:
> 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
> XCBOpcodeCreateWindow?

Hrm, whatever works.  Preferably something that doesn't add a ton to the
total length, but aside from that I have no real preference.

Zephaniah E. Hull.

	  1024D/E65A7801 Zephaniah E. Hull <warp at aehallh.com>
	   92ED 94E4 B1E6 3624 226D  5727 4453 008B E65A 7801
	    CCs of replies from mailing lists are requested.

"I would rather spend 10 hours reading someone else's source code than
10 minutes listening to Musak waiting for technical support which
(By Dr. Greg Wettstein, Roger Maris Cancer Center)
-------------- 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/20060824/e7169d98/attachment.pgp

More information about the Xcb mailing list