Imported Upstream version 0.6.35
[platform/upstream/libsolv.git] / src / bitmap.h
index c6993ca..1e89590 100644 (file)
 
 #include <string.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct _Map {
   unsigned char *map;
   int size;
@@ -29,14 +33,17 @@ 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);
+extern void map_init_clone(Map *target, const Map *source);
 extern void map_grow(Map *m, int n);
 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_and(Map *t, const Map *s);
+extern void map_or(Map *t, const Map *s);
+extern void map_subtract(Map *t, const Map *s);
+extern void map_invertall(Map *m);
 
 static inline void map_empty(Map *m)
 {
@@ -58,5 +65,13 @@ 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
+}
+#endif
 
 #endif /* LIBSOLV_BITMAP_H */