X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fmemcached_constants.h;h=7399d6cbd11202aa092fe0d5e0078da6d22d13f9;hb=67e1b61bd9840daef731de3159d06875eed93c9e;hp=5fdede9a765923ddc6b428f7732078ca1ced2c24;hpb=f63d634e21459280599f663154089fa724903bd6;p=awesomized%2Flibmemcached diff --git a/libmemcached/memcached_constants.h b/libmemcached/memcached_constants.h index 5fdede9a..7399d6cb 100644 --- a/libmemcached/memcached_constants.h +++ b/libmemcached/memcached_constants.h @@ -9,10 +9,6 @@ #ifndef __MEMCACHED_CONSTANTS_H__ #define __MEMCACHED_CONSTANTS_H__ -#ifdef __cplusplus -extern "C" { -#endif - /* Public defines */ #define MEMCACHED_DEFAULT_PORT 11211 #define MEMCACHED_MAX_KEY 251 /* We add one to have it null terminated */ @@ -21,7 +17,7 @@ extern "C" { #define MEMCACHED_MAX_HOST_SORT_LENGTH 86 /* Used for Ketama */ #define MEMCACHED_POINTS_PER_SERVER 100 #define MEMCACHED_POINTS_PER_SERVER_KETAMA 160 -#define MEMCACHED_CONTINUUM_SIZE MEMCACHED_POINTS_PER_SERVER*100 /* This would then set max hosts to 100 */ +#define MEMCACHED_CONTINUUM_SIZE MEMCACHED_POINTS_PER_SERVER*100 /* This would then set max hosts to 100 */ #define MEMCACHED_STRIDE 4 #define MEMCACHED_DEFAULT_TIMEOUT 1000 #define MEMCACHED_CONTINUUM_ADDITION 10 /* How many extra slots we should build for in the continuum */ @@ -66,6 +62,8 @@ typedef enum { MEMCACHED_INVALID_HOST_PROTOCOL, MEMCACHED_SERVER_MARKED_DEAD, MEMCACHED_UNKNOWN_STAT_KEY, + MEMCACHED_E2BIG, + MEMCACHED_INVALID_ARGUMENTS, MEMCACHED_MAXIMUM_RETURN /* Always add new error code before */ } memcached_return; @@ -73,7 +71,8 @@ typedef enum { MEMCACHED_DISTRIBUTION_MODULA, MEMCACHED_DISTRIBUTION_CONSISTENT, MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA, - MEMCACHED_DISTRIBUTION_RANDOM + MEMCACHED_DISTRIBUTION_RANDOM, + MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA_SPY } memcached_server_distribution; typedef enum { @@ -106,19 +105,25 @@ typedef enum { MEMCACHED_BEHAVIOR_NOREPLY, MEMCACHED_BEHAVIOR_USE_UDP, MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTS, - MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS + MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS, + MEMCACHED_BEHAVIOR_KETAMA_COMPAT_MODE } memcached_behavior; +#define MEMCACHED_KETAMA_COMPAT_LIBMEMCACHED 0 +#define MEMCACHED_KETAMA_COMPAT_SPY 1 + typedef enum { - MEMCACHED_CALLBACK_PREFIX_KEY, - MEMCACHED_CALLBACK_USER_DATA, - MEMCACHED_CALLBACK_CLEANUP_FUNCTION, - MEMCACHED_CALLBACK_CLONE_FUNCTION, - MEMCACHED_CALLBACK_MALLOC_FUNCTION, - MEMCACHED_CALLBACK_REALLOC_FUNCTION, - MEMCACHED_CALLBACK_FREE_FUNCTION, - MEMCACHED_CALLBACK_GET_FAILURE, - MEMCACHED_CALLBACK_DELETE_TRIGGER + MEMCACHED_CALLBACK_PREFIX_KEY = 0, + MEMCACHED_CALLBACK_USER_DATA = 1, + MEMCACHED_CALLBACK_CLEANUP_FUNCTION = 2, + MEMCACHED_CALLBACK_CLONE_FUNCTION = 3, +#ifdef MEMCACHED_ENABLE_DEPRECATED + MEMCACHED_CALLBACK_MALLOC_FUNCTION = 4, + MEMCACHED_CALLBACK_REALLOC_FUNCTION = 5, + MEMCACHED_CALLBACK_FREE_FUNCTION = 6, +#endif + MEMCACHED_CALLBACK_GET_FAILURE = 7, + MEMCACHED_CALLBACK_DELETE_TRIGGER = 8 } memcached_callback; typedef enum { @@ -141,8 +146,4 @@ typedef enum { MEMCACHED_CONNECTION_UNIX_SOCKET } memcached_connection; -#ifdef __cplusplus -} -#endif - #endif /* __MEMCACHED_CONSTANTS_H__ */