Added get/set behavior functions to the C++ interface. Added a test to exercise the...
[awesomized/libmemcached] / libmemcached / memcached_constants.h
index 5d0e31d0c3f352aa0d45f5d29b67bbd4e4503381..7399d6cbd11202aa092fe0d5e0078da6d22d13f9 100644 (file)
@@ -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,9 +105,13 @@ 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 = 0,
   MEMCACHED_CALLBACK_USER_DATA = 1,
@@ -143,8 +146,4 @@ typedef enum {
   MEMCACHED_CONNECTION_UNIX_SOCKET
 } memcached_connection;
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* __MEMCACHED_CONSTANTS_H__ */