.. option:: --help
+.. envvar:: MEMCACHED_SERVERS
+
-----------
DESCRIPTION
-----------
connections in each thread. Each connection keeps key size distribution,
value size distribution, and command distribution by itself.
-You can specify servers via the :option:`--servers` option or via the
+You can specify servers via the :option:`memslap --servers` option or via the
environment variable :envvar:`MEMCACHED_SERVERS`.
.. option:: --help
+.. option:: --analyze
----
HOME
MEMCACHED_AUTH_CONTINUE
=======================
+.. c:type:: MEMCACHED_AUTH_CONTINUE
+
Authentication has been paused.
MEMCACHED_AUTH_FAILURE
======================
+.. c:type:: MEMCACHED_AUTH_FAILURE
+
The credentials provided are not valid for this server.
MEMCACHED_AUTH_PROBLEM
======================
+.. c:type:: MEMCACHED_AUTH_PROBLEM
+
An unknown issue has occured during authentication.
MEMCACHED_BAD_KEY_PROVIDED
==========================
+.. c:type:: MEMCACHED_BAD_KEY_PROVIDED
+
The key provided is not a valid key.
MEMCACHED_BUFFERED
==================
+.. c:type:: MEMCACHED_BUFFERED
+
The request has been buffered.
MEMCACHED_CLIENT_ERROR
======================
+.. c:type:: MEMCACHED_CLIENT_ERROR
+
An unknown client error has occured internally.
MEMCACHED_CONNECTION_BIND_FAILURE
=================================
+.. c:type:: MEMCACHED_CONNECTION_BIND_FAILURE
+.. deprecated:: <0.30
+
We were not able to bind() to the socket.
MEMCACHED_CONNECTION_FAILURE
============================
+.. c:type:: MEMCACHED_CONNECTION_FAILURE
+
A unknown error has occured while trying to connect to a server.
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.
MEMCACHED_DATA_DOES_NOT_EXIST
=============================
+.. c:type:: MEMCACHED_DATA_DOES_NOT_EXIST
+
The data requested with the key given was not found.
MEMCACHED_DATA_EXISTS
=====================
+.. c:type:: MEMCACHED_DATA_EXISTS
+
The data requested with the key given was not found.
MEMCACHED_DELETED
=================
+.. c:type:: MEMCACHED_DELETED
+
The object requested by the key has been deleted.
MEMCACHED_DEPRECATED
====================
+.. c:type:: MEMCACHED_DEPRECATED
+
The method that was requested has been deprecated.
MEMCACHED_E2BIG
===============
+.. c:type:: MEMCACHED_E2BIG
+
Item is too large for the server to store.
MEMCACHED_END
=============
+.. c:type:: MEMCACHED_END
+
The server has completed returning all of the objects requested.
MEMCACHED_ERRNO
===============
+.. c:type:: MEMCACHED_ERRNO
+
An error has occurred in the driver which has set errno.
MEMCACHED_FAILURE
=================
+.. c:type:: MEMCACHED_FAILURE
+.. deprecated:: <0.30
+
A unknown failure has occurred in the server.
MEMCACHED_FAIL_UNIX_SOCKET
==========================
+.. c:type:: MEMCACHED_FAIL_UNIX_SOCKET
+
A connection was not established with the server via a unix domain socket.
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.
MEMCACHED_HOST_LOOKUP_FAILURE
=============================
+.. c:type:: MEMCACHED_HOST_LOOKUP_FAILURE
+
A DNS failure has occurred.
MEMCACHED_INVALID_ARGUMENTS
===========================
+.. c:type:: MEMCACHED_INVALID_ARGUMENTS
+
The arguments supplied to the given function were not valid.
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.
MEMCACHED_ITEM
==============
+.. c:type:: MEMCACHED_ITEM
+
An item has been fetched (this is an internal error only).
MEMCACHED_KEY_TOO_BIG
=====================
+.. c:type:: MEMCACHED_KEY_TOO_BIG
+
The key that has been provided is too large for the given server.
MEMCACHED_MAXIMUM_RETURN
========================
+.. c:type:: MEMCACHED_MAXIMUM_RETURN
+
This in an internal only state.
MEMCACHED_MEMORY_ALLOCATION_FAILURE
===================================
+.. c:type:: MEMCACHED_MEMORY_ALLOCATION_FAILURE
+
An error has occurred while trying to allocate memory.
MEMCACHED_NOTFOUND
==================
+.. c:type:: MEMCACHED_NOTFOUND
+
The object requested was not found.
MEMCACHED_NOTSTORED
===================
+.. c:type:: MEMCACHED_NOTSTORED
+
The request to store an object failed.
MEMCACHED_NOT_SUPPORTED
=======================
+.. c:type:: MEMCACHED_NOT_SUPPORTED
+
The given method is not supported in the server.
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.
MEMCACHED_NO_SERVERS
====================
+.. c:type:: MEMCACHED_NO_SERVERS
+
No servers have been added to the memcached_st object.
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.
MEMCACHED_PARSE_USER_ERROR
==========================
+.. c:type:: MEMCACHED_PARSE_USER_ERROR
+
An error has occurred in parsing the configuration string.
MEMCACHED_PARTIAL_READ
======================
+.. c:type:: MEMCACHED_PARTIAL_READ
+
The read was only partcially successful.
MEMCACHED_PROTOCOL_ERROR
========================
+.. c:type:: MEMCACHED_PROTOCOL_ERROR
+
An unknown error has occurred in the protocol.
MEMCACHED_READ_FAILURE
======================
+.. c:type:: MEMCACHED_READ_FAILURE
+
A read failure has occurred.
MEMCACHED_SERVER_ERROR
======================
+.. c:type:: MEMCACHED_SERVER_ERROR
+
An unknown error has occurred in the server.
MEMCACHED_SERVER_MARKED_DEAD
============================
+.. c:type:: MEMCACHED_SERVER_MARKED_DEAD
+
The requested server has been marked dead.
MEMCACHED_SOME_ERRORS
=====================
+.. c:type:: MEMCACHED_SOME_ERRORS
+
A multi request has been made, and some underterminate number of errors have occurred.
MEMCACHED_STAT
==============
+.. c:type:: MEMCACHED_STAT
+
A "stat" command has been returned in the protocol.
MEMCACHED_STORED
================
+.. c:type:: MEMCACHED_STORED
+
The requested object has been successfully stored on the server.
MEMCACHED_SUCCESS
=================
+.. c:type:: MEMCACHED_SUCCESS
+
The request was successfully executed.
MEMCACHED_TIMEOUT
=================
+.. c:type:: MEMCACHED_TIMEOUT
+
Operation has timed out.
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.
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.
MEMCACHED_VALUE
===============
+.. c:type:: MEMCACHED_VALUE
+
A value has been returned from the server (this is an internal condition only).
MEMCACHED_WRITE_FAILURE
=======================
+.. c:type:: MEMCACHED_WRITE_FAILURE
+
An error has occured while trying to write to a server.
Creating a hashkit structure
============================
+.. highlightlang:: c
+
.. index:: object: hashkit_st
--------
.. c:type:: hashkit_st
-.. c:function:: hashkit_st *hashkit_create(hashkit_st *hash);
+.. c:function:: hashkit_st *hashkit_create(hashkit_st *hash)
-.. c:function:: hashkit_st *hashkit_clone(hashkit_st *destination, const hashkit_st *ptr);
+.. c:function:: hashkit_st *hashkit_clone(hashkit_st *destination, const hashkit_st *ptr)
-.. c:function:: void hashkit_free(hashkit_st *hash);
+.. c:function:: void hashkit_free(hashkit_st *hash)
-.. c:function:: bool hashkit_is_allocated(const hashkit_st *hash);
+.. c:function:: bool hashkit_is_allocated(const hashkit_st *hash)
Compile and link with -lhashkit
-----------
-The :c:func:`hashkit_create()` function initializes a hashkit object for use. If
+The :c:func:`hashkit_create` function initializes a hashkit object for use. If
you pass a NULL argument for hash, then the memory for the object is
allocated. If you specify a pre-allocated piece of memory, that is
initialized for use.
-The :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 :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_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
+The :c:func:`hashkit_is_allocated` reports where the memory was allocated
for a hashkit object.
------------
-:c:func:`hashkit_create()` and :c:func:`hashkit_clone()` will return NULL on
+: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.
+: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.
----
#include <libhashkit/hashkit.h>
-.. c:function:: uint32_t hashkit_default(const char *key, size_t key_length);
+.. 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_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_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_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_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_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_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_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_jenkins(const char *key, size_t key_length)
-.. c:function:: uint32_t hashkit_md5(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
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 hashkit_hsieh is only available if the library is built with
the appropriate flag enabled.
#include <libhashkit/hashkit.h>
-.. c:function:: uint32_t hashkit_value(hashkit_st *hash, const char *key, size_t key_length);
+.. 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
+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.
memcached_strerror
error_messages
memcached_user_data
- memcached_verbosity
- memcached_version
+ memcached_verbosity
+ memcached_version
+ libmemcached/defaults
##################
Interface Versions
:maxdepth: 1
tap
+ types
#################################
Deriving statistics from a server
===========================================
-memcached_touch(), memcached_touch_by_key()
+memcached_touch, memcached_touch_by_key
===========================================
.. index:: object: memcached_st
#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 (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);
+.. 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
-----------
-: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
+: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.
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
+Use :c:func:`memcached_strerror` to translate this value to a printable
string.
----
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.
+: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
+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()`.
+:c:type:`memcached_strerror`.
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.
AC_SUBST(DEPS_CFLAGS)
AC_SUBST(DEPS_LIBS)
-Some features of the library must be enabled through :c:func:`memcached_behavior_set()`.
+Some features of the library must be enabled through :c:func:`memcached_behavior_set`.
Hope you enjoy it!
A number of constants have been provided for in the library.
-.. c:var:: MEMCACHED_DEFAULT_PORT
+.. c:macro:: MEMCACHED_DEFAULT_PORT
The default port used by memcached(3).
-
-.. c:var:: MEMCACHED_MAX_KEY
+.. 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:var:: MEMCACHED_MAX_KEY
+.. c:macro:: MEMCACHED_MAX_KEY
Default size of key (which includes the null pointer).
-
-.. c:var:: MEMCACHED_STRIDE
+.. c:macro:: MEMCACHED_STRIDE
This is the "stride" used in the consistent hash used between replicas.
-
-.. c:var:: MEMCACHED_MAX_HOST_LENGTH
+.. c:macro:: MEMCACHED_MAX_HOST_LENGTH
Maximum allowed size of the hostname.
-.. c:var:: LIBMEMCACHED_VERSION_STRING
+.. c:macro:: LIBMEMCACHED_VERSION_STRING
String value of libmemcached version such as "1.23.4"
-.. c:var:: LIBMEMCACHED_VERSION_HEX
+.. c:macro:: LIBMEMCACHED_VERSION_HEX
Hex value of the version number. "0x00048000" This can be used for comparing versions based on number.
+.. c:macro:: MEMCACHED_PREFIX_KEY_MAX_SIZE
+
+ Maximum length allowed for namespacing of a key.
+
---------------------
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.
+you can call :c:func:`memcached_quit` on a :c:type:`memcached_st` and then use the resulting cloned structure.
----
--- /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
=================
-memcached_fetch()
+memcached_fetch
=================
.. index:: object: memcached_st
.. 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)
.. deprecated:: 0.50
- Use :c:func:`memcached_fetch_result()` instead.
+ Use :c:func:`memcached_fetch_result` instead.
Compile and link with -lmemcached
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.
+: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:`MEMCACHD_END` is returned by the \*error value when all objects that have been found are returned. The final value upon :c:type:`MEMCACHED_END` is null.
+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.
-Values returned by :c:func:`memcached_fetch()` must be freed by the caller.
+Values returned by :c:func:`memcached_fetch` must be freed by the caller.
All of the above functions are not tested when the
:c:type:`MEMCACHED_BEHAVIOR_USE_UDP` has been set. Executing any of these
RETURN
------
-:c:func:`memcached_fetch()` sets error to
+: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.
-:c:type:`MEMCACHED_KEY_TOO_BIG` is set to error whenever :c::func:`memcached_fetch()` was used
+: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.
#include <libmemcached/memcached.h>
-.. c:function:: const char *memcached_last_error_message(memcached_st *);
+.. 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
+: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
+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.
----
.. c:type:: memcached_return_t
-.. c:function:: const char *libmemcached_strerror(libmemcached_return_t rc)
+.. c:function:: const char *libmemcached_strerror(memcached_return_t rc)
-.. c:function:: bool libmemcached_success(libmemcached_return_t rc)
+.. c:function:: bool libmemcached_success(memcached_return_t rc)
-.. c:function:: bool libmemcached_failure(libmemcached_return_t rc)
+.. c:function:: bool libmemcached_failure(memcached_return_t rc)
-.. c:function:: bool libmemcache_continue(libmemcached_return_t rc)
+.. c:function:: bool libmemcache_continue(memcached_return_t rc)
+.. c:function:: bool memcached_success(memcached_return_t)
+.. c:function:: bool memcached_failure(memcached_return_t)
-:c:func:`memcached_success()` return true if :c:type:`MEMCACHED_SUCCESS` tested true.
-:c:func:`memcached_failure()` return true if any value other then :c:type:`MEMCACHED_SUCCESS` was provided.
+:c:func:`memcached_success` return true if :c:type:`MEMCACHED_SUCCESS` tested true.
+
+:c:func:`memcached_failure` return true if any value other then :c:type:`MEMCACHED_SUCCESS` was provided.
Libmemcached return types:
++++++++++++++++++++++++++
-.. c:type:: MEMCACHED_SUCCESS
-
-Success
-
-.. c:type:: MEMCACHED_FAILURE
+:c:type:`MEMCACHED_SUCCESS`
-.. c:type:: MEMCACHED_HOST_LOOKUP_FAILURE
+:c:type:`MEMCACHED_FAILURE`
-.. c:type:: MEMCACHED_CONNECTION_FAILURE
+:c:type:`MEMCACHED_HOST_LOOKUP_FAILURE`
-.. c:type:: MEMCACHED_CONNECTION_BIND_FAILURE
-.. deprecated:: <0.30
+:c:type:`MEMCACHED_CONNECTION_FAILURE`
-.. c:type:: MEMCACHED_WRITE_FAILURE
+:c:type:`MEMCACHED_CONNECTION_BIND_FAILURE`
-.. c:type:: MEMCACHED_READ_FAILURE
+:c:type:`MEMCACHED_WRITE_FAILURE`
-.. c:type:: MEMCACHED_UNKNOWN_READ_FAILURE
+:c:type:`MEMCACHED_READ_FAILURE`
-.. c:type:: MEMCACHED_PROTOCOL_ERROR
+:c:type:`MEMCACHED_UNKNOWN_READ_FAILURE`
-.. c:type:: MEMCACHED_CLIENT_ERROR
+:c:type:`MEMCACHED_PROTOCOL_ERROR`
-.. c:type:: MEMCACHED_SERVER_ERROR
+:c:type:`MEMCACHED_CLIENT_ERROR`
-.. c:type:: MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE
-.. deprecated:: <0.30
+:c:type:`MEMCACHED_SERVER_ERROR`
-.. c:type:: MEMCACHED_DATA_EXISTS
+:c:type:`MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE`
-.. c:type:: MEMCACHED_DATA_DOES_NOT_EXIST
+:c:type:`MEMCACHED_DATA_EXISTS`
-.. c:type:: MEMCACHED_NOTSTORED
+:c:type:`MEMCACHED_DATA_DOES_NOT_EXIST`
-.. c:type:: MEMCACHED_STORED
+:c:type:`MEMCACHED_NOTSTORED`
-.. c:type:: MEMCACHED_NOTFOUND
+:c:type:`MEMCACHED_STORED`
-.. c:type:: MEMCACHED_MEMORY_ALLOCATION_FAILURE
+:c:type:`MEMCACHED_NOTFOUND`
-.. c:type:: MEMCACHED_PARTIAL_READ
+:c:type:`MEMCACHED_MEMORY_ALLOCATION_FAILURE`
-.. c:type:: MEMCACHED_SOME_ERRORS
+:c:type:`MEMCACHED_PARTIAL_READ`
-.. c:type:: MEMCACHED_NO_SERVERS
+:c:type:`MEMCACHED_SOME_ERRORS`
-.. c:type:: MEMCACHED_END
+:c:type:`MEMCACHED_NO_SERVERS`
-.. c:type:: MEMCACHED_DELETED
+:c:type:`MEMCACHED_END`
-.. c:type:: MEMCACHED_VALUE
+:c:type:`MEMCACHED_DELETED`
-.. c:type:: MEMCACHED_STAT
+:c:type:`MEMCACHED_VALUE`
-.. c:type:: MEMCACHED_ITEM
+:c:type:`MEMCACHED_STAT`
-.. c:type:: MEMCACHED_ERRNO
+:c:type:`MEMCACHED_ITEM`
-.. c:type:: MEMCACHED_FAIL_UNIX_SOCKET
-.. deprecated:: <0.30
+:c:type:`MEMCACHED_ERRNO`
-.. c:type:: MEMCACHED_NOT_SUPPORTED
+:c:type:`MEMCACHED_FAIL_UNIX_SOCKET`
-.. c:type:: MEMCACHED_NO_KEY_PROVIDED
-.. deprecated:: <0.30
- Use :c:type:`MEMCACHED_BAD_KEY_PROVIDED` instead.
+:c:type:`MEMCACHED_NOT_SUPPORTED`
-.. c:type:: MEMCACHED_FETCH_NOTFINISHED
+:c:type:`MEMCACHED_NO_KEY_PROVIDED`
-.. c:type:: MEMCACHED_TIMEOUT
+:c:type:`MEMCACHED_FETCH_NOTFINISHED`
- Connection to server timed out.
+:c:type:`MEMCACHED_TIMEOUT`
-.. c:type:: MEMCACHED_BUFFERED
+:c:type:`MEMCACHED_BUFFERED`
-.. c:type:: MEMCACHED_BAD_KEY_PROVIDED
+:c:type:`MEMCACHED_BAD_KEY_PROVIDED`
-.. c:type:: MEMCACHED_INVALID_HOST_PROTOCOL
+:c:type:`MEMCACHED_INVALID_HOST_PROTOCOL`
-.. c:type:: MEMCACHED_SERVER_MARKED_DEAD
+:c:type:`MEMCACHED_SERVER_MARKED_DEAD`
-.. c:type:: MEMCACHED_UNKNOWN_STAT_KEY
+:c:type:`MEMCACHED_UNKNOWN_STAT_KEY`
-.. c:type:: MEMCACHED_E2BIG
+:c:type:`MEMCACHED_E2BIG`
-.. c:type:: MEMCACHED_INVALID_ARGUMENTS
+:c:type:`MEMCACHED_INVALID_ARGUMENTS`
-.. c:type:: MEMCACHED_KEY_TOO_BIG
+:c:type:`MEMCACHED_KEY_TOO_BIG`
-.. c:type:: MEMCACHED_AUTH_PROBLEM
+:c:type:`MEMCACHED_AUTH_PROBLEM`
-.. c:type:: MEMCACHED_AUTH_FAILURE
+:c:type:`MEMCACHED_AUTH_FAILURE`
-.. c:type:: MEMCACHED_AUTH_CONTINUE
+:c:type:`MEMCACHED_AUTH_CONTINUE`
-.. c:type:: MEMCACHED_PARSE_ERROR
+:c:type:`MEMCACHED_PARSE_ERROR`
-.. c:type:: MEMCACHED_PARSE_USER_ERROR
+:c:type:`MEMCACHED_PARSE_USER_ERROR`
-.. c:type:: MEMCACHED_DEPRECATED
+:c:type:`MEMCACHED_DEPRECATED`
--------
SEE ALSO
--------
-:manpage:`memcached(8)` :manpage:`libmemcached(3)` :manpage:`memcached_client_error()` or :manpage:`memcached_worker_error()`
+:manpage:`memcached` :manpage:`libmemcached` :manpage:`memcached_client_error` or :manpage:`memcached_worker_error`
In the above code you create a :c:type:`memcached_st` object with three server
-by making use of :c:func:`memcached_create_with_options()`.
+by making use of :c:func:`memcached_create`.
--------------------------
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()`.
+implementation. see :c:func:`memcached_pool_create`.
----
#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);
+.. c:function:: memcached_analysis_st * memcached_analyze (memcached_st *ptr, memcached_stat_st *stat, memcached_return_t *error)
Compile and link with -lmemcached
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
+: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, :c:func:`memstat()` with the option :option:`--analyze`,
+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.
.. 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_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);
+.. 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
-----------
-:c:func:`memcached_prepend()` and memcached_append are used to
+: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
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
+: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
+: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_by_key()` methods both behave in a similar
+: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
+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
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
+Use :c:func:`memcached_strerror` to translate this value to a printable
string.
#include <libmemcached/memcached.h>
-.. c:function:: memcached_return_t memcached_increment (memcached_st *ptr, const char *key, size_t key_length, unsigned int offset, uint64_t *value);
+.. 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, unsigned int 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_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_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, unsigned int offset, 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, unsigned int 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_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);
+.. 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
(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 unsigned int
+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 unsigned int
+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
+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 unsigned int
+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() takes a key and keylength and decrements
+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 unsigned int
+flags will be set to zero.The value is then returned via the uint32_t
value pointer you pass to it.
-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.
+: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.
------
------
-A value of type \ ``memcached_return_t``\ is returned.
-On success that value will be \ ``MEMCACHED_SUCCESS``\ .
-Use memcached_strerror() to translate this value to a printable string.
+A value of type :c:type:`memcached_return_t` is returned.
+On success that value will be :c:type:`MEMCACHED_SUCCESS`.
+Use memcached_strerror to translate this value to a printable string.
----
#include <libmemcached/memcached.h>
+
+.. c:type:: memcached_behavior_t
-.. c:function:: uint64_t memcached_behavior_get (memcached_st *ptr, memcached_behavior flag);
+.. 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 flag, uint64_t data);
+.. 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
+: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
+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_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
+: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: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_value_fetch()`.
+:c:type:`MEMCACHED_NOT_SUPPORTED` when executed with the
+:c:type:`MEMCACHED_BEHAVIOR_USE_UDP` enabled: :c:func:`memcached_version`,
+:c:func:`memcached_stat`, :c:func:`memcached_get`,
+:c:func:`memcached_get_by_key`, :c:func:`memcached_mget`,
+:c:func:`memcached_mget_by_key`, :c:func:`memcached_fetch`,
+:c:func:`memcached_fetch_result`, :c:func:`memcached_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
.. c:type:: MEMCACHED_BEHAVIOR_KETAMA
-Sets the default distribution to MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA and the hash to MEMCACHED_HASH_MD5.
+Sets the default distribution to MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA and
+the hash to :c:type:`MEMCACHED_HASH_MD5`.
.. c:type:: MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED
.. c:type:: MEMCACHED_BEHAVIOR_KETAMA_HASH
-Sets the hashing algorithm for host mapping on continuum. The value can be set to either MEMCACHED_HASH_DEFAULT, MEMCACHED_HASH_MD5, MEMCACHED_HASH_CRC, MEMCACHED_HASH_FNV1_64, MEMCACHED_HASH_FNV1A_64, MEMCACHED_HASH_FNV1_32, and MEMCACHED_HASH_FNV1A_32.
+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
.. c:type:: MEMCACHED_BEHAVIOR_POLL_TIMEOUT
-Modify the timeout value that is used by poll(). The default value is -1. An signed int pointer must be passed to memcached_behavior_set() to change this value. For memcached_behavior_get() a signed int value will be cast and returned as the unsigned long long.
+Modify the timeout value that is used by poll. The default value is -1. An signed int pointer must be passed to memcached_behavior_set to change this value. 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
------
-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()
+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.
-----
-memcached_behavior_set() in version .17 was changed from taking a pointer
+memcached_behavior_set in version .17 was changed from taking a pointer
to data value, to taking a uin64_t.
--------
#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:: 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);
+.. c:function:: void * memcached_callback_get (memcached_st *ptr, memcached_callback_t flag, memcached_return_t *error)
Compile and link with -lmemcached
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_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
+: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
.. c:type:: MEMCACHED_CALLBACK_CLEANUP_FUNCTION
-When :c:func:`memcached_delete()` is called this function will be excuted. At
+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.
+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
.. 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:type:`MEMCACHED_PREFIX_KEY_MAX_SIZE - 1` and will
-reduce :c:type:`MEMCACHED_MAX_KEY` by the value of your key.
+The value specified here will be prefixed to each of your keys. The value can
+not be greater then :c: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
.. 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
+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
------
-:c:func:`memcached_callback_get()` return the function or structure that was
+: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
+:c:func:`memcached_callback_set` returns :c:type:`MEMCACHED_SUCCESS` upon
successful setting, otherwise :c:type:`MEMCACHED_FAILURE` on error.
#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(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);
+.. 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"
+: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)
+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_set` for information on how to do this.
-:c:func:`memcached_cas_by_key()` method behaves in a similar method as the non
-key methods. The difference is that it uses the :c:type:`group_key` parameter
+: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
+: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
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
+Use :c:func:`memcached_strerror` to translate this value to a printable
string.
#include <libmemcached/memcached.h>
-.. c:type:: memcachd_st
+.. c:type:: memcached_st
.. c:function:: memcached_st* memcached_create(memcached_st *ptr)
DESCRIPTION
-----------
-:c:func:`memcached_create()` is used to create a :c:type:`memcached_st`
+: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
+: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_create_with_options()` over
-:c:func:`memcached_create()`.
+:c:func:`memcached` over
+:c:func:`memcached_create`.
-:c:func:`memcached_clone()` is similar to :c:func:`memcached_create()` but
+: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()`.
+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
+: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
+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
------
-:c:func:`memcached_create()` returns a pointer to the :c:type:`memcached_st`
+: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`
+: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.
#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 (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);
+.. 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
-----------
-: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
+: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
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
+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
#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:function:: memcached_return_t memcached_dump (memcached_st *ptr, memcached_dump_fn *function, void *context, uint32_t number_of_callbacks)
-.. c:function:: typedef memcached_return_t (*memcached_dump_fn)(memcached_st *ptr, const char *key, size_t key_length, void *context);
+.. 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
-----------
-:c:func:`memcached_dump()` is used to get a list of keys found in memcached(1)
+: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.
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
+Use :c:func:`memcached_strerror` to translate this value to a printable
string.
#include <libmemcached/memcached.h>
-.. c:function:: memcached_return_t memcached_flush (memcached_st *ptr, time_t expiration);
+.. c:function:: memcached_return_t memcached_flush (memcached_st *ptr, time_t expiration)
Compile and link with -lmemcached
-----------
-:c:func::`memcached_flush()` is used to wipe clean the contents of :program:`memcached` servers.
+: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
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.
+Use :c:type:`memcached_strerror` to translate this value to a printable string.
----
HOME
#include <libmemcached/memcached.h>
-.. c:function:: memcached_return_t memcached_flush_buffers (memcached_st *ptr);
+.. c:function:: memcached_return_t memcached_flush_buffers (memcached_st *ptr)
Compile and link with -lmemcached
-----------
-:c:func:`memcached_flush_buffers()` is used in conjunction with
+:c:func:`memcached_flush_buffers` is used in conjunction with
:c:type:`MEMCACHED_BEHAVIOR_BUFFER_REQUESTS` (see memcached_behavior(3)) to flush all buffers by sending the buffered commands to the server for processing.
A value of type :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
+Use :c:func:`memcached_strerror` to translate this value to a printable
string.
#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_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:function:: uint32_t memcached_generate_hash (memcached_st *ptr, const char *key, size_t key_length);
Compile and link with -lmemcachedutil -lmemcached
-----------
-:c:func:`memcached_generate_hash_value()` allows you to hash a key using one of
+:c:func:`memcached_generate_hash_value` allows you to hash a key using one of
the hash functions defined in the library. This method is provided for
the convenience of higher-level language bindings and is not necessary
for normal memcache operations.
The allowed hash algorithm constants are listed in the manpage for
-:c:func:`memcached_behavior_set()`.
+:c:func:`memcached_behavior_set`.
-:c:func:`memcached_generate_hash()` takes a :c:type:`memcached_st` struture
+:c:func:`memcached_generate_hash` takes a :c:type:`memcached_st` struture
and produces the hash value that would have been generated based on the
-defaults of the :c:type:`memcached_st structure`.
+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.
.. 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
-----------
-:c:func:`memcached_get()` is used to fetch an individual value from the server.
+: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
+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
+: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
+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_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.
+: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:`MEMCACHD_END` is returned by the \*error value when all objects that have been found are returned. The final value upon :c:type:`MEMCACHED_END` is null.
+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
+: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.
+: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
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
+: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
+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()`
+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()`.
+: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 objects retrieved via :c:func:`memcached_get()` or :c:func:`memcached_get_by_key()` must be freed with :manpage:`free(3)`.
+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
+: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
+: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
+: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.
#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:: 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 (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_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_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_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_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);
+.. c:function:: void * (*memcached_calloc_fn) (memcached_st *ptr, size_t nelem, const size_t elsize, void *context)
Compile and link with -lmemcached
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
+: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
+: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()`.
+: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
------
-:c:func:`memcached_set_memory_allocators()` return :c:type:`MEMCACHED_SUCCESS`
+: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.
.. c:function:: memcached_pool_st* memcached_pool_create(memcached_st* mmc, int initial, int max)
.. deprecated:: 0.46
- Use :c:func:`memcached_pool()`
+ 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()`
+ Use :c:func:`memcached_pool_fetch`
-.. c:function:: memcached_st* memcached_pool_fetch(memcached_pool_st*, struct timespec* relative_time, memcached_return_t* rc);
+.. 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()
+ 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()`
+ Use :c:func:`memcached_pool_push`
-.. c:function:: memcached_return_t memcached_pool_release(memcached_pool_st* pool, memcached_st* mmc);
+.. c:function:: memcached_return_t memcached_pool_release(memcached_pool_st* pool, memcached_st* mmc)
.. versionadded:: 0.53
- Synonym for memcached_pool_push().
+ 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:func:`memcached_pool()` is used to create a connection pool of objects you
+: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
+: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..
+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
+: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_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.
+: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.
+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_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_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_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.
+: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.
+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.
----
#include <libmemcached/memcached.h>
-.. c:function:: void memcached_quit (memcached_st *ptr);
+.. c:function:: void memcached_quit (memcached_st *ptr)
Compile and link with -lmemcached
-----------
-: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.
+: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()`.
+reset connections during the middle of a :c:func:`memcached_fetch`.
------
------
-A value of type :c:type:`memcached_return` is returned
-On success that value will be :c:type:`MEMCACHED_SUCCESS`.
-Use :c:func:`memcached_strerror()` to translate this value to a printable string.
+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.
----
.. c:type:: memcached_result_st
-.. c:function:: memcached_result_st * memcached_result_create (memcached_st *ptr, memcached_result_st *result);
+.. 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:: void memcached_result_free (memcached_result_st *result)
-.. c:function:: const char * memcached_result_key_value (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:: size_t memcached_result_key_length (const memcached_result_st *result)
-.. c:function:: const char *memcached_result_value (memcached_result_st *ptr);
+.. c:function:: const char *memcached_result_value (memcached_result_st *ptr)
-.. c:function:: size_t memcached_result_length (const 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:: 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)
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: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
+: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
+: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
+: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
+:c:func:`memcached_result_value` returns the result value associated with the
current result object.
-:c:func:`memcached_result_length()` returns the result length associated with
+: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
+: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
+: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
+: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:`void memcached_result_set_flags()` takes a result structure and stores
-a new value for the flags field.
+:c:func:`memcached_result_set_flags` takes a result structure and stores a new
+value for the flags field.
-:c:func:`void memcached_result_set_expiration(A)` takes a result structure and stores a new value for the expiration field (this is only used by read
-through triggers).
+: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
Varies, see particular functions. All structures must have
-:c:func:`memcached_result_free()` called on them for cleanup purposes. Failure
+:c:func:`memcached_result_free` called on them for cleanup purposes. Failure
to do this will result in leaked memory.
.. c:function:: const sasl_callback_t *memcached_get_sasl_callbacks(memcached_st *ptr)
-.. c:function:: memcached_return memcached_set_sasl_auth_data(memcached_st *ptr, const char *username, const char *password)
+.. c:function:: memcached_return_t memcached_set_sasl_auth_data(memcached_st *ptr, const char *username, const char *password)
-.. c:function:: memcached_return memcached_destroy_sasl_auth_data(memcached_st *ptr)
+.. c:function:: memcached_return_t memcached_destroy_sasl_auth_data(memcached_st *ptr)
Compile and link with -lmemcached
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
+: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()`.
-
-You as a client user have to initialize libsasl by using :c:type:`sasl_client_init` before enabling it in libmemcached, and you have to shut down libsasl by
-calling :c:func:`sasl_done()` when you are done using SASL from libmemcached.
+function with :c:func:`memcached_set_sasl_callbacks`.
------
------
-:c:func:`memcached_get_sasl_callbacks()` returns the callbacks currently used
-by this memcached handle. :c:func:`memcached_get_sasl_set_auth_data()` returns :c:type:`MEMCACHED_SUCCESS` upon success.
+: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.
----
.. c:type:: memcached_server_instance_st
+.. c:type:: memcached_server_list_st
+
+.. c:type:: memcached_server_st
+
.. c:function:: const memcached_server_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, unsigned int port, memcached_return_t *error)
+.. 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:: void memcached_server_error_reset (memcached_server_instance_st list)
.. deprecated:: 0.39
+.. c:function:: void memcached_servers_parse ()
+.. deprecated:: 0.39
Compile and link with -lmemcached
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` 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_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: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()`
+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.
+: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.
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
+: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
+: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
+: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.
+: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
+: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
+: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
+: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
+: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 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.
------
#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_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_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_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_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_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);
+.. 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
-----------
-: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
+: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
+: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_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_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"
+: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
+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
+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
+: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.
+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.
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.
+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.
+For :c:func:`memcached_replace` and :c:func:`memcached_add`, :c:type:`MEMCACHED_NOTSTORED` is a legitmate error in the case of a collision.
----
#include <libmemcached/memcached.h>
-.. c:function:: memcached_stat_st *memcached_stat (memcached_st *ptr, char *args, memcached_return_t *error);
+.. c:type:: memcached_stat_st
-.. c:function:: memcached_return_t memcached_stat_servername (memcached_stat_st *stat, char *args, const char *hostname, unsigned int port);
+.. c:type:: memcached_return_t (*memcached_stat_fn)(memcached_server_instance_st server, const char *key, size_t key_length, const char *value, size_t value_length, void *context)
-.. c:function:: char * memcached_stat_get_value (memcached_st *ptr, memcached_stat_st *stat, const char *key, memcached_return_t *error);
+.. c:function:: memcached_stat_st *memcached_stat (memcached_st *ptr, char *args, 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_servername (memcached_stat_st *stat, char *args, const char *hostname, in_port_t port)
-.. c:function:: memcached_return_t memcached_stat_execute (memcached_st *memc, const char *args, memcached_stat_fn func, void *context);
+.. 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
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: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
+: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` 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
+: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_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.
+: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.
#include <libmemcached/memcached.h>
-.. c:function:: const char * memcached_strerror (memcached_st *ptr, memcached_return_t rc);
+.. c:function:: const char * memcached_strerror (memcached_st *ptr, memcached_return_t rc)
Compile and link with -lmemcached
-----------
-:c:func:`memcached_strerror()` takes a :c:type:`memcached_return_t` value and returns a string describing the error.
+:c:func:`memcached_strerror` takes a :c:type:`memcached_return_t` value and returns a string describing the error.
This string must not be modified by the application.
------
-:c:func:`memcached_strerror()` returns a string describing a :c:type:`memcached_return_t` value.
+:c:func:`memcached_strerror` returns a string describing a :c:type:`memcached_return_t` value.
----
-.. code-block:: perl
+.. code-block:: c
- #include <libmemcached/memcached.h>
-
- void *memcached_get_user_data (memcached_st *ptr);
-
- void *memcached_set_user_data (memcached_st *ptr, void *data);
+#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
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: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.
+:c:func:`memcached_get_user_data` is used to retrieve the user specific data in the :c:type:`memcached_st` structure.
------
------
-:c:func:`memcached_set_user_data()` returns the previous value of the user specific data.
+:c:func:`memcached_set_user_data` returns the previous value of the user specific data.
-:c:func:`memcached_get_user_data()` returns the current value uf the user specific data.
+:c:func:`memcached_get_user_data` returns the current value uf the user specific data.
----
#include <libmemcached/memcached.h>
-.. c:function:: memcached_return_t memcached_verbosity (memcached_st *ptr, unsigned int verbosity);
+.. c:function:: memcached_return_t memcached_verbosity (memcached_st *ptr, uint32_t verbosity)
Compile and link with -lmemcached
-----------
-:c:func:`memcached_verbosity()` modifies the "verbosity" of the
+:c:func:`memcached_verbosity` modifies the "verbosity" of the
memcached(1) servers referenced in the :c:type:`memcached_st` parameter.
On success that value will be :c:type:`MEMCACHED_SUCCESS`.
-Use :c:func:`memcached_strerror()` to translate this value to a printable string.
+Use :c:func:`memcached_strerror` to translate this value to a printable string.
----
-----------
-: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_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.
+: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.
------
------
-:c:func:`memcached_lib_version()` returns a string with the version of the libmemcached driver.
+: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()'
+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
+Use :c:func:`memcached_strerror` to translate this value to
a printable string.
--- /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
Versioning
==========
-Libmemcached is layed out by interface version. The 1.0 version would be found in:
- libmemcached-1.0/memcached.h
+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.
/**
* This file contains an implementation of the callback interface for level 1
* in the protocol library. If you compare the implementation with the one
- * in interface_v0.c you will see that this implementation is much easier and
+ * in interface_v0.cc you will see that this implementation is much easier and
* hides all of the protocol logic and let you focus on the application
* logic. One "problem" with this layer is that it is synchronous, so that
* you will not receive the next command before a answer to the previous
* With that in mind, let me give you some pointers into the source:
* storage.c/h - Implements the item store for this server and not really
* interesting for this example.
- * interface_v0.c - Shows an implementation of the memcached server by using
+ * interface_v0.cc - Shows an implementation of the memcached server by using
* the "raw" access to the packets as they arrive
- * interface_v1.c - Shows an implementation of the memcached server by using
+ * interface_v1.cc - Shows an implementation of the memcached server by using
* the more "logical" interface.
- * memcached_light.c - This file sets up all of the sockets and run the main
+ * memcached_light.cc- This file sets up all of the sockets and run the main
* message loop.
*
*
* the library)
*/
-#include "config.h"
+#include <config.h>
#include <libmemcachedprotocol-0.0/handler.h>
#include <libmemcached/socket.hpp>
AS_IF([test "$ac_cv_warnings_as_errors" = "yes"],[
W_FAIL="-Werror"
- SPHINX_WARNINGS="-W"
+ SPHINX_WARNINGS="-W -n"
INTLTOOL_WARNINGS="yes"
])