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