1 Creating a hashkit structure
2 ============================
4 Create, copy and free a hashkit structure
9 #include <libhashkit-|libhashkit_version|/hashkit.h>
10 Compile and link with -lhashkit
12 .. type:: struct hashkit_st hashkit_st
14 .. function:: hashkit_st *hashkit_create(hashkit_st *hash)
16 .. function:: hashkit_st *hashkit_clone(hashkit_st *destination, const hashkit_st *ptr)
18 .. function:: void hashkit_free(hashkit_st *hash)
20 .. function:: bool hashkit_is_allocated(const hashkit_st *hash)
25 The :func:`hashkit_create` function initializes a hashkit object for use. If
26 you pass a NULL argument for hash, then the memory for the object is
27 allocated. If you specify a pre-allocated piece of memory, that is
30 The :func:`hashkit_clone` function initializes a hashkit object much like
31 :func:`hashkit_create`, but instead of using default settings it will use
32 the settings of the ptr hashkit object.
34 The :func:`hashkit_free` frees any resources being consumed by the hashkit
35 objects that were initialized with :func:`hashkit_create` or :func:`hashkit_clone`.
37 The :func:`hashkit_is_allocated` reports where the memory was allocated
43 :func:`hashkit_create` and :func:`hashkit_clone` will return NULL on
44 failure or non-NULL on success.
46 :func:`hashkit_is_allocated` returns true if the memory for the hashkit
47 object was allocated inside of :func:`hashkit_create` or
48 :func:`hashkit_clone`, otherwise it is false and was user-supplied memory.
55 :manpage:`libhashkit(3)`
56 :manpage:`hashkit_value(3)`
57 :manpage:`hashkit_function3)`
61 * :doc:`../libhashkit`
62 * :doc:`hashkit_value`
63 * :doc:`hashkit_function`