X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=lib%2Fcommon.h;h=5c2d2682e3a59e01995167f4f322e52b24d847ef;hb=97ccdd0fbb452e094e1fcfde80376f805370ff70;hp=1e564cf5f894d5a00533916ee10bca6e9544b703;hpb=8d0cd77fc7bafd1f353bc7c50910b751766f931a;p=m6w6%2Flibmemcached diff --git a/lib/common.h b/lib/common.h index 1e564cf5..5c2d2682 100644 --- a/lib/common.h +++ b/lib/common.h @@ -19,6 +19,10 @@ #include #include #include +#include +#include +#include + #include @@ -36,6 +40,11 @@ #define MEMCACHED_BLOCK_SIZE 1024 +typedef enum { + MEM_NO_FLUSH, + MEM_FLUSH, +} memcached_flush_action; + typedef enum { MEM_NO_BLOCK= (1 << 0), MEM_TCP_NODELAY= (1 << 1), @@ -44,12 +53,14 @@ typedef enum { MEM_USE_KETAMA= (1 << 4), MEM_USE_CRC= (1 << 5), MEM_USE_CACHE_LOOKUPS= (1 << 6), + MEM_SUPPORT_CAS= (1 << 7), } memcached_flags; /* Hashing algo */ void md5_signature(unsigned char *key, unsigned int length, unsigned char *result); uint32_t hash_crc32(const char *data, size_t data_len); +uint32_t hsieh_hash(char *key, size_t key_length); memcached_return memcached_connect(memcached_st *ptr, unsigned int server_key); memcached_return memcached_response(memcached_st *ptr,