Merge in updates (including removal of some depcrated bits from the examples).
[m6w6/libmemcached] / docs / hashkit_create.rst
1 ============================
2 Creating a hashkit structure
3 ============================
4
5
6 Create and destroy hashkit objects
7
8
9 -------
10 LIBRARY
11 -------
12
13
14 C Library for hashing algorithms (libmemcached, -lhashkit)
15
16
17 --------
18 SYNOPSIS
19 --------
20
21
22
23 .. code-block:: perl
24
25 #include <libmemcached/hashkit.h>
26
27 hashkit_st *hashkit_create(hashkit_st *hash);
28
29 hashkit_st *hashkit_clone(hashkit_st *destination, const hashkit_st *ptr);
30
31 void hashkit_free(hashkit_st *hash);
32
33 bool hashkit_is_allocated(const hashkit_st *hash);
34
35
36
37 -----------
38 DESCRIPTION
39 -----------
40
41
42 The hashkit_create() function initializes a hashkit object for use. If
43 you pass a NULL argument for hash, then the memory for the object is
44 allocated. If you specify a pre-allocated piece of memory, that is
45 initialized for use.
46
47 The hashkit_clone() function initializes a hashkit object much like
48 hashkit_create(), but instead of using default settings it will use
49 the settings of the ptr hashkit object.
50
51 The hashkit_free() frees any resources being consumed by the hashkit
52 objects that were initialized with hashkit_create() or hashkit_clone().
53
54 The hashkit_is_allocated() reports where the memory was allocated
55 for a hashkit object.
56
57
58 ------------
59 RETURN VALUE
60 ------------
61
62
63 hashkit_create() and hashkit_clone() will return NULL on failure or
64 non-NULL on success.
65
66 hashkit_is_allocated() returns true if the memory for the hashkit
67 object was allocated inside of hashkit_create() or hashkit_clone(),
68 otherwise it is false and was user-supplied memory.
69
70
71 ----
72 HOME
73 ----
74
75
76 To find out more information please check:
77 `http://libmemcached.org/ <http://libmemcached.org/>`_