diff options
| author | William Casarin <jb55@jb55.com> | 2018-07-09 22:28:25 -0700 |
|---|---|---|
| committer | William Casarin <jb55@jb55.com> | 2018-07-09 22:31:48 -0700 |
| commit | 9593fc545950782ed75f12f53238b07885559b2b (patch) | |
| tree | 9c7c2f7cbb427c54e9184cb61eedce737a6cbc6f /ccan/list/test/compile_ok-constant.c | |
| parent | bd8c223756d2f912526ecef53bae0cc8e0c63442 (diff) | |
remove ccan for now
Diffstat (limited to 'ccan/list/test/compile_ok-constant.c')
| -rw-r--r-- | ccan/list/test/compile_ok-constant.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/ccan/list/test/compile_ok-constant.c b/ccan/list/test/compile_ok-constant.c deleted file mode 100644 index c57cdad..0000000 --- a/ccan/list/test/compile_ok-constant.c +++ /dev/null @@ -1,49 +0,0 @@ -#include <ccan/list/list.h> -#include <ccan/tap/tap.h> -#include <ccan/list/list.c> -#include <stdbool.h> -#include <stdio.h> - -struct child { - const char *name; - struct list_node list; -}; - -static bool children(const struct list_head *list) -{ - return !list_empty(list); -} - -static const struct child *first_child(const struct list_head *list) -{ - return list_top(list, struct child, list); -} - -static const struct child *last_child(const struct list_head *list) -{ - return list_tail(list, struct child, list); -} - -static void check_children(const struct list_head *list) -{ - list_check(list, "bad child list"); -} - -static void print_children(const struct list_head *list) -{ - const struct child *c; - list_for_each(list, c, list) - printf("%s\n", c->name); -} - -int main(void) -{ - LIST_HEAD(h); - - children(&h); - first_child(&h); - last_child(&h); - check_children(&h); - print_children(&h); - return 0; -} |
