Rework file random map
[fio.git] / lib / bitmap.h
1 #ifndef FIO_BITMAP_H
2 #define FIO_BITMAP_H
3
4 #include <inttypes.h>
5
6 struct bitmap;
7 struct bitmap *bitmap_new(unsigned long nr_bits);
8 void bitmap_free(struct bitmap *bm);
9
10 void bitmap_clear(struct bitmap *bitmap, uint64_t bit_nr);
11 void bitmap_set(struct bitmap *bitmap, uint64_t bit_nr);
12 unsigned int bitmap_set_nr(struct bitmap *bitmap, uint64_t bit_nr, unsigned int nr_bits);
13 int bitmap_isset(struct bitmap *bitmap, uint64_t bit_nr);
14 uint64_t bitmap_first_free(struct bitmap *bitmap);
15 uint64_t bitmap_next_free(struct bitmap *bitmap, uint64_t bit_nr);
16 void bitmap_reset(struct bitmap *bitmap);
17
18 #endif