X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibavl%2Favl.c;h=63a543f8e4fb82f048d2387a887031dfa8119c18;hb=5c10406b9e5c377f81def44e3229ee864d2a324f;hp=adce228dd7a1ec7dc3bd6201c584e3e827a7d632;hpb=f704f1c475636cbcea7ff83164aeac06a6e1fca8;p=openldap diff --git a/libraries/libavl/avl.c b/libraries/libavl/avl.c index adce228dd7..63a543f8e4 100644 --- a/libraries/libavl/avl.c +++ b/libraries/libavl/avl.c @@ -1,4 +1,9 @@ /* avl.c - routines to implement an avl tree */ +/* $OpenLDAP$ */ +/* + * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ /* * Copyright (c) 1993 Regents of the University of Michigan. * All rights reserved. @@ -19,7 +24,7 @@ static char avl_version[] = "AVL library version 1.0\n"; #endif #include -#include +#include #define AVL_INTERNAL #include "avl.h" @@ -27,7 +32,7 @@ static char avl_version[] = "AVL library version 1.0\n"; #define ROTATERIGHT(x) { \ Avlnode *tmp;\ if ( *(x) == NULL || (*(x))->avl_left == NULL ) {\ - (void) fputs("RR error\n", stderr); exit(1); \ + (void) fputs("RR error\n", stderr); exit( EXIT_FAILURE ); \ }\ tmp = (*(x))->avl_left;\ (*(x))->avl_left = tmp->avl_right;\ @@ -37,7 +42,7 @@ static char avl_version[] = "AVL library version 1.0\n"; #define ROTATELEFT(x) { \ Avlnode *tmp;\ if ( *(x) == NULL || (*(x))->avl_right == NULL ) {\ - (void) fputs("RL error\n", stderr); exit(1); \ + (void) fputs("RL error\n", stderr); exit( EXIT_FAILURE ); \ }\ tmp = (*(x))->avl_right;\ (*(x))->avl_right = tmp->avl_left;\ @@ -622,7 +627,7 @@ avl_free( Avlnode *root, AVL_FREE dfree ) */ void* -avl_find( Avlnode *root, void* data, AVL_CMP fcmp ) +avl_find( Avlnode *root, const void* data, AVL_CMP fcmp ) { int cmp; @@ -644,7 +649,7 @@ avl_find( Avlnode *root, void* data, AVL_CMP fcmp ) */ void* -avl_find_lin( Avlnode *root, void* data, AVL_CMP fcmp ) +avl_find_lin( Avlnode *root, const void* data, AVL_CMP fcmp ) { void* res;