From: Kent Date: Sun, 19 Jun 2011 02:44:48 +0000 (-0700) Subject: KBDocs3 X-Git-Tag: 0.51~3^2~6^2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=16ba6539e831e2abcef9dcf56fa26e3a0d5c7f91;p=m6w6%2Flibmemcached KBDocs3 --- diff --git a/docs/libhashkit.rst b/docs/libhashkit.rst index 5f31f69b..d13b8757 100644 --- a/docs/libhashkit.rst +++ b/docs/libhashkit.rst @@ -15,8 +15,7 @@ Introducing libhashkit DESCRIPTION ----------- - -\ **libhashkit**\ is a small and thread-safe client library that provides a collection of useful hashing algorithm. libhashkit is distributed with libmemcached. +:program:'libhashkit' is a small and thread-safe client library that provides a collection of useful hashing algorithm. libhashkit is distributed with libmemcached. ---- diff --git a/docs/libmemcached.rst b/docs/libmemcached.rst index c63f34ac..78af3e32 100644 --- a/docs/libmemcached.rst +++ b/docs/libmemcached.rst @@ -43,13 +43,13 @@ a modular and consistent method of object distribution. There are multiple implemented routing and hashing methods. See the memcached_behavior_set() manpage for more information. -All operations are performed against a \ ``memcached_st``\ structure. +All operations are performed against a :c:type:`memcached_st` structure. These structures can either be dynamically allocated or statically allocated and then initialized by memcached_create(). Functions have been -written in order to encapsulate the \ ``memcached_st``\ . It is not +written in order to encapsulate the :c:type:`memcached_st` . It is not recommended that you operate directly against the structure. -Nearly all functions return a \ ``memcached_return_t``\ value. +Nearly all functions return a :c:type:`memcached_return_t`\ value. This value can be translated to a printable string with memcached_strerror(3). Objects are stored on servers by hashing keys. The hash value maps the key to a particular server. All clients understand how this hashing works, so it is possibly to reliably both push data to a server and retrieve data from a server. @@ -58,7 +58,7 @@ Group keys can be optionally used to group sets of objects with servers. Namespaces are supported, and can be used to partition caches so that multiple applications can use the same memcached servers. -\ ``memcached_st``\ structures are thread-safe, but each thread must +:c:type:`memcached_st` structures are thread-safe, but each thread must contain its own structure (that is, if you want to share these among threads you must provide your own locking). No global variables are used in this library. @@ -131,9 +131,9 @@ THREADS AND PROCESSES When using threads or forked processes it is important to keep one instance -of \ ``memcached_st``\ per process or thread. Without creating your own locking -structures you can not share a single \ ``memcached_st``\ . However, you can call -memcached_quit(3) on a \ ``memcached_st``\ and then use the resulting cloned +of :c:type:`memcached_st` per process or thread. Without creating your own locking +structures you can not share a single :c:type:`memcached_st`. However, you can call +memcached_quit(3) on a :c:type:`memcached_st` and then use the resulting cloned structure. diff --git a/docs/memaslap.rst b/docs/memaslap.rst index 02e2ab26..845d613f 100644 --- a/docs/memaslap.rst +++ b/docs/memaslap.rst @@ -18,10 +18,10 @@ DESCRIPTION ----------- -\ **memaslap**\ is a load generation and benchmark tool for memcached(1) -servers. It generates configurable workload such as threads, concurrencies, connections, -run time, overwrite, miss rate, key size, value size, get/set proportion, -expected throughput, and so on. Furthermore, it also testss data +.. c:func:: memaslap + +is a load generation and benchmark tool for memcached(1) +servers. It generates configurable workload such as threads, concurrencies, connections, run time, overwrite, miss rate, key size, value size, get/set proportion, expected throughput, and so on. Furthermore, it also testss data verification, expire-time verification, UDP, binary protocol, facebook test, replication test, multi-get and reconnection, etc. @@ -31,8 +31,8 @@ the threads don't communicate with each other, and there are several socket connections in each thread. Each connection keeps key size distribution, value size distribution, and command distribution by itself. -You can specify servers via the \ **--servers**\ option or via the -environment variable \ ``MEMCACHED_SERVERS``\ . +You can specify servers via the :option:`--servers` option or via the +environment variable :envvar:`MEMCACHED_SERVERS`. -------- diff --git a/docs/memcached_behavior.rst b/docs/memcached_behavior.rst index 0a8314d9..f7acb297 100644 --- a/docs/memcached_behavior.rst +++ b/docs/memcached_behavior.rst @@ -26,19 +26,17 @@ Compile and link with -lmemcached DESCRIPTION ----------- -:manpage:`libmemcached(3)` behavior can be modified by use memcached_behavior_set(). -Default behavior is the library strives to be quick and accurate. Some -behavior, while being faster, can also result in not entirely accurate -behavior (for instance, memcached_set() will always respond with -\ ``MEMCACHED_SUCCESS``\ ). +:manpage:`libmemcached(3)` behavior can be modified by using :c:func:`memcached_behavior_set()`. Default behavior is the library strives to be quick and +accurate. Some behavior, while being faster, can also result in not entirely +accurate behavior (for instance, :c:func:`memcached_set()` will always respond +with :c:type:`MEMCACHED_SUCCESS`). -memcached_behavior_get() takes a behavior flag and returns whether or not -that behavior is currently enabled in the client. +:c:func:`memcached_behavior_get()` takes a behavior flag and returns whether or not that behavior is currently enabled in the client. -memcached_behavior_set() changes the value of a particular option of the -client. It takes both a flag (listed below) and a value. For simple on or -off options you just need to pass in a value of 1. Calls to -memcached_behavior_set() will flush and reset all connections. +:c:func:`memcached_behavior_set()` changes the value of a particular option +of the client. It takes both a flag (listed below) and a value. For simple +on or off options you just need to pass in a value of 1. Calls to +:c:func:`memcached_behavior_set()` will flush and reset all connections. .. c:var:: MEMCACHED_BEHAVIOR_USE_UDP @@ -46,27 +44,24 @@ memcached_behavior_set() will flush and reset all connections. Causes :manpage:`libmemcached(3)` to use the UDP transport when communicating with a memcached server. Not all I/O operations are testsed when this behavior is enababled. The following operations will return -\ ``MEMCACHED_NOT_SUPPORTED``\ when executed with the MEMCACHED_BEHAVIOR_USE_UDP -enabled: memcached_version(), memcached_stat(), memcached_get(), -memcached_get_by_key(), memcached_mget(), memcached_mget_by_key(), -memcached_fetch(), memcached_fetch_result(), memcached_value_fetch(). +:c:type:`MEMCACHED_NOT_SUPPORTED` when executed with the :c:type:`MEMCACHED_BEHAVIOR_USE_UDP` enabled: :c:func:`memcached_version()`, :c:func:`memcached_stat()`, :c:func:`memcached_get()`, :c:func:`memcached_get_by_key()`, :c:func:`memcached_mget()`, :c:func:`memcached_mget_by_key()`, :c:func:`memcached_fetch()`, :c:func:`memcached_fetch_result()`, :c:func:`memcached_value_fetch()`. All other operations are testsed but are executed in a 'fire-and-forget' mode, in which once the client has executed the operation, no attempt will be made to ensure the operation has been received and acted on by the server. -:manpage:`libmemcached(3)` does not allow TCP and UDP servers to be shared within -the same libmemached(3) client 'instance'. An attempt to add a TCP server -when this behavior is enabled will result in a \ ``MEMCACHED_INVALID_HOST_PROTOCOL``\ , -as will attempting to add a UDP server when this behavior has not been enabled. +:manpage:`libmemcached(3)` does not allow TCP and UDP servers to be shared +within the same libmemached(3) client 'instance'. An attempt to add a TCP +server when this behavior is enabled will result in a :c:type:`MEMCACHED_INVALID_HOST_PROTOCOL`, as will attempting to add a UDP server when this behavior has +not been enabled. .. c:var:: MEMCACHED_BEHAVIOR_NO_BLOCK -Causes :manpage:`libmemcached(3)` to use asychronous IO. This is the fastest transport -available for storage functions. +Causes :manpage:`libmemcached(3)` to use asychronous IO. This is the fastest +transport available for storage functions. .. c:var:: MEMCACHED_BEHAVIOR_SND_TIMEOUT @@ -91,11 +86,12 @@ environments). .. c:var:: MEMCACHED_BEHAVIOR_HASH -Makes the default hashing algorithm for keys use MD5. The value can be set to either MEMCACHED_HASH_DEFAULT, MEMCACHED_HASH_MD5, MEMCACHED_HASH_CRC, MEMCACHED_HASH_FNV1_64, MEMCACHED_HASH_FNV1A_64, MEMCACHED_HASH_FNV1_32, MEMCACHED_HASH_FNV1A_32, MEMCACHED_HASH_JENKINS, MEMCACHED_HASH_HSIEH, and MEMCACHED_HASH_MURMUR. +Makes the default hashing algorithm for keys use MD5. The value can be set to either :c:type:`MEMCACHED_HASH_DEFAULT`, :c:type:`MEMCACHED_HASH_MD5`, :c:type:`MEMCACHED_HASH_CRC`, :c:type:`MEMCACHED_HASH_FNV1_64`, :c:type:`MEMCACHED_HASH_FNV1A_64`, :c:type:`MEMCACHED_HASH_FNV1_32`, :c:type:`MEMCACHED_HASH_FNV1A_32`, :c:type:`MEMCACHED_HASH_JENKINS`, :c:type:`MEMCACHED_HASH_HSIEH`, and :c:type:`MEMCACHED_HASH_MURMUR`. -Each hash has it's advantages and it's weaknesses. If you don't know or don't care, just go with the default. +Each hash has it's advantages and it's weaknesses. If you don't know or don't +care, just go with the default. -Support for MEMCACHED_HASH_HSIEH is a compile time option that is disabled by default. To enable tests for this hashing algorithm, configure and build libmemcached with the --enable-hash_hsieh. +Support for :c:type:`MEMCACHED_HASH_HSIEH` is a compile time option that is disabled by default. To enable tests for this hashing algorithm, configure and build libmemcached with the --enable-hash_hsieh. diff --git a/docs/memcached_callback.rst b/docs/memcached_callback.rst index bec57f81..3cdd5adb 100644 --- a/docs/memcached_callback.rst +++ b/docs/memcached_callback.rst @@ -30,34 +30,40 @@ libmemcached(3) can have callbacks set key execution points. These either provide function calls at points in the code, or return pointers to structures for particular usages. -memcached_callback_get() takes a callback flag and returns the structure or -function set by memcached_callback_set(). +:c:func:`memcached_callback_get()` takes a callback flag and returns the +structure or function set by :c:func:`memcached_callback_set()`. -memcached_callback_set() changes the function/structure assigned by a +:c:func:`memcached_callback_set()` changes the function/structure assigned by a callback flag. No connections are reset. -You can use MEMCACHED_CALLBACK_USER_DATA to provide custom context if required for any of the callbacks. +You can use :c:type:`MEMCACHED_CALLBACK_USER_DATA` to provide custom context +if required for any of the callbacks. .. c:var:: MEMCACHED_CALLBACK_CLEANUP_FUNCTION -When memcached_delete() is called this function will be excuted. At the point of its execution all connections are closed. +When :c:func:`memcached_delete()` is called this function will be excuted. At +the point of its execution all connections are closed. .. c:var:: MEMCACHED_CALLBACK_CLONE_FUNCTION -When memcached_delete() is called this function will be excuted. At the -point of its execution all connections are closed. +When :c:func:`memcached_delete()` is called this function will be excuted. +At the point of its execution all connections are closed. .. 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 be greater then MEMCACHED_PREFIX_KEY_MAX_SIZE - 1 and will reduce MEMCACHED_MAX_KEY by the value of your key. +The value specified here will be prefixed to each of your keys. The value can +not be greater then :c:type:`MEMCACHED_PREFIX_KEY_MAX_SIZE - 1` and will +reduce :c:type:`MEMCACHED_MAX_KEY` by the value of your key. -The prefix key is only applied to the primary key, not the master key. MEMCACHED_FAILURE will be returned if no key is set. In the case of a key which is too long, MEMCACHED_BAD_KEY_PROVIDED will be returned. +The prefix key is only applied to the primary key, not the master key. +:c:type:`MEMCACHED_FAILURE` will be returned if no key is set. In the case of +a key which is too long, :c:type:`MEMCACHED_BAD_KEY_PROVIDED` will be returned. If you set a value with the value being NULL then the prefix key is disabled. @@ -65,26 +71,26 @@ If you set a value with the value being NULL then the prefix key is disabled. .. 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 -will copy the pointer to the clone. +retrieved from inside of :c:func:`memcached_fetch_execute()`. Cloning a +:c:type:`memcached_st` will copy the pointer to the clone. .. c:var:: MEMCACHED_CALLBACK_MALLOC_FUNCTION -DEPRECATED: use memcached_set_memory_allocators instead. +DEPRECATED: use :c:type:`memcached_set_memory_allocators` instead. .. c:var:: MEMCACHED_CALLBACK_REALLOC_FUNCTION -DEPRECATED: use memcached_set_memory_allocators instead. +DEPRECATED: use :c:type:`memcached_set_memory_allocators` instead. .. c:var:: MEMCACHED_CALLBACK_FREE_FUNCTION -DEPRECATED: use memcached_set_memory_allocators instead. +DEPRECATED: use :c:type:`memcached_set_memory_allocators` instead. @@ -94,13 +100,16 @@ This function implements the read through cache behavior. On failure of retrieva You are responsible for populating the result object provided. This result object will then be stored in the server and returned to the calling process. -You must clone the memcached_st in order to +You must clone the :c:type:`memcached_st` in order to make use of it. The value will be stored only if you return -MEMCACHED_SUCCESS or MEMCACHED_BUFFERED. Returning MEMCACHED_BUFFERED will -cause the object to be buffered and not sent immediatly (if this is the default behavior based on your connection setup this will happen automatically). +:c:type:`MEMCACHED_SUCCESS` or :c:type:`MEMCACHED_BUFFERED`. Returning +:c:type:`MEMCACHED_BUFFERED` will cause the object to be buffered and not sent +immediatly (if this is the default behavior based on your connection setup +this will happen automatically). The prototype for this is: -memcached_return_t (\*memcached_trigger_key)(memcached_st \*ptr, char \*key, size_t key_length, memcached_result_st \*result); + +.. c:function:: memcached_return_t (\*memcached_trigger_key)(memcached_st \*ptr, char \*key, size_t key_length, memcached_result_st \*result); @@ -108,7 +117,9 @@ memcached_return_t (\*memcached_trigger_key)(memcached_st \*ptr, char \*key, siz 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: + +.. c:function:: typedef memcached_return_t (\*memcached_trigger_delete_key)(memcached_st \*ptr, char \*key, size_t key_length); @@ -118,12 +129,12 @@ RETURN ------ -memcached_callback_get() return the function or structure that was provided. -Upon error, nothing is set, null is returned, and the memcached_return_t -argument is set to MEMCACHED_FAILURE. +:c:func:`memcached_callback_get()` return the function or structure that was +provided. Upon error, nothing is set, null is returned, and the +:c:type:`memcached_return_t` argument is set to :c:type:`MEMCACHED_FAILURE`. -memcached_callback_set() returns MEMCACHED_SUCCESS upon successful setting, -otherwise MEMCACHED_FAILURE on error. +:c:func:`memcached_callback_set()` returns :c:type:`MEMCACHED_SUCCESS` upon +successful setting, otherwise :c:type:`MEMCACHED_FAILURE` on error. ---- diff --git a/docs/memcached_cas.rst b/docs/memcached_cas.rst index 9d2188a6..7ba33411 100644 --- a/docs/memcached_cas.rst +++ b/docs/memcached_cas.rst @@ -23,33 +23,30 @@ Compile and link with -lmemcached DESCRIPTION ----------- -memcached_cas() overwrites data in the server as long as the "cas" value is -still the same in the server. You can get the cas value of a result by -calling memcached_result_cas() on a memcached_result_st(3) structure. At the point -that this note was written cas is still buggy in memached. Turning on tests -for it in libmemcached(3) is optional. Please see memcached_set() for -information on how to do this. - -memcached_cas_by_key() method behaves in a similar method as the non key -methods. The difference is that it uses the group_key parameter to map -objects to particular servers. - -memcached_cas() is testsed with the \ ``MEMCACHED_BEHAVIOR_USE_UDP``\ -behavior enabled. However, when using these operations with this behavior on, there -are limits to the size of the payload being sent to the server. The reason for -these limits is that the Memcached Server does not allow multi-datagram requests -and the current server implementation sets a datagram size to 1400 bytes. Due -to protocol overhead, the actual limit of the user supplied data is less than -1400 bytes and depends on the protocol in use as, well as the operation being -executed. When running with the binary protocol, \ `` MEMCACHED_BEHAVIOR_BINARY_PROTOCOL``\ , -the size of the key,value, flags and expiry combined may not exceed 1368 bytes. -When running with the ASCII protocol, the exact limit fluctuates depending on -which function is being executed and whether the function is a cas operation -or not. For non-cas ASCII set operations, there are at least 1335 bytes available -to split among the key, key_prefix, and value; for cas ASCII operations there are -at least 1318 bytes available to split among the key, key_prefix and value. If the -total size of the command, including overhead, exceeds 1400 bytes, a \ ``MEMCACHED_WRITE_FAILURE``\ -will be returned. +:cfunc:`memcached_cas()` overwrites data in the server as long as the "cas" +value is still the same in the server. You can get the cas value of a result +by calling :c:func:`memcached_result_cas()` on a memcached_result_st(3) +structure. At the point that this note was written cas is still buggy in memached. Turning on tests for it in libmemcached(3) is optional. Please see +:c:func:`memcached_set()` for information on how to do this. + +:c:func:`memcached_cas_by_key()` method behaves in a similar method as the non +key methods. The difference is that it uses the :c:type:`group_key` parameter +to map objects to particular servers. + +:c:func:`memcached_cas()` is testsed with the :c:type:`MEMCACHED_BEHAVIOR_USE_UDP` behavior enabled. However, when using these operations with this behavior +on, there are limits to the size of the payload being sent to the server. The +reason for these limits is that the Memcached Server does not allow +multi-datagram requests and the current server implementation sets a datagram +size to 1400 bytes. Due to protocol overhead, the actual limit of the user +supplied data is less than 1400 bytes and depends on the protocol in use as, +well as the operation being executed. When running with the binary protocol, +:c:type:`MEMCACHED_BEHAVIOR_BINARY_PROTOCOL`, the size of the key,value, +flags and expiry combined may not exceed 1368 bytes. When running with the +ASCII protocol, the exact limit fluctuates depending on which function is +being executed and whether the function is a cas operation or not. For +non-cas ASCII set operations, there are at least 1335 bytes available to +split among the key, key_prefix, and value; for cas ASCII operations there +are at least 1318 bytes available to split among the key, key_prefix and value. If the total size of the command, including overhead, exceeds 1400 bytes, a :c:type:`MEMCACHED_WRITE_FAILURE` will be returned. ------ @@ -57,9 +54,10 @@ RETURN ------ -All methods return a value of type \ ``memcached_return_t``\ . -On success the value will be \ ``MEMCACHED_SUCCESS``\ . -Use memcached_strerror() to translate this value to a printable string. +All methods return a value of type :c:type:`memcached_return_t`. +On success the value will be :c:type:`MEMCACHED_SUCCESS`. +Use :c:func:`memcached_strerror()` to translate this value to a printable +string. ---- @@ -76,5 +74,5 @@ SEE ALSO -------- -memcached(1) libmemached(3) memcached_strerror(3) memcached_set(3) memcached_append(3) memcached_add(3) memcached_prepend(3) memcached_replace(3) +:manpage:`memcached(1)` :manpage:`libmemached(3)` :manpage:`memcached_strerror(3)` :manpage:`memcached_set(3)` :manpage:`memcached_append(3)` :manpage:`memcached_add(3)` :manpage:`memcached_prepend(3)` :manpage:`memcached_replace(3)` diff --git a/docs/memcached_create.rst b/docs/memcached_create.rst index 12bf92c5..782b1a06 100644 --- a/docs/memcached_create.rst +++ b/docs/memcached_create.rst @@ -25,25 +25,30 @@ Compile and link with -lmemcached DESCRIPTION ----------- -memcached_create() is used to create a \ ``memcached_st``\ structure that will then -be used by other libmemcached(3) functions to communicate with the server. You -should either pass a statically declared \ ``memcached_st``\ to memcached_create() or +:c:func:`memcached_create()` is used to create a :c:type:`memcached_st` +structure that will then be used by other libmemcached(3) functions to +communicate with the server. You should either pass a statically declared +:c:type:`memcached_st` to :c:func:`memcached_create()` or a NULL. If a NULL passed in then a structure is allocated for you. -Please note, when you write new application use memcached_create_with_options() over memcached_create(). +Please note, when you write new application use +:c:func:`memcached_create_with_options()` over +:c:func:`memcached_create()`. -memcached_clone() is similar to memcached_create(3) but it copies the -defaults and list of servers from the source \ ``memcached_st``\ . If you pass a null as -the argument for the source to clone, it is the same as a call to memcached_create(). -If the destination argument is NULL a \ ``memcached_st``\ will be allocated for you. +:c:func:`memcached_clone()` is similar to :c:func:`memcached_create()` but +it copies the defaults and list of servers from the source +:c:type:`memcached_st`. If you pass a null as the argument for the source +to clone, it is the same as a call to :c:func:`memcached_create()`. +If the destination argument is NULL a :c:type:`memcached_st` will be allocated +for you. -memcached_servers_reset() allows you to zero out the list of servers that -the memcached_st has. +:c:func:`memcached_servers_reset()` allows you to zero out the list of +servers that the :c:type:`memcached_st` has. -To clean up memory associated with a \ ``memcached_st``\ structure you should pass -it to memcached_free() when you are finished using it. memcached_free() is -the only way to make sure all memory is deallocated when you finish using -the structure. +To clean up memory associated with a :c:type:`memcached_st` structure you +should pass it to :c:func:`memcached_free()` when you are finished using it. +:c:func:`memcached_free()` is the only way to make sure all memory is +deallocated when you finish using the structure. You may wish to avoid using memcached_create(3) or memcached_clone(3) with a stack based allocation. The most common issues related to ABI safety involve @@ -55,11 +60,11 @@ RETURN ------ -memcached_create() returns a pointer to the memcached_st that was created -(or initialized). On an allocation failure, it returns NULL. +:c:func:`memcached_create()` returns a pointer to the :c:type:`memcached_st` +that was created (or initialized). On an allocation failure, it returns NULL. -memcached_clone() returns a pointer to the memcached_st that was created -(or initialized). On an allocation failure, it returns NULL. +:c:func:`memcached_clone()` returns a pointer to the :c:type:`memcached_st` +that was created (or initialized). On an allocation failure, it returns NULL. ---- diff --git a/docs/memcached_delete.rst b/docs/memcached_delete.rst index 5c373b08..acea40fa 100644 --- a/docs/memcached_delete.rst +++ b/docs/memcached_delete.rst @@ -22,9 +22,9 @@ DESCRIPTION ----------- -memcached_delete() is used to delete a particular key. -memcached_delete_by_key() works the same, but it takes a master key to -find the given value. +:c:func:`memcached_delete()` is used to delete a particular key. +:c:func:`memcached_delete_by_key()` works the same, but it takes a master key +to find the given value. Expiration works by placing the item into a delete queue, which means that it won't be possible to retrieve it by the "get" command. The "add" and @@ -40,9 +40,10 @@ RETURN ------ -A value of type \ ``memcached_return_t``\ is returned -On success that value will be \ ``MEMCACHED_SUCCESS``\ . -Use memcached_strerror() to translate this value to a printable string. +A value of type :c:type:`memcached_return_t` is returned +On success that value will be :c:type:`MEMCACHED_SUCCESS`. +Use :c:func:`memcached_strerror()` to translate this value to a printable +string. If you are using the non-blocking mode of the library, success only means that the message was queued for delivery. diff --git a/docs/memcached_dump.rst b/docs/memcached_dump.rst index 08c21c46..3ef1c43c 100644 --- a/docs/memcached_dump.rst +++ b/docs/memcached_dump.rst @@ -28,9 +28,9 @@ DESCRIPTION ----------- -memcached_dump() is used to get a list of keys found in memcached(1) servers. -Because memcached(1) does not guarentee to dump all keys you can not assume -you have fetched all keys from the server. The function takes an array +:c:func:`memcached_dump()` is used to get a list of keys found in memcached(1) +servers. Because memcached(1) does not guarentee to dump all keys you can not +assume you have fetched all keys from the server. The function takes an array of callbacks that it will use to execute on keys as they are found. Currently the binary protocol is not testsed. @@ -41,9 +41,10 @@ RETURN ------ -A value of type \ ``memcached_return_t``\ is returned -On success that value will be \ ``MEMCACHED_SUCCESS``\ . -Use memcached_strerror() to translate this value to a printable string. +A value of type :c:type:`memcached_return_t` is returned +On success that value will be :c:type:`MEMCACHED_SUCCESS`. +Use :c:func:`memcached_strerror()` to translate this value to a printable +string. ---- diff --git a/docs/memcached_flush.rst b/docs/memcached_flush.rst index c38ad499..fe251b4a 100644 --- a/docs/memcached_flush.rst +++ b/docs/memcached_flush.rst @@ -24,8 +24,8 @@ DESCRIPTION ----------- -memcached_flush() is used to wipe clean the contents of memcached(1) servers. -It will either do this immediately or expire the content based on the +:c:func:`memcached_flush()` is used to wipe clean the contents of memcached(1) +servers. It will either do this immediately or expire the content based on the expiration time passed to the method (a value of zero causes an immediate flush). The operation is not atomic to multiple servers, just atomic to a single server. That is, it will flush the servers in the order that they were @@ -37,9 +37,10 @@ RETURN ------ -A value of type \ ``memcached_return_t``\ is returned -On success that value will be \ ``MEMCACHED_SUCCESS``\ . -Use memcached_strerror() to translate this value to a printable string. +A value of type :c:type:`memcached_return_t` is returned +On success that value will be :c:type:`MEMCACHED_SUCCESS`. +Use :c:func:`memcached_strerror()` to translate this value to a printable +string. ---- diff --git a/docs/memcached_flush_buffers.rst b/docs/memcached_flush_buffers.rst index 5419c900..1a6088c2 100644 --- a/docs/memcached_flush_buffers.rst +++ b/docs/memcached_flush_buffers.rst @@ -23,9 +23,8 @@ DESCRIPTION ----------- -memcached_flush_buffers() is used in conjunction with -MEMCACHED_BEHAVIOR_BUFFER_REQUESTS (see memcached_behavior(3)) to flush -all buffers by sending the buffered commands to the server for processing. +:c:func:`memcached_flush_buffers()` is used in conjunction with +:c:type:`MEMCACHED_BEHAVIOR_BUFFER_REQUESTS` (see memcached_behavior(3)) to flush all buffers by sending the buffered commands to the server for processing. ------ @@ -33,9 +32,10 @@ RETURN ------ -A value of type \ ``memcached_return_t``\ is returned -On success that value will be \ ``MEMCACHED_SUCCESS``\ . -Use memcached_strerror() to translate this value to a printable string. +A value of type :c:type:`memcached_return_t` is returned +On success that value will be :c:type:`MEMCACHED_SUCCESS`. +Use :c:func:`memcached_strerror()` to translate this value to a printable +string. ---- diff --git a/docs/memcached_generate_hash_value.rst b/docs/memcached_generate_hash_value.rst index 4bfe2f07..3da05dfd 100644 --- a/docs/memcached_generate_hash_value.rst +++ b/docs/memcached_generate_hash_value.rst @@ -26,17 +26,17 @@ DESCRIPTION ----------- -memcached_generate_hash_value() allows you to hash a key using one of +:c:func:`memcached_generate_hash_value()` allows you to hash a key using one of the hash functions defined in the library. This method is provided for the convenience of higher-level language bindings and is not necessary for normal memcache operations. The allowed hash algorithm constants are listed in the manpage for -memcached_behavior_set(). +:c:func:`memcached_behavior_set()`. -memcached_generate_hash() takes a memcached_st struture and produces -the hash value that would have been generated based on the defaults -of the memcached_st structure. +:c:func:`memcached_generate_hash()` takes a :c:type:`memcached_st` struture +and produces the hash value that would have been generated based on the +defaults of the :c:type:`memcached_st structure`. As of version 0.36 all hash methods have been placed into the library libhashkit(3) which is linked with libmemcached(3). For more information please see its documentation. diff --git a/docs/memcached_get.rst b/docs/memcached_get.rst index c563f396..0c8e8819 100644 --- a/docs/memcached_get.rst +++ b/docs/memcached_get.rst @@ -37,75 +37,67 @@ DESCRIPTION ----------- -memcached_get() is used to fetch an individual value from the server. You -must pass in a key and its length to fetch the object. You must supply +:c:func:`memcached_get()` is used to fetch an individual value from the server. +You must pass in a key and its length to fetch the object. You must supply three pointer variables which will give you the state of the returned -object. A uint32_t pointer to contain whatever flags you stored with the value, -a size_t pointer which will be filled with size of of the object, and a -memcached_return_t pointer to hold any error. The object will be returned -upon success and NULL will be returned on failure. Any object returned by -memcached_get() must be released by the caller application. - -memcached_mget() is used to select multiple keys at once. For multiple key -operations it is always faster to use this function. This function always -works asynchronously. memcached_fetch() is then used to retrieve any keys -found. No error is given on keys that are not found. You must call either -memcached_fetch() or memcached_fetch_result() after a successful call to -memcached_mget(). You should continue to call these functions until they -return NULL (aka no more values). If you need to quit in the middle of a -memcached_get() call, execute a memcached_quit(). After you do this, you can -issue new queries against the server. - -memcached_fetch() is used to fetch an individual value from the server. -memcached_mget() must always be called before using this method. You -must pass in a key and its length to fetch the object. You must supply +object. A :c:type:`uint32_t` pointer to contain whatever flags you stored with the value, a :c:type:`size_t` pointer which will be filled with size of of +the object, and a :c:type:`memcached_return_t` pointer to hold any error. The +object will be returned upon success and NULL will be returned on failure. Any +object returned by :c:func:`memcached_get()` must be released by the caller +application. + +:c:func:`memcached_mget()` is used to select multiple keys at once. For +multiple key operations it is always faster to use this function. This function always works asynchronously. :c:func:`memcached_fetch()` is then used to +retrieve any keys found. No error is given on keys that are not found. You +must call either :c:func:`memcached_fetch()` or +:c:func:`memcached_fetch_result()` after a successful call to +:c:func:`memcached_mget()`. You should continue to call these functions until +they return NULL (aka no more values). If you need to quit in the middle of a +:c:func:`memcached_get()` call, execute a :c:func:`memcached_quit()`. After you do this, you can issue new queries against the server. + +:c:func:`memcached_fetch()` is used to fetch an individual value from the server. :c:func:`memcached_mget()` must always be called before using this method. +You must pass in a key and its length to fetch the object. You must supply three pointer variables which will give you the state of the returned -object. A uint32_t pointer to contain whatever flags you stored with the value, -a size_t pointer which will be filled with size of of the object, and a -memcached_return_t pointer to hold any error. The object will be returned -upon success and NULL will be returned on failure. MEMCACHD_END is returned -by the \*error value when all objects that have been found are returned. -The final value upon MEMCACHED_END is null. Values returned by -memcached_fetch() must be freed by the caller. memcached_fetch() will -be DEPRECATED in the near future, memcached_fetch_result() should be used -instead. - -memcached_fetch_result() is used to return a memcached_result_st(3) structure -from a memcached server. The result object is forward compatible with changes -to the server. For more information please refer to the memcached_result_st(3) -help. This function will dynamically allocate a result structure for you -if you do not pass one to the function. - -memcached_fetch_execute() is a callback function for result sets. Instead -of returning the results to you for processing, it passes each of the +object. A :c:type:`uint32_t` pointer to contain whatever flags you stored with the value, a :c:type:`size_t` pointer which will be filled with size of of the +object, and a :c:type:`memcached_return_t` pointer to hold any error. The +object will be returned upon success and NULL will be returned on failure. :c:type:`MEMCACHD_END` is returned by the \*error value when all objects that have been found are returned. The final value upon :c:type:`MEMCACHED_END` is null. +Values returned by :c:func:`memcached_fetch()` must be freed by the caller. +:c:func:`memcached_fetch()` will be DEPRECATED in the near future, +c:func:`memcached_fetch_result()` should be used instead. + +:c:func:`memcached_fetch_result()` is used to return a :c:type:`memcached_result_st` structure from a memcached server. The result object is forward compatible +with changes to the server. For more information please refer to the +:c:type:`memcached_result_st` help. This function will dynamically allocate a +result structure for you if you do not pass one to the function. + +:c:func:`memcached_fetch_execute()` is a callback function for result sets. +Instead of returning the results to you for processing, it passes each of the result sets to the list of functions you provide. It passes to the function -a memcached_st that can be cloned for use in the called function (it can not -be used directly). It also passes a result set which does not need to be freed. -Finally it passes a "context". This is just a pointer to a memory reference -you supply the calling function. Currently only one value is being passed -to each function call. In the future there will be an option to allow this -to be an array. - -memcached_mget_execute() and memcached_mget_execute_by_key() is -similar to memcached_mget(), but it may trigger the supplied callbacks -with result sets while sending out the queries. If you try to perform -a really large multiget with memcached_mget() you may encounter a -deadlock in the OS kernel (it will fail to write data to the socket because -the input buffer is full). memcached_mget_execute() solves this -problem by processing some of the results before continuing sending -out requests. Please note that this function is only available in the -binary protocol. - -memcached_get_by_key() and memcached_mget_by_key() behave in a similar nature -as memcached_get() and memcached_mget(). The difference is that they take -a master key that is used for determining which server an object was stored -if key partitioning was used for storage. - -All of the above functions are not tested when the \ ``MEMCACHED_BEHAVIOR_USE_UDP``\ -has been set. Executing any of these functions with this behavior on will result in -\ ``MEMCACHED_NOT_SUPPORTED``\ being returned, or for those functions which do not return -a \ ``memcached_return_t``\ , the error function parameter will be set to -\ ``MEMCACHED_NOT_SUPPORTED``\ . +a :c:type:`memcached_st` that can be cloned for use in the called +function (it can not be used directly). It also passes a result set which does +not need to be freed. Finally it passes a "context". This is just a pointer to +a memory reference you supply the calling function. Currently only one value +is being passed to each function call. In the future there will be an option +to allow this to be an array. + +:c:func:`memcached_mget_execute()` and :c:func:`memcached_mget_execute_by_key()` +is similar to :c:func:`memcached_mget()`, but it may trigger the supplied +callbacks with result sets while sending out the queries. If you try to +perform a really large multiget with :c:func:`memcached_mget()` you may +encounter a deadlock in the OS kernel (it will fail to write data to the +socket because the input buffer is full). :c:func:`memcached_mget_execute()` +solves this problem by processing some of the results before continuing +sending out requests. Please note that this function is only available in +the binary protocol. + +:c:func:`memcached_get_by_key()` and :c:func:`memcached_mget_by_key()` behave +in a similar nature as :c:func:`memcached_get()` and :c:func:`memcached_mget()`. +The difference is that they take a master key that is used for determining +which server an object was stored if key partitioning was used for storage. + +All of the above functions are not tested when the +:c:type:`MEMCACHED_BEHAVIOR_USE_UDP` has been set. Executing any of these +functions with this behavior on will result in :c:type:`MEMCACHED_NOT_SUPPORTED` being returned, or for those functions which do not return a :c:type:`memcached_return_t`, the error function parameter will be set to :c:type:`MEMCACHED_NOT_SUPPORTED`. ------ @@ -114,12 +106,13 @@ RETURN All objects returned must be freed by the calling application. -memcached_get() and memcached_fetch() will return NULL on error. You must -look at the value of error to determine what the actual error was. +:c:func:`memcached_get()` and :c:func:`memcached_fetch()` will return NULL on +error. You must look at the value of error to determine what the actual error +was. -MEMCACHED_KEY_TOO_BIG is set to error whenever memcached_fetch() was used -and the key was set larger then MEMCACHED_MAX_KEY, which was the largest -key allowed for the original memcached ascii server. +:c:type:`MEMCACHED_KEY_TOO_BIG` is set to error whenever +:c:func:`memcached_fetch()` was used and the key was set larger then +:c:type:`MEMCACHED_MAX_KEY`, which was the largest key allowed for the original memcached ascii server. ---- diff --git a/docs/memcached_memory_allocators.rst b/docs/memcached_memory_allocators.rst index 33f3d3a7..ce8af386 100644 --- a/docs/memcached_memory_allocators.rst +++ b/docs/memcached_memory_allocators.rst @@ -39,18 +39,18 @@ DESCRIPTION libmemcached(3) allows you to specify your own memory allocators, optimized for your application. This enables libmemcached to be used inside of applications that have their own malloc implementation. -memcached_set_memory_allocators() is used to set the memory allocators used -by the memcached instance specified by ptr. Please note that you cannot -override only one of the memory allocators, you have to specify a complete -new set if you want to override one of them. All of the memory allocation -functions should behave as specified in the C99 standard. Specify NULL as -all functions to reset them to the default values. +:c:func:`memcached_set_memory_allocators()` is used to set the memory +allocators used by the memcached instance specified by ptr. Please note that +you cannot override only one of the memory allocators, you have to specify a +complete new set if you want to override one of them. All of the memory +allocation functions should behave as specified in the C99 standard. Specify +NULL as all functions to reset them to the default values. -memcached_get_memory_allocators() is used to get the currently used memory -allocators by a mamcached handle. +:c:func:`memcached_get_memory_allocators()` is used to get the currently used +memory allocators by a mamcached handle. -memcached_get_memory_allocators_context() returns the void \* that was -passed in during the call to memcached_set_memory_allocators(). +:c:func:`memcached_get_memory_allocators_context()` returns the void \* that +was passed in during the call to :c:func:`memcached_set_memory_allocators()`. The first argument to the memory allocator functions is a pointer to a memcached structure, the is passed as const and you will need to clone @@ -72,8 +72,9 @@ RETURN ------ -memcached_set_memory_allocators() return MEMCACHED_SUCCESS upon success, -and MEMCACHED_FAILURE if you don't pass a complete set of function pointers. +:c:func:`memcached_set_memory_allocators()` return :c:type:`MEMCACHED_SUCCESS` +upon success, and :c:type:`MEMCACHED_FAILURE` if you don't pass a complete set +of function pointers. ---- diff --git a/docs/memcached_pool.rst b/docs/memcached_pool.rst index aa914e50..38d2b3a7 100644 --- a/docs/memcached_pool.rst +++ b/docs/memcached_pool.rst @@ -34,38 +34,35 @@ DESCRIPTION ----------- -memcached_pool() is used to create a connection pool of objects you may use -to remove the overhead of using memcached_clone for short lived -\ ``memcached_st``\ objects. Please see :manpage:`libmemcached_configuration` for details on the format of the configuration string. - -DEPRECATED memcached_pool_create() is used to create a connection pool of -objects you may use to remove the overhead of using memcached_clone for -short lived \ ``memcached_st``\ objects. The mmc argument should be an -initialised \ ``memcached_st``\ structure, and a successfull invocation of -memcached_pool_create takes full ownership of the variable (until it is -released by memcached_pool_destroy). The \ ``initial``\ argument specifies -the initial size of the connection pool, and the \ ``max``\ argument +:c:func:`memcached_pool()` is used to create a connection pool of objects you +may use to remove the overhead of using memcached_clone for short lived +:c:type:`memcached_st` objects. Please see :manpage:`libmemcached_configuration` for details on the format of the configuration string. + +DEPRECATED :c:func:`memcached_pool_create()` is used to create a connection pool of objects you may use to remove the overhead of using +:c:type:`memcached_clone` for short lived :c:type:`memcached_st` objects. +The mmc argument should be an initialised :c:type:`memcached_st` structure, +and a successfull invocation of :c:type:`memcached_pool_create` takes full +ownership of the variable (until it is released by +:c:type:`memcached_pool_destroy`). The :c:type:`initial` argument specifies +the initial size of the connection pool, and the :c:type:`max` argument specifies the maximum size the connection pool should grow to. Please note that the library will allocate a fixed size buffer scaled to the max size of the connection pool, so you should not pass MAXINT or some other large number here. -memcached_pool_destroy() is used to destroy the connection pool -created with memcached_pool_create() and release all allocated -resources. It will return the pointer to the \ ``memcached_st``\ structure -passed as an argument to memcached_pool_create(), and returns the ownership -of the pointer to the caller when created with memcached_pool_create, -otherwise NULL is returned.. +:c:func:`memcached_pool_destroy()` is used to destroy the connection pool +created with :c:func:`memcached_pool_create()` and release all allocated +resources. It will return the pointer to the :c:type:`memcached_st` structure +passed as an argument to :c:func:`memcached_pool_create()`, and returns the ownership of the pointer to the caller when created with :c:func:`memcached_pool_create()`, otherwise NULL is returned.. -memcached_pool_pop() is used to grab a connection structure from the +:c:func:`memcached_pool_pop()` is used to grab a connection structure from the connection pool. The block argument specifies if the function should block and wait for a connection structure to be available if we try to exceed the maximum size. -memcached_pool_push() is used to return a connection structure back to the pool. +:c:func:`memcached_pool_push()` is used to return a connection structure back to the pool. -memcached_pool_behavior_set() and memcached_pool_behagior_get() is -used to get/set behavior flags on all connections in the pool. +:c:func:`memcached_pool_behavior_set()` and :c:func:`memcached_pool_behagior_get()` is used to get/set behavior flags on all connections in the pool. ------ @@ -73,21 +70,19 @@ RETURN ------ -memcached_pool_create() returns a pointer to the newly created -memcached_pool_st structure. On an allocation failure, it returns +:c:func:`memcached_pool_create()` returns a pointer to the newly created +:c:type:`memcached_pool_st` structure. On an allocation failure, it returns NULL. -memcached_pool_destroy() returns the pointer (and ownership) to the -memcached_st structure used to create the pool. If connections are in +:c:func:`memcached_pool_destroy()` returns the pointer (and ownership) to the +:c:type:`memcached_st` structure used to create the pool. If connections are in use it returns NULL. -memcached_pool_pop() returns a pointer to a memcached_st structure -from the pool (or NULL if an allocation cannot be satisfied). +:c:func:`memcached_pool_pop()` returns a pointer to a :c:type:`memcached_st structure` from the pool (or NULL if an allocation cannot be satisfied). -memcached_pool_push() returns MEMCACHED_SUCCESS upon success. +:c:func:`memcached_pool_push()` returns :c:type:`MEMCACHED_SUCCESS` upon success. -memcached_pool_behavior_get() and memcached_pool_behavior_get() -returns MEMCACHED_SUCCESS upon success. +:c:func:`memcached_pool_behavior_get()` and :c:func:`memcached_pool_behavior_get()` returns :c:type:`MEMCACHED_SUCCESS` upon success. ---- diff --git a/docs/memcached_quit.rst b/docs/memcached_quit.rst index 06e98e8f..8377f63c 100644 --- a/docs/memcached_quit.rst +++ b/docs/memcached_quit.rst @@ -19,15 +19,14 @@ DESCRIPTION ----------- -memcached_quit() will disconnect you from all currently connected servers. -It will also reset the state of the connection (ie, any memcached_fetch() you -are in the middle of will be terminated). This function is called -automatically when you call memcached_free() on the \ ``memcached_st``\ structure. +:c:func:`memcached_quit()` will disconnect you from all currently connected +servers. It will also reset the state of the connection (ie, any :c:func:`memcached_fetch()` you are in the middle of will be terminated). This function is +called automatically when you call :c:func:`memcached_free()` on the :c:type:`memcached_st` structure. You do not need to call this on your own. All operations to change server hashes and parameters will handle connections to the server for you. This function is provided mainly so that you can timeout your connections or -reset connections during the middle of a memcached_fetch(). +reset connections during the middle of a :c:func:`memcached_fetch()`. ------ @@ -35,9 +34,9 @@ RETURN ------ -A value of type \ ``memcached_return``\ is returned -On success that value will be \ ``MEMCACHED_SUCCESS``\ . -Use memcached_strerror() to translate this value to a printable string. +A value of type :c:type:`memcached_return` is returned +On success that value will be :c:type:`MEMCACHED_SUCCESS`. +Use :c:func:`memcached_strerror()` to translate this value to a printable string. ---- diff --git a/docs/memcached_result_st.rst b/docs/memcached_result_st.rst index fab6c4a4..8bc43e26 100644 --- a/docs/memcached_result_st.rst +++ b/docs/memcached_result_st.rst @@ -44,51 +44,50 @@ DESCRIPTION ----------- -libmemcached(3) can optionally return a memcached_result_st which acts as a -result object. The result objects have added benefits over the character -pointer returns, in that they are forward compatible with new return items -that future memcached servers may implement (the best current example of -this is the CAS return item). The structures can also be reused, which will -save on calls to malloc(3). It is suggested that you use result objects over -char \* return functions. +libmemcached(3) can optionally return a :c:type:`memcached_result_st` which +acts as a result object. The result objects have added benefits over the +character pointer returns, in that they are forward compatible with new +return items that future memcached servers may implement (the best current +example of this is the CAS return item). The structures can also be reused, +which will save on calls to malloc(3). It is suggested that you use result +objects over char \* return functions. -The structure of memcached_result_st has been encapsulated, you should not -write code to directly access members of the structure. +The structure of :c:type:`memcached_result_st` has been encapsulated, you should +not write code to directly access members of the structure. -memcached_result_create() will either allocate memory for a -memcached_result_st or will initialize a structure passed to it. +:c:func:`memcached_result_create()` will either allocate memory for a +:c:type:`memcached_result_st` or will initialize a structure passed to it. -memcached_result_free() will deallocate any memory attached to the +:c:func:`memcached_result_free()` will deallocate any memory attached to the structure. If the structure was also allocated, it will deallocate it. -memcached_result_key_value() returns the key value associated with the +:c:func:`memcached_result_key_value()` returns the key value associated with the current result object. -memcached_result_key_length() returns the key length associated with the -current result object. +:c:func:`memcached_result_key_length()` returns the key length associated with +the current result object. -memcached_result_value() returns the result value associated with the +:c:func:`memcached_result_value()` returns the result value associated with the current result object. -memcached_result_length() returns the result length associated with the -current result object. +:c:func:`memcached_result_length()` returns the result length associated with +the current result object. -memcached_result_flags() returns the flags associated with the +:c:func:`memcached_result_flags()` returns the flags associated with the current result object. -memcached_result_cas() returns the cas associated with the +:c:cune:`memcached_result_cas()` returns the cas associated with the current result object. This value will only be available if the server tests it. -memcached_result_set_value() takes a byte array and a size and sets +:c:func:`memcached_result_set_value()` takes a byte array and a size and sets the result to this value. This function is used for trigger responses. -void memcached_result_set_flags() takes a result structure and stores +:c:func:`void memcached_result_set_flags()` takes a result structure and stores a new value for the flags field. -void memcached_result_set_expiration(A) takes a result structure and stores -a new value for the expiration field (this is only used by read through -triggers). +:c:func:`void memcached_result_set_expiration(A)` takes a result structure and stores a new value for the expiration field (this is only used by read +through triggers). You may wish to avoid using memcached_result_create(3) with a stack based allocation. The most common issues related to ABI safety involve @@ -101,8 +100,8 @@ RETURN Varies, see particular functions. All structures must have -memcached_result_free() called on them for cleanup purposes. Failure to -do this will result in leaked memory. +:c:func:`memcached_result_free()` called on them for cleanup purposes. Failure +to do this will result in leaked memory. ---- diff --git a/docs/memcached_return_t.rst b/docs/memcached_return_t.rst index 57d6af95..3663c6df 100644 --- a/docs/memcached_return_t.rst +++ b/docs/memcached_return_t.rst @@ -29,6 +29,8 @@ SYNOPSIS .. c:type:: MEMCACHED_SUCCESS, +Success + .. c:type:: MEMCACHED_FAILURE, .. c:type:: MEMCACHED_HOST_LOOKUP_FAILURE, // getaddrinfo() only @@ -91,6 +93,8 @@ SYNOPSIS .. c:type:: MEMCACHED_TIMEOUT, +Connection to server timed out. + .. c:type:: MEMCACHED_BUFFERED, .. c:type:: MEMCACHED_BAD_KEY_PROVIDED, diff --git a/docs/memcached_sasl.rst b/docs/memcached_sasl.rst index 4dc4039c..bd51348b 100644 --- a/docs/memcached_sasl.rst +++ b/docs/memcached_sasl.rst @@ -34,16 +34,16 @@ libsasl to perform SASL authentication. Please note that SASL requires the memcached binary protocol, and you have to specify the callbacks before you connect to the server. -memcached_set_sasl_auth_data() is a helper function defining +:c:func:`memcached_set_sasl_auth_data()` is a helper function defining the basic functionality for you, but it will store the username and password in memory. If you choose to use this method you have to call -memcached_destroy_sasl_auth_data before calling memcached_free to avoid -a memory leak. You should NOT call memcached_destroy_sasl_auth_data if you -specify your own callback function with memcached_set_sasl_callbacks(). +:c:type:`memcached_destroy_sasl_auth_data` before calling +:c:type:`memcached_free` to avoid a memory leak. You should NOT call +:c:type:`memcached_destroy_sasl_auth_data` if you specify your own callback +function with :c:func:`memcached_set_sasl_callbacks()`. -You as a client user have to initialize libsasl by using sasl_client_init -before enabling it in libmemcached, and you have to shut down libsasl by -calling sasl_done() when you are done using SASL from libmemcached. +You as a client user have to initialize libsasl by using :c:type:`sasl_client_init` before enabling it in libmemcached, and you have to shut down libsasl by +calling :c:func:`sasl_done()` when you are done using SASL from libmemcached. ------ @@ -51,9 +51,8 @@ RETURN ------ -memcached_get_sasl_callbacks() returns the callbacks currently used -by this memcached handle. -memcached_get_sasl_set_auth_data() returns MEMCACHED_SUCCESS upon success. +:c:func:`memcached_get_sasl_callbacks()` returns the callbacks currently used +by this memcached handle. :c:func:`memcached_get_sasl_set_auth_data()` returns :c:type:`MEMCACHED_SUCCESS` upon success. ---- diff --git a/docs/memcached_server_st.rst b/docs/memcached_server_st.rst index 77eb9137..f39c478b 100644 --- a/docs/memcached_server_st.rst +++ b/docs/memcached_server_st.rst @@ -35,30 +35,25 @@ DESCRIPTION libmemcached(3) operates on a list of hosts which are stored in -memcached_server_st structures. You should not modify these structures +:c:type:`memcached_server_st` structures. You should not modify these structures directly. Functions are provided to modify these structures (and more can be added, just ask!). -memcached_server_list() is used to provide an array of all defined hosts. -This was incorrectly documented as "requiring free()" up till version 0.39. +:c:func:`memcached_server_list()` is used to provide an array of all defined hosts. This was incorrectly documented as "requiring free()" up till version 0.39. -memcached_server_list_free() deallocates all memory associated with the array -of memcached_server_st that you passed to it. +:c:func:`memcached_server_list_free()` deallocates all memory associated with the array of :c:type:`memcached_server_st` that you passed to it. -memcached_server_list_append() adds a server to the end of a -memcached_server_st array. On error null will be returned and the -memcached_return_t pointer you passed into the function will be set with the -appropriate error. If the value of port is zero, it is set to the default +:c:func:`memcached_server_list_append()` adds a server to the end of a +:c:type:`memcached_server_st` array. On error null will be returned and the +:c:type:`memcached_return_t` pointer you passed into the function will be set with the appropriate error. If the value of port is zero, it is set to the default port of a memcached server. -DEPRECATED memcached_servers_parse(), please see :manpage:`memcached(3)` +DEPRECATED :c:func:`memcached_servers_parse()`, please see :manpage:`memcached(3)` -memcached_server_error() can be used to look at the text of the last error -message sent by the server to to the client. +:c:func:`memcached_server_error()` can be used to look at the text of the last error message sent by the server to to the client. Before version 0.39 theses functions used a memcache_server_st \*. In 0.39 -memcached_server_st \* was aliased to memcached_server_list_st. This was -done for a style reason/to help clean up some concepts in the code. +memcached_server_st \* was aliased to :c:type:`memcached_server_list_st`. This was done for a style reason to help clean up some concepts in the code. ------ diff --git a/docs/memcached_servers.rst b/docs/memcached_servers.rst index 5156b2a2..7331dbdd 100644 --- a/docs/memcached_servers.rst +++ b/docs/memcached_servers.rst @@ -40,49 +40,43 @@ hosts determine routing to keys. Functions are provided to add keys to memcached_st structures. To manipulate lists of servers see memcached_server_st(3). -memcached_server_count() provides you a count of the current number of -servers being used by a \ ``memcached_st``\ structure. - -memcached_server_add() pushes a single TCP server into the \ ``memcached_st``\ -structure. This server will be placed at the end. Duplicate servers are -allowed, so duplication is not checked. Executing this function with the -\ ``MEMCACHED_BEHAVIOR_USE_UDP``\ behavior set will result in a -\ ``MEMCACHED_INVALID_HOST_PROTOCOL``\ . - -memcached_server_add_udp() pushes a single UDP server into the \ ``memcached_st``\ -structure. This server will be placed at the end. Duplicate servers are -allowed, so duplication is not checked. Executing this function with out -setting the \ ``MEMCACHED_BEHAVIOR_USE_UDP``\ behavior will result in a -\ ``MEMCACHED_INVALID_HOST_PROTOCOL``\ . - -memcached_server_add_unix_socket() pushes a single UNIX socket into the -\ ``memcached_st``\ structure. This UNIX socket will be placed at the end. +:c:func:`memcached_server_count()` provides you a count of the current number of +servers being used by a :c:type:`memcached_st` structure. + +:c:func:`memcached_server_add()` pushes a single TCP server into the :c:type:`memcached_st` structure. This server will be placed at the end. Duplicate servers + are allowed, so duplication is not checked. Executing this function with the +:c:type:`MEMCACHED_BEHAVIOR_USE_UDP` behavior set will result in a +:c:type:`MEMCACHED_INVALID_HOST_PROTOCOL`. + +:c:func:`memcached_server_add_udp()` pushes a single UDP server into the :c:type:`memcached_st` structure. This server will be placed at the end. Duplicate +servers are allowed, so duplication is not checked. Executing this function with out setting the :c:type:`MEMCACHED_BEHAVIOR_USE_UDP` behavior will result in a +:c:type:`MEMCACHED_INVALID_HOST_PROTOCOL`. + +:c:func:`memcached_server_add_unix_socket()` pushes a single UNIX socket into the :c:type:`memcached_st` structure. This UNIX socket will be placed at the end. Duplicate servers are allowed, so duplication is not checked. The length -of the filename must be one character less then MEMCACHED_MAX_HOST_LENGTH. +of the filename must be one character less than :c:type:`MEMCACHED_MAX_HOST_LENGTH`. -memcached_server_push() pushes an array of \ ``memcached_server_st``\ into -the \ ``memcached_st``\ structure. These servers will be placed at the -end. Duplicate servers are allowed, so duplication is not checked. A +:c:func:`memcached_server_push()` pushes an array of :c:type:`memcached_server_st` into the :c:type:`memcached_st` structure. These servers will be placed at +the end. Duplicate servers are allowed, so duplication is not checked. A copy is made of structure so the list provided (and any operations on the list) are not saved. -memcached_server_by_key() allows you to provide a key and retrieve the +:c:func:`memcached_server_by_key()` allows you to provide a key and retrieve the server which would be used for assignment. This structure is cloned from its original structure and must be freed. If NULL is returned you should consult \*error. The returning structure should be freed with -memcached_server_free(). +:c:func:`memcached_server_free()`. -memcached_server_get_last_disconnect() returns a pointer to the last server -for which there was a connection problem. It does not mean this particular -server is currently dead but if the library is reporting a server is, -the returned server is a very good candidate. +:c:func:`memcached_server_get_last_disconnect()` returns a pointer to the last +server for which there was a connection problem. It does not mean this +particular server is currently dead but if the library is reporting a server +is, the returned server is a very good candidate. -memcached_server_cursor() takes a memcached_st and loops through the +:c:func:`memcached_server_cursor()` takes a memcached_st and loops through the list of hosts currently in the cursor calling the list of callback functions provided. You can optionally pass in a value via context which will be provided to each callback function. An error -return from any callback will terminate the loop. memcached_server_cursor() -is passed the original caller memcached_st in its current state. +return from any callback will terminate the loop. :c:func:`memcached_server_cursor()` is passed the original caller :c:type:`memcached_st` in its current state. ------ diff --git a/docs/memcached_set.rst b/docs/memcached_set.rst index ffe6db64..29d8d241 100644 --- a/docs/memcached_set.rst +++ b/docs/memcached_set.rst @@ -32,55 +32,43 @@ DESCRIPTION ----------- -memcached_set(), memcached_add(), and memcached_replace() are all used to -store information on the server. All methods take a key, and its length to -store the object. Keys are currently limited to 250 characters when using either a version of memcached(1) which is 1.4 or below, or when using the text protocol. You must supply both a value and a length. Optionally you +:c:func:`memcached_set()`, :c:func:`memcached_add()`, and :c:func:`memcached_replace()` are all used to store information on the server. All methods take a key, and its length to store the object. Keys are currently limited to 250 characters when using either a version of memcached(1) which is 1.4 or below, or when using the text protocol. You must supply both a value and a length. Optionally you store the object. Keys are currently limited to 250 characters by the memcached(1) server. You must supply both a value and a length. Optionally you may test an expiration time for the object and a 16 byte value (it is meant to be used as a bitmap). "flags" is a 4byte space that is stored alongside of the main value. Many sub libraries make use of this field, so in most cases users should avoid making use of it. -memcached_set() will write an object to the server. If an object already -exists it will overwrite what is in the server. If the object does not exist -it will be written. If you are using the non-blocking mode this function +:c:func:`memcached_set()` will write an object to the server. If an object +already exists it will overwrite what is in the server. If the object does not +exist it will be written. If you are using the non-blocking mode this function will always return true unless a network error occurs. -memcached_replace() replaces an object on the server. If the object is not -found on the server an error occurs. +:c:func:`memcached_replace()` replaces an object on the server. If the object is not found on the server an error occurs. -memcached_add() adds an object to the server. If the object is found on the -server an error occurs, otherwise the value is stored. +:c:func:`memcached_add()` adds an object to the server. If the object is found on the server an error occurs, otherwise the value is stored. -memcached_cas() overwrites data in the server as long as the "cas" value is -still the same in the server. You can get the cas value of a result by -calling memcached_result_cas() on a memcached_result_st(3) structure. At the point +:c:func:`memcached_cas()` overwrites data in the server as long as the "cas" +value is still the same in the server. You can get the cas value of a result by +calling :c:func:`memcached_result_cas()` on a memcached_result_st(3) structure. At the point that this note was written cas is still buggy in memached. Turning on tests for it in libmemcached(3) is optional. Please see memcached_set() for information on how to do this. -memcached_set_by_key(), memcached_add_by_key(), and memcached_replace_by_key() -methods all behave in a similar method as the non key -methods. The difference is that they use their group_key parameter to map +:c:func:`memcached_set_by_key()`, :c:func:`memcached_add_by_key()`, and :c:func:`memcached_replace_by_key()` methods all behave in a similar method as the non +key methods. The difference is that they use their group_key parameter to map objects to particular servers. -If you are looking for performance, memcached_set() with non-blocking IO is -the fastest way to store data on the server. - -All of the above functions are testsed with the \ ``MEMCACHED_BEHAVIOR_USE_UDP``\ -behavior enabled. However, when using these operations with this behavior on, there -are limits to the size of the payload being sent to the server. The reason for -these limits is that the Memcached Server does not allow multi-datagram requests -and the current server implementation sets a datagram size to 1400 bytes. Due -to protocol overhead, the actual limit of the user supplied data is less than -1400 bytes and depends on the protocol in use as, well as the operation being -executed. When running with the binary protocol, \ `` MEMCACHED_BEHAVIOR_BINARY_PROTOCOL``\ , -the size of the key,value, flags and expiry combined may not exceed 1368 bytes. -When running with the ASCII protocol, the exact limit fluctuates depending on -which function is being executed and whether the function is a cas operation -or not. For non-cas ASCII set operations, there are at least 1335 bytes available -to split among the key, key_prefix, and value; for cas ASCII operations there are -at least 1318 bytes available to split among the key, key_prefix and value. If the -total size of the command, including overhead, exceeds 1400 bytes, a \ ``MEMCACHED_WRITE_FAILURE``\ -will be returned. +If you are looking for performance, :c:func:`memcached_set()` with non-blocking IO is the fastest way to store data on the server. + +All of the above functions are testsed with the :c:type:`MEMCACHED_BEHAVIOR_USE_UDP` behavior enabled. However, when using these operations with this behavior +on, there are limits to the size of the payload being sent to the server. +The reason for these limits is that the Memcached Server does not allow +multi-datagram requests and the current server implementation sets a datagram +size to 1400 bytes. Due to protocol overhead, the actual limit of the user supplied data is less than 1400 bytes and depends on the protocol in use as, well as the operation being +executed. When running with the binary protocol, :c:type:`MEMCACHED_BEHAVIOR_BINARY_PROTOCOL`, the size of the key,value, flags and expiry combined may not +exceed 1368 bytes. When running with the ASCII protocol, the exact limit fluctuates depending on which function is being executed and whether the function is a cas operation or not. For non-cas ASCII set operations, there are at least +1335 bytes available to split among the key, key_prefix, and value; for cas +ASCII operations there are at least 1318 bytes available to split among the key, key_prefix and value. If the total size of the command, including overhead, +exceeds 1400 bytes, a :c:type:`MEMCACHED_WRITE_FAILURE` will be returned. ------ @@ -88,12 +76,11 @@ RETURN ------ -All methods return a value of type \ ``memcached_return_t``\ . -On success the value will be \ ``MEMCACHED_SUCCESS``\ . -Use memcached_strerror() to translate this value to a printable string. +All methods return a value of type :c:type:`memcached_return_t`. +On success the value will be :c:type:`MEMCACHED_SUCCESS`. +Use :c:func:`memcached_strerror()` to translate this value to a printable string. -For memcached_replace() and memcached_add(), \ ``MEMCACHED_NOTSTORED``\ is a -legitmate error in the case of a collision. +For :c:func:`memcached_replace()` and :c:func:`memcached_add()`, :c:type:`MEMCACHED_NOTSTORED` is a legitmate error in the case of a collision. ---- @@ -110,5 +97,5 @@ SEE ALSO -------- -memcached(1) libmemached(3) memcached_strerror(3) memcached_prepend(3) memcached_cas(3) memcached_append(3) +:manpage:`memcached(1)` :manpage:`libmemached(3)` :manpage:`memcached_strerror(3)` :manpage:`memcached_prepend(3)` :manpage:`memcached_cas(3)` :manpage:`memcached_append(3)` diff --git a/docs/memcached_stats.rst b/docs/memcached_stats.rst index 0c0115c9..2cd36b6b 100644 --- a/docs/memcached_stats.rst +++ b/docs/memcached_stats.rst @@ -33,34 +33,20 @@ DESCRIPTION libmemcached(3) has the ability to query a memcached server (or collection of servers) for their current state. Queries to find state return a -\ ``memcached_stat_st``\ structure. You are responsible for freeing this structure. -While it is possible to access the structure directly it is not advisable. -`_ +------ +AUTHOR +------ + + +Brian Aker, + + -------- SEE ALSO -------- diff --git a/docs/memerror.rst b/docs/memerror.rst index 16ee6147..aa298993 100644 --- a/docs/memerror.rst +++ b/docs/memerror.rst @@ -14,17 +14,23 @@ SYNOPSIS .. program:: memerror -.. option:: --help - ----------- DESCRIPTION ----------- -\ **memerror**\ translate an error code from libmemcached(3) into a human +:program:`memerror` translates an error code from libmemcached(3) into a human readable string. -For a full list of operations run the tool with the \ **--help**\ option. + +------- +OPTIONS +------- + + +For a full list of operations run the tool with option: + +.. option:: --help ---- @@ -36,10 +42,17 @@ To find out more infoerroration please check: `http://libmemcached.org/ `_ +------ +AUTHOR +------ + + +Brian Aker, + + -------- SEE ALSO -------- -memcached(1) libmemcached(3) - +:manpage:`memcached(1)` :manpage:`libmemcached(3)` diff --git a/docs/memflush.rst b/docs/memflush.rst index e02969bd..d2cb644f 100644 --- a/docs/memflush.rst +++ b/docs/memflush.rst @@ -14,20 +14,31 @@ SYNOPSIS .. program:: memflush -.. option:: --help - ----------- DESCRIPTION ----------- -\ **memflush**\ resets the contents of memcached(1) servers. +:program:`memflush` resets the contents of memcached(1) servers. This means that all data in the specified servers will be deleted. -You can specify servers via the \ **--servers**\ option or via the -environment variable \ ``MEMCACHED_SERVERS``\ . -For a full list of operations run the tool with the \ **--help**\ option. +------- +OPTIONS +------- + + +You can specify servers via the option: + +.. option:: --servers + +or via the environment variable: + +.. envvar:: `MEMCACHED_SERVERS` + +For a full list of operations run the tool with option: + +.. option:: --help ---- @@ -53,4 +64,4 @@ Mark Atwood SEE ALSO -------- -memcached(1) libmemcached(3) +:manpage:`memcached(1)` :manpage:`libmemcached(3)` diff --git a/docs/memrm.rst b/docs/memrm.rst index 4dad9f75..7b34b029 100644 --- a/docs/memrm.rst +++ b/docs/memrm.rst @@ -14,21 +14,33 @@ SYNOPSIS .. program:: memrm -.. option:: --help - - ----------- DESCRIPTION ----------- -\ **memrm**\ removes items, specified by key, from memcached(1) servers. +:program:`memrm` removes items, specified by key, from memcached(1) servers. + + +------- +OPTIONS +------- + + +You can specify servers via the option: + +.. option:: --servers + +or via the environment variable: + +.. envvar:: `MEMCACHED_SERVERS` + +For a full list of operations run the tool with the + +.. option:: --help -You can specify servers via the \ **--servers**\ option or via the -environment variable \ ``MEMCACHED_SERVERS``\ . -For a full list of operations run the tool with the \ **--help**\ option. ---- @@ -55,5 +67,5 @@ SEE ALSO -------- -memcached(1) libmemcached(3) +:manpage:`memcached(1)` :manpage:`libmemcached(3)` diff --git a/docs/memslap.rst b/docs/memslap.rst index 1996b99f..c99abd77 100644 --- a/docs/memslap.rst +++ b/docs/memslap.rst @@ -12,17 +12,48 @@ SYNOPSIS .. program:: memslap -.. option:: --help - ----------- DESCRIPTION ----------- -\ **memslap**\ is a load generation and benchmark tool for memcached(1) +:program:`memslap` is a load generation and benchmark tool for memcached(1) servers. It generates configurable workload such as threads, concurrencies, connections, run time, overwrite, miss rate, key size, value size, get/set proportion, expected throughput, and so on. -You can specify servers via the \ **--servers**\ option or via the environment variable \ ``MEMCACHED_SERVERS``\ . + +------- +OPTIONS +------- + + +You can specify servers via the option: + +.. option:: --servers + +or via the environment variable: + +.. envvar:: `MEMCACHED_SERVERS` + +For a full list of operations run the tool with: + +.. option:: --help + + +---- +HOME +---- + + +To find out more information please check: +'http://libmemcached.org/ '_ + + +------ +AUTHOR +------ + + +Brian Aker, -------- diff --git a/docs/memstat.rst b/docs/memstat.rst index e5aa0e06..550c346f 100644 --- a/docs/memstat.rst +++ b/docs/memstat.rst @@ -14,22 +14,33 @@ SYNOPSIS .. program:: memstat -.. option:: --help - ----------- DESCRIPTION ----------- -\ **memstat**\ dumps the state of memcached(1) servers. +:program:`memstat` dumps the state of memcached(1) servers. It displays all data to stdout. -You can specify servers via the \ **--servers**\ option or via the -environment variable \ ``MEMCACHED_SERVERS``\ . \ **--args**\ can be used -to specify the "argument" sent to the stats command (ie slab, size, items, -etc..). -For a full list of operations run the tool with the \ **--help**\ option. +------- +OPTIONS +------- + + +You can specify servers via the option: + +.. option:: --servers + +or via the environment variable: + +.. envvar:: 'MEMCACHED_SERVERS, --args' + +which can be used to specify the "argument" sent to the stats command (ie slab, size, items, etc..). + +For a full list of operations run the tool with: + +.. option:: --help ---- @@ -46,5 +57,5 @@ SEE ALSO -------- -memcached(1) libmemcached(3) +:manpage:`memcached(1)` :manpage:`libmemcached(3)`