#include <pthread.h>
#include <stddef.h>
#include <stdint.h>
#include "citrusleaf/cf_base_types.h"
Go to the source code of this file.
Functions |
int | shash_create (shash **h, shash_hash_fn h_fn, uint32_t key_len, uint32_t value_len, uint32_t sz, unsigned int flags) |
int | shash_put (shash *h, void *key, void *value) |
int | shash_put_unique (shash *h, void *key, void *value) |
int | shash_get (shash *h, void *key, void *value) |
int | shash_get_vlock (shash *h, void *key, void **value, pthread_mutex_t **vlock) |
int | shash_get_and_delete (shash *h, void *key, void *value) |
int | shash_delete (shash *h, void *key) |
int | shash_delete_lockfree (shash *h, void *key) |
uint32_t | shash_get_size (shash *h) |
int | shash_grab (shash *h, void *key, uint32_t key_len, void **value, uint32_t *value_len) |
int | shash_return (shash *h, void *value) |
int | shash_reduce (shash *h, shash_reduce_fn reduce_fn, void *udata) |
int | shash_reduce_delete (shash *h, shash_reduce_fn reduce_fn, void *udata) |
void | shash_destroy (shash *h) |
Macro Definition Documentation
#define SHASH_CR_GRAB 0x02 |
#define SHASH_CR_MT_BIGLOCK 0x04 |
#define SHASH_CR_MT_MANYLOCK 0x08 |
#define SHASH_CR_RESIZE 0x01 |
#define SHASH_ELEM_KEY_PTR |
( |
|
_h, |
|
|
|
_e |
|
) |
| ( (void *) _e->data ) |
#define SHASH_ELEM_SZ |
( |
|
_h | ) |
( sizeof(shash_elem) + (_h->key_len) + (_h->value_len) ) |
#define SHASH_ELEM_VALUE_PTR |
( |
|
_h, |
|
|
|
_e |
|
) |
| ( (void *) (_e->data + _h->key_len) ) |
#define SHASH_ERR_BUFSZ -2 |
#define SHASH_ERR_FOUND -4 |
#define SHASH_ERR_NOTFOUND -3 |
#define SHASH_REDUCE_DELETE (1) |
Typedef Documentation
typedef uint32_t(* shash_hash_fn)(void *key) |
typedef int(* shash_reduce_fn)(void *key, void *data, void *udata) |
Function Documentation
int shash_create |
( |
shash ** |
h, |
|
|
shash_hash_fn |
h_fn, |
|
|
uint32_t |
key_len, |
|
|
uint32_t |
value_len, |
|
|
uint32_t |
sz, |
|
|
unsigned int |
flags |
|
) |
| |
int shash_delete |
( |
shash * |
h, |
|
|
void * |
key |
|
) |
| |
int shash_delete_lockfree |
( |
shash * |
h, |
|
|
void * |
key |
|
) |
| |
void shash_destroy |
( |
shash * |
h | ) |
|
int shash_get |
( |
shash * |
h, |
|
|
void * |
key, |
|
|
void * |
value |
|
) |
| |
int shash_get_and_delete |
( |
shash * |
h, |
|
|
void * |
key, |
|
|
void * |
value |
|
) |
| |
uint32_t shash_get_size |
( |
shash * |
h | ) |
|
int shash_get_vlock |
( |
shash * |
h, |
|
|
void * |
key, |
|
|
void ** |
value, |
|
|
pthread_mutex_t ** |
vlock |
|
) |
| |
int shash_grab |
( |
shash * |
h, |
|
|
void * |
key, |
|
|
uint32_t |
key_len, |
|
|
void ** |
value, |
|
|
uint32_t * |
value_len |
|
) |
| |
int shash_put |
( |
shash * |
h, |
|
|
void * |
key, |
|
|
void * |
value |
|
) |
| |
int shash_put_unique |
( |
shash * |
h, |
|
|
void * |
key, |
|
|
void * |
value |
|
) |
| |
int shash_return |
( |
shash * |
h, |
|
|
void * |
value |
|
) |
| |