]> git.sur5r.net Git - openldap/commitdiff
#ifdef out non-reentrant prototypes.
authorKurt Zeilenga <kurt@openldap.org>
Mon, 31 May 1999 20:32:21 +0000 (20:32 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 31 May 1999 20:32:21 +0000 (20:32 +0000)
Only testavl uses this interface.

include/avl.h
libraries/libavl/avl.c
libraries/libavl/testavl.c

index 757931c9b59567740451b373a72ea6a97099faa5..58b3d972dec206eddb27c9fbd02ca0e19263cc9e 100644 (file)
@@ -70,14 +70,10 @@ avl_find LDAP_P((Avlnode *, void*, AVL_CMP));
 LDAP_F( void* )
 avl_find_lin LDAP_P((Avlnode *, void*, AVL_CMP));
 
+#ifdef AVL_NONREENTRANT
 LDAP_F( void* )
 avl_getfirst LDAP_P((Avlnode *));
 
-#ifdef AVL_REENTRANT
-/* ??? avl.c does not provide this version ??? */
-LDAP_F( void* )
-avl_getnext LDAP_P((Avlnode *, void* ));
-#else
 LDAP_F( void* )
 avl_getnext LDAP_P((void));
 #endif
index c1b1aad6cb5146967e6a984ab85ff3e83e0b5063..08cd7ed7b7b939390c74d9ca2b6a4c91976fda97 100644 (file)
@@ -664,6 +664,8 @@ avl_find_lin( Avlnode *root, void* data, AVL_CMP fcmp )
                return( avl_find_lin( root->avl_right, data, fcmp ) );
 }
 
+/* NON-REENTRANT INTERFACE */
+
 static void*   *avl_list;
 static int     avl_maxlist;
 static int     avl_nextlist;
@@ -736,6 +738,9 @@ avl_getnext( void )
        return( avl_list[ avl_nextlist++ ] );
 }
 
+/* end non-reentrant code */
+
+
 int
 avl_dup_error( void* left, void* right )
 {
index 4a9fd6678b30cdbed5ae4c967e48ebb4fedd7a80..8183e167b3e028d1fc44ce0e3e0d743b0ce0045f 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <ac/string.h>
 
+#define AVL_NONREENTRANT 
 #include "avl.h"
 
 static void ravl_print LDAP_P(( Avlnode *root, int depth ));
@@ -31,11 +32,16 @@ main( int argc, char **argv )
                        ( void ) myprint( tree );
                        break;
                case 't':       /* traverse with first, next */
+#ifdef AVL_NONREENTRANT
                        printf( "***\n" );
                        for ( p = (char * ) avl_getfirst( tree );
-                           p != NULL; p = (char *) avl_getnext( /* tree, p */ ) )
+                           p != NULL;
+                               p = (char *) avl_getnext())
                                printf( "%s\n", p );
                        printf( "***\n" );
+#else
+                       printf( "*** reentrant interface not implemented ***" );
+#endif
                        break;
                case 'f':       /* find */
                        printf( "data? " );