QuakeForge  0.7.2.210-815cf
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
set.h File Reference
This graph shows which files directly or indirectly include this file:

Data Structures

struct  set_iter_s
 Represent the state of a scan through a set. More...
 
struct  set_pool_s
 
struct  set_s
 Represent a set using a bitmap. More...
 

Macros

#define SET_BITS   (sizeof (set_bits_t) * 8)
 
#define SET_DEFMAP_SIZE
 
#define SET_ONE   ((set_bits_t) 1)
 
#define SET_SIZE(x)   (((x) + SET_BITS) & ~(SET_BITS - 1))
 
#define SET_TEST_MEMBER(s, x)   ((s)->map[(x) / SET_BITS] & (SET_ONE << ((x) % SET_BITS)))
 
#define SET_WORDS(s)   ((s)->size / SET_BITS)
 
#define SET_ZERO   ((set_bits_t) 0)
 

Typedefs

typedef uint32_t set_bits_t
 
typedef struct set_iter_s set_iter_t
 Represent the state of a scan through a set. More...
 
typedef struct set_pool_s set_pool_t
 
typedef struct set_s set_t
 Represent a set using a bitmap. More...
 

Functions

set_tset_add (set_t *set, unsigned x)
 Add an element to a set. More...
 
const char * set_as_string (const set_t *set)
 Return a human-readable string representing the set. More...
 
set_tset_assign (set_t *dst, const set_t *src)
 Make a set equivalent to another. More...
 
void set_del_iter (set_iter_t *set_iter)
 Delete a set iterator that is no longer needed. More...
 
void set_del_iter_r (set_pool_t *set_pool, set_iter_t *set_iter)
 
void set_delete (set_t *set)
 Delete a set that is no longer needed. More...
 
void set_delete_r (set_pool_t *set_pool, set_t *set)
 
set_tset_difference (set_t *dst, const set_t *src)
 Compute the diffedrence of two sets. More...
 
set_tset_empty (set_t *set)
 Make a set the empty set. More...
 
set_tset_everything (set_t *set)
 Make a set the set of everything. More...
 
set_iter_tset_first (const set_t *set)
 Find the first "member" of the set. More...
 
set_iter_tset_first_r (set_pool_t *set_pool, const set_t *set)
 
set_tset_intersection (set_t *dst, const set_t *src)
 Compute the intersection of two sets. More...
 
set_tset_invert (set_t *set)
 Compute the inverse of a set. More...
 
int set_is_disjoint (const set_t *s1, const set_t *s2)
 Test if two sets are disjoint. More...
 
int set_is_empty (const set_t *set)
 Test if a set is the set of everything. More...
 
int set_is_equivalent (const set_t *s1, const set_t *s2)
 Test if two sets are equivalent. More...
 
int set_is_everything (const set_t *set)
 Test if a set is the set of everything. More...
 
int set_is_intersecting (const set_t *s1, const set_t *s2)
 Test if two sets intersect. More...
 
int set_is_member (const set_t *set, unsigned x)
 Test an element for membership in a set. More...
 
int set_is_subset (const set_t *set, const set_t *sub)
 Test if a set is a subset of another set. More...
 
set_tset_new (void)
 Create a new set. More...
 
set_tset_new_r (set_pool_t *set_pool)
 
set_tset_new_size (int size)
 Create a new set with space pre-allocated for the specified set size. More...
 
set_tset_new_size_r (set_pool_t *set_pool, int size)
 
set_iter_tset_next (set_iter_t *set_iter)
 Find the next "member" of the set. More...
 
set_iter_tset_next_r (set_pool_t *set_pool, set_iter_t *set_iter)
 
void set_pool_init (set_pool_t *set_pool)
 
set_tset_remove (set_t *set, unsigned x)
 Remove an element from a set. More...
 
set_tset_reverse_difference (set_t *dst, const set_t *src)
 Compute the diffedrence of two sets. More...
 
unsigned set_size (const set_t *set)
 Obtain the number of members (or non-members) of a set. More...
 
set_tset_union (set_t *dst, const set_t *src)
 Compute the union of two sets. More...