#ifndef SET_H #define SET_H typedef struct s_set *set; typedef void *set_object; USE_EXCEPTION(NotPresent) USE_EXCEPTION(SetEmpty) extern set set_create(void); extern void set_destroy(void); extern int set_cardinality(set s); extern void set_insert(set s, set_object obj); /* If the object is already present, nothing appends */ extern void set_remove(set s, set_object obj); /* If the object is not present, NotPresent is raised */ /* Return and remove from "set" an unspecified element, if "set" is empty, SetEmpty is raised */ extern set_object set_remove_any(set s); extern int set_member(set s, set_object obj); /* Make the union of two sets into the first. */ extern void set_union(set s1, set s2); extern set set_clone(set s); typedef void (*map_fun)(void *object); extern void set_map(set s, map_fun fun) #endif