-
Notifications
You must be signed in to change notification settings - Fork 4
/
bloom.h
57 lines (46 loc) · 1.02 KB
/
bloom.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/**
* file name : bloom.h
* authors : Dave Pederson
* created : Jul 20, 2011
*
* modifications:
* Date: Name: Description:
* ------------ --------------- ----------------------------------------------
* Jul 20, 2011 Dave Pederson Creation
*/
#ifndef __BLOOM_H_INCLUDED__
#define __BLOOM_H_INCLUDED__
#include <stdlib.h>
/**
* Hash function pointer
*/
typedef unsigned int(*bloom_hashfunc)(const char*);
/**
* Opaque type definition
*/
typedef struct _bloom_t bloom_t;
/**
* Allocate a new bloom filter
*/
bloom_t *bloom_filter_new(size_t);
/**
* Free and allocated bloom filter
*/
int bloom_filter_free(bloom_t*);
/**
* Add a key to a bloom filter
*/
int bloom_filter_add(bloom_t*, const char*);
/**
* Check bloom filter membership
*/
int bloom_filter_contains(bloom_t*, const char*);
/**
* The number of keys in the bloom filter
*/
size_t bloom_filter_count(bloom_t*);
/**
* The size of the bloom filter
*/
size_t bloom_filter_size(bloom_t*);
#endif // __BLOOM_H_INCLUDED__