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.
----
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.
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.
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.
-----------
-\ **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.
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`.
--------
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
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
.. 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.
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.
.. 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.
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);
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);
------
-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.
----
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.
------
------
-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.
----
--------
-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)`
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
------
-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.
----
-----------
-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
------
-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.
-----------
-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.
------
-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.
----
-----------
-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
------
-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.
----
-----------
-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.
------
------
-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.
----
-----------
-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.
-----------
-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`.
------
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.
----
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
------
-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.
----
-----------
-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.
------
------
-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.
----
-----------
-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()`.
------
------
-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.
----
-----------
-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
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.
----
.. c:type:: MEMCACHED_SUCCESS,
+Success
+
.. c:type:: MEMCACHED_FAILURE,
.. c:type:: MEMCACHED_HOST_LOOKUP_FAILURE, // getaddrinfo() only
.. c:type:: MEMCACHED_TIMEOUT,
+Connection to server timed out.
+
.. c:type:: MEMCACHED_BUFFERED,
.. c:type:: MEMCACHED_BAD_KEY_PROVIDED,
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.
------
------
-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.
----
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.
------
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.
------
-----------
-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.
------
------
-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.
----
--------
-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)`
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.
-<memcached_stat_get_value() has been provided to query the structure.
-
-memcached_stat_execute() uses the servers found in \ ``memcached_stat_st``\ and
-executes a "stat" command on each server. args is an optional argument that
-can be passed in to modify the behavior of "stats". You will need to supply
-a callback function that will be supplied each pair of values returned by
+:c:type:`memcached_stat_st` structure. You are responsible for freeing this structure. While it is possible to access the structure directly it is not advisable. :c:func:`memcached_stat_get_value()` has been provided to query the structure.
+
+:c:func:`memcached_stat_execute()` uses the servers found in :c:type:`memcached_stat_st` and executes a "stat" command on each server. args is an optional argument that can be passed in to modify the behavior of "stats". You will need to supply a callback function that will be supplied each pair of values returned by
the memcached server.
-memcached_stat() fetches an array of \ ``memcached_stat_st``\ structures containing
-the state of all available memcached servers. The return value must be freed
-by the calling application. If called with the \ ``MEMCACHED_BEHAVIOR_USE_UDP``\
-behavior set, a NULL value is returned and the error parameter is set to
-\ ``MEMCACHED_NOT_SUPPORTED``\ .
-
-memcached_stat_servername() can be used standalone without a \ ``memcached_st``\ to
-obtain the state of a particular server. "args" is used to define a
-particular state object (a list of these are not provided for by either
-the memcached_stat_get_keys() call nor are they defined in the memcached
-protocol). You must specify the hostname and port of the server you want to
+:c:func:`memcached_stat()` fetches an array of :c:type:`memcached_stat_st` structures containing the state of all available memcached servers. The return value must be freed by the calling application. If called with the :c:type:`MEMCACHED_BEHAVIOR_USE_UDP` behavior set, a NULL value is returned and the error parameter is set to :c:type:`MEMCACHED_NOT_SUPPORTED`.
+
+:c:func:`memcached_stat_servername()` can be used standalone without a :c:type:`memcached_st` to obtain the state of a particular server. "args" is used to define a particular state object (a list of these are not provided for by either
+the :c:func:`memcached_stat_get_keys()` call nor are they defined in the memcached protocol). You must specify the hostname and port of the server you want to
obtain information on.
-memcached_stat_get_value() returns the value of a particular state key. You
-specify the key you wish to obtain. The key must be null terminated.
+:c:func:`memcached_stat_get_value()` returns the value of a particular state key. You specify the key you wish to obtain. The key must be null terminated.
-memcached_stat_get_keys() returns a list of keys that the server has state
-objects on. You are responsible for freeing this list.
+:c:func:`memcached_stat_get_keys()` returns a list of keys that the server has state objects on. You are responsible for freeing this list.
A command line tool, memstat(1), is provided so that you do not have to write
an application to do this.
Varies, see particular functions.
-Any method returning a \ ``memcached_stat_st``\ expects you to free the
+Any method returning a :c:type:`memcached_stat_st` expects you to free the
memory allocated for it.
--------
-memcached(1) libmemcached(3) memcached_strerror(3)
+:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
-----------
-memcached_strerror() takes a \ ``memcached_return_t``\ value and returns a string
-describing the error.
+:c:func:`memcached_strerror()` takes a :c:type:`memcached_return_t` value and returns a string describing the error.
This string must not be modified by the application.
-\ ``memcached_return_t``\ values are returned from nearly all libmemcached(3) functions.
+:c:type:`memcached_return_t` values are returned from nearly all libmemcached(3) functions.
-\ ``memcached_return_t``\ values are of an enum type so that you can set up responses
-with switch/case and know that you are capturing all possible return values.
+:c:type:`memcached_return_t` values are of an enum type so that you can set up responses with switch/case and know that you are capturing all possible return values.
------
------
-memcached_strerror() returns a string describing a \ ``memcached_return_t``\ value.
+:c:func:`memcached_strerror()` returns a string describing a :c:type:`memcached_return_t` value.
----
--------
-memcached(1) libmemcached(3)
+:manpage:`memcached(1)` :manpage:`libmemcached(3)`
libmemcached(3) allows you to store a pointer to a user specific data inside
the memcached_st structure.
-memcached_set_user_data() is used to set the user specific data in the
-memcached_st structure.
+:c:func:`memcached_set_user_data()` is used to set the user specific data in the
+:c:type:`memcached_st` structure.
-memcached_get_user_data() is used to retrieve the user specific data in
-the memcached_st structure.
+:c:func:`memcached_get_user_data()` is used to retrieve the user specific data in the :c:type:`memcached_st` structure.
------
------
-memcached_set_user_data() returns the previous value of the user specific
-data.
+:c:func:`memcached_set_user_data()` returns the previous value of the user specific data.
-memcached_get_user_data() returns the current value uf the user specific
-data.
+:c:func:`memcached_get_user_data()` returns the current value uf the user specific data.
----
--------
-memcached(1) libmemcached(3)
+:manpage:`memcached(1)` :manpage:`libmemcached(3)`
-----------
-memcached_verbosity() modifies the "verbosity" of the
-memcached(1) servers referenced in the \ ``memcached_st``\ parameter.
+:c:func:`memcached_verbosity()` modifies the "verbosity" of the
+memcached(1) servers referenced in the :c:type:`memcached_st` parameter.
------
------
-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.
----
--------
-memcached(1) libmemcached(3) memcached_strerror(3)
+:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
-----------
-memcached_lib_version() is used to return a simple version string representing
-the libmemcached version (client library version, not server version)
+:c:func:`memcached_lib_version()` is used to return a simple version string representing the libmemcached version (client library version, not server version)
-memcached_version() is used to set the major, minor, and micro versions of each
-memcached server being used by the memcached_st connection structure. It returns the
-memcached server return code.
+:c:func:`memcached_version()` is used to set the major, minor, and micro versions of each memcached server being used by the memcached_st connection structure. It returns the memcached server return code.
------
------
-A string with the version of libmemcached driver is returned from
-memcached_lib_version()
+:c:function:`memcached_lib_version()` returns a string with the version of the libmemcached driver.
-A value of type \ ``memcached_return_t``\ is returned from memcached_version()
-On success that value will be \ ``MEMCACHED_SUCCESS``\ . If called with the
-\ ``MEMCACHED_BEHAVIOR_USE_UDP``\ behavior set, the value \ ``MEMCACHED_NOT_SUPPORTED``\
-will be returned. Use memcached_strerror() to translate this value to
+A value of :c:type:`memcached_return_t` is returned from :c:func:'memcached_version()'
+
+On success that value will be :c:type:`MEMCACHED_SUCCESS`.
+
+If called with the :c:func:`MEMCACHED_BEHAVIOR_USE_UDP` behavior set, the value :c:type:`MEMCACHED_NOT_SUPPORTED` will be returned.
+
+Use :c:func:`memcached_strerror()` to translate this value to
a printable string.
--------
-memcached(1) libmemcached(3) memcached_strerror(3)
+:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
.. program:: memcapable
+-----------
+DESCRIPTION
+-----------
+
+:program:`memcapable` connects to the specified memcached server and tries to
+determine its capabilities by running the various commands and verifying
+the response.
+
+
+-----------
+LIMITATIONS
+-----------
+
+
+The current version of memcapable will only verify the binary protocol.
+
+
+-------
+OPTIONS
+-------
+
+
.. option:: -h hostname
Specify the hostname to connect to. The default is \ *localhost*\
Specify the port number to connect to. The default is \ *11211*\
-
-
.. option:: -c
Generate a coredump when it detects an error from the server.
-
-
.. option:: -v
Print out the comparison when it detects an error from the server.
-
-
.. option:: -t n
Set the timeout from an IO operation to/from the server to \ *n*\ seconds.
------------
-DESCRIPTION
------------
-
-\ **memcapable**\ connects to the specified memcached server and tries to
-determine its capabilities by running the various commands and verifying
-the response.
-
-
------------
-LIMITATIONS
------------
-
-
-The current version of memcapable will only verify the binary protocol.
-
----
HOME
.. program:: memcat
-.. option:: --help
-
-----------
DESCRIPTION
-----------
-\ **memcat**\ outputs to stdout the value a single or multiple set of keys
+:program:`memcat` outputs to stdout the value a single or multiple set of keys
stored in a memcached(1) server. If any key is not found an error is returned.
It is similar to the standard UNIX cat(1) utility.
-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 the option:
+
+.. option:: --help
----
--------
-memcached(1) libmemcached(3)
+:manpage:`memcached(1)` :manpage:`libmemcached(3)`
.. program:: memcp
-.. option:: --help
-
-----------
DESCRIPTION
-----------
-\ **memcp**\ copies one or more files into memcached(1) servers.
+:program:`memcp` copies one or more files into memcached(1) servers.
It is similar to the standard UNIX cp(1) command.
The key names will be the names of the files,
without any directory path.
-You can specify servers via the \ **--servers**\ option or via the
-environment variable \ ``MEMCACHED_SERVERS``\. If you do not specify either these, the final value in the command line list is the name of a
-server(s).
-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`
+
+If you do not specify either these, the final value in the command line list is the name of a server(s).
+
+For a full list of operations run the tool with the option:
+
+.. option:: --help
----
--------
-memcached(1) libmemcached(3)
+:manpage:`memcached(1)` :manpage:`libmemcached(3)`
.. program:: memdump
-.. option:: --help
-
-----------
DESCRIPTION
-----------
-\ **memdump**\ dumps a list of "keys" from all servers that
+:program:`memdump` dumps a list of "keys" from all servers that
it is told to fetch from. Because memcached does not guarentee to
provide all keys it is not possible to get a complete "dump".
-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
----
`http://libmemcached.org/ <http://libmemcached.org/>`_
+------
+AUTHOR
+------
+
+
+Brian Aker, <brian@tangent.org>
+
+
--------
SEE ALSO
--------
.. 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
----
`http://libmemcached.org/ <http://libmemcached.org/>`_
+------
+AUTHOR
+------
+
+
+Brian Aker, <brian@tangent.org>
+
+
--------
SEE ALSO
--------
-memcached(1) libmemcached(3)
-
+:manpage:`memcached(1)` :manpage:`libmemcached(3)`
.. 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
----
SEE ALSO
--------
-memcached(1) libmemcached(3)
+:manpage:`memcached(1)` :manpage:`libmemcached(3)`
.. 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.
----
--------
-memcached(1) libmemcached(3)
+:manpage:`memcached(1)` :manpage:`libmemcached(3)`
.. 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/ <http://libmemcached.org/>'_
+
+
+------
+AUTHOR
+------
+
+
+Brian Aker, <brian@tangent.org>
--------
.. 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
----
--------
-memcached(1) libmemcached(3)
+:manpage:`memcached(1)` :manpage:`libmemcached(3)`