6 * list - double linked list routines
8 * The list header contains routines for manipulating double linked lists.
9 * It defines two types: struct list_head used for anchoring lists, and
10 * struct list_node which is usually embedded in the structure which is placed
17 * #include <ccan/list/list.h>
21 * struct list_head children;
22 * unsigned int num_children;
27 * struct list_node list;
30 * int main(int argc, char *argv[])
37 * errx(1, "Usage: %s parent children...", argv[0]);
40 * list_head_init(&p.children);
41 * for (i = 2; i < argc; i++) {
42 * c = malloc(sizeof(*c));
44 * list_add(&p.children, &c->list);
48 * printf("%s has %u children:", p.name, p.num_children);
49 * list_for_each(&p.children, c, list)
50 * printf("%s ", c->name);
55 * Licence: LGPL (2 or any later version)
57 int main(int argc, char *argv[])
62 if (strcmp(argv[1], "depends") == 0) {
63 printf("ccan/container_of\n");