aboutsummaryrefslogtreecommitdiff
path: root/src/util/container_bloomfilter.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/container_bloomfilter.c')
-rw-r--r--src/util/container_bloomfilter.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util/container_bloomfilter.c b/src/util/container_bloomfilter.c
index cb7984c3f..eca651862 100644
--- a/src/util/container_bloomfilter.c
+++ b/src/util/container_bloomfilter.c
@@ -149,6 +149,7 @@ setBit (char *bitArray, unsigned int bitIdx)
149 bitArray[arraySlot] |= targetBit; 149 bitArray[arraySlot] |= targetBit;
150} 150}
151 151
152
152/** 153/**
153 * Clears a bit from bitArray. Bit is cleared from the array 154 * Clears a bit from bitArray. Bit is cleared from the array
154 * only if the respective usage counter on the disk hits/is zero. 155 * only if the respective usage counter on the disk hits/is zero.
@@ -167,6 +168,7 @@ clearBit (char *bitArray, unsigned int bitIdx)
167 bitArray[slot] = bitArray[slot] & (~targetBit); 168 bitArray[slot] = bitArray[slot] & (~targetBit);
168} 169}
169 170
171
170/** 172/**
171 * Checks if a bit is active in the bitArray 173 * Checks if a bit is active in the bitArray
172 * 174 *
@@ -188,6 +190,7 @@ testBit (char *bitArray, unsigned int bitIdx)
188 return GNUNET_NO; 190 return GNUNET_NO;
189} 191}
190 192
193
191/** 194/**
192 * Sets a bit active in the bitArray and increments 195 * Sets a bit active in the bitArray and increments
193 * bit-specific usage counter on disk (but only if 196 * bit-specific usage counter on disk (but only if
@@ -238,6 +241,7 @@ incrementBit (char *bitArray,
238 GNUNET_assert (1 == GNUNET_DISK_file_write (fh, &value, 1)); 241 GNUNET_assert (1 == GNUNET_DISK_file_write (fh, &value, 1));
239} 242}
240 243
244
241/** 245/**
242 * Clears a bit from bitArray if the respective usage 246 * Clears a bit from bitArray if the respective usage
243 * counter on the disk hits/is zero. 247 * counter on the disk hits/is zero.
@@ -302,6 +306,7 @@ decrementBit (char *bitArray,
302 GNUNET_assert (1 == GNUNET_DISK_file_write (fh, &value, 1)); 306 GNUNET_assert (1 == GNUNET_DISK_file_write (fh, &value, 1));
303} 307}
304 308
309
305#define BUFFSIZE 65536 310#define BUFFSIZE 65536
306 311
307/** 312/**
@@ -342,6 +347,7 @@ make_empty_file (const struct GNUNET_DISK_FileHandle *fh, size_t size)
342 return GNUNET_OK; 347 return GNUNET_OK;
343} 348}
344 349
350
345/* ************** GNUNET_CONTAINER_BloomFilter iterator ********* */ 351/* ************** GNUNET_CONTAINER_BloomFilter iterator ********* */
346 352
347/** 353/**
@@ -474,6 +480,7 @@ testBitCallback (void *cls,
474 return GNUNET_YES; 480 return GNUNET_YES;
475} 481}
476 482
483
477/* *********************** INTERFACE **************** */ 484/* *********************** INTERFACE **************** */
478 485
479/** 486/**
@@ -796,6 +803,7 @@ GNUNET_CONTAINER_bloomfilter_or (struct GNUNET_CONTAINER_BloomFilter *bf,
796 return GNUNET_OK; 803 return GNUNET_OK;
797} 804}
798 805
806
799/** 807/**
800 * Or the entries of the given raw data array with the 808 * Or the entries of the given raw data array with the
801 * data of the given bloom filter. Assumes that 809 * data of the given bloom filter. Assumes that
@@ -854,6 +862,7 @@ GNUNET_CONTAINER_bloomfilter_remove (struct GNUNET_CONTAINER_BloomFilter *bf,
854 iterateBits (bf, &decrementBitCallback, bf, e); 862 iterateBits (bf, &decrementBitCallback, bf, e);
855} 863}
856 864
865
857/** 866/**
858 * Resize a bloom filter. Note that this operation 867 * Resize a bloom filter. Note that this operation
859 * is pretty costly. Essentially, the bloom filter 868 * is pretty costly. Essentially, the bloom filter
@@ -889,4 +898,5 @@ GNUNET_CONTAINER_bloomfilter_resize (struct GNUNET_CONTAINER_BloomFilter *bf,
889 GNUNET_CONTAINER_bloomfilter_add (bf, &hc); 898 GNUNET_CONTAINER_bloomfilter_add (bf, &hc);
890} 899}
891 900
901
892/* end of container_bloomfilter.c */ 902/* end of container_bloomfilter.c */