Only testavl uses this interface.
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
return( avl_find_lin( root->avl_right, data, fcmp ) );
}
+/* NON-REENTRANT INTERFACE */
+
static void* *avl_list;
static int avl_maxlist;
static int avl_nextlist;
return( avl_list[ avl_nextlist++ ] );
}
+/* end non-reentrant code */
+
+
int
avl_dup_error( void* left, void* right )
{
#include <ac/string.h>
+#define AVL_NONREENTRANT
#include "avl.h"
static void ravl_print LDAP_P(( Avlnode *root, int depth ));
( 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? " );