On Tue, Sep 08, 2009 at 10:04:39AM -0700, Garrett D'Amore wrote: > >Remember the fileno() fiasco? At least with functions, we have symbolic > >tricks we can pull to get different (and compatible) behaviors depending > >on who calls the function and how it's called. > > > >Fortunately for the BSD queue macros, that really isn't an issue. They > >haven't changed in approximately forever. > > More to the point, the "macros" for the BSD queues are self-contained. > That is to say, assuming you only use the macros within a single module, ^^^^^^^^
But why should anyone assume that? (Yes, fileno() was intended to be used with FILE *, which was a very public interface. But nothing stops one from making the same sort of mistake with these macros.) I think the BSD queue macros should be public interfaces, if only because they are useful for porting software. Perhaps they should come with a loud warning that one must not make struct types/typedefs defined by the *_HEAD() and *_ENTRY() macros, part of any public interface, though since they have never changed and we have no reason to think that they ever will... Incidentally, Linux has its own list API, including inlined functions. It'd be nice to have compatibility with that. Also, I second Darren's sentiment w.r.t. the AVL tree API. Nico --