82 #define ST_OUT_OF_MEM -10000 88 #define ST_DEFAULT_MAX_DENSITY 5 94 #define ST_DEFAULT_INIT_TABLE_SIZE 11 100 #define ST_DEFAULT_GROW_FACTOR 2.0 106 #define ST_DEFAULT_REORDER_FLAG 0 177 #define st_is_member(table,key) st_lookup(table,key,(void **) 0) 201 #define st_foreach_item(table, gen, key, value) \ 202 for(gen=st_init_gen(table); st_gen(gen,key,value) || (st_free_gen(gen),0);) 228 #define st_foreach_item_int(table, gen, key, value) \ 229 for(gen=st_init_gen(table); st_gen_int(gen,key,value) || (st_free_gen(gen),0);) 258 int st_numcmp (
void const *,
void const *);
259 int st_ptrcmp (
void const *,
void const *);
int st_find_or_add(st_table *, void *, void ***)
Lookup key in table; if not found, create an entry.
Definition: st.c:636
int st_ptrcmp(void const *, void const *)
Pointer comparison function.
Definition: st.c:988
Symbol table header.
Definition: st.c:101
st_table * st_copy(st_table const *)
Returns a copy of old_table and all its members.
Definition: st.c:715
int st_lookup_int(st_table *, void const *, int *)
Lookup up key in table.
Definition: st.c:495
void st_free_gen(st_generator *)
Reclaims the resources associated with gen.
Definition: st.c:1130
int st_gen(st_generator *, void **, void **)
Returns the next (key, value) pair in the generation sequence.
Definition: st.c:1046
void st_free_table(st_table *)
Free a table.
Definition: st.c:427
int st_gen_int(st_generator *, void **, int *)
Returns the next (key, value) pair in the generation sequence.
Definition: st.c:1090
int st_numcmp(void const *, void const *)
Integral number comparison function.
Definition: st.c:972
int(* st_hash_t)(void const *, int)
Type of hash functions.
Definition: st.h:145
int st_delete_int(st_table *, void **, int *)
Deletes the entry with the key pointed to by keyp.
Definition: st.c:816
int st_delete(st_table *, void **, void **)
Deletes the entry with the key pointed to by keyp.
Definition: st.c:776
Symbol table generator.
Definition: st.c:118
int st_insert(st_table *, void *, void *)
Insert value in table under the key key.
Definition: st.c:528
int(* st_compare_t)(void const *, void const *)
Type of comparison functions.
Definition: st.h:140
st_retval
Type of return values for iterators.
Definition: st.h:130
int st_strhash(void const *, int)
String hash function.
Definition: st.c:916
int st_lookup(st_table *, void const *, void **)
Lookup up key in table.
Definition: st.c:460
int(* st_hash_arg_t)(void const *, int, void const *)
Type of hash functions with extra argument.
Definition: st.h:155
enum st_retval(* st_foreach_t)(void *, void *, void *)
Type for function passed to st_foreach.
Definition: st.h:135
int st_add_direct(st_table *, void *, void *)
Place 'value' in 'table' under the key 'key'.
Definition: st.c:579
st_table * st_init_table_with_params(st_compare_t, st_hash_t, int, int, double, int)
Create a table with given parameters.
Definition: st.c:315
int st_find(st_table *, void const *, void ***)
Lookup key in table.
Definition: st.c:683
st_generator * st_init_gen(st_table const *)
Initializes a generator.
Definition: st.c:1008
st_table * st_init_table_with_arg(st_compare_arg_t, st_hash_arg_t, void const *)
Creates and initializes a table.
Definition: st.c:400
int(* st_compare_arg_t)(void const *, void const *, void const *)
Type of comparison functions with extra argument.
Definition: st.h:150
int st_ptrhash(void const *, int)
Pointer hash function.
Definition: st.c:956
int st_numhash(void const *, int)
Integral number hash function.
Definition: st.c:940
st_table * st_init_table(st_compare_t, st_hash_t)
Creates and initializes a table.
Definition: st.c:283
int st_foreach(st_table *, st_foreach_t, void *)
Iterates over the elements of a table.
Definition: st.c:878
int st_count(st_table const *)
Returns the number of entries in the table table.
Definition: st.c:846
st_table * st_init_table_with_params_and_arg(st_compare_arg_t, st_hash_arg_t, void const *, int, int, double, int)
Creates and initializes a table.
Definition: st.c:366