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);
42 * for (i = 2; i < argc; i++) {
43 * c = malloc(sizeof(*c));
45 * list_add(&p.children, &c->list);
49 * printf("%s has %u children:", p.name, p.num_children);
50 * list_for_each(&p.children, c, list)
51 * printf("%s ", c->name);
56 * License: LGPL (v2.1 or any later version)
57 * Author: Rusty Russell <rusty@rustcorp.com.au>
59 int main(int argc, char *argv[])
64 if (strcmp(argv[1], "depends") == 0) {
65 printf("ccan/container_of\n");