[Xcb] about api changes

Christoph Pfister christophpfister at gmail.com
Sun Jun 10 03:08:52 PDT 2007


Am Samstag, 9. Juni 2007 22:00 schrieb Barton C Massey:
> In message <19a3b7a80706090629m7634c94bx4014113f8692bdb2 at mail.gmail.com> you 
wrote:
> > There are in fact three ways with the current api:
> > a) get a pointer to the first element + advance yourself
> > b) get an iterater + advance yourself
> > c) get an iterator + use the _next() function
> >
> > a + b are possible for the continuous lists (where elements occupy
> > adjacent memory positions); b + c are possible for the non-continuous
> > lists (but b is in this case _horribly_ wrong).
>
> Very clear summary--thanks!
>
> My original intent was that (c) be possible for *all* list
> types; I didn't realize that at some point we lost the
> iterators for continuous lists, but IMHO we should put them
> back.  (a) would then be a shortcut that only works for
> continuous lists.  IMHO (b) is just a bad idea, since the
> iterators are in general opaque.  As you say, if you know
> you can do (a), you should just do (a), and otherwise you
> should do (c).
>
> This small change also preserves the current API/ABI, which
> is a bonus.

Yes - this sounds good to me. Don't forget to add a note about that in the 
tutorial once it's done ... :-P

> My 2c --- YMMV.

It could be reconsidered for a next major api breakage (like 2.0 - which will 
happen _somewhen_ but certainly not in the near future). Because I think 
stuff like *_end(), .rem & .index is ugly enough to think again about 
this ...

>     Bart

Christoph


More information about the Xcb mailing list