2 * Copyright (c) 2007-2011, Novell Inc.
4 * This program is licensed under the BSD license, read LICENSE.BSD
5 * for further information
13 #ifndef LIBSOLV_BITMAP_H
14 #define LIBSOLV_BITMAP_H
27 #define MAPZERO(m) (memset((m)->map, 0, (m)->size))
29 #define MAPSETALL(m) (memset((m)->map, 0xff, (m)->size))
31 #define MAPSET(m, n) ((m)->map[(n) >> 3] |= 1 << ((n) & 7))
33 #define MAPCLR(m, n) ((m)->map[(n) >> 3] &= ~(1 << ((n) & 7)))
35 #define MAPTST(m, n) ((m)->map[(n) >> 3] & (1 << ((n) & 7)))
37 extern void map_init(Map *m, int n);
38 extern void map_init_clone(Map *t, Map *s);
39 extern void map_grow(Map *m, int n);
40 extern void map_free(Map *m);
41 extern void map_and(Map *t, Map *s);
42 extern void map_or(Map *t, Map *s);
43 extern void map_subtract(Map *t, Map *s);
45 static inline void map_empty(Map *m)
49 static inline void map_set(Map *m, int n)
53 static inline void map_setall(Map *m)
57 static inline void map_clr(Map *m, int n)
61 static inline int map_tst(Map *m, int n)
70 #endif /* LIBSOLV_BITMAP_H */