1/*-------------------------------------------------------------------------
2 *
3 * bloomfilter.h
4 * Space-efficient set membership testing
5 *
6 * Copyright (c) 2018-2019, 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
16typedef struct bloom_filter bloom_filter;
17
18extern bloom_filter *bloom_create(int64 total_elems, int bloom_work_mem,
19 uint64 seed);
20extern void bloom_free(bloom_filter *filter);
21extern void bloom_add_element(bloom_filter *filter, unsigned char *elem,
22 size_t len);
23extern bool bloom_lacks_element(bloom_filter *filter, unsigned char *elem,
24 size_t len);
25extern double bloom_prop_bits_set(bloom_filter *filter);
26
27#endif /* BLOOMFILTER_H */
28