From 8198d4a1605ad615f7bf00e5851d9e784015af66 Mon Sep 17 00:00:00 2001 From: lemire Date: Thu, 19 Sep 2024 15:00:32 +0000 Subject: [PATCH] deploy: 51be4bd8cb4e855e19f362a29705cb78688a9d42 --- d8/d01/roaring64_8h.html | 10 +- d8/d01/roaring64_8h_source.html | 98 ++-- .../structroaring__uint32__iterator__s.html | 18 +- dc/d56/roaring_8h.html | 33 +- dc/d56/roaring_8h_source.html | 440 +++++++++--------- index.html | 20 +- 6 files changed, 320 insertions(+), 299 deletions(-) diff --git a/d8/d01/roaring64_8h.html b/d8/d01/roaring64_8h.html index 325caf8a..8d66b7ee 100644 --- a/d8/d01/roaring64_8h.html +++ b/d8/d01/roaring64_8h.html @@ -1623,9 +1623,12 @@

-

Read a bitmap from a serialized buffer safely (reading up to maxbytes). In case of failure, NULL is returned.

+

Read a bitmap from a serialized buffer (reading up to maxbytes). In case of failure, NULL is returned.

This is meant to be compatible with other languages https://github.com/RoaringBitmap/RoaringFormatSpec#extension-for-64-bit-implementations

-

The function itself is safe in the sense that it will not cause buffer overflows. However, for correct operations, it is assumed that the bitmap read was once serialized from a valid bitmap (i.e., it follows the format specification). If you provided an incorrect input (garbage), then the bitmap read may not be in a valid state and following operations may not lead to sensible results. In particular, the serialized array containers need to be in sorted order, and the run containers should be in sorted non-overlapping order. This is is guaranteed to happen when serializing an existing bitmap, but not for random inputs.

+

The function itself is safe in the sense that it will not cause buffer overflows: it will not read beyond the scope of the provided buffer (buf,maxbytes).

+

However, for correct operations, it is assumed that the bitmap read was once serialized from a valid bitmap (i.e., it follows the format specification). If you provided an incorrect input (garbage), then the bitmap read may not be in a valid state and following operations may not lead to sensible results. In particular, the serialized array containers need to be in sorted order, and the run containers should be in sorted non-overlapping order. This is is guaranteed to happen when serializing an existing bitmap, but not for random inputs.

+

You may use roaring64_bitmap_internal_validate to check the validity of the bitmap prior to using it.

+

We recommend that you use checksums to check that serialized data corresponds to a serialized bitmap.

This function is endian-sensitive. If you have a big-endian system (e.g., a mainframe IBM s390x), the data format is going to be big-endian and not compatible with little-endian systems.

@@ -1688,7 +1691,8 @@

https://github.com/RoaringBitmap/RoaringFormatSpec#extension-for-64-bit-implementations

-

This function is endian-sensitive. If you have a big-endian system (e.g., a mainframe IBM s390x), the data format is going to be big-endian and not compatible with little-endian systems.

+

This function is endian-sensitive. If you have a big-endian system (e.g., a mainframe IBM s390x), the data format is going to be big-endian and not compatible with little-endian systems.

+

When serializing data to a file, we recommend that you also use checksums so that, at deserialization, you can be confident that you are recovering the correct data.

diff --git a/d8/d01/roaring64_8h_source.html b/d8/d01/roaring64_8h_source.html index dc8011df..0d7fbc33 100644 --- a/d8/d01/roaring64_8h_source.html +++ b/d8/d01/roaring64_8h_source.html @@ -297,56 +297,56 @@
492  uint64_t max);
500 
- -
516  char *buf);
- -
525  size_t maxbytes);
-
526 
- -
549  size_t maxbytes);
-
550 
- -
565  roaring_iterator64 iterator, void *ptr);
-
566 
- -
576  uint64_t *out);
-
577 
- -
587 
- -
597  const roaring64_bitmap_t *r);
-
598 
- - -
605 
- - -
612 
- + +
520  char *buf);
+ +
529  size_t maxbytes);
+
530 
+ +
562  size_t maxbytes);
+
563 
+ +
578  roaring_iterator64 iterator, void *ptr);
+
579 
+ +
589  uint64_t *out);
+
590 
+ +
600 
+ +
610  const roaring64_bitmap_t *r);
+
611 
+ +
618 
- -
623 
- -
629 
- -
635 
- -
646 
- -
657 
- -
666  uint64_t val);
-
667 
-
675 uint64_t roaring64_iterator_read(roaring64_iterator_t *it, uint64_t *buf,
-
676  uint64_t count);
-
677 
-
678 #ifdef __cplusplus
-
679 } // extern "C"
-
680 } // namespace roaring
-
681 } // namespace api
-
682 #endif
-
683 
-
684 #endif /* ROARING64_H */
+ + +
625 
+ +
631 
+ +
636 
+ +
642 
+ +
648 
+ +
659 
+ +
670 
+ +
679  uint64_t val);
+
680 
+
688 uint64_t roaring64_iterator_read(roaring64_iterator_t *it, uint64_t *buf,
+
689  uint64_t count);
+
690 
+
691 #ifdef __cplusplus
+
692 } // extern "C"
+
693 } // namespace roaring
+
694 } // namespace api
+
695 #endif
+
696 
+
697 #endif /* ROARING64_H */
roaring64_bitmap_t * roaring64_bitmap_move_from_roaring32(roaring_bitmap_t *r)
uint64_t roaring64_bitmap_or_cardinality(const roaring64_bitmap_t *r1, const roaring64_bitmap_t *r2)
diff --git a/da/d27/structroaring__uint32__iterator__s.html b/da/d27/structroaring__uint32__iterator__s.html index c38dfad8..ba2099c2 100644 --- a/da/d27/structroaring__uint32__iterator__s.html +++ b/da/d27/structroaring__uint32__iterator__s.html @@ -120,7 +120,7 @@

roaring_bitmap_t *r =... roaring_uint32_iterator_t i; roaring_iterator_create(r, &i); while(i.has_value) { printf("value = %d\n", i.current_value); roaring_uint32_iterator_advance(&i); }

Obviously, if you modify the underlying bitmap, the iterator becomes invalid. So don't. A struct used to keep iterator state. Users should only access current_value and has_value, the rest of the type should be treated as opaque.

-

Definition at line 960 of file roaring.h.

+

Definition at line 977 of file roaring.h.

Member Data Documentation

◆ container

@@ -134,7 +134,7 @@

-

Definition at line 962 of file roaring.h.

+

Definition at line 979 of file roaring.h.

@@ -150,7 +150,7 @@

-

Definition at line 964 of file roaring.h.

+

Definition at line 981 of file roaring.h.

@@ -166,7 +166,7 @@

-

Definition at line 966 of file roaring.h.

+

Definition at line 983 of file roaring.h.

@@ -182,7 +182,7 @@

-

Definition at line 968 of file roaring.h.

+

Definition at line 985 of file roaring.h.

@@ -198,7 +198,7 @@

-

Definition at line 969 of file roaring.h.

+

Definition at line 986 of file roaring.h.

@@ -214,7 +214,7 @@

-

Definition at line 965 of file roaring.h.

+

Definition at line 982 of file roaring.h.

@@ -230,7 +230,7 @@

-

Definition at line 961 of file roaring.h.

+

Definition at line 978 of file roaring.h.

@@ -246,7 +246,7 @@

-

Definition at line 963 of file roaring.h.

+

Definition at line 980 of file roaring.h.

diff --git a/dc/d56/roaring_8h.html b/dc/d56/roaring_8h.html index 8f2fd4cc..dc3fd41f 100644 --- a/dc/d56/roaring_8h.html +++ b/dc/d56/roaring_8h.html @@ -450,7 +450,7 @@

DEPRECATED, use roaring_uint32_iterator_advance.

-

Definition at line 1028 of file roaring.h.

+

Definition at line 1045 of file roaring.h.

References roaring_uint32_iterator_advance().

@@ -1340,7 +1340,8 @@

Serializes bitmap using frozen format. Buffer size must be at least roaring_bitmap_frozen_size_in_bytes().

-

This function is endian-sensitive. If you have a big-endian system (e.g., a mainframe IBM s390x), the data format is going to be big-endian and not compatible with little-endian systems.

+

This function is endian-sensitive. If you have a big-endian system (e.g., a mainframe IBM s390x), the data format is going to be big-endian and not compatible with little-endian systems.

+

When serializing data to a file, we recommend that you also use checksums so that, at deserialization, you can be confident that you are recovering the correct data.

Referenced by roaring::Roaring::writeFrozen().

@@ -2261,8 +2262,10 @@

Read bitmap from a serialized buffer safely (reading up to maxbytes). In case of failure, NULL is returned.

This is meant to be compatible with the Java and Go versions: https://github.com/RoaringBitmap/RoaringFormatSpec

-

The function itself is safe in the sense that it will not cause buffer overflows. However, for correct operations, it is assumed that the bitmap read was once serialized from a valid bitmap (i.e., it follows the format specification). If you provided an incorrect input (garbage), then the bitmap read may not be in a valid state and following operations may not lead to sensible results. In particular, the serialized array containers need to be in sorted order, and the run containers should be in sorted non-overlapping order. This is is guaranteed to happen when serializing an existing bitmap, but not for random inputs.

-

You may use roaring_bitmap_internal_validate to check the validity of the bitmap prior to using it. You may also use other strategies to check for corrupted inputs (e.g., checksums).

+

The function itself is safe in the sense that it will not cause buffer overflows: it will not read beyond the scope of the provided buffer (buf,maxbytes).

+

However, for correct operations, it is assumed that the bitmap read was once serialized from a valid bitmap (i.e., it follows the format specification). If you provided an incorrect input (garbage), then the bitmap read may not be in a valid state and following operations may not lead to sensible results. In particular, the serialized array containers need to be in sorted order, and the run containers should be in sorted non-overlapping order. This is is guaranteed to happen when serializing an existing bitmap, but not for random inputs.

+

You may use roaring_bitmap_internal_validate to check the validity of the bitmap prior to using it.

+

We recommend that you use checksums to check that serialized data corresponds to a serialized bitmap.

This function is endian-sensitive. If you have a big-endian system (e.g., a mainframe IBM s390x), the data format is going to be big-endian and not compatible with little-endian systems.

Referenced by roaring::Roaring::readSafe().

@@ -2327,7 +2330,8 @@

https://github.com/RoaringBitmap/RoaringFormatSpec

-

This function is endian-sensitive. If you have a big-endian system (e.g., a mainframe IBM s390x), the data format is going to be big-endian and not compatible with little-endian systems.

+

This function is endian-sensitive. If you have a big-endian system (e.g., a mainframe IBM s390x), the data format is going to be big-endian and not compatible with little-endian systems.

+

When serializing data to a file, we recommend that you also use checksums so that, at deserialization, you can be confident that you are recovering the correct data.

Referenced by roaring::Roaring::write().

@@ -2862,7 +2866,8 @@

roaring_bitmap_portable_serialize() if you want a format that's compatible with Java and Go implementations. This format can sometimes be more space efficient than the portable form, e.g. when the data is sparse.

Returns how many bytes written, should be roaring_bitmap_size_in_bytes(r).

-

This function is endian-sensitive. If you have a big-endian system (e.g., a mainframe IBM s390x), the data format is going to be big-endian and not compatible with little-endian systems.

+

This function is endian-sensitive. If you have a big-endian system (e.g., a mainframe IBM s390x), the data format is going to be big-endian and not compatible with little-endian systems.

+

When serializing data to a file, we recommend that you also use checksums so that, at deserialization, you can be confident that you are recovering the correct data.

Referenced by roaring::Roaring::write().

@@ -3191,7 +3196,7 @@

DEPRECATED, use roaring_uint32_iterator_copy.

-

Definition at line 1074 of file roaring.h.

+

Definition at line 1091 of file roaring.h.

References roaring_uint32_iterator_copy().

@@ -3222,7 +3227,7 @@

DEPRECATED, use roaring_iterator_create.

-

Definition at line 1012 of file roaring.h.

+

Definition at line 1029 of file roaring.h.

References roaring_iterator_create().

@@ -3253,7 +3258,7 @@

DEPRECATED, use roaring_uint32_iterator_free.

-

Definition at line 1084 of file roaring.h.

+

Definition at line 1101 of file roaring.h.

References roaring_uint32_iterator_free().

@@ -3294,7 +3299,7 @@

DEPRECATED, use roaring_iterator_init.

-

Definition at line 981 of file roaring.h.

+

Definition at line 998 of file roaring.h.

References roaring_iterator_init().

@@ -3335,7 +3340,7 @@

DEPRECATED, use roaring_iterator_init_last.

-

Definition at line 995 of file roaring.h.

+

Definition at line 1012 of file roaring.h.

References roaring_iterator_init_last().

@@ -3542,7 +3547,7 @@

DEPRECATED, use roaring_uint32_iterator_move_equalorlarger.

-

Definition at line 1060 of file roaring.h.

+

Definition at line 1077 of file roaring.h.

References roaring_uint32_iterator_move_equalorlarger().

@@ -3573,7 +3578,7 @@

DEPRECATED, use roaring_uint32_iterator_previous.

-

Definition at line 1045 of file roaring.h.

+

Definition at line 1062 of file roaring.h.

References roaring_uint32_iterator_previous().

@@ -3620,7 +3625,7 @@

DEPRECATED, use roaring_uint32_iterator_read.

-

Definition at line 1104 of file roaring.h.

+

Definition at line 1121 of file roaring.h.

References roaring_uint32_iterator_read().

diff --git a/dc/d56/roaring_8h_source.html b/dc/d56/roaring_8h_source.html index d95ead6e..525025d5 100644 --- a/dc/d56/roaring_8h_source.html +++ b/dc/d56/roaring_8h_source.html @@ -325,218 +325,218 @@
535 
541 
-
556 size_t roaring_bitmap_serialize(const roaring_bitmap_t *r, char *buf);
-
557 
- -
569 
- -
585  size_t maxbytes);
-
586 
- -
592 
- -
609 
- -
636  size_t maxbytes);
-
637 
- -
659 
- -
668  size_t maxbytes);
-
669 
- -
677 
- -
693 
-
694 /*
-
695  * "Frozen" serialization format imitates memory layout of roaring_bitmap_t.
-
696  * Deserialized bitmap is a constant view of the underlying buffer.
-
697  * This significantly reduces amount of allocations and copying required during
-
698  * deserialization.
-
699  * It can be used with memory mapped files.
-
700  * Example can be found in benchmarks/frozen_benchmark.c
-
701  *
-
702  * [#####] const roaring_bitmap_t *
-
703  * | | |
-
704  * +----+ | +-+
-
705  * | | |
-
706  * [#####################################] underlying buffer
-
707  *
-
708  * Note that because frozen serialization format imitates C memory layout
-
709  * of roaring_bitmap_t, it is not fixed. It is different on big/little endian
-
710  * platforms and can be changed in future.
-
711  */
-
712 
- -
717 
- -
727 
- -
744  size_t length);
-
745 
-
759 bool roaring_iterate(const roaring_bitmap_t *r, roaring_iterator iterator,
-
760  void *ptr);
-
761 
-
762 bool roaring_iterate64(const roaring_bitmap_t *r, roaring_iterator64 iterator,
-
763  uint64_t high_bits, void *ptr);
-
764 
- -
769  const roaring_bitmap_t *r2);
-
770 
- -
775  const roaring_bitmap_t *r2);
-
776 
- -
782  const roaring_bitmap_t *r2);
-
783 
- -
800  const roaring_bitmap_t *r2,
-
801  const bool bitsetconversion);
-
802 
- -
812  const roaring_bitmap_t *r2,
-
813  const bool bitsetconversion);
-
814 
- -
822 
- -
835  const roaring_bitmap_t *r2);
-
836 
- -
843  const roaring_bitmap_t *r2);
-
844 
- -
851  uint64_t range_start, uint64_t range_end);
-
852 
-
859 void roaring_bitmap_flip_inplace(roaring_bitmap_t *r1, uint64_t range_start,
-
860  uint64_t range_end);
+
560 size_t roaring_bitmap_serialize(const roaring_bitmap_t *r, char *buf);
+
561 
+ +
573 
+ +
589  size_t maxbytes);
+
590 
+ +
596 
+ +
613 
+ +
645  size_t maxbytes);
+
646 
+ +
668 
+ +
677  size_t maxbytes);
+
678 
+ +
686 
+ +
706 
+
707 /*
+
708  * "Frozen" serialization format imitates memory layout of roaring_bitmap_t.
+
709  * Deserialized bitmap is a constant view of the underlying buffer.
+
710  * This significantly reduces amount of allocations and copying required during
+
711  * deserialization.
+
712  * It can be used with memory mapped files.
+
713  * Example can be found in benchmarks/frozen_benchmark.c
+
714  *
+
715  * [#####] const roaring_bitmap_t *
+
716  * | | |
+
717  * +----+ | +-+
+
718  * | | |
+
719  * [#####################################] underlying buffer
+
720  *
+
721  * Note that because frozen serialization format imitates C memory layout
+
722  * of roaring_bitmap_t, it is not fixed. It is different on big/little endian
+
723  * platforms and can be changed in future.
+
724  */
+
725 
+ +
730 
+ +
744 
+ +
761  size_t length);
+
762 
+
776 bool roaring_iterate(const roaring_bitmap_t *r, roaring_iterator iterator,
+
777  void *ptr);
+
778 
+
779 bool roaring_iterate64(const roaring_bitmap_t *r, roaring_iterator64 iterator,
+
780  uint64_t high_bits, void *ptr);
+
781 
+ +
786  const roaring_bitmap_t *r2);
+
787 
+ +
792  const roaring_bitmap_t *r2);
+
793 
+ +
799  const roaring_bitmap_t *r2);
+
800 
+ +
817  const roaring_bitmap_t *r2,
+
818  const bool bitsetconversion);
+
819 
+ +
829  const roaring_bitmap_t *r2,
+
830  const bool bitsetconversion);
+
831 
+ +
839 
+ +
852  const roaring_bitmap_t *r2);
+
853 
+ +
860  const roaring_bitmap_t *r2);
861 
-
868 bool roaring_bitmap_select(const roaring_bitmap_t *r, uint32_t rank,
-
869  uint32_t *element);
-
870 
-
881 uint64_t roaring_bitmap_rank(const roaring_bitmap_t *r, uint32_t x);
-
882 
-
892 void roaring_bitmap_rank_many(const roaring_bitmap_t *r, const uint32_t *begin,
-
893  const uint32_t *end, uint64_t *ans);
-
894 
-
902 int64_t roaring_bitmap_get_index(const roaring_bitmap_t *r, uint32_t x);
-
903 
- -
908 
- -
913 
- -
921  roaring_statistics_t *stat);
-
922 
- -
938  const char **reason);
+ +
868  uint64_t range_start, uint64_t range_end);
+
869 
+
876 void roaring_bitmap_flip_inplace(roaring_bitmap_t *r1, uint64_t range_start,
+
877  uint64_t range_end);
+
878 
+
885 bool roaring_bitmap_select(const roaring_bitmap_t *r, uint32_t rank,
+
886  uint32_t *element);
+
887 
+
898 uint64_t roaring_bitmap_rank(const roaring_bitmap_t *r, uint32_t x);
+
899 
+
909 void roaring_bitmap_rank_many(const roaring_bitmap_t *r, const uint32_t *begin,
+
910  const uint32_t *end, uint64_t *ans);
+
911 
+
919 int64_t roaring_bitmap_get_index(const roaring_bitmap_t *r, uint32_t x);
+
920 
+ +
925 
+ +
930 
+ +
938  roaring_statistics_t *stat);
939 
-
940 
- -
961  const roaring_bitmap_t *parent; // Owner
-
962  const ROARING_CONTAINER_T *container; // Current container
-
963  uint8_t typecode; // Typecode of current container
-
964  int32_t container_index; // Current container index
-
965  uint32_t highbits; // High 16 bits of the current value
-
966  roaring_container_iterator_t container_it;
-
967 
-
968  uint32_t current_value;
-
969  bool has_value;
- -
971 
- - -
979 
-
981 CROARING_DEPRECATED static inline void roaring_init_iterator(
-
982  const roaring_bitmap_t *r, roaring_uint32_iterator_t *newit) {
-
983  roaring_iterator_init(r, newit);
-
984 }
-
985 
- - -
993 
-
995 CROARING_DEPRECATED static inline void roaring_init_iterator_last(
-
996  const roaring_bitmap_t *r, roaring_uint32_iterator_t *newit) {
-
997  roaring_iterator_init_last(r, newit);
-
998 }
-
999 
- -
1009 
-
1011 CROARING_DEPRECATED static inline roaring_uint32_iterator_t *
- -
1013  return roaring_iterator_create(r);
-
1014 }
-
1015 
- + +
955  const char **reason);
+
956 
+
957 
+ +
978  const roaring_bitmap_t *parent; // Owner
+
979  const ROARING_CONTAINER_T *container; // Current container
+
980  uint8_t typecode; // Typecode of current container
+
981  int32_t container_index; // Current container index
+
982  uint32_t highbits; // High 16 bits of the current value
+
983  roaring_container_iterator_t container_it;
+
984 
+
985  uint32_t current_value;
+
986  bool has_value;
+ +
988 
+ + +
996 
+
998 CROARING_DEPRECATED static inline void roaring_init_iterator(
+
999  const roaring_bitmap_t *r, roaring_uint32_iterator_t *newit) {
+
1000  roaring_iterator_init(r, newit);
+
1001 }
+
1002 
+ +
1009  roaring_uint32_iterator_t *newit);
+
1010 
+
1012 CROARING_DEPRECATED static inline void roaring_init_iterator_last(
+
1013  const roaring_bitmap_t *r, roaring_uint32_iterator_t *newit) {
+
1014  roaring_iterator_init_last(r, newit);
+
1015 }
+
1016 
+
1026 
-
1028 CROARING_DEPRECATED static inline bool roaring_advance_uint32_iterator(
- - +
1028 CROARING_DEPRECATED static inline roaring_uint32_iterator_t *
+ +
1030  return roaring_iterator_create(r);
1031 }
1032 
- +
1043 
-
1045 CROARING_DEPRECATED static inline bool roaring_previous_uint32_iterator(
+
1045 CROARING_DEPRECATED static inline bool roaring_advance_uint32_iterator(
- +
1048 }
1049 
- -
1056  uint32_t val);
-
1057 
-
1059 CROARING_DEPRECATED static inline bool
- -
1061  uint32_t val) {
- -
1063 }
-
1064 
- -
1070  const roaring_uint32_iterator_t *it);
-
1071 
-
1073 CROARING_DEPRECATED static inline roaring_uint32_iterator_t *
- -
1075  return roaring_uint32_iterator_copy(it);
-
1076 }
-
1077 
- -
1082 
-
1084 CROARING_DEPRECATED static inline void roaring_free_uint32_iterator(
- - -
1087 }
+ +
1060 
+
1062 CROARING_DEPRECATED static inline bool roaring_previous_uint32_iterator(
+ + +
1065 }
+
1066 
+ +
1073  uint32_t val);
+
1074 
+
1076 CROARING_DEPRECATED static inline bool
+ +
1078  uint32_t val) {
+ +
1080 }
+
1081 
+ +
1087  const roaring_uint32_iterator_t *it);
1088 
-
1089 /*
-
1090  * Reads next ${count} values from iterator into user-supplied ${buf}.
-
1091  * Returns the number of read elements.
-
1092  * This number can be smaller than ${count}, which means that iterator is
-
1093  * drained.
-
1094  *
-
1095  * This function satisfies semantics of iteration and can be used together with
-
1096  * other iterator functions.
-
1097  * - first value is copied from ${it}->current_value
-
1098  * - after function returns, iterator is positioned at the next element
-
1099  */
- -
1101  uint32_t *buf, uint32_t count);
-
1102 
-
1104 CROARING_DEPRECATED static inline uint32_t roaring_read_uint32_iterator(
-
1105  roaring_uint32_iterator_t *it, uint32_t *buf, uint32_t count) {
-
1106  return roaring_uint32_iterator_read(it, buf, count);
-
1107 }
-
1108 
-
1109 #ifdef __cplusplus
-
1110 }
-
1111 }
-
1112 } // extern "C" { namespace roaring { namespace api {
-
1113 #endif
-
1114 
-
1115 #endif /* ROARING_H */
-
1116 
-
1117 #ifdef __cplusplus
-
1129 #if !defined(ROARING_API_NOT_IN_GLOBAL_NAMESPACE)
-
1130 using namespace ::roaring::api;
-
1131 #endif
-
1132 #endif
+
1090 CROARING_DEPRECATED static inline roaring_uint32_iterator_t *
+ +
1092  return roaring_uint32_iterator_copy(it);
+
1093 }
+
1094 
+ +
1099 
+
1101 CROARING_DEPRECATED static inline void roaring_free_uint32_iterator(
+ + +
1104 }
+
1105 
+
1106 /*
+
1107  * Reads next ${count} values from iterator into user-supplied ${buf}.
+
1108  * Returns the number of read elements.
+
1109  * This number can be smaller than ${count}, which means that iterator is
+
1110  * drained.
+
1111  *
+
1112  * This function satisfies semantics of iteration and can be used together with
+
1113  * other iterator functions.
+
1114  * - first value is copied from ${it}->current_value
+
1115  * - after function returns, iterator is positioned at the next element
+
1116  */
+ +
1118  uint32_t *buf, uint32_t count);
+
1119 
+
1121 CROARING_DEPRECATED static inline uint32_t roaring_read_uint32_iterator(
+
1122  roaring_uint32_iterator_t *it, uint32_t *buf, uint32_t count) {
+
1123  return roaring_uint32_iterator_read(it, buf, count);
+
1124 }
+
1125 
+
1126 #ifdef __cplusplus
+
1127 }
+
1128 }
+
1129 } // extern "C" { namespace roaring { namespace api {
+
1130 #endif
+
1131 
+
1132 #endif /* ROARING_H */
+
1133 
+
1134 #ifdef __cplusplus
+
1146 #if !defined(ROARING_API_NOT_IN_GLOBAL_NAMESPACE)
+
1147 using namespace ::roaring::api;
+
1148 #endif
+
1149 #endif
roaring_bitmap_t * roaring_bitmap_and(const roaring_bitmap_t *r1, const roaring_bitmap_t *r2)
bool roaring_bitmap_select(const roaring_bitmap_t *r, uint32_t rank, uint32_t *element)
@@ -560,11 +560,11 @@
bool roaring_iterate64(const roaring_bitmap_t *r, roaring_iterator64 iterator, uint64_t high_bits, void *ptr)
void roaring_bitmap_printf_describe(const roaring_bitmap_t *r)
bool roaring_bitmap_internal_validate(const roaring_bitmap_t *r, const char **reason)
-
static CROARING_DEPRECATED void roaring_init_iterator(const roaring_bitmap_t *r, roaring_uint32_iterator_t *newit)
Definition: roaring.h:981
+
static CROARING_DEPRECATED void roaring_init_iterator(const roaring_bitmap_t *r, roaring_uint32_iterator_t *newit)
Definition: roaring.h:998
bool roaring_bitmap_run_optimize(roaring_bitmap_t *r)
void roaring_bitmap_and_inplace(roaring_bitmap_t *r1, const roaring_bitmap_t *r2)
uint64_t roaring_bitmap_or_cardinality(const roaring_bitmap_t *r1, const roaring_bitmap_t *r2)
-
static CROARING_DEPRECATED void roaring_init_iterator_last(const roaring_bitmap_t *r, roaring_uint32_iterator_t *newit)
Definition: roaring.h:995
+
static CROARING_DEPRECATED void roaring_init_iterator_last(const roaring_bitmap_t *r, roaring_uint32_iterator_t *newit)
Definition: roaring.h:1012
roaring_bitmap_t * roaring_bitmap_lazy_xor(const roaring_bitmap_t *r1, const roaring_bitmap_t *r2)
void roaring_iterator_init(const roaring_bitmap_t *r, roaring_uint32_iterator_t *newit)
size_t roaring_bitmap_frozen_size_in_bytes(const roaring_bitmap_t *r)
@@ -578,7 +578,7 @@
bool roaring_uint32_iterator_move_equalorlarger(roaring_uint32_iterator_t *it, uint32_t val)
roaring_bitmap_t * roaring_bitmap_or(const roaring_bitmap_t *r1, const roaring_bitmap_t *r2)
double roaring_bitmap_jaccard_index(const roaring_bitmap_t *r1, const roaring_bitmap_t *r2)
-
static CROARING_DEPRECATED roaring_uint32_iterator_t * roaring_create_iterator(const roaring_bitmap_t *r)
Definition: roaring.h:1012
+
static CROARING_DEPRECATED roaring_uint32_iterator_t * roaring_create_iterator(const roaring_bitmap_t *r)
Definition: roaring.h:1029
size_t roaring_bitmap_size_in_bytes(const roaring_bitmap_t *r)
bool roaring_uint32_iterator_previous(roaring_uint32_iterator_t *it)
roaring_uint32_iterator_t * roaring_iterator_create(const roaring_bitmap_t *r)
@@ -595,7 +595,7 @@
void roaring_bitmap_lazy_or_inplace(roaring_bitmap_t *r1, const roaring_bitmap_t *r2, const bool bitsetconversion)
roaring_bitmap_t * roaring_bitmap_deserialize(const void *buf)
bool roaring_bitmap_is_empty(const roaring_bitmap_t *r)
-
static CROARING_DEPRECATED bool roaring_previous_uint32_iterator(roaring_uint32_iterator_t *it)
Definition: roaring.h:1045
+
static CROARING_DEPRECATED bool roaring_previous_uint32_iterator(roaring_uint32_iterator_t *it)
Definition: roaring.h:1062
roaring_bitmap_t * roaring_bitmap_portable_deserialize_frozen(const char *buf)
void roaring_bitmap_free(const roaring_bitmap_t *r)
void roaring_bitmap_statistics(const roaring_bitmap_t *r, roaring_statistics_t *stat)
@@ -618,19 +618,19 @@
roaring_bitmap_t * roaring_bitmap_lazy_or(const roaring_bitmap_t *r1, const roaring_bitmap_t *r2, const bool bitsetconversion)
size_t roaring_bitmap_portable_size_in_bytes(const roaring_bitmap_t *r)
bool roaring_bitmap_is_subset(const roaring_bitmap_t *r1, const roaring_bitmap_t *r2)
-
static CROARING_DEPRECATED uint32_t roaring_read_uint32_iterator(roaring_uint32_iterator_t *it, uint32_t *buf, uint32_t count)
Definition: roaring.h:1104
+
static CROARING_DEPRECATED uint32_t roaring_read_uint32_iterator(roaring_uint32_iterator_t *it, uint32_t *buf, uint32_t count)
Definition: roaring.h:1121
void roaring_bitmap_rank_many(const roaring_bitmap_t *r, const uint32_t *begin, const uint32_t *end, uint64_t *ans)
roaring_bitmap_t * roaring_bitmap_xor(const roaring_bitmap_t *r1, const roaring_bitmap_t *r2)
void roaring_bitmap_or_inplace(roaring_bitmap_t *r1, const roaring_bitmap_t *r2)
uint32_t roaring_uint32_iterator_read(roaring_uint32_iterator_t *it, uint32_t *buf, uint32_t count)
uint64_t roaring_bitmap_rank(const roaring_bitmap_t *r, uint32_t x)
void roaring_uint32_iterator_free(roaring_uint32_iterator_t *it)
-
static CROARING_DEPRECATED bool roaring_move_uint32_iterator_equalorlarger(roaring_uint32_iterator_t *it, uint32_t val)
Definition: roaring.h:1060
+
static CROARING_DEPRECATED bool roaring_move_uint32_iterator_equalorlarger(roaring_uint32_iterator_t *it, uint32_t val)
Definition: roaring.h:1077
uint32_t roaring_bitmap_maximum(const roaring_bitmap_t *r)
roaring_bitmap_t * roaring_bitmap_or_many_heap(uint32_t number, const roaring_bitmap_t **rs)
bool roaring_bitmap_init_with_capacity(roaring_bitmap_t *r, uint32_t cap)
void roaring_bitmap_add_range(roaring_bitmap_t *r, uint64_t min, uint64_t max)
Definition: roaring.h:388
-
static CROARING_DEPRECATED roaring_uint32_iterator_t * roaring_copy_uint32_iterator(const roaring_uint32_iterator_t *it)
Definition: roaring.h:1074
+
static CROARING_DEPRECATED roaring_uint32_iterator_t * roaring_copy_uint32_iterator(const roaring_uint32_iterator_t *it)
Definition: roaring.h:1091
int64_t roaring_bitmap_get_index(const roaring_bitmap_t *r, uint32_t x)
uint64_t roaring_bitmap_get_cardinality(const roaring_bitmap_t *r)
size_t roaring_bitmap_serialize(const roaring_bitmap_t *r, char *buf)
@@ -640,12 +640,12 @@
struct roaring_bulk_context_s roaring_bulk_context_t
struct roaring_uint32_iterator_s roaring_uint32_iterator_t
bool roaring_bitmap_remove_checked(roaring_bitmap_t *r, uint32_t x)
-
static CROARING_DEPRECATED bool roaring_advance_uint32_iterator(roaring_uint32_iterator_t *it)
Definition: roaring.h:1028
+
static CROARING_DEPRECATED bool roaring_advance_uint32_iterator(roaring_uint32_iterator_t *it)
Definition: roaring.h:1045
roaring_bitmap_t * roaring_bitmap_deserialize_safe(const void *buf, size_t maxbytes)
void roaring_bitmap_repair_after_lazy(roaring_bitmap_t *r1)
void roaring_bitmap_printf(const roaring_bitmap_t *r)
bool roaring_uint32_iterator_advance(roaring_uint32_iterator_t *it)
-
static CROARING_DEPRECATED void roaring_free_uint32_iterator(roaring_uint32_iterator_t *it)
Definition: roaring.h:1084
+
static CROARING_DEPRECATED void roaring_free_uint32_iterator(roaring_uint32_iterator_t *it)
Definition: roaring.h:1101
uint32_t roaring_bitmap_minimum(const roaring_bitmap_t *r)
void roaring_bitmap_add(roaring_bitmap_t *r, uint32_t x)
roaring_bitmap_t * roaring_bitmap_from_range(uint64_t min, uint64_t max, uint32_t step)
@@ -656,15 +656,15 @@
ROARING_CONTAINER_T * container
Definition: roaring.h:334
- -
const roaring_bitmap_t * parent
Definition: roaring.h:961
- -
const ROARING_CONTAINER_T * container
Definition: roaring.h:962
- - - - -
roaring_container_iterator_t container_it
Definition: roaring.h:966
+ +
const roaring_bitmap_t * parent
Definition: roaring.h:978
+ +
const ROARING_CONTAINER_T * container
Definition: roaring.h:979
+ + + + +
roaring_container_iterator_t container_it
Definition: roaring.h:983
diff --git a/index.html b/index.html index 2e7e045a..23a8e7ea 100644 --- a/index.html +++ b/index.html @@ -344,10 +344,17 @@

// we can write a bitmap to a pointer and recover it later
uint32_t expectedsize = roaring_bitmap_portable_size_in_bytes(r1);
char *serializedbytes = malloc(expectedsize);
+
// When serializing data to a file, we recommend that you also use
+
// checksums so that, at deserialization, you can be confident
+
// that you are recovering the correct data.
roaring_bitmap_portable_serialize(r1, serializedbytes);
// Note: it is expected that the input follows the specification
// https://github.com/RoaringBitmap/RoaringFormatSpec
// otherwise the result may be unusable.
+
// The 'roaring_bitmap_portable_deserialize_safe' function will not read
+
// beyond expectedsize bytes.
+
// We recommend you further use checksums to make sure that the input is from
+
// serialized data.
roaring_bitmap_t *t = roaring_bitmap_portable_deserialize_safe(serializedbytes, expectedsize);
if(t == NULL) { return EXIT_FAILURE; }
const char *reason = NULL;
@@ -362,7 +369,11 @@

roaring_bitmap_portable_deserialize_size(serializedbytes, expectedsize);
assert(sizeofbitmap ==
expectedsize); // sizeofbitmap would be zero if no bitmap were found
-
// we can also read the bitmap "safely" by specifying a byte size limit:
+
// We can also read the bitmap "safely" by specifying a byte size limit.
+
// The 'roaring_bitmap_portable_deserialize_safe' function will not read
+
// beyond expectedsize bytes.
+
// We recommend you further use checksums to make sure that the input is from
+
// serialized data.
t = roaring_bitmap_portable_deserialize_safe(serializedbytes, expectedsize);
if(t == NULL) {
printf("Problem during deserialization.\n");
@@ -449,8 +460,8 @@

bool roaring_uint32_iterator_advance(roaring_uint32_iterator_t *it)
void roaring_bitmap_add(roaring_bitmap_t *r, uint32_t x)
- - + +

Compressed 64-bit Roaring bitmaps (C)

We also support efficient 64-bit compressed bitmaps in C:

@@ -459,7 +470,8 @@

for (uint64_t i = 100; i < 1000; i++) roaring64_bitmap_add(r2, i);
printf("cardinality (64-bit) = %d\n", (int) roaring64_bitmap_get_cardinality(r2));
roaring64_bitmap_free(r2);
-

+

The API is similar to the conventional 32-bit bitmaps. Please see the header file roaring64.h (compare with roaring.h).

+

Conventional bitsets (C)

We support convention bitsets (uncompressed) as part of the library.

Simple example: