LDAP_BEGIN_DECL
-typedef struct avlnode {
+typedef struct avlnode Avlnode;
+
+#ifdef AVL_INTERNAL
+struct avlnode {
void* avl_data;
signed char avl_bf;
struct avlnode *avl_left;
struct avlnode *avl_right;
-} Avlnode;
+};
#define NULLAVL ((Avlnode *) NULL)
#define LH (-1)
#define EH 0
#define RH 1
+#endif
/* avl routines */
#define avl_getone(x) ((x) == 0 ? 0 : (x)->avl_data)
#include <ac/string.h>
+#define AVL_INTERNAL
#define AVL_NONREENTRANT
#include "avl.h"
int
main( int argc, char **argv )
{
- Avlnode *tree = NULLAVL;
+ Avlnode *tree = NULL;
char command[ 10 ];
char name[ 80 ];
char *p;
switch( *command ) {
case 'n': /* new tree */
( void ) avl_free( tree, (AVL_FREE) free );
- tree = NULLAVL;
+ tree = NULL;
break;
case 'p': /* print */
( void ) myprint( tree );