docs: sanitize
[m6w6/libmemcached] / docs / source / hashkit_create.rst
1 Creating a hashkit structure
2 ============================
3
4 .. index:: object: hashkit_st
5
6 Create, copy and free a hashkit structure
7
8 SYNOPSIS
9 --------
10
11 #include <libhashkit-|libhashkit_version|/hashkit.h>
12 Compile and link with -lhashkit
13
14 .. c:type:: struct hashkit_st
15
16 typedef struct hashkit_st hashkit_st;
17
18 .. c:function:: hashkit_st *hashkit_create(hashkit_st *hash)
19
20 .. c:function:: hashkit_st *hashkit_clone(hashkit_st *destination, const hashkit_st *ptr)
21
22 .. c:function:: void hashkit_free(hashkit_st *hash)
23
24 .. c:function:: bool hashkit_is_allocated(const hashkit_st *hash)
25
26 DESCRIPTION
27 -----------
28
29 The :c:func:`hashkit_create` function initializes a hashkit object for use. If
30 you pass a NULL argument for hash, then the memory for the object is
31 allocated. If you specify a pre-allocated piece of memory, that is
32 initialized for use.
33
34 The :c:func:`hashkit_clone` function initializes a hashkit object much like
35 :c:func:`hashkit_create`, but instead of using default settings it will use
36 the settings of the ptr hashkit object.
37
38 The :c:func:`hashkit_free` frees any resources being consumed by the hashkit
39 objects that were initialized with :c:func:`hashkit_create` or :c:func:`hashkit_clone`.
40
41 The :c:func:`hashkit_is_allocated` reports where the memory was allocated
42 for a hashkit object.
43
44 RETURN VALUE
45 ------------
46
47 :c:func:`hashkit_create` and :c:func:`hashkit_clone` will return NULL on
48 failure or non-NULL on success.
49
50 :c:func:`hashkit_is_allocated` returns true if the memory for the hashkit
51 object was allocated inside of :c:func:`hashkit_create` or
52 :c:func:`hashkit_clone`, otherwise it is false and was user-supplied memory.
53
54 SEE ALSO
55 --------
56
57 .. only:: man
58
59 :manpage:`libhashkit(3)`
60 :manpage:`hashkit_value(3)`
61 :manpage:`hashkit_function3)`
62
63 .. only:: html
64
65 * :doc:`libhashkit`
66 * :doc:`hashkit_value`
67 * :doc:`hashkit_function`