PostgreSQL Source Code  git master
bloomfilter.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * bloomfilter.h
4  * Space-efficient set membership testing
5  *
6  * Copyright (c) 2018-2021, PostgreSQL Global Development Group
7  *
8  * IDENTIFICATION
9  * src/include/lib/bloomfilter.h
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef BLOOMFILTER_H
14 #define BLOOMFILTER_H
15 
16 typedef struct bloom_filter bloom_filter;
17 
18 extern bloom_filter *bloom_create(int64 total_elems, int bloom_work_mem,
19  uint64 seed);
20 extern void bloom_free(bloom_filter *filter);
21 extern void bloom_add_element(bloom_filter *filter, unsigned char *elem,
22  size_t len);
23 extern bool bloom_lacks_element(bloom_filter *filter, unsigned char *elem,
24  size_t len);
25 extern double bloom_prop_bits_set(bloom_filter *filter);
26 
27 #endif /* BLOOMFILTER_H */
bool bloom_lacks_element(bloom_filter *filter, unsigned char *elem, size_t len)
Definition: bloomfilter.c:158
void bloom_add_element(bloom_filter *filter, unsigned char *elem, size_t len)
Definition: bloomfilter.c:136
uint64 seed
Definition: bloomfilter.c:48
void bloom_free(bloom_filter *filter)
Definition: bloomfilter.c:127
double bloom_prop_bits_set(bloom_filter *filter)
Definition: bloomfilter.c:188
bloom_filter * bloom_create(int64 total_elems, int bloom_work_mem, uint64 seed)
Definition: bloomfilter.c:88