00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef __G_HASH_H__
00029 #define __G_HASH_H__
00030
00031 #include <_ansi.h>
00032 #include <glib/gtypes.h>
00033
00034 G_BEGIN_DECLS
00035
00036 typedef struct _GHashTable GHashTable;
00037
00038 typedef gboolean (*GHRFunc) (gpointer key,
00039 gpointer value,
00040 gpointer user_data);
00041
00042
00043
00044 IMPORT_C GHashTable* g_hash_table_new (GHashFunc hash_func,
00045 GEqualFunc key_equal_func);
00046 IMPORT_C GHashTable* g_hash_table_new_full (GHashFunc hash_func,
00047 GEqualFunc key_equal_func,
00048 GDestroyNotify key_destroy_func,
00049 GDestroyNotify value_destroy_func);
00050 IMPORT_C void g_hash_table_destroy (GHashTable *hash_table);
00051 IMPORT_C void g_hash_table_insert (GHashTable *hash_table,
00052 gpointer key,
00053 gpointer value);
00054 IMPORT_C void g_hash_table_replace (GHashTable *hash_table,
00055 gpointer key,
00056 gpointer value);
00057 IMPORT_C gboolean g_hash_table_remove (GHashTable *hash_table,
00058 gconstpointer key);
00059 IMPORT_C gboolean g_hash_table_steal (GHashTable *hash_table,
00060 gconstpointer key);
00061 IMPORT_C gpointer g_hash_table_lookup (GHashTable *hash_table,
00062 gconstpointer key);
00063 IMPORT_C gboolean g_hash_table_lookup_extended (GHashTable *hash_table,
00064 gconstpointer lookup_key,
00065 gpointer *orig_key,
00066 gpointer *value);
00067 IMPORT_C void g_hash_table_foreach (GHashTable *hash_table,
00068 GHFunc func,
00069 gpointer user_data);
00070 IMPORT_C gpointer g_hash_table_find (GHashTable *hash_table,
00071 GHRFunc predicate,
00072 gpointer user_data);
00073 IMPORT_C guint g_hash_table_foreach_remove (GHashTable *hash_table,
00074 GHRFunc func,
00075 gpointer user_data);
00076 IMPORT_C guint g_hash_table_foreach_steal (GHashTable *hash_table,
00077 GHRFunc func,
00078 gpointer user_data);
00079 IMPORT_C guint g_hash_table_size (GHashTable *hash_table);
00080
00081
00082 IMPORT_C GHashTable* g_hash_table_ref (GHashTable *hash_table);
00083 IMPORT_C void g_hash_table_unref (GHashTable *hash_table);
00084
00085 #ifndef G_DISABLE_DEPRECATED
00086
00087
00088
00089 #define g_hash_table_freeze(hash_table) ((void)0)
00090 #define g_hash_table_thaw(hash_table) ((void)0)
00091
00092 #endif
00093
00094
00095
00096 IMPORT_C gboolean g_str_equal (gconstpointer v1,
00097 gconstpointer v2);
00098 IMPORT_C guint g_str_hash (gconstpointer v);
00099
00100 IMPORT_C gboolean g_int_equal (gconstpointer v1,
00101 gconstpointer v2);
00102 IMPORT_C guint g_int_hash (gconstpointer v);
00103
00104
00105
00106
00107
00108
00109
00110 IMPORT_C guint g_direct_hash (gconstpointer v) G_GNUC_CONST;
00111 IMPORT_C gboolean g_direct_equal (gconstpointer v1,
00112 gconstpointer v2) G_GNUC_CONST;
00113
00114 G_END_DECLS
00115
00116 #endif
00117