about summary refs log tree commit
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-06-01 21:39:42 +0000
committerEric Wong <normalperson@yhbt.net>2011-06-02 16:55:32 +0000
commitc8adca42aa407e1c68bcc2697b20e1242dfa3a3e (patch)
tree5a7dc1435c26848b27ce0423a565319fe50c9c51
parentb23c5ea4159a16907745ea348af0a88f7ee5405b (diff)
downloadrpatricia-c8adca42aa407e1c68bcc2697b20e1242dfa3a3e.tar.gz
patricia.[ch]: remove dead functions
They're unused by our Ruby module, so there's no need to
preserve them.
-rw-r--r--ext/rpatricia/patricia.c61
-rw-r--r--ext/rpatricia/patricia.h5
2 files changed, 0 insertions, 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 <sys/types.h> /* for u_* definitions (on FreeBSD 5) */
 
 #include <errno.h> /* 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