6 * lstack - Simple, singly-linked-list stack implementation
8 * This code provides a simple implementation of the Stack abstract
9 * data type in terms of a singly linked list.
12 * Author: David Gibson <david@gibson.dropbear.id.au>
15 * #include <ccan/lstack/lstack.h>
19 * struct lstack_link sl;
22 * int main(int argc, char *argv[])
28 * for (i = 0; i < argc; i++) {
29 * a = malloc(sizeof(*a));
31 * lstack_push(&argstack, a, sl);
34 * printf("Command line arguments in reverse:\n");
36 * while (!lstack_empty(&argstack)) {
37 * a = lstack_pop(&argstack, struct arg, sl);
38 * printf("Argument: %s\n", a->arg);
45 int main(int argc, char *argv[])
47 /* Expect exactly one argument */
51 if (strcmp(argv[1], "depends") == 0) {
52 printf("ccan/container_of\n");