libdebian-installer
|
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, see <http://www.gnu.org/licenses/>. 00019 */ 00020 00021 #ifndef DEBIAN_INSTALLER__HASH_H 00022 #define DEBIAN_INSTALLER__HASH_H 00023 00024 #include <debian-installer/types.h> 00025 00031 di_equal_func di_rstring_equal; 00032 di_hash_func di_rstring_hash; 00033 00034 #if 0 00035 di_equal_func di_string_equal; 00036 di_hash_func di_string_hash; 00037 #endif 00038 00041 typedef struct di_hash_table di_hash_table; 00042 00059 di_hash_table *di_hash_table_new (di_hash_func hash_func, di_equal_func key_equal_func); 00060 00080 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); 00081 00091 void di_hash_table_destroy (di_hash_table *hash_table); 00092 00106 void di_hash_table_insert (di_hash_table *hash_table, void *key, void *value); 00107 00116 void *di_hash_table_lookup (di_hash_table *hash_table, const void *key); 00117 00130 void di_hash_table_foreach (di_hash_table *hash_table, di_hfunc *func, void *user_data); 00131 00139 di_ksize_t di_hash_table_size (di_hash_table *hash_table); 00140 00142 #endif