41 lines
1.2 KiB
C
41 lines
1.2 KiB
C
#ifndef BLUE_DS_BITMAP_H_
|
|
#define BLUE_DS_BITMAP_H_
|
|
|
|
#include <blue/core/macros.h>
|
|
#include <blue/core/misc.h>
|
|
#include <stdbool.h>
|
|
|
|
B_DECLS_BEGIN;
|
|
|
|
#define B_TYPE_BITMAP (b_bitmap_get_type())
|
|
|
|
B_DECLARE_TYPE(b_bitmap);
|
|
|
|
B_TYPE_CLASS_DECLARATION_BEGIN(b_bitmap)
|
|
B_TYPE_CLASS_DECLARATION_END(b_bitmap)
|
|
|
|
BLUE_API b_type b_bitmap_get_type(void);
|
|
|
|
BLUE_API b_bitmap *b_bitmap_create(size_t nr_bits);
|
|
|
|
BLUE_API void b_bitmap_set_bit(b_bitmap *map, size_t bit);
|
|
BLUE_API void b_bitmap_clear_bit(b_bitmap *map, size_t bit);
|
|
BLUE_API void b_bitmap_set_range(b_bitmap *map, size_t first_bit, size_t nbits);
|
|
BLUE_API void b_bitmap_clear_range(b_bitmap *map, size_t first_bit, size_t nbits);
|
|
BLUE_API void b_bitmap_set_all(b_bitmap *map);
|
|
BLUE_API void b_bitmap_clear_all(b_bitmap *map);
|
|
|
|
BLUE_API bool b_bitmap_check_bit(const b_bitmap *map, size_t bit);
|
|
|
|
BLUE_API size_t b_bitmap_count_set_bits(const b_bitmap *map);
|
|
BLUE_API size_t b_bitmap_count_clear_bits(const b_bitmap *map);
|
|
|
|
BLUE_API size_t b_bitmap_highest_set_bit(const b_bitmap *map);
|
|
BLUE_API size_t b_bitmap_highest_clear_bit(const b_bitmap *map);
|
|
BLUE_API size_t b_bitmap_lowest_set_bit(const b_bitmap *map);
|
|
BLUE_API size_t b_bitmap_lowest_clear_bit(const b_bitmap *map);
|
|
|
|
B_DECLS_END;
|
|
|
|
#endif
|