]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
bitmap: implement map_and_not. 11/head
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 94a88ca0949adc8b585756182e15f70a6ebc48dc..5a8dcd80cc95ebf268a3e2b99c9e2d7de2d468c0 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 12257ff49eba7016050af5c64d22f608e8653e8a..b098b260db9b96c89c0185ffd4c39b427d20377e 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 5204e29ca3e9eead922b44650af1a0b4c713cc68..3902354b3d9c5fabbf7ddbdf97a3a59210af99a4 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;