bitmap: implement map_and_not.
authorAles Kozumplik <akozumpl@redhat.com>
Tue, 27 Mar 2012 12:06:42 +0000 (14:06 +0200)
committerAles Kozumplik <akozumpl@redhat.com>
Tue, 27 Mar 2012 12:13:00 +0000 (14:13 +0200)
src/bitmap.c
src/bitmap.h
src/libsolv.ver

index 94a88ca..5a8dcd8 100644 (file)
@@ -71,4 +71,16 @@ map_and(Map *t, Map *s)
        *ti++ &= *si++;
 }
 
+/* like map_and but negates value in s first, i.e. t & ~s */
+void
+map_and_not(Map *t, Map *s)
+{
+    unsigned char *ti, *si, *end;
+    ti = t->map;
+    si = s->map;
+    end = ti + t->size;
+    while (ti < end)
+       *ti++ &= ~*si++;
+}
+
 /* EOF */
index 12257ff..b098b26 100644 (file)
@@ -35,6 +35,7 @@ extern void map_init_clone(Map *t, Map *s);
 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_and_not(Map *t, Map *s);
 
 static inline void map_empty(Map *m)
 {
index 5204e29..3902354 100644 (file)
@@ -27,6 +27,7 @@ SOLV_1.0 {
                dirpool_init;
                dirpool_make_dirtraverse;
                map_and;
+               map_and_not;
                map_free;
                map_grow;
                map_init;