1*0Sstevel@tonic-gate /* 2*0Sstevel@tonic-gate * Copyright 2003 by Sun Microsystems, Inc. All rights reserved. 3*0Sstevel@tonic-gate * Use is subject to license terms. 4*0Sstevel@tonic-gate */ 5*0Sstevel@tonic-gate 6*0Sstevel@tonic-gate /* tree.h - declare structures used by tree library 7*0Sstevel@tonic-gate * 8*0Sstevel@tonic-gate * vix 22jan93 [revisited; uses RCS, ANSI, POSIX; has bug fixes] 9*0Sstevel@tonic-gate * vix 27jun86 [broken out of tree.c] 10*0Sstevel@tonic-gate * 11*0Sstevel@tonic-gate * $Id: tree.h,v 8.3 2002/12/03 05:26:48 marka Exp $ 12*0Sstevel@tonic-gate */ 13*0Sstevel@tonic-gate 14*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 15*0Sstevel@tonic-gate 16*0Sstevel@tonic-gate #ifndef _TREE_H_INCLUDED 17*0Sstevel@tonic-gate #define _TREE_H_INCLUDED 18*0Sstevel@tonic-gate 19*0Sstevel@tonic-gate 20*0Sstevel@tonic-gate #ifndef __P 21*0Sstevel@tonic-gate # if defined(__STDC__) || defined(__GNUC__) 22*0Sstevel@tonic-gate # define __P(x) x 23*0Sstevel@tonic-gate # else 24*0Sstevel@tonic-gate # define __P(x) () 25*0Sstevel@tonic-gate # endif 26*0Sstevel@tonic-gate #endif 27*0Sstevel@tonic-gate 28*0Sstevel@tonic-gate /* 29*0Sstevel@tonic-gate * tree_t is our package-specific anonymous pointer. 30*0Sstevel@tonic-gate */ 31*0Sstevel@tonic-gate #if defined(__STDC__) || defined(__GNUC__) 32*0Sstevel@tonic-gate typedef void *tree_t; 33*0Sstevel@tonic-gate #else 34*0Sstevel@tonic-gate typedef char *tree_t; 35*0Sstevel@tonic-gate #endif 36*0Sstevel@tonic-gate 37*0Sstevel@tonic-gate #ifdef ORIGINAL_ISC_CODE 38*0Sstevel@tonic-gate /* 39*0Sstevel@tonic-gate * Do not taint namespace 40*0Sstevel@tonic-gate */ 41*0Sstevel@tonic-gate #define tree_add __tree_add 42*0Sstevel@tonic-gate #define tree_delete __tree_delete 43*0Sstevel@tonic-gate #define tree_init __tree_init 44*0Sstevel@tonic-gate #define tree_mung __tree_mung 45*0Sstevel@tonic-gate #define tree_srch __tree_srch 46*0Sstevel@tonic-gate #define tree_trav __tree_trav 47*0Sstevel@tonic-gate #else 48*0Sstevel@tonic-gate #endif 49*0Sstevel@tonic-gate 50*0Sstevel@tonic-gate typedef struct tree_s { 51*0Sstevel@tonic-gate tree_t data; 52*0Sstevel@tonic-gate struct tree_s *left, *right; 53*0Sstevel@tonic-gate short bal; 54*0Sstevel@tonic-gate } 55*0Sstevel@tonic-gate tree; 56*0Sstevel@tonic-gate 57*0Sstevel@tonic-gate 58*0Sstevel@tonic-gate void tree_init __P((tree **)); 59*0Sstevel@tonic-gate tree_t tree_srch __P((tree **, int (*)(), tree_t)); 60*0Sstevel@tonic-gate tree_t tree_add __P((tree **, int (*)(), tree_t, void (*)())); 61*0Sstevel@tonic-gate int tree_delete __P((tree **, int (*)(), tree_t, void (*)())); 62*0Sstevel@tonic-gate int tree_trav __P((tree **, int (*)())); 63*0Sstevel@tonic-gate void tree_mung __P((tree **, void (*)())); 64*0Sstevel@tonic-gate 65*0Sstevel@tonic-gate 66*0Sstevel@tonic-gate #endif /* _TREE_H_INCLUDED */ 67