You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

bitmap.h 518B

12345678910111213141516171819202122232425
  1. #ifndef L2_BITMAP_H
  2. #define L2_BITMAP_H
  3. #include <stdlib.h>
  4. #include <stdint.h>
  5. typedef long long int l2_bitmap_entry;
  6. struct l2_bitmap {
  7. l2_bitmap_entry *tables;
  8. size_t tableslen;
  9. size_t currtable;
  10. l2_bitmap_entry *dirs;
  11. size_t dirslen;
  12. size_t currdir;
  13. };
  14. void l2_bitmap_init(struct l2_bitmap *bm);
  15. void l2_bitmap_free(struct l2_bitmap *bm);
  16. int l2_bitmap_get(struct l2_bitmap *bm, size_t id);
  17. size_t l2_bitmap_set_next(struct l2_bitmap *bm);
  18. void l2_bitmap_unset(struct l2_bitmap *bm, size_t id);
  19. #endif