48 #define set_undefined ((set)(-16))
49 #define set_undefined_p(s) ((s)==set_undefined)
52 #define set_equal(s1,s2) set_equal_p(s1,s2)
54 #define SET_MAP(element,code,the_set) \
56 HASH_MAP(_set_map_key, element, code, \
57 set_private_get_hash_table(the_set)); \
78 #define SET_FOREACH(type_name, the_item, the_set) \
79 hash_table NGMID(h) = set_private_get_hash_table(the_set); \
80 void * NGMID(i) = NULL; \
81 for (type_name the_item; \
83 hash_table_scan(NGMID(h), NGMID(i), (void **) &the_item, NULL));)
_uint(* hash_rank_t)(const void *, size_t)
int(* hash_equals_t)(const void *, const void *)
set set_generic_make(set_type, hash_equals_t, hash_rank_t)
what about this replacement? #define SET_MAP(the_item, the_code, the_set) \ { SET_FOREACH(void *,...
set set_delfree_element(set, const set, const void *)
May be useful for string sets ...
bool set_empty_p(const set)
tell whether set s is empty.
set set_assign_list(set, const list)
assigns a list contents to a set all duplicated elements are lost
bool set_intersection_p(const set, const set)
returns whether s1 n s2 <> 0 complexity of the intersection
set set_singleton(set_type, const void *)
create a singleton set of any type but hash_private
set set_del_element(set, const set, const void *)
set set_intersection(set, const set, const set)
list set_to_list(const set)
create a list from a set the set is not freed
bool list_in_set_p(const list, const set)
list set_to_sorted_list(const set, gen_cmp_func_t)
set set_assign(set, const set)
Assign a set with the content of another set.
void sets_free(set,...)
Free several sets in one call.
bool set_equal_p(const set, const set)
returns whether s1 == s2
int set_size(const set)
returns the number of items in s.
set set_difference(set, const set, const set)
int set_own_allocated_memory(const set)
hash_table set_private_get_hash_table(const set)
return the internal hash table of set s
bool set_inclusion_p(const set, const set)
return whether s1 \included s2
set set_clear(set)
Assign the empty set to s s := {}.
string set_to_string(string, const set, gen_string_func_t)
return allocated string for set s
void gen_set_closure(void(*)(void *, set), set)
a set-based implementation of gen_closure that does not go twice in the same object.
bool set_belong_p(const set, const void *)
set set_union(set, const set, const set)
void set_fprint(FILE *, string, const set, gen_string_func_t)
print set s to file stream out.
set_type
Note: hash_chunk is not included in set_type.
set set_append_list(set, const list)
add list l items to set s, which is returned.
void gen_set_closure_iterate(void(*)(void *, set), set, bool)
set_type set_get_type(const set)
return the type of set s
set set_add_elements(set, const set, const void *e,...)
set set_make(set_type)
Create an empty set of any type but hash_private.
set set_add_element(set, const set, const void *)
string(* gen_string_func_t)(const void *)
int(* gen_cmp_func_t)(const void *, const void *)
FI: I do not understand why the type is duplicated at the set level.
The structure used to build lists in NewGen.