28 #include "../../../../common/util.h"
32 typedef uint32_t bitmap_cell_t;
33 typedef uint16_t bitmap_size_t;
34 typedef int32_t bitmap_bitn_t;
37 #if defined(SEAP_THREAD_SAFE)
41 bitmap_size_t realsize;
46 #if defined(SEAP_THREAD_SAFE)
47 # define BITMAP_INITIALIZER { 0, 128, 0, NULL, 0 }
49 # define BITMAP_INITIALIZER { 128, 0, NULL, 0 }
52 #define BITMAP_CELLSIZE (sizeof (bitmap_cell_t) * 8)
54 bitmap_t *bitmap_new (bitmap_size_t size);
55 int *bitmap_init (
bitmap_t *bitmap, bitmap_size_t size);
56 int *bitmap_reinit (
bitmap_t *bitmap, bitmap_size_t size);
57 int bitmap_set (
bitmap_t *bitmap, bitmap_bitn_t bitn);
58 int bitmap_cas (
bitmap_t *bitmap, bitmap_bitn_t bitn,
int v);
59 int bitmap_unset (
bitmap_t *bitmap, bitmap_bitn_t bitn);
61 bitmap_bitn_t bitmap_setfree (
bitmap_t *bitmap);
62 bitmap_bitn_t bitmap_getfree (
bitmap_t *bitmap);