1
0
mirror of https://github.com/haiwen/ccnet-server.git synced 2025-05-01 03:53:20 +00:00
ccnet-server/lib/bloom-filter.h

24 lines
567 B
C
Raw Permalink Normal View History

2016-08-18 09:39:55 +00:00
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#ifndef __BLOOM_H__
#define __BLOOM_H__
#include <stdlib.h>
typedef struct {
size_t asize;
unsigned char *a;
size_t csize;
unsigned char *counters;
int k;
char counting:1;
} Bloom;
Bloom *bloom_create (size_t size, int k, int counting);
int bloom_destroy (Bloom *bloom);
int bloom_add (Bloom *bloom, const char *s);
int bloom_remove (Bloom *bloom, const char *s);
int bloom_test (Bloom *bloom, const char *s);
#endif