diff options
author | Yuriy Rymarchuk <45283261+DropB1t@users.noreply.github.com> | 2023-05-18 13:28:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-18 13:28:32 +0200 |
commit | a8b3baf2b8d7f4fffadc7d35a335ddd2c76770c2 (patch) | |
tree | e3facfabba279617627691e54c266db4317ad2ee | |
parent | b1bcf1ff6018c55f8daaa107070e1c8503082b2b (diff) |
Add support for roaring_bitmap_xor_inplace (#1983)
-rw-r--r-- | src/include/ndpi_api.h | 1 | ||||
-rw-r--r-- | src/lib/ndpi_bitmap.c | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/include/ndpi_api.h b/src/include/ndpi_api.h index 9c2188e68..7c5523bd6 100644 --- a/src/include/ndpi_api.h +++ b/src/include/ndpi_api.h @@ -1914,6 +1914,7 @@ extern "C" { void ndpi_bitmap_and(ndpi_bitmap* a, ndpi_bitmap* b_and); void ndpi_bitmap_or(ndpi_bitmap* a, ndpi_bitmap* b_or); + void ndpi_bitmap_xor(ndpi_bitmap* a, ndpi_bitmap* b_xor); ndpi_bitmap_iterator* ndpi_bitmap_iterator_alloc(ndpi_bitmap* b); void ndpi_bitmap_iterator_free(ndpi_bitmap* b); diff --git a/src/lib/ndpi_bitmap.c b/src/lib/ndpi_bitmap.c index e87ca1620..728973ae8 100644 --- a/src/lib/ndpi_bitmap.c +++ b/src/lib/ndpi_bitmap.c @@ -115,6 +115,13 @@ void ndpi_bitmap_or(ndpi_bitmap* a, ndpi_bitmap* b_or) { /* ******************************************* */ +/* b = b ^ b_xor */ +void ndpi_bitmap_xor(ndpi_bitmap* a, ndpi_bitmap* b_xor) { + roaring_bitmap_xor_inplace((ndpi_bitmap*)a, (ndpi_bitmap*)b_xor); +} + +/* ******************************************* */ + ndpi_bitmap_iterator* ndpi_bitmap_iterator_alloc(ndpi_bitmap* b) { return(roaring_create_iterator((ndpi_bitmap*)b)); } |