[Xcb] XML description of GLX conditional reply lists

Jeremy A. Kolb jkolb at brandeis.edu
Wed Nov 29 12:02:35 PST 2006


On Wed, 29 Nov 2006, Jamey Sharp wrote:

> 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);
> }
> 

Yeah that looks good. I'm not sure what we should do with the XML.  I 
don't remember exactly but I think that these replies also have 0 length 
on error or something like that in which case it won't even return the 
'datum' field.  Maybe we can do something with length... so if the length 
is 0 we'll return null, 1 we return datum else we return the list.  Maybe 
some "cond" tag or something...

> > 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 makes sense.  Mesa isn't the only library to use GLX though.  Granted 
it's the only one I know of that uses these functions but there are other 
requests (context creation etc.) that need to be used in a standalone 
XCB OpenGL program.

> 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
> 



More information about the Xcb mailing list