X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=docs%2Fmemcached_callback.rst;h=787bc49ad77c8d66811f532dee4745591136c033;hb=41543e45ff7aca5456c9279bc0403ecdc35f7b6e;hp=a4b4b3d3081548a430ab7583f5bf6dea496edfc0;hpb=281c398ba3a10af677494c4453cd09d85ca921e0;p=m6w6%2Flibmemcached diff --git a/docs/memcached_callback.rst b/docs/memcached_callback.rst index a4b4b3d3..787bc49a 100644 --- a/docs/memcached_callback.rst +++ b/docs/memcached_callback.rst @@ -6,9 +6,9 @@ Setting callbacks Get and set a callback -******* +------- LIBRARY -******* +------- C Client Library for memcached (libmemcached, -lmemcached) @@ -18,21 +18,11 @@ C Client Library for memcached (libmemcached, -lmemcached) SYNOPSIS -------- - - -.. code-block:: perl - - #include +#include - memcached_return_t - memcached_callback_set (memcached_st *ptr, - memcached_callback_t flag, - void *data); +.. c:function:: memcached_return_t memcached_callback_set (memcached_st *ptr, memcached_callback_t flag, void *data); - void * - memcached_callback_get (memcached_st *ptr, - memcached_callback_t flag, - memcached_return_t *error); +.. c:function:: void * memcached_callback_get (memcached_st *ptr, memcached_callback_t flag, memcached_return_t *error); @@ -55,21 +45,21 @@ You can use MEMCACHED_CALLBACK_USER_DATA to provide custom context if required f of the callbacks -MEMCACHED_CALLBACK_CLEANUP_FUNCTION +.. c:var:: MEMCACHED_CALLBACK_CLEANUP_FUNCTION When memcached_delete() is called this function will be excuted. At the point of its execution all connections have been closed. -MEMCACHED_CALLBACK_CLONE_FUNCTION +.. c:var:: MEMCACHED_CALLBACK_CLONE_FUNCTION When memcached_delete() is called this function will be excuted. At the point of its execution all connections have been closed. -MEMCACHED_CALLBACK_PREFIX_KEY +.. c:var:: MEMCACHED_CALLBACK_PREFIX_KEY You can set a value which will be used to create a domain for your keys. The value specified here will be prefixed to each of your keys. The value can not @@ -81,7 +71,7 @@ MEMCACHED_CALLBACK_PREFIX_KEY If you set a value with the value being NULL then the prefix key is disabled. -MEMCACHED_CALLBACK_USER_DATA +.. c:var:: MEMCACHED_CALLBACK_USER_DATA This allows you to store a pointer to a specifc piece of data. This can be retrieved from inside of memcached_fetch_execute(). Cloning a memcached_st @@ -89,25 +79,25 @@ MEMCACHED_CALLBACK_USER_DATA -MEMCACHED_CALLBACK_MALLOC_FUNCTION +.. c:var:: MEMCACHED_CALLBACK_MALLOC_FUNCTION DEPRECATED: use memcached_set_memory_allocators instead. -MEMCACHED_CALLBACK_REALLOC_FUNCTION +.. c:var:: MEMCACHED_CALLBACK_REALLOC_FUNCTION DEPRECATED: use memcached_set_memory_allocators instead. -MEMCACHED_CALLBACK_FREE_FUNCTION +.. c:var:: MEMCACHED_CALLBACK_FREE_FUNCTION DEPRECATED: use memcached_set_memory_allocators instead. -MEMCACHED_CALLBACK_GET_FAILURE +.. c:var:: MEMCACHED_CALLBACK_GET_FAILURE This function implements the read through cache behavior. On failure of retrieval this callback will be called. You are responsible for populating the result object provided. This result object will then be stored in the server and @@ -121,20 +111,18 @@ MEMCACHED_CALLBACK_GET_FAILURE -MEMCACHED_CALLBACK_DELETE_TRIGGER +.. c:var:: MEMCACHED_CALLBACK_DELETE_TRIGGER - This function implements a trigger upon successful deletion of a key. The memcached_st structure will need to be cloned - in order to make use of it. +This function implements a trigger upon successful deletion of a key. The memcached_st structure will need to be cloned in order to make use of it. - The prototype for this is: - typedef memcached_return_t (\*memcached_trigger_delete_key)(memcached_st \*ptr, char \*key, size_t key_length); +The prototype for this is: typedef memcached_return_t (\*memcached_trigger_delete_key)(memcached_st \*ptr, char \*key, size_t key_length); -****** +------ RETURN -****** +------ memcached_callback_get() return the function or structure that was provided. @@ -145,18 +133,18 @@ memcached_callback_set() returns MEMCACHED_SUCCESS upon successful setting, otherwise MEMCACHED_FAILURE on error. -**** +---- HOME -**** +---- To find out more information please check: -`https://launchpad.net/libmemcached `_ +`http://libmemcached.org/ `_ -****** +------ AUTHOR -****** +------ Brian Aker,