docs: sanitize
[awesomized/libmemcached] / docs / source / libhashkit / hashkit_create.rst
diff --git a/docs/source/libhashkit/hashkit_create.rst b/docs/source/libhashkit/hashkit_create.rst
new file mode 100644 (file)
index 0000000..b11f642
--- /dev/null
@@ -0,0 +1,63 @@
+Creating a hashkit structure
+============================
+
+Create, copy and free a hashkit structure
+
+SYNOPSIS
+--------
+
+#include <libhashkit-|libhashkit_version|/hashkit.h>
+  Compile and link with -lhashkit
+
+.. type:: struct hashkit_st hashkit_st
+
+.. function:: hashkit_st *hashkit_create(hashkit_st *hash)
+
+.. function:: hashkit_st *hashkit_clone(hashkit_st *destination, const hashkit_st *ptr)
+
+.. function:: void hashkit_free(hashkit_st *hash)
+
+.. function:: bool hashkit_is_allocated(const hashkit_st *hash)
+
+DESCRIPTION
+-----------
+
+The :func:`hashkit_create` function initializes a hashkit object for use. If
+you pass a NULL argument for hash, then the memory for the object is
+allocated. If you specify a pre-allocated piece of memory, that is
+initialized for use.
+
+The :func:`hashkit_clone` function initializes a hashkit object much like
+:func:`hashkit_create`, but instead of using default settings it will use
+the settings of the ptr hashkit object.
+
+The :func:`hashkit_free` frees any resources being consumed by the hashkit
+objects that were initialized with :func:`hashkit_create` or :func:`hashkit_clone`.
+
+The :func:`hashkit_is_allocated` reports where the memory was allocated 
+for a hashkit object.
+
+RETURN VALUE
+------------
+
+:func:`hashkit_create` and :func:`hashkit_clone` will return NULL on 
+failure or non-NULL on success.
+
+:func:`hashkit_is_allocated` returns true if the memory for the hashkit
+object was allocated inside of :func:`hashkit_create` or 
+:func:`hashkit_clone`, otherwise it is false and was user-supplied memory.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+    :manpage:`libhashkit(3)`
+    :manpage:`hashkit_value(3)`
+    :manpage:`hashkit_function3)`
+
+.. only:: html
+
+    * :doc:`../libhashkit`
+    * :doc:`hashkit_value`
+    * :doc:`hashkit_function`