#include <stdbool.h>
#include <stddef.h>
+typedef unsigned long elem_type;
+
struct bitmap
{
size_t bit_cnt;
elem_type *bits;
};
-void bitmap_init (struct bitmap *, size_t bit_cnt);
+bool bitmap_init (struct bitmap *, size_t bit_cnt);
void bitmap_destroy (struct bitmap *);
size_t bitmap_size (const struct bitmap *);
+size_t bitmap_storage_size (const struct bitmap *);
void bitmap_set (struct bitmap *, size_t idx, bool);
void bitmap_set_all (struct bitmap *, bool);
bool bitmap_none (const struct bitmap *);
bool bitmap_all (const struct bitmap *);
+#ifdef FILESYS
+struct file;
+void bitmap_read (struct bitmap *, struct file *);
+void bitmap_write (const struct bitmap *, struct file *);
+#endif
+
+void bitmap_dump (const struct bitmap *);
+
#endif /* bitmap.h */