Minor
This commit is contained in:
parent
bb5c464ca1
commit
47a73e7e89
39
cdb/cdb.h
39
cdb/cdb.h
@ -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
|
|
@ -4,7 +4,7 @@ exec_prefix=@exec_prefix@
|
|||||||
libdir=@libdir@
|
libdir=@libdir@
|
||||||
includedir=@includedir@
|
includedir=@includedir@
|
||||||
|
|
||||||
Name: alsa
|
Name: cmph
|
||||||
Description: minimal perfect hashing library
|
Description: minimal perfect hashing library
|
||||||
Version: @VERSION@
|
Version: @VERSION@
|
||||||
Libs: -L${libdir} -lcmph
|
Libs: -L${libdir} -lcmph
|
||||||
|
18
src/cmph.c
18
src/cmph.c
@ -1,14 +1,14 @@
|
|||||||
#include "cmph.h"
|
#include "cmph.h"
|
||||||
#include "cmph_structs.h"
|
#include "cmph_structs.h"
|
||||||
#include "chm.h"
|
#include "chm.h"
|
||||||
#include "bmz.h" /* included -- Fabiano */
|
#include "bmz.h"
|
||||||
#include "bmz8.h" /* included -- Fabiano */
|
#include "bmz8.h"
|
||||||
#include "brz.h" /* included -- Fabiano */
|
#include "brz.h"
|
||||||
#include "fch.h" /* included -- Fabiano */
|
#include "fch.h"
|
||||||
#include "bdz.h" /* included -- Fabiano */
|
#include "bdz.h"
|
||||||
#include "bdz_ph.h" /* included -- Fabiano */
|
#include "bdz_ph.h"
|
||||||
#include "chd_ph.h" /* included -- Fabiano */
|
#include "chd_ph.h"
|
||||||
#include "chd.h" /* included -- Fabiano */
|
#include "chd.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@ -16,7 +16,7 @@
|
|||||||
//#define DEBUG
|
//#define DEBUG
|
||||||
#include "debug.h"
|
#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
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -35,7 +35,8 @@ typedef unsigned int cmph_uint32;
|
|||||||
typedef enum { CMPH_HASH_JENKINS, CMPH_HASH_COUNT } CMPH_HASH;
|
typedef enum { CMPH_HASH_JENKINS, CMPH_HASH_COUNT } CMPH_HASH;
|
||||||
extern const char *cmph_hash_names[];
|
extern const char *cmph_hash_names[];
|
||||||
typedef enum { CMPH_BMZ, CMPH_BMZ8, CMPH_CHM, CMPH_BRZ, CMPH_FCH,
|
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[];
|
extern const char *cmph_names[];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user