KBDocs2
[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 .. c:function:: perl
26
27 .. c:function:: hashkit_st *hashkit_create(hashkit_st *hash);
28
29 .. c:function:: hashkit_st *hashkit_clone(hashkit_st *destination, const hashkit_st *ptr);
30
31 .. c:function:: void hashkit_free(hashkit_st *hash);
32
33 .. c:function:: bool hashkit_is_allocated(const hashkit_st *hash);
34
35 -----------
36 DESCRIPTION
37 -----------
38
39
40 The hashkit_create() function initializes a hashkit object for use. If
41 you pass a NULL argument for hash, then the memory for the object is
42 allocated. If you specify a pre-allocated piece of memory, that is
43 initialized for use.
44
45 The hashkit_clone() function initializes a hashkit object much like
46 hashkit_create(), but instead of using default settings it will use
47 the settings of the ptr hashkit object.
48
49 The hashkit_free() frees any resources being consumed by the hashkit
50 objects that were initialized with hashkit_create() or hashkit_clone().
51
52 The hashkit_is_allocated() reports where the memory was allocated
53 for a hashkit object.
54
55
56 ------------
57 RETURN VALUE
58 ------------
59
60
61 hashkit_create() and hashkit_clone() will return NULL on failure or
62 non-NULL on success.
63
64 hashkit_is_allocated() returns true if the memory for the hashkit
65 object was allocated inside of hashkit_create() or hashkit_clone(),
66 otherwise it is false and was user-supplied memory.
67
68
69 ----
70 HOME
71 ----
72
73
74 To find out more information please check:
75 `http://libmemcached.org/ <http://libmemcached.org/>`_