14 #ifndef ABC__misc__st__stmm_h
15 #define ABC__misc__st__stmm_h
26 # define EXTERN extern
28 # define EXTERN extern "C"
31 # define EXTERN extern
36 #define ARGS(protos) protos
75 #define stmm_is_member(table,key) stmm_lookup(table,key,(char **) 0)
76 #define stmm_count(table) ((table)->num_entries)
111 #define STMM_DEFAULT_MAX_DENSITY 5
112 #define STMM_DEFAULT_INIT_TABLE_SIZE 11
113 #define STMM_DEFAULT_GROW_FACTOR 2.0
114 #define STMM_DEFAULT_REORDER_FLAG 0
117 #define stmm_foreach_item2(tb, gen, key, value) \
118 for(gen.table=(tb), gen.entry=NULL, gen.index=0; \
119 stmm_gen(&(gen),key,value);)
121 #define stmm_foreach_item(table, gen, key, value) \
122 for(gen=stmm_init_gen(table); stmm_gen(gen,key,value) || (stmm_free_gen(gen),0);)
124 #define stmm_foreach_item_int(table, gen, key, value) \
125 for(gen=stmm_init_gen(table); stmm_gen_int(gen,key,value) || (stmm_free_gen(gen),0);)
127 #define STMM_OUT_OF_MEM -10000
int stmm_foreach(stmm_table *table, enum stmm_retval(*func)(char *, char *, char *), char *arg)
stmm_table * stmm_init_table(stmm_compare_func_type compare, stmm_hash_func_type hash)
stmm_compare_func_type compare
int(* stmm_hash_func_type)(const char *, int)
int stmm_insert(stmm_table *table, char *key, char *value)
int stmm_lookup_int(stmm_table *table, char *key, int *value)
stmm_table * stmm_init_table_with_params(stmm_compare_func_type compare, stmm_hash_func_type hash, int size, int density, double grow_factor, int reorder_flag)
int stmm_gen_int(stmm_generator *gen, char **key_p, long *value_p)
int stmm_numcmp(const char *x, const char *y)
void stmm_clean(stmm_table *table)
int stmm_lookup(stmm_table *table, char *key, char **value)
int stmm_ptrhash(const char *x, int size)
void stmm_free_gen(stmm_generator *gen)
static uint32_t hash(uint32_t x)
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
int stmm_find_or_add(stmm_table *table, char *key, char ***slot)
#define ABC_NAMESPACE_HEADER_END
int stmm_strhash(const char *string, int modulus)
int stmm_ptrcmp(const char *x, const char *y)
void stmm_free_table(stmm_table *table)
enum stmm_retval(* STMM_PFSR)(char *, char *, char *)
int(* stmm_compare_func_type)(const char *, const char *)
int stmm_numhash(const char *x, int size)
int stmm_gen(stmm_generator *gen, char **key_p, char **value_p)
int stmm_delete_int(stmm_table *table, long *keyp, char **value)
int stmm_add_direct(stmm_table *table, char *key, char *value)
int stmm_delete(stmm_table *table, char **keyp, char **value)
stmm_table * stmm_copy(stmm_table *old_table)
int stmm_find(stmm_table *table, char *key, char ***slot)
stmm_generator * stmm_init_gen(stmm_table *table)