3 #include "xbt/setset.h"
6 #define BITS_INT (8 * sizeof(int))
8 typedef struct s_xbt_setset_elm {
10 } s_xbt_setset_elm_t, *xbt_setset_elm_t;
12 typedef union u_xbt_setset_elm_entry {
13 /* Information when the entry is being used */
17 /* Information when the entry is free */
21 } u_xbt_setset_elm_entry_t, *xbt_setset_elm_entry_t;
23 typedef struct s_xbt_setset_set {
24 xbt_setset_t setset; /* setset that contains this set */
25 unsigned int size; /* in integers */
26 unsigned int *bitmap; /* the bit array */
29 typedef struct s_xbt_setset {
30 xbt_dynar_t elm_array; /* of s_xbt_setset_elm_entry_t, to find elements by index */
31 xbt_fifo_t sets; /* of s_xbt_setset_set_t, memberships in actual sets of setset */
34 typedef struct s_xbt_setset_cursor {
35 int idx; /* Actual postition of the cursor (bit number) */
36 xbt_setset_set_t set; /* The set associated to the cursor */
37 } s_xbt_setset_cursor_t;
39 /* Some internal functions */
43 /* Get the object associated to a given index */
44 void *_xbt_setset_idx_to_obj(xbt_setset_t setset, unsigned long idx);
46 /* Check if the nth bit of an integer is set or not*/
47 unsigned int _is_bit_set(unsigned int bit, unsigned int integer);
49 /* Set the nth bit of an array of integers */
50 void _set_bit(unsigned int bit, unsigned int *bitmap);
52 /* Unset the nth bit of an array of integers */
53 void _unset_bit(unsigned int bit, unsigned int *bitmap);