X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=docs%2Fhashkit_create.rst;h=8935b2d096f9d1c8eaca73bc58117604e0542ab8;hb=dc9533f1e17289d98c9fc7e5bb953774f625c033;hp=4fa5974600ae5c03c34d107744395ab79ee971d3;hpb=49fc1e5ea4ea006f4a2ac71428833760f6fac030;p=m6w6%2Flibmemcached diff --git a/docs/hashkit_create.rst b/docs/hashkit_create.rst index 4fa59746..8935b2d0 100644 --- a/docs/hashkit_create.rst +++ b/docs/hashkit_create.rst @@ -1,90 +1,65 @@ -.. highlight:: perl +============================ +Creating a hashkit structure +============================ +.. index:: object: hashkit_st -**** -NAME -**** - - -hashkit_create, hashkit_clone, hashkit_free, hashkit_is_allocated - -Create and destroy hashkit objects - - -******* -LIBRARY -******* - - -C Library for hashing algorithms (libhashkit, -lhashkit) - - -******** +-------- SYNOPSIS -******** - - +-------- -.. code-block:: perl - - #include - - hashkit_st *hashkit_create(hashkit_st *hash); - - hashkit_st *hashkit_clone(hashkit_st *destination, const hashkit_st *ptr); +#include - void hashkit_free(hashkit_st *hash); +.. c:type:: hashkit_st + +.. c:function:: hashkit_st *hashkit_create(hashkit_st *hash); - bool hashkit_is_allocated(const hashkit_st *hash); +.. c:function:: hashkit_st *hashkit_clone(hashkit_st *destination, const hashkit_st *ptr); + +.. c:function:: void hashkit_free(hashkit_st *hash); +.. c:function:: bool hashkit_is_allocated(const hashkit_st *hash); +Compile and link with -lhashkit -*********** +----------- DESCRIPTION -*********** +----------- -The hashkit_create() function initializes a hashkit object for use. If +The :c: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 hashkit_clone() function initializes a hashkit object much like -hashkit_create(), but instead of using default settings it will use +The :c:func:`hashkit_clone()` function initializes a hashkit object much like +:c:func:`hashkit_create()`, but instead of using default settings it will use the settings of the ptr hashkit object. -The hashkit_free() frees any resources being consumed by the hashkit -objects that were initialized with hashkit_create() or hashkit_clone(). +The :c:func:`hashkit_free()` frees any resources being consumed by the hashkit +objects that were initialized with :c:func:`hashkit_create()` or :c:func:`hashkit_clone()`. -The hashkit_is_allocated() reports where the memory was allocated +The :c:func:`hashkit_is_allocated()` reports where the memory was allocated for a hashkit object. -************ +------------ RETURN VALUE -************ +------------ -hashkit_create() and hashkit_clone() will return NULL on failure or +:c:func:`hashkit_create()` and :c:func:`hashkit_clone()` will return NULL on failure or non-NULL on success. -hashkit_is_allocated() returns true if the memory for the hashkit -object was allocated inside of hashkit_create() or hashkit_clone(), +:c:func:`hashkit_is_allocated()` returns true if the memory for the hashkit +object was allocated inside of :c:func:`hashkit_create()` or :c:func:`hashkit_clone()`, otherwise it is false and was user-supplied memory. -**** +---- HOME -**** +---- To find out more information please check: -`https://launchpad.net/libmemcached `_ - - -****** -AUTHOR -****** - - -Brian Aker, - +`http://libmemcached.org/ `_