bitmap: implement bitmap_set_range, bitmap_get and bitmap_destroy

This commit is contained in:
2026-04-25 16:48:58 -03:00
committed by Matheus
parent 1d1e66fe32
commit 1dea5f12a8
2 changed files with 45 additions and 6 deletions
+4 -1
View File
@@ -1,6 +1,7 @@
#ifndef _BITMAP_H
#define _BITMAP_H
#include <stdbool.h>
#include <stddef.h>
typedef struct {
@@ -9,8 +10,10 @@ typedef struct {
} bitmap_t;
int bitmap_init(bitmap_t *bitmap, size_t size);
void bitmap_destroy(bitmap_t *bitmap);
void bitmap_set(bitmap_t *bitmap, long idx, int v);
void bitmap_set_range(bitmap_t *bitmap, long start, long count, int v);
bool bitmap_get(bitmap_t *bitmap, long idx);
long bitmap_find_first_set(bitmap_t *bitmap);
#endif