--- /dev/null
+=======================
+MEMCACHED_AUTH_CONTINUE
+=======================
+
+Authentication has been paused.
--- /dev/null
+======================
+MEMCACHED_AUTH_FAILURE
+======================
+
+The credentials provided are not valid for this server.
--- /dev/null
+======================
+MEMCACHED_AUTH_PROBLEM
+======================
+
+An unknown issue has occured during authentication.
--- /dev/null
+==========================
+MEMCACHED_BAD_KEY_PROVIDED
+==========================
+
+The key provided is not a valid key.
--- /dev/null
+==================
+MEMCACHED_BUFFERED
+==================
+
+The request has been buffered.
--- /dev/null
+======================
+MEMCACHED_CLIENT_ERROR
+======================
+
+An unknown client error has occured internally.
--- /dev/null
+=================================
+MEMCACHED_CONNECTION_BIND_FAILURE
+=================================
+
+We were not able to bind() to the socket.
--- /dev/null
+============================
+MEMCACHED_CONNECTION_FAILURE
+============================
+
+A unknown error has occured while trying to connect to a server.
--- /dev/null
+==========================================
+MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE
+==========================================
+
+An error has occurred while trying to connect to a server. It is likely that either the number of file descriptors need to be increased or you are out of memory.
--- /dev/null
+=============================
+MEMCACHED_DATA_DOES_NOT_EXIST
+=============================
+
+The data requested with the key given was not found.
--- /dev/null
+=====================
+MEMCACHED_DATA_EXISTS
+=====================
+
+The data requested with the key given was not found.
--- /dev/null
+=================
+MEMCACHED_DELETED
+=================
+
+The object requested by the key has been deleted.
--- /dev/null
+====================
+MEMCACHED_DEPRECATED
+====================
+
+The method that was requested has been deprecated.
--- /dev/null
+===============
+MEMCACHED_E2BIG
+===============
+
+Item is too large for the server to store.
--- /dev/null
+=============
+MEMCACHED_END
+=============
+
+The server has completed returning all of the objects requested.
--- /dev/null
+===============
+MEMCACHED_ERRNO
+===============
+
+An error has occurred in the driver which has set errno.
--- /dev/null
+=================
+MEMCACHED_FAILURE
+=================
+
+A unknown failure has occurred in the server.
--- /dev/null
+==========================
+MEMCACHED_FAIL_UNIX_SOCKET
+==========================
+
+A connection was not established with the server via a unix domain socket.
--- /dev/null
+===========================
+MEMCACHED_FETCH_NOTFINISHED
+===========================
+
+A request has been made, but the server has not finished the fetch of the last request.
--- /dev/null
+=============================
+MEMCACHED_HOST_LOOKUP_FAILURE
+=============================
+
+A DNS failure has occurred.
--- /dev/null
+===========================
+MEMCACHED_INVALID_ARGUMENTS
+===========================
+
+The arguments supplied to the given function were not valid.
--- /dev/null
+===============================
+MEMCACHED_INVALID_HOST_PROTOCOL
+===============================
+
+The server you are connecting too has an invalid protocol. Most likely you are connecting to an older server that does not speak the binary protocol.
--- /dev/null
+==============
+MEMCACHED_ITEM
+==============
+
+An item has been fetched (this is an internal error only).
--- /dev/null
+=====================
+MEMCACHED_KEY_TOO_BIG
+=====================
+
+The key that has been provided is too large for the given server.
--- /dev/null
+========================
+MEMCACHED_MAXIMUM_RETURN
+========================
+
+This in an internal only state.
--- /dev/null
+===================================
+MEMCACHED_MEMORY_ALLOCATION_FAILURE
+===================================
+
+An error has occurred while trying to allocate memory.
--- /dev/null
+==================
+MEMCACHED_NOTFOUND
+==================
+
+The object requested was not found.
--- /dev/null
+===================
+MEMCACHED_NOTSTORED
+===================
+
+The request to store an object failed.
--- /dev/null
+=======================
+MEMCACHED_NOT_SUPPORTED
+=======================
+
+The given method is not supported in the server.
--- /dev/null
+=========================
+MEMCACHED_NO_KEY_PROVIDED
+=========================
+
+No key was provided.
--- /dev/null
+====================
+MEMCACHED_NO_SERVERS
+====================
+
+No servers have been added to the memcached_st object.
--- /dev/null
+=====================
+MEMCACHED_PARSE_ERROR
+=====================
+
+An error has occurred while trying to parse the configuration string. You should use memparse to determine what the error was.
--- /dev/null
+==========================
+MEMCACHED_PARSE_USER_ERROR
+==========================
+
+An error has occurred in parsing the configuration string.
--- /dev/null
+======================
+MEMCACHED_PARTIAL_READ
+======================
+
+The read was only partcially successful.
--- /dev/null
+========================
+MEMCACHED_PROTOCOL_ERROR
+========================
+
+An unknown error has occurred in the protocol.
--- /dev/null
+======================
+MEMCACHED_READ_FAILURE
+======================
+
+A read failure has occurred.
--- /dev/null
+======================
+MEMCACHED_SERVER_ERROR
+======================
+
+An unknown error has occurred in the server.
--- /dev/null
+============================
+MEMCACHED_SERVER_MARKED_DEAD
+============================
+
+The requested server has been marked dead.
--- /dev/null
+=====================
+MEMCACHED_SOME_ERRORS
+=====================
+
+A multi request has been made, and some underterminate number of errors have occurred.
--- /dev/null
+==============
+MEMCACHED_STAT
+==============
+
+A "stat" command has been returned in the protocol.
--- /dev/null
+================
+MEMCACHED_STORED
+================
+
+The requested object has been successfully stored on the server.
--- /dev/null
+=================
+MEMCACHED_SUCCESS
+=================
+
+The request was successfully executed.
--- /dev/null
+=================
+MEMCACHED_TIMEOUT
+=================
+
+Operation has timed out.
--- /dev/null
+==============================
+MEMCACHED_UNKNOWN_READ_FAILURE
+==============================
+
+An unknown read failure only occurs when either there is a bug in the server, or in rare cases where an ethernet nic is reporting dubious information.
--- /dev/null
+==========================
+MEMCACHED_UNKNOWN_STAT_KEY
+==========================
+
+The server you are communicating with has a stat key which has not be defined in the protocol.
--- /dev/null
+===============
+MEMCACHED_VALUE
+===============
+
+A value has been returned from the server (this is an internal condition only).
--- /dev/null
+=======================
+MEMCACHED_WRITE_FAILURE
+=======================
+
+An error has occured while trying to write to a server.
--- /dev/null
+=====================
+Client Error messages
+=====================
+
+.. toctree::
+ :maxdepth: 1
+
+ client_errors/MEMCACHED_AUTH_CONTINUE
+ client_errors/MEMCACHED_AUTH_FAILURE
+ client_errors/MEMCACHED_AUTH_PROBLEM
+ client_errors/MEMCACHED_BAD_KEY_PROVIDED
+ client_errors/MEMCACHED_BUFFERED
+ client_errors/MEMCACHED_CLIENT_ERROR
+ client_errors/MEMCACHED_CONNECTION_BIND_FAILURE
+ client_errors/MEMCACHED_CONNECTION_FAILURE
+ client_errors/MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE
+ client_errors/MEMCACHED_DATA_DOES_NOT_EXIST
+ client_errors/MEMCACHED_DATA_EXISTS
+ client_errors/MEMCACHED_DELETED
+ client_errors/MEMCACHED_DEPRECATED
+ client_errors/MEMCACHED_E2BIG
+ client_errors/MEMCACHED_END
+ client_errors/MEMCACHED_ERRNO
+ client_errors/MEMCACHED_FAILURE
+ client_errors/MEMCACHED_FAIL_UNIX_SOCKET
+ client_errors/MEMCACHED_FETCH_NOTFINISHED
+ client_errors/MEMCACHED_HOST_LOOKUP_FAILURE
+ client_errors/MEMCACHED_INVALID_ARGUMENTS
+ client_errors/MEMCACHED_INVALID_HOST_PROTOCOL
+ client_errors/MEMCACHED_ITEM
+ client_errors/MEMCACHED_KEY_TOO_BIG
+ client_errors/MEMCACHED_MAXIMUM_RETURN
+ client_errors/MEMCACHED_MEMORY_ALLOCATION_FAILURE
+ client_errors/MEMCACHED_NOTFOUND
+ client_errors/MEMCACHED_NOTSTORED
+ client_errors/MEMCACHED_NOT_SUPPORTED
+ client_errors/MEMCACHED_NO_KEY_PROVIDED
+ client_errors/MEMCACHED_NO_SERVERS
+ client_errors/MEMCACHED_PARSE_ERROR
+ client_errors/MEMCACHED_PARSE_USER_ERROR
+ client_errors/MEMCACHED_PARTIAL_READ
+ client_errors/MEMCACHED_PROTOCOL_ERROR
+ client_errors/MEMCACHED_READ_FAILURE
+ client_errors/MEMCACHED_SERVER_ERROR
+ client_errors/MEMCACHED_SERVER_MARKED_DEAD
+ client_errors/MEMCACHED_SOME_ERRORS
+ client_errors/MEMCACHED_STAT
+ client_errors/MEMCACHED_STORED
+ client_errors/MEMCACHED_SUCCESS
+ client_errors/MEMCACHED_TIMEOUT
+ client_errors/MEMCACHED_UNKNOWN_READ_FAILURE
+ client_errors/MEMCACHED_UNKNOWN_STAT_KEY
+ client_errors/MEMCACHED_VALUE
+ client_errors/MEMCACHED_WRITE_FAILURE
+
EXTRA_DIST+= \
docs/conf.py \
+ docs/error_messages.rst \
+ docs/client_errors/MEMCACHED_AUTH_CONTINUE.rst \
+ docs/client_errors/MEMCACHED_AUTH_FAILURE.rst \
+ docs/client_errors/MEMCACHED_AUTH_PROBLEM.rst \
+ docs/client_errors/MEMCACHED_BAD_KEY_PROVIDED.rst \
+ docs/client_errors/MEMCACHED_BUFFERED.rst \
+ docs/client_errors/MEMCACHED_CLIENT_ERROR.rst \
+ docs/client_errors/MEMCACHED_CONNECTION_BIND_FAILURE.rst \
+ docs/client_errors/MEMCACHED_CONNECTION_FAILURE.rst \
+ docs/client_errors/MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE.rst \
+ docs/client_errors/MEMCACHED_DATA_DOES_NOT_EXIST.rst \
+ docs/client_errors/MEMCACHED_DATA_EXISTS.rst \
+ docs/client_errors/MEMCACHED_DELETED.rst \
+ docs/client_errors/MEMCACHED_DEPRECATED.rst \
+ docs/client_errors/MEMCACHED_E2BIG.rst \
+ docs/client_errors/MEMCACHED_END.rst \
+ docs/client_errors/MEMCACHED_ERRNO.rst \
+ docs/client_errors/MEMCACHED_FAILURE.rst \
+ docs/client_errors/MEMCACHED_FAIL_UNIX_SOCKET.rst \
+ docs/client_errors/MEMCACHED_FETCH_NOTFINISHED.rst \
+ docs/client_errors/MEMCACHED_HOST_LOOKUP_FAILURE.rst \
+ docs/client_errors/MEMCACHED_INVALID_ARGUMENTS.rst \
+ docs/client_errors/MEMCACHED_INVALID_HOST_PROTOCOL.rst \
+ docs/client_errors/MEMCACHED_ITEM.rst \
+ docs/client_errors/MEMCACHED_KEY_TOO_BIG.rst \
+ docs/client_errors/MEMCACHED_MAXIMUM_RETURN.rst \
+ docs/client_errors/MEMCACHED_MEMORY_ALLOCATION_FAILURE.rst \
+ docs/client_errors/MEMCACHED_NOTFOUND.rst \
+ docs/client_errors/MEMCACHED_NOTSTORED.rst \
+ docs/client_errors/MEMCACHED_NOT_SUPPORTED.rst \
+ docs/client_errors/MEMCACHED_NO_KEY_PROVIDED.rst \
+ docs/client_errors/MEMCACHED_NO_SERVERS.rst \
+ docs/client_errors/MEMCACHED_PARSE_ERROR.rst \
+ docs/client_errors/MEMCACHED_PARSE_USER_ERROR.rst \
+ docs/client_errors/MEMCACHED_PARTIAL_READ.rst \
+ docs/client_errors/MEMCACHED_PROTOCOL_ERROR.rst \
+ docs/client_errors/MEMCACHED_READ_FAILURE.rst \
+ docs/client_errors/MEMCACHED_SERVER_ERROR.rst \
+ docs/client_errors/MEMCACHED_SERVER_MARKED_DEAD.rst \
+ docs/client_errors/MEMCACHED_SOME_ERRORS.rst \
+ docs/client_errors/MEMCACHED_STAT.rst \
+ docs/client_errors/MEMCACHED_STORED.rst \
+ docs/client_errors/MEMCACHED_SUCCESS.rst \
+ docs/client_errors/MEMCACHED_TIMEOUT.rst \
+ docs/client_errors/MEMCACHED_UNKNOWN_READ_FAILURE.rst \
+ docs/client_errors/MEMCACHED_UNKNOWN_STAT_KEY.rst \
+ docs/client_errors/MEMCACHED_VALUE.rst \
+ docs/client_errors/MEMCACHED_WRITE_FAILURE.rst \
docs/hashkit_create.rst \
docs/hashkit_functions.rst \
docs/hashkit_value.rst \
memcached_create
libmemcached_examples
libmemcached_configuration
+ error_messages
#################
#define MEMCACHED_VERSION_STRING_LENGTH 24
-enum memcached_return_t {
- MEMCACHED_SUCCESS,
- MEMCACHED_FAILURE,
- MEMCACHED_HOST_LOOKUP_FAILURE,
- MEMCACHED_CONNECTION_FAILURE,
- MEMCACHED_CONNECTION_BIND_FAILURE,
- MEMCACHED_WRITE_FAILURE,
- MEMCACHED_READ_FAILURE,
- MEMCACHED_UNKNOWN_READ_FAILURE,
- MEMCACHED_PROTOCOL_ERROR,
- MEMCACHED_CLIENT_ERROR,
- MEMCACHED_SERVER_ERROR,
- MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE,
- MEMCACHED_DATA_EXISTS,
- MEMCACHED_DATA_DOES_NOT_EXIST,
- MEMCACHED_NOTSTORED,
- MEMCACHED_STORED,
- MEMCACHED_NOTFOUND,
- MEMCACHED_MEMORY_ALLOCATION_FAILURE,
- MEMCACHED_PARTIAL_READ,
- MEMCACHED_SOME_ERRORS,
- MEMCACHED_NO_SERVERS,
- MEMCACHED_END,
- MEMCACHED_DELETED,
- MEMCACHED_VALUE,
- MEMCACHED_STAT,
- MEMCACHED_ITEM,
- MEMCACHED_ERRNO,
- MEMCACHED_FAIL_UNIX_SOCKET,
- MEMCACHED_NOT_SUPPORTED,
- MEMCACHED_NO_KEY_PROVIDED, /* Deprecated. Use MEMCACHED_BAD_KEY_PROVIDED! */
- MEMCACHED_FETCH_NOTFINISHED,
- MEMCACHED_TIMEOUT,
- MEMCACHED_BUFFERED,
- MEMCACHED_BAD_KEY_PROVIDED,
- MEMCACHED_INVALID_HOST_PROTOCOL,
- MEMCACHED_SERVER_MARKED_DEAD,
- MEMCACHED_UNKNOWN_STAT_KEY,
- MEMCACHED_E2BIG,
- MEMCACHED_INVALID_ARGUMENTS,
- MEMCACHED_KEY_TOO_BIG,
- MEMCACHED_AUTH_PROBLEM,
- MEMCACHED_AUTH_FAILURE,
- MEMCACHED_AUTH_CONTINUE,
- MEMCACHED_PARSE_ERROR,
- MEMCACHED_PARSE_USER_ERROR,
- MEMCACHED_DEPRECATED,
- MEMCACHED_MAXIMUM_RETURN /* Always add new error code before */
-};
-
-#ifndef __cplusplus
-typedef enum memcached_return_t memcached_return_t;
-#endif
-
-
enum memcached_server_distribution_t {
MEMCACHED_DISTRIBUTION_MODULA,
MEMCACHED_DISTRIBUTION_CONSISTENT,
libmemcached/protocol/callback.h \
libmemcached/protocol_handler.h \
libmemcached/quit.h \
+ libmemcached/return.h \
libmemcached/platform.h \
libmemcached/result.h \
libmemcached/sasl.h \
*
*/
-#ifndef __LIBMEMCACHED_MEMCACHED_H__
-#define __LIBMEMCACHED_MEMCACHED_H__
+#pragma once
#include <inttypes.h>
#include <stdlib.h>
#include <libmemcached/configure.h>
#include <libmemcached/platform.h>
#include <libmemcached/constants.h>
+#include <libmemcached/return.h>
#include <libmemcached/types.h>
#include <libmemcached/string.h>
#include <libmemcached/array.h>
#ifdef __cplusplus
} // extern "C"
#endif
-
-#endif /* __LIBMEMCACHED_MEMCACHED_H__ */
-
--- /dev/null
+/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ *
+ * Libmemcached library
+ *
+ * Copyright (C) 2011 Data Differential, http://datadifferential.com/
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * The names of its contributors may not be used to endorse or
+ * promote products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#pragma once
+
+enum memcached_return_t {
+ MEMCACHED_SUCCESS,
+ MEMCACHED_FAILURE,
+ MEMCACHED_HOST_LOOKUP_FAILURE,
+ MEMCACHED_CONNECTION_FAILURE,
+ MEMCACHED_CONNECTION_BIND_FAILURE,
+ MEMCACHED_WRITE_FAILURE,
+ MEMCACHED_READ_FAILURE,
+ MEMCACHED_UNKNOWN_READ_FAILURE,
+ MEMCACHED_PROTOCOL_ERROR,
+ MEMCACHED_CLIENT_ERROR,
+ MEMCACHED_SERVER_ERROR,
+ MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE,
+ MEMCACHED_DATA_EXISTS,
+ MEMCACHED_DATA_DOES_NOT_EXIST,
+ MEMCACHED_NOTSTORED,
+ MEMCACHED_STORED,
+ MEMCACHED_NOTFOUND,
+ MEMCACHED_MEMORY_ALLOCATION_FAILURE,
+ MEMCACHED_PARTIAL_READ,
+ MEMCACHED_SOME_ERRORS,
+ MEMCACHED_NO_SERVERS,
+ MEMCACHED_END,
+ MEMCACHED_DELETED,
+ MEMCACHED_VALUE,
+ MEMCACHED_STAT,
+ MEMCACHED_ITEM,
+ MEMCACHED_ERRNO,
+ MEMCACHED_FAIL_UNIX_SOCKET,
+ MEMCACHED_NOT_SUPPORTED,
+ MEMCACHED_NO_KEY_PROVIDED, /* Deprecated. Use MEMCACHED_BAD_KEY_PROVIDED! */
+ MEMCACHED_FETCH_NOTFINISHED,
+ MEMCACHED_TIMEOUT,
+ MEMCACHED_BUFFERED,
+ MEMCACHED_BAD_KEY_PROVIDED,
+ MEMCACHED_INVALID_HOST_PROTOCOL,
+ MEMCACHED_SERVER_MARKED_DEAD,
+ MEMCACHED_UNKNOWN_STAT_KEY,
+ MEMCACHED_E2BIG,
+ MEMCACHED_INVALID_ARGUMENTS,
+ MEMCACHED_KEY_TOO_BIG,
+ MEMCACHED_AUTH_PROBLEM,
+ MEMCACHED_AUTH_FAILURE,
+ MEMCACHED_AUTH_CONTINUE,
+ MEMCACHED_PARSE_ERROR,
+ MEMCACHED_PARSE_USER_ERROR,
+ MEMCACHED_DEPRECATED,
+ MEMCACHED_MAXIMUM_RETURN /* Always add new error code before */
+};
+
+#ifndef __cplusplus
+typedef enum memcached_return_t memcached_return_t;
+#endif
+
+