]> git.ozlabs.org Git - ccan/blobdiff - ccan/container_of/_info.c
Fix examples (they all compile now), and init parent list in list
[ccan] / ccan / container_of / _info.c
index 194fcabaf4c07c20e5004633f1fb9d1ec311e57b..4c25c296036d510a84f2df79c44736004e2200f7 100644 (file)
  * callback.
  *
  * Example:
- *     struct info
- *     {
+ *     #include <stdio.h>
+ *     #include <ccan/container_of/container_of.h>
+ *
+ *     struct timer {
+ *             void *members;
+ *     };
+ *
+ *     struct info {
  *             int my_stuff;
  *             struct timer timer;
  *     };
@@ -31,7 +37,9 @@
  *             struct info info = { .my_stuff = 1 };
  *
  *             register_timer(&info.timer);
- *             ...
+ *             // ...
+ *             return 0;
+ *     }
  *
  * Licence: LGPL (2 or any later version)
  */