/**********************************************************************
 
	Copyright (C) 2003 Hirohisa MORI <joshua@nichibun.ac.jp>
 
	This program is free software; you can redistribute it 
	and/or modify it under the terms of the GLOBALBASE 
	Library General Public License (G-LGPL) as published by 

	http://www.globalbase.org/
 
	This program is distributed in the hope that it will be 
	useful, but WITHOUT ANY WARRANTY; without even the 
	implied warranty of MERCHANTABILITY or FITNESS FOR A 
	PARTICULAR PURPOSE.

**********************************************************************/



#ifndef ___AVT_H___
#define ___AVT_H___

typedef struct avt_node {
	int			level;
	struct avt_node *	small;
	struct avt_node *	large;
	void *			data;
} AVT_NODE;

AVT_NODE * avt_insert(AVT_NODE **,AVT_NODE *,int (*)());
AVT_NODE * avt_search(AVT_NODE *,void *,int (*)());
int avt_trace_from_small(AVT_NODE*,int (*)(),void*);
int avt_trace_from_large(AVT_NODE*,int (*)(),void*);
AVT_NODE * avt_delete(AVT_NODE **,void *,int (*)());
void avt_test(AVT_NODE *,int (*)());

int er_panic();

#endif

