1/* GLIB - Library of useful routines for C programming 2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with this library; if not, write to the 16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 * Boston, MA 02111-1307, USA. 18 */ 19 20/* 21 * Modified by the GLib Team and others 1997-2000. See the AUTHORS 22 * file for a list of people on the GLib Team. See the ChangeLog 23 * files for a list of changes. These files are distributed with 24 * GLib at ftp://ftp.gtk.org/pub/gtk/. 25 */ 26 27/* 28 * Demolished by Peter Hanappe [December 2002] 29 * 30 * - only string as key 31 * - stores additional type info 32 * - removed use of GLib types (gpointer, gint, ...) 33 * - reduced the number of API functions 34 * - changed names to fluid_hashtable_... 35 */ 36 37#ifndef _FLUID_HASH_H 38#define _FLUID_HASH_H 39 40 41typedef int (*fluid_hash_iter_t)(char* key, void* value, int type, void* data); 42typedef void (*fluid_hash_delete_t)(void* value, int type); 43 44fluid_hashtable_t* new_fluid_hashtable(fluid_hash_delete_t delete); 45void delete_fluid_hashtable(fluid_hashtable_t *hash_table); 46 47void fluid_hashtable_insert(fluid_hashtable_t *hash_table, char* key, void* value, int type); 48 49void fluid_hashtable_replace(fluid_hashtable_t *hash_table, char* key, void* value, int type); 50 51/* Returns non-zero if found, 0 if not found */ 52int fluid_hashtable_lookup(fluid_hashtable_t *hash_table, char* key, void** value, int* type); 53 54/* Returns non-zero if removed, 0 if not removed */ 55int fluid_hashtable_remove(fluid_hashtable_t *hash_table, char* key); 56 57void fluid_hashtable_foreach(fluid_hashtable_t *hashtable, fluid_hash_iter_t fun, void* data); 58 59unsigned int fluid_hashtable_size(fluid_hashtable_t *hash_table); 60 61unsigned int fluid_str_hash(char* v); 62 63#endif /* _FLUID_HASH_H */ 64 65