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