rpm
5.4.15
|
#include "system.h"
#include <math.h>
#include <rpmiotypes.h>
#include <rpmio.h>
#include <rpmlog.h>
#include <rpmbf.h>
#include "debug.h"
#include "lookup3.c"
Go to the source code of this file.
Macros | |
#define | _RPMBF_INTERNAL |
#define | _JLU3_jlu32lpair 1 |
Functions | |
static void | rpmbfFini (void *_bf) |
static rpmbf | rpmbfGetPool (rpmioPool pool) |
rpmbf | rpmbfNew (size_t m, size_t k, unsigned flags) |
Create a Bloom filter. More... | |
int | rpmbfAdd (rpmbf bf, const void *_s, size_t ns) |
Add item to a Bloom filter. More... | |
int | rpmbfChk (rpmbf bf, const void *_s, size_t ns) |
Check for item in a Bloom filter. More... | |
int | rpmbfClr (rpmbf bf) |
Clear a Bloom filter, discarding all set memberships. More... | |
int | rpmbfDel (rpmbf bf, const void *_s, size_t ns) |
Delete item from a Bloom filter. More... | |
int | rpmbfIntersect (rpmbf a, const rpmbf b) |
Return intersection of two Bloom filters. More... | |
int | rpmbfUnion (rpmbf a, const rpmbf b) |
Return union of two Bloom filters. More... | |
void | rpmbfParams (size_t n, double e, size_t *mp, size_t *kp) |
Return optimal {m, k} for given n and e. More... | |
Variables | |
int | _rpmbf_debug = 0 |
rpmioPool | _rpmbfPool = NULL |
int rpmbfAdd | ( | rpmbf | bf, |
const void * | _s, | ||
size_t | ns | ||
) |
Add item to a Bloom filter.
bf | Bloom filter |
*_s | bytes |
ns | no. bytes (0 uses strlen) |
Definition at line 68 of file rpmbf.c.
References _rpmbf_debug.
Referenced by db3Acallback(), removePackage(), rpmfiFNBF(), rpmhkpFindKey(), rpmhkpValidate(), rpmmiPrune(), rpmtsFindBaseNamesInDB(), and rpmtsFindPubkey().
int rpmbfChk | ( | rpmbf | bf, |
const void * | _s, | ||
size_t | ns | ||
) |
Check for item in a Bloom filter.
bf | Bloom filter |
*_s | bytes |
ns | no. bytes (0 uses strlen) |
Definition at line 90 of file rpmbf.c.
References _rpmbf_debug.
Referenced by addRelation(), db3Acallback(), orgrpmAddRelation(), packagedDir(), rpmalAllFileSatisfiesDepend(), rpmhkpFindKey(), rpmhkpVerify(), rpmmiNext(), rpmtsFindBaseNamesInDB(), and rpmtsFindPubkey().
int rpmbfClr | ( | rpmbf | bf | ) |
Clear a Bloom filter, discarding all set memberships.
bf | Bloom filter |
Definition at line 115 of file rpmbf.c.
References _rpmbf_debug.
int rpmbfDel | ( | rpmbf | bf, |
const void * | _s, | ||
size_t | ns | ||
) |
Delete item from a Bloom filter.
bf | Bloom filter |
*_s | bytes |
ns | no. bytes (0 will do strlen) |
Definition at line 132 of file rpmbf.c.
References _rpmbf_debug.
|
static |
Definition at line 25 of file rpmbf.c.
Referenced by rpmbfGetPool().
Definition at line 38 of file rpmbf.c.
References _rpmbf_debug, _rpmbfPool, rpmbfFini(), rpmioGetPool(), and rpmioNewPool().
Referenced by rpmbfNew().
Return intersection of two Bloom filters.
a | Bloom filter |
b | Bloom filter |
Definition at line 156 of file rpmbf.c.
References _rpmbf_debug, and i.
rpmbf rpmbfNew | ( | size_t | m, |
size_t | k, | ||
unsigned | flags | ||
) |
Create a Bloom filter.
m | no. of bits |
k | no. of hashes |
flags | flags |
Definition at line 52 of file rpmbf.c.
References rpmbfGetPool(), and rpmbfLink().
Referenced by db3Acallback(), removePackage(), rpmfiFNBF(), rpmhkpNew(), rpmmiPrune(), and rpmtsFindBaseNamesInDB().
void rpmbfParams | ( | size_t | n, |
double | e, | ||
size_t * | mp, | ||
size_t * | kp | ||
) |
Return optimal {m, k} for given n and e.
n | population estimate |
e | probability of error |
*mp | no. of bits |
*kp | no. of hashes |
Definition at line 202 of file rpmbf.c.
References _rpmbf_debug.
Referenced by db3Acallback(), removePackage(), rpmfiFNBF(), rpmhkpNew(), rpmmiPrune(), and rpmtsFindBaseNamesInDB().
Return union of two Bloom filters.
a | Bloom filter |
b | Bloom filter |
Definition at line 179 of file rpmbf.c.
References _rpmbf_debug, and i.
int _rpmbf_debug = 0 |
Definition at line 22 of file rpmbf.c.
Referenced by rpmbfAdd(), rpmbfChk(), rpmbfClr(), rpmbfDel(), rpmbfGetPool(), rpmbfIntersect(), rpmbfParams(), and rpmbfUnion().
rpmioPool _rpmbfPool = NULL |
Definition at line 36 of file rpmbf.c.
Referenced by rpmbfGetPool(), and rpmioClean().