summaryrefslogtreecommitdiff
path: root/src/bitmap.c
diff options
context:
space:
mode:
authorAles Kozumplik <akozumpl@redhat.com>2012-01-20 10:51:05 +0100
committerAles Kozumplik <akozumpl@redhat.com>2012-03-09 11:02:51 +0100
commit48253fc45e973585af73cef429d80224ad21593b (patch)
tree3a6586010b3949774b5af2ccd00e8f0ff395e80d /src/bitmap.c
parent0aa8a722447b68812ea89acb8881f753a87ca0c2 (diff)
downloadlibsolv-48253fc45e973585af73cef429d80224ad21593b.tar.gz
libsolv-48253fc45e973585af73cef429d80224ad21593b.tar.bz2
libsolv-48253fc45e973585af73cef429d80224ad21593b.zip
bitmap: implement map_and and MAPSETALL
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 d57971d..94a88ca 100644
--- a/src/bitmap.c
+++ b/src/bitmap.c
@@ -59,4 +59,16 @@ map_grow(Map *m, int n)
}
}
+/* bitwise-ands same-sized maps t and s, stores the result in t. */
+void
+map_and(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 */