Merge in additional documentation.
[m6w6/libmemcached] / docs / hashkit_create.rst
1 ============================
2 Creating a hashkit structure
3 ============================
4
5
6 --------
7 SYNOPSIS
8 --------
9
10 C Library for hashing algorithms (libmemcached, -lhashkit)
11
12
13 #include <libhashkit/hashkit.h>
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 -lmemcached
24
25
26 -----------
27 DESCRIPTION
28 -----------
29
30
31 The hashkit_create() function initializes a hashkit object for use. If
32 you pass a NULL argument for hash, then the memory for the object is
33 allocated. If you specify a pre-allocated piece of memory, that is
34 initialized for use.
35
36 The hashkit_clone() function initializes a hashkit object much like
37 hashkit_create(), but instead of using default settings it will use
38 the settings of the ptr hashkit object.
39
40 The hashkit_free() frees any resources being consumed by the hashkit
41 objects that were initialized with hashkit_create() or hashkit_clone().
42
43 The hashkit_is_allocated() reports where the memory was allocated
44 for a hashkit object.
45
46
47 ------------
48 RETURN VALUE
49 ------------
50
51
52 hashkit_create() and hashkit_clone() will return NULL on failure or
53 non-NULL on success.
54
55 hashkit_is_allocated() returns true if the memory for the hashkit
56 object was allocated inside of hashkit_create() or hashkit_clone(),
57 otherwise it is false and was user-supplied memory.
58
59
60 ----
61 HOME
62 ----
63
64
65 To find out more information please check:
66 `http://libmemcached.org/ <http://libmemcached.org/>`_