From c8adca42aa407e1c68bcc2697b20e1242dfa3a3e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 1 Jun 2011 21:39:42 +0000 Subject: patricia.[ch]: remove dead functions They're unused by our Ruby module, so there's no need to preserve them. --- ext/rpatricia/patricia.c | 61 ------------------------------------------------ ext/rpatricia/patricia.h | 5 ---- 2 files changed, 66 deletions(-) diff --git a/ext/rpatricia/patricia.c b/ext/rpatricia/patricia.c index ebd7999..9eb969c 100644 --- a/ext/rpatricia/patricia.c +++ b/ext/rpatricia/patricia.c @@ -944,64 +944,3 @@ patricia_remove (patricia_tree_t *patricia, patricia_node_t *node) parent->l = child; } } - -/* { from demo.c */ - -patricia_node_t * -make_and_lookup (patricia_tree_t *tree, char *string) -{ - prefix_t *prefix; - patricia_node_t *node; - - prefix = ascii2prefix (AF_INET, string); - printf ("make_and_lookup: %s/%d\n", prefix_toa (prefix), prefix->bitlen); - node = patricia_lookup (tree, prefix); - Deref_Prefix (prefix); - return (node); -} - -patricia_node_t * -try_search_exact (patricia_tree_t *tree, char *string) -{ - prefix_t *prefix; - patricia_node_t *node; - - prefix = ascii2prefix (AF_INET, string); - printf ("try_search_exact: %s/%d\n", prefix_toa (prefix), prefix->bitlen); - if ((node = patricia_search_exact (tree, prefix)) == NULL) { - printf ("try_search_exact: not found\n"); - } - else { - printf ("try_search_exact: %s/%d found\n", - prefix_toa (node->prefix), node->prefix->bitlen); - } - Deref_Prefix (prefix); - return (node); -} - -void -lookup_then_remove (patricia_tree_t *tree, char *string) -{ - patricia_node_t *node; - - if (node = try_search_exact (tree, string)) - patricia_remove (tree, node); -} - -patricia_node_t * -try_search_best (patricia_tree_t *tree, char *string) -{ - prefix_t *prefix; - patricia_node_t *node; - - prefix = ascii2prefix (AF_INET, string); - printf ("try_search_best: %s/%d\n", prefix_toa (prefix), prefix->bitlen); - if ((node = patricia_search_best (tree, prefix)) == NULL) - printf ("try_search_best: not found\n"); - else - printf ("try_search_best: %s/%d found\n", - prefix_toa (node->prefix), node->prefix->bitlen); - Deref_Prefix (prefix); -} - -/* } */ diff --git a/ext/rpatricia/patricia.h b/ext/rpatricia/patricia.h index ee12744..5224859 100644 --- a/ext/rpatricia/patricia.h +++ b/ext/rpatricia/patricia.h @@ -23,8 +23,6 @@ typedef void (*void_fn_t)(); #define BIT_TEST(f, b) ((f) & (b)) /* } */ -#define addroute make_and_lookup - #include /* for u_* definitions (on FreeBSD 5) */ #include /* for EAFNOSUPPORT */ @@ -92,9 +90,6 @@ void patricia_process (patricia_tree_t *patricia, void_fn_t func); prefix_t * ascii2prefix (int family, char *string); -patricia_node_t * -make_and_lookup (patricia_tree_t *tree, char *string); - /* } */ #define PATRICIA_MAXBITS 128 -- cgit v1.2.3-24-ge0c7