src/bin/memstat
src/bin/memtouch
cmake-build-*/
+ccmake-*/
example/memcached_light
example/t/memcached_light
tags
venv/
/infer-out/
-/docs/gh-pages/source/
+/docs/gh-pages/pages/
/docs/gh-pages/build/
function(check_debug)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_options(-O1)
- add_compile_definitions(DEBUG=1)
+ add_definitions(-DDEBUG=1)
foreach(FLAG IN ITEMS
-fno-inline
-fno-omit-frame-pointer
endif()
endif()
else()
- add_compile_definitions(DEBUG=0)
+ add_definitions(-DDEBUG=0)
endif()
endfunction()
pkg_check_modules(${NAME} ${LIB}${ARGN})
endif()
set(${NAME} ${${NAME}_FOUND} PARENT_SCOPE)
- set(${NAME}_LIBRARIES ${${NAME}_LIBRARIES} PARENT_SCOPE)
- set(${NAME}_INCLUDEDIR ${${NAME}_INCLUDEDIR}} PARENT_SCOPE)
+ set(${NAME}_LIBRARIES ${${NAME}_LDFLAGS} PARENT_SCOPE)
+ set(${NAME}_INCLUDEDIR ${${NAME}_INCLUDEDIR} PARENT_SCOPE)
safe_string(${LIB} LIB_CONST)
set(HAVE_${NAME} ${${NAME}_FOUND} PARENT_SCOPE)
-set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake)
-
set(THREADS_PREFER_PTHREAD_FLAG ON)
# globals
endif()
## hashes
-if(ENABLE_FNV64_HASH)
+if(ENABLE_HASH_FNV64)
set(HAVE_FNV64_HASH 1)
endif()
-if(ENABLE_MURMUR_HASH)
+if(ENABLE_HASH_MURMUR)
set(HAVE_MURMUR_HASH 1)
endif()
-if(ENABLE_HSIEH_HASH)
+if(ENABLE_HASH_HSIEH)
set(HAVE_HSIEH_HASH 1)
endif()
set(CMAKE_INSTALL_PREFIX /usr/local
CACHE PATH "install prefix")
-# make test
-
-set(BUILD_TESTING ON
- CACHE STRING "whether to enable build of the test suite")
+option(BUILD_TESTING "whether to enable build of the test suite"
+ OFF)
+option(BUILD_DOCSONLY "build *only* documentation"
+ OFF)
+option(BUILD_DOCS "build documentation"
+ ${BUILD_DOCSONLY})
+option(BUILD_DOCS_HTML "build HTML docs"
+ ${BUILD_DOCS})
+option(BUILD_DOCS_MAN "build manpages"
+ ${BUILD_DOCS})
+option(BUILD_DOCS_MANGZ "gzip manpages"
+ ${BUILD_DOCS_MAN})
+
+option(ENABLE_DTRACE "enable dtrace support"
+ OFF)
+option(ENABLE_HASH_FNV64 "enable fnv64 hash support"
+ ON)
+option(ENABLE_HASH_MURMUR "enable murmur hash support"
+ ON)
+option(ENABLE_HASH_HSIEH "enable hsieh hash support"
+ OFF)
+option(ENABLE_MEMASLAP "enable memaslap client"
+ ON)
+option(ENABLE_SASL "enable SASL support"
+ OFF)
set(ENABLE_SANITIZERS ""
CACHE STRING "sanitizers to enable (e.g. address undefined ...)")
-set(MEMCACHED_BINARY "/usr/bin/memcached"
- CACHE FILEPATH "memcached binary")
-
-# sasl
-
-set(ENABLE_SASL OFF
- CACHE BOOL "enable SASL support")
-
-# hashes
-
-set(ENABLE_FNV64_HASH ON
- CACHE BOOL "enable fnv64 hash support")
-set(ENABLE_MURMUR_HASH ON
- CACHE BOOL "enable murmur hash support")
-set(ENABLE_HSIEH_HASH OFF
- CACHE BOOL "enable hsieh hash support")
-
-# memaslap, needs libevent and stdatomic
-set(ENABLE_MEMASLAP ON
- CACHE BOOL "enable memaslap client")
-
-# dtrace
-
-set(ENABLE_DTRACE OFF
- CACHE BOOL "enable dtrace support")
-
-# docs / sphinx
-
-set(GZIP_MAN ON
- CACHE BOOL "gzip manpages")
-
-set(SPHINX_OPTIONS ""
- CACHE STRING "additional sphinx-build command line options")
-set(SPHINX_THEME "sphinx_rtd_theme"
- CACHE STRING "sphinx HTML theme")
-set(SPHINX_THEME_OPTIONS "'collapse_navigation':False, 'navigation_depth':2, 'titles_only':False, 'includehidden':False"
- CACHE STRING "sphinx HTML theme options")
-set(SPHINX_EXTENSIONS ""
- CACHE STRING "comma separated list of quoted sphinx extensions")
-set(SPHINX_CONF_APPEND ""
- CACHE STRING "append verbatim code to sphinx' conf.py")
+if(BUILD_TESTING)
+ set(MEMCACHED_BINARY "/usr/bin/memcached"
+ CACHE FILEPATH "memcached binary")
+endif()
+
+if(BUILD_DOCS)
+ set(SPHINX_OPTIONS ""
+ CACHE STRING "additional sphinx-build command line options")
+ set(SPHINX_THEME "sphinx_rtd_theme"
+ CACHE STRING "sphinx HTML theme")
+ set(SPHINX_THEME_OPTIONS ""
+ CACHE STRING "sphinx HTML theme options")
+ set(SPHINX_EXTENSIONS ""
+ CACHE STRING "comma separated list of quoted sphinx extensions")
+ set(SPHINX_CONF_APPEND ""
+ CACHE STRING "append verbatim code to sphinx' conf.py")
+endif()
# legacy
# modules
+set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake)
-include(CMake/_Include.cmake)
+if(NOT BUILD_DOCSONLY)
+ include(CMake/_Include.cmake)
+endif()
include(CMakeConfig.txt)
-foreach(INCLUDE IN ITEMS ${CMAKE_BINARY_DIR} .)
- include_directories(
- ${INCLUDE}/
- ${INCLUDE}/include
- ${INCLUDE}/src
+if(NOT BUILD_DOCSONLY)
+ foreach(INCLUDE IN ITEMS ${CMAKE_BINARY_DIR} .)
+ include_directories(
+ ${INCLUDE}/
+ ${INCLUDE}/include
+ ${INCLUDE}/src
+ )
+ endforeach()
+
+ set(AUTOHEADER_FILE mem_config.h)
+
+ set(CLIENTS
+ memcapable
+ memcat
+ memcp
+ memdump
+ memerror
+ memexist
+ memflush
+ memparse
+ memping
+ memrm
+ memslap
+ memstat
+ memtouch
)
-endforeach()
-
-set(AUTOHEADER_FILE mem_config.h)
-
-set(CLIENTS
- memcapable
- memcat
- memcp
- memdump
- memerror
- memexist
- memflush
- memparse
- memping
- memrm
- memslap
- memstat
- memtouch
- )
-add_subdirectory(include)
-add_subdirectory(src)
-add_subdirectory(docs)
-add_subdirectory(support)
+ add_subdirectory(include)
+ add_subdirectory(src)
+ add_subdirectory(support)
+
+ if(BUILD_TESTING)
+ add_subdirectory(tests)
+ endif()
-if(BUILD_TESTING)
- add_subdirectory(tests)
+ # keep last
+ configure_file(src/mem_config.h.in ${AUTOHEADER_FILE} @ONLY)
endif()
-# keep last
-configure_file(src/mem_config.h.in ${AUTOHEADER_FILE} @ONLY)
+if(BUILD_DOCS OR BUILD_DOCSONLY)
+ add_subdirectory(docs)
+endif()
+
+
"${SPHINX_BUILD_DIR}/conf.py"
@ONLY)
- add_custom_target(html
- ${SPHINX_EXECUTABLE}
- -q -b html
- -c "${SPHINX_BUILD_DIR}"
- -d "${SPHINX_CACHE_DIR}"
- ${SPHINX_OPTIONS}
- "${SPHINX_SOURCE_DIR}"
- "${SPHINX_HTML_DIR}"
- BYPRODUCTS ${SPHINX_HTML_DIR}
- )
- add_custom_target(man ALL
- ${SPHINX_EXECUTABLE}
- -q -b man
- -c "${SPHINX_BUILD_DIR}"
- -d "${SPHINX_CACHE_DIR}"
- ${SPHINX_OPTIONS}
- "${SPHINX_SOURCE_DIR}"
- "${SPHINX_MAN_DIR}"
- BYPRODUCTS ${SPHINX_MAN_DIR}
- )
-
- set(MAN_EXT "")
- if(GZIP_MAN)
- find_program(PIGZ pigz)
- if(PIGZ)
- set(GZIP ${PIGZ})
- else()
- find_package(UnixCommands)
- endif()
- if(GZIP)
- set(MAN_EXT ".gz")
- add_custom_target(man_gz ALL
- ${GZIP} -rkf ${SPHINX_MAN_DIR}
- DEPENDS man
- )
+ if(BUILD_DOCS_HTML)
+ add_custom_target(html
+ ${SPHINX_EXECUTABLE}
+ -q -b html
+ -c "${SPHINX_BUILD_DIR}"
+ -d "${SPHINX_CACHE_DIR}"
+ ${SPHINX_OPTIONS}
+ "${SPHINX_SOURCE_DIR}"
+ "${SPHINX_HTML_DIR}"
+ BYPRODUCTS ${SPHINX_HTML_DIR}
+ )
+ endif()
+
+ if(BUILD_DOCS_MAN)
+ add_custom_target(man ALL
+ ${SPHINX_EXECUTABLE}
+ -q -b man
+ -c "${SPHINX_BUILD_DIR}"
+ -d "${SPHINX_CACHE_DIR}"
+ ${SPHINX_OPTIONS}
+ "${SPHINX_SOURCE_DIR}"
+ "${SPHINX_MAN_DIR}"
+ BYPRODUCTS ${SPHINX_MAN_DIR}
+ )
+
+ set(MAN_EXT "")
+ if(BUILD_DOCS_MANGZ)
+ find_program(PIGZ pigz)
+ if(PIGZ)
+ set(GZIP ${PIGZ})
+ else()
+ find_package(UnixCommands)
+ endif()
+ if(GZIP)
+ set(MAN_EXT ".gz")
+ add_custom_target(man_gz ALL
+ ${GZIP} -kf ${SPHINX_MAN_DIR}/*.{1,3}
+ DEPENDS man
+ )
+ endif()
endif()
+
+ install(DIRECTORY ${SPHINX_MAN_DIR}/
+ DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
+ FILES_MATCHING PATTERN *.1${MAN_EXT}
+ )
+ install(DIRECTORY ${SPHINX_MAN_DIR}/
+ DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
+ FILES_MATCHING PATTERN *.3${MAN_EXT}
+ )
endif()
- install(DIRECTORY ${SPHINX_MAN_DIR}/
- DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
- FILES_MATCHING PATTERN *.1${MAN_EXT}
- )
- install(DIRECTORY ${SPHINX_MAN_DIR}/
- DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
- FILES_MATCHING PATTERN *.3${MAN_EXT}
- )
endif()
set -eu
cd "$(dirname $0)"
-if test -d source/.git
+if test -d pages/.git
then
- cd source
+ cd pages
git pull -r
cd ..
else
- git clone -b gh-pages github.com:m6w6/libmemcached source
+ git clone -b gh-pages github.com:m6w6/libmemcached pages
fi
mkdir -p build
cd build
-cmake ../..
+cmake -DBUILD_DOCSONLY=true -DBUILD_DOCS_HTML=true ../../..
make html
-rsync -va --delete --exclude=.git/ docs/html/ ../source/
+rsync -va --delete --exclude=.git/ docs/html/ ../pages/
-cd ../source
+cd ../pages
touch .nojekyll
git add -A
git ci -m "update docs"
--- /dev/null
+Client Applications
+===================
+
+Data Manipulation
+-----------------
+
+.. toctree::
+ :titlesonly:
+
+ memexist — Check for the existence of a key <memexist>
+ memcat — "cat" data from a server <memcat>
+ memcp — "cp" files to a server <memcp>
+ memtouch — "touch" a key <memtouch>
+ memrm – "rm" a key <memrm>
+
+Tests and Analysis
+------------------
+
+.. toctree::
+ :titlesonly:
+
+ memaslap
+ memslap
+ memping – Ping a server <memping>
+ memstat – Gather statistics from a server <memstat>
+ memerror — Translate libmemcached error codes <memerror>
+ memparse — Parse and validate an option string <memparse>
+ memcapable — Check a server's capabilities and compatibility <memcapable>
+
+Server Administration
+---------------------
+
+.. toctree::
+ :titlesonly:
+
+ memdump — Dump a server's data <memdump>
+ memflush — Flush a server (erase all cached data) <memflush>
memaslap - Load testing and benchmarking a server
==================================================
-
---------
SYNOPSIS
--------
.. envvar:: MEMCACHED_SERVERS
------------
DESCRIPTION
-----------
-
:program:`memaslap` is a load generation and benchmark tool for memcached
-servers. It generates configurable workload such as threads, concurrencies,
+servers. It generates configurable workload such as threads, concurrency,
connections, run time, overwrite, miss rate, key size, value size, get/set
-proportion, expected throughput, and so on. Furthermore, it also testss data
+proportion, expected throughput, and so on. Furthermore, it also tests data
verification, expire-time verification, UDP, binary protocol, facebook test,
replication test, multi-get and reconnection, etc.
You can specify servers via the :option:`memslap --servers` option or via the
environment variable :envvar:`MEMCACHED_SERVERS`.
-
---------
FEATURES
--------
-
Memslap is developed to for the following purposes:
-
Manages network connections with libevent asynchronously.
-
-
Set both TCP and UDP up to use non-blocking IO.
-
-
Improves parallelism: higher performance in multi-threads environments.
-
-
Improves time efficiency: faster processing speed.
-
-
Generates key and value more efficiently; key size distribution and value size distribution are configurable.
-
-
Supports get, multi-get, and set commands; command distribution is configurable.
-
-
Supports controllable miss rate and overwrite rate.
-
-
Supports data and expire-time verification.
-
-
Supports dumping statistic information periodically.
-
-
Supports thousands of TCP connections.
-
-
Supports binary protocol.
-
-
Supports facebook test (set with TCP and multi-get with UDP) and replication test.
-
-
-
--------
DETAILS
-------
-
Effective implementation of network.
____________________________________
-
For memaslap, both TCP and UDP use non-blocking network IO. All
the network events are managed by libevent as memcached. The network module
of memaslap is similar to memcached. Libevent can ensure
memaslap can handle network very efficiently.
-
Effective implementation of multi-threads and concurrency
_________________________________________________________
-
Memslap has the similar implementation of multi-threads to
memcached. Memslap creates one or more self-governed threads;
-each thread is bound with one CPU core if the system testss setting CPU
+each thread is bound with one CPU core if the system tests setting CPU
core affinity.
In addition, each thread has a libevent to manage the events of the network;
-each thread has one or more self-governed concurrencies; and each
-concurrency has one or more socket connections. All the concurrencies don’t
+each thread has one or more self-governed concurrency; and each
+concurrency has one or more socket connections. All the concurrent tasks don't
communicate with each other even though they are in the same thread.
Memslap can create thousands of socket connections, and each
concurrency and socket connections of each concurrency according to their
expected workload.
-
Effective implementation of generating key and value
____________________________________________________
-
-In order to improve time efficiency and space efficiency,
+In order to improve time efficiency and space efficiency,
memaslap creates a random characters table with 10M characters. All the
suffixes of keys and values are generated from this random characters table.
Each key contains two parts, a prefix and a suffix. The prefix is an
uint64_t, 8 bytes. In order to verify the data set before,
memaslap need to ensure each key is unique, so it uses the prefix to identify
-a key. The prefix cannot include illegal characters, such as ‘\r’, ‘\n’,
-‘\0’ and ‘ ‘. And memaslap has an algorithm to ensure that.
+a key. The prefix cannot include illegal characters, such as '\r', '\n',
+'\0' and ' '. And memaslap has an algorithm to ensure that.
-Memslap doesn’t generate all the objects (key-value pairs) at
+Memslap doesn't generate all the objects (key-value pairs) at
the beginning. It only generates enough objects to fill the task window
(default 10K objects) of each concurrency. Each object has the following
basic information, key prefix, key suffix offset in the character table, key
time, each concurrency kicks objects out of its window and adds new object
into it.
-
Simple but useful task scheduling
_________________________________
-
-Memslap uses libevent to schedule all the concurrencies of
+Memslap uses libevent to schedule all concurrent tasks of
threads, and each concurrency schedules tasks based on the local task
window. Memslap assumes that if each concurrency keeps the same
key distribution, value distribution and commands distribution, from
specify the window size to get the expected miss rate of the first cache
layer.
-
Useful implementation of multi-servers , UDP, TCP, multi-get and binary protocol
________________________________________________________________________________
-
Because each thread is self-governed, memaslap can assign
different threads to handle different memcached servers. This is just one of
the ways in which memaslap tests multiple servers. The only
multi-get option, memaslap will collect enough get commands and
pack and send the commands together.
-Memslap testss both the ASCII protocol and binary protocol,
+Memslap tests both the ASCII protocol and binary protocol,
but it runs on the ASCII protocol by default.
Memslap by default runs on the TCP protocol, but it also
tests UDP. Because UDP is unreliable, dropped packages and out-of-order
get lost, the waiting timeout mechanism can ensure half-baked packages will
be discarded and the next command will be sent.
-
-
------
USAGE
-----
-
Below are some usage samples:
-
memaslap -s 127.0.0.1:11211 -S 5s
-
-
memaslap -s 127.0.0.1:11211 -t 2m -v 0.2 -e 0.05 -b
-
-
memaslap -s 127.0.0.1:11211 -F config -t 2m -w 40k -S 20s -o 0.2
-
-
memaslap -s 127.0.0.1:11211 -F config -t 2m -T 4 -c 128 -d 20 -P 40k
-
-
memaslap -s 127.0.0.1:11211 -F config -t 2m -d 50 -a -n 40
-
-
memaslap -s 127.0.0.1:11211,127.0.0.1:11212 -F config -t 2m
-
-
memaslap -s 127.0.0.1:11211,127.0.0.1:11212 -F config -t 2m -p 2
-
-
The user must specify one server at least to run memaslap. The
rest of the parameters have default values, as shown below:
-Thread number = 1 Concurrency = 16
+Thread number = 1 Concurrency = 16
Run time = 600 seconds Configuration file = NULL
Get/set = 9:1 Window size = 10k
-Execute number = 0 Single get = true
+Execute number = 0 Single get = true
-Multi-get = false Number of sockets of each concurrency = 1
+Multi-get = false Number of sockets of each concurrency = 1
Reconnect = false Data verification = false
-Expire-time verification = false ASCII protocol = true
-
-Binary protocol = false Dumping statistic information
+Expire-time verification = false ASCII protocol = true
-periodically = false
+Binary protocol = false Dumping statistic information periodically = false
Overwrite proportion = 0% UDP = false
-TCP = true Limit throughput = false
+TCP = true Limit throughput = false
-Facebook test = false Replication test = false
+Facebook test = false Replication test = false
Key size, value size and command distribution.
______________________________________________
-
All the distributions are read from the configuration file specified by user
-with “—cfg_cmd” option. If the user does not specify a configuration file,
+with "—cfg_cmd" option. If the user does not specify a configuration file,
memaslap will run with the default distribution (key size = 64,
value size = 1024, get/set = 9:1). For information on how to edit the
-configuration file, refer to the “Configuration File” section.
+configuration file, refer to the "Configuration File" section.
The minimum key size is 16 bytes; the maximum key size is 250 bytes. The
precision of proportion is 0.001. The proportion of distribution will be
The minimum value size is 1 bytes; the maximum value size is 1M bytes. The
precision of proportion is 0.001. The proportion of distribution will be
rounded to 3 decimal places.
-Currently, memaslap only testss set and get commands. And it
+Currently, memaslap only tests set and get commands. And it
testss 100% set and 100% get. For 100% get, it will preset some objects to
the server.
-
Multi-thread and concurrency
____________________________
-
The high performance of memaslap benefits from the special
-schedule of thread and concurrency. It’s important to specify the proper
+schedule of thread and concurrency. It's important to specify the proper
number of them. The default number of threads is 1; the default number of
-concurrency is 16. The user can use “—threads” and “--concurrency” to
+concurrency is 16. The user can use "—threads" and "--concurrency" to
specify these variables.
If the system tests setting CPU affinity and the number of threads
are two ways to do this:
Decrease the number of threads and concurrencies.
-Use the option “--tps” that memaslap
+Use the option "--tps" that memaslap
provides to limit the throughput. This option allows
the user to get the expected throughput. For
example, assume that the maximum throughput is 50
kops/s for a specific configuration, you can specify
the throughput equal to or less than the maximum
-throughput using “--tps” option.
-
+throughput using "--tps" option.
Window size
___________
-
Most of the time, the user does not need to specify the window size. The
default window size is 10k. For Schooner Memcached, the user can specify
different window sizes to get different cache miss rates based on the test
cache_size / concurrency / (key_size + value_size) \* 0.7
-
Verification
____________
-
Memslap testss both data verification and expire-time
verification. The user can use "--verify=" or "-v" to specify the proportion
of data verification. In theory, it testss 100% data verification. The
verification. Specify the "--verbose" options to get more detailed error
information.
-For example: --exp_verify=0.01 –verify=0.1 , it means that 1% of the objects
+For example: --exp_verify=0.01 –verify=0.1 , it means that 1% of the objects
set with expire-time, 10% of the objects gotten will be verified. If the
objects are gotten, memaslap will verify the expire-time and
value.
-
multi-servers and multi-config
_______________________________
-
Memslap testss multi-servers based on self-governed thread.
There is a limitation that the number of servers cannot be greater than the
number of threads. Memslap assigns one thread to handle one
All the threads and concurrencies in memaslap are self-governed.
-So is memaslap. The user can start up several
+So is memaslap. The user can start up several
memaslap instances. The user can run memaslap on different client
machines to communicate with the same memcached server at the same. It is
recommended that the user start different memaslap on different
machines using the same configuration.
-
Run with execute number mode or time mode
_________________________________________
-
The default memaslap runs with time mode. The default run time
is 10 minutes. If it times out, memaslap will exit. Do not
specify both execute number mode and time mode at the same time; just
--execute_number=100000 (It means that after running 100000 commands, the test will exit.)
-
Dump statistic information periodically.
________________________________________
-
The user can use "--stat_freq=" or "-S" to specify the frequency.
For example:
Memslap will dump the statistics of the commands (get and set) at the frequency of every 20
seconds.
-For more information on the format of dumping statistic information, refer to “Format of Output” section.
-
+For more information on the format of dumping statistic information, refer to "Format of Output" section.
Multi-get
_________
-
The user can use "--division=" or "-d" to specify multi-get keys count.
Memslap by default does single get with TCP. Memslap also testss data
verification and expire-time verification for multi-get.
Memslap testss multi-get with both TCP and UDP. Because of
the different implementation of the ASCII protocol and binary protocol,
there are some differences between the two. For the ASCII protocol,
-memaslap sends one “multi-get” to the server once. For the
+memaslap sends one "multi-get" to the server once. For the
binary protocol, memaslap sends several single get commands
-together as “multi-get” to the server.
-
+together as "multi-get" to the server.
UDP and TCP
___________
-
Memslap testss both UDP and TCP. For TCP,
memaslap does not reconnect the memcached server if socket connections are
lost. If all the socket connections are lost or memcached server crashes,
-memaslap will exit. If the user specifies the “--reconnect”
+memaslap will exit. If the user specifies the "--reconnect"
option when socket connections are lost, it will reconnect them.
-User can use “--udp” to enable the UDP feature, but UDP comes with some
+User can use "--udp" to enable the UDP feature, but UDP comes with some
limitations:
UDP cannot set data more than 1400 bytes.
-UDP is not testsed by the binary protocol because the binary protocol of
+UDP is not tested by the binary protocol because the binary protocol of
memcached does not tests that.
-UDP doesn’t tests reconnection.
-
+UDP doesn't tests reconnection.
Facebook test
_____________
-
Set data with TCP and multi-get with UDP. Specify the following options:
"--facebook --division=50"
If you specify "--division=50", the key size must be less that 25 bytes
because the UDP packet size is 1400 bytes.
-
Replication test
________________
-
For replication test, the user must specify at least two memcached servers.
-The user can use “—rep_write=” option to enable feature.
+The user can use "—rep_write=" option to enable feature.
For example:
back to life again, memaslap will reconnect server 0. If both
server 0 and server 1 crash, memaslap will exit.
-
Supports thousands of TCP connections
_____________________________________
-
Start memaslap with "--conn_sock=" or "-n" to enable this
feature. Make sure that your system can tests opening thousands of files
and creating thousands of sockets. However, this feature does not tests
connections, and the total number of TCP socket connections is 128 \* 128 =
16384.
-
Supports binary protocol
________________________
-
Start memaslap with "--binary" or "-B" options to enable this
feature. It testss all the above features except UDP, because the latest
memcached 1.3.3 does not implement binary UDP protocol.
Since memcached 1.3.3 doesn't implement binary UDP protocol,
memaslap does not tests UDP. In addition, memcached 1.3.3 does not tests
multi-get. If you specify "--division=50" option, it just sends 50 get
-commands together as “mulit-get” to the server.
-
+commands together as "multi-get" to the server.
-
-------------------
Configuration file
------------------
-
This section describes the format of the configuration file. By default
when no configuration file is specified memaslap reads the default
one located at ~/.memaslap.cnf.
Below is a sample configuration file:
-
.. code-block:: perl
---------------------------------------------------------------------------
0 0.1
1.0 0.9
-
-
-----------------
Format of output
----------------
-
At the beginning, memaslap displays some configuration information as follows:
-
servers : 127.0.0.1:11211
-
-
threads count: 1
-
-
concurrency: 16
-
-
run time: 20s
-
-
windows size: 10k
-
-
set proportion: set_prop=0.10
-
-
get proportion: get_prop=0.90
-
-
Where
_____
-
-
servers : "servers"
The servers used by memaslap.
-
-
threads count
The number of threads memaslap runs with.
-
-
concurrency
The number of concurrencies memaslap runs with.
-
-
run time
How long to run memaslap.
-
-
windows size
The task window size of each concurrency.
-
-
set proportion
The proportion of set command.
-
-
get proportion
The proportion of get command.
-
-
The output of dynamic statistics is something like this:
-
.. code-block:: perl
---------------------------------------------------------------------------------------------------------------------------------
95.43 177.29
Global 20 1257935 62896 71.8 0 26 3791 224
117.79 192.60
-
-
Set Statistics
+
Type Time(s) Ops TPS(ops/s) Net(M/s) Get_miss Min(us) Max(us)
Avg(us) Std_dev Geo_dist
Period 5 38425 7685 7.3 0 42 628 240
88.05 220.21
Global 20 139780 6989 8.0 0 37 3790 253
117.93 224.83
-
-
Total Statistics
+
Type Time(s) Ops TPS(ops/s) Net(M/s) Get_miss Min(us) Max(us)
Avg(us) Std_dev Geo_dist
Period 5 384252 76850 72.5 0 27 2198 207
117.93 195.60
---------------------------------------------------------------------------------------------------------------------------------
-
-
Where
_____
-
-
Get Statistics
Statistics information of get command
-
-
Set Statistics
Statistics information of set command
-
-
Total Statistics
Statistics information of both get and set command
-
-
Period
Result within a period
-
-
Global
Accumulated results
-
-
Ops
Total operations
-
-
TPS
Throughput, operations/second
-
-
Net
The rate of network
-
-
Get_miss
- How many objects can’t be gotten
-
-
+ How many objects can't be gotten
Min
The minimum response time
-
-
Max
The maximum response time
-
-
Avg:
The average response time
-
-
Std_dev
Standard deviation of response time
-
-
Geo_dist
Geometric distribution based on natural exponential function
-
-
At the end, memaslap will output something like this:
-
.. code-block:: perl
---------------------------------------------------------------------------------------------------------------------------------
Run time: 20.0s Ops: 1397754 TPS: 69817 Net_rate: 59.4M/s
---------------------------------------------------------------------------------------------------------------------------------
-
-
Where
_____
-
-
Get Statistics
Get statistics of response time
-
-
Set Statistics
Set statistics of response time
-
-
Total Statistics
Both get and set statistics of response time
-
-
Min
The accumulated and minimum response time
-
-
Max
The accumulated and maximum response time
-
-
Avg
The accumulated and average response time
-
-
Std
Standard deviation of response time
-
-
Log2 Dist
Geometric distribution based on logarithm 2
-
-
cmd_get
Total get commands done
-
-
cmd_set
Total set commands done
-
-
get_misses
- How many objects can’t be gotten from server
-
-
+ How many objects can't be gotten from server
verify_misses
- How many objects need to verify but can’t get them
-
-
+ How many objects need to verify but can't get them
verify_failed
How many objects with insistent value
-
-
expired_get
How many objects are expired but we get them
-
-
unexpired_unget
- How many objects are unexpired but we can’t get them
-
-
+ How many objects are unexpired but we can't get them
written_bytes
Total written bytes
-
-
read_bytes
Total read bytes
-
-
object_bytes
Total object bytes
-
-
packet_disorder
How many UDP packages are disorder
-
-
packet_drop
How many UDP packages are lost
-
-
udp_timeout
How many times UDP time out happen
-
-
Run time
Total run time
-
-
Ops
Total operations
-
-
TPS
Throughput, operations/second
-
-
Net_rate
The average rate of network
-
-
-
-
--------
OPTIONS
-------
-
-s, --servers=
List one or more servers to connect. Servers count must be less than
threads count. e.g.: --servers=localhost:1234,localhost:11211
The proportion of objects need overwrite, e.g.: --overwrite=0.01.
Default never overwrite object.
--R, --reconnect
+-R, --reconnect
Reconnect tests, when connection is closed it will be reconnected.
--U, --udp
+-U, --udp
UDP tests, default memaslap uses TCP, TCP port and UDP port of
server must be same.
--a, --facebook
+-a, --facebook
Whether it enables facebook test feature, set with TCP and multi-get with UDP.
--B, --binary
+-B, --binary
Whether it enables binary protocol. Default with ASCII protocol.
-P, --tps=
-p, --rep_write=
The first nth servers can write data, e.g.: --rep_write=2.
--b, --verbose
+-b, --verbose
Whether it outputs detailed information when verification fails.
--h, --help
+-h, --help
Display this message and then exit.
--V, --version
+-V, --version
Display the version of the application and then exit.
-
---------
EXAMPLES
--------
-
memaslap -s 127.0.0.1:11211 -S 5s
memaslap -s 127.0.0.1:11211 -t 2m -v 0.2 -e 0.05 -b
memaslap -s 127.0.0.1:11211,127.0.0.1:11212 -F config -t 2m -p 2
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
--------
-AUTHORS
--------
-
-
-Mingqiang Zhuang <mingqiangzhuang@hengtiansoft.com> (Schooner Technolgy)
-Brian Aker, <brian@tangent.org>
-
-
---------
SEE ALSO
--------
-:manpage:`memcached(1)` :manpage:`libmemcached(3)`
+.. only:: man
+
+ :manpage:`memcached(1)` :manpage:`libmemcached(3)`
-=======================================================================
-memcapable - Checking a Memcached server capibilities and compatibility
-=======================================================================
+memcapable
+==========
---------
SYNOPSIS
--------
+.. program:: memcapable
+
memcapable [options]
-.. program:: memcapable
+Check a memcached server's capabilities and compatibility.
------------
DESCRIPTION
-----------
:program:`memcapable` connects to the specified memcached server and tries to
-determine its capabilities by running the various commands and verifying
-the response.
-
+determine its capabilities by running 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*\
-.. option:: -p port
-
-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.
-
+ Specify the hostname to connect to. The default is \ *localhost*\ .
-----
-HOME
-----
+.. option:: -p port
+ Specify the port number to connect to. The default is \ *11211*\ .
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
+.. option:: -c
+ :manpage:`abort(3)` when detecting an error from the server.
-------
-AUTHOR
-------
+.. option:: -v
+ Print out the comparison when it detects an error from the server.
-Trond Norbye, <trond.norbye@gmail.com>
+.. option:: -t n
+ Set the timeout for an IO operation to/from the server to \ *n*\ seconds.
---------
SEE ALSO
--------
-:manpage:`memcached(1)` :manpage:`libmemcached(3)`
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+
+.. only:: html
+ * :doc:`/libmemcached`
-=================================
-memcat - "cat" data from a server
-=================================
+memcat
+======
-
-
---------
SYNOPSIS
--------
-memcat [options] key
-
-Copy a set of keys to stdout
-
-
.. program:: memcat
+memcat [options] key [key...]
+
+Read and output the value of one key or the values of a set of keys.
------------
DESCRIPTION
-----------
+:program:`memcat` reads and outputs the value of a single or a set of keys
+stored in a :manpage:`memcached(1)` server.
-: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.
+If any key is not found an error is returned.
+It is similar to the standard UNIX :manpage:`cat(1)` utility.
--------
OPTIONS
-------
+.. include:: options/all.rst
+.. include:: options/common.rst
+.. include:: options/hash.rst
-You can specify servers via the option:
-
-.. cmdoption:: --servers
-
-or via the environment variable:
+.. option:: --flag
-.. envvar:: `MEMCACHED_SERVERS`
+ Display stored flags.
-For a full list of operations run the tool with the option:
-
-.. cmdoption:: --help
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
-------
-AUTHOR
-------
-
-
-Brian Aker, <brian@tangent.org>
+ENVIRONMENT
+-----------
-Mark Atwood <mark@fallenpegasus.com>
+.. envvar:: MEMCACHED_SERVERS
+ Specify a list of servers.
---------
SEE ALSO
--------
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`libmemcached_configuration(3)`
-:manpage:`memcached(1)` :manpage:`libmemcached(3)`
+.. only:: html
+ * :doc:`/libmemcached`
+ * :doc:`/libmemcached/configuration`
-=============================
-memcp - Copy data to a server
-=============================
+memcp
+=====
-
-Copies files to a collection of memcached servers
-
-
---------
SYNOPSIS
--------
-memcp [options] [file] [server]
-
.. program:: memcp
+memcp [options] \-\-servers <hostname[:port]...> <file...>
+
+Copy files to a collection of memcached servers.
------------
DESCRIPTION
-----------
+:program:`memcp` copies one or more files into :manpage:`memcached(1)` servers.
+It is similar to the standard UNIX :manpage:`cp(1)` command.
-: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.
+The key names will be the names of the files, without any directory path.
-
--------
OPTIONS
-------
+.. include:: options/all.rst
+.. include:: options/common.rst
+.. include:: options/expire.rst
+.. include:: options/flag.rst
+.. include:: options/hash.rst
+.. include:: options/sasl.rst
+.. include:: options/udp.rst
-You can specify servers via the option:
+.. option:: --buffer
-.. option:: --servers
+ Enable internal buffering of commands.
-or via the environment variable:
+.. option:: --set
-.. envvar:: `MEMCACHED_SERVERS`
+ Issue *SET* command(s). This is the default mode.
+ See also :option:`--add` and :option:`--replace`.
-If you do not specify either these, the final value in the command line list is the name of a server(s).
+.. option:: --add
-For a full list of operations run the tool with the option:
+ Issue *ADD* command(s).
-.. option:: --help
+.. option:: --replace
+ Issue *REPLACE* command(s).
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
-------
-AUTHOR
-------
-
-
-Brian Aker, <brian@tangent.org>
+ENVIRONMENT
+-----------
-Mark Atwood, <mark@fallenpegasus.com>
+.. envvar:: MEMCACHED_SERVERS
+ Specify the list of servers.
---------
SEE ALSO
--------
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_behavior(3)`
-:manpage:`memcached(1)` :manpage:`libmemcached(3)`
+.. only:: html
+ * :doc:`/libmemcached`
+ * :doc:`/libmemcached/configuration`
+ * :doc:`/libmemcached/memcached_behavior`
-=============================
-memdump - Dumping your server
-=============================
+memdump
+=======
-
-Dump a list of keys from a server.
-
-
---------
SYNOPSIS
--------
+.. program:: memdump
+
memdump [options]
-.. program:: memdump
+Dump a list of keys from a server.
------------
DESCRIPTION
-----------
-
-:program:`memdump` dumps a list of "keys" from all servers that
-it is told to fetch from. Because memcached does not guarentee to
+:program:`memdump` dumps a list of "keys" from all servers that
+it is told to fetch from. Because memcached does not guarantee to
provide all keys it is not possible to get a complete "dump".
-
--------
OPTIONS
-------
+.. include:: options/all.rst
+.. include:: options/common.rst
+.. include:: options/hash.rst
+.. include:: options/sasl.rst
-For a full list of operations run the tool with option:
-
-.. option:: --help
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
+ENVIRONMENT
+-----------
+.. envvar:: MEMCACHED_SERVERS
-------
-AUTHOR
-------
+ Specify the list of servers.
+SEE ALSO
+--------
-Brian Aker, <brian@tangent.org>
+.. only:: man
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
---------
-SEE ALSO
---------
+.. only:: html
-:manpage:`memcached(1)` :manpage:`libmemcached(3)`
+ * :doc:`/libmemcached`
+ * :doc:`/libmemcached/memcached_dump`
-==============================================
-memerror - translate an error code to a string
-==============================================
+memerror
+========
-
-Translates a memcached error code into a string
-
-
---------
SYNOPSIS
--------
-memerror [options] [error code]
-
.. program:: memerror
------------
+memerror [options] <error code>
+
+Translate a memcached error code into a string.
+
DESCRIPTION
-----------
-
-:program:`memerror` translates an error code from libmemcached(3) into a human
+:program:`memerror` translates an error code from `libmemcached` into a human
readable string.
-
--------
OPTIONS
-------
+.. include:: options/all.rst
-For a full list of operations run the tool with option:
-
-.. option:: --help
-
-
-----
-HOME
-----
-
-
-To find out more infoerroration please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
-------
-AUTHOR
-------
-
+ENVIRONMENT
+-----------
-Brian Aker, <brian@tangent.org>
+.. envvar:: MEMCACHED_SERVERS
+ Specify the list of servers.
---------
SEE ALSO
--------
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+
+.. only:: html
-:manpage:`memcached(1)` :manpage:`libmemcached(3)`
+ * :doc:`/libmemcached`
+ * :doc:`/libmemcached/index_errors`
-===========================================
-memexist - Check for the existance of a key
-===========================================
+memexist
+========
-
---------
SYNOPSIS
--------
-memexist [options] [key]
-
.. program:: memexist
+memexist [options] <key>
+
+Check for the existence of a key.
------------
DESCRIPTION
-----------
-:program:`memexist` checks for the existance of a key within a cluster.
-
+:program:`memexist` checks for the existence of a key within a cluster.
--------
OPTIONS
-------
+.. include:: options/all.rst
+.. include:: options/common.rst
+.. include:: options/hash.rst
+.. include:: options/sasl.rst
-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
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
-------
-AUTHOR
-------
+ENVIRONMENT
+-----------
+.. envvar:: MEMCACHED_SERVERS
-Brian Aker, <brian@tangent.org>
+ Specify the list of servers.
---------
SEE ALSO
--------
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
-:manpage:`memcached(1)` :manpage:`libmemcached(3)`
+.. only:: html
+ * :doc:`/libmemcached`
+ * :doc:`/libmemcached/memcached_exist`
-=======================================
-memflush - flush all data from a server
-=======================================
+memflush
+========
-
-Reset a server or list of servers
-
-
---------
SYNOPSIS
--------
.. program:: memflush
------------
+Reset a server or list of servers
+
DESCRIPTION
-----------
+:program:`memflush` resets the contents of :manpage:`memcached(1)` servers.
-:program:`memflush` resets the contents of memcached(1) servers.
-This means that all data in the specified servers will be deleted.
+.. warning::
+ This means that all data in the specified servers will be deleted.
--------
OPTIONS
-------
+.. include:: options/all.rst
+.. include:: options/common.rst
+.. include:: options/sasl.rst
+.. include:: options/expire.rst
-You can specify servers via the option:
+.. note::
-.. option:: --servers
+ Using an expiration time (period), all keys, which have not bean updated until expiration will cease to exist.
-or via the environment variable:
+ Quoting the `memcached protocol documentation`_, it states:
-.. envvar:: `MEMCACHED_SERVERS`
+ Its effect is to invalidate all
+ existing items immediately (by default) or after the expiration
+ specified. After invalidation none of the items will be returned in
+ response to a retrieval command (unless it's stored again under the
+ same key *after* flush_all has invalidated the items).
-For a full list of operations run the tool with option:
+ The most precise
+ definition of what flush_all does is the following: it causes all
+ items whose update time is earlier than the time at which flush_all
+ was set to be executed to be ignored for retrieval purposes.
-.. option:: --help
+ The intent of flush_all with a delay, was that in a setting where you
+ have a pool of memcached servers, and you need to flush all content,
+ you have the option of not resetting all memcached servers at the
+ same time (which could e.g. cause a spike in database load with all
+ clients suddenly needing to recreate content that would otherwise
+ have been found in the memcached daemon).
+.. _memcached protocol documentation: https://github.com/memcached/memcached/blob/master/doc/protocol.txt
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
+ENVIRONMENT
+-----------
-------
-AUTHOR
-------
+.. envvar:: MEMCACHED_SERVERS
+ Specify the list of servers.
-Brian Aker, <brian@tangent.org>
+SEE ALSO
+--------
-Mark Atwood <mark@fallenpegasus.com>
+.. only:: man
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
---------
-SEE ALSO
---------
+.. only:: html
-:manpage:`memcached(1)` :manpage:`libmemcached(3)`
+* :doc:`/libmemcached`
+* :doc:`/libmemcached/memcached_flush`
-=================================
-memparse - Parse an option string
-=================================
+memparse
+========
-
-Used to validate an option string
-
-
---------
SYNOPSIS
--------
-memparse [options] "option string"
-
.. program:: memparse
+memparse <option string>
+
+Parse and validate an option string.
------------
DESCRIPTION
-----------
-
:program:`memparse` can be used to validate an option string.
--------
OPTIONS
-------
-For a full list of operations run the tool with the option:
-
-.. option:: --help
-
+None.
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
-------
-AUTHOR
-------
-
-
-Brian Aker, <brian@tangent.org>
-
---------
SEE ALSO
--------
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`libmemcached_configuration(3)`
+
+.. only:: html
-:manpage:`memcached(1)` :manpage:`libmemcached(3)`
+ * :doc:`/libmemcached`
+ * :doc:`/libmemcached/configuration`
-===============================================
-memping - Test to see if a server is available.
-===============================================
+memping
+=======
-
---------
SYNOPSIS
--------
.. program:: memping
+Test for availability of a server
------------
DESCRIPTION
-----------
+:program:`memping` can be used to ping a memcached server to see if it is accepting connections.
-:program:`memping` can be used to ping a memcached server to see if it is taking connections.
-
--------
OPTIONS
-------
+.. include:: options/all.rst
+.. include:: options/common.rst
+.. include:: options/sasl.rst
-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
-
-
-----
-HOME
-----
+ENVIRONMENT
+-----------
+.. envvar:: MEMCACHED_SERVERS
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
+ Specify the list of servers.
+SEE ALSO
+--------
-------
-AUTHOR
-------
+.. only:: man
-Brian Aker, <brian@tangent.org>
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
---------
-SEE ALSO
---------
+.. only:: html
-:manpage:`memcached(1)` :manpage:`libmemcached(3)`
+* :doc:`/libmemcached`
-=================================
-memrm - Remove data from a server
-=================================
+memrm
+=====
-
-memrm - Remove a key(s) from a collection of memcached servers
-
-
---------
SYNOPSIS
--------
-memrm [options] [key]
+memrm [options] <key ...>
.. program:: memrm
+Remove key(s) from a collection of memcached servers
------------
DESCRIPTION
-----------
+:program:`memrm` removes items, specified by key, from :manpage:`memcached(1)` servers.
-:program:`memrm` removes items, specified by key, from memcached(1) servers.
-
-
--------
OPTIONS
-------
+.. include:: options/all.rst
+.. include:: options/common.rst
+.. include:: options/hash.rst
+.. include:: options/sasl.rst
-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
-
-
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
-------
-AUTHOR
-------
-
-
-Brian Aker, <brian@tangent.org>
+ENVIRONMENT
+-----------
-Mark Atwood, <mark@fallenpegasus.com>
+.. envvar:: MEMCACHED_SERVERS
+ Specify the list of servers.
---------
SEE ALSO
--------
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
-:manpage:`memcached(1)` :manpage:`libmemcached(3)`
+.. only:: html
+* :doc:`/libmemcached`
+* :doc:`/libmemcached/memcached_delete`
-=================================================
-memslap - Load testing and benchmarking a server
-=================================================
+memslap
+=======
-
---------
SYNOPSIS
--------
.. program:: memslap
------------
+Load testing and benchmarking a server
+
DESCRIPTION
-----------
+:program:`memslap` is a load generation and benchmark tool for :manpage:`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.
-: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.
-
-
--------
OPTIONS
-------
+.. include:: options/all.rst
+.. include:: options/common.rst
-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
-------
-
+ENVIRONMENT
+-----------
-Brian Aker, <brian@tangent.org>
+.. envvar:: MEMCACHED_SERVERS
+ Specify the list of servers.
---------
SEE ALSO
--------
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+
+.. only:: html
-:manpage:`memcached(1)` :manpage:`libmemcached(3)`
+* :doc:`/libmemcached`
-=========================================
-memstat - Gather statistics from a server
-=========================================
+memstat
+=======
-
-memstat - Display the operating status of a single or group of memcached servers
-
-
---------
SYNOPSIS
--------
.. program:: memstat
------------
+Gather statistics from a server
+
DESCRIPTION
-----------
+:program:`memstat` dumps the state of :manpage:`memcached(1)` servers.
+It prints all data to stdout.
-:program:`memstat` dumps the state of memcached(1) servers.
-It displays all data to stdout.
-
-
--------
OPTIONS
-------
+.. include:: options/all.rst
+.. include:: options/common.rst
+.. include:: options/sasl.rst
-You can specify servers via the option:
-
-.. option:: --servers
+.. option:: --analyze
-or via the environment variable:
+ Analyze and print differences of a server cluster. A memory and uptime comparison is performed by default.
-.. envvar:: 'MEMCACHED_SERVERS, --args'
+ Available additional modes:
-which can be used to specify the "argument" sent to the stats command (ie slab, size, items, etc..).
+ --analyze=latency
+ Network latency comparison
-For a full list of operations run the tool with:
-.. option:: --help
-.. option:: --analyze
+.. option:: --server-version
-----
-HOME
-----
+ Obtain and print server version(s) only.
+ENVIRONMENT
+-----------
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
+.. envvar:: MEMCACHED_SERVERS
+ Specify the list of servers.
---------
SEE ALSO
--------
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
-:manpage:`memcached(1)` :manpage:`libmemcached(3)`
+.. only:: html
+* :doc:`/libmemcached`
+* :doc:`/libmemcached/memcached_stats`
-=========================
-memtouch - Touches a key.
-=========================
+memtouch
+========
-
---------
SYNOPSIS
--------
-memtouch [options] key
-
.. program:: memtouch
+memtouch [options] <key>
------------
DESCRIPTION
-----------
-
:program:`memtouch` does a "touch" on the specified key.
--------
OPTIONS
-------
+.. include:: options/all.rst
+.. include:: options/common.rst
+.. include:: options/expire.rst
+.. include:: options/hash.rst
+.. include:: options/sasl.rst
-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
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
-------
-AUTHOR
-------
-
-Brian Aker, <brian@tangent.org>
-
---------
SEE ALSO
--------
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
-:manpage:`memcached(1)` :manpage:`libmemcached(3)`
+.. only:: html
+* :doc:`/libmemcached`
+* :doc:`/libmemcached/memcached_touch`
--- /dev/null
+.. option:: --help
+
+ Display help.
+
+.. option:: --version
+
+ Display version.
+
--- /dev/null
+.. option:: --quiet
+
+ Operate quietly.
+
+.. option:: --verbose
+
+ Operate more verbosely.
+
+.. option:: --debug
+
+ See :option:`--verbose`.
+
+.. option:: --servers <list of servers>
+
+ Specify the list of servers as *hostname[:port][,hostname[:port]...]*.
+
+.. option:: --binary
+
+ Enable binary protocol.
+
--- /dev/null
+.. option:: --expire <expiration>
+
+ Use *expiration* seconds (or a UNIX timestamp).
+
--- /dev/null
+.. option:: --flag <number>
+
+ Use *number* as flag.
+
--- /dev/null
+.. option:: --hash <algorithm>
+
+ Use *algorithm* as key hash algo.
+ See :enumerator:`memcached_behavior_t::MEMCACHED_BEHAVIOR_HASH`.
+
--- /dev/null
+.. option:: --username <username>
+
+ Use *username* for SASL authentication.
+
+.. option:: --password <password>
+
+ Use *password* for SASL authentication.
+
--- /dev/null
+.. option:: --udp
+
+ Enable UDP operation mode.
+
+++ /dev/null
-=======================
-MEMCACHED_AUTH_CONTINUE
-=======================
-
-.. c:type:: MEMCACHED_AUTH_CONTINUE
-
-Authentication has been paused.
+++ /dev/null
-======================
-MEMCACHED_AUTH_FAILURE
-======================
-
-.. c:type:: MEMCACHED_AUTH_FAILURE
-
-The credentials provided are not valid for this server.
+++ /dev/null
-======================
-MEMCACHED_AUTH_PROBLEM
-======================
-
-.. c:type:: MEMCACHED_AUTH_PROBLEM
-
-An unknown issue has occured during authentication.
+++ /dev/null
-==========================
-MEMCACHED_BAD_KEY_PROVIDED
-==========================
-
-.. c:type:: MEMCACHED_BAD_KEY_PROVIDED
-
-The key provided is not a valid key.
+++ /dev/null
-==================
-MEMCACHED_BUFFERED
-==================
-
-.. c:type:: MEMCACHED_BUFFERED
-
-The request has been buffered.
+++ /dev/null
-======================
-MEMCACHED_CLIENT_ERROR
-======================
-
-.. c:type:: MEMCACHED_CLIENT_ERROR
-
-An unknown client error has occured internally.
+++ /dev/null
-=================================
-MEMCACHED_CONNECTION_BIND_FAILURE
-=================================
-
-.. c:type:: MEMCACHED_CONNECTION_BIND_FAILURE
-.. deprecated:: <0.30
-
-We were not able to bind() to the socket.
+++ /dev/null
-============================
-MEMCACHED_CONNECTION_FAILURE
-============================
-
-.. c:type:: MEMCACHED_CONNECTION_FAILURE
-
-A unknown error has occured while trying to connect to a server.
+++ /dev/null
-==========================================
-MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE
-==========================================
-
-.. c:type:: MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE
-.. deprecated:: <0.30
-
-An error has occurred while trying to connect to a server. It is likely that either the number of file descriptors need to be increased or you are out of memory.
+++ /dev/null
-=============================
-MEMCACHED_DATA_DOES_NOT_EXIST
-=============================
-
-.. c:type:: MEMCACHED_DATA_DOES_NOT_EXIST
-
-The data requested with the key given was not found.
+++ /dev/null
-=====================
-MEMCACHED_DATA_EXISTS
-=====================
-
-.. c:type:: MEMCACHED_DATA_EXISTS
-
-The data requested with the key given was not found.
+++ /dev/null
-=================
-MEMCACHED_DELETED
-=================
-
-.. c:type:: MEMCACHED_DELETED
-
-The object requested by the key has been deleted.
+++ /dev/null
-====================
-MEMCACHED_DEPRECATED
-====================
-
-.. c:type:: MEMCACHED_DEPRECATED
-
-The method that was requested has been deprecated.
+++ /dev/null
-===============
-MEMCACHED_E2BIG
-===============
-
-.. c:type:: MEMCACHED_E2BIG
-
-Item is too large for the server to store.
+++ /dev/null
-=============
-MEMCACHED_END
-=============
-
-.. c:type:: MEMCACHED_END
-
-The server has completed returning all of the objects requested.
+++ /dev/null
-===============
-MEMCACHED_ERRNO
-===============
-
-.. c:type:: MEMCACHED_ERRNO
-
-An error has occurred in the driver which has set errno.
+++ /dev/null
-=================
-MEMCACHED_FAILURE
-=================
-
-.. c:type:: MEMCACHED_FAILURE
-.. deprecated:: <0.30
-
-A unknown failure has occurred in the server.
+++ /dev/null
-==========================
-MEMCACHED_FAIL_UNIX_SOCKET
-==========================
-
-.. c:type:: MEMCACHED_FAIL_UNIX_SOCKET
-
-A connection was not established with the server via a unix domain socket.
+++ /dev/null
-===========================
-MEMCACHED_FETCH_NOTFINISHED
-===========================
-
-.. c:type:: MEMCACHED_FETCH_NOTFINISHED
-
-A request has been made, but the server has not finished the fetch of the last request.
+++ /dev/null
-=============================
-MEMCACHED_HOST_LOOKUP_FAILURE
-=============================
-
-.. c:type:: MEMCACHED_HOST_LOOKUP_FAILURE
-
-A DNS failure has occurred.
+++ /dev/null
-===========================
-MEMCACHED_INVALID_ARGUMENTS
-===========================
-
-.. c:type:: MEMCACHED_INVALID_ARGUMENTS
-
-The arguments supplied to the given function were not valid.
+++ /dev/null
-===============================
-MEMCACHED_INVALID_HOST_PROTOCOL
-===============================
-
-.. c:type:: MEMCACHED_INVALID_HOST_PROTOCOL
-
-The server you are connecting too has an invalid protocol. Most likely you are connecting to an older server that does not speak the binary protocol.
+++ /dev/null
-==============
-MEMCACHED_ITEM
-==============
-
-.. c:type:: MEMCACHED_ITEM
-
-An item has been fetched (this is an internal error only).
+++ /dev/null
-=====================
-MEMCACHED_KEY_TOO_BIG
-=====================
-
-.. c:type:: MEMCACHED_KEY_TOO_BIG
-
-The key that has been provided is too large for the given server.
+++ /dev/null
-========================
-MEMCACHED_MAXIMUM_RETURN
-========================
-
-.. c:type:: MEMCACHED_MAXIMUM_RETURN
-
-This in an internal only state.
+++ /dev/null
-===================================
-MEMCACHED_MEMORY_ALLOCATION_FAILURE
-===================================
-
-.. c:type:: MEMCACHED_MEMORY_ALLOCATION_FAILURE
-
-An error has occurred while trying to allocate memory.
+++ /dev/null
-==================
-MEMCACHED_NOTFOUND
-==================
-
-.. c:type:: MEMCACHED_NOTFOUND
-
-The object requested was not found.
+++ /dev/null
-===================
-MEMCACHED_NOTSTORED
-===================
-
-.. c:type:: MEMCACHED_NOTSTORED
-
-The request to store an object failed.
+++ /dev/null
-=======================
-MEMCACHED_NOT_SUPPORTED
-=======================
-
-.. c:type:: MEMCACHED_NOT_SUPPORTED
-
-The given method is not supported in the server.
+++ /dev/null
-=========================
-MEMCACHED_NO_KEY_PROVIDED
-=========================
-
-.. c:type:: MEMCACHED_NO_KEY_PROVIDED
-.. deprecated:: <0.30
- Use :c:type:`MEMCACHED_BAD_KEY_PROVIDED` instead.
-
-No key was provided.
+++ /dev/null
-====================
-MEMCACHED_NO_SERVERS
-====================
-
-.. c:type:: MEMCACHED_NO_SERVERS
-
-No servers have been added to the memcached_st object.
+++ /dev/null
-=====================
-MEMCACHED_PARSE_ERROR
-=====================
-
-.. c:type:: MEMCACHED_PARSE_ERROR
-
-An error has occurred while trying to parse the configuration string. You should use memparse to determine what the error was.
+++ /dev/null
-==========================
-MEMCACHED_PARSE_USER_ERROR
-==========================
-
-.. c:type:: MEMCACHED_PARSE_USER_ERROR
-
-An error has occurred in parsing the configuration string.
+++ /dev/null
-======================
-MEMCACHED_PARTIAL_READ
-======================
-
-.. c:type:: MEMCACHED_PARTIAL_READ
-
-The read was only partcially successful.
+++ /dev/null
-========================
-MEMCACHED_PROTOCOL_ERROR
-========================
-
-.. c:type:: MEMCACHED_PROTOCOL_ERROR
-
-An unknown error has occurred in the protocol.
+++ /dev/null
-======================
-MEMCACHED_READ_FAILURE
-======================
-
-.. c:type:: MEMCACHED_READ_FAILURE
-
-A read failure has occurred.
+++ /dev/null
-======================
-MEMCACHED_SERVER_ERROR
-======================
-
-.. c:type:: MEMCACHED_SERVER_ERROR
-
-An unknown error has occurred in the server.
+++ /dev/null
-============================
-MEMCACHED_SERVER_MARKED_DEAD
-============================
-
-.. c:type:: MEMCACHED_SERVER_MARKED_DEAD
-
-The requested server has been marked dead.
+++ /dev/null
-=====================
-MEMCACHED_SOME_ERRORS
-=====================
-
-.. c:type:: MEMCACHED_SOME_ERRORS
-
-A multi request has been made, and some underterminate number of errors have occurred.
+++ /dev/null
-==============
-MEMCACHED_STAT
-==============
-
-.. c:type:: MEMCACHED_STAT
-
-A "stat" command has been returned in the protocol.
+++ /dev/null
-================
-MEMCACHED_STORED
-================
-
-.. c:type:: MEMCACHED_STORED
-
-The requested object has been successfully stored on the server.
+++ /dev/null
-=================
-MEMCACHED_SUCCESS
-=================
-
-.. c:type:: MEMCACHED_SUCCESS
-
-The request was successfully executed.
+++ /dev/null
-=================
-MEMCACHED_TIMEOUT
-=================
-
-.. c:type:: MEMCACHED_TIMEOUT
-
-Operation has timed out.
+++ /dev/null
-==============================
-MEMCACHED_UNKNOWN_READ_FAILURE
-==============================
-
-.. c:type:: MEMCACHED_UNKNOWN_READ_FAILURE
-
-An unknown read failure only occurs when either there is a bug in the server, or in rare cases where an ethernet nic is reporting dubious information.
+++ /dev/null
-==========================
-MEMCACHED_UNKNOWN_STAT_KEY
-==========================
-
-.. c:type:: MEMCACHED_UNKNOWN_STAT_KEY
-
-The server you are communicating with has a stat key which has not be defined in the protocol.
+++ /dev/null
-===============
-MEMCACHED_VALUE
-===============
-
-.. c:type:: MEMCACHED_VALUE
-
-A value has been returned from the server (this is an internal condition only).
+++ /dev/null
-=======================
-MEMCACHED_WRITE_FAILURE
-=======================
-
-.. c:type:: MEMCACHED_WRITE_FAILURE
-
-An error has occured while trying to write to a server.
# -*- coding: utf-8 -*-
-#
-# libmemcached documentation build configuration file, created by
-# sphinx-quickstart on Sun Mar 6 12:05:53 2011.
-#
-# This file is execfile()d with the current directory set to its containing dir.
-#
-# Note that not all possible configuration values are present in this
-# autogenerated file.
-#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
import sys, os
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
+
# -- General configuration -----------------------------------------------------
-# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
-
-# Add any Sphinx extension module names here, as strings. They can be extensions
-# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [@SPHINX_EXTENSIONS@]
-
-#extensions = ['sphinxcontrib.googleanalytics']
-
-# Google
-#googleanalytics_id = 'UA-15307604-2'
-#googleanalytics_enabled = 'True'
-
-# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
-
-# The suffix of source filenames.
source_suffix = '.rst'
-
-# The encoding of source files.
-#source_encoding = 'utf-8-sig'
-
-# The master toctree document.
master_doc = 'index'
-
-# General information about the project.
-project = u'libmemcached'
-copyright = u'2011-2020 Brian Aker, Michael Wallner'
-
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-#
-# The short X.Y version.
-version = '@VERSION@'
-# The full version, including alpha/beta/rc tags.
-release = '@VERSION@'
-
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-#language = None
-
-# There are two options for replacing |today|: either, you set today to some
-# non-false value, then it is used:
-#today = ''
-# Else, today_fmt is used as the format for a strftime call.
-#today_fmt = '%B %d, %Y'
-
-# List of patterns, relative to source directory, that match files and
-# directories to ignore when looking for source files.
-exclude_patterns = ['_build']
-
-# The reST default role (used for this markup: `text`) to use for all documents.
-#default_role = None
-
-# If true, '()' will be appended to :func: etc. cross-reference text.
-#add_function_parentheses = True
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. function::).
-#add_module_names = True
-
-# If true, sectionauthor and moduleauthor directives will be shown in the
-# output. They are ignored by default.
-#show_authors = False
-
-# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
-# A list of ignored prefixes for module index sorting.
-#modindex_common_prefix = []
+primary_domain = 'cpp'
+default_role = 'any'
+project = u'libmemcached'
+version = '@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@'
+release = '@PROJECT_VERSION@'
+
+smartquotes = False
# -- Options for HTML output ---------------------------------------------------
-# The theme to use for HTML and HTML Help pages. See the documentation for
-# a list of builtin themes.
html_theme = '@SPHINX_THEME@'
-
-# Theme options are theme-specific and customize the look and feel of a theme
-# further. For a list of options available for each theme, see the
-# documentation.
html_theme_options = {@SPHINX_THEME_OPTIONS@}
-
-# Add any paths that contain custom themes here, relative to this directory.
-#html_theme_path = []
-
-# The name for this set of Sphinx documents. If None, it defaults to
-# "<project> v<release> documentation".
-#html_title = None
-
-# A shorter title for the navigation bar. Default is the same as html_title.
-#html_short_title = None
-
-# The name of an image file (relative to this directory) to place at the top
-# of the sidebar.
-#html_logo = None
-
-# The name of an image file (within the static path) to use as favicon of the
-# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
-# pixels large.
-#html_favicon = None
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
-#html_static_path = ['_static']
-
-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
-# using the given strftime format.
-#html_last_updated_fmt = '%b %d, %Y'
-
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-#html_use_smartypants = True
-
-# Custom sidebar templates, maps document names to template names.
-#html_sidebars = {}
-
-# Additional templates that should be rendered to pages, maps page names to
-# template names.
-#html_additional_pages = {}
-
-# If false, no module index is generated.
html_domain_indices = False
-
-# If false, no index is generated.
-#html_use_index = True
-
-# If true, the index is split into individual pages for each letter.
-#html_split_index = False
-
-# If true, links to the reST sources are added to the pages.
html_show_sourcelink = False
-
-# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
-#html_show_sphinx = True
-
-# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
-#html_show_copyright = True
-
-# If true, an OpenSearch description file will be output, and all pages will
-# contain a <link> tag referring to it. The value of this option must be the
-# base URL from which the finished HTML is served.
-#html_use_opensearch = ''
-
-# This is the file name suffix for HTML files (e.g. ".xhtml").
-#html_file_suffix = None
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = 'libmemcacheddoc'
-
-
-# -- Options for LaTeX output --------------------------------------------------
-
-# The paper size ('letter' or 'a4').
-#latex_paper_size = 'letter'
-
-# The font size ('10pt', '11pt' or '12pt').
-#latex_font_size = '10pt'
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title, author, documentclass [howto/manual]).
-latex_documents = [
- ('index', 'libmemcached.tex', u'libmemcached Documentation',
- u'Brian Aker', 'manual'),
-]
-
-# The name of an image file (relative to this directory) to place at the top of
-# the title page.
-#latex_logo = None
-
-# For "manual" documents, if this is true, then toplevel headings are parts,
-# not chapters.
-#latex_use_parts = False
-
-# If true, show page references after internal links.
-#latex_show_pagerefs = False
-
-# If true, show URL addresses after external links.
-#latex_show_urls = False
-
-# Additional stuff for the LaTeX preamble.
-#latex_preamble = ''
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-#latex_domain_indices = True
-
+html_copy_source = False
+#manpages_url = 'http://man7.org/linux/man-pages/man{section}/{page}.{section}.html'
+manpages_url = 'https://linux.die.net/man/{section}/{page}'
# -- Options for manual page output --------------------------------------------
+
# Skip a separate AUTHOR section
man_authors = []
+
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
- ('hashkit_create', 'hashkit_clone', u'libhashkit Documentation', man_authors, 3),
- ('hashkit_create', 'hashkit_create', u'libhashkit Documentation', man_authors, 3),
- ('hashkit_create', 'hashkit_free', u'libhashkit Documentation', man_authors, 3),
- ('hashkit_create', 'hashkit_is_allocated', u'libhashkit Documentation', man_authors, 3),
- ('hashkit_functions', 'hashkit_crc32', u'libhashkit Documentation', man_authors, 3),
- ('hashkit_functions', 'hashkit_fnv1_32', u'libhashkit Documentation', man_authors, 3),
- ('hashkit_functions', 'hashkit_fnv1_64', u'libhashkit Documentation', man_authors, 3),
- ('hashkit_functions', 'hashkit_fnv1a_32', u'libhashkit Documentation', man_authors, 3),
- ('hashkit_functions', 'hashkit_fnv1a_64', u'libhashkit Documentation', man_authors, 3),
- ('hashkit_functions', 'hashkit_functions', u'libhashkit Documentation', man_authors, 3),
- ('hashkit_functions', 'hashkit_hsieh', u'libhashkit Documentation', man_authors, 3),
- ('hashkit_functions', 'hashkit_jenkins', u'libhashkit Documentation', man_authors, 3),
- ('hashkit_functions', 'hashkit_md5', u'libhashkit Documentation', man_authors, 3),
- ('hashkit_functions', 'hashkit_murmur', u'libhashkit Documentation', man_authors, 3),
- ('hashkit_value', 'hashkit_value', u'libhashkit Documentation', man_authors, 3),
- ('libhashkit', 'libhashkit', u'libhashkit Documentation', man_authors, 3),
- ('libmemcached', 'libmemcached', u'Introducing the C Client Library for memcached', man_authors, 3),
- ('libmemcached_configuration', 'libmemcached_check_configuration', u'libmemcached Documentation', man_authors, 3),
- ('libmemcached_configuration', 'libmemcached_configuration', u'libmemcached Documentation', man_authors, 3),
- ('libmemcached_configuration', 'memcached', u'libmemcached Documentation', man_authors, 3),
- ('libmemcached_examples', 'libmemcached_examples', u'libmemcached Documentation', man_authors, 3),
- ('libmemcachedutil', 'libmemcachedutil', u'libmemcached Documentation', man_authors, 3),
- ('memcached_analyze', 'memcached_analyze', u'libmemcached Documentation', man_authors, 3),
- ('memcached_append', 'memcached_append', u'Appending to or Prepending to data on the server', man_authors, 3),
- ('memcached_append', 'memcached_append_by_key', u'Appending to or Prepending to data on the server', man_authors, 3),
- ('memcached_append', 'memcached_prepend', u'Appending to or Prepending to data on the server', man_authors, 3),
- ('memcached_append', 'memcached_prepend_by_key', u'Appending to or Prepending to data on the server', man_authors, 3),
- ('memcached_auto', 'memcached_auto', u'Incrementing and Decrementing Values', man_authors, 3),
- ('memcached_auto', 'memcached_decrement', u'Incrementing and Decrementing Values', man_authors, 3),
- ('memcached_auto', 'memcached_decrement_with_initial', u'Incrementing and Decrementing Values', man_authors, 3),
- ('memcached_auto', 'memcached_increment', u'Incrementing and Decrementing Values', man_authors, 3),
- ('memcached_auto', 'memcached_increment_with_initial', u'Incrementing and Decrementing Values', man_authors, 3),
- ('memcached_behavior', 'memcached_behavior', u'libmemcached Documentation', man_authors, 3),
- ('memcached_behavior', 'memcached_behavior_get', u'libmemcached Documentation', man_authors, 3),
- ('memcached_behavior', 'memcached_behavior_set', u'libmemcached Documentation', man_authors, 3),
- ('memcached_callback', 'memcached_callback', u'libmemcached Documentation', man_authors, 3),
- ('memcached_callback', 'memcached_callback_get', u'libmemcached Documentation', man_authors, 3),
- ('memcached_callback', 'memcached_callback_set', u'libmemcached Documentation', man_authors, 3),
- ('memcached_cas', 'memcached_cas', u'Working with data on the server in an atomic fashion', man_authors, 3),
- ('memcached_cas', 'memcached_cas_by_key', u'Storing and Replacing Data', man_authors, 3),
- ('memcached_create', 'memcached_clone', u'libmemcached Documentation', man_authors, 3),
- ('memcached_create', 'memcached_create', u'libmemcached Documentation', man_authors, 3),
- ('memcached_create', 'memcached_free', u'libmemcached Documentation', man_authors, 3),
- ('memcached_create', 'memcached_servers_reset', u'libmemcached Documentation', man_authors, 3),
- ('memcached_delete', 'memcached_delete', u'libmemcached Documentation', man_authors, 3),
- ('memcached_delete', 'memcached_delete_by_key', u'libmemcached Documentation', man_authors, 3),
- ('libmemcached-1.0/memcached_touch', 'memcached_touch', u'libmemcached Documentation', man_authors, 3),
- ('libmemcached-1.0/memcached_touch', 'memcached_touch_by_key', u'libmemcached Documentation', man_authors, 3),
- ('libmemcached/memcached_exist', 'memcached_exist', u'libmemcached Documentation', man_authors, 3),
- ('libmemcached/memcached_exist', 'memcached_exist_by_key', u'libmemcached Documentation', man_authors, 3),
- ('memcached_dump', 'memcached_dump', u'libmemcached Documentation', man_authors, 3),
- ('memcached_flush', 'memcached_flush', u'libmemcached Documentation', man_authors, 3),
- ('memcached_flush_buffers', 'memcached_flush_buffers', u'libmemcached Documentation', man_authors, 3),
- ('memcached_generate_hash_value', 'memcached_generate_hash', u'Generating hash values directly', man_authors, 3),
- ('memcached_generate_hash_value', 'memcached_generate_hash_value', u'Generating hash values directly', man_authors, 3),
- ('libmemcached/memcached_fetch', 'memcached_fetch', u'Retrieving data from the server', man_authors, 3),
- ('memcached_get', 'memcached_fetch_execute', u'Retrieving data from the server', man_authors, 3),
- ('memcached_get', 'memcached_fetch_result', u'Retrieving data from the server', man_authors, 3),
- ('memcached_get', 'memcached_get', u'Retrieving data from the server', man_authors, 3),
- ('memcached_get', 'memcached_get_by_key', u'Retrieving data from the server', man_authors, 3),
- ('libmemcached/memcached_return_t', 'memcached_return_t', u'Return type values ', man_authors, 3),
- ('memcached_get', 'memcached_mget', u'Retrieving data from the server', man_authors, 3),
- ('memcached_get', 'memcached_mget_by_key', u'Retrieving data from the server', man_authors, 3),
- ('memcached_get', 'memcached_mget_execute', u'Retrieving data from the server', man_authors, 3),
- ('memcached_get', 'memcached_mget_execute_by_key', u'Retrieving data from the server', man_authors, 3),
- ('libmemcached/memcached_last_error_message', 'memcached_last_error_message', u'libmemcached Documentation', man_authors, 3),
- ('memcached_memory_allocators', 'memcached_get_memory_allocators', u'libmemcached Documentation', man_authors, 3),
- ('memcached_memory_allocators', 'memcached_memory_allocators', u'libmemcached Documentation', man_authors, 3),
- ('memcached_memory_allocators', 'memcached_set_memory_allocators', u'libmemcached Documentation', man_authors, 3),
- ('memcached_memory_allocators', 'memcached_set_memory_allocators_context', u'libmemcached Documentation', man_authors, 3),
- ('memcached_pool', 'memcached_pool', u'libmemcached Documentation', man_authors, 3),
- ('memcached_pool', 'memcached_pool_behavior_get', u'libmemcached Documentation', man_authors, 3),
- ('memcached_pool', 'memcached_pool_behavior_set', u'libmemcached Documentation', man_authors, 3),
- ('memcached_pool', 'memcached_pool_create', u'libmemcached Documentation', man_authors, 3),
- ('memcached_pool', 'memcached_pool_destroy', u'libmemcached Documentation', man_authors, 3),
- ('memcached_pool', 'memcached_pool_fetch', u'libmemcached Documentation', man_authors, 3),
- ('memcached_pool', 'memcached_pool_pop', u'libmemcached Documentation', man_authors, 3),
- ('memcached_pool', 'memcached_pool_push', u'libmemcached Documentation', man_authors, 3),
- ('memcached_pool', 'memcached_pool_release', u'libmemcached Documentation', man_authors, 3),
- ('memcached_pool', 'memcached_pool_st', u'libmemcached Documentation', man_authors, 3),
- ('memcached_quit', 'memcached_quit', u'libmemcached Documentation', man_authors, 3),
- ('libmemcached-1.0/memcached_set_encoding_key', 'memcached_set_encoding_key', u'libmemcached Documentation', man_authors, 3),
- ('memcached_result_st', 'memcached_result_cas', u'Working with result sets', man_authors, 3),
- ('memcached_result_st', 'memcached_result_create', u'Working with result sets', man_authors, 3),
- ('memcached_result_st', 'memcached_result_flags', u'Working with result sets', man_authors, 3),
- ('memcached_result_st', 'memcached_result_free', u'Working with result sets', man_authors, 3),
- ('memcached_result_st', 'memcached_result_key_length', u'Working with result sets', man_authors, 3),
- ('memcached_result_st', 'memcached_result_key_value', u'Working with result sets', man_authors, 3),
- ('memcached_result_st', 'memcached_result_length', u'Working with result sets', man_authors, 3),
- ('memcached_result_st', 'memcached_result_st', u'Working with result sets', man_authors, 3),
- ('memcached_result_st', 'memcached_result_value', u'Working with result sets', man_authors, 3),
- ('memcached_sasl', 'memcached_destroy_sasl_auth_data', u'libmemcached Documentation', man_authors, 3),
- ('memcached_sasl', 'memcached_get_sasl_callbacks', u'libmemcached Documentation', man_authors, 3),
- ('memcached_sasl', 'memcached_sasl', u'libmemcached Documentation', man_authors, 3),
- ('memcached_sasl', 'memcached_sasl_set_auth_data', u'libmemcached Documentation', man_authors, 3),
- ('memcached_sasl', 'memcached_set_sasl_callbacks', u'libmemcached Documentation', man_authors, 3),
- ('memcached_server_st', 'memcached_server_list_append', u'libmemcached Documentation', man_authors, 3),
- ('memcached_server_st', 'memcached_server_list_count', u'libmemcached Documentation', man_authors, 3),
- ('memcached_server_st', 'memcached_server_list_free', u'libmemcached Documentation', man_authors, 3),
- ('memcached_server_st', 'memcached_servers_parse', u'libmemcached Documentation', man_authors, 3),
- ('memcached_servers', 'memcached_server_add', u'libmemcached Documentation', man_authors, 3),
- ('memcached_servers', 'memcached_server_add_unix_socket', u'libmemcached Documentation', man_authors, 3),
- ('memcached_servers', 'memcached_server_count', u'libmemcached Documentation', man_authors, 3),
- ('memcached_servers', 'memcached_server_cursor', u'libmemcached Documentation', man_authors, 3),
- ('memcached_servers', 'memcached_server_list', u'libmemcached Documentation', man_authors, 3),
- ('memcached_servers', 'memcached_server_push', u'libmemcached Documentation', man_authors, 3),
- ('memcached_servers', 'memcached_server_st', u'libmemcached Documentation', man_authors, 3),
- ('memcached_servers', 'memcached_servers', u'libmemcached Documentation', man_authors, 3),
- ('memcached_set', 'memcached_add', u'Storing and Replacing Data', man_authors, 3),
- ('memcached_set', 'memcached_add_by_key', u'Storing and Replacing Data', man_authors, 3),
- ('memcached_set', 'memcached_replace', u'Storing and Replacing Data', man_authors, 3),
- ('memcached_set', 'memcached_replace_by_key', u'Storing and Replacing Data', man_authors, 3),
- ('memcached_set', 'memcached_set', u'Storing and Replacing Data', man_authors, 3),
- ('memcached_set', 'memcached_set_by_key', u'Storing and Replacing Data', man_authors, 3),
- ('memcached_stats', 'memcached_stat', u'libmemcached Documentation', man_authors, 3),
- ('memcached_stats', 'memcached_stat_execute', u'libmemcached Documentation', man_authors, 3),
- ('memcached_stats', 'memcached_stat_get_keys', u'libmemcached Documentation', man_authors, 3),
- ('memcached_stats', 'memcached_stat_get_value', u'libmemcached Documentation', man_authors, 3),
- ('memcached_stats', 'memcached_stat_servername', u'libmemcached Documentation', man_authors, 3),
- ('memcached_stats', 'memcached_stats', u'libmemcached Documentation', man_authors, 3),
- ('memcached_strerror', 'memcached_strerror', u'libmemcached Documentation', man_authors, 3),
- ('memcached_user_data', 'memcached_get_user_data', u'libmemcached Documentation', man_authors, 3),
- ('memcached_user_data', 'memcached_set_user_data', u'libmemcached Documentation', man_authors, 3),
- ('memcached_user_data', 'memcached_user_data', u'libmemcached Documentation', man_authors, 3),
- ('memcached_verbosity', 'memcached_verbosity', u'libmemcached Documentation', man_authors, 3),
- ('memcached_version', 'memcached_lib_version', u'libmemcached Documentation', man_authors, 3),
- ('memcached_version', 'memcached_version', u'libmemcached Documentation', man_authors, 3),
- ('bin/memcapable', 'memcapable', u'libmemcached Documentation', man_authors, 1),
- ('bin/memcat', 'memcat', u'libmemcached Documentation', man_authors, 1),
- ('bin/memcp', 'memcp', u'libmemcached Documentation', man_authors, 1),
- ('bin/memdump', 'memdump', u'libmemcached Documentation', man_authors, 1),
- ('bin/memerror', 'memerror', u'libmemcached Documentation', man_authors, 1),
- ('bin/memflush', 'memflush', u'libmemcached Documentation', man_authors, 1),
- ('bin/memrm', 'memrm', u'libmemcached Documentation', man_authors, 1),
- ('bin/memaslap', 'memaslap', u'libmemcached Documentation', man_authors, 1),
- ('bin/memslap', 'memslap', u'libmemcached Documentation', man_authors, 1),
- ('bin/memstat', 'memstat', u'libmemcached Documentation', man_authors, 1),
- ('bin/memexist', 'memexist', u'libmemcached Documentation', man_authors, 1),
- ('bin/memparse', 'memparse', u'libmemcached Documentation', man_authors, 1),
- ('bin/memping', 'memping', u'libmemcached Documentation', man_authors, 1),
- ('bin/memtouch', 'memtouch', u'libmemcached Documentation', man_authors, 1),
+ ('libhashkit' ,'libhashkit' ,u'libhashkit Documentation' ,man_authors,3),
+ ('libhashkit/hashkit_create' ,'hashkit_clone' ,u'libhashkit Documentation' ,man_authors,3),
+ ('libhashkit/hashkit_create' ,'hashkit_create' ,u'libhashkit Documentation' ,man_authors,3),
+ ('libhashkit/hashkit_create' ,'hashkit_free' ,u'libhashkit Documentation' ,man_authors,3),
+ ('libhashkit/hashkit_create' ,'hashkit_is_allocated' ,u'libhashkit Documentation' ,man_authors,3),
+ ('libhashkit/hashkit_function' ,'hashkit_function' ,u'libhashkit Documentation' ,man_authors,3),
+ ('libhashkit/hashkit_function' ,'hashkit_get_distribution_function' ,u'libhashkit Documentation' ,man_authors,3),
+ ('libhashkit/hashkit_function' ,'hashkit_get_function' ,u'libhashkit Documentation' ,man_authors,3),
+ ('libhashkit/hashkit_function' ,'hashkit_set_custom_distribution_function',u'libhashkit Documentation' ,man_authors,3),
+ ('libhashkit/hashkit_function' ,'hashkit_set_custom_function' ,u'libhashkit Documentation' ,man_authors,3),
+ ('libhashkit/hashkit_function' ,'hashkit_set_distribution_function' ,u'libhashkit Documentation' ,man_authors,3),
+ ('libhashkit/hashkit_function' ,'hashkit_set_function' ,u'libhashkit Documentation' ,man_authors,3),
+ ('libhashkit/hashkit_functions' ,'hashkit_crc32' ,u'libhashkit Documentation' ,man_authors,3),
+ ('libhashkit/hashkit_functions' ,'hashkit_fnv1_32' ,u'libhashkit Documentation' ,man_authors,3),
+ ('libhashkit/hashkit_functions' ,'hashkit_fnv1_64' ,u'libhashkit Documentation' ,man_authors,3),
+ ('libhashkit/hashkit_functions' ,'hashkit_fnv1a_32' ,u'libhashkit Documentation' ,man_authors,3),
+ ('libhashkit/hashkit_functions' ,'hashkit_fnv1a_64' ,u'libhashkit Documentation' ,man_authors,3),
+ ('libhashkit/hashkit_functions' ,'hashkit_functions' ,u'libhashkit Documentation' ,man_authors,3),
+ ('libhashkit/hashkit_functions' ,'hashkit_hsieh' ,u'libhashkit Documentation' ,man_authors,3),
+ ('libhashkit/hashkit_functions' ,'hashkit_jenkins' ,u'libhashkit Documentation' ,man_authors,3),
+ ('libhashkit/hashkit_functions' ,'hashkit_md5' ,u'libhashkit Documentation' ,man_authors,3),
+ ('libhashkit/hashkit_functions' ,'hashkit_murmur' ,u'libhashkit Documentation' ,man_authors,3),
+ ('libhashkit/hashkit_value' ,'hashkit_value' ,u'libhashkit Documentation' ,man_authors,3),
+
+ ('libmemcached' ,'libmemcached' ,u'C/C++ Client Library for memcached' ,man_authors,3),
+ ('libmemcached/configuration' ,'libmemcached_check_configuration' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/configuration' ,'libmemcached_configuration' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/configuration' ,'memcached' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/examples' ,'libmemcached_examples' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_analyze' ,'memcached_analyze' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_append' ,'memcached_append_by_key' ,u'Appending to or Prepending Data' ,man_authors,3),
+ ('libmemcached/memcached_append' ,'memcached_append' ,u'Appending to or Prepending Data' ,man_authors,3),
+ ('libmemcached/memcached_append' ,'memcached_prepend_by_key' ,u'Appending to or Prepending Data' ,man_authors,3),
+ ('libmemcached/memcached_append' ,'memcached_prepend' ,u'Appending to or Prepending Data' ,man_authors,3),
+ ('libmemcached/memcached_auto' ,'memcached_auto' ,u'Incrementing and Decrementing Values',man_authors,3),
+ ('libmemcached/memcached_auto' ,'memcached_decrement' ,u'Incrementing and Decrementing Values',man_authors,3),
+ ('libmemcached/memcached_auto' ,'memcached_decrement_with_initial' ,u'Incrementing and Decrementing Values',man_authors,3),
+ ('libmemcached/memcached_auto' ,'memcached_increment' ,u'Incrementing and Decrementing Values',man_authors,3),
+ ('libmemcached/memcached_auto' ,'memcached_increment_with_initial' ,u'Incrementing and Decrementing Values',man_authors,3),
+ ('libmemcached/memcached_behavior' ,'memcached_behavior_get' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_behavior' ,'memcached_behavior_set' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_behavior' ,'memcached_behavior' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_callback' ,'memcached_callback_get' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_callback' ,'memcached_callback_set' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_callback' ,'memcached_callback' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_cas' ,'memcached_cas_by_key' ,u'Storing and Replacing Data' ,man_authors,3),
+ ('libmemcached/memcached_cas' ,'memcached_cas' ,u'Atomic Compare and Swap' ,man_authors,3),
+ ('libmemcached/memcached_create' ,'memcached_clone' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_create' ,'memcached_create' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_create' ,'memcached_free' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_create' ,'memcached_servers_reset' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_delete' ,'memcached_delete_by_key' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_delete' ,'memcached_delete' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_dump' ,'memcached_dump' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_exist' ,'memcached_exist_by_key' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_exist' ,'memcached_exist' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_fetch' ,'memcached_fetch' ,u'Retrieving data from the server' ,man_authors,3),
+ ('libmemcached/memcached_flush_buffers' ,'memcached_flush_buffers' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_flush' ,'memcached_flush' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_generate_hash_value','memcached_generate_hash' ,u'Generating hash values directly' ,man_authors,3),
+ ('libmemcached/memcached_generate_hash_value','memcached_generate_hash_value' ,u'Generating hash values directly' ,man_authors,3),
+ ('libmemcached/memcached_get' ,'memcached_fetch_execute' ,u'Retrieving data from the server' ,man_authors,3),
+ ('libmemcached/memcached_get' ,'memcached_fetch_result' ,u'Retrieving data from the server' ,man_authors,3),
+ ('libmemcached/memcached_get' ,'memcached_get_by_key' ,u'Retrieving data from the server' ,man_authors,3),
+ ('libmemcached/memcached_get' ,'memcached_get' ,u'Retrieving data from the server' ,man_authors,3),
+ ('libmemcached/memcached_get' ,'memcached_mget_by_key' ,u'Retrieving data from the server' ,man_authors,3),
+ ('libmemcached/memcached_get' ,'memcached_mget_execute_by_key' ,u'Retrieving data from the server' ,man_authors,3),
+ ('libmemcached/memcached_get' ,'memcached_mget_execute' ,u'Retrieving data from the server' ,man_authors,3),
+ ('libmemcached/memcached_get' ,'memcached_mget' ,u'Retrieving data from the server' ,man_authors,3),
+ ('libmemcached/memcached_last_error' ,'memcached_last_error_errno' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_last_error' ,'memcached_last_error_message' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_last_error' ,'memcached_last_error' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_memory_allocators' ,'memcached_get_memory_allocators' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_memory_allocators' ,'memcached_memory_allocators' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_memory_allocators' ,'memcached_set_memory_allocators_context' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_memory_allocators' ,'memcached_set_memory_allocators' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_quit' ,'memcached_quit' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_result_st' ,'memcached_result_cas' ,u'Working with result sets' ,man_authors,3),
+ ('libmemcached/memcached_result_st' ,'memcached_result_create' ,u'Working with result sets' ,man_authors,3),
+ ('libmemcached/memcached_result_st' ,'memcached_result_flags' ,u'Working with result sets' ,man_authors,3),
+ ('libmemcached/memcached_result_st' ,'memcached_result_free' ,u'Working with result sets' ,man_authors,3),
+ ('libmemcached/memcached_result_st' ,'memcached_result_key_length' ,u'Working with result sets' ,man_authors,3),
+ ('libmemcached/memcached_result_st' ,'memcached_result_key_value' ,u'Working with result sets' ,man_authors,3),
+ ('libmemcached/memcached_result_st' ,'memcached_result_length' ,u'Working with result sets' ,man_authors,3),
+ ('libmemcached/memcached_result_st' ,'memcached_result_st' ,u'Working with result sets' ,man_authors,3),
+ ('libmemcached/memcached_result_st' ,'memcached_result_value' ,u'Working with result sets' ,man_authors,3),
+ ('libmemcached/memcached_return_t' ,'memcached_return_t' ,u'Return type values ' ,man_authors,3),
+ ('libmemcached/memcached_sasl' ,'memcached_destroy_sasl_auth_data' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_sasl' ,'memcached_get_sasl_callbacks' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_sasl' ,'memcached_sasl_set_auth_data' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_sasl' ,'memcached_sasl' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_sasl' ,'memcached_set_sasl_callbacks' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_servers' ,'memcached_server_add' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_servers' ,'memcached_server_add_unix_socket' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_servers' ,'memcached_server_count' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_servers' ,'memcached_server_cursor' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_servers' ,'memcached_server_list' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_servers' ,'memcached_server_push' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_servers' ,'memcached_server_st' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_servers' ,'memcached_servers' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_server_st' ,'memcached_server_list_append' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_server_st' ,'memcached_server_list_count' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_server_st' ,'memcached_server_list_free' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_server_st' ,'memcached_servers_parse' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_set_encoding_key' ,'memcached_set_encoding_key' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_set' ,'memcached_add_by_key' ,u'Storing and Replacing Data' ,man_authors,3),
+ ('libmemcached/memcached_set' ,'memcached_add' ,u'Storing and Replacing Data' ,man_authors,3),
+ ('libmemcached/memcached_set' ,'memcached_replace_by_key' ,u'Storing and Replacing Data' ,man_authors,3),
+ ('libmemcached/memcached_set' ,'memcached_replace' ,u'Storing and Replacing Data' ,man_authors,3),
+ ('libmemcached/memcached_set' ,'memcached_set_by_key' ,u'Storing and Replacing Data' ,man_authors,3),
+ ('libmemcached/memcached_set' ,'memcached_set' ,u'Storing and Replacing Data' ,man_authors,3),
+ ('libmemcached/memcached_stats' ,'memcached_stat_execute' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_stats' ,'memcached_stat_get_keys' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_stats' ,'memcached_stat_get_value' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_stats' ,'memcached_stat_servername' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_stats' ,'memcached_stats' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_stats' ,'memcached_stat' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_strerror' ,'memcached_strerror' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_touch' ,'memcached_touch_by_key' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_touch' ,'memcached_touch' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_user_data' ,'memcached_get_user_data' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_user_data' ,'memcached_set_user_data' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_user_data' ,'memcached_user_data' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_verbosity' ,'memcached_verbosity' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_version' ,'memcached_lib_version' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcached/memcached_version' ,'memcached_version' ,u'libmemcached Documentation' ,man_authors,3),
+
+ ('libmemcachedutil' ,'libmemcachedutil' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcachedutil/memcached_pool' ,'memcached_pool_behavior_get' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcachedutil/memcached_pool' ,'memcached_pool_behavior_set' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcachedutil/memcached_pool' ,'memcached_pool_create' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcachedutil/memcached_pool' ,'memcached_pool_destroy' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcachedutil/memcached_pool' ,'memcached_pool_fetch' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcachedutil/memcached_pool' ,'memcached_pool_pop' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcachedutil/memcached_pool' ,'memcached_pool_push' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcachedutil/memcached_pool' ,'memcached_pool_release' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcachedutil/memcached_pool' ,'memcached_pool_st' ,u'libmemcached Documentation' ,man_authors,3),
+ ('libmemcachedutil/memcached_pool' ,'memcached_pool' ,u'libmemcached Documentation' ,man_authors,3),
+
+ ('bin/memcapable' , 'memcapable' , u'libmemcached Documentation' , man_authors, 1),
+ ('bin/memcat' , 'memcat' , u'libmemcached Documentation' , man_authors, 1),
+ ('bin/memcp' , 'memcp' , u'libmemcached Documentation' , man_authors, 1),
+ ('bin/memdump' , 'memdump' , u'libmemcached Documentation' , man_authors, 1),
+ ('bin/memerror' , 'memerror' , u'libmemcached Documentation' , man_authors, 1),
+ ('bin/memflush' , 'memflush' , u'libmemcached Documentation' , man_authors, 1),
+ ('bin/memrm' , 'memrm' , u'libmemcached Documentation' , man_authors, 1),
+ ('bin/memaslap' , 'memaslap' , u'libmemcached Documentation' , man_authors, 1),
+ ('bin/memslap' , 'memslap' , u'libmemcached Documentation' , man_authors, 1),
+ ('bin/memstat' , 'memstat' , u'libmemcached Documentation' , man_authors, 1),
+ ('bin/memexist' , 'memexist' , u'libmemcached Documentation' , man_authors, 1),
+ ('bin/memparse' , 'memparse' , u'libmemcached Documentation' , man_authors, 1),
+ ('bin/memping' , 'memping' , u'libmemcached Documentation' , man_authors, 1),
+ ('bin/memtouch' , 'memtouch' , u'libmemcached Documentation' , man_authors, 1),
]
+rst_prolog = """
+.. |libhashkit_version| replace:: @LIBHASHKIT_VERSION_MAJOR@.@LIBHASHKIT_VERSION_MINOR@
+.. |libmemcached_version| replace:: @LIBMEMCACHED_VERSION_MAJOR@.@LIBMEMCACHED_VERSION_MINOR@
+"""
+
@SPHINX_CONF_APPEND@
-=========
Copyright
=========
+++ /dev/null
-=====================
-Client Error messages
-=====================
-
-.. toctree::
- :maxdepth: 1
-
- client_errors/MEMCACHED_AUTH_CONTINUE
- client_errors/MEMCACHED_AUTH_FAILURE
- client_errors/MEMCACHED_AUTH_PROBLEM
- client_errors/MEMCACHED_BAD_KEY_PROVIDED
- client_errors/MEMCACHED_BUFFERED
- client_errors/MEMCACHED_CLIENT_ERROR
- client_errors/MEMCACHED_CONNECTION_BIND_FAILURE
- client_errors/MEMCACHED_CONNECTION_FAILURE
- client_errors/MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE
- client_errors/MEMCACHED_DATA_DOES_NOT_EXIST
- client_errors/MEMCACHED_DATA_EXISTS
- client_errors/MEMCACHED_DELETED
- client_errors/MEMCACHED_DEPRECATED
- client_errors/MEMCACHED_E2BIG
- client_errors/MEMCACHED_END
- client_errors/MEMCACHED_ERRNO
- client_errors/MEMCACHED_FAILURE
- client_errors/MEMCACHED_FAIL_UNIX_SOCKET
- client_errors/MEMCACHED_FETCH_NOTFINISHED
- client_errors/MEMCACHED_HOST_LOOKUP_FAILURE
- client_errors/MEMCACHED_INVALID_ARGUMENTS
- client_errors/MEMCACHED_INVALID_HOST_PROTOCOL
- client_errors/MEMCACHED_ITEM
- client_errors/MEMCACHED_KEY_TOO_BIG
- client_errors/MEMCACHED_MAXIMUM_RETURN
- client_errors/MEMCACHED_MEMORY_ALLOCATION_FAILURE
- client_errors/MEMCACHED_NOTFOUND
- client_errors/MEMCACHED_NOTSTORED
- client_errors/MEMCACHED_NOT_SUPPORTED
- client_errors/MEMCACHED_NO_KEY_PROVIDED
- client_errors/MEMCACHED_NO_SERVERS
- client_errors/MEMCACHED_PARSE_ERROR
- client_errors/MEMCACHED_PARSE_USER_ERROR
- client_errors/MEMCACHED_PARTIAL_READ
- client_errors/MEMCACHED_PROTOCOL_ERROR
- client_errors/MEMCACHED_READ_FAILURE
- client_errors/MEMCACHED_SERVER_ERROR
- client_errors/MEMCACHED_SERVER_MARKED_DEAD
- client_errors/MEMCACHED_SOME_ERRORS
- client_errors/MEMCACHED_STAT
- client_errors/MEMCACHED_STORED
- client_errors/MEMCACHED_SUCCESS
- client_errors/MEMCACHED_TIMEOUT
- client_errors/MEMCACHED_UNKNOWN_READ_FAILURE
- client_errors/MEMCACHED_UNKNOWN_STAT_KEY
- client_errors/MEMCACHED_VALUE
- client_errors/MEMCACHED_WRITE_FAILURE
-
+++ /dev/null
-============================
-Creating a hashkit structure
-============================
-
-.. highlightlang:: c
-
-.. index:: object: hashkit_st
-
---------
-SYNOPSIS
---------
-
-#include <libhashkit/hashkit.h>
-
-.. c:type:: hashkit_st
-
-.. c:function:: hashkit_st *hashkit_create(hashkit_st *hash)
-
-.. c:function:: hashkit_st *hashkit_clone(hashkit_st *destination, const hashkit_st *ptr)
-
-.. c:function:: void hashkit_free(hashkit_st *hash)
-
-.. c:function:: bool hashkit_is_allocated(const hashkit_st *hash)
-
-Compile and link with -lhashkit
-
------------
-DESCRIPTION
------------
-
-
-The :c:func:`hashkit_create` function initializes a hashkit object for use. If
-you pass a NULL argument for hash, then the memory for the object is
-allocated. If you specify a pre-allocated piece of memory, that is
-initialized for use.
-
-The :c:func:`hashkit_clone` function initializes a hashkit object much like
-:c:func:`hashkit_create`, but instead of using default settings it will use
-the settings of the ptr hashkit object.
-
-The :c:func:`hashkit_free` frees any resources being consumed by the hashkit
-objects that were initialized with :c:func:`hashkit_create` or :c:func:`hashkit_clone`.
-
-The :c:func:`hashkit_is_allocated` reports where the memory was allocated
-for a hashkit object.
-
-
-------------
-RETURN VALUE
-------------
-
-
-:c:func:`hashkit_create` and :c:func:`hashkit_clone` will return NULL on
-failure or non-NULL on success.
-
-:c:func:`hashkit_is_allocated` returns true if the memory for the hashkit
-object was allocated inside of :c:func:`hashkit_create` or
-:c:func:`hashkit_clone`, otherwise it is false and was user-supplied memory.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
-
---------
-SEE ALSO
---------
-
-
-:manpage:`hashkit_create(3)` :manpage:`hashkit_value(3)` :manpage:`hashkit_set_hash_fn(3)`
-
+++ /dev/null
-================
-Available Hashes
-================
-
-.. index:: object: hashkit_st
-
-Various hash functions to use for calculating values for keys
-
-
---------
-SYNOPSIS
---------
-
-#include <libhashkit/hashkit.h>
-
-.. c:function:: uint32_t hashkit_default(const char *key, size_t key_length)
-
-.. c:function:: uint32_t hashkit_fnv1_64(const char *key, size_t key_length)
-
-.. c:function:: uint32_t hashkit_fnv1a_64(const char *key, size_t key_length)
-
-.. c:function:: uint32_t hashkit_fnv1_32(const char *key, size_t key_length)
-
-.. c:function:: uint32_t hashkit_fnv1a_32(const char *key, size_t key_length)
-
-.. c:function:: uint32_t hashkit_crc32(const char *key, size_t key_length)
-
-.. c:function:: uint32_t hashkit_hsieh(const char *key, size_t key_length)
-
-.. c:function:: uint32_t hashkit_murmur(const char *key, size_t key_length)
-
-.. c:function:: uint32_t hashkit_jenkins(const char *key, size_t key_length)
-
-.. c:function:: uint32_t hashkit_md5(const char *key, size_t key_length)
-
-Compile and link with -lhashkit
-
-
------------
-DESCRIPTION
------------
-
-
-These functions generate hash values from a key using a variety of
-algorithms. These functions can be used standalone, or as arguments
-to hashkit_set_hash_fn(3) or hashkit_set_continuum_hash_fn(3).
-
-The hashkit_hsieh is only available if the library is built with
-the appropriate flag enabled.
-
-
-------------
-RETURN VALUE
-------------
-
-
-A 32-bit hash value.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
---------
-SEE ALSO
---------
-
-
-:manpage:`hashkit_create(3)` :manpage:`hashkit_value(3)` :manpage:`hashkit_set_hash_fn(3)` :manpage:`hashkit_set_continuum_hash_fn(3)`
-
+++ /dev/null
-=============
-hashkit_value
-=============
-
-
-.. index:: object: hashkit_st
-
-Generate a value for the given key
-
---------
-SYNOPSIS
---------
-
-
-#include <libhashkit/hashkit.h>
-
-.. c:function:: uint32_t hashkit_value(hashkit_st *hash, const char *key, size_t key_length)
-
-Compile and link with -lhashkit
-
------------
-DESCRIPTION
------------
-
-
-The :c:func:`hashkit_value` function generates a 32-bit hash value from the
-given key and key_length. The hash argument is an initialized hashkit
-object, and distribution type and hash function is used from this
-object while generating the value.
-
-
-------------
-RETURN VALUE
-------------
-
-
-A 32-bit hash value.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
---------
-SEE ALSO
---------
-
-
-:manpage:`hashkit_create(3)` :manpage:`hashkit_set_distribution(3)` :manpage:`hashkit_set_hash_fn(3)`
-
-=========================================
-Welcome to the libmemcached documentation
-=========================================
+libmemcached Manual
+===================
-------------
-Libmemcached
-------------
+`libmemcached` is an open source C/C++ client library and tools for the
+memcached server (http://memcached.org/). It has been designed to be light on
+memory usage, thread safe, and provide full access to server side methods.
-.. toctree::
- :maxdepth: 1
- :caption: Basics
-
- libmemcached
- versioning
- memcached_create
- libmemcached_examples
- libmemcached_configuration
- libmemcached/memcached_last_error_message
-
-.. toctree::
- :maxdepth: 1
- :caption: Working with Data
-
- memcached_auto
- memcached_delete
- libmemcached/memcached_exist
- memcached_flush_buffers
- memcached_flush
- memcached_get
- memcached_result_st
- memcached_set
- memcached_append
- memcached_cas
.. toctree::
- :maxdepth: 1
- :caption: Advanced Topics
+ :caption: libmemcached
+ :titlesonly:
- libmemcached-1.0/memcached_set_encoding_key
- memcached_behavior
- memcached_callback
- memcached_dump
- memcached_generate_hash_value
- memcached_memory_allocators
- memcached_quit
- libmemcached/memcached_return_t
- memcached_sasl
- memcached_server_st
- memcached_servers
- memcached_strerror
- error_messages
- memcached_user_data
- memcached_verbosity
- memcached_version
- libmemcached/defaults
+ Introduction <libmemcached>
+ libmemcached/index
+ libmemcached/index_misc
.. toctree::
- :titlesonly:
- :caption: Interface Versions
+ :titlesonly:
+ :caption: libmemcachedutil
- libmemcached-1.0/index
- libmemcached-1.1/index
+ Introduction <libmemcachedutil>
+ libmemcachedutil/index
.. toctree::
- :titlesonly:
- :caption: Deprecated Functions
+ :titlesonly:
+ :caption: libhashkit
- libmemcached/memcached_fetch
+ Introduction <libhashkit>
+ libhashkit/index
.. toctree::
- :maxdepth: 1
- :caption: Platform Specifics
+ :maxdepth: 1
+ :caption: Client Applications
- tap
- types
+ bin/index
.. toctree::
- :maxdepth: 1
- :caption: Deriving Statistics from a Server
+ :caption: Copyright
+ :hidden:
- memcached_analyze
- memcached_stats
+ copyright
-.. toctree::
- :maxdepth: 1
- :caption: Libmemcachedutil
-
- libmemcachedutil
- memcached_pool
-
-.. toctree::
- :maxdepth: 1
- :caption: Client Applications
-
- bin/memcapable
- bin/memcat
- bin/memcp
- bin/memdump
- bin/memerror
- bin/memflush
- bin/memrm
- bin/memslap
- bin/memaslap
- bin/memstat
- bin/memexist.rst
- bin/memparse.rst
- bin/memping.rst
- bin/memtouch.rst
-
-.. toctree::
- :maxdepth: 1
- :caption: Libhashkit
-
- libhashkit
- hashkit_create
- hashkit_functions
- hashkit_value
-
-==================
-Indices and tables
-==================
-
-* :ref:`genindex`
-* :ref:`search`
-
-.. toctree::
- :caption: Copyright
- :hidden:
+Index
+-----
- copyright
+:ref:`genindex`
-======================
-Introducing libhashkit
-======================
-
-
-.. code-block:: c
-
- cc [ flag ... ] file ... -lhashkit
-
- #include <libhashkit/hashkit.h>
+libhashkit - C/C++ hashing library
+==================================
+SYNOPSIS
+--------
+#include <libhashkit-|libhashkit_version|/hashkit.h>
+ Compile and link with -lhashkit.
------------
DESCRIPTION
-----------
+`libhashkit` is a small and thread-safe client library that provides a collection
+of useful hashing algorithms.
-libhashkit is a small and thread-safe client library that provides a collection of useful hashing algorithm. libhashkit is distributed with libmemcached.
-
-
-----
-HOME
-----
+`libhashkit` is distributed with `libmemcached`.
+SEE ALSO
+--------
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
+.. only:: man
+ :manpage:`libmemcached(3)`
+ :manpage:`hashkit_create(3)`
+ :manpage:`hashkit_function(3)`
+ :manpage:`hashkit_functions(3)`
+ :manpage:`hashkit_value(3)`
---------
-SEE ALSO
---------
+.. only:: html
-:manpage:`libhashkit(3)`
+ * :doc:`libmemcached`
+ * :doc:`libhashkit/hashkit_create`
+ * :doc:`libhashkit/hashkit_function`
+ * :doc:`libhashkit/hashkit_functions`
+ * :doc:`libhashkit/hashkit_value`
--- /dev/null
+Creating a hashkit structure
+============================
+
+SYNOPSIS
+--------
+
+#include <libhashkit-|libhashkit_version|/hashkit.h>
+ Compile and link with -lhashkit
+
+.. type:: struct hashkit_st hashkit_st
+
+.. function:: hashkit_st *hashkit_create(hashkit_st *hash)
+
+ :param hash: memory address of a `hashkit_st` struct;
+ if a nullptr is passed, the struct will be dynamically allocated by libhashkit
+ :returns: pointer to initialized `hashkit_st` structure
+
+.. function:: hashkit_st *hashkit_clone(hashkit_st *destination, const hashkit_st *ptr)
+
+ :param destination: memory address of a `hashkit_st` struct;
+ if a nullptr is passed, the struct will be dynamically allocated by libhashkit
+ :param ptr: pointer of the `hashkit_st` struct to copy
+ :returns: pointer to a `hashkit_st` structure (`destination`, if not nullptr), initialized from `ptr`
+
+.. function:: void hashkit_free(hashkit_st *hash)
+
+ :param hash: pointer to an initialized `hashkit_st` struct
+
+.. function:: bool hashkit_is_allocated(const hashkit_st *hash)
+
+ :param hash: pointer to an initialized `hashkit_st` struct
+ :returns: bool, whether the `hash` struct was dynamically allocated
+
+DESCRIPTION
+-----------
+
+The `hashkit_create` function initializes a hashkit object for use. If you pass
+a nullptr argument for hash, then the memory for the object is allocated. If you
+specify a pre-allocated piece of memory, that is initialized for use.
+
+The `hashkit_clone` function initializes a hashkit object much like
+`hashkit_create`, but instead of using default settings it will use the settings
+of the ptr hashkit object.
+
+The `hashkit_free` frees any resources being consumed by the hashkit objects
+that were initialized with `hashkit_create` or `hashkit_clone`.
+
+The `hashkit_is_allocated` reports whether the memory was allocated for a hashkit
+object.
+
+RETURN VALUE
+------------
+
+`hashkit_create` and `hashkit_clone` will return nullptr on failure or pointer
+to `hashkit_st` on success.
+
+`hashkit_is_allocated` returns true if the memory for the hashkit object was
+allocated inside of `hashkit_create` or `hashkit_clone`, otherwise it is false
+and was user-supplied memory.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`libhashkit(3)`
+ :manpage:`hashkit_value(3)`
+ :manpage:`hashkit_function3)`
+
+.. only:: html
+
+ * :doc:`../libhashkit`
+ * :doc:`hashkit_value`
+ * :doc:`hashkit_function`
--- /dev/null
+Set Hash Function
+=================
+
+SYNOPSIS
+--------
+
+#include <libhashkit-|libhashkit_version|/hashkit.h>
+ Compile and link with -lhashkit
+
+.. type:: uint32_t (*hashkit_hash_fn)(const char *key, size_t key_length, void *context)
+
+ :param key: the key to generate a hash of
+ :param key_length: the length of the `key` without any terminating zero byte
+ :param context: the custom hash function context set through `hashkit_set_custom_function` or `hashkit_set_custom_distribution_function`
+ :returns: the custom hash function should return a hash value for `key` as an unsigned 32bit integer
+
+.. c:type:: enum hashkit_return_t hashkit_return_t
+
+.. enum:: hashkit_return_t
+
+ .. enumerator:: HASHKIT_SUCCESS
+
+ Operation succeeded.
+
+ .. enumerator:: HASHKIT_FAILURE
+
+ Operation failed.
+
+ .. enumerator:: HASHKIT_MEMORY_ALLOCATION_FAILURE
+
+ Memory allocation failed.
+
+ .. enumerator:: HASHKIT_INVALID_HASH
+
+ Invalid `hashkit_hash_algorithm_t` passed.
+
+ .. enumerator:: HASHKIT_INVALID_ARGUMENT
+
+ Invalid argument passed.
+
+.. c:type:: enum hashkit_hash_algorithm_t hashkit_hash_algorithm_t
+
+.. enum:: hashkit_hash_algorithm_t
+
+ .. enumerator:: HASHKIT_HASH_DEFAULT
+
+ Default hash algorithm (one_at_a_time).
+
+ .. enumerator:: HASHKIT_HASH_MD5
+ .. enumerator:: HASHKIT_HASH_CRC
+ .. enumerator:: HASHKIT_HASH_FNV1_64
+ .. enumerator:: HASHKIT_HASH_FNV1A_64
+ .. enumerator:: HASHKIT_HASH_FNV1_32
+ .. enumerator:: HASHKIT_HASH_FNV1A_32
+ .. enumerator:: HASHKIT_HASH_HSIEH
+
+ Only available if `libhashkit` hash been built with HSIEH support.
+
+ .. enumerator:: HASHKIT_HASH_MURMUR
+
+ Only available if `libhashkit` has been built with MURMUR support.
+
+ .. enumerator:: HASHKIT_HASH_MURMUR3
+
+ Only available if `libhashkit` has been built with MURMUR support.
+
+ .. enumerator:: HASHKIT_HASH_JENKINS
+ .. enumerator:: HASHKIT_HASH_CUSTOM
+
+ Use custom `hashkit_hash_fn` function set through `hashkit_set_custom_function` or `hashkit_set_custom_distribution_function`.
+
+.. function:: hashkit_return_t hashkit_set_function(hashkit_st *hash, hashkit_hash_algorithm_t hash_algorithm)
+
+ :param hash: pointer to an initialized `hashkit_st` struct
+ :param hash_algorithm: valid `hashkit_hash_algorithm_t` constant
+ :returns: `hashkit_return_t` indicating success or failure
+
+.. function:: hashkit_return_t hashkit_set_custom_function(hashkit_st *hash, hashkit_hash_fn function, void *context)
+
+ :param hash: pointer to initialized `hashkit_st` struct
+ :param function: `hashkit_hash_fn` function pointer to use as hash function for `HASHKIT_HASH_CUSTOM`
+ :param context: pointer to an opaque user managed context for the custom hash function
+ :returns: `hashkit_return_t` indicating success or failure
+
+.. function:: hashkit_hash_algorithm_t hashkit_get_function(const hashkit_st *hash)
+
+ :param hash: pointer to an initialized `hashkit_st` struct
+ :returns: `hashkit_hash_algorithm_t` indicating the currently set hash algorithm to use
+
+.. function:: hashkit_return_t hashkit_set_distribution_function(hashkit_st *hash, hashkit_hash_algorithm_t hash_algorithm)
+
+ :param hash: pointer to an initialized `hashkit_st` struct
+ :param hash_algorithm: valid `hashkit_hash_algrothm_t` constant
+ :returns: `hashkit_return_t` indicating success or failure
+
+.. function:: hashkit_return_t hashkit_set_custom_distribution_function(hashkit_st *hash, hashkit_hash_fn function, void *context)
+
+ :param hash: pointer to initialized `hashkit_st` struct
+ :param function: `hashkit_hash_fn` function pointer to use as distribution hash function for `HASHKIT_HASH_CUSTOM`
+ :param context: pointer to an opaque user managed context for the custom distribution hash function
+
+.. function:: hashkit_hash_algorithm_t hashkit_get_distribution_function(const hashkit_st *hash)
+
+ :param hash: pointer to an initialized `hashkit_st` struct
+ :returns: `hashkit_hash_algorithm_t` indicating the currently set distribution hash algorithm to use
+
+DESCRIPTION
+-----------
+
+These functions are used to set and retrieve the key and distribution hash functions.
+
+RETURN VALUE
+------------
+
+`hashkit_set_function`, `hashkit_set_custom_function` and the distribution
+equivalents return `hashkit_return_t::HASHKIT_SUCCESS` on success.
+
+`hashkit_get_function` and `hashkit_get_distribution_function` return
+`hashkit_hash_algorithm_t` indicating the hash function used.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`libhashkit(3)`
+ :manpage:`hashkit_create(3)`
+ :manpage:`hashkit_functions(3)`
+
+.. only:: html
+
+ * :doc:`../libhashkit`
+ * :doc:`hashkit_create`
+ * :doc:`hashkit_functions`
+
--- /dev/null
+Available Hashes
+================
+
+SYNOPSIS
+--------
+
+#include <libhashkit-|libhashkit_version|/hashkit.h>
+ Compile and link with -lhashkit
+
+.. function:: uint32_t hashkit_default(const char *key, size_t key_length)
+
+.. function:: uint32_t hashkit_fnv1_64(const char *key, size_t key_length)
+
+.. function:: uint32_t hashkit_fnv1a_64(const char *key, size_t key_length)
+
+.. function:: uint32_t hashkit_fnv1_32(const char *key, size_t key_length)
+
+.. function:: uint32_t hashkit_fnv1a_32(const char *key, size_t key_length)
+
+.. function:: uint32_t hashkit_crc32(const char *key, size_t key_length)
+
+.. function:: uint32_t hashkit_hsieh(const char *key, size_t key_length)
+
+.. function:: uint32_t hashkit_murmur(const char *key, size_t key_length)
+
+.. function:: uint32_t hashkit_murmur3(const char *key, size_t key_length)
+
+.. function:: uint32_t hashkit_jenkins(const char *key, size_t key_length)
+
+.. function:: uint32_t hashkit_md5(const char *key, size_t key_length)
+
+DESCRIPTION
+-----------
+
+These functions generate hash values from a key using a variety of
+algorithms. These functions can be used standalone, or will be used
+according to the algorithm set with `hashkit_set_function`
+or `hashkit_set_distribution_function`.
+
+The `hashkit_hsieh`, `hashkit_murmur` and `hashkit_murmur3` functions are
+only available if the library is built with the appropriate flag enabled.
+
+RETURN VALUE
+------------
+
+A 32-bit hash value.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`libhashkit(3)`
+ :manpage:`hashkit_create(3)`
+ :manpage:`hashkit_function(3)`
+
+.. only:: html
+
+ * :doc:`../libhashkit`
+ * :doc:`hashkit_create`
+ * :doc:`hashkit_function`
+
--- /dev/null
+Generate hash value
+===================
+
+SYNOPSIS
+--------
+
+#include <libhashkit-|libhashkit_version|/hashkit.h>
+ Compile and link with -lhashkit
+
+.. function:: uint32_t hashkit_value(hashkit_st *hash, const char *key, size_t key_length)
+
+ :param hash: pointer to an initialized `hashkit_st` struct
+ :param key: the key to genereate a hash of
+ :param key_length: the length of the `key` without any terminating zero byte
+
+DESCRIPTION
+-----------
+
+The `hashkit_value` function generates a 32-bit hash value from the given key
+and key_length. The hash argument is an initialized hashkit object, and
+distribution type and hash function is used from this object while generating
+the value.
+
+RETURN VALUE
+------------
+
+A 32-bit hash value.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`libhashkit(3)`
+ :manpage:`hashkit_create(3)`
+ :manpage:`hashkit_function(3)`
+ :manpage:`hashkit_functions(3)`
+
+.. only:: html
+
+ * :doc:`../libhashkit`
+ * :doc:`hashkit_create`
+ * :doc:`hashkit_function`
+ * :doc:`hashkit_functions`
+
--- /dev/null
+libhashkit API
+==============
+
+.. toctree::
+ :titlesonly:
+ :caption: Hashkit API
+
+ hashkit_create
+ hashkit_function
+ hashkit_functions
+ hashkit_value
+++ /dev/null
-====================
-libmemcached 1.0 API
-====================
-
-
-.. toctree::
- :titlesonly:
-
- memcached_touch
+++ /dev/null
-==================
-Set encryption key
-==================
-
-.. index:: object: memcached_st
-
---------
-SYNOPSIS
---------
-
-#include <libmemcached/memcached.h>
-
-.. c:function:: void memcached_set_encoding_key (memcached_st *ptr, const char *string, const size_t string_length)
-
-Compile and link with -lmemcached
-
------------
-DESCRIPTION
------------
-
-
-:c:func:`memcached_set_encoding_key` sets the key that will be used to encrypt and decrypt data as it is sent and recieved from the server.
-
-Currently only AES is is supported.
-
-
-------
-RETURN
-------
-
-
-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.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
-------
-AUTHOR
-------
-
-
-Brian Aker, <brian@tangent.org>
-
-
---------
-SEE ALSO
---------
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
+++ /dev/null
-===========================================
-memcached_touch, memcached_touch_by_key
-===========================================
-
-.. index:: object: memcached_st
-
---------
-SYNOPSIS
---------
-
-
-#include <libmemcached/memcached.h>
-
-.. c:function:: memcached_return_t memcached_touch (memcached_st *ptr, const char *key, size_t key_length, time_t expiration)
-
-.. c:function:: memcached_return_t memcached_touch_by_key (memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, time_t expiration)
-
-Compile and link with -lmemcached
-
------------
-DESCRIPTION
------------
-
-
-:c:func:`memcached_touch` is used to update the expiration time on an existing key.
-:c:func:`memcached_touch_by_key` works the same, but it takes a master key
-to find the given value.
-
-
-------
-RETURN
-------
-
-
-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.
-
-----
-HOME
-----
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
-------
-AUTHOR
-------
-
-
-Brian Aker, <brian@tangent.org>
-
-
---------
-SEE ALSO
---------
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
-
+++ /dev/null
-====================
-libmemcached 1.1 API
-====================
-
-The 1.1 is still being finalized. It will be the 1.0 API minus deprecated functions.
-==============================================
-Introducing the C Client Library for memcached
-==============================================
+C/C++ Client Library for memcached
+==================================
---------
SYNOPSIS
--------
#include <libmemcached/memcached.h>
-
-Compile and link with -lmemcached
+ Compile and link with -lmemcached
=======
-libMemcached is an open source C/C++ client library and tools for the memcached server (http://memcached.org/). It has been designed to be light on memory usage, thread safe, and provide full access to server side methods.
+`libmemcached` is an open source C/C++ client library and tools for the
+memcached server (http://memcached.org/). It has been designed to be light on
+memory usage, thread safe, and provide full access to server side methods.
-libMemcached was designed to provide the greatest number of options to use Memcached. Some of the features provided:
+`libmemcached` was designed to provide the greatest number of options to use
+Memcached. Some of the features provided:
1. Asynchronous and Synchronous Transport Support.
2. Consistent Hashing and Distribution.
6. A complete reference guide and documentation to the API.
7. Tools to Manage your Memcached networks.
------------
DESCRIPTION
-----------
+"Memcached is a high-performance, distributed memory object caching system,
+generic in nature, but intended for use in speeding up dynamic web applications
+by alleviating database load." `http://memcached.org/ <http://memcached.org/>`_
-"Memcached is a high-performance, distributed memory object caching
-system, generic in nature, but intended for use in speeding up dynamic web
-applications by alleviating database load." `http://memcached.org/ <http://memcached.org/>`_
-
-:program:`libmemcached` is a small, thread-safe client library for the
-memcached protocol. The code has all been written to allow
-for both web and embedded usage. It handles the work behind routing
-individual keys to specific servers specified by the developer (and values are
-matched based on server order as supplied by the user). It implements
-a modular and consistent method of object distribution.
+`libmemcached` is a small, thread-safe client library for the memcached
+protocol. The code has all been written to allow for both web and embedded
+usage. It handles the work behind routing individual keys to specific servers
+specified by the developer (and values are matched based on server order as
+supplied by the user). It implements a modular and consistent method of object
+distribution.
There are multiple implemented routing and hashing methods. See the
-:c:func:`memcached_behavior_set` manpage for more information.
-
-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 :c:func:`memcached_create`. Functions have
-been 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 :c:type:`memcached_return_t` value.
-This value can be translated to a printable string with
-:c:type:`memcached_strerror`.
+`memcached_behavior_set` manpage for more information.
-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.
+All operations are performed against a `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 recommended that you operate directly
+against the structure.
-Group keys can be optionally used to group sets of objects with servers.
+Nearly all functions return a `memcached_return_t` value. This value can be
+translated to a printable string with `memcached_strerror`.
-Namespaces are supported, and can be used to partition caches so that multiple applications can use the same memcached servers.
+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.
-: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.
+Group keys can be optionally used to group sets of objects with servers.
-If you are working with GNU autotools you will want to add the following to
-your COPYING to properly include libmemcached in your application.
+Namespaces are supported, and can be used to partition caches so that multiple
+applications can use the same memcached servers.
-PKG_CHECK_MODULES(DEPS, libmemcached >= 0.8.0)
-AC_SUBST(DEPS_CFLAGS)
-AC_SUBST(DEPS_LIBS)
+Some features of the library must be enabled through `memcached_behavior_set`.
-Some features of the library must be enabled through :c:func:`memcached_behavior_set`.
+THREADS AND PROCESSES
+---------------------
-Hope you enjoy it!
+No global variables are used in this library.
+`memcached_st` structures are thread-safe, but 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` on a `memcached_st` and
+then use the resulting cloned structure.
----------
-CONSTANTS
+SYSTEMTAP
---------
+`libmemcached` can be built to support Systemtap on Linux when enabled at
+compile time.
-A number of constants have been provided for in the library.
+Please see :manpage:`stap(1)` and :manpage:`dtrace(1)` for more information
+about Systemtap.
+CLIENT PROGRAMS
+---------------
-.. c:macro:: MEMCACHED_DEFAULT_PORT
-
- The default port used by memcached(3).
-
+`libmemcached` comes with a few useful client programs:
-.. c:macro:: MEMCACHED_MAX_KEY
-
- Default maximum size of a key (which includes the null pointer). Master keys
- have no limit, this only applies to keys used for storage.
-
+.. only:: man
-.. c:macro:: MEMCACHED_MAX_BUFFER
-
- Default size of read/write buffers (which includes the null pointer).
-
+ :manpage:`memaslap(1)`
+ :manpage:`memcapable(1)`
+ :manpage:`memcat(1)`
+ :manpage:`memcp(1)`
+ :manpage:`memdump(1)`
+ :manpage:`memerror(1)`
+ :manpage:`memexist(1)`
+ :manpage:`memflush(1)`
+ :manpage:`memparse(1)`
+ :manpage:`memping(1)`
+ :manpage:`memrm(1)`
+ :manpage:`memslap(1)`
+ :manpage:`memstat(1)`
+ :manpage:`memtouch(1)`
-.. c:macro:: MEMCACHED_STRIDE
-
- This is the "stride" used in the consistent hash used between replicas.
-
+.. only:: html
-.. c:macro:: MEMCACHED_MAX_HOST_LENGTH
-
- Maximum allowed size of the hostname.
-
+ * :doc:`bin/memaslap`
+ * :doc:`bin/memcapable`
+ * :doc:`bin/memcat`
+ * :doc:`bin/memcp`
+ * :doc:`bin/memdump`
+ * :doc:`bin/memerror`
+ * :doc:`bin/memexist`
+ * :doc:`bin/memflush`
+ * :doc:`bin/memparse`
+ * :doc:`bin/memping`
+ * :doc:`bin/memrm`
+ * :doc:`bin/memslap`
+ * :doc:`bin/memstat`
+ * :doc:`bin/memtouch`
-.. c:macro:: LIBMEMCACHED_VERSION_STRING
-
- String value of libmemcached version such as "1.23.4"
+UTILITY LIBRARIES
+-----------------
+.. only:: man
-.. c:macro:: LIBMEMCACHED_VERSION_HEX
-
- Hex value of the version number. "0x00048000" This can be used for comparing versions based on number.
-
+ :manpage:`libhashkit(3)`
+ :manpage:`libmemcachedutil(3)`
-.. c:macro:: MEMCACHED_PREFIX_KEY_MAX_SIZE
+.. only:: html
- Maximum length allowed for namespacing of a key.
+ * :doc:`libhashkit`
+ * :doc:`libmemcachedutil`
-
-
----------------------
-THREADS AND PROCESSES
----------------------
-
-
-When using threads or forked processes it is important to keep one instance
-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 :c:func:`memcached_quit` on a :c:type:`memcached_st` and then use the resulting cloned structure.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
---------
SEE ALSO
--------
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached_configuration(3)`
+ :manpage:`libmemcached_examples(3)`
+
+ :manpage:`memcached_analyze(3)`
+ :manpage:`memcached_append(3)`
+ :manpage:`memcached_auto(3)`
+ :manpage:`memcached_behavior(3)`
+ :manpage:`memcached_callback(3)`
+ :manpage:`memcached_cas(3)`
+ :manpage:`memcached_create(3)`
+ :manpage:`memcached_delete(3)`
+ :manpage:`memcached_dump(3)`
+ :manpage:`memcached_exist(3)`
+ :manpage:`memcached_fetch(3)`
+ :manpage:`memcached_flush(3)`
+ :manpage:`memcached_flush_buffers(3)`
+ :manpage:`memcached_generate_hash_value(3)`
+ :manpage:`memcached_get(3)`
+ :manpage:`memcached_last_error_message(3)`
+ :manpage:`memcached_memory_allocators(3)`
+ :manpage:`memcached_pool(3)`
+ :manpage:`memcached_quit(3)`
+ :manpage:`memcached_result_st(3)`
+ :manpage:`memcached_return_t(3)`
+ :manpage:`memcached_sasl(3)`
+ :manpage:`memcached_servers(3)`
+ :manpage:`memcached_server_st(3)`
+ :manpage:`memcached_set(3)`
+ :manpage:`memcached_set_encoding_key(3)`
+ :manpage:`memcached_stats(3)`
+ :manpage:`memcached_strerror(3)`
+ :manpage:`memcached_touch(3)`
+ :manpage:`memcached_user_data(3)`
+ :manpage:`memcached_verbosity(3)`
+ :manpage:`memcached_version(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+
+ * :doc:`libmemcached/configuration`
+ * :doc:`libmemcached/examples`
-:manpage:`memcached(1)` :manpage:`libmemcached_examples(3)`
-:manpage:`libmemcached(1)` :manpage:`memcat(1)` :manpage:`memcp(1)`
-:manpage:`memflush(1)` :manpage:`memrm(1)` :manpage:`memslap(1)`
-:manpage:`memstat(1)` :manpage:`memcached_fetch(3)`
-:manpage:`memcached_replace(3)` :manpage:`memcached_server_list_free(3)`
-:manpage:`libmemcached_examples(3)` :manpage:`memcached_clone(3)`
-:manpage:`memcached_free(3)` :manpage:`memcached_server_add(3)`
-:manpage:`memcached_server_push(3)` :manpage:`memcached_add(3)`
-:manpage:`memcached_get(3)` :manpage:`memcached_server_count(3)`
-:manpage:`memcached_create(3)` :manpage:`memcached_increment(3)`
-:manpage:`memcached_server_list(3)` :manpage:`memcached_set(3)`
-:manpage:`memcached_decrement(3)` :manpage:`memcached_mget(3)`
-:manpage:`memcached_server_list_append(3)` :manpage:`memcached_strerror(3)`
-:manpage:`memcached_delete(3)` :manpage:`memcached_quit(3)`
-:manpage:`memcached_server_list_count(3)` :manpage:`memcached_verbosity(3)`
-:manpage:`memcached_server_add_unix_socket(3)`
-:manpage:`memcached_result_create(3)` :manpage:`memcached_result_free(3)`
-:manpage:`memcached_result_key_value(3)`
-:manpage:`memcached_result_key_length(3)`
-:manpage:`memcached_result_value(3)` :manpage:`memcached_result_length(3)`
-:manpage:`memcached_result_flags(3)` :manpage:`memcached_result_cas(3)`
-:manpage:`memcached_result_st(3)` :manpage:`memcached_append(3)`
-:manpage:`memcached_prepend(3)` :manpage:`memcached_fetch_result(3)`
-:manpage:`memerror(1)` :manpage:`memcached_get_by_key(3)`
-:manpage:`memcached_mget_by_key(3)` :manpage:`memcached_delete_by_key(3)`
-:manpage:`memcached_fetch_execute(3)` :manpage:`memcached_callback_get(3)`
-:manpage:`memcached_callback_set(3)` :manpage:`memcached_version(3)`
-:manpage:`memcached_lib_version(3)` :manpage:`memcached_result_set_value(3)`
-:manpage:`memcached_dump(3)` :manpage:`memdump(1)`
-:manpage:`memcached_set_memory_allocators(3)`
-:manpage:`memcached_get_memory_allocators(3)`
-:manpage:`memcached_get_user_data(3)` :manpage:`memcached_set_user_data(3)`
--- /dev/null
+libmemcached Configuration
+==========================
+
+SYNOPSIS
+--------
+
+#include <libmemcached-|libmemcached_version|/memcached.h>
+ Compile and link with -lmemcached
+
+.. function:: memcached_st *memcached(const char *string, size_t string_length)
+
+ :param string: configuration string
+ :param string_length: length of the configuration string without any terminating zero
+ :returns: allocated and initialized `memcached_st` struct
+
+.. function:: memcached_return_t libmemcached_check_configuration(const char *option_string, size_t length, char *error_buffer, size_t error_buffer_size)
+
+ :param option_string: configuration string
+ :param length: length of the configuration string without any terminating zero
+ :param error_buffer: buffer used to store any error message
+ :param error_buffer_size: available size of the `error_buffer`
+ :returns: `memcached_return_t` indicating success
+
+DESCRIPTION
+-----------
+
+`libmemcached` implements a custom language for configuring and modifying
+servers. By passing in an option string you can generate a `memcached_st` object
+that you can use in your application directly.
+
+General Options:
+~~~~~~~~~~~~~~~~
+
+.. describe:: --SERVER=<servername>:<optional_port>/?<optional_weight>
+
+ Provide a servername to be used by the client.
+
+ Providing a weight will cause weighting to occur with all hosts with each
+ server getting a default weight of 1.
+
+.. describe:: --SOCKET=\"<filepath>/?<optional_weight>\"
+
+ Provide a filepath to a UNIX socket file. Providing a weight will cause
+ weighting to occur with all hosts with each server getting a default weight
+ of 1.
+
+.. describe:: --VERIFY-KEY
+
+ Verify that keys that are being used fit within the design of the protocol
+ being used.
+
+.. describe:: --REMOVE_FAILED_SERVERS
+
+ Enable the behavior `MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS`.
+
+.. describe:: --BINARY-PROTOCOL
+
+ Force all connections to use the binary protocol.
+
+.. describe:: --BUFFER-REQUESTS
+
+ Please see `MEMCACHED_BEHAVIOR_BUFFER_REQUESTS`.
+
+.. describe:: --CONFIGURE-FILE=
+
+ Provide a configuration file to be used to load requests. Beware that by
+ using a configuration file `libmemcached` will reset `memcached_st` based
+ on information only contained in the file.
+
+.. describe:: --CONNECT-TIMEOUT=
+
+ See `memcached_behavior_set` for `MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT`.
+
+.. describe:: --DISTRIBUTION=
+
+ Set the distribution model used by the client.
+ See `memcached_behavior_set` for more details.
+
+.. describe:: --HASH=
+
+ Set the hashing algorithm used for placing keys on servers.
+
+.. describe:: --HASH-WITH-NAMESPACE
+
+ When enabled the prefix key will be added to the key when determining which
+ server to store the data in.
+
+.. describe:: --NOREPLY
+
+ Enable "no reply" for all calls that support this. It is highly recommended
+ that you use this option with the binary protocol only.
+
+.. describe:: --NUMBER-OF-REPLICAS=
+
+ Set the number of servers that keys will be replicated to.
+
+.. describe:: --RANDOMIZE-REPLICA-READ
+
+ Select randomly the server within the replication pool to read from.
+
+.. describe:: --SORT-HOSTS
+
+ When adding new servers always calculate their distribution based on sorted
+ naming order.
+
+.. describe:: --SUPPORT-CAS
+
+ See `memcached_behavior_set` for `MEMCACHED_BEHAVIOR_SUPPORT_CAS`
+
+.. describe:: --USE-UDP
+
+ See `memcached_behavior_set` for `MEMCACHED_BEHAVIOR_USE_UDP`
+
+.. describe:: --NAMESPACE=
+
+ A namespace is a container that provides context for keys, only other
+ requests that know the namespace can access these values. This is
+ accomplished by prepending the namespace value to all keys.
+
+Memcached Pool Options:
+~~~~~~~~~~~~~~~~~~~~~~~
+
+.. describe:: --POOL-MIN
+
+ Initial size of pool.
+
+.. describe:: --POOL-MAX
+
+ Maximize size of the pool.
+
+I/O Options:
+~~~~~~~~~~~~
+
+.. describe:: --TCP-NODELAY
+
+ See `memcached_behavior_set` for `MEMCACHED_BEHAVIOR_TCP_NODELAY`
+
+.. describe:: --TCP-KEEPALIVE
+
+ See `memcached_behavior_set` for `MEMCACHED_BEHAVIOR_TCP_KEEPALIVE`
+
+.. describe:: --RETRY-TIMEOUT=
+
+ See `memcached_behavior_set` for `MEMCACHED_BEHAVIOR_RETRY_TIMEOUT`
+
+.. describe:: --SERVER-FAILURE-LIMIT=
+
+ See `memcached_behavior_set` for `MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT`
+
+.. describe:: --SND-TIMEOUT=
+
+ See `memcached_behavior_set` for `MEMCACHED_BEHAVIOR_SND_TIMEOUT`
+
+.. describe:: --SOCKET-RECV-SIZE=
+
+ See `memcached_behavior_set` for `MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE`
+
+.. describe:: --SOCKET-SEND-SIZE=
+
+ See `memcached_behavior_set` for `MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE`
+
+.. describe:: --POLL-TIMEOUT=
+
+ Set the timeout used by :manpage:`poll(3)`.
+
+.. describe:: --IO-BYTES-WATERMARK=
+
+.. describe:: --IO-KEY-PREFETCH=
+
+.. describe:: --IO-MSG-WATERMARK=
+
+.. describe:: --TCP-KEEPIDLE
+
+.. describe:: --RCV-TIMEOUT=
+
+Other Options:
+~~~~~~~~~~~~~~
+
+.. describe:: INCLUDE
+
+ Include a file in configuration.
+ Unlike ``--CONFIGURE-FILE=`` this will not reset `memcached_st`.
+
+.. describe:: RESET
+
+ Reset `memcached_st` and continue to process.
+
+.. describe:: END
+
+ End configuration processing.
+
+.. describe:: ERROR
+
+ End configuration processing and throw an error.
+
+ENVIRONMENT
+-----------
+
+.. envvar:: LIBMEMCACHED
+
+RETURN VALUE
+------------
+
+`memcached` returns a pointer to the `memcached_st` that was created (or
+initialized). On an allocation failure, it returns NULL.
+
+EXAMPLE
+-------
+
+.. code-block:: c
+
+ const char *config_string=
+ "--SERVER=host10.example.com "
+ "--SERVER=host11.example.com "
+ "--SERVER=host10.example.com";
+ memcached_st *memc= memcached(config_string, strlen(config_string));
+ {
+ // ...
+ }
+ memcached_free(memc);
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_strerror(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_strerror`
--- /dev/null
+libmemcached Constants and Defaults
+===================================
+
+SYNOPSIS
+--------
+
+#include <libmemcached-|libmemcached_version|/memcached.h>
+ Compile and link with -lmemcached
+
+.. c:macro:: LIBMEMCACHED_VERSION_STRING
+
+ String value of libmemcached version such as "|release|"
+
+.. c:macro:: LIBMEMCACHED_VERSION_HEX
+
+ Hex value of the version number, e.g. "0x00048000".
+ This can be used for comparing versions based on number.
+
+
+.. c:macro:: MEMCACHED_DEFAULT_PORT
+
+ The default port used by `memcached`.
+
+.. c:macro:: MEMCACHED_DEFAULT_TIMEOUT
+
+ Default timeout of 5000 milliseconds.
+
+.. c:macro:: MEMCACHED_DEFAULT_CONNECT_TIMEOUT
+
+ Default connect timeout of 4000 milliseconds.
+
+
+.. c:macro:: MEMCACHED_MAX_BUFFER
+
+ Default size of read/write buffers (which includes the null pointer).
+
+.. c:macro:: MEMCACHED_MAX_KEY
+
+ Default maximum size of a key (which includes the null pointer). Master keys
+ have no limit, this only applies to keys used for storage.
+
+.. c:macro:: MEMCACHED_MAX_NAMESPACE
+
+ Maximum length allowed for namespacing of a key. Defaults to 128.
+
+
+.. c:macro:: MEMCACHED_MAX_HOST_LENGTH
+
+ Maximum allowed length of the hostname.
+
+.. c:macro:: MEMCACHED_MAX_HOST_SORT_LENGTH
+
+ Length of the host string used for sorting. Used for Ketama.
+
+.. c:macro:: MEMCACHED_MAX_INTEGER_DISPLAY_LENGTH
+
+ Maximum display width of an integer represented as string.
+
+
+.. c:macro:: MEMCACHED_CONTINUUM_ADDITION
+
+ How many extra slots we should build for in the continuum, defaults to 10.
+
+.. c:macro:: MEMCACHED_EXPIRATION_NOT_ADD
+
+ Value ``0xffffffffU``
+
+.. c:macro:: MEMCACHED_STRIDE
+
+ This is the "stride" used in the consistent hash used between replicas.
+
+
+.. c:macro:: MEMCACHED_SERVER_FAILURE_LIMIT
+
+ Value 5
+
+.. c:macro:: MEMCACHED_SERVER_FAILURE_RETRY_TIMEOUT
+
+ Value 2
+
+.. c:macro:: MEMCACHED_SERVER_FAILURE_DEAD_TIMEOUT
+
+ Value 0
+
+
+.. c:macro:: MEMCACHED_VERSION_STRING_LENGTH
+
+ Value 24
+
+DESCRIPTION
+-----------
+
+These compile time defaults are provided by `libmemcached` for convenience.
+++ /dev/null
-========
-DEFAULTS
-========
-
-
-.. c:macro:: MEMCACHED_DEFAULT_TIMEOUT
-
-Value 5000
-
-.. c:macro:: MEMCACHED_DEFAULT_CONNECT_TIMEOUT
-
- Value 4000
-
-.. c:macro:: MEMCACHED_CONTINUUM_ADDITION
-
- Value 10. How many extra slots we should build for in the continuum.
-
-.. c:macro:: MEMCACHED_SERVER_FAILURE_LIMIT
-
- Value 5
-
-.. c:macro:: MEMCACHED_SERVER_FAILURE_RETRY_TIMEOUT
-
- Value 2
-
-.. c:macro:: MEMCACHED_SERVER_FAILURE_DEAD_TIMEOUT
-
- Value 0
-
-.. c:macro:: `MEMCACHED_PREFIX_KEY_MAX_SIZE`
-
- Value 128
-
-.. c:macro:: MEMCACHED_VERSION_STRING_LENGTH
-
- Value 24
--- /dev/null
+libmemcached Examples
+=====================
+
+Examples for libmemcached
+
+DESCRIPTION
+-----------
+
+For full examples, test cases are found in tests/\*.c in the main distribution.
+These are always up to date, and are used for each test run of the library.
+
+Connecting to servers
+---------------------
+
+.. code-block:: c
+
+ const char *config_string =
+ "--SERVER=host10.example.com "
+ "--SERVER=host11.example.com "
+ "--SERVER=host10.example.com";
+ memcached_st *memc= memcached(config_string, strlen(config_string);
+ {
+ // ...
+ }
+ memcached_free(memc);
+
+In the above code you create a `memcached_st` object with three server by making
+use of `memcached_create`.
+
+Creating a pool of servers
+--------------------------
+
+.. code-block:: c
+
+ const char *config_string =
+ "--SERVER=host10.example.com "
+ "--SERVER=host11.example.com "
+ "--SERVER=host10.example.com";
+
+ memcached_pool_st* pool= memcached_pool(config_string, strlen(config_string));
+
+ memcached_return_t rc;
+
+ memcached_st *memc= memcached_pool_pop(pool, false, &rc);
+
+ // .... do work
+
+ /*
+ Release the memc_ptr that was pulled from the pool
+ */
+ memcached_pool_push(pool, memc);
+
+ /*
+ Destroy the pool.
+ */
+ memcached_pool_destroy(pool);
+
+In the above code you create a `memcached_pool_st` object with three server by
+making use of `memcached_pool()`.
+
+When `memcached_pool_destroy()` all memory will be released that is associated
+with the pool.
+
+Adding a value to the server
+----------------------------
+
+.. code-block:: c
+
+ char *key= "foo";
+ char *value= "value";
+ time_t expires = 0;
+ uint32_t flags = 0;
+
+ memcached_return_t rc = memcached_set(memc,
+ key, strlen(key),
+ value, value_length,
+ expires, flags);
+
+ if (rc != MEMCACHED_SUCCESS)
+ {
+ // handle failure
+ }
+
+It is best practice to always look at the return value of any operation.
+
+Fetching multiple values
+------------------------
+
+.. code-block:: c
+
+ memcached_return_t rc;
+ char *keys[]= {"fudge", "son", "food"};
+ size_t key_length[]= {5, 3, 4};
+ unsigned int x;
+ uint32_t flags;
+
+ char return_key[MEMCACHED_MAX_KEY];
+ size_t return_key_length;
+ char *return_value;
+ size_t return_value_length;
+
+ rc= memcached_mget(memc, keys, key_length, 3);
+
+ x= 0;
+ while ((return_value= memcached_fetch(memc, return_key, &return_key_length,
+ &return_value_length, &flags, &rc)))
+ {
+ free(return_value);
+ x++;
+ }
+
+Notice that you freed values returned from memcached_fetch(). The define
+`MEMCACHED_MAX_KEY` is provided for usage.
+
+SEE ALSO
+--------
+
+ :manpage:`memcached(1)`
+
--- /dev/null
+libmemcached API
+================
+
+.. toctree::
+ :titlesonly:
+ :caption: Basics
+
+ index_basics
+
+.. toctree::
+ :titlesonly:
+ :caption: Working with Data
+
+ index_data
+
+.. toctree::
+ :titlesonly:
+ :caption: Messages and Errors
+
+ index_errors
+
+.. toctree::
+ :caption: Advanced Topics
+ :titlesonly:
+
+ index_advanced
+
+.. toctree::
+ :titlesonly:
+ :caption: Deprecated Functionality
+
+ index_deprecated
+
+.. toctree:
+ :titlesonly:
+ :caption: Miscellaneous
+
+ index_misc
--- /dev/null
+Advanced Topics
+===============
+
+.. toctree::
+ :titlesonly:
+ :caption: Internal Behavior
+
+ index_advanced_internals
+
+.. toctree::
+ :titlesonly:
+ :caption: Authentication, Encryption & Hashing
+
+ index_advanced_aeh.rst
+
+.. toctree::
+ :titlesonly:
+ :caption: Servers and Server Lists
+
+ index_advanced_servers
+
+.. toctree::
+ :titlesonly:
+ :caption: Affecting the memcached Daemon
+
+ index_advanced_daemon
+
+.. toctree::
+ :titlesonly:
+ :caption: Deriving Statistics from a Server
+
+ index_advanced_stats
--- /dev/null
+Authentication, Encryption & Hashing
+====================================
+
+.. toctree::
+ :titlesonly:
+
+ memcached_set_encoding_key
+ memcached_generate_hash_value
+ memcached_sasl
--- /dev/null
+Affecting the memcached Daemon
+==============================
+
+.. toctree::
+ :titlesonly:
+
+ memcached_dump
+ memcached_flush
+ memcached_verbosity
--- /dev/null
+Internal Behavior
+=================
+
+.. toctree::
+ :titlesonly:
+
+ memcached_behavior
+ memcached_callback
+ memcached_memory_allocators
+ memcached_user_data
--- /dev/null
+Servers and Server Lists
+========================
+
+.. toctree::
+ :titlesonly:
+
+ memcached_server_st
+ memcached_servers
--- /dev/null
+Statistics
+==========
+
+.. toctree::
+ :titlesonly:
+
+ memcached_analyze
+ memcached_stats
+ memcached_version
--- /dev/null
+Basics
+======
+
+.. toctree::
+ :titlesonly:
+
+ memcached_create
+ memcached_get
+ memcached_set
+ memcached_delete
+ memcached_quit
--- /dev/null
+Working with Data
+=================
+
+.. toctree::
+ :titlesonly:
+
+ memcached_auto
+ memcached_exist
+ memcached_touch
+
+ memcached_flush_buffers
+ memcached_result_st
+
+ memcached_append
+ memcached_cas
--- /dev/null
+Deprecated Functionality
+========================
+
+.. toctree::
+ :titlesonly:
+
+ memcached_fetch
+
--- /dev/null
+Messages and Errors
+===================
+
+.. toctree::
+ :titlesonly:
+
+ memcached_return_t
+ memcached_last_error
+ memcached_strerror
--- /dev/null
+Misc
+====
+
+.. toctree::
+ :titlesonly:
+
+ Configuration <configuration>
+ Constants <constants>
+ Examples <examples>
+ Versioning <versioning>
--- /dev/null
+Analyzing servers
+=================
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
+
+.. type:: struct memcached_analysis_st memcached_analysis_st
+
+.. function:: memcached_analysis_st *memcached_analyze(memcached_st *ptr, memcached_stat_st *stat, memcached_return_t *error)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :param stat: pointer to a `memcached_stat_st` struct to fill
+ :param error: pointer to `memcached_return_t` indicating success
+ :returns: pointer to an allocated and filled out `memcached_analysis_t` struct
+
+DESCRIPTION
+-----------
+
+`libmemcached` has the ability to query a memcached server (or collection of
+servers) for their current state. Queries to find state return a
+`memcached_analysis_st` structure. You are responsible for freeing this
+structure.
+
+`memcached_analyze` analyzes useful information based on the provided servers
+and sets the result to the `memcached_analysis_st` structure. The return value
+must be freed by the calling application.
+
+.. seealso:: :option:`memstat --analyze`
+ A command line tool to analyze a memcached server.
+
+
+RETURN VALUE
+------------
+
+A pointer to the allocated `memcached_analysis_st` structure on success and a
+NULL pointer on failure. You may inspect the error detail by checking the
+`memcached_return_t` value.
+
+Any method returning a `memcached_analysis_st` expects you to free the memory
+allocated for it.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_strerror(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_strerror`
--- /dev/null
+Appending or Prepending Data
+============================
+
+SYNOPSIS
+--------
+
+#include <libmemcached-|libmemcached_version|/memcached.h>
+ Compile and link with -lmemcached
+
+.. function:: memcached_return_t memcached_prepend(memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags)
+
+.. function:: memcached_return_t memcached_append(memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags)
+
+.. function:: memcached_return_t memcached_prepend_by_key(memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags)
+
+.. function:: memcached_return_t memcached_append_by_key(memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags)
+
+ :param ptr: pointer to an initialized `memcached_st` struct
+ :param group_key: key namespace
+ :param group_key_length: length of the key namespace without any terminating zero
+ :param key: the key
+ :param key_length: length of the key without any terminating zero
+ :param value: the value to append/prepend
+ :param value_length: the length of the value without any terminating zero
+ :param expiration: expiration as a unix timestamp or as relative expiration time in seconds
+ :param flags: 16 bit flags
+ :returns: `memcached_return_t` indicating success
+
+DESCRIPTION
+-----------
+
+`memcached_prepend` and memcached_append are used to modify information on a
+server. All methods take a ``key``, and ``key_length`` to store the object. Keys
+are currently limited to 250 characters when using either a version of memcached
+which is 1.4 or below, or when using the text protocol. You must supply both a
+value and a length. Optionally you may set an expiration time for the object
+and a 16 bit value (it is meant to be used as a bitmap). ``flags`` is a 4 byte
+space that is stored along the main value. Many sub libraries make use of
+this field, so in most cases users should avoid making use of it.
+
+`memcached_prepend` places a segment of data before the last piece of data
+stored. Currently expiration and key are not used in the server.
+
+`memcached_append` places a segment of data at the end of the last piece of data
+stored. Currently expiration and key are not used in the server.
+
+`memcached_prepend_by_key` and `memcached_append_by_key` methods both behave in
+a similar manner 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 tested 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.
+
+RETURN VALUE
+------------
+
+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.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_strerror(3)`
+ :manpage:`memcached_set(3)`
+ :manpage:`memcached_add(3)`
+ :manpage:`memcached_cas(3)`
+ :manpage:`memcached_replace(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_set`
+ * :doc:`memcached_cas`
+ * :doc:`memcached_strerror`
--- /dev/null
+Incrementing and Decrementing Values
+====================================
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
+
+.. function:: memcached_return_t memcached_increment (memcached_st *ptr, const char *key, size_t key_length, uint32_t offset, uint64_t *value)
+
+.. function:: memcached_return_t memcached_decrement (memcached_st *ptr, const char *key, size_t key_length, uint32_t offset, uint64_t *value)
+
+.. function:: memcached_return_t memcached_increment_with_initial (memcached_st *ptr, const char *key, size_t key_length, uint64_t offset, uint64_t initial, time_t expiration, uint64_t *value)
+
+.. function:: memcached_return_t memcached_decrement_with_initial (memcached_st *ptr, const char *key, size_t key_length, uint64_t offset, uint64_t initial, time_t expiration, uint64_t *value)
+
+.. function:: memcached_return_t memcached_increment_by_key (memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, uint32_t offset, uint64_t *value)
+
+.. function:: memcached_return_t memcached_decrement_by_key (memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, uint32_t offset, uint64_t *value)
+
+.. function:: memcached_return_t memcached_increment_with_initial_by_key (memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, uint64_t offset, uint64_t initial, time_t expiration, uint64_t *value)
+
+.. function:: memcached_return_t memcached_decrement_with_initial_by_key (memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, uint64_t offset, uint64_t initial, time_t expiration, uint64_t *value)
+
+ :param ptr: pointer to an initialized `memcached_st` struct
+ :param group_key: key namespace
+ :param group_key_length: length of the key namespace without any terminating zero
+ :param key: the key
+ :param key_length: length of the key without any terminating zero
+ :param offset: offset to increment/decrement
+ :param initial: initial value if `key` does not exist and `expiration` is not `MEMCACHED_EXPIRATION_NOT_ADD`
+ :param expiration: expiration as a unix timestamp or as relative expiration time in seconds
+ :param value: the resulting value after initialization/increment/decrement
+ :returns: `memcached_return_t` indicating success
+
+DESCRIPTION
+-----------
+
+:manpage:`memcached(1)` servers have the ability to increment and decrement keys
+(overflow and underflow are not detected). This gives you the ability to use
+memcached to generate shared sequences of values.
+
+`memcached_increment` takes a ``key`` and ``key_length`` and increments the
+value by the ``offset`` passed to it. The value is then returned via the
+uint32_t ``value`` pointer you pass to it.
+
+`memcached_decrement` takes a ``key`` and ``key_length`` and decrements the
+value by the ``offset`` passed to it. The value is then returned via the
+uint32_t ``value`` pointer you pass to it.
+
+`memcached_increment_with_initial` takes a ``key`` and ``key_length`` and
+increments the value by the ``offset`` passed to it. If the object specified by
+``key`` does not exist, one of two things may happen: If the ``expiration``
+value is :c:macro:`MEMCACHED_EXPIRATION_NOT_ADD`, the operation will fail. For
+all other ``expiration`` values, the operation will succeed by seeding the value
+for that key with a initial value to expire with the provided expiration time.
+The ``flags`` will be set to zero. The value is then returned via the uint32_t
+``value`` pointer you pass to it. ``memcached_increment_with_initial`` is only
+available when using the binary protocol.
+
+`memcached_decrement_with_initial` takes a ``key`` and ``key_length`` and
+decrements the value by the ``offset`` passed to it. If the object specified by
+``key`` does not exist, one of two things may happen: If the ``expiration``
+value is :c:macro:`MEMCACHED_EXPIRATION_NOT_ADD`, the operation will fail. For
+all other ``expiration`` values, the operation will succeed by seeding the value
+for that key with a initial value to expire with the provided expiration time.
+The ``flags`` will be set to zero. The value is then returned via the uint32_t
+``value`` pointer you pass to it. `memcached_decrement_with_initial` is only
+available when using the binary protocol.
+
+`memcached_increment_by_key`, `memcached_decrement_by_key`,
+`memcached_increment_with_initial_by_key`, and
+`memcached_decrement_with_initial_by_key` are master key equivalents of the
+above.
+
+RETURN VALUE
+------------
+
+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.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_strerror(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_strerror`
--- /dev/null
+Behaviors of the library
+========================
+
+Manipulate the behavior of a memcached_st structure.
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
+
+.. function:: uint64_t memcached_behavior_get (memcached_st *ptr, memcached_behavior_t flag)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :param flag: `memcached_behavior_t` to query
+ :returns: the vaue set for `flag`
+
+.. function:: memcached_return_t memcached_behavior_set (memcached_st *ptr, memcached_behavior_t flag, uint64_t data)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :param flag: `memcached_behavior_t` to set
+ :param data: the value to set for `flag`
+ :returns: `memcached_return_t` indicating success
+
+ .. versionchanged:: 0.17
+ The `data` argument of `memcached_behavior_set` was changed
+ from taking a pointer to data value, to taking a uin64_t.
+
+.. c:type:: enum memcached_behavior_t memcached_behavior_t
+
+.. enum:: memcached_behavior_t
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_USE_UDP
+
+ Causes `libmemcached` to use the UDP transport when communicating with a
+ memcached server. Not all I/O operations are tested when this behavior
+ is enabled.
+
+ The following operations will return `MEMCACHED_NOT_SUPPORTED` when
+ executed with `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_fetch_execute`.
+
+ All other operations are tested 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.
+
+ `libmemcached` does not allow TCP and UDP servers to be shared within
+ the same `libmemcached` 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.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_NO_BLOCK
+
+ Causes `libmemcached` to use asynchronous IO. This is the fastest
+ transport available for storage functions.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_SND_TIMEOUT
+
+ This sets the microsecond behavior of the socket against the SO_SNDTIMEO
+ flag.
+
+ In cases where you cannot use non-blocking IO this will allow you to
+ still have timeouts on the sending of data.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_RCV_TIMEOUT
+
+ This sets the microsecond behavior of the socket against the SO_RCVTIMEO
+ flag.
+
+ In cases where you cannot use non-blocking IO this will allow you to
+ still have timeouts on the reading of data.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_TCP_NODELAY
+
+ Disables Nagle's algorithm.
+ See `RFC 896 <https://tools.ietf.org/html/rfc896>`_.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_HASH
+
+ Set the `hash algorithm <memcached_hash_t>` used for keys.
+
+ Each hash has its advantages and its weaknesses. If you don't know or
+ don't care, just go with the default.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_DISTRIBUTION
+
+ Setting a `memcached_server_distribution_t` you can enable different
+ means of distributing values to servers.
+
+ The default method is `MEMCACHED_DISTRIBUTION_MODULA` (hash of the
+ key modulo number of servers).
+
+ You can enable consistent hashing by setting
+ `MEMCACHED_DISTRIBUTION_CONSISTENT`. Consistent hashing delivers better
+ distribution and allows servers to be added to the cluster with minimal
+ cache losses.
+
+ Currently `MEMCACHED_DISTRIBUTION_CONSISTENT` is an alias for the value
+ `MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA`.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_CACHE_LOOKUPS
+
+ .. deprecated:: 0.46(?)
+ DNS lookups are now always cached until an error occurs with the
+ server.
+
+ Memcached can cache named lookups so that DNS lookups are made only once.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_SUPPORT_CAS
+
+ Support CAS operations (this is not enabled by default at this point in
+ the server since it imposes a slight performance penalty).
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_KETAMA
+
+ Sets the default distribution to
+ `MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA` and the hash to
+ `MEMCACHED_HASH_MD5`.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED
+
+ Sets the default distribution to
+ `MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA` with the weighted tests.
+ Makes the default hashing algorithm for keys use `MEMCACHED_HASH_MD5`.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_KETAMA_HASH
+
+ Sets the `hashing algorithm <memcached_hash_t>` for host mapping on continuum.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_KETAMA_COMPAT
+
+ Sets the compatibility mode. The value can be set to either
+ `MEMCACHED_KETAMA_COMPAT_LIBMEMCACHED` (this is the default) or
+ `MEMCACHED_KETAMA_COMPAT_SPY` to be compatible with the SPY Memcached
+ client for Java.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_POLL_TIMEOUT
+
+ Modify the timeout in milliseconds value that is used by poll. The
+ default value is -1. An signed int must be passed to
+ `memcached_behavior_set` to change this value (this requires casting).
+ For `memcached_behavior_get` a 'signed int' value will be cast and
+ returned as 'unsigned long long'.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_USER_DATA
+
+ .. deprecated:: < 0.30
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_BUFFER_REQUESTS
+
+ Enabling buffered IO causes commands to "buffer" instead of being sent.
+ Any action that gets data causes this buffer to be be sent to the remote
+ connection. Quiting the connection or closing down the connection will
+ also cause the buffered data to be pushed to the remote connection.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_VERIFY_KEY
+
+ Enabling this will cause `libmemcached` to test all keys to verify that
+ they are valid keys.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_SORT_HOSTS
+
+ Enabling this will cause hosts that are added to be placed in the host
+ list in sorted order. This will defeat consistent hashing.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT
+
+ In non-blocking mode this changes the value of the timeout during socket
+ connection in milliseconds. Specifying -1 means an infinite time‐out.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_BINARY_PROTOCOL
+
+ Enable the use of the binary protocol. Please note that you cannot
+ toggle this flag on an open connection.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK
+
+ Set this value to tune the number of messages that may be sent before
+ `libmemcached` should start to automatically drain the input queue.
+
+ Setting this value to high, may cause `libmemcached` to deadlock (trying
+ to send data, but the send will block because the input buffer in the
+ kernel is full).
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK
+
+ Set this value to tune the number of bytes that may be sent before
+ `libmemcached` should start to automatically drain the input queue (need
+ at least 10 IO requests sent without reading the input buffer).
+
+ Setting this value to high, may cause libmemcached to deadlock (trying
+ to send data, but the send will block because the input buffer in the
+ kernel is full).
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH
+
+ The binary protocol works a bit different than the textual protocol in
+ that a multiget is implemented as a pipe of single get-operations which
+ are sent to the server in a chunk.
+
+ If you are using large multigets from your application, you may improve
+ the latency of the gets by setting this value so you send out the first
+ chunk of requests when you hit the specified limit. It allows the
+ servers to start processing the requests to send the data back while the
+ rest of the requests are created and sent to the server.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_NOREPLY
+
+ Set this value to specify that you really don't care about the result
+ from your storage commands (set, add, replace, append, prepend).
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS
+
+ Specify the numbers of replicas `libmemcached` should store of each item
+ (on different servers).
+
+ This replication does not dedicate certain memcached servers to store
+ the replicas in, but instead it will store the replicas together with
+ all of the other objects (on the 'n' next servers specified in your
+ server list).
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ
+
+ Allows randomizing the replica reads starting point. Normally the read
+ is done from primary server and in case of miss the read is done from
+ primary + 1, then primary + 2 all the way to 'n' replicas.
+
+ If this option is set on the starting point of the replica reads is
+ randomized between the servers. This allows distributing read load to
+ multiple servers with the expense of more write traffic.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_CORK
+
+ .. deprecated:: ?
+ This option has been deprecated with the behavior now built in and
+ used appropriately on selected platforms.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_KEEPALIVE
+
+ Enable TCP_KEEPALIVE behavior.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_KEEPALIVE_IDLE
+
+ Specify time, in seconds, to mark a connection as idle. This is only
+ available as an option on Linux.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE
+
+ Find the current size of SO_SNDBUF. A value of 0 means either an error
+ occurred or no hosts were available. It is safe to assume system default
+ if this occurs.
+
+ If an error occurs you can check the last cached errno to find the
+ specific error.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE
+
+ Find the current size of SO_RCVBUF. A value of 0 means either an error
+ occurred or no hosts were available. It is safe to assume system default
+ if this occurs.
+
+ If an error occurs you can check the last cached errno to find the
+ specific error.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT
+
+ .. deprecated:: 0.48
+ See `MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS`
+
+ Set this value to enable the server be removed after continuous
+ `MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT` times connection failure.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTS
+
+ .. deprecated:: 0.48
+ See `MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS`
+
+ If enabled any hosts which have been flagged as disabled will be removed
+ from the list of servers in the `memcached_st` structure. This must be
+ used in combination with `MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT`.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS
+
+ If enabled any hosts which have been flagged as disabled will be removed
+ from the list of servers in the `memcached_st` structure.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_RETRY_TIMEOUT
+
+ When enabled a host which is problematic will only be checked for usage
+ based on the amount of time set by this behavior. The value is in
+ seconds.
+
+ .. enumerator:: MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY
+
+ When enabled the prefix key will be added to the key when determining
+ server by hash. See `MEMCACHED_CALLBACK_NAMESPACE` for additional
+ information.
+
+.. c:type:: enum memcached_server_distribution_t memcached_server_distribution_t
+
+.. enum:: memcached_server_distribution_t
+
+ .. enumerator:: MEMCACHED_DISTRIBUTION_MODULA
+
+ Distribute keys by hash modulo number of servers.
+
+ .. enumerator:: MEMCACHED_DISTRIBUTION_CONSISTENT
+
+ Alias for `MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA`.
+
+ .. enumerator:: MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA
+
+ Unweighted consistent key distribution.
+
+ .. enumerator:: MEMCACHED_DISTRIBUTION_RANDOM
+
+ Distribute keys by :manpage:`rand(3)` modulo number of servers.
+
+ .. enumerator:: MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA_SPY
+
+ Unweighted consistent key distribution compatible with the SPY client.
+
+ .. enumerator:: MEMCACHED_DISTRIBUTION_CONSISTENT_WEIGHTED
+
+ Weighted consistent key distribution.
+
+ .. enumerator:: MEMCACHED_DISTRIBUTION_VIRTUAL_BUCKET
+
+ Consistent key distribution by virtual buckets.
+
+
+DESCRIPTION
+-----------
+
+`libmemcached` behavior can be modified by using `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`).
+
+`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`` 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.
+
+RETURN VALUE
+------------
+
+`memcached_behavior_get` returns either the current value of the key, or 0
+or 1 on simple flag behaviors (1 being enabled). `memcached_behavior_set`
+returns failure or success.
+
+NOTES
+-----
+
+The `data` argument of `memcached_behavior_set` was changed in version
+0.17 from taking a pointer to data value, to taking a uin64_t.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`setsockopt(3)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_strerror(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :manpage:`setsockopt(3)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_strerror`
--- /dev/null
+Library callbacks
+=================
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
+
+.. function:: memcached_return_t memcached_callback_set(memcached_st *ptr, memcached_callback_t flag, const void *data)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :param flag: `memcached_callback_t` flag to set
+ :param data: data corresponding to `flag`
+ :returns: `memcached_return_t` indicating success
+
+.. function:: void *memcached_callback_get(memcached_st *ptr, memcached_callback_t flag, memcached_return_t *error)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :param flag: `memcached_callback_t` flag to query
+ :param error: pointer to `memcached_return_t` indicating success
+ :returns: the `data` previously set
+
+.. c:type:: enum memcached_callback_t memcached_callback_t
+
+.. enum:: memcached_callback_t
+
+ .. enumerator:: MEMCACHED_CALLBACK_CLEANUP_FUNCTION
+
+ When `memcached_free` or `memcached_reset` is called this function
+ will be executed. At the point of its execution all connections are closed.
+
+ Its signature is:
+
+ .. type:: memcached_return_t (*memcached_cleanup_fn)(const memcached_st *ptr)
+
+
+ .. enumerator:: MEMCACHED_CALLBACK_CLONE_FUNCTION
+
+ When `memcached_clone` is called this function will be executed.
+
+ Its signature is:
+
+ .. type:: memcached_return_t (*memcached_clone_fn)(memcached_st *destination, const memcached_st *source)
+
+ .. enumerator:: MEMCACHED_CALLBACK_PREFIX_KEY
+
+ See `MEMCACHED_CALLBACK_NAMESPACE`.
+
+ .. enumerator:: MEMCACHED_CALLBACK_NAMESPACE
+
+ 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 :c:macro:`MEMCACHED_MAX_NAMESPACE` - 1 and
+ will reduce :c:macro:`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.
+
+ If you set a value with the value being NULL then the prefix key is
+ disabled.
+
+ .. enumerator:: MEMCACHED_CALLBACK_USER_DATA
+
+ This allows you to store a pointer to a specific piece of data. This can
+ be retrieved from inside of `memcached_fetch_execute`. Cloning a
+ `memcached_st` will copy the pointer to the clone.
+
+ .. enumerator:: MEMCACHED_CALLBACK_MALLOC_FUNCTION
+
+ .. deprecated:: <0.32
+ Use `memcached_set_memory_allocators` instead.
+
+ .. enumerator:: MEMCACHED_CALLBACK_REALLOC_FUNCTION
+
+ .. deprecated:: <0.32
+ Use `memcached_set_memory_allocators` instead.
+
+ .. enumerator:: MEMCACHED_CALLBACK_FREE_FUNCTION
+
+ .. deprecated:: <0.32
+ Use `memcached_set_memory_allocators` instead.
+
+ .. enumerator:: MEMCACHED_CALLBACK_GET_FAILURE
+
+ This function implements the read through cache behavior. On failure of
+ retrieval this callback will be called.
+
+ You are responsible for populating the result object provided. This
+ result object will then be stored in the server and returned to the
+ calling process.
+
+ You must clone the `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 immediately (if this is the default
+ behavior based on your connection setup this will happen automatically).
+
+ The prototype for this is:
+
+ .. type:: memcached_return_t (*memcached_trigger_key)(memcached_st *ptr, char *key, size_t key_length, memcached_result_st *result)
+
+ .. enumerator:: MEMCACHED_CALLBACK_DELETE_TRIGGER
+
+ This function implements a trigger upon successful deletion of a key.
+ The `memcached_st` structure will need to be cloned in order to make use
+ of it.
+
+ The prototype for this is:
+
+ .. type:: memcached_return_t (*memcached_trigger_delete_key)(memcached_st *ptr, char *key, size_t key_length)
+
+DESCRIPTION
+-----------
+
+`libmemcached` 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`.
+
+`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.
+
+RETURN VALUE
+------------
+
+`memcached_callback_get` returns 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`.
+
+`memcached_callback_set` returns `MEMCACHED_SUCCESS` upon successful setting,
+otherwise `MEMCACHED_FAILURE` on error.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_strerror(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_strerror`
--- /dev/null
+Working with data on the server in an atomic fashion
+====================================================
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
+
+.. function:: memcached_return_t memcached_cas(memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags, uint64_t cas)
+
+.. function:: memcached_return_t memcached_cas_by_key(memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags, uint64_t cas)
+
+ :param ptr: pointer to an initialized `memcached_st` struct
+ :param group_key: key namespace
+ :param group_key_length: length of the `group_key` without any trailing zero
+ :param key: the key to check
+ :param key_length: the length of the `key` without any trailing zero
+ :param value: the value to set
+ :param value_length: the length of the `value` without any trailing zero
+ :param expiration: expiration time as unix timestamp or relative time in seconds
+ :param flags: 16 bit flags
+ :param cas: the ``cas`` value to compare
+ :returns: `memcached_return_t` indicating success
+
+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` structure.
+
+`memcached_cas_by_key` method behaves in a similar way as the non key methods.
+The difference is that it uses the ``group_key`` parameter to map objects to
+particular servers.
+
+`memcached_cas` is tested 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.
+
+RETURN VALUE
+------------
+
+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.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(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)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_set`
+ * :doc:`memcached_append`
+ * :doc:`memcached_strerror`
--- /dev/null
+Creating and destroying a memcached_st
+======================================
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
+
+.. type:: struct memcached_st memcached_st
+
+.. function:: memcached_st* memcached_create(memcached_st *ptr)
+
+ :param ptr: pointer to user-allocated `memcached_st` struct or null pointer
+ :returns: pointer to initialized `memcached_st` struct
+
+.. function:: void memcached_free(memcached_st *ptr)
+
+ :param ptr: pointer to initialized `memcached_st` struct to destroy and possibly free
+
+.. function:: memcached_st* memcached_clone(memcached_st *destination, memcached_st *source)
+
+ :param destination: pointer to user-allocated `memcached_st` struct or null pointer
+ :param source: pointer to initialized `memcached_st` struct to copy from
+ :returns: pointer to newly initialized `destination`, copied from `source`
+
+.. function:: void memcached_servers_reset(memcached_st *ptr)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+
+DESCRIPTION
+-----------
+
+`memcached_create` is used to create a `memcached_st` structure that will then
+be used by other `libmemcached` functions to communicate with the server. You
+should either pass a statically declared `memcached_st` to `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` over
+`memcached_create`.
+
+`memcached_clone` is similar to `memcached_create` but it copies the defaults
+and list of servers from the source `memcached_st` pointer. 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.
+
+`memcached_servers_reset` allows you to zero out the list of servers that the
+`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.
+
+You may wish to avoid using `memcached_create` or `memcached_clone` with a stack
+based allocation. The most common issues related to ABI safety involve heap
+allocated structures.
+
+RETURN VALUE
+------------
+
+`memcached_create` returns a pointer to the `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.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
--- /dev/null
+Deleting data from a server
+===========================
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
+
+.. function:: memcached_return_t memcached_delete(memcached_st *ptr, const char *key, size_t key_length, time_t expiration)
+
+.. function:: memcached_return_t memcached_delete_by_key(memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, time_t expiration)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :param group_key: key namespace
+ :param group_key_length: length of the `group_key` without any terminating zero
+ :param key: the key to delete
+ :param key_length: the length og the `key` without any terminating zero
+ :param expiration: obsolete since :manpage:`memcached(1)` version 1.4
+ :returns: `memcached_return_t` indicating success
+
+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.
+
+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 "replace"
+commands with this key will also fail (the "set" command will succeed, however).
+After the time passes, the item is finally deleted from server memory.
+
+Please note the the memcached server removed tests for expiration in the 1.4
+version.
+
+RETURN VALUE
+------------
+
+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.
+
+If you are using the non-blocking mode of the library, success only means that
+the message was queued for delivery.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_strerror(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_strerror`
--- /dev/null
+Dumping data from a server
+==========================
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
+
+.. type:: memcached_return_t (*memcached_dump_fn)(memcached_st *ptr, const char *key, size_t key_length, void *context)
+
+ :param ptr: pointer to `memcached_st` object
+ :param key: key string being dumped
+ :param key_length: length of the key without any terminating zero
+ :param context: pointer to the user supplied context
+ :returns: `memcached_return_t` indicating success
+
+.. function:: memcached_return_t memcached_dump (memcached_st *ptr, memcached_dump_fn *function, void *context, uint32_t number_of_callbacks)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :param function: pointer to `number_of_callbacks` `memcached_dump_fn` callbacks
+ :param context: pointer to a user managed context
+ :param number_of_callbacks: number of callbacks in the `function` array
+ :returns: `memcached_return_t` indicating success
+
+
+DESCRIPTION
+-----------
+
+:func:`memcached_dump` is used to get a list of keys found in :manpage:`memcached(1)`
+servers. Because memcached does not guarantee 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 tested.
+
+RETURN VALUE
+------------
+
+A value of type :type:`memcached_return_t` is returned.
+On success that value will be `MEMCACHED_SUCCESS`.
+Use :func:`memcached_strerror` to translate this value to a printable
+string.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_strerror(3)`
+
+.. only:: html
+
+ * :doc:`../libmemcached`
+ * :doc:`memcached_strerror`
-===========================
-Determine if a keys exists.
-===========================
+Determine if a keys exists
+==========================
-.. index:: object: memcached_st
-
---------
SYNOPSIS
--------
-
#include <libmemcached/memcached.h>
-
-.. c:function:: memcached_return_t memcached_exist(memcached_st *ptr, char *key, size_t *key_length)
+ Compile and link with -lmemcached
-.. c:function:: memcached_return_t memcached_exist_by_key(memcached_st *ptr, char *group_key, size_t *group_key_length, char *key, size_t *key_length)
+.. function:: memcached_return_t memcached_exist(memcached_st *ptr, char *key, size_t *key_length)
- .. versionadded:: 0.53
+.. function:: memcached_return_t memcached_exist_by_key(memcached_st *ptr, char *group_key, size_t *group_key_length, char *key, size_t *key_length)
-Compile and link with -lmemcached
+ :param ptr: pointer to an initialized `memcached_st` struct
+ :param group_key: the key namespace
+ :param group_key_length: length of the `group_key` without any terminating zero
+ :param key: the key to check
+ :param key_length: length of the `key` without any terminating zero
+ :returns: `memcached_return_t` indicating success
+.. versionadded:: 0.53
------------
DESCRIPTION
-----------
-:c:func:`memcached_exist()` can be used to check to see if a key exists. No value is returned if the key exists, or does not exist, on the server.
-
+:func:`memcached_exist()` can be used to check if a key exists.
-------
-RETURN
-------
+RETURN VALUE
+------------
-:c:func:`memcached_exist()` sets error to
-to :c:type:`MEMCACHED_SUCCESS` upon finding that the key exists.
-:c:type:`MEMCACHED_NOTFOUND` will be return if the key is not found.
+`MEMCACHED_SUCCESS`
+ The key exists.
+`MEMCACHED_NOTFOUND`
+ The key was not found.
-----
-HOME
-----
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
---------
SEE ALSO
--------
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_strerror(3)`
+.. only:: html
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_strerror`
-=================
memcached_fetch
=================
-.. index:: object: memcached_st
-
---------
SYNOPSIS
--------
-
#include <libmemcached/memcached.h>
-
-.. c:function:: char *memcached_fetch(memcached_st *ptr, char *key, size_t *key_length, size_t *value_length, uint32_t *flags, memcached_return_t *error)
+ Compile and link with -lmemcached
- .. deprecated:: 0.50
- Use :c:func:`memcached_fetch_result` instead.
+.. function:: char *memcached_fetch(memcached_st *ptr, char *key, size_t *key_length, size_t *value_length, uint32_t *flags, memcached_return_t *error)
-Compile and link with -lmemcached
+ .. deprecated:: 0.50
+ Use :func:`memcached_fetch_result` instead.
------------
DESCRIPTION
-----------
-: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 :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:`MEMCACHED_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.
+:func:`memcached_fetch` is used to fetch an individual value from the server.
+:func:`memcached_mget` must always be called before using this method.
+You must pass in a key and its length to fetch the object.
-Values returned by :c:func:`memcached_fetch` must be freed by the caller.
+You must supply three pointer variables which will give you the state of the returned
+object:
-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`.
+ * A :type:`uint32_t` pointer to contain whatever flags you stored with the value,
+ * a :type:`size_t` pointer which will be filled with size of of the object, and
+ * a :type:`memcached_return_t` pointer to hold any error.
+The object will be returned upon success and NULL will be returned on failure.
-------
-RETURN
-------
+`MEMCACHED_END` is returned by the error value when all objects that have been found are returned.
+The final value upon `MEMCACHED_END` is a NULL pointer.
-:c:func:`memcached_fetch` sets error to
-to :c:type:`MEMCACHED_END` upon successful conclusion.
-:c:type:`MEMCACHED_NOTFOUND` will be return if no keys at all were found.
+Values returned by :func:`memcached_fetch` must be freed by the caller.
-: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.
+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
+:type:`memcached_return_t`, the error function parameter will
+be set to `MEMCACHED_NOT_SUPPORTED`.
+RETURN VALUE
+------------
-----
-HOME
-----
+:func:`memcached_fetch` sets error to
+to `MEMCACHED_END` upon successful conclusion.
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
+`MEMCACHED_NOTFOUND` will be return if no keys at all were found.
+`MEMCACHED_KEY_TOO_BIG` is set to error whenever :func:`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.
---------
SEE ALSO
--------
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)` :manpage:`memcached_fetch_result(3)`
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_strerror(3)`
+ :manpage:`memcached_fetch_result(3)`
+
+.. only:: html
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_strerror`
+ * :doc:`memcached_get`
--- /dev/null
+Wiping clean the contents of a server
+=====================================
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
+
+.. function:: memcached_return_t memcached_flush (memcached_st *ptr, time_t expiration)
+
+ :param ptr: pointer to an initialized `memcached_st` struct
+ :param expiration: expiration as a unix timestamp or as relative expiration time in seconds
+ :returns: `memcached_return_t` indicating success
+
+DESCRIPTION
+-----------
+
+`memcached_flush` is used to wipe clean the contents of :manpage:`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
+added.
+
+RETURN VALUE
+------------
+
+A value of type :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.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_strerror(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_strerror`
--- /dev/null
+Flush and send buffered commands
+================================
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
+
+.. function:: memcached_return_t memcached_flush_buffers (memcached_st *ptr)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :returns: `memcached_return_t` indicating success
+
+DESCRIPTION
+-----------
+
+:func:`memcached_flush_buffers` is used in conjunction with
+`MEMCACHED_BEHAVIOR_BUFFER_REQUESTS` to flush all buffers by
+sending the buffered commands to the server for processing.
+
+RETURN VALUE
+------------
+
+A value of type :type:`memcached_return_t` is returned.
+On success that value will be `MEMCACHED_SUCCESS`.
+Use :func:`memcached_strerror` to translate this value to a printable string.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_strerror(3)`
+ :manpage:`memcached_behavior(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_strerror`
+ * :doc:`memcached_behavior`
--- /dev/null
+Generating hash values directly
+===============================
+
+Hash a key value
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcachedutil -lmemcached
+
+.. function:: uint32_t memcached_generate_hash_value (const char *key, size_t key_length, memcached_hash_t hash_algorithm)
+
+ :param key: the key to generate a hash of
+ :param key_length: the length of the `key` without any terminating zero
+ :param hash_algorithm: `memcached_hash_t`, the algorithm to use
+ :returns: a 32 bit hash value
+
+.. function:: uint32_t memcached_generate_hash (memcached_st *ptr, const char *key, size_t key_length)
+
+ :param ptr: pointer to an initialized `memcached_st` struct
+ :param key: the key to generate a hash of
+ :param key_length: the length of the `key` without any terminating zero
+ :returns: a 32 bit hash value
+
+.. c:type:: enum memcached_hash_t memcached_hash_t
+
+.. enum:: memcached_hash_t
+
+ .. enumerator:: MEMCACHED_HASH_DEFAULT
+
+ .. enumerator:: MEMCACHED_HASH_MD5
+
+ .. enumerator:: MEMCACHED_HASH_CRC
+
+ .. enumerator:: MEMCACHED_HASH_FNV1_64
+
+ .. enumerator:: MEMCACHED_HASH_FNV1A_64
+
+ .. enumerator:: MEMCACHED_HASH_FNV1_32
+
+ .. enumerator:: MEMCACHED_HASH_FNV1A_32
+
+ .. enumerator:: MEMCACHED_HASH_HSIEH
+
+ .. enumerator:: MEMCACHED_HASH_MURMUR
+
+ .. enumerator:: MEMCACHED_HASH_JENKINS
+
+ .. enumerator:: MEMCACHED_HASH_MURMUR3
+
+ .. enumerator:: MEMCACHED_HASH_CUSTOM
+
+
+
+DESCRIPTION
+-----------
+
+: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.
+
+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 Hsieh hash enabled.
+
+:func:`memcached_generate_hash` takes a :type:`memcached_st` structure
+and produces the hash value that would have been generated based on the
+defaults of :type:`memcached_st`.
+
+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.
+
+RETURN VALUE
+------------
+
+A 32-bit integer which is the result of hashing the given key.
+For 64-bit hash algorithms, only the least-significant 32 bits are
+returned.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
--- /dev/null
+Retrieving data from the server
+===============================
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
+
+.. function:: memcached_result_st * memcached_fetch_result (memcached_st *ptr, memcached_result_st *result, memcached_return_t *error)
+
+.. function:: char * memcached_get (memcached_st *ptr, const char *key, size_t key_length, size_t *value_length, uint32_t *flags, memcached_return_t *error)
+
+.. function:: memcached_return_t memcached_mget (memcached_st *ptr, const char * const *keys, const size_t *key_length, size_t number_of_keys)
+
+.. function:: char * memcached_get_by_key (memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, size_t *value_length, uint32_t *flags, memcached_return_t *error)
+
+.. function:: memcached_return_t memcached_mget_by_key (memcached_st *ptr, const char *group_key, size_t group_key_length, const char * const *keys, const size_t *key_length, size_t number_of_keys)
+
+.. function:: memcached_return_t memcached_fetch_execute (memcached_st *ptr, memcached_execute_fn *callback, void *context, uint32_t number_of_callbacks)
+
+.. function:: memcached_return_t memcached_mget_execute (memcached_st *ptr, const char * const *keys, const size_t *key_length, size_t number_of_keys, memcached_execute_fn *callback, void *context, uint32_t number_of_callbacks)
+
+.. function:: memcached_return_t memcached_mget_execute_by_key (memcached_st *ptr, const char *group_key, size_t group_key_length, const char * const *keys, const size_t *key_length, size_t number_of_keys, memcached_execute_fn *callback, void *context, uint32_t number_of_callbacks)
+
+.. type:: memcached_return_t (*memcached_execute_fn)(const memcached_st *ptr, memcached_result_st *result, void *context)
+
+
+DESCRIPTION
+-----------
+
+: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 :type:`uint32_t` pointer to contain whatever flags you stored
+with the value, a :type:`size_t` pointer which will be filled with size of of
+the object, and a :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 :func:`memcached_get` must be released by the caller
+application.
+
+: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.
+
+To retrieve data after a successful execution of :func:`memcached_mget`, you
+will need to call :func:`memcached_fetch_result`. You should continue to call
+this function until it returns a NULL (i.e. no more values). If you need to quit
+in the middle of a :func:`memcached_mget` call, you can execute a
+:func:`memcached_quit`, those this is not required.
+
+:func:`memcached_fetch_result` is used to fetch an individual value from the
+server. :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 :type:`uint32_t` pointer to contain whatever flags you stored with the value,
+a :type:`size_t` pointer which will be filled with size of of the object, and a
+:type:`memcached_return_t` pointer to hold any error. The object will be
+returned upon success and NULL will be returned on failure. `MEMCACHED_END` is
+returned by the \*error value when all objects that have been found have been
+returned. The final value upon `MEMCACHED_END` is null.
+
+:func:`memcached_fetch_result` is used to return a :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
+:type:`memcached_result_st` help. This function will dynamically allocate a
+result structure for you if you do not pass one to the function.
+
+: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 :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.
+
+:func:`memcached_mget_execute` and :func:`memcached_mget_execute_by_key`
+is similar to :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 :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). :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.
+
+:func:`memcached_get_by_key` and :func:`memcached_mget_by_key` behave
+in a similar nature as :func:`memcached_get` and :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
+`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
+:type:`memcached_return_t`, the error function parameter will be set to
+`MEMCACHED_NOT_SUPPORTED`.
+
+RETURN VALUE
+------------
+
+All objects retrieved via :func:`memcached_get` or :func:`memcached_get_by_key`
+must be freed with :manpage:`free(3)`.
+
+:func:`memcached_get` will return NULL on error.
+You must look at the value of error to determine what the actual error was.
+
+:func:`memcached_fetch_execute` return `MEMCACHED_SUCCESS` if
+all keys were successful. `MEMCACHED_NOTFOUND` will be returned if no
+keys at all were found.
+
+:func:`memcached_fetch_result` sets error
+to `MEMCACHED_END` upon successful conclusion.
+`MEMCACHED_NOTFOUND` will be returned if no keys at all were found.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_strerror(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_strerror`
--- /dev/null
+Retrieving Error Codes and Messages
+===================================
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
+
+.. function:: memcached_return_t memcached_last_error(const memcached_st *ptr)
+
+ :param ptr: pointer to an initialized `memcached_st` struct
+ :returns: `memcached_return_t` indicating success of last operation
+
+.. function:: const char *memcached_last_error_message(const memcached_st *ptr)
+
+ :param ptr: pointer to an initialized `memcached_st` struct
+ :returns: message describing the status of last operation
+
+.. function:: int memcached_last_error_errno(const memcached_st *ptr)
+
+ :param ptr: pointer to an initialized `memcached_st` struct
+ :returns: :manpage:`errno(3)` (if any) of last operation
+
+DESCRIPTION
+-----------
+
+Retrieve error codes and messages.
+
+RETURN VALUE
+------------
+
+`memcached_last_error` returns the last error code.
+
+`memcached_last_error_message` returns the last error message. If this error
+came from a specific server, its hostname and port will be provided in the error
+message. Any error message will be returned as 'const char \*' which does not
+need to be de-allocated. NULL will be returned if no error has occurred.
+
+`memcached_last_error_errno` returns any last local error code obtained from
+:manpage:`errno(3)`.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`errno(3)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_strerror(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :manpage:`errno(3)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_strerror`
+++ /dev/null
-=================
-Retrieving errors
-=================
-
-
---------
-SYNOPSIS
---------
-
-
-#include <libmemcached/memcached.h>
-
-.. c:function:: const char *memcached_last_error_message(memcached_st *)
-
-Compile and link with -lmemcached
-
-
------------
-DESCRIPTION
------------
-
-:c:func:`memcached_last_error_message` is used to return the last error
-message that the server responded too. If this error came from a specific
-server, its hostname and port will be provided in the error message.
-
-------
-RETURN
-------
-
-memcached_last_error_message returns a const char* which does not need to be
-de-allocated. If no error has occurred then it will return NULL.
-
-----
-HOME
-----
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
---------
-SEE ALSO
---------
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
-
-
--- /dev/null
+Use custom allocators for embedded usage
+========================================
+
+Manage memory allocator functions
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
+
+.. function:: memcached_return_t memcached_set_memory_allocators (memcached_st *ptr, memcached_malloc_fn mem_malloc, memcached_free_fn mem_free, memcached_realloc_fn mem_realloc, memcached_calloc_fn mem_calloc, void *context)
+
+ :param ptr: pointer to an initialized `memcached_st` struct
+ :param mem_malloc: pointer to a `memcached_malloc_fn` callback
+ :param mem_free: pointer to a `memcached_free_fn` callback
+ :param mem_realloc: pointer to a `memcached_realloc_fn` callback
+ :param mem_calloc: pointer to a `memcached_calloc_fn` callback
+ :param context: pointer to a user supplied context
+ :returns: `memcached_return_t` indicating success
+
+.. function:: void memcached_get_memory_allocators (memcached_st *ptr, memcached_malloc_fn *mem_malloc, memcached_free_fn *mem_free, memcached_realloc_fn *mem_realloc, memcached_calloc_fn *mem_calloc)
+
+ :param ptr: pointer to an initialized `memcached_st` struct
+ :param mem_malloc: pointer to store the address of the `memcached_malloc_fn` callback
+ :param mem_free: pointer to store the address of the `memcached_free_fn` callback
+ :param mem_realloc: pointer to store the address of the `memcached_realloc_fn` callback
+ :param mem_calloc: pointer to store the address of the `memcached_calloc_fn` callback
+
+.. function:: void * memcached_get_memory_allocators_context(const memcached_st *ptr)
+
+ :param ptr: pointer to an initialized `memcached_st` struct
+ :returns: pointer to the user supplied context
+
+.. type:: void * (*memcached_malloc_fn) (memcached_st *ptr, const size_t size, void *context)
+
+ :param ptr: pointer to an initialized `memcached_st` struct
+ :param size: the number of bytes to allocate
+ :param context: pointer to the user supplied context
+ :returns: pointer to at least `size` bytes of allocated memory
+
+.. type:: void * (*memcached_realloc_fn) (memcached_st *ptr, void *mem, const size_t size, void *context)
+
+ :param ptr: pointer to an initialized `memcached_st` struct
+ :param mem: pointer to previously allocated memory
+ :param size: the number of bytes to allocate
+ :param context: pointer to the user supplied context
+ :returns: pointer to at least `size` bytes of allocated memory
+
+.. type:: void (*memcached_free_fn) (memcached_st *ptr, void *mem, void *context)
+
+ :param ptr: pointer to an initialized `memcached_st` struct
+ :param mem: pointer to previously allocated memory
+ :param context: pointer to the user supplied context
+
+.. type:: void * (*memcached_calloc_fn) (memcached_st *ptr, size_t nelem, const size_t elsize, void *context)
+
+ :param ptr: pointer to an initialized `memcached_st` struct
+ :param nelem: number of elements to allocate
+ :param elsize: the number of bytes to allocate per element
+ :param context: pointer to the user supplied context
+ :returns: pointer to at least `elsize` \* `nelem` bytes of allocated and zeroed memory
+
+DESCRIPTION
+-----------
+
+`libmemcached` 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.
+
+: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.
+
+:func:`memcached_get_memory_allocators` is used to get the currently used memory
+allocators by a memcached handle.
+
+:func:`memcached_get_memory_allocators_context` returns the void \* that was
+passed in during the call to :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 it in order to make
+use of any operation which would modify it.
+
+NOTES
+-----
+
+In version 0.38 all functions were modified to have a context void pointer
+passed to them. This was so that custom allocators could have their own space
+for memory.
+
+RETURN VALUE
+------------
+
+:func:`memcached_set_memory_allocators` returns `MEMCACHED_SUCCESS` upon success,
+and `MEMCACHED_FAILURE` if you don't pass a complete set of function pointers.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_strerror(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_strerror`
--- /dev/null
+Disconnecting a client from a server
+====================================
+
+.. index:: object: memcached_st
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
+
+.. function:: void memcached_quit (memcached_st *ptr)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+
+DESCRIPTION
+-----------
+
+:func:`memcached_quit` will disconnect you from all currently connected
+servers. It will also reset the state of the connection (i.e., any
+:func:`memcached_fetch` you are in the middle of will be terminated). This
+function is called automatically when you call :func:`memcached_free` on the
+: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 :func:`memcached_fetch`.
+
+RETURN VALUE
+------------
+
+A value of type :type:`memcached_return_t` is returned On success that value
+will be `MEMCACHED_SUCCESS`. Use :func:`memcached_strerror` to
+translate this value to a printable string.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_strerror(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_strerror`
--- /dev/null
+Working with result sets
+========================
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcachedutil -lmemcached
+
+.. type:: struct memcached_result_st memcached_result_st
+
+.. function:: memcached_result_st *memcached_result_create (memcached_st *ptr, memcached_result_st *result)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :param result: pointer to an `memcached_result_st` instance to initialize or
+ nullptr to allocate a new instance
+ :returns: pointer to initialized `memcached_result_st` instance
+
+.. function:: void memcached_result_free (memcached_result_st *result)
+
+ :param result: pointer to initialized `memcached_result_st` struct
+
+.. function:: const char * memcached_result_key_value (memcached_result_st *result)
+
+ :param result: pointer to initialized `memcached_result_st` struct
+ :returns: the key value associated with the current result object
+
+.. function:: size_t memcached_result_key_length (const memcached_result_st *result)
+
+ :param result: pointer to initialized `memcached_result_st` struct
+ :returns: the key length associated with the current result object
+
+.. function:: const char *memcached_result_value (memcached_result_st *result)
+
+ :param result: pointer to initialized `memcached_result_st` struct
+ :returns: the result value associated with the current result object
+
+.. function:: char *memcached_result_take_value (memcached_result_st *result)
+
+ :param result: pointer to initialized `memcached_result_st` struct
+ :returns: the result value associated with the current result object
+
+.. function:: size_t memcached_result_length (const memcached_result_st *result)
+
+ :param result: pointer to initialized `memcached_result_st` struct
+ :returns: the result length associated with the current result object
+
+.. function:: uint32_t memcached_result_flags (const memcached_result_st *result)
+
+ :param result: pointer to initialized `memcached_result_st` struct
+ :returns: the flags associated with the current result object
+
+.. function:: uint64_t memcached_result_cas (const memcached_result_st *result)
+
+ :param result: pointer to initialized `memcached_result_st` struct
+ :returns: the cas associated with the current result object
+
+.. function:: memcached_return_t memcached_result_set_value (memcached_result_st *result, const char *value, size_t length)
+
+ :param result: pointer to initialized `memcached_result_st` struct
+ :param value: byte array to set the value of the current result object to
+ :param length: the length of `value` wothout any terminating zero
+ :returns: `memcached_return_t` indicating success
+
+.. function:: void memcached_result_set_flags (memcached_result_st *result, uint32_t flags)
+
+ :param result: pointer to initialized `memcached_result_st` struct
+ :param flags: a new value for the flags field
+
+.. function:: void memcached_result_set_expiration (memcached_result_st *result, time_t expiration)
+
+ :param result: pointer to initialized `memcached_result_st` struct
+ :param expiration: a new value for the expiration field
+
+
+DESCRIPTION
+-----------
+
+`libmemcached` can optionally return a :type:`memcached_result_st` which
+acts as a result object. The result objects have added benefits over the
+character pointer return values, 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 :manpage:`malloc(3)`. It is suggested that you use
+result objects over char \* return functions.
+
+The structure of :type:`memcached_result_st` has been encapsulated, you should
+not write code directly accessing members of the structure.
+
+:func:`memcached_result_create` will either allocate memory for a
+:type:`memcached_result_st` or will initialize a structure passed to it.
+
+:func:`memcached_result_free` will deallocate any memory attached to the
+structure. If the structure was also allocated, it will deallocate it.
+
+:func:`memcached_result_key_value` returns the key value associated with the
+current result object.
+
+:func:`memcached_result_key_length` returns the key length associated with
+the current result object.
+
+:func:`memcached_result_value` returns the result value associated with the
+current result object.
+
+:func:`memcached_result_take_value` returns and hands over the result value
+associated with the current result object. You must call :manpage:`free(3)` to
+release this value, unless you have made use of a custom allocator. Use of a
+custom allocator requires that you create your own custom free() to release it.
+
+:func:`memcached_result_length` returns the result length associated with
+the current result object.
+
+:func:`memcached_result_flags` returns the flags associated with the
+current result object.
+
+:func:`memcached_result_cas` returns the cas associated with the
+current result object. This value will only be available if the server
+tests it.
+
+: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.
+
+:func:`memcached_result_set_flags` takes a result structure and stores a new
+value for the flags field.
+
+:func:`memcached_result_set_expiration` takes a result structure and stores
+a new value for the expiration field (this is only used by read through
+triggers).
+
+
+RETURN VALUE
+------------
+
+Varies, see particular functions. All structures must have
+:func:`memcached_result_free` called on them for cleanup purposes. Failure
+to do this will result in leaked memory.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_strerror(3)`
+ :manpage:`memcached_memory_allocators(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_strerror`
+ * :doc:`memcached_memory_allocators`
-================================
-Error Codes (memcached_return_t)
+Error Codes - memcached_return_t
================================
---------
SYNOPSIS
--------
#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
-.. c:type:: memcached_return_t
+.. function:: bool memcached_success(memcached_return_t rc)
-.. c:function:: const char *memcached_strerror(memcached_st *ptr, memcached_return_t rc)
+.. function:: bool memcached_continue(memcached_return_t rc)
-.. c:function:: bool memcached_success(memcached_return_t)
+.. function:: bool memcached_failed(memcached_return_t rc)
-.. c:function:: bool memcached_continue(memcached_return_t rc)
+.. function:: bool memcached_fatal(memcached_return_t rc)
-.. c:function:: bool memcached_failed(memcached_return_t)
+.. c:type:: enum memcached_return_t memcached_return_t
-.. c:function:: bool memcached_fatal(memcached_return_t)
+.. enum:: memcached_return_t
+ .. enumerator:: MEMCACHED_AUTH_CONTINUE
-Libmemcached return types:
-++++++++++++++++++++++++++
+ Authentication has been paused.
+ .. enumerator:: MEMCACHED_AUTH_FAILURE
-:c:type:`MEMCACHED_SUCCESS`
+ The credentials provided are not valid for this server.
-:c:type:`MEMCACHED_FAILURE`
+ .. enumerator:: MEMCACHED_AUTH_PROBLEM
-:c:type:`MEMCACHED_HOST_LOOKUP_FAILURE`
+ An unknown issue has occurred during authentication.
-:c:type:`MEMCACHED_CONNECTION_FAILURE`
+ .. enumerator:: MEMCACHED_BAD_KEY_PROVIDED
-:c:type:`MEMCACHED_CONNECTION_BIND_FAILURE`
+ The key provided is not a valid key.
-:c:type:`MEMCACHED_WRITE_FAILURE`
+ .. enumerator:: MEMCACHED_BUFFERED
-:c:type:`MEMCACHED_READ_FAILURE`
+ The request has been buffered.
-:c:type:`MEMCACHED_UNKNOWN_READ_FAILURE`
+ .. enumerator:: MEMCACHED_CLIENT_ERROR
-:c:type:`MEMCACHED_PROTOCOL_ERROR`
+ An unknown client error has occurred internally.
-:c:type:`MEMCACHED_CLIENT_ERROR`
+ .. enumerator:: MEMCACHED_CONNECTION_BIND_FAILURE
-:c:type:`MEMCACHED_SERVER_ERROR`
+ .. deprecated:: <0.30
-:c:type:`MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE`
+ We were not able to bind() to the socket.
-:c:type:`MEMCACHED_DATA_EXISTS`
+ .. enumerator:: MEMCACHED_CONNECTION_FAILURE
-:c:type:`MEMCACHED_DATA_DOES_NOT_EXIST`
+ A unknown error has occurred while trying to connect to a server.
-:c:type:`MEMCACHED_NOTSTORED`
+ .. enumerator:: MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE
-:c:type:`MEMCACHED_STORED`
+ .. deprecated:: <0.30
-:c:type:`MEMCACHED_NOTFOUND`
+ An error has occurred while trying to connect to a server.
+ It is likely that either the number of file descriptors need to be increased or you are out of memory.
-:c:type:`MEMCACHED_MEMORY_ALLOCATION_FAILURE`
+ .. enumerator:: MEMCACHED_DATA_DOES_NOT_EXIST
-:c:type:`MEMCACHED_PARTIAL_READ`
+ The data requested with the key given was not found.
-:c:type:`MEMCACHED_SOME_ERRORS`
+ .. enumerator:: MEMCACHED_DATA_EXISTS
-:c:type:`MEMCACHED_NO_SERVERS`
+ The data requested with the key given was not found.
-:c:type:`MEMCACHED_END`
+ .. enumerator:: MEMCACHED_DELETED
-:c:type:`MEMCACHED_DELETED`
+ The object requested by the key has been deleted.
-:c:type:`MEMCACHED_VALUE`
+ .. enumerator:: MEMCACHED_DEPRECATED
-:c:type:`MEMCACHED_STAT`
+ The method that was requested has been deprecated.
-:c:type:`MEMCACHED_ITEM`
+ .. enumerator:: MEMCACHED_E2BIG
-:c:type:`MEMCACHED_ERRNO`
+ Item is too large for the server to store.
-:c:type:`MEMCACHED_FAIL_UNIX_SOCKET`
+ .. enumerator:: MEMCACHED_END
-:c:type:`MEMCACHED_NOT_SUPPORTED`
+ The server has completed returning all of the objects requested.
-:c:type:`MEMCACHED_NO_KEY_PROVIDED`
+ .. enumerator:: MEMCACHED_ERRNO
-:c:type:`MEMCACHED_FETCH_NOTFINISHED`
+ An error has occurred in the driver which has set errno.
-:c:type:`MEMCACHED_TIMEOUT`
+ .. enumerator:: MEMCACHED_FAIL_UNIX_SOCKET
-:c:type:`MEMCACHED_BUFFERED`
+ A connection was not established with the server via a unix domain socket.
-:c:type:`MEMCACHED_BAD_KEY_PROVIDED`
+ .. enumerator:: MEMCACHED_FAILURE
-:c:type:`MEMCACHED_INVALID_HOST_PROTOCOL`
+ .. deprecated:: <0.30
-:c:type:`MEMCACHED_SERVER_MARKED_DEAD`
+ A unknown failure has occurred in the server.
-:c:type:`MEMCACHED_UNKNOWN_STAT_KEY`
+ .. enumerator:: MEMCACHED_FETCH_NOTFINISHED
-:c:type:`MEMCACHED_E2BIG`
+ A request has been made, but the server has not finished the fetch of the last request.
-:c:type:`MEMCACHED_INVALID_ARGUMENTS`
+ .. enumerator:: MEMCACHED_HOST_LOOKUP_FAILURE
-:c:type:`MEMCACHED_KEY_TOO_BIG`
+ A DNS failure has occurred.
-:c:type:`MEMCACHED_AUTH_PROBLEM`
+ .. enumerator:: MEMCACHED_INVALID_ARGUMENTS
-:c:type:`MEMCACHED_AUTH_FAILURE`
+ The arguments supplied to the given function were not valid.
-:c:type:`MEMCACHED_AUTH_CONTINUE`
+ .. enumerator:: MEMCACHED_INVALID_HOST_PROTOCOL
-:c:type:`MEMCACHED_PARSE_ERROR`
+ The server you are connecting too has an invalid protocol.
+ Most likely you are connecting to an older server that does not speak the binary protocol.
-:c:type:`MEMCACHED_PARSE_USER_ERROR`
+ .. enumerator:: MEMCACHED_ITEM
-:c:type:`MEMCACHED_DEPRECATED`
+ An item has been fetched (this is an internal error only).
+
+ .. enumerator:: MEMCACHED_KEY_TOO_BIG
+
+ The key that has been provided is too large for the given server.
+
+ .. enumerator:: MEMCACHED_MAXIMUM_RETURN
+
+ This in an internal only state.
+
+ .. enumerator:: MEMCACHED_MEMORY_ALLOCATION_FAILURE
+
+ An error has occurred while trying to allocate memory.
+
+ .. enumerator:: MEMCACHED_NO_KEY_PROVIDED
+
+ .. deprecated:: <0.30
+ Use `MEMCACHED_BAD_KEY_PROVIDED` instead.
+
+ No key was provided.
+
+ .. enumerator:: MEMCACHED_NO_SERVERS
+
+ No servers have been added to the memcached_st object.
+
+ .. enumerator:: MEMCACHED_NOTFOUND
+
+ The object requested was not found.
+
+ .. enumerator:: MEMCACHED_NOTSTORED
+
+ The request to store an object failed.
+
+ .. enumerator:: MEMCACHED_NOT_SUPPORTED
+
+ The given method is not supported in the server.
+
+ .. enumerator:: MEMCACHED_PARSE_ERROR
+
+ An error has occurred while trying to parse the configuration string.
+ You should use memparse to determine what the error was.
+
+ .. enumerator:: MEMCACHED_PARSE_USER_ERROR
+
+ An error has occurred in parsing the configuration string.
+
+ .. enumerator:: MEMCACHED_PARTIAL_READ
+
+ The read was only partially successful.
+
+ .. enumerator:: MEMCACHED_PROTOCOL_ERROR
+
+ An unknown error has occurred in the protocol.
+
+ .. enumerator:: MEMCACHED_READ_FAILURE
+
+ A read failure has occurred.
+
+ .. enumerator:: MEMCACHED_SERVER_ERROR
+
+ An unknown error has occurred in the server.
+
+ .. enumerator:: MEMCACHED_SERVER_MARKED_DEAD
+
+ The requested server has been marked dead.
+
+ .. enumerator:: MEMCACHED_SOME_ERRORS
+
+ A multi request has been made, and some undetermined number of errors have occurred.
+
+ .. enumerator:: MEMCACHED_STAT
+
+ A "stat" command has been returned in the protocol.
+
+ .. enumerator:: MEMCACHED_STORED
+
+ The requested object has been successfully stored on the server.
+
+ .. enumerator:: MEMCACHED_SUCCESS
+
+ The request was successfully executed.
+
+ .. enumerator:: MEMCACHED_TIMEOUT
+
+ Operation has timed out.
+
+ .. enumerator:: MEMCACHED_UNKNOWN_READ_FAILURE
+
+ An unknown read failure only occurs when either there is a bug in the server,
+ or in rare cases where an ethernet nic is reporting dubious information.
+
+ .. enumerator:: MEMCACHED_UNKNOWN_STAT_KEY
+
+ The server you are communicating with has a stat key which has not be defined in the protocol.
+
+ .. enumerator:: MEMCACHED_VALUE
+
+ A value has been returned from the server (this is an internal condition only).
+
+ .. enumerator:: MEMCACHED_WRITE_FAILURE
+
+ An error has occurred while trying to write to a server.
-:c:type:`MEMCACHED_UNIX_SOCKET_PATH_TOO_BIG`
-
---------
SEE ALSO
--------
-:manpage:`memcached` :manpage:`libmemcached` :manpage:`memcached_client_error` or :manpage:`memcached_worker_error`
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_strerror(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_strerror`
+
--- /dev/null
+SASL support
+============
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
+
+.. function:: void memcached_set_sasl_callbacks(memcached_st *ptr, const sasl_callback_t *callbacks)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :param callbacks: pointer to `sasl_callbacks_t` holding the callbacks to use
+
+.. function:: const sasl_callback_t *memcached_get_sasl_callbacks(memcached_st *ptr)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :returns: pointer to `sasl_callbacks_t` holding the callbacks currently used
+
+.. function:: memcached_return_t memcached_set_sasl_auth_data(memcached_st *ptr, const char *username, const char *password)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :param username:
+ :param password:
+ :returns: `memcached_return_t` indicating success
+
+.. function:: memcached_return_t memcached_destroy_sasl_auth_data(memcached_st *ptr)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :returns: `memcached_return_t` indicating success
+
+DESCRIPTION
+-----------
+
+`libmemcached` allows you to plug in your own callbacks function used by
+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.
+
+: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`.
+
+RETURN VALUE
+------------
+
+:func:`memcached_get_sasl_callbacks` returns the callbacks currently used by
+this memcached handle. :func:`memcached_set_sasl_auth_data` returns
+`MEMCACHED_SUCCESS` upon success.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_strerror(3)`
+ :manpage:`sasl_client_new(3)`
+ :manpage:`sasl_callbacks(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_strerror`
+ * :manpage:`sasl_client_new(3)`
+ * :manpage:`sasl_callbacks(3)`
--- /dev/null
+Managing lists of servers
+=========================
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
+
+.. c:type:: struct memcached_instance_st memcached_instance_st
+
+.. c:type:: struct memcached_server_st memcached_server_st
+
+.. c:type:: struct memcached_server_st *memcached_server_list_st
+
+.. function:: void memcached_server_list_free (memcached_server_list_st list)
+
+ :param list: instance of initialized `memcached_server_list_st` object
+
+.. function:: memcached_server_list_st memcached_server_list_append (memcached_server_list_st list, const char *hostname, in_port_t port, memcached_return_t *error)
+
+ :param list: instance of an existing `memcached_server_list_st` or nullptr to create one
+ :param hostname: the hostname or path to the socket, defaults to localhost if null
+ :param port: the port to use, defaults to 11211 if 0
+ :param error: pointer to store any `memcached_return_t` error indicating success
+ :returns: new instance of `memcached_server_list_st` on success or nullptr on failure
+
+.. function:: uint32_t memcached_server_list_count (memcached_server_list_st list)
+
+ :param list: instance of `memcached_server_list_st`
+ :returns: count of servers in the list
+
+.. function:: const char *memcached_server_error (const memcached_instance_st * instance)
+
+ :param instance: pointer to an initialized `memcached_instance_st` object
+ :returns: last error message sent from the server to the client
+
+.. function:: void memcached_server_error_reset (const memcached_instance_st * list)
+
+ .. deprecated:: 0.39
+
+.. function:: void memcached_servers_parse ()
+
+ .. deprecated:: 0.39
+
+ See `memcached`.
+
+DESCRIPTION
+-----------
+
+`libmemcached` operates on a list of hosts which are stored in
+:type:`memcached_server_st` structures. You should not modify these structures
+directly. Functions are provided to modify these structures.
+
+: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.
+
+:func:`memcached_server_list_free` deallocates all memory associated with the
+array of :type:`memcached_server_st` that you passed to it.
+
+:func:`memcached_server_list_append` adds a server to the end of a
+:type:`memcached_server_st` array. On error null will be returned and the
+: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 :func:`memcached_servers_parse`, please see :func:`memcached`
+
+: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 memcached_server_st \*. In 0.39
+memcached_server_st \* was aliased to :type:`memcached_server_list_st`.
+This was done for a style reason to help clean up some concepts in the code.
+
+RETURN VALUE
+------------
+
+Varies, see particular functions.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_servers(3)`
+ :manpage:`memcached_strerror(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_servers`
+ * :doc:`memcached_strerror`
--- /dev/null
+Managing the servers used by memcached_st
+=========================================
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
+
+.. function:: uint32_t memcached_server_count (memcached_st *ptr)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :returns: number of configured servers
+
+.. function:: memcached_return_t memcached_server_add (memcached_st *ptr, const char *hostname, in_port_t port)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :param hostname: hostname or IP address of the TCP server to add
+ :param port: port of the TCP server
+ :returns: `memcached_return_t` indicating success
+
+.. function:: memcached_return_t memcached_server_add_udp (memcached_st *ptr, const char *hostname, in_port_t port)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :param hostname: hostname or IP address of the UDP server to add
+ :param port: port of the UDP server
+ :returns: `memcached_return_t` indicating success
+
+.. function:: memcached_return_t memcached_server_add_unix_socket (memcached_st *ptr, const char *socket)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :param socket: path to the UNIX socket of the server to add
+ :returns: `memcached_return_t` indicating success
+
+.. function:: memcached_return_t memcached_server_push (memcached_st *ptr, const memcached_server_st *list)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :param list: pre-configured list of servers to push
+ :returns: `memcached_return_t` indicating success
+
+.. function:: const memcached_instance_st * memcached_server_by_key (memcached_st *ptr, const char *key, size_t key_length, memcached_return_t *error)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :param key: key to hash and lookup a server
+ :param key_length: length of `key` without any terminating zero
+ :param error: pointer to `memcached_return_t` indicating success
+ :returns: the server instance to be used for storing/retrieving `key`
+
+.. function:: const memcached_instance_st * memcached_server_get_last_disconnect (const memcached_st *ptr)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :returns: the instance of the last server for which there was a connection problem
+
+.. function:: memcached_return_t memcached_server_cursor(const memcached_st *ptr, const memcached_server_fn *callback, void *context, uint32_t number_of_callbacks)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :param callback: list of `memcached_server_fn` to be called for each server instance
+ :param context: pointer to user supplied context for the callback
+ :param number_of_callbacks: number of callbacks supplied
+ :returns: `memcached_return_t` indicating success
+
+.. type:: memcached_return_t (*memcached_server_fn)(const memcached_st *ptr, const memcached_instance_st * server, void *context)
+
+ :param ptr: pointer to the `memcached_st` struct
+ :param server: pointer to `memcached_instance_st`
+ :param context: pointer to user supplied context
+ :returns: `memcached_return_t` indicating success
+
+DESCRIPTION
+-----------
+
+`libmemcached` performs operations on a list of hosts. The order of
+these hosts determine routing to keys. Functions are provided to add keys to
+`memcached_st` structures. To manipulate lists of servers see
+`memcached_server_st`.
+
+:func:`memcached_server_count` provides you a count of the current number of
+servers being used by a :type:`memcached_st` structure.
+
+:func:`memcached_server_add` pushes a single TCP server into the
+: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 `MEMCACHED_BEHAVIOR_USE_UDP` behavior set will result in
+a `MEMCACHED_INVALID_HOST_PROTOCOL`.
+
+:func:`memcached_server_add_udp` pushes a single UDP server into the
+:type:`memcached_st` structure. This server will be placed at the end. Duplicate
+servers are allowed, so duplication is not checked. Executing this function
+without setting the `MEMCACHED_BEHAVIOR_USE_UDP` behavior will result in a
+`MEMCACHED_INVALID_HOST_PROTOCOL`.
+
+:func:`memcached_server_add_unix_socket` pushes a single UNIX socket into the
+: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 than `MEMCACHED_MAX_HOST_LENGTH`.
+
+:func:`memcached_server_push` pushes an array of :type:`memcached_server_st`
+into the :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.
+
+:func:`memcached_server_by_key` allows you to provide a key and retrieve the
+server which would be used for assignment.
+
+: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.
+
+: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.
+:func:`memcached_server_cursor` is passed the original caller
+:type:`memcached_st` in its current state.
+
+RETURN VALUE
+------------
+
+Varies, see particular functions.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_server_st(3)`
+ :manpage:`memcached_strerror(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_server_st`
+ * :doc:`memcached_strerror`
--- /dev/null
+Storing data on the server
+==========================
+
+.. index:: object: memcached_st
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
+
+.. function:: memcached_return_t memcached_set(memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags)
+
+.. function:: memcached_return_t memcached_add(memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags)
+
+.. function:: memcached_return_t memcached_replace(memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags)
+
+.. function:: memcached_return_t memcached_set_by_key(memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags)
+
+.. function:: memcached_return_t memcached_add_by_key(memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags)
+
+.. function:: memcached_return_t memcached_replace_by_key(memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags)
+
+DESCRIPTION
+-----------
+
+:func:`memcached_set`, :func:`memcached_add`, and :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 :manpage:`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.
+
+: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.
+
+:func:`memcached_replace` replaces an object on the server. If the object is not
+found on the server an error occurs.
+
+: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.
+
+:func:`memcached_set_by_key`, :func:`memcached_add_by_key`, and
+: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, :func:`memcached_set` with non-blocking IO
+is the fastest way to store data on the server.
+
+All of the above functions are tested 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.
+
+RETURN VALUE
+------------
+
+All methods return a value of type `memcached_return_t`.
+
+On success the value will be `MEMCACHED_SUCCESS`.
+Use :func:`memcached_strerror` to translate this value to a printable string.
+
+For :func:`memcached_replace` and :func:`memcached_add`, `MEMCACHED_NOTSTORED`
+is a legitimate error in the case of a collision.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_strerror(3)`
+ :manpage:`memcached_prepend(3)`
+ :manpage:`memcached_append(3)`
+ :manpage:`memcached_cas(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_strerror`
+ * :doc:`memcached_auto`
+ * :doc:`memcached_cas`
--- /dev/null
+Set encryption key
+==================
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
+
+.. function:: memcached_return_t memcached_set_encoding_key (memcached_st *ptr, const char *str, const size_t length)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :param str: the key to use
+ :param length: the length of `key` without any terminating zero
+ :returns: `memcached_return_t` indicating success
+
+DESCRIPTION
+-----------
+
+:func:`memcached_set_encoding_key` sets the key that will be used to encrypt and
+decrypt data as it is sent and received from the server.
+
+Currently only AES is is supported.
+
+RETURN VALUE
+------------
+
+A value of type :type:`memcached_return_t` is returned.
+On success that value will be `MEMCACHED_SUCCESS`.
+Use :func:`memcached_strerror` to translate this value to a printable string.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_strerror(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_strerror`
--- /dev/null
+Working with statistical information from a server
+==================================================
+
+Get memcached statistics
+
+.. index:: object: memcached_st
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
+
+.. type:: struct memcached_stat_st memcached_stat_st
+
+.. type:: memcached_return_t (*memcached_stat_fn)(const memcached_instance_st * server, const char *key, size_t key_length, const char *value, size_t value_length, void *context)
+
+ :param server: pointer to the `memcached_instance_st` being stat'ed
+ :param key: the current key
+ :param key_length: the length of the `key` without any terminating zero
+ :param value: the value read
+ :param value_length: the length of the value without any terminating zero
+ :param context: pointer to the user supplied context
+ :returns: `memcached_return_t` indicating success
+
+.. function:: memcached_stat_st *memcached_stat (memcached_st *ptr, char *args, memcached_return_t *error)
+
+ :param ptr: pointer to an initialized `memcached_st` struct
+ :param args: particular state object to query
+ :param error: pointer to `memcached_return_t` indicating success
+ :returns: array of `memcached_stat_st` objects for all available servers
+
+.. function:: memcached_return_t memcached_stat_servername (memcached_stat_st *stat, char *args, const char *hostname, in_port_t port)
+
+ :param stat: pointer to a `memcached_stat_st` struct to fill
+ :param args: particular state object to query
+ :param hostname: the hostname or IP address of the server to stat
+ :param port: the port of the server to stat
+ :returns: `memcached_return_t` indicating success
+
+.. function:: char * memcached_stat_get_value (memcached_st *ptr, memcached_stat_st *stat, const char *key, memcached_return_t *error)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :param stat: pointer to initialized `memcached_stat_st` struct
+ :param key: the statistic to query
+ :param error: pointer to `memcached_return_t` indicating success
+ :returns: string value of the statistic
+
+.. function:: char ** memcached_stat_get_keys (memcached_st *ptr, memcached_stat_st *stat, memcached_return_t *error)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :param stat: pointer to initialized `memcached_stat_st` struct
+ :param error: pointer to `memcached_return_t` indicating success
+ :returns: array of default keys probably available in the statistics
+
+.. function:: memcached_return_t memcached_stat_execute (memcached_st *ptr, const char *args, memcached_stat_fn func, void *context)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :param args: particular state object to query
+ :param func: `memcached_stat_fn` callback
+ :param context: pointer to user supplied context
+ :returns: `memcached_return_t` indication success
+
+DESCRIPTION
+-----------
+
+`libmemcached` has the ability to query a :manpage:`memcached(1)` server (or
+collection of servers) for their current state. Queries to find state return a
+: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. :func:`memcached_stat_get_value` has been provided to query the structure.
+
+:func:`memcached_stat_execute` uses the servers found in :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.
+
+:func:`memcached_stat` fetches an array of :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
+`MEMCACHED_BEHAVIOR_USE_UDP` behavior set, a NULL value is returned and the
+error parameter is set to `MEMCACHED_NOT_SUPPORTED`.
+
+:func:`memcached_stat_servername` can be used standalone without a
+: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 :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.
+
+: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.
+
+: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`, is provided so that you do not have to write
+an application to do this.
+
+RETURN VALUE
+------------
+
+Varies, see particular functions.
+
+Any method returning a :type:`memcached_stat_st` expects you to free the
+memory allocated for it.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_strerror(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_strerror`
--- /dev/null
+Converting Error Codes to Messages
+==================================
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
+
+.. function:: const char *memcached_strerror(memcached_st *ptr, memcached_return_t rc)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :param rc: `memcached_return_t` value to query the string representation for
+ :returns: the string representation of `rc`
+
+DESCRIPTION
+-----------
+
+`memcached_strerror` takes a `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.
+
+`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.
+
+RETURN VALUE
+------------
+
+`memcached_strerror` returns a string describing a `memcached_return_t` value.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_return_t`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_return_t`
--- /dev/null
+Update expiration on a key
+==========================
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
+
+.. function:: memcached_return_t memcached_touch (memcached_st *ptr, const char *key, size_t key_length, time_t expiration)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :param key: the key to touch
+ :param key_length: the length of `key` without any terminating zero
+ :param expiration: new expiration as a unix timestamp or as relative expiration time in seconds
+ :returns: `memcached_return_t` indicating success
+
+.. function:: memcached_return_t memcached_touch_by_key (memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, time_t expiration)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :param group_key: the `key` namespace
+ :param group_key_length: the length of `group_key` without any terminating zero
+ :param key: the key to touch
+ :param key_length: the length of `key` without any terminating zero
+ :param expiration: new expiration as a unix timestamp or as relative expiration time in seconds
+ :returns: `memcached_return_t` indicating success
+
+DESCRIPTION
+-----------
+
+:func:`memcached_touch` is used to update the expiration time on an existing key.
+:func:`memcached_touch_by_key` works the same, but it takes a master key
+to find the given value.
+
+RETURN VALUE
+------------
+
+A value of type :type:`memcached_return_t` is returned.
+On success that value will be `MEMCACHED_SUCCESS`.
+Use :func:`memcached_strerror` to translate this value to a printable
+string.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_strerror(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_strerror`
--- /dev/null
+Storing custom information in the client
+========================================
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
+
+.. function:: void *memcached_get_user_data (memcached_st *ptr)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :returns: opaque pointer to the user supplied data
+
+.. function:: void *memcached_set_user_data (memcached_st *ptr, void *data)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :param data: opaque pointer to user supplied data
+ :returns: opaque pointer to the previously set `data`
+
+DESCRIPTION
+-----------
+
+`libmemcached` allows you to store a pointer to a user specific data inside
+the memcached_st structure.
+
+:func:`memcached_set_user_data` is used to set the user specific data in the
+:type:`memcached_st` structure.
+
+:func:`memcached_get_user_data` is used to retrieve the user specific data in
+the :type:`memcached_st` structure.
+
+RETURN VALUE
+------------
+
+:func:`memcached_set_user_data` returns the previous value of the user specific data.
+
+:func:`memcached_get_user_data` returns the current value of the user specific data.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
--- /dev/null
+Setting the verbosity of a server
+=================================
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
+
+.. function:: memcached_return_t memcached_verbosity (memcached_st *ptr, uint32_t verbosity)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :param verbosity: level of verbosity
+ :returns: `memcached_return_t` indicating success
+
+DESCRIPTION
+-----------
+
+:func:`memcached_verbosity` modifies the "verbosity" of the
+:manpage:`memcached(1)` servers referenced in the :type:`memcached_st` parameter.
+
+RETURN VALUE
+------------
+
+A value of type :type:`memcached_return_t` is returned.
+
+On success that value will be `MEMCACHED_SUCCESS`.
+
+Use :func:`memcached_strerror` to translate this value to a printable string.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_strerror(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`memcached_strerror`
--- /dev/null
+Getting version information
+===========================
+
+SYNOPSIS
+--------
+
+#include <libmemcached/memcached.h>
+ Compile and link with -lmemcached
+
+.. function:: const char * memcached_lib_version (void)
+
+ :returns: version string of `libmemcached`
+
+.. function:: memcached_return_t memcached_version (memcached_st *ptr)
+
+ :param ptr: pointer to initialized `memcached_st` struct
+ :returns: `memcached_return_t` indicating success
+
+DESCRIPTION
+-----------
+
+:func:`memcached_lib_version` is used to return a simple version string
+representing the `libmemcached` version (client library, not server).
+
+: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.
+
+RETURN VALUE
+------------
+
+:func:`memcached_lib_version` returns a string with the version of the libmemcached driver.
+
+A value of :type:`memcached_return_t` is returned from :func:'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 :func:`memcached_strerror` to translate this value to
+a printable string.
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
+
--- /dev/null
+libmemcached Versioning
+=======================
+
+Libmemcached is laid out by interface version. The 1.0 version would be found
+in: ``libmemcached-1.0/memcached.h``
+
+The historic ``libmemcached/memcached.h`` includes
+``libmemcached-1.0/memcached.h``. For best practice you should include the
+version of libmemcached that you used during development.
+
+++ /dev/null
-========================
-Configuring Libmemcached
-========================
-
-.. highlightlang:: c
-
---------
-SYNOPSIS
---------
-
-#include <libmemcached-1.0/memcached.h>
-
-.. envvar:: LIBMEMCACHED
-
-.. c:function:: memcached_st *memcached(const char *string, size_t string_length)
-
-.. c:function:: memcached_return_t libmemcached_check_configuration(const char *option_string, size_t length, char *error_buffer, size_t error_buffer_size)
-
-Compile and link with -lmemcached
-
-
------------
-DESCRIPTION
------------
-
-Libmemcached implements a custom language for configuring and modifying
-servers. By passing in an option string you can generate a ``memcached_st`` object
-that you can use in your application directly.
-
-.. describe:: --SERVER=<servername>:<optional_port>/?<optional_weight>
-
-Provide a servername to be used by the client. Providing a weight will cause weighting to occur with all hosts with each server getting a default weight of 1.
-
-.. describe:: --SOCKET=\"<filepath>/?<optional_weight>\"
-
-Provide a filepath to a UNIX socket file. Providing a weight will cause weighting to occur with all hosts with each server getting a default weight of 1.
-
-.. describe:: --VERIFY-KEY
-
-Verify that keys that are being used fit within the design of the protocol being used.
-
-.. describe:: --REMOVE_FAILED_SERVERS
-
-Enable the behavior :c:type:`MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS`.
-
-.. describe:: --BINARY-PROTOCOL
-
-Force all connections to use the binary protocol.
-
-.. describe:: --BUFFER-REQUESTS
-
-Please see :c:type:`MEMCACHED_BEHAVIOR_BUFFER_REQUESTS`.
-
-.. describe:: --CONFIGURE-FILE=
-
-Provide a configuration file to be used to load requests. Beware that by using a configuration file libmemcached will reset memcached_st based on information only contained in the file.
-
-.. describe:: --CONNECT-TIMEOUT=
-
-Please see :c:type:`MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT`.
-
-.. describe:: --DISTRIBUTION=
-
-Set the distribution model used by the client. See :manpage:`memcached_behavior_set(3)` for more details.
-
-.. describe:: --HASH=
-
-Set the hashing alogrthm used for placing keys on servers.
-
-.. describe:: --HASH-WITH-NAMESPACE
-
-When enabled the prefix key will be added to the key when determining which
-server to store the data in.
-
-.. describe:: --NOREPLY
-
-Enable "no reply" for all calls that support this. It is highly recommended
-that you use this option with the binary protocol only.
-
-.. describe:: --NUMBER-OF-REPLICAS=
-
-Set the nummber of servers that keys will be replicated to.
-
-.. describe:: --RANDOMIZE-REPLICA-READ
-
-Select randomly the server within the replication pool to read from.
-
-.. describe:: --SORT-HOSTS
-
-When adding new servers always calculate their distribution based on sorted naming order.
-
-.. describe:: --SUPPORT-CAS
-
-See :manpage:`memcached_behavior_set(3)` for :c:type:`MEMCACHED_BEHAVIOR_SUPPORT_CAS`
-
-.. describe:: --USE-UDP
-
-See :manpage:`memcached_behavior_set(3)` for :c:type:`MEMCACHED_BEHAVIOR_USE_UDP`
-
-.. describe:: --NAMESPACE=
-
-A namespace is a container that provides context for keys, only other
-requests that know the namespace can access these values. This is
-accomplished by prepending the namespace value to all keys.
-
-
-**********************
-Mecached Pool Options:
-**********************
-
-.. describe:: --POOL-MIN
-
-Initial size of pool.
-
-.. describe:: --POOL-MAX
-
-Maximize size of the pool.
-
-************
-I/O Options:
-************
-
-.. describe:: --TCP-NODELAY
-
-See :manpage:`memcached_behavior_set(3)` for MEMCACHED_BEHAVIOR_TCP_NODELAY
-
-.. describe:: --TCP-KEEPALIVE
-
-See :manpage:`memcached_behavior_set(3)` for MEMCACHED_BEHAVIOR_TCP_KEEPALIVE
-
-.. describe:: --RETRY-TIMEOUT=
-
-See :manpage:`memcached_behavior_set(3)` for MEMCACHED_BEHAVIOR_RETRY_TIMEOUT
-
-.. describe:: --SERVER-FAILURE-LIMIT=
-
-See :manpage:`memcached_behavior_set(3)` for MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT
-
-.. describe:: --SND-TIMEOUT=
-
-See :manpage:`memcached_behavior_set(3)` for MEMCACHED_BEHAVIOR_SND_TIMEOUT
-
-.. describe:: --SOCKET-RECV-SIZE=
-
-See :manpage:`memcached_behavior_set(3)` for MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE
-
-.. describe:: --SOCKET-SEND-SIZE=
-
-See :manpage:`memcached_behavior_set(3)` for MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE
-
-.. describe:: --POLL-TIMEOUT=
-
-That sets the value of the timeout used by :manpage: `poll()`.
-
-.. describe:: --IO-BYTES-WATERMARK=
-
-.. describe:: --IO-KEY-PREFETCH=
-
-.. describe:: --IO-MSG-WATERMARK=
-
-.. describe:: --TCP-KEEPIDLE
-
-.. describe:: --RCV-TIMEOUT=
-
-
-
-******
-Other:
-******
-
-
-.. describe:: INCLUDE
-
-Include a file in configuration. Unlike --CONFIGURE-FILE= this will not reset memcached_st
-
-.. describe:: RESET
-
-Reset memcached_st and continue to process.
-
-.. describe:: END
-
-End configutation processing.
-
-.. describe:: ERROR
-
-End configutation processing and throw an error.
-
-
-------
-RETURN
-------
-
-
-:c:func:`memcached()` returns a pointer to the memcached_st that was
-created (or initialized). On an allocation failure, it returns NULL.
-
-
-
--------
-EXAMPLE
--------
-
-
-.. code-block:: c
-
- const char *config_string= "--SERVER=host10.example.com --SERVER=host11.example.com --SERVER=host10.example.com"
- memcached_st *memc= memcached(config_string, strlen(config_string);
- {
- ...
- }
- memcached_free(memc);
-
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
-
---------
-SEE ALSO
---------
-
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
+++ /dev/null
-========
-Examples
-========
-
-Examples for libmemcached
-
------------
-DESCRIPTION
------------
-
-
-For full examples, test cases are found in tests/\*.c in the main
-distribution. These are always up to date, and are used for each test run of
-the library.
-
-
----------------------
-Connecting to servers
----------------------
-
-
-.. code-block:: c
-
- const char *config_string= "--SERVER=host10.example.com --SERVER=host11.example.com --SERVER=host10.example.com"
- memcached_st *memc= memcached(config_string, strlen(config_string);
- {
- ...
- }
- memcached_free(memc);
-
-
-In the above code you create a :c:type:`memcached_st` object with three server
-by making use of :c:func:`memcached_create`.
-
-
---------------------------
-Creating a pool of servers
---------------------------
-
-
-.. code-block:: c
-
- const char *config_string= "--SERVER=host10.example.com --SERVER=host11.example.com --SERVER=host10.example.com";
-
- memcached_pool_st* pool= memcached_pool(config_string, strlen(config_string));
-
- memcached_return_t rc;
-
- memcached_st *memc= memcached_pool_pop(pool, false, &rc);
-
- .... do work
-
- /*
- Release the memc_ptr that was pulled from the pool
- */
- memcached_pool_push(pool, memc);
-
- /*
- Destroy the pool.
- */
- memcached_pool_destroy(pool);
-
-
-
-In the above code you create a :c:type:`memcached_pool_st` object with three
-server by making use of :c:func:`memcached_pool()`.
-
-When :c:func:`memcached_pool_destroy()` all memory will be released that is associated
-with the pool.
-
-
-----------------------------
-Adding a value to the server
-----------------------------
-
-
-
-.. code-block:: c
-
- char *key= "foo";
- char *value= "value";
-
- memcached_return_t rc= memcached_set(memc, key, strlen(key), value, value_length, (time_t)0, (uint32_t)0);
-
- if (rc != MEMCACHED_SUCCESS)
- {
- ... // handle failure
- }
-
-
-It is best practice to always look at the return value of any operation.
-
-
-------------------------
-Fetching multiple values
-------------------------
-
-
-
-.. code-block:: c
-
- memcached_return_t rc;
- char *keys[]= {"fudge", "son", "food"};
- size_t key_length[]= {5, 3, 4};
- unsigned int x;
- uint32_t flags;
-
- char return_key[MEMCACHED_MAX_KEY];
- size_t return_key_length;
- char *return_value;
- size_t return_value_length;
-
- rc= memcached_mget(memc, keys, key_length, 3);
-
- x= 0;
- while ((return_value= memcached_fetch(memc, return_key, &return_key_length,
- &return_value_length, &flags, &rc)))
- {
- free(return_value);
- x++;
- }
-
-
-Notice that you freed values returned from memcached_fetch(). The define
-:c:type:`MEMCACHED_MAX_KEY` is provided for usage.
-
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
---------
-SEE ALSO
---------
-
-
-:manpage:`memcached(1)`
-
-============================
-Introducing libmemcachedutil
-============================
+libmemcachedutil - C/C++ utilities extending libmemcached
+=========================================================
Utility library for libmemcached
-
---------
SYNOPSIS
--------
-.. code-block:: c
-
- cc [ flag ... ] file ... -lmemcachedutil
-
- #include <libmemcached/memcached_util.h>
-
+#include <libmemcachedutil-|libmemcached_version|/util.h>
+ Compile and link with -lmemcachedutil -lmemcached
-
------------
DESCRIPTION
-----------
+`libmemcachedutil` is a small and thread-safe client library that provides extra
+functionality built on top of `libmemcached`.
-:program:`libmemcachedutil` is a small and thread-safe client library that
-provides extra functionality built on top of :program:`libmemcached`.
-
-
--------
-THREADS
--------
+THREADS AND PROCESSES
+---------------------
+Do not try to access an instance of `memcached_st` from multiple threads at the
+same time. If you want to access memcached from multiple threads you should
+either clone the `memcached_st`, or use the memcached pool implementation. See
+`memcached_pool`.
-Do not try to access an instance of :c:type:`memcached_st` from multiple threads
-at the same time. If you want to access memcached from multiple threads
-you should either clone the :c:type:`memcached_st`, or use the memcached pool
-implementation. see :c:func:`memcached_pool_create`.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
---------
SEE ALSO
--------
+.. only:: man
+
+ :manpage:`libmemcached(3)`
+ :manpage:`memcached_pool(3)`
+ :manpage:`memcached_pool_destroy(3)`
+ :manpage:`memcached_pool_pop(3)`
+ :manpage:`memcached_pool_push(3)`
-:manpage:`libmemcached(3)` :manpage:`memcached_pool_create(3)` :manpage:`memcached_pool_destroy(3)` :manpage:`memcached_pool_pop(3)` :manpage:`memcached_pool_push(3)`
+.. only:: html
+ * :doc:`../libmemcached`
+ * :doc:`libmemcachedutil/memcached_pool`
--- /dev/null
+libmemcachedutil API
+====================
+
+.. toctree::
+ :titlesonly:
+ :caption: Additional Utilities
+
+ memcached_pool
--- /dev/null
+Working with memcached pools
+============================
+
+SYNOPSIS
+--------
+
+#include <libmemcachedutil-|libmemcached_version|/pool.h>
+ Compile and link with -lmemcachedutil -lmemcached
+
+.. type:: struct memcached_pool_st memcached_pool_st
+
+.. function:: memcached_pool_st* memcached_pool(const char *option_string, size_t option_string_length)
+
+ :param option_string: :doc:`configuration </libmemcached/configuration>` string
+ :param option_string_length: length of `options_string` without any trailing zero byte
+ :returns: allocated and initialized `memcached_pool_st` instance on success or nullptr on failure
+
+.. function:: memcached_st* memcached_pool_destroy(memcached_pool_st* pool)
+
+ :param pool: initialized `memcached_pool_st` instance to free
+ :returns: pointer to the 'master' `memcached_st` instance by legacy
+
+.. function:: memcached_st* memcached_pool_fetch(memcached_pool_st* pool, struct timespec* relative_time, memcached_return_t* rc)
+
+ .. versionadded:: 0.53
+ Synonym for memcached_pool_pop
+
+ :param pool: initialized `memcached_pool_st` instance
+ :param relative_time: time to block thread and wait for a connection to become available when pool size is exceeded, unless nullptr
+ :param rc: out pointer to `memcached_return_t`
+ :returns: pointer to an available `memcached_st` instance
+
+.. function:: memcached_return_t memcached_pool_release(memcached_pool_st* pool, memcached_st* mmc)
+
+ .. versionadded:: 0.53
+ Synonym for memcached_pool_push.
+
+ :param pool: initialized `memcached_pool_st` instance
+ :param mmc: the `memcached_st` instance to return to the pool
+ :returns: `memcached_return_t` indicating success
+
+.. function:: memcached_return_t memcached_pool_behavior_set(memcached_pool_st *pool, memcached_behavior_t flag, uint64_t data)
+
+ :param pool: initialized `memcached_pool_st` instance
+ :param flag: the :doc:`behavior </libmemcached/memcached_behavior>` to change
+ :param value: the value to set for `flag`
+ :returns: `memcached_return_t` indicating success
+
+.. function:: memcached_return_t memcached_pool_behavior_get(memcached_pool_st *pool, memcached_behavior_t flag, uint64_t *value)
+
+ :param pool: initialized `memcached_pool_st` instance
+ :param flag: the :doc:`behavior </libmemcached/memcached_behavior>` to read
+ :param value: out pointer to receive the set value of `flag`
+ :returns: `memcached_return_t` indicating success
+
+.. function:: memcached_pool_st* memcached_pool_create(memcached_st* mmc, int initial, int max)
+
+ .. deprecated:: 0.46
+ Use `memcached_pool`
+
+.. function:: memcached_st* memcached_pool_pop(memcached_pool_st* pool, bool block, memcached_return_t *rc)
+
+ .. deprecated:: 0.53
+ Use `memcached_pool_fetch`
+
+.. function:: memcached_return_t memcached_pool_push(memcached_pool_st* pool, memcached_st *mmc)
+
+ .. deprecated:: 0.53
+ Use `memcached_pool_release`
+
+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 :doc:`../libmemcached/configuration` for details on the
+format of the configuration string.
+
+`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..
+
+`memcached_pool_fetch` is used to fetch a connection structure from the
+connection pool. The relative_time argument specifies if the function should
+block and wait for a connection structure to be available if we try to exceed
+the maximum size. You need to specify time in relative time.
+
+`memcached_pool_release` is used to return a connection structure back to the
+pool.
+
+`memcached_pool_behavior_get` and `memcached_pool_behavior_set` is used to
+get/set behavior flags on all connections in the pool.
+
+Both `memcached_pool_release` and `memcached_pool_fetch` are thread safe.
+
+RETURN VALUE
+------------
+
+`memcached_pool_destroy` returns the pointer (and ownership) to the
+`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).
+
+`memcached_pool_release` returns `MEMCACHED_SUCCESS` upon success.
+
+`memcached_pool_behavior_get` and `memcached_pool_behavior_get` return
+`MEMCACHED_SUCCESS` upon success.
+
+`memcached_pool_fetch` may return `MEMCACHED_TIMEOUT` if a timeout occurs while
+waiting for a free `memcached_st` instance, `MEMCACHED_NOTFOUND` if no `memcached_st`
+instance was available, respectively.
+
+.. note::
+ If any method returns `MEMCACHED_IN_PROGRESS` then a lock on the pool could not
+ be obtained.
+
+ If any of the parameters passed to any of these functions is
+ invalid, `MEMCACHED_INVALID_ARGUMENTS` will be returned.
+
+
+SEE ALSO
+--------
+
+.. only:: man
+
+ :manpage:`memcached(1)`
+ :manpage:`libmemcached(3)`
+ :manpage:`libmemcached_configuration(3)`
+ :manpage:`memcached_strerror(3)`
+
+.. only:: html
+
+ * :manpage:`memcached(1)`
+ * :doc:`../libmemcached`
+ * :doc:`../libmemcached/configuration`
+ * :doc:`../libmemcached/memcached_strerror`
+++ /dev/null
-=================
-Anaylzing servers
-=================
-
-
-Analyze server information
-
-
---------
-SYNOPSIS
---------
-
-.. index:: object: memcached_analysis_st
-
-
-#include <libmemcached/memcached.h>
-
-.. c:type:: memcached_analysis_st
-
-.. c:function:: memcached_analysis_st * memcached_analyze (memcached_st *ptr, memcached_stat_st *stat, memcached_return_t *error)
-
-Compile and link with -lmemcached
-
------------
-DESCRIPTION
------------
-
-
-:program:`libmemcached` has the ability to query a memcached server (or
-collection of servers) for their current state. Queries to find state return a
-:c:type:`memcached_analysis_st` structure. You are responsible for freeing this structure.
-
-:c:func:`memcached_analyze` analyzes useful information based on the
-provided servers and sets the result to the :c:type:`memcached_analysis_st`
-structure. The return value must be freed by the calling application.
-
-A command line tool, :program:`memstat` with the option :option:`memstat --analyze`,
-is provided so that you do not have to write an application to use this method.
-
-
-------
-RETURN
-------
-
-
-A pointer to the allocated :c:type:`memcached_analysis_st` structure on
-success and a NULL pointer on failure. You may inspect the error detail by
-checking the :c:type:`memcached_return_t` value.
-
-Any method returning a :c:type:`memcached_analysis_st` expects you to free the
-memory allocated for it.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
---------
-SEE ALSO
---------
-
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
-
+++ /dev/null
-=============================================
-Appending or Prepending to data on the server
-=============================================
-
-.. index:: object: memcached_st
-
-Appending or Prepending to data on the server
-
-
---------
-SYNOPSIS
---------
-
-
-#include <libmemcached/memcached.h>
-
-.. c:function:: memcached_return_t memcached_prepend(memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags)
-
-.. c:function:: memcached_return_t memcached_append(memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags)
-
-.. c:function:: memcached_return_t memcached_prepend_by_key(memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags)
-
-.. c:function:: memcached_return_t memcached_append_by_key(memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags)
-
-Compile and link with -lmemcached
-
-
------------
-DESCRIPTION
------------
-
-
-:c:func:`memcached_prepend` and memcached_append are used to
-modify information on a 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 which is 1.4 or below, or when using the text
-protocol. 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.
-
-:c:func:`memcached_prepend` places a segment of data before the last piece
-of data stored. Currently expiration and key are not used in the server.
-
-:c:func:`memcached_append` places a segment of data at the end of the last
-piece of data stored. Currently expiration and key are not used in the server.
-
-:c:func:`memcached_prepend_by_key` and
-:c:func:`memcached_append_by_key` methods both 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, :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.
-
-
-------
-RETURN
-------
-
-
-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.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
---------
-SEE ALSO
---------
-
-
-:manpage:`memcached(1)` :manpage:`libmemached(3)` :manpage:`memcached_strerror(3)` :manpage:`memcached_set(3)` :manpage:`memcached_add(3)` :manpage:`memcached_cas(3)` :manpage:`memcached_replace(3)`
-
+++ /dev/null
-====================================
-Incrementing and Decrementing Values
-====================================
-
-.. index:: object: memcached_st
-
---------
-SYNOPSIS
---------
-
-#include <libmemcached/memcached.h>
-
-.. c:function:: memcached_return_t memcached_increment (memcached_st *ptr, const char *key, size_t key_length, uint32_t offset, uint64_t *value)
-
-.. c:function:: memcached_return_t memcached_decrement (memcached_st *ptr, const char *key, size_t key_length, uint32_t offset, uint64_t *value)
-
-.. c:function:: memcached_return_t memcached_increment_with_initial (memcached_st *ptr, const char *key, size_t key_length, uint64_t offset, uint64_t initial, time_t expiration, uint64_t *value)
-
-.. c:function:: memcached_return_t memcached_decrement_with_initial (memcached_st *ptr, const char *key, size_t key_length, uint64_t offset, uint64_t initial, time_t expiration, uint64_t *value)
-
-.. c:function:: memcached_return_t memcached_increment_by_key (memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, uint32_t offset, uint64_t *value)
-
-.. c:function:: memcached_return_t memcached_decrement_by_key (memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, uint32_t offset, uint64_t *value)
-
-.. c:function:: memcached_return_t memcached_increment_with_initial_by_key (memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, uint64_t offset, uint64_t initial, time_t expiration, uint64_t *value)
-
-.. c:function:: memcached_return_t memcached_decrement_with_initial_by_key (memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, uint64_t offset, uint64_t initial, time_t expiration, uint64_t *value)
-
-Compile and link with -lmemcached
-
-
------------
-DESCRIPTION
------------
-
-
-:manpage:`memcached(1)` servers have the ability to increment and decrement keys
-(overflow and underflow are not detected). This gives you the ability to use
-memcached to generate shared sequences of values.
-
-memcached_increment takes a key and keylength and increments the value by
-the offset passed to it. The value is then returned via the uint32_t
-value pointer you pass to it.
-
-memcached_decrement takes a key and keylength and decrements the value by
-the offset passed to it. The value is then returned via the uint32_t
-value pointer you pass to it.
-
-memcached_increment_with_initial takes a key and keylength and increments
-the value by the offset passed to it. If the object specified by key does
-not exist, one of two things may happen: If the expiration value is
-MEMCACHED_EXPIRATION_NOT_ADD, the operation will fail. For all other
-expiration values, the operation will succeed by seeding the value for that
-key with a initial value to expire with the provided expiration time. The
-flags will be set to zero.The value is then returned via the uint32_t
-value pointer you pass to it. memcached_increment_with_initial is only available
-when using the binary protocol.
-
-memcached_decrement_with_initial takes a key and keylength and decrements
-the value by the offset passed to it. If the object specified by key does
-not exist, one of two things may happen: If the expiration value is
-MEMCACHED_EXPIRATION_NOT_ADD, the operation will fail. For all other
-expiration values, the operation will succeed by seeding the value for that
-key with a initial value to expire with the provided expiration time. The
-flags will be set to zero.The value is then returned via the uint32_t
-value pointer you pass to it. memcached_decrement_with_initial is only available
-when using the binary protocol.
-
-:c:func:`memcached_increment_by_key`, :c:func:`memcached_decrement_by_key`,
-:c:func:`memcached_increment_with_initial_by_key`, and
-:c:func:`memcached_decrement_with_initial_by_key` are master key equivalents of the above.
-
-
-------
-RETURN
-------
-
-
-A value of type :c:type:`memcached_return_t` is returned.
-On success that value will be :c:type:`MEMCACHED_SUCCESS`.
-Use memcached_strerror to translate this value to a printable string.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
---------
-SEE ALSO
---------
-
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
+++ /dev/null
-================================
-Modifying how the driver behaves
-================================
-
-
-Manipulate the behavior of a memcached_st structure.
-
-.. index:: object: memcached_st
-
-
---------
-SYNOPSIS
---------
-
-
-#include <libmemcached/memcached.h>
-
-.. c:type:: memcached_behavior_t
-
-.. c:function:: uint64_t memcached_behavior_get (memcached_st *ptr, memcached_behavior_t flag)
-
-.. c:function:: memcached_return_t memcached_behavior_set (memcached_st *ptr, memcached_behavior_t flag, uint64_t data)
-
-Compile and link with -lmemcached
-
-
------------
-DESCRIPTION
------------
-
-: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`).
-
-:c:func:`memcached_behavior_get` takes a behavior flag and returns whether or not that behavior is currently enabled in the client.
-
-: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:type:: 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
-: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_fetch_execute`.
-
-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 :c:type:`MEMCACHED_INVALID_HOST_PROTOCOL`, as will attempting to add a UDP server when this behavior has
-not been enabled.
-
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_NO_BLOCK
-
-Causes :manpage:`libmemcached(3)` to use asychronous IO. This is the fastest
-transport available for storage functions.
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_SND_TIMEOUT
-
-This sets the microsecond behavior of the socket against the SO_SNDTIMEO flag. In cases where you cannot use non-blocking IO this will allow you to still have timeouts on the sending of data.
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_RCV_TIMEOUT
-
-This sets the microsecond behavior of the socket against the SO_RCVTIMEO flag.
-
-In cases where you cannot use non-blocking IO this will allow you to still have timeouts on the reading of data.
-
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_TCP_NODELAY
-
-Turns on the no-delay feature for connecting sockets (may be faster in some
-environments).
-
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_HASH
-
-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.
-
-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.
-
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_DISTRIBUTION
-
-Using this you can enable different means of distributing values to servers.
-
-The default method is MEMCACHED_DISTRIBUTION_MODULA. You can enable consistent hashing by setting MEMCACHED_DISTRIBUTION_CONSISTENT. Consistent hashing delivers better distribution and allows servers to be added to the cluster with minimal cache losses. Currently MEMCACHED_DISTRIBUTION_CONSISTENT is an alias for the value MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA.
-
-.. c:type:: MEMCACHED_BEHAVIOR_CACHE_LOOKUPS
-.. deprecated:: 0.46(?)
- DNS lookups are now always cached until an error occurs with the server.
-
- Memcached can cache named lookups so that DNS lookups are made only once.
-
-.. c:type:: MEMCACHED_BEHAVIOR_SUPPORT_CAS
-
-Support CAS operations (this is not enabled by default at this point in the server since it imposes a slight performance penalty).
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_KETAMA
-
-Sets the default distribution to MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA and
-the hash to :c:type:`MEMCACHED_HASH_MD5`.
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED
-
- Sets the default distribution to MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA with the weighted tests. and the hash to MEMCACHED_HASH_MD5.
-
-.. c:type:: MEMCACHED_BEHAVIOR_KETAMA_HASH
-
-Sets the hashing algorithm for host mapping on continuum. 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`, and
-:c:type:`MEMCACHED_HASH_FNV1A_32`.
-
-.. c:type:: MEMCACHED_BEHAVIOR_KETAMA_COMPAT
-
-Sets the compatibility mode. The value can be set to either MEMCACHED_KETAMA_COMPAT_LIBMEMCACHED (this is the default) or MEMCACHED_KETAMA_COMPAT_SPY to be compatible with the SPY Memcached client for Java.
-
-.. c:type:: MEMCACHED_BEHAVIOR_POLL_TIMEOUT
-
-Modify the timeout in milliseconds value that is used by poll. The default value is -1. An signed int must be passed to memcached_behavior_set to change this value (this requires casting). For memcached_behavior_get a signed int value will be cast and returned as the unsigned long long.
-
-.. c:type:: MEMCACHED_BEHAVIOR_USER_DATA
-.. deprecated:: < 0.30
-
-.. c:type:: MEMCACHED_BEHAVIOR_BUFFER_REQUESTS
-
-Enabling buffered IO causes commands to "buffer" instead of being sent. Any action that gets data causes this buffer to be be sent to the remote connection. Quiting the connection or closing down the connection will also cause the buffered data to be pushed to the remote connection.
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_VERIFY_KEY
-
-Enabling this will cause :manpage:`libmemcached(3)` to test all keys to verify that they are valid keys.
-
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_SORT_HOSTS
-
-Enabling this will cause hosts that are added to be placed in the host list in sorted order. This will defeat consisten hashing.
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT
-
-In non-blocking mode this changes the value of the timeout during socket connection in milliseconds. Specifying -1 means an infinite time‐out.
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_BINARY_PROTOCOL
-
-Enable the use of the binary protocol. Please note that you cannot toggle this flag on an open connection.
-
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT
-
-Set this value to enable the server be removed after continuous MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT times connection failure.
-
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK
-
-Set this value to tune the number of messages that may be sent before libmemcached should start to automatically drain the input queue. Setting this value to high, may cause libmemcached to deadlock (trying to send data, but the send will block because the input buffer in the kernel is full).
-
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK
-
-Set this value to tune the number of bytes that may be sent before libmemcached should start to automatically drain the input queue (need at least 10 IO requests sent without reading the input buffer). Setting this value to high, may cause libmemcached to deadlock (trying to send data, but the send will block because the input buffer in the kernel is full).
-
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH
-
-The binary protocol works a bit different than the textual protocol in that a multiget is implemented as a pipe of single get-operations which are sent to the server in a chunk. If you are using large multigets from your application, you may improve the latency of the gets by setting this value so you send out the first chunk of requests when you hit the specified limit. It allows the servers to start processing the requests to send the data back while the rest of the requests are created and sent to the server.
-
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_NOREPLY
-
-Set this value to specify that you really don't care about the result from your storage commands (set, add, replace, append, prepend).
-
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS
-
-If you just want "a poor mans HA", you may specify the numbers of replicas libmemcached should store of each item (on different servers). This replication does not dedicate certain memcached servers to store the replicas in, but instead it will store the replicas together with all of the other objects (on the 'n' next servers specified in your server list).
-
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ
-
-Allows randomizing the replica reads starting point. Normally the read is done from primary server and in case of miss the read is done from primary + 1, then primary + 2 all the way to 'n' replicas. If this option is set on the starting point of the replica reads is randomized between the servers. This allows distributing read load to multiple servers with the expense of more write traffic.
-
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_CORK
-
-This open has been deprecated with the behavior now built and used appropriately on selected platforms.
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_KEEPALIVE
-
-Enable TCP_KEEPALIVE behavior.
-
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_KEEPALIVE_IDLE
-
-Specify time, in seconds, to mark a connection as idle. This is only available as an option Linux.
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE
-
-Find the current size of SO_SNDBUF. A value of 0 means either an error occured or no hosts were available. It is safe to assume system default if this occurs. If an error occurs you can checked the last cached errno statement to find the specific error.
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE
-
-Find the current size of SO_RCVBUF. A value of 0 means either an error occured or no hosts were available. It is safe to assume system default if this occurs. If an error occurs you can checked the last cached errno statement to find the specific error.
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT
-.. deprecated:: 0.48
- See :c:type:`MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS`
-
- This number of times a host can have an error before it is disabled.
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTS
-.. deprecated:: 0.48
- See :c:type:`MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS`
-
- If enabled any hosts which have been flagged as disabled will be removed from the list of servers in the memcached_st structure. This must be used in combination with MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT.
-
-.. c:type:: MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS
-
- If enabled any hosts which have been flagged as disabled will be removed from the list of servers in the memcached_st structure.
-
-.. c:type:: MEMCACHED_BEHAVIOR_RETRY_TIMEOUT
-
-When enabled a host which is problematic will only be checked for usage based on the amount of time set by this behavior. The value is in seconds.
-
-
-.. c:type:: MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY
-
-When enabled the prefix key will be added to the key when determining server
-by hash. See :c:type:`MEMCACHED_CALLBACK_NAMESPACE` for additional
-information.
-
-
-
-
-------
-RETURN
-------
-
-
-memcached_behavior_get returns either the current value of the get, or 0
-or 1 on simple flag behaviors (1 being enabled). memcached_behavior_set
-returns failure or success.
-
-
------
-NOTES
------
-
-
-memcached_behavior_set in version .17 was changed from taking a pointer
-to data value, to taking a uin64_t.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
-
---------
-SEE ALSO
---------
-
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
+++ /dev/null
-=================
-Setting callbacks
-=================
-
-
-Get and set a callback
-
-.. index:: object: memcached_st
-
-
---------
-SYNOPSIS
---------
-
-#include <libmemcached/memcached.h>
-
-.. c:type:: memcached_callback_t
-
-.. c:function:: memcached_return_t memcached_callback_set (memcached_st *ptr, memcached_callback_t flag, const void *data)
-
-.. c:function:: void * memcached_callback_get (memcached_st *ptr, memcached_callback_t flag, memcached_return_t *error)
-
-Compile and link with -lmemcached
-
-
------------
-DESCRIPTION
------------
-
-
-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.
-
-:c:func:`memcached_callback_get` takes a callback flag and returns the
-structure or function set by :c:func:`memcached_callback_set`.
-
-:c:func:`memcached_callback_set` changes the function/structure assigned by a
-callback flag. No connections are reset.
-
-You can use :c:type:`MEMCACHED_CALLBACK_USER_DATA` to provide custom context
-if required for any of the callbacks.
-
-
-.. c:type:: MEMCACHED_CALLBACK_CLEANUP_FUNCTION
-
-When :c:func:`memcached_delete` is called this function will be excuted. At
-the point of its execution all connections are closed.
-
-
-
-.. c:type:: MEMCACHED_CALLBACK_CLONE_FUNCTION
-
-When :c:func:`memcached_delete` is called this function will be excuted.
-At the point of its execution all connections are closed.
-
-.. c:type:: MEMCACHED_CALLBACK_PREFIX_KEY
-
- See :c:type:`MEMCACHED_CALLBACK_NAMESPACE`
-
-.. c:type:: MEMCACHED_CALLBACK_NAMESPACE
-
-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 :c:macro:`MEMCACHED_PREFIX_KEY_MAX_SIZE` - 1 and will
-reduce :c:macro:`MEMCACHED_MAX_KEY` by the value of your key.
-
-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:type:: MEMCACHED_CALLBACK_USER_DATA
-
-This allows you to store a pointer to a specifc piece of data. This can be
-retrieved from inside of :c:func:`memcached_fetch_execute`. Cloning a
-:c:type:`memcached_st` will copy the pointer to the clone.
-
-.. c:type:: MEMCACHED_CALLBACK_MALLOC_FUNCTION
-.. deprecated:: <0.32
- Use :c:type:`memcached_set_memory_allocators` instead.
-
-.. c:type:: MEMCACHED_CALLBACK_REALLOC_FUNCTION
-.. deprecated:: <0.32
- Use :c:type:`memcached_set_memory_allocators` instead.
-
-.. c:type:: MEMCACHED_CALLBACK_FREE_FUNCTION
-.. deprecated:: <0.32
- Use :c:type:`memcached_set_memory_allocators` instead.
-
-.. c:type:: MEMCACHED_CALLBACK_GET_FAILURE
-
-This function implements the read through cache behavior. On failure of retrieval this callback will be called.
-
-You are responsible for populating the result object provided. This result object will then be stored in the server and returned to the calling process.
-
-You must clone the :c:type:`memcached_st` in order to
-make use of it. The value will be stored only if you return
-: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:
-
-.. c:function:: memcached_return_t (\*memcached_trigger_key)(memcached_st \*ptr, char \*key, size_t key_length, memcached_result_st \*result);
-
-
-
-.. c:type:: MEMCACHED_CALLBACK_DELETE_TRIGGER
-
-This function implements a trigger upon successful deletion of a key. The memcached_st structure will need to be cloned in order to make use of it.
-
-The prototype for this is:
-
-.. c:function:: typedef memcached_return_t (\*memcached_trigger_delete_key)(memcached_st \*ptr, char \*key, size_t key_length);
-
-
-
-
-------
-RETURN
-------
-
-
-: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`.
-
-:c:func:`memcached_callback_set` returns :c:type:`MEMCACHED_SUCCESS` upon
-successful setting, otherwise :c:type:`MEMCACHED_FAILURE` on error.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
-------
-AUTHOR
-------
-
-
-Brian Aker, <brian@tangent.org>
-
-
---------
-SEE ALSO
---------
-
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
+++ /dev/null
-====================================================
-Working with data on the server in an atomic fashion
-====================================================
-
-.. index:: object: memcached_st
-
-
---------
-SYNOPSIS
---------
-
-
-#include <libmemcached/memcached.h>
-
-.. c:function:: memcached_return_t memcached_cas(memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags, uint64_t cas)
-
-.. c:function:: memcached_return_t memcached_cas_by_key(memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags, uint64_t cas)
-
-Compile and link with -lmemcached
-
-
------------
-DESCRIPTION
------------
-
-: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
-: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 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.
-
-
-------
-RETURN
-------
-
-
-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.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
---------
-SEE ALSO
---------
-
-
-: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)`
-
+++ /dev/null
-======================================
-Creating and destroying a memcached_st
-======================================
-
---------
-SYNOPSIS
---------
-
-#include <libmemcached/memcached.h>
-
-.. c:type:: memcached_st
-
-.. c:function:: memcached_st* memcached_create(memcached_st *ptr)
-
-.. c:function:: void memcached_free(memcached_st *ptr)
-
-.. c:function:: memcached_st* memcached_clone(memcached_st *destination, memcached_st *source)
-
-.. c:function:: void memcached_servers_reset(memcached_st)
-
-Compile and link with -lmemcached
-
-
------------
-DESCRIPTION
------------
-
-: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
-:c:func:`memcached` over :c:func:`memcached_create`.
-
-: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.
-
-: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 :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
-heap allocated structures.
-
-
-------
-RETURN
-------
-
-
-: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.
-
-: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.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
---------
-SEE ALSO
---------
-
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
+++ /dev/null
-===========================
-Deleting data from a server
-===========================
-
-.. index:: object: memcached_st
-
---------
-SYNOPSIS
---------
-
-
-#include <libmemcached/memcached.h>
-
-.. c:function:: memcached_return_t memcached_delete (memcached_st *ptr, const char *key, size_t key_length, time_t expiration)
-
-.. c:function:: memcached_return_t memcached_delete_by_key (memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, time_t expiration)
-
-Compile and link with -lmemcached
-
------------
-DESCRIPTION
------------
-
-
-: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
-"replace" commands with this key will also fail (the "set" command will
-succeed, however). After the time passes, the item is finally deleted from server memory.
-
-Please note the the Danga memcached server removed tests for expiration in
-the 1.4 version.
-
-
-------
-RETURN
-------
-
-
-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.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
-------
-AUTHOR
-------
-
-
-Brian Aker, <brian@tangent.org>
-
-
---------
-SEE ALSO
---------
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
+++ /dev/null
-==========================
-Dumping data from a server
-==========================
-
-
-Get a list of keys found on memcached servers
-
-.. index:: object: memcached_st
-
-
---------
-SYNOPSIS
---------
-
-
-#include <libmemcached/memcached.h>
-
-.. c:function:: memcached_return_t memcached_dump (memcached_st *ptr, memcached_dump_fn *function, void *context, uint32_t number_of_callbacks)
-
-.. c:type:: memcached_return_t (*memcached_dump_fn)(memcached_st *ptr, const char *key, size_t key_length, void *context)
-
-Compile and link with -lmemcached
-
-
-
------------
-DESCRIPTION
------------
-
-
-: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.
-
-
-------
-RETURN
-------
-
-
-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.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
-------
-AUTHOR
-------
-
-
-Brian Aker, <brian@tangent.org>
-
-
---------
-SEE ALSO
---------
-
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
+++ /dev/null
-=====================================
-Wiping clean the contents of a server
-=====================================
-
-.. index:: object: memcached_st
-
-Wipe contents of memcached servers
-
-
---------
-SYNOPSIS
---------
-
-
-#include <libmemcached/memcached.h>
-
-.. c:function:: memcached_return_t memcached_flush (memcached_st *ptr, time_t expiration)
-
-Compile and link with -lmemcached
-
-
------------
-DESCRIPTION
------------
-
-
-:c:func::`memcached_flush` is used to wipe clean the contents of :program:`memcached` 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
-added.
-
-
-------
-RETURN
-------
-
-
-A value of type :c:type:`memcached_return_t` is returned
-On success that value will be :c:type:`MEMCACHED_SUCCESS`.
-Use :c:type:`memcached_strerror` to translate this value to a printable string.
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
-------
-AUTHOR
-------
-
-
-Brian Aker, <brian@tangent.org>
-
-
---------
-SEE ALSO
---------
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
+++ /dev/null
-=======================
-Flushing client buffers
-=======================
-
-
-.. index:: object: memcached_st
-
-Flush and senf buffered commands
-
---------
-SYNOPSIS
---------
-
-#include <libmemcached/memcached.h>
-
-.. c:function:: memcached_return_t memcached_flush_buffers (memcached_st *ptr)
-
-Compile and link with -lmemcached
-
-
------------
-DESCRIPTION
------------
-
-
-: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.
-
-
-------
-RETURN
-------
-
-
-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.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
-------
-AUTHOR
-------
-
-
-Brian Aker, <brian@tangent.org>
-
-Trond Norbye, <trond.norbye@gmail.com>
-
-
---------
-SEE ALSO
---------
-
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
+++ /dev/null
-===============================
-Generating hash values directly
-===============================
-
-.. index:: object: memcached_st
-
-Hash a key value
-
-
---------
-SYNOPSIS
---------
-
-
-#include <libmemcached/memcached.h>
-
-.. c:type:: memcached_hash_t
-
-.. c:function:: uint32_t memcached_generate_hash_value (const char *key, size_t key_length, memcached_hash_t hash_algorithm)
-
-.. c:function:: uint32_t memcached_generate_hash (memcached_st *ptr, const char *key, size_t key_length)
-
-.. 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_MURMUR
-
-.. c:type:: MEMCACHED_HASH_HSIEH
-
-.. c:type:: MEMCACHED_HASH_MURMUR3
-
-
-Compile and link with -lmemcachedutil -lmemcached
-
-
------------
-DESCRIPTION
------------
-
-
-: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
-:c:func:`memcached_behavior_set`.
-
-: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 :c:type:`memcached_st`.
-
-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.
-
-
-------
-RETURN
-------
-
-
-A 32-bit integer which is the result of hashing the given key.
-For 64-bit hash algorithms, only the least-significant 32 bits are
-returned.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
-------
-AUTHOR
-------
-
-
-Brian Aker, <brian@tangent.org>
-
-
---------
-SEE ALSO
---------
-
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
+++ /dev/null
-===============================
-Retrieving data from the server
-===============================
-
-.. index:: object: memcached_st
-
---------
-SYNOPSIS
---------
-
-
-#include <libmemcached/memcached.h>
-
-.. c:function:: memcached_result_st * memcached_fetch_result (memcached_st *ptr, memcached_result_st *result, memcached_return_t *error)
-
-.. c:function:: char * memcached_get (memcached_st *ptr, const char *key, size_t key_length, size_t *value_length, uint32_t *flags, memcached_return_t *error)
-
-.. c:function:: memcached_return_t memcached_mget (memcached_st *ptr, const char * const *keys, const size_t *key_length, size_t number_of_keys)
-
-.. c:function:: char * memcached_get_by_key (memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, size_t *value_length, uint32_t *flags, memcached_return_t *error)
-
-.. c:function:: memcached_return_t memcached_mget_by_key (memcached_st *ptr, const char *group_key, size_t group_key_length, const char * const *keys, const size_t *key_length, size_t number_of_keys)
-
-.. c:function:: memcached_return_t memcached_fetch_execute (memcached_st *ptr, memcached_execute_fn *callback, void *context, uint32_t number_of_callbacks)
-
-.. c:function:: memcached_return_t memcached_mget_execute (memcached_st *ptr, const char * const *keys, const size_t *key_length, size_t number_of_keys, memcached_execute_fn *callback, void *context, uint32_t number_of_callbacks)
-
-.. c:function:: memcached_return_t memcached_mget_execute_by_key (memcached_st *ptr, const char *group_key, size_t group_key_length, const char * const *keys, const size_t *key_length, size_t number_of_keys, memcached_execute_fn *callback, void *context, uint32_t number_of_callbacks)
-
-.. c:type:: memcached_return_t (*memcached_execute_fn)(const memcached_st *ptr, memcached_result_st *result, void *context)
-
-Compile and link with -lmemcached
-
-
------------
-DESCRIPTION
------------
-
-
-: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 :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.
-
-To retrieve data after a successful execution of :c:func:`memcached_mget`, you will need to
-call :c:func:`memcached_fetch_result`. You should continue to call this function until
-it returns a NULL (i.e. no more values). If you need to quit in the middle of a
-:c:func:`memcached_mget` call, you can execute a :c:func:`memcached_quit`, those this is not required.
-
-:c:func:`memcached_fetch_result` 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 :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:`MEMCACHED_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.
-
-: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 :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`.
-
-
-------
-RETURN
-------
-
-
-All objects retrieved via :c:func:`memcached_get` or :c:func:`memcached_get_by_key` must be freed with :manpage:`free(3)`.
-
-:c:func:`memcached_get` will return NULL on
-error. You must look at the value of error to determine what the actual error
-was.
-
-:c:func:`memcached_fetch_execute` return :c:type:`MEMCACHED_SUCCESS` if
-all keys were successful. :c:type:`MEMCACHED_NOTFOUND` will be return if no
-keys at all were found.
-
-:c:func:`memcached_fetch_result` sets error
-to :c:type:`MEMCACHED_END` upon successful conclusion.
-:c:type:`MEMCACHED_NOTFOUND` will be return if no keys at all were found.
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
---------
-SEE ALSO
---------
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
+++ /dev/null
-========================================
-Use custom allocators for embedded usage
-========================================
-
-.. index:: object: memcached_st
-
-Manage memory allocator functions
-
---------
-SYNOPSIS
---------
-
-
-#include <libmemcached/memcached.h>
-
-.. c:function:: memcached_return_t memcached_set_memory_allocators (memcached_st *ptr, memcached_malloc_fn mem_malloc, memcached_free_fn mem_free, memcached_realloc_fn mem_realloc, memcached_calloc_fn mem_calloc, void *context)
-
-.. c:function:: void memcached_get_memory_allocators (memcached_st *ptr, memcached_malloc_fn *mem_malloc, memcached_free_fn *mem_free, memcached_realloc_fn *mem_realloc, memcached_calloc_fn *mem_calloc)
-
-.. c:function:: void * memcached_get_memory_allocators_context(const memcached_st *ptr)
-
-.. c:function:: void * (*memcached_malloc_fn) (memcached_st *ptr, const size_t size, void *context)
-
-.. c:function:: void * (*memcached_realloc_fn) (memcached_st *ptr, void *mem, const size_t size, void *context)
-
-.. c:function:: void (*memcached_free_fn) (memcached_st *ptr, void *mem, void *context)
-
-.. c:function:: void * (*memcached_calloc_fn) (memcached_st *ptr, size_t nelem, const size_t elsize, void *context)
-
-Compile and link with -lmemcached
-
-
-
------------
-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.
-
-: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.
-
-:c:func:`memcached_get_memory_allocators` is used to get the currently used
-memory allocators by a mamcached handle.
-
-: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
-it in order to make use of any operation which would modify it.
-
-
------
-NOTES
------
-
-
-In version 0.38 all functions were modified to have a context void pointer
-passed to them. This was so that customer allocators could have their
-own space for memory.
-
-
-------
-RETURN
-------
-
-
-: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.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
---------
-SEE ALSO
---------
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
+++ /dev/null
-============================
-Working with memcached pools
-============================
-
---------
-SYNOPSIS
---------
-
-#include <libmemcached/memcached_pool.h>
-
-.. c:type:: memcached_pool_st
-
-.. c:function:: memcached_pool_st* memcached_pool(const char *option_string, size_t option_string_length)
-
-.. c:function:: memcached_pool_st* memcached_pool_create(memcached_st* mmc, int initial, int max)
-.. deprecated:: 0.46
- Use :c:func:`memcached_pool`
-
-.. c:function:: memcached_st* memcached_pool_destroy(memcached_pool_st* pool)
-
-.. c:function:: memcached_st* memcached_pool_pop(memcached_pool_st* pool, bool block, memcached_return_t *rc)
-.. deprecated:: 0.53
- Use :c:func:`memcached_pool_fetch`
-
-.. c:function:: memcached_st* memcached_pool_fetch(memcached_pool_st*, struct timespec* relative_time, memcached_return_t* rc)
-
-.. versionadded:: 0.53
- Synonym for memcached_pool_pop
-
-.. c:function:: memcached_return_t memcached_pool_push(memcached_pool_st* pool, memcached_st *mmc)
-.. deprecated:: 0.53
- Use :c:func:`memcached_pool_push`
-
-.. c:function:: memcached_return_t memcached_pool_release(memcached_pool_st* pool, memcached_st* mmc)
-.. versionadded:: 0.53
- Synonym for memcached_pool_push.
-
-.. c:function:: memcached_return_t memcached_pool_behavior_set(memcached_pool_st *pool, memcached_behavior_t flag, uint64_t data)
-
-.. c:function:: memcached_return_t memcached_pool_behavior_get(memcached_pool_st *pool, memcached_behavior_t flag, uint64_t *value)
-
-Compile and link with -lmemcachedutil -lmemcached
-
------------
-DESCRIPTION
------------
-
-
-: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 :doc:`libmemcached_configuration` for details on the format of the configuration string.
-
-: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..
-
-:c:func:`memcached_pool_fetch` is used to fetch a connection structure from the
-connection pool. The relative_time argument specifies if the function should
-block and wait for a connection structure to be available if we try
-to exceed the maximum size. You need to specify time in relative time.
-
-:c:func:`memcached_pool_release` is used to return a connection structure back to the pool.
-
-:c:func:`memcached_pool_behavior_get` and :c:func:`memcached_pool_behavior_set` is used to get/set behavior flags on all connections in the pool.
-
-Both :c:func:`memcached_pool_release` and :c:func:`memcached_pool_fetch` are thread safe.
-
-------
-RETURN
-------
-
-: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.
-
-: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).
-
-:c:func:`memcached_pool_release` returns :c:type:`MEMCACHED_SUCCESS` upon success.
-
-:c:func:`memcached_pool_behavior_get` and :c:func:`memcached_pool_behavior_get` returns :c:type:`MEMCACHED_SUCCESS` upon success.
-
-If any methods returns MEMCACHED_IN_PROGRESS then a lock on the pool could not be obtained. If any of the parameters passed to any of these functions is invalid, MEMCACHED_INVALID_ARGUMENTS will be returned.
-
-memcached_pool_fetch may return MEMCACHED_TIMEOUT if a timeout occurs while waiting for a free memcached_st. MEMCACHED_NOTFOUND if no memcached_st was available.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
-------
-AUTHOR
-------
-
-
-Brian Aker, <brian@tangent.org>
-
-Trond Norbye, <trond.norbye@gmail.com>
-
-
---------
-SEE ALSO
---------
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)` :manpage:`libmemcached_configuration(3)`
+++ /dev/null
-====================================
-Disconnecting a client from a server
-====================================
-
-.. index:: object: memcached_st
-
---------
-SYNOPSIS
---------
-
-#include <libmemcached/memcached.h>
-
-.. c:function:: void memcached_quit (memcached_st *ptr)
-
-Compile and link with -lmemcached
-
------------
-DESCRIPTION
------------
-
-
-: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 :c:func:`memcached_fetch`.
-
-
-------
-RETURN
-------
-
-
-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.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
-------
-AUTHOR
-------
-
-
-Brian Aker, <brian@tangent.org>
-
-
---------
-SEE ALSO
---------
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
+++ /dev/null
-========================
-Working with result sets
-========================
-
---------
-SYNOPSIS
---------
-
-#include <libmemcached/memcached_pool.h>
-
-.. c:type:: memcached_result_st
-
-.. c:function:: memcached_result_st * memcached_result_create (memcached_st *ptr, memcached_result_st *result)
-
-.. c:function:: void memcached_result_free (memcached_result_st *result)
-
-.. c:function:: const char * memcached_result_key_value (memcached_result_st *result)
-
-.. c:function:: size_t memcached_result_key_length (const memcached_result_st *result)
-
-.. c:function:: const char *memcached_result_value (memcached_result_st *ptr)
-
-.. c:function:: char *memcached_result_take_value (memcached_result_st *ptr)
-
-.. c:function:: size_t memcached_result_length (const memcached_result_st *ptr)
-
-.. c:function:: uint32_t memcached_result_flags (const memcached_result_st *result)
-
-.. c:function:: uint64_t memcached_result_cas (const memcached_result_st *result)
-
-.. c:function:: memcached_return_t memcached_result_set_value (memcached_result_st *ptr, const char *value, size_t length)
-
-.. c:function:: void memcached_result_set_flags (memcached_result_st *ptr, uint32_t flags)
-
-.. c:function:: void memcached_result_set_expiration (memcached_result_st *ptr, time_t)
-
-Compile and link with -lmemcachedutil -lmemcached
-
-
-
------------
-DESCRIPTION
------------
-
-
-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 :c:type:`memcached_result_st` has been encapsulated, you should
-not write code to directly access members of the structure.
-
-:c:func:`memcached_result_create` will either allocate memory for a
-:c:type:`memcached_result_st` or will initialize a structure passed to it.
-
-:c:func:`memcached_result_free` will deallocate any memory attached to the
-structure. If the structure was also allocated, it will deallocate it.
-
-:c:func:`memcached_result_key_value` returns the key value associated with the
-current result object.
-
-:c:func:`memcached_result_key_length` returns the key length associated with
-the current result object.
-
-:c:func:`memcached_result_value` returns the result value associated with the
-current result object.
-
-:c:func:`memcached_result_take_value` returns and hands over the result value
-associated with the current result object. You must call free() to release this
-value, unless you have made use of a custom allocator. Use of a custom
-allocator requires that you create your own custom free() to release it.
-
-:c:func:`memcached_result_length` returns the result length associated with
-the current result object.
-
-:c:func:`memcached_result_flags` returns the flags associated with the
-current result object.
-
-:c:func:`memcached_result_cas` returns the cas associated with the
-current result object. This value will only be available if the server
-tests it.
-
-: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.
-
-:c:func:`memcached_result_set_flags` takes a result structure and stores a new
-value for the flags field.
-
-:c:func:`memcached_result_set_expiration` 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
-heap allocated structures.
-
-
-------
-RETURN
-------
-
-
-Varies, see particular functions. All structures must have
-:c:func:`memcached_result_free` called on them for cleanup purposes. Failure
-to do this will result in leaked memory.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
---------
-SEE ALSO
---------
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
+++ /dev/null
-============
-SASL support
-============
-
-.. index:: object: memcached_st
-
-
---------
-SYNOPSIS
---------
-
-#include <libmemcached/memcached_pool.h>
-
-.. c:function:: void memcached_set_sasl_callbacks(memcached_st *ptr, const sasl_callback_t *callbacks)
-
-.. c:function:: const sasl_callback_t *memcached_get_sasl_callbacks(memcached_st *ptr)
-
-.. c:function:: memcached_return_t memcached_set_sasl_auth_data(memcached_st *ptr, const char *username, const char *password)
-
-.. c:function:: memcached_return_t memcached_destroy_sasl_auth_data(memcached_st *ptr)
-
-Compile and link with -lmemcached
-
-
-
------------
-DESCRIPTION
------------
-
-
-libmemcached(3) allows you to plug in your own callbacks function used by
-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.
-
-: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
-: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`.
-
-
-------
-RETURN
-------
-
-
-:c:func:`memcached_get_sasl_callbacks` returns the callbacks currently used by
-this memcached handle. :c:func:`memcached_set_sasl_auth_data` returns
-:c:type:`MEMCACHED_SUCCESS` upon success.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
-------
-AUTHOR
-------
-
-
-Brian Aker, <brian@tangent.org>
-
-Trond Norbye, <trond.norbye@gmail.com>
-
-
---------
-SEE ALSO
---------
-
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
+++ /dev/null
-=========================
-Managing lists of servers
-=========================
-
-
---------
-SYNOPSIS
---------
-
-
-
-#include <libmemcached/memcached.h>
-
-.. c:type:: const memcached_instance_st *
-
-.. c:type:: memcached_server_list_st
-
-.. c:type:: memcached_server_st
-
-.. c:function:: const const memcached_instance_st * memcached_server_list (memcached_st *ptr)
-
-.. c:function:: void memcached_server_list_free (memcached_server_list_st list)
-
-.. c:function:: memcached_server_list_st memcached_server_list_append (memcached_server_list_st list, const char *hostname, in_port_t port, memcached_return_t *error)
-
-.. c:function:: uint32_t memcached_server_list_count (memcached_server_list_st list)
-
-.. c:function:: const char *memcached_server_error (const memcached_instance_st * instance)
-
-.. c:function:: void memcached_server_error_reset (const memcached_instance_st * list)
-.. deprecated:: 0.39
-
-.. c:function:: void memcached_servers_parse ()
-.. deprecated:: 0.39
-
-Compile and link with -lmemcached
-
-
------------
-DESCRIPTION
------------
-
-
-libmemcached(3) operates on a list of hosts which are stored in
-: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!).
-
-: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.
-
-:c:func:`memcached_server_list_free` deallocates all memory associated with the array of :c:type:`memcached_server_st` that you passed to it.
-
-: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 :c:func:`memcached_servers_parse`, please see :c:func:`memcached`
-
-: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 :c:type:`memcached_server_list_st`. This was done for a style reason to help clean up some concepts in the code.
-
-
-------
-RETURN
-------
-
-
-Varies, see particular functions.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
-
---------
-SEE ALSO
---------
-
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
+++ /dev/null
-========================================================
-Manipulate the server information stored in memcached_st
-========================================================
-
---------
-SYNOPSIS
---------
-
-#include <libmemcached/memcached.h>
-
-.. c:type:: memcached_server_fn
-
-.. c:function:: uint32_t memcached_server_count (memcached_st *ptr)
-
-.. c:function:: memcached_return_t memcached_server_add (memcached_st *ptr, const char *hostname, in_port_t port)
-
-.. c:function:: memcached_return_t memcached_server_add_udp (memcached_st *ptr, const char *hostname, in_port_t port)
-
-.. c:function:: memcached_return_t memcached_server_add_unix_socket (memcached_st *ptr, const char *socket)
-
-.. c:function:: memcached_return_t memcached_server_push (memcached_st *ptr, const memcached_server_st *list)
-
-.. c:function:: const memcached_instance_st * memcached_server_by_key (memcached_st *ptr, const char *key, size_t key_length, memcached_return_t *error)
-
-.. c:function:: const memcached_instance_st * memcached_server_get_last_disconnect (const memcached_st *ptr)
-
-.. c:function:: memcached_return_t memcached_server_cursor(const memcached_st *ptr, const memcached_server_fn *callback, void *context, uint32_t number_of_callbacks)
-
-compile and link with -lmemcached
-
-
-
------------
-DESCRIPTION
------------
-
-
-:doc:`libmemcached` performs operations on a list of hosts. The order of
-these 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).
-
-: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 than :c:type:`MEMCACHED_MAX_HOST_LENGTH`.
-
-: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.
-
-:c:func:`memcached_server_by_key` allows you to provide a key and retrieve the
-server which would be used for assignment.
-
-: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.
-
-: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. :c:func:`memcached_server_cursor` is passed the original caller :c:type:`memcached_st` in its current state.
-
-
-------
-RETURN
-------
-
-
-Varies, see particular functions.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
---------
-SEE ALSO
---------
-
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
+++ /dev/null
-=========================================================
-Store, replace, add, or atomically add data to the server
-=========================================================
-
-.. index:: object: memcached_st
-
-
---------
-SYNOPSIS
---------
-
-
-#include <libmemcached/memcached.h>
-
-.. c:function:: memcached_return_t memcached_set (memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags)
-
-.. c:function:: memcached_return_t memcached_add (memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags)
-
-.. c:function:: memcached_return_t memcached_replace (memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags)
-
-.. c:function:: memcached_return_t memcached_set_by_key(memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags)
-
-.. c:function:: memcached_return_t memcached_add_by_key(memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags)
-
-.. c:function:: memcached_return_t memcached_replace_by_key(memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags)
-
-Compile and link with -lmemcached
-
-
------------
-DESCRIPTION
------------
-
-
-: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.
-
-: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.
-
-:c:func:`memcached_replace` replaces an object on the server. If the object is not found on the server an error occurs.
-
-: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.
-
-: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.
-
-: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, :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.
-
-
-------
-RETURN
-------
-
-
-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 :c:func:`memcached_replace` and :c:func:`memcached_add`, :c:type:`MEMCACHED_NOTSTORED` is a legitmate error in the case of a collision.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
---------
-SEE ALSO
---------
-
-
-:manpage:`memcached(1)` :manpage:`libmemached(3)` :manpage:`memcached_strerror(3)` :manpage:`memcached_prepend(3)` :manpage:`memcached_cas(3)` :manpage:`memcached_append(3)`
-
+++ /dev/null
-==================================================
-Working with statistical information from a server
-==================================================
-
-
-Get memcached statistics
-
-.. index:: object: memcached_st
-
-
---------
-SYNOPSIS
---------
-
-#include <libmemcached/memcached.h>
-
-.. c:type:: memcached_stat_st
-
-.. c:type:: memcached_return_t (*memcached_stat_fn)(const memcached_instance_st * server, const char *key, size_t key_length, const char *value, size_t value_length, void *context)
-
-.. c:function:: memcached_stat_st *memcached_stat (memcached_st *ptr, char *args, memcached_return_t *error)
-
-.. c:function:: memcached_return_t memcached_stat_servername (memcached_stat_st *stat, char *args, const char *hostname, in_port_t port)
-
-.. c:function:: char * memcached_stat_get_value (memcached_st *ptr, memcached_stat_st *stat, const char *key, memcached_return_t *error)
-
-.. c:function:: char ** memcached_stat_get_keys (memcached_st *ptr, memcached_stat_st *stat, memcached_return_t *error)
-
-.. c:function:: memcached_return_t memcached_stat_execute (memcached_st *memc, const char *args, memcached_stat_fn func, void *context)
-
-Compile and link with -lmemcached
-
------------
-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
-: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.
-
-: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.
-
-: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.
-
-: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.
-
-
-------
-RETURN
-------
-
-
-Varies, see particular functions.
-
-Any method returning a :c:type:`memcached_stat_st` expects you to free the
-memory allocated for it.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
-------
-AUTHOR
-------
-
-
-Brian Aker, <brian@tangent.org>
-
-
---------
-SEE ALSO
---------
-
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
-
+++ /dev/null
-================================================
-Coverting Errors, memcached_return_t, to strings
-================================================
-
-
-.. index:: object: memcached_st
-
---------
-SYNOPSIS
---------
-
-#include <libmemcached/memcached.h>
-
-.. c:function:: const char * memcached_strerror (memcached_st *ptr, memcached_return_t rc)
-
-Compile and link with -lmemcached
-
-
------------
-DESCRIPTION
------------
-
-
-: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.
-
-:c:type:`memcached_return_t` values are returned from nearly all libmemcached(3) functions.
-
-: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.
-
-
-------
-RETURN
-------
-
-
-:c:func:`memcached_strerror` returns a string describing a :c:type:`memcached_return_t` value.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
-
---------
-SEE ALSO
---------
-
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)`
-
+++ /dev/null
-==============================================
-Storing custom user information in the client.
-==============================================
-
-.. index:: object: memcached_st
-
-Manage user specific data
-
-
--------
-LIBRARY
--------
-
-
-C Client Library for memcached (libmemcached, -lmemcached)
-
-
---------
-SYNOPSIS
---------
-
-
-#include <libmemcached/memcached.h>
-
-.. c:function:: void *memcached_get_user_data (memcached_st *ptr)
-
-.. c:function:: void *memcached_set_user_data (memcached_st *ptr, void *data)
-
-Compile and link with -lmemcached
-
-
-
------------
-DESCRIPTION
------------
-
-
-libmemcached(3) allows you to store a pointer to a user specific data inside
-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.
-
-:c:func:`memcached_get_user_data` is used to retrieve the user specific data in the :c:type:`memcached_st` structure.
-
-
-------
-RETURN
-------
-
-
-:c:func:`memcached_set_user_data` returns the previous value of the user specific data.
-
-:c:func:`memcached_get_user_data` returns the current value uf the user specific data.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
---------
-SEE ALSO
---------
-
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)`
-
+++ /dev/null
-=================================
-Setting the verbosity of a server
-=================================
-
-.. index:: object: memcached_st
-
-Modifiy verbosity of servers
-
---------
-SYNOPSIS
---------
-
-#include <libmemcached/memcached.h>
-
-.. c:function:: memcached_return_t memcached_verbosity (memcached_st *ptr, uint32_t verbosity)
-
-Compile and link with -lmemcached
-
-
------------
-DESCRIPTION
------------
-
-
-:c:func:`memcached_verbosity` modifies the "verbosity" of the
-memcached(1) servers referenced in the :c:type:`memcached_st` parameter.
-
-
-------
-RETURN
-------
-
-
-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.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
---------
-SEE ALSO
---------
-
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
-
+++ /dev/null
-=======================================================
-Getting version information about the client and server
-=======================================================
-
-
---------
-SYNOPSIS
---------
-
-#include <libmemcached/memcached.h>
-
-.. c:function:: const char * memcached_lib_version (void)
-
-.. c:function:: memcached_return_t memcached_version (memcached_st *ptr)
-
-
-Compile and link with -lmemcached
-
-
-
------------
-DESCRIPTION
------------
-
-
-:c:func:`memcached_lib_version` is used to return a simple version string representing the libmemcached version (client library version, not server version)
-
-: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.
-
-
-------
-RETURN
-------
-
-
-:c:func:`memcached_lib_version` returns a string with the version of the libmemcached driver.
-
-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.
-
-
-----
-HOME
-----
-
-
-To find out more information please check:
-`http://libmemcached.org/ <http://libmemcached.org/>`_
-
-
---------
-SEE ALSO
---------
-
-
-:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`
-
+++ /dev/null
-=================
-Systemtap support
-=================
-
-By default on Linux libmemcached is compiled to support Systemtap. This enabled/disabled during compiles via the dtrace configure flag.
-
-Please see :manpage: `stapex` for more information about Systemtap.
+++ /dev/null
-================
-Required C types
-================
-
-.. highlightlang:: c
-
-Types
------
-
-C Types Used
-------------
-
-.. c:type:: bool
-
-.. c:type:: uint32_t
-
-.. c:type:: uint64_t
-
-.. c:type:: in_port_t
-
-.. c:type:: size_t
-
-.. c:type:: time_t
-
-.. c:type:: struct timespec
-
-.. c:type:: sasl_callback_t
+++ /dev/null
-==========
-Versioning
-==========
-
-Libmemcached is layed out by interface version. The 1.0 version would be found in: libmemcached-1.0/memcached.h
-
-The historic libmemcached/memcached.h includes libmemcached-1.0/memcached.h. For best practice you should include the version of libmemcacached that you used during development.
-
configure_file(configure.h.in configure.h @ONLY)
-install_public_headers(
- libhashkit-1.0
-
+install_public_headers(libhashkit-1.0
algorithm.h
basic_string.h
behavior.h
#pragma once
-#define MEMCACHED_MAXIMUM_INTEGER_DISPLAY_LENGTH 20
#define MEMCACHED_MAX_BUFFER 8196
-#define MEMCACHED_MAX_HOST_SORT_LENGTH 86 /* Used for Ketama */
#define MEMCACHED_MAX_KEY 251 /* We add one to have it null terminated */
-#define MEMCACHED_PREFIX_KEY_MAX_SIZE 128
+#define MEMCACHED_MAX_NAMESPACE 128
+
+#define MEMCACHED_MAX_HOST_SORT_LENGTH 86 /* Used for Ketama */
+#define MEMCACHED_MAX_INTEGER_DISPLAY_LENGTH 20
#define MEMCACHED_VERSION_STRING_LENGTH 24
+
+/* legacy */
+#define MEMCACHED_MAXIMUM_INTEGER_DISPLAY_LENGTH MEMCACHED_MAX_INTEGER_DISPLAY_LENGTH
+#define MEMCACHED_PREFIX_KEY_MAX_SIZE MEMCACHED_MAX_NAMESPACE
#include <climits>
#include <cstdio>
#include <cstdlib>
-#include <cstdlib>
#include <cstring>
#include <fcntl.h>
#include <getopt.h>
#endif
#include <sys/stat.h>
#include <sys/types.h>
-#include <sys/types.h>
-#include <sys/types.h>
#include <unistd.h>
find_package(FLEX)
-find_package(BISON)
+find_package(BISON 2.3)
+
+if(${BISON_VERSION} VERSION_GREATER_EQUAL 3.0)
+ set(BISON_WARNINGS -Wno-deprecated)
+endif()
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/csl)
bison_target(CSL_PARSER csl/parser.yy ${CMAKE_CURRENT_BINARY_DIR}/csl/parser.cc
DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/csl/parser.h
+ COMPILE_FLAGS ${BISON_WARNINGS}
)
flex_target(CSL_SCANNER csl/scanner.l ${CMAKE_CURRENT_BINARY_DIR}/csl/scanner.cc
DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/csl/scanner.h
return hashkit_get_function(&ptr->hashkit);
case MEMCACHED_BEHAVIOR_KETAMA_HASH:
- return hashkit_get_function(&ptr->hashkit);
+ return hashkit_get_distribution_function(&ptr->hashkit);
case MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS:
return ptr->flags.auto_eject_hosts;
typedef void* yyscan_t;
#endif
+#ifndef YYSTYPE
+# define YYSTYPE CONFIG_STYPE
+#endif
+
+#define config_tokentype int
+
#include "libmemcached/common.h"
#include "libmemcached/csl/server.h"
%}
-%define parse.error verbose
-%define api.pure
-%define api.prefix {config_}
-%define api.value.type {union CONFIG_STYPE}
+%require "2.3"
+
%debug
-%defines
+%error-verbose
+%verbose
%expect 0
+
+%pure-parser
+%name-prefix="config_"
+
%lex-param { yyscan_t *scanner }
%parse-param { class Context *context }
%parse-param { yyscan_t *scanner }
-%require "2.5"
%start begin
-%verbose
%{
}
memc.flags.verify_key= orig;
- if ((key_length > MEMCACHED_PREFIX_KEY_MAX_SIZE -1))
+ if ((key_length > MEMCACHED_MAX_NAMESPACE -1))
{
return memcached_set_error(memc, MEMCACHED_KEY_TOO_BIG, MEMCACHED_AT);
}