Improve description.
[pintos-anon] / src / lib / kernel / bitmap.h
index ada1354d26944ab8d1bb1a8f1b26f0526f296fcd..8aef186f709a6073c6c445f19b20285f2b114d08 100644 (file)
@@ -1,31 +1,12 @@
-#ifndef HEADER_BITMAP_H
-#define HEADER_BITMAP_H 1
+#ifndef __LIB_KERNEL_BITMAP_H
+#define __LIB_KERNEL_BITMAP_H
 
 #include <stdbool.h>
 #include <stddef.h>
 
 /* Bitmap abstract data type. */
 
-/* Element type.
-
-   This must be an unsigned integer type at least as wide as int.
-
-   Each bit represents one bit in the bitmap.
-   If bit 0 in an element represents bit K in the bitmap,
-   then bit 1 in the element represents bit K+1 in the bitmap,
-   and so on. */
-typedef unsigned long elem_type;
-
-/* From the outside, a bitmap is an array of bits.  From the
-   inside, it's an array of elem_type (defined above) that
-   simulates an array of bits. */
-struct bitmap
-  {
-    size_t bit_cnt;     /* Number of bits. */
-    elem_type *bits;    /* Elements that represent bits. */
-  };
-
-bool bitmap_init (struct bitmap *, size_t bit_cnt);
+struct bitmap *bitmap_create (size_t bit_cnt);
 void bitmap_destroy (struct bitmap *);
 
 size_t bitmap_size (const struct bitmap *);
@@ -60,4 +41,4 @@ void bitmap_write (const struct bitmap *, struct file *);
 
 void bitmap_dump (const struct bitmap *);
 
-#endif /* bitmap.h */
+#endif /* lib/kernel/bitmap.h */