[Xcb] XML description of GLX conditional reply lists

Jamey Sharp jamey at minilop.net
Wed Nov 29 11:52:47 PST 2006


On Wed, Nov 29, 2006 at 02:19:38PM -0500, Jeremy A. Kolb wrote:
> In the case of these requests what do you want the C code we generate
> to look like?  Are you thinking that we'd always return the list and
> that XCB would add the one reply value to the list if need be?  I'm
> just not sure how common this case is.

I was trying to describe the code I want to generate in my earlier mail,
but just to be more explicit... The current code is:

uint8_t *
xcb_glx_get_booleanv_data (const xcb_glx_get_booleanv_reply_t *R)
{
    return (uint8_t *) (R + 1);
}

But I want to insert two lines:

uint8_t *
xcb_glx_get_booleanv_data (const xcb_glx_get_booleanv_reply_t *R)
{
    if(R->n == 1)
        return &R->datum;
    return (uint8_t *) (R + 1);
}

> On Wed, 29 Nov 2006, Jamey Sharp wrote:
> > On Wed, Nov 29, 2006 at 08:07:40AM -0500, Jeremy Kolb wrote:
> > > A glx utility library might be a nice thing to have for these and
> > > other functions...
> > 
> > I think currently that library is called "Mesa". ;-)
> 
> Haha no Mesa is WAY more complicated. ;)  I was thinking more along
> the lines of a few convenience functions... but I don't think the need
> is that dire.

AFAIK only Mesa actually uses GLX protocol. The only benefit to making a
new library is that you get a defined interface for shared code, so that
development is decoupled and different projects can proceed at different
rates. But the cost of introducing a library is you have to define an
interface that allows project development to be decoupled. In this case,
there's no sharing between projects, so creating a library is all cost
and no benefit; therefore, convenience code should just be in Mesa.

That said, I want the above change, even if only Mesa's code generator
benefits, because: it fits with both Bart's point of view and mine on
XCB's API; it should be easy; and it makes the XML better describe the
protocol.

--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/20061129/27a15f81/attachment.pgp


More information about the Xcb mailing list