1
Fork 0
This commit is contained in:
Davi Reis 2009-07-04 20:17:36 -07:00
parent bb5c464ca1
commit 47a73e7e89
4 changed files with 12 additions and 50 deletions

View File

@ -1,39 +0,0 @@
#ifndef __CMPH_CDB_H__
#define __CMPH_CDB_H__
#ifdef __cplusplus
extern "C"
{
#endif
typedef struct
{
int fd;
void *data;
} cdb;
int cdb_init(struct cdb *cdbp, int fd);
void cdb_free(struct cdb *cdbp);
int cdb_read(const struct cdb *cdbp, void *buf, cmph_uint32 len, cmph_uint32 pos);
int cdb_find(const struct cdb *cdbp, const void *key, cmph_uint32 keylen);
int cdb_read(const struct cdb *cdbp, void *buf, cmph_uint32 len, cmph_uint32 pos);
typedef struct
{
int fd;
void *data;
} cdb_make;
int cdb_make_start(struct cdb_make *cdbmp, int fd);
int cdb_make_add(struct cdb_make *cdbmp, const void *key, cmph_uint32 keylen, const void *val, cmph_uint32 vallen);
int cdb_make_exists(struct cdb_make *cdbmp, const void *key, cmph_uint32 klen);
int cdb_make_find(struct cdb_make *cdbmp, const void *key, cmph_uint32 klen, enum cdb_put_mode mode);
int cdb_make_put(struct cdb_make *cdbmp, const void *key, cmph_uint32 klen, const void *val, cmph_uint32 vlen, enum cdb_put_mode mode);
int cdb_make_finish(struct cdb_make *cdbmp);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -4,7 +4,7 @@ exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: alsa
Name: cmph
Description: minimal perfect hashing library
Version: @VERSION@
Libs: -L${libdir} -lcmph

View File

@ -1,14 +1,14 @@
#include "cmph.h"
#include "cmph_structs.h"
#include "chm.h"
#include "bmz.h" /* included -- Fabiano */
#include "bmz8.h" /* included -- Fabiano */
#include "brz.h" /* included -- Fabiano */
#include "fch.h" /* included -- Fabiano */
#include "bdz.h" /* included -- Fabiano */
#include "bdz_ph.h" /* included -- Fabiano */
#include "chd_ph.h" /* included -- Fabiano */
#include "chd.h" /* included -- Fabiano */
#include "bmz.h"
#include "bmz8.h"
#include "brz.h"
#include "fch.h"
#include "bdz.h"
#include "bdz_ph.h"
#include "chd_ph.h"
#include "chd.h"
#include <stdlib.h>
#include <assert.h>
@ -16,7 +16,7 @@
//#define DEBUG
#include "debug.h"
const char *cmph_names[] = {"bmz", "bmz8", "chm", "brz", "fch", "bdz", "bdz_ph", "chd_ph", "chd", NULL }; /* included -- Fabiano */
const char *cmph_names[] = {"bmz", "bmz8", "chm", "brz", "fch", "bdz", "bdz_ph", "chd_ph", "chd", NULL };
typedef struct
{

View File

@ -35,7 +35,8 @@ typedef unsigned int cmph_uint32;
typedef enum { CMPH_HASH_JENKINS, CMPH_HASH_COUNT } CMPH_HASH;
extern const char *cmph_hash_names[];
typedef enum { CMPH_BMZ, CMPH_BMZ8, CMPH_CHM, CMPH_BRZ, CMPH_FCH,
CMPH_BDZ, CMPH_BDZ_PH, CMPH_CHD_PH, CMPH_CHD, CMPH_COUNT } CMPH_ALGO; /* included -- Fabiano */
CMPH_BDZ, CMPH_BDZ_PH,
CMPH_CHD_PH, CMPH_CHD, CMPH_COUNT } CMPH_ALGO;
extern const char *cmph_names[];
#endif