[Xcb] naming convention (finished)

Jamey Sharp jamey at minilop.net
Tue Sep 19 10:05:26 PDT 2006


On Tue, Sep 19, 2006 at 08:00:57AM -0700, Ian Osgood wrote:
> On Sep 18, 2006, at 6:00 PM, Jamey Sharp wrote:
> >RENDER had a namespace collision prior to this renaming between the
> >PictOp enumeration and the PictOp error; my code currently assumes the
> >error is what was meant, which is probably the right assumption given
> >that programs couldn't actually use the enumeration typename before.
> 
> Another way to fix this is to distinguish error codes.  
> xcb_bad_pict_op like Xlib is one way.

That's not the issue I'm talking about. The *old* API had this
ambiguity; the new one doesn't. So the only problem is in writing the
API conversion tool: which name do I translate the ambiguous one to?

Also, note that error numbers are constants, so now are named in all
caps: XCB_RENDER_PICT_OP.

We could add a BAD prefix in there, I guess. I resisted it before due to
the mismatch with the protocol documentation, which we've sort of
abandoned now anyway. I'll resist it a little bit still because it makes
my API conversion tool a little harder ;-) but more importantly, what
rule are we creating here? Do we need to namespace events as well? Does
this rule apply elsewhere in the API?

> >Anyway, with the above things fixed, there's just minor differences
> >in our rules for identifying "words" that should be separated with
> >underscores in these names. Hopefully that will be straightforward,
> >but we need to decide whether things should be named XCB_MAP_INDEX_1
> >or XCB_MAP_INDEX1, for example.
> 
> I prefer the former. Especially in this example, where another of the
> enumeration values is INDEX_SHIFT.

You and Vincent both have coherent arguments for this: I'll take it.
But what do I do with CHAR2B, for instance? xcb_char_2_b_t?

--Jamey
-------------- 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/20060919/df231d5b/attachment.pgp


More information about the Xcb mailing list