summaryrefslogtreecommitdiff
path: root/ccan/list/list.c
diff options
context:
space:
mode:
authorWilliam Casarin <jb55@jb55.com>2018-07-09 22:28:25 -0700
committerWilliam Casarin <jb55@jb55.com>2018-07-09 22:31:48 -0700
commit9593fc545950782ed75f12f53238b07885559b2b (patch)
tree9c7c2f7cbb427c54e9184cb61eedce737a6cbc6f /ccan/list/list.c
parentbd8c223756d2f912526ecef53bae0cc8e0c63442 (diff)
remove ccan for now
Diffstat (limited to 'ccan/list/list.c')
-rw-r--r--ccan/list/list.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/ccan/list/list.c b/ccan/list/list.c
deleted file mode 100644
index 2717fa3..0000000
--- a/ccan/list/list.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Licensed under BSD-MIT - see LICENSE file for details */
-#include <stdio.h>
-#include <stdlib.h>
-#include "list.h"
-
-static void *corrupt(const char *abortstr,
- const struct list_node *head,
- const struct list_node *node,
- unsigned int count)
-{
- if (abortstr) {
- fprintf(stderr,
- "%s: prev corrupt in node %p (%u) of %p\n",
- abortstr, node, count, head);
- abort();
- }
- return NULL;
-}
-
-struct list_node *list_check_node(const struct list_node *node,
- const char *abortstr)
-{
- const struct list_node *p, *n;
- int count = 0;
-
- for (p = node, n = node->next; n != node; p = n, n = n->next) {
- count++;
- if (n->prev != p)
- return corrupt(abortstr, node, n, count);
- }
- /* Check prev on head node. */
- if (node->prev != p)
- return corrupt(abortstr, node, node, 0);
-
- return (struct list_node *)node;
-}
-
-struct list_head *list_check(const struct list_head *h, const char *abortstr)
-{
- if (!list_check_node(&h->n, abortstr))
- return NULL;
- return (struct list_head *)h;
-}