rustyrussell/ccan — pull request #1 by ndreys (2011-11-16 11:07:28+00:00)
Title: Additional macro to iterate over list

Neither list_for_each, nor list_for_each_safe allow user to iterate
over a list if the structure of its elements is opaque.
List_for_each_opaque provides said functionality, for opaque
structures pointers to which can be safely cast to `struct
node_list *`. In other words if the corresponding `struct
node_list` field is placed at the top of the structure declaration.

P.S. I tried my best to figure out how the testing infrastructure
works, but I'm afraid I wasn't completely successful. I added my tests
to run.c, but the purpose of run-with-debug.c(looks completely
identical) and the mechanics behind using "Examples" section of
documentation for testing completely evade me. So for now I just
ignored them but if it's necessary I'll add tests there.