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 #ifndef _GDSL_HASH_H_
00027 #define _GDSL_HASH_H_
00028
00029
00030 #include <stdio.h>
00031
00032
00033 #include "gdsl_types.h"
00034
00035
00036 #ifdef __cplusplus
00037 extern "C"
00038 {
00039 #endif
00040
00041
00054 typedef struct hash_table* gdsl_hash_t;
00055
00062 typedef const char* (*gdsl_key_func_t) (void* VALUE
00063 );
00064
00070 typedef ulong (*gdsl_hash_func_t) (const char* KEY
00071 );
00072
00073
00074
00075
00076
00087 extern ulong
00088 gdsl_hash (const char* KEY
00089 );
00090
00091
00092
00093
00094
00127 extern gdsl_hash_t
00128 gdsl_hash_alloc (const char* NAME,
00129 gdsl_alloc_func_t ALLOC_F,
00130 gdsl_free_func_t FREE_F,
00131 gdsl_key_func_t KEY_F,
00132 gdsl_hash_func_t HASH_F,
00133 ushort INITIAL_ENTRIES_NB
00134 );
00135
00149 extern void
00150 gdsl_hash_free (gdsl_hash_t H
00151 );
00152
00166 extern void
00167 gdsl_hash_flush (gdsl_hash_t H
00168 );
00169
00170
00171
00172
00173
00183 extern const char*
00184 gdsl_hash_get_name (const gdsl_hash_t H
00185 );
00186
00196 extern ushort
00197 gdsl_hash_get_entries_number (const gdsl_hash_t H
00198 );
00199
00214 extern ushort
00215 gdsl_hash_get_lists_max_size (const gdsl_hash_t H
00216 );
00217
00229 extern ushort
00230 gdsl_hash_get_longest_list_size (const gdsl_hash_t H
00231 );
00232
00243 extern ulong
00244 gdsl_hash_get_size (const gdsl_hash_t H
00245 );
00246
00257 extern double
00258 gdsl_hash_get_fill_factor (const gdsl_hash_t H
00259 );
00260
00261
00262
00263
00264
00278 extern gdsl_hash_t
00279 gdsl_hash_set_name (gdsl_hash_t H,
00280 const char* NEW_NAME
00281 );
00282
00312 extern gdsl_element_t
00313 gdsl_hash_insert (gdsl_hash_t H,
00314 void* VALUE
00315 );
00316
00333 extern gdsl_element_t
00334 gdsl_hash_remove (gdsl_hash_t H,
00335 const char* KEY
00336 );
00354 extern gdsl_hash_t
00355 gdsl_hash_delete (gdsl_hash_t H,
00356 const char* KEY
00357 );
00358
00387 extern gdsl_hash_t
00388 gdsl_hash_modify (gdsl_hash_t H,
00389 ushort NEW_ENTRIES_NB,
00390 ushort NEW_LISTS_MAX_SIZE
00391 );
00392
00393
00394
00395
00396
00412 extern gdsl_element_t
00413 gdsl_hash_search (const gdsl_hash_t H,
00414 const char* KEY
00415 );
00416
00417
00418
00419
00420
00436 extern gdsl_element_t
00437 gdsl_hash_map (const gdsl_hash_t H,
00438 gdsl_map_func_t MAP_F,
00439 void* USER_DATA
00440 );
00441
00442
00443
00444
00445
00461 extern void
00462 gdsl_hash_write (const gdsl_hash_t H,
00463 gdsl_write_func_t WRITE_F,
00464 FILE* OUTPUT_FILE,
00465 void* USER_DATA
00466 );
00467
00484 extern void
00485 gdsl_hash_write_xml (const gdsl_hash_t H,
00486 gdsl_write_func_t WRITE_F,
00487 FILE* OUTPUT_FILE,
00488 void* USER_DATA
00489 );
00490
00507 extern void
00508 gdsl_hash_dump (const gdsl_hash_t H,
00509 gdsl_write_func_t WRITE_F,
00510 FILE* OUTPUT_FILE,
00511 void* USER_DATA
00512 );
00513
00514
00515
00516
00517
00518
00519 #ifdef __cplusplus
00520 }
00521 #endif
00522
00523
00524 #endif
00525
00526