Merge pull request #140 from hussainnaqvee/patch-1
[awesomized/libmemcached] / source / hashkit_create.rst
1 ============================
2 Creating a hashkit structure
3 ============================
4
5 .. highlightlang:: c
6
7 .. index:: object: hashkit_st
8
9 --------
10 SYNOPSIS
11 --------
12
13 #include <libhashkit/hashkit.h>
14
15 .. c:type:: hashkit_st
16
17 .. c:function:: hashkit_st *hashkit_create(hashkit_st *hash)
18
19 .. c:function:: hashkit_st *hashkit_clone(hashkit_st *destination, const hashkit_st *ptr)
20
21 .. c:function:: void hashkit_free(hashkit_st *hash)
22
23 .. c:function:: bool hashkit_is_allocated(const hashkit_st *hash)
24
25 Compile and link with -lhashkit
26
27 -----------
28 DESCRIPTION
29 -----------
30
31
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
35 initialized for use.
36
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.
40
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`.
43
44 The :c:func:`hashkit_is_allocated` reports where the memory was allocated
45 for a hashkit object.
46
47
48 ------------
49 RETURN VALUE
50 ------------
51
52
53 :c:func:`hashkit_create` and :c:func:`hashkit_clone` will return NULL on
54 failure or non-NULL on success.
55
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.
59
60
61 ----
62 HOME
63 ----
64
65
66 To find out more information please check:
67 `http://libmemcached.org/ <http://libmemcached.org/>`_
68
69
70
71 --------
72 SEE ALSO
73 --------
74
75
76 :manpage:`hashkit_create(3)` :manpage:`hashkit_value(3)` :manpage:`hashkit_set_hash_fn(3)`
77