[Xcb] char* in structs ;)

Jeremy Kolb jkolb at brandeis.edu
Fri Jun 10 08:02:27 PDT 2005


Quoting David Eger <eger at havoc.gtf.org>:

> On Tue, Jun 07, 2005 at 11:19:33PM -0400, Jeremy A. Kolb wrote:
> > Ok.  In XV there is an AttributeInfo struct, a list of which are returned
> > from a reply.
> >
> > So it looks like we're going to need a way of
> > returning a struct with a list in it of variable size.
>
> Man I need to finish this implementation of BLT ;-)
>
> As a note, the only good solution I know for structs with variable
> sized fields is to represent such fields by two words:
>
> struct XV_Request_Foo {
>    ...
>    struct {
>       int len;
>       struct AttributeInfo *arr;
>    } ais;
>    ...
> };
>
> -David
>


As far as I know we can't send or receive a struct *within* a request/reply
that has a variable length field in it.

Maybe I'm just confused though.  I usually am.

Jeremy


More information about the xcb mailing list