1 ============================
2 Creating a hashkit structure
3 ============================
5 .. index:: object: hashkit_st
11 #include <libhashkit/hashkit.h>
13 .. c:type:: hashkit_st
15 .. c:function:: hashkit_st *hashkit_create(hashkit_st *hash);
17 .. c:function:: hashkit_st *hashkit_clone(hashkit_st *destination, const hashkit_st *ptr);
19 .. c:function:: void hashkit_free(hashkit_st *hash);
21 .. c:function:: bool hashkit_is_allocated(const hashkit_st *hash);
23 Compile and link with -lhashkit
30 The :c:func:`hashkit_create()` function initializes a hashkit object for use. If
31 you pass a NULL argument for hash, then the memory for the object is
32 allocated. If you specify a pre-allocated piece of memory, that is
35 The :c:func:`hashkit_clone()` function initializes a hashkit object much like
36 :c:func:`hashkit_create()`, but instead of using default settings it will use
37 the settings of the ptr hashkit object.
39 The :c:func:`hashkit_free()` frees any resources being consumed by the hashkit
40 objects that were initialized with :c:func:`hashkit_create()` or :c:func:`hashkit_clone()`.
42 The :c:func:`hashkit_is_allocated()` reports where the memory was allocated
51 :c:func:`hashkit_create()` and :c:func:`hashkit_clone()` will return NULL on
52 failure or non-NULL on success.
54 :c:func:`hashkit_is_allocated()` returns true if the memory for the hashkit
55 object was allocated inside of :c:func:`hashkit_create()` or
56 :c:func:`hashkit_clone()`, otherwise it is false and was user-supplied memory.
64 To find out more information please check:
65 `http://libmemcached.org/ <http://libmemcached.org/>`_
74 :manpage:`hashkit_create(3)` :manpage:`hashkit_value(3)` :manpage:`hashkit_set_hash_fn(3)`