Jorgen Grahn <grahn+> writes:
> Not an answer, but it's a good idea to also provide a void* for
> user-supplied data (unless one of those two unsigned longs serve that
> purpose).
>
> It can be really frustrating to get a callback, but not being able to
> *do* anything useful because you don't have access to your own data
> structures. That tends to end up with you making all your data
> structures (reachable through) global variables -- ugh.
Yes yes yes. One of the most important lessons I've learnt in the last
few years. Sooner or later you end up going back and hacking the code
to put that user data pointer in, so you might as well put it there in
the first place. Another thing the standard library didn't necessarily
get completely right and which was too easy to slavishly copy.
--
Online waterways route planner |
http://canalplan.eu
Plan trips, see photos, check facilities |
http://canalplan.org.uk