Update documentation.
[m6w6/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:function:: hashkit_st *hashkit_create(hashkit_st *hash);
14
15 .. c:function:: hashkit_st *hashkit_clone(hashkit_st *destination, const hashkit_st *ptr);
16
17 .. c:function:: void hashkit_free(hashkit_st *hash);
18
19 .. c:function:: bool hashkit_is_allocated(const hashkit_st *hash);
20
21 Compile and link with -lhashkit
22
23
24 -----------
25 DESCRIPTION
26 -----------
27
28
29 The 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 hashkit_clone() function initializes a hashkit object much like
35 hashkit_create(), but instead of using default settings it will use
36 the settings of the ptr hashkit object.
37
38 The hashkit_free() frees any resources being consumed by the hashkit
39 objects that were initialized with hashkit_create() or hashkit_clone().
40
41 The hashkit_is_allocated() reports where the memory was allocated
42 for a hashkit object.
43
44
45 ------------
46 RETURN VALUE
47 ------------
48
49
50 hashkit_create() and hashkit_clone() will return NULL on failure or
51 non-NULL on success.
52
53 hashkit_is_allocated() returns true if the memory for the hashkit
54 object was allocated inside of hashkit_create() or hashkit_clone(),
55 otherwise it is false and was user-supplied memory.
56
57
58 ----
59 HOME
60 ----
61
62
63 To find out more information please check:
64 `http://libmemcached.org/ <http://libmemcached.org/>`_