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
15 * #include "list/list.h"
19 * struct list_head children;
20 * unsigned int num_children;
25 * struct list_node list;
28 * int main(int argc, char *argv[])
35 * errx(1, "Usage: %s parent children...", argv[0]);
38 * for (i = 2; i < argc, i++) {
39 * c = malloc(sizeof(*c));
41 * list_add(&p.children, &c->list);
45 * printf("%s has %u children:", p.name, p.num_children);
46 * list_for_each(&p.children, c, list)
47 * printf("%s ", c->name);
52 int main(int argc, char *argv[])
57 if (strcmp(argv[1], "depends") == 0) {
58 printf("ccan/container_of\n");