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