*** empty log message ***
This commit is contained in:
29
src/cmph.h
29
src/cmph.h
@@ -16,11 +16,11 @@ typedef struct __cmph_t cmph_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
void *data;
|
||||
cmph_uint32 nkeys;
|
||||
int (*read)(void *, char **, cmph_uint32 *);
|
||||
void (*dispose)(void *, char *, cmph_uint32);
|
||||
void (*rewind)(void *);
|
||||
void *data;
|
||||
cmph_uint32 nkeys;
|
||||
int (*read)(void *, char **, cmph_uint32 *);
|
||||
void (*dispose)(void *, char *, cmph_uint32);
|
||||
void (*rewind)(void *);
|
||||
} cmph_io_adapter_t;
|
||||
|
||||
/** Adapter pattern API **/
|
||||
@@ -37,18 +37,23 @@ void cmph_io_vector_adapter_destroy(cmph_io_adapter_t * key_source);
|
||||
cmph_io_adapter_t *cmph_io_byte_vector_adapter(cmph_uint8 ** vector, cmph_uint32 nkeys);
|
||||
void cmph_io_byte_vector_adapter_destroy(cmph_io_adapter_t * key_source);
|
||||
|
||||
cmph_io_adapter_t *cmph_io_struct_vector_adapter(void * vector, cmph_uint32 struct_size, cmph_uint32 key_offset, cmph_uint32 key_len, cmph_uint32 nkeys);
|
||||
cmph_io_adapter_t *cmph_io_struct_vector_adapter(void * vector,
|
||||
cmph_uint32 struct_size,
|
||||
cmph_uint32 key_offset,
|
||||
cmph_uint32 key_len,
|
||||
cmph_uint32 nkeys);
|
||||
|
||||
void cmph_io_struct_vector_adapter_destroy(cmph_io_adapter_t * key_source);
|
||||
|
||||
/** Hash configuration API **/
|
||||
cmph_config_t *cmph_config_new(cmph_io_adapter_t *key_source);
|
||||
void cmph_config_set_hashfuncs(cmph_config_t *mph, CMPH_HASH *hashfuncs);
|
||||
void cmph_config_set_verbosity(cmph_config_t *mph, cmph_uint32 verbosity);
|
||||
void cmph_config_set_graphsize(cmph_config_t *mph, float c);
|
||||
void cmph_config_set_graphsize(cmph_config_t *mph, double c);
|
||||
void cmph_config_set_algo(cmph_config_t *mph, CMPH_ALGO algo);
|
||||
void cmph_config_set_tmp_dir(cmph_config_t *mph, cmph_uint8 *tmp_dir);
|
||||
void cmph_config_set_mphf_fd(cmph_config_t *mph, FILE *mphf_fd);
|
||||
void cmph_config_set_b(cmph_config_t *mph, cmph_uint8 b);
|
||||
void cmph_config_set_b(cmph_config_t *mph, cmph_uint32 b);
|
||||
void cmph_config_set_memory_availability(cmph_config_t *mph, cmph_uint32 memory_availability);
|
||||
void cmph_config_destroy(cmph_config_t *mph);
|
||||
|
||||
@@ -65,7 +70,8 @@ cmph_t *cmph_new(cmph_config_t *mph);
|
||||
cmph_uint32 cmph_search(cmph_t *mphf, const char *key, cmph_uint32 keylen);
|
||||
|
||||
/** cmph_uint32 cmph_search_fingerprint(cmph_t *mphf, const char *key, cmph_uint32 keylen, cmph_uint32 * fingerprint);
|
||||
* \brief Computes the mphf value and a fingerprint of 12 bytes (i.e., figerprint should be a prealocated area to fit three 4-byte integers).
|
||||
* \brief Computes the mphf value and a fingerprint of 12 bytes (i.e.,
|
||||
* \brief figerprint should be a prealocated area to fit three 4-byte integers).
|
||||
* \param mphf pointer to the resulting function
|
||||
* \param key is the key to be hashed
|
||||
* \param keylen is the key legth in bytes
|
||||
@@ -89,7 +95,8 @@ cmph_t *cmph_load(FILE *f);
|
||||
/** \fn void cmph_pack(cmph_t *mphf, void *packed_mphf);
|
||||
* \brief Support the ability to pack a perfect hash function into a preallocated contiguous memory space pointed by packed_mphf.
|
||||
* \param mphf pointer to the resulting mphf
|
||||
* \param packed_mphf pointer to the contiguous memory area used to store the resulting mphf. The size of packed_mphf must be at least cmph_packed_size()
|
||||
* \param packed_mphf pointer to the contiguous memory area used to store the
|
||||
* \param resulting mphf. The size of packed_mphf must be at least cmph_packed_size()
|
||||
*/
|
||||
void cmph_pack(cmph_t *mphf, void *packed_mphf);
|
||||
|
||||
@@ -97,7 +104,7 @@ void cmph_pack(cmph_t *mphf, void *packed_mphf);
|
||||
* \brief Return the amount of space needed to pack mphf.
|
||||
* \param mphf pointer to a mphf
|
||||
* \return the size of the packed function or zero for failures
|
||||
*/
|
||||
*/
|
||||
cmph_uint32 cmph_packed_size(cmph_t *mphf);
|
||||
|
||||
/** cmph_uint32 cmph_search(void *packed_mphf, const char *key, cmph_uint32 keylen);
|
||||
|
||||
Reference in New Issue
Block a user