From: Ales Kozumplik Date: Tue, 27 Mar 2012 12:06:42 +0000 (+0200) Subject: bitmap: implement map_and_not. X-Git-Tag: BASE-SuSE-Code-12_2-Branch~63^2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fd144ef57517b9cff624d5c8ca11d2bc3f461ed2;p=platform%2Fupstream%2Flibsolv.git bitmap: implement map_and_not. --- 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 */ diff --git a/src/bitmap.h b/src/bitmap.h index 12257ff..b098b26 100644 --- a/src/bitmap.h +++ b/src/bitmap.h @@ -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) { diff --git a/src/libsolv.ver b/src/libsolv.ver index 5204e29..3902354 100644 --- a/src/libsolv.ver +++ b/src/libsolv.ver @@ -27,6 +27,7 @@ SOLV_1.0 { dirpool_init; dirpool_make_dirtraverse; map_and; + map_and_not; map_free; map_grow; map_init;