libdebian-installer

tree.h

00001 /*
00002  * tree.h
00003  *
00004  * Copyright (C) 2006 Bastian Blank <waldi@debian.org>
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program. If not, see <http://www.gnu.org/licenses/>.
00018  */
00019 
00020 #ifndef DEBIAN_INSTALLER__TREE_H
00021 #define DEBIAN_INSTALLER__TREE_H
00022 
00023 #include <debian-installer/types.h>
00024 
00025 typedef struct di_tree di_tree;
00026 
00040 di_tree *di_tree_new (di_compare_func key_compare_func);
00041 
00058 di_tree *di_tree_new_full (di_compare_func key_compare_func, di_destroy_notify key_destroy_func, di_destroy_notify value_destroy_func);
00059 
00068 void di_tree_destroy (di_tree *tree);
00069 
00083 void di_tree_insert (di_tree *tree, void *key, void *value);
00084 
00093 void *di_tree_lookup (di_tree *tree, const void *key);
00094 
00107 void di_tree_foreach (di_tree *tree, di_hfunc *func, void *user_data);
00108 
00116 di_ksize_t di_tree_size (di_tree *tree);
00117 
00119 #endif