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, write to the Free Software 00018 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 00019 * 00020 * $Id: hash.h 29603 2005-07-31 16:10:46Z cjwatson $ 00021 */ 00022 00023 #ifndef DEBIAN_INSTALLER__TREE_H 00024 #define DEBIAN_INSTALLER__TREE_H 00025 00026 #include <debian-installer/types.h> 00027 00028 typedef struct di_tree di_tree; 00029 00043 di_tree *di_tree_new (di_compare_func key_compare_func); 00044 00061 di_tree *di_tree_new_full (di_compare_func key_compare_func, di_destroy_notify key_destroy_func, di_destroy_notify value_destroy_func); 00062 00071 void di_tree_destroy (di_tree *tree); 00072 00086 void di_tree_insert (di_tree *tree, void *key, void *value); 00087 00096 void *di_tree_lookup (di_tree *tree, const void *key); 00097 00110 void di_tree_foreach (di_tree *tree, di_hfunc *func, void *user_data); 00111 00119 di_ksize_t di_tree_size (di_tree *tree); 00120 00122 #endif