[xiph-cvs] cvs commit: avl avl.c avl.h

Brendan brendan at xiph.org
Sun Jul 6 18:10:14 PDT 2003



brendan     03/07/06 21:10:14

  Modified:    .        avl.c avl.h
  Log:
  Namespace cleanup: _mangle exported symbols, declare others static.
  This is tedious.

Revision  Changes    Path
1.5       +9 -9      avl/avl.c

Index: avl.c
===================================================================
RCS file: /usr/local/cvsroot/avl/avl.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -u -r1.4 -r1.5
--- avl.c	15 Mar 2003 02:10:18 -0000	1.4
+++ avl.c	7 Jul 2003 01:10:14 -0000	1.5
@@ -22,7 +22,7 @@
  *
  */
 
-/* $Id: avl.c,v 1.4 2003/03/15 02:10:18 msmith Exp $ */
+/* $Id: avl.c,v 1.5 2003/07/07 01:10:14 brendan Exp $ */
 
 /*
  * This is a fairly straightfoward translation of a prototype
@@ -83,7 +83,7 @@ avl_tree_new (avl_key_compare_fun_type c
   }
 }
   
-void
+static void
 avl_tree_free_helper (avl_node * node, avl_free_key_fun_type free_key_fun)
 {
   if (node->left) {
@@ -610,7 +610,7 @@ int avl_delete(avl_tree *tree, void *key
   return (0);
 }
 
-int
+static int
 avl_iterate_inorder_helper (avl_node * node,
             avl_iter_fun_type iter_fun,
             void * iter_arg)
@@ -755,7 +755,7 @@ avl_iterate_index_range (avl_tree * tree
  * representing the closest preceding value.
  */
 
-avl_node *
+static avl_node *
 avl_get_index_by_key (avl_tree * tree,
           void * key,
           unsigned long * index)
@@ -978,7 +978,7 @@ avl_get_item_by_key_least (avl_tree * tr
 
 #define MAX(X, Y)  ((X) > (Y) ? (X) : (Y))
 
-long
+static long
 avl_verify_balance (avl_node * node)
 {
   if (!node) {
@@ -998,7 +998,7 @@ avl_verify_balance (avl_node * node)
   }
 }
     
-void
+static void
 avl_verify_parent (avl_node * node, avl_node * parent)
 {
   if (node->parent != parent) {
@@ -1013,7 +1013,7 @@ avl_verify_parent (avl_node * node, avl_
   }
 }
 
-long
+static long
 avl_verify_rank (avl_node * node)
 {
   if (!node) {
@@ -1059,9 +1059,9 @@ typedef struct _link_node {
   int            width;
 } link_node;  
 
-char balance_chars[3] = {'\\', '-', '/'};
+static char balance_chars[3] = {'\\', '-', '/'};
 
-int
+static int
 default_key_printer (char * buffer, void * key)
 {
   return sprintf (buffer, "%p", key);

<p><p>1.7       +29 -5     avl/avl.h

Index: avl.h
===================================================================
RCS file: /usr/local/cvsroot/avl/avl.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -u -r1.6 -r1.7
--- avl.h	15 Mar 2003 02:10:18 -0000	1.6
+++ avl.h	7 Jul 2003 01:10:14 -0000	1.7
@@ -2,7 +2,7 @@
  * Copyright (C) 1995 by Sam Rushing <rushing at nightmare.com>
  */
 
-/* $Id: avl.h,v 1.6 2003/03/15 02:10:18 msmith Exp $ */
+/* $Id: avl.h,v 1.7 2003/07/07 01:10:14 brendan Exp $ */
 
 #ifndef __AVL_H
 #define __AVL_H
@@ -62,6 +62,34 @@ typedef int (*avl_key_printer_fun_type) 
  * function with each tree, separately.
  */
 
+#ifdef _mangle
+# define avl_tree_new _mangle(avl_tree_new)
+# define avl_node_new _mangle(avl_node_new)
+# define avl_tree_free _mangle(avl_tree_free)
+# define avl_insert _mangle(avl_insert)
+# define avl_delete _mangle(avl_delete)
+# define avl_get_by_index _mangle(avl_get_by_index)
+# define avl_get_by_key _mangle(avl_get_by_key)
+# define avl_iterate_inorder _mangle(avl_iterate_inorder)
+# define avl_iterate_index_range _mangle(avl_iterate_index_range)
+# define avl_tree_rlock _mangle(avl_tree_rlock)
+# define avl_tree_wlock _mangle(avl_tree_wlock)
+# define avl_tree_wlock _mangle(avl_tree_wlock)
+# define avl_tree_unlock _mangle(avl_tree_unlock)
+# define avl_node_rlock _mangle(avl_node_rlock)
+# define avl_node_wlock _mangle(avl_node_wlock)
+# define avl_node_unlock _mangle(avl_node_unlock)
+# define avl_get_span_by_key _mangle(avl_get_span_by_key)
+# define avl_get_span_by_two_keys _mangle(avl_get_span_by_two_keys)
+# define avl_verify _mangle(avl_verify)
+# define avl_print_tree _mangle(avl_print_tree)
+# define avl_get_first _mangle(avl_get_first)
+# define avl_get_prev _mangle(avl_get_prev)
+# define avl_get_next _mangle(avl_get_next)
+# define avl_get_item_by_key_most _mangle(avl_get_item_by_key_most)
+# define avl_get_item_by_key_least _mangle(avl_get_item_by_key_least)
+#endif
+
 typedef struct _avl_tree {
   avl_node *            root;
   unsigned long            height;
@@ -173,7 +201,3 @@ void avl_node_unlock(avl_node *node);
 #endif
 
 #endif /* __AVL_H */
-
-
-
-

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list