/*  libhrel - Holyrel library

    Copyright (C) 2005 Chong Kai Xiong <descender@phreaker.net>

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library 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.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public
    License along with this library; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA  02111-1307  USA.
*/

#ifndef H_BTREE_H
#define H_BTREE_H

#include <glib.h>

G_BEGIN_DECLS

typedef struct _HBTree HBTree;

HBTree  *h_btree_new      (GCompareDataFunc key_compare_func,
                           gpointer         key_compare_data);
HBTree  *h_btree_new_full (GCompareDataFunc key_compare_func,
                           gpointer         key_compare_data,
                           GDestroyNotify   key_destroy_func,
                           GDestroyNotify   value_destroy_func);
void     h_btree_destroy  (HBTree          *tree);
guint    h_btree_n_nodes  (HBTree          *tree,
                           GTraverseFlags   flags);
guint    h_btree_height   (HBTree          *tree);
void     h_btree_insert   (HBTree          *tree,
                           gpointer         key,
                           gpointer         value);
gboolean h_btree_delete   (HBTree          *tree,
                           gconstpointer    key);
gpointer h_btree_lookup   (HBTree          *tree,
                           gconstpointer    key);
void     h_btree_foreach  (HBTree          *tree,
                           GTraverseFunc    func,
                           gpointer         user_data);

G_END_DECLS

#endif /* #ifndef H_BTREE_H */

