1 #ifndef HEADER_BITMAP_H
2 #define HEADER_BITMAP_H 1
13 void bitmap_init (struct bitmap *, size_t bit_cnt);
14 void bitmap_destroy (struct bitmap *);
16 size_t bitmap_size (const struct bitmap *);
18 void bitmap_set (struct bitmap *, size_t idx, bool);
19 void bitmap_set_all (struct bitmap *, bool);
21 void bitmap_mark (struct bitmap *, size_t idx);
22 void bitmap_reset (struct bitmap *, size_t idx);
23 void bitmap_flip (struct bitmap *, size_t idx);
25 bool bitmap_test (const struct bitmap *, size_t idx);
27 #define BITMAP_ERROR ((size_t) -1)
28 size_t bitmap_scan (const struct bitmap *, bool);
29 size_t bitmap_find_and_set (struct bitmap *);
30 size_t bitmap_find_and_clear (struct bitmap *);
32 size_t bitmap_set_cnt (const struct bitmap *);
33 bool bitmap_clear_cnt (const struct bitmap *);
35 bool bitmap_any (const struct bitmap *);
36 bool bitmap_none (const struct bitmap *);
37 bool bitmap_all (const struct bitmap *);