/* splay.h $Id: splay.h,v 1.1 2006/12/22 04:15:09 dmochiha Exp $ */ #ifndef __SPLAY_H__ #define __SPLAY_H__ typedef int (*cmpfunc)(void *, void *); typedef void (*prfunc)(void *); typedef struct splay splay; struct splay { splay *left; splay *right; void *item; }; splay *splay_insert (splay *t, void *i, cmpfunc comp); splay *splay_delete (splay *t, void *i, cmpfunc comp); splay *splay_free (splay *t); void *splay_find (splay **tp, void *i, cmpfunc comp); void splay_print (splay *t, prfunc print); /* utility */ int numcmp (void *a, void *b); int idcmp (void *a, void *b); int intprint (void *i); #endif