00001 /* 00002 * hash.h 00003 * 00004 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 00005 * 2003 Bastian Blank <waldi@debian.org> 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 00020 * 00021 * $Id$ 00022 */ 00023 00024 #ifndef DEBIAN_INSTALLER__HASH_H 00025 #define DEBIAN_INSTALLER__HASH_H 00026 00027 #include <debian-installer/types.h> 00028 00034 di_equal_func di_rstring_equal; 00035 di_hash_func di_rstring_hash; 00036 00037 #if 0 00038 di_equal_func di_string_equal; 00039 di_hash_func di_string_hash; 00040 #endif 00041 00044 typedef struct di_hash_table di_hash_table; 00045 00062 di_hash_table *di_hash_table_new (di_hash_func hash_func, di_equal_func key_equal_func); 00063 00083 di_hash_table *di_hash_table_new_full (di_hash_func hash_func, di_equal_func key_equal_func, di_destroy_notify key_destroy_func, di_destroy_notify value_destroy_func); 00084 00094 void di_hash_table_destroy (di_hash_table *hash_table); 00095 00109 void di_hash_table_insert (di_hash_table *hash_table, void *key, void *value); 00110 00119 void *di_hash_table_lookup (di_hash_table *hash_table, const void *key); 00120 00133 void di_hash_table_foreach (di_hash_table *hash_table, di_hfunc *func, void *user_data); 00134 00142 di_ksize_t di_hash_table_size (di_hash_table *hash_table); 00143 00145 #endif