summaryrefslogtreecommitdiff
path: root/src/bitmap.c
diff options
context:
space:
mode:
authorAles Kozumplik <akozumpl@redhat.com>2012-03-27 14:06:42 +0200
committerAles Kozumplik <akozumpl@redhat.com>2012-03-27 14:13:00 +0200
commitfd144ef57517b9cff624d5c8ca11d2bc3f461ed2 (patch)
tree582902cbe70251de23bdd54c394c50780397f8f0 /src/bitmap.c
parent28d0d857fec4cc719d7418f94e250b570228ae84 (diff)
downloadlibsolv-fd144ef57517b9cff624d5c8ca11d2bc3f461ed2.tar.gz
libsolv-fd144ef57517b9cff624d5c8ca11d2bc3f461ed2.tar.bz2
libsolv-fd144ef57517b9cff624d5c8ca11d2bc3f461ed2.zip
bitmap: implement map_and_not.
Diffstat (limited to 'src/bitmap.c')
-rw-r--r--src/bitmap.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/bitmap.c b/src/bitmap.c
index 94a88ca..5a8dcd8 100644
--- a/src/bitmap.c
+++ b/src/bitmap.c
@@ -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 */