X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=include%2Fmemcached.h;h=4e60cca0fa2a6475133b4a5f56ea973a4685dfbd;hb=08968cb5fc9edcec75729a0180259cb2fd3aca30;hp=53b51ea03ee94657c13aabb24b27e2902e579e7b;hpb=8d0cd77fc7bafd1f353bc7c50910b751766f931a;p=awesomized%2Flibmemcached diff --git a/include/memcached.h b/include/memcached.h index 53b51ea0..4e60cca0 100644 --- a/include/memcached.h +++ b/include/memcached.h @@ -36,7 +36,7 @@ typedef struct memcached_server_st memcached_server_st; typedef enum { MEMCACHED_SUCCESS, MEMCACHED_FAILURE, - MEMCACHED_HOST_LOCKUP_FAILURE, + MEMCACHED_HOST_LOOKUP_FAILURE, MEMCACHED_CONNECTION_FAILURE, MEMCACHED_CONNECTION_BIND_FAILURE, MEMCACHED_WRITE_FAILURE, @@ -74,6 +74,8 @@ typedef enum { MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE, MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE, MEMCACHED_BEHAVIOR_CACHE_LOOKUPS, + MEMCACHED_BEHAVIOR_SUPPORT_CAS, + MEMCACHED_BEHAVIOR_POLL_TIMEOUT, } memcached_behavior; typedef enum { @@ -85,6 +87,7 @@ typedef enum { MEMCACHED_HASH_FNV1_32, MEMCACHED_HASH_FNV1A_32, MEMCACHED_HASH_KETAMA, + MEMCACHED_HASH_HSIEH, } memcached_hash; typedef enum { @@ -97,6 +100,7 @@ typedef enum { typedef enum { MEMCACHED_NOT_ALLOCATED, MEMCACHED_ALLOCATED, + MEMCACHED_USED, } memcached_allocated; struct memcached_server_st { @@ -117,35 +121,34 @@ struct memcached_server_st { uint8_t major_version; uint8_t minor_version; uint8_t micro_version; + uint16_t count; }; struct memcached_stat_st { - unsigned int pid; - unsigned int uptime; - unsigned int threads; - time_t time; + uint32_t pid; + uint32_t uptime; + uint32_t threads; + uint32_t time; + uint32_t pointer_size; + uint32_t rusage_user_seconds; + uint32_t rusage_user_microseconds; + uint32_t rusage_system_seconds; + uint32_t rusage_system_microseconds; + uint32_t curr_items; + uint32_t total_items; + uint32_t limit_maxbytes; + uint32_t curr_connections; + uint32_t total_connections; + uint32_t connection_structures; + uint64_t bytes; + uint64_t cmd_get; + uint64_t cmd_set; + uint64_t get_hits; + uint64_t get_misses; + uint64_t evictions; + uint64_t bytes_read; + uint64_t bytes_written; char version[MEMCACHED_VERSION_STRING]; - unsigned int pointer_size; - unsigned int rusage_user; - unsigned int rusage_system; - unsigned int rusage_user_seconds; - unsigned int rusage_user_microseconds; - unsigned int rusage_system_seconds; - unsigned int rusage_system_microseconds; - unsigned int curr_items; - unsigned int total_items; - unsigned long long bytes; - unsigned int curr_connections; - unsigned int total_connections; - unsigned int connection_structures; - unsigned long long cmd_get; - unsigned long long cmd_set; - unsigned long long get_hits; - unsigned long long get_misses; - unsigned long long evictions; - unsigned long long bytes_read; - unsigned long long bytes_written; - unsigned int limit_maxbytes; }; struct memcached_string_st { @@ -177,6 +180,7 @@ struct memcached_st { unsigned long long flags; int send_size; int recv_size; + int32_t poll_timeout; memcached_string_st result_buffer; memcached_hash hash; memcached_return warning; /* Future Use */ @@ -254,11 +258,11 @@ memcached_result_st *memcached_fetch_result(memcached_st *ptr, memcached_return *error); /* Server Public functions */ -#define memcached_server_count(A) A->number_of_hosts -#define memcached_server_name(A,B) B.hostname -#define memcached_server_port(A,B) B.port -#define memcached_server_list(A) A->hosts -#define memcached_server_response_count(A,B) A->hosts[B].stack_responses +#define memcached_server_count(A) (A)->number_of_hosts +#define memcached_server_name(A,B) (B).hostname +#define memcached_server_port(A,B) (B).port +#define memcached_server_list(A) (A)->hosts +#define memcached_server_response_count(A,B) (A)->hosts[B].stack_responses memcached_return memcached_server_add_udp(memcached_st *ptr, char *hostname,