diff options
Diffstat (limited to 'src/bitmap.h')
-rw-r--r-- | src/bitmap.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/bitmap.h b/src/bitmap.h index 5784e6c..0050a6a 100644 --- a/src/bitmap.h +++ b/src/bitmap.h @@ -33,6 +33,8 @@ typedef struct _Map { #define MAPCLR(m, n) ((m)->map[(n) >> 3] &= ~(1 << ((n) & 7))) /* test bit */ #define MAPTST(m, n) ((m)->map[(n) >> 3] & (1 << ((n) & 7))) +/* clear some bits at a position */ +#define MAPCLR_AT(m, n) ((m)->map[(n) >> 3] = 0) extern void map_init(Map *m, int n); extern void map_init_clone(Map *t, Map *s); @@ -41,6 +43,7 @@ extern void map_free(Map *m); extern void map_and(Map *t, Map *s); extern void map_or(Map *t, Map *s); extern void map_subtract(Map *t, Map *s); +extern void map_invertall(Map *m); static inline void map_empty(Map *m) { @@ -62,6 +65,10 @@ static inline int map_tst(Map *m, int n) { return MAPTST(m, n); } +static inline void map_clr_at(Map *m, int n) +{ + MAPCLR_AT(m, n); +} #ifdef __cplusplus } |