3 * Copyright (C) 2009 Brian Aker
6 * Use and distribution licensed under the BSD license. See
7 * the COPYING file in the parent directory for full text.
12 * @brief HashKit Header
15 #ifndef HASHKIT_TYPES_H
16 #define HASHKIT_TYPES_H
23 * @addtogroup hashkit_types Types
31 HASHKIT_MEMORY_ALLOCATION_FAILURE
,
32 HASHKIT_MAXIMUM_RETURN
/* Always add new error code before */
36 @todo hashkit_options_t is for future use, currently we do not define any user options.
46 /* We use the following for internal book keeping. */
47 bool is_initialized
:1;
52 HASHKIT_HASH_DEFAULT
= 0,
56 HASHKIT_HASH_FNV1A_64
,
58 HASHKIT_HASH_FNV1A_32
,
63 } hashkit_hash_algorithm_t
;
66 * Hash distributions that are available to use.
70 HASHKIT_DISTRIBUTION_MODULA
,
71 HASHKIT_DISTRIBUTION_RANDOM
,
72 HASHKIT_DISTRIBUTION_KETAMA
,
73 HASHKIT_DISTRIBUTION_MAX
/* Always add new values before this. */
74 } hashkit_distribution_t
;
77 typedef struct hashkit_st hashkit_st
;
78 typedef struct hashkit_continuum_point_st hashkit_continuum_point_st
;
79 typedef bool (hashkit_active_fn
)(void *context
);
80 typedef uint32_t (hashkit_fn
)(const char *key
, size_t key_length
);
81 typedef size_t (hashkit_key_fn
)(char *key
, size_t key_length
, uint32_t point_index
, void *context
);
82 typedef void (hashkit_sort_fn
)(void *context
, size_t count
);
83 typedef uint32_t (hashkit_weight_fn
)(void *context
);
92 #endif /* HASHKIT_TYPES_H */