auto.h   auto.h 
skipping to change at line 20 skipping to change at line 20
*/ */
#ifndef __LIBMEMCACHED_AUTO_H__ #ifndef __LIBMEMCACHED_AUTO_H__
#define __LIBMEMCACHED_AUTO_H__ #define __LIBMEMCACHED_AUTO_H__
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_increment(memcached_st *ptr, memcached_return_t memcached_increment(memcached_st *ptr,
const char *key, size_t key_length, const char *key, size_t key_length
uint32_t offset, ,
uint64_t *value); uint32_t offset,
LIBMEMCACHED_API uint64_t *value);
memcached_return_t memcached_decrement(memcached_st *ptr, LIBMEMCACHED_API
const char *key, size_t key_length, memcached_return_t memcached_decrement(memcached_st *ptr,
uint32_t offset, const char *key, size_t key_length
uint64_t *value); ,
uint32_t offset,
LIBMEMCACHED_API uint64_t *value);
memcached_return_t memcached_increment_by_key(memcached_st *ptr,
const char *master_key, size_t LIBMEMCACHED_API
master_key_length, memcached_return_t memcached_increment_by_key(memcached_st *ptr,
const char *key, size_t key_len const char *group_key, size
gth, _t group_key_length,
uint64_t offset, const char *key, size_t key
uint64_t *value); _length,
uint64_t offset,
LIBMEMCACHED_API uint64_t *value);
memcached_return_t memcached_decrement_by_key(memcached_st *ptr,
const char *master_key, size_t LIBMEMCACHED_API
master_key_length, memcached_return_t memcached_decrement_by_key(memcached_st *ptr,
const char *key, size_t key_len const char *group_key, size
gth, _t group_key_length,
uint64_t offset, const char *key, size_t key
uint64_t *value); _length,
uint64_t offset,
LIBMEMCACHED_API uint64_t *value);
memcached_return_t memcached_increment_with_initial(memcached_st *ptr,
const char *key, LIBMEMCACHED_API
size_t key_length, memcached_return_t memcached_increment_with_initial(memcached_st *ptr,
uint64_t offset, const char *key,
uint64_t initial, size_t key_length,
time_t expiration, uint64_t offset,
uint64_t *value); uint64_t initial,
LIBMEMCACHED_API time_t expiration,
memcached_return_t memcached_decrement_with_initial(memcached_st *ptr, uint64_t *value);
const char *key,
size_t key_length, LIBMEMCACHED_API
uint64_t offset, memcached_return_t memcached_decrement_with_initial(memcached_st *ptr,
uint64_t initial, const char *key,
time_t expiration, size_t key_length,
uint64_t *value); uint64_t offset,
LIBMEMCACHED_API uint64_t initial,
memcached_return_t memcached_increment_with_initial_by_key(memcached_st *pt time_t expiration,
r, uint64_t *value);
const char *master
_key, LIBMEMCACHED_API
size_t master_key_ memcached_return_t memcached_increment_with_initial_by_key(memcached_st *
length, ptr,
const char *key, const char *gr
size_t key_length, oup_key,
uint64_t offset, size_t group_k
uint64_t initial, ey_length,
time_t expiration, const char *ke
uint64_t *value); y,
LIBMEMCACHED_API size_t key_len
memcached_return_t memcached_decrement_with_initial_by_key(memcached_st *pt gth,
r, uint64_t offse
const char *master t,
_key, uint64_t initi
size_t master_key_ al,
length, time_t expirat
const char *key, ion,
size_t key_length, uint64_t *valu
uint64_t offset, e);
uint64_t initial,
time_t expiration, LIBMEMCACHED_API
uint64_t *value); memcached_return_t memcached_decrement_with_initial_by_key(memcached_st *
ptr,
const char *gr
oup_key,
size_t group_k
ey_length,
const char *ke
y,
size_t key_len
gth,
uint64_t offse
t,
uint64_t initi
al,
time_t expirat
ion,
uint64_t *valu
e);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __LIBMEMCACHED_AUTO_H__ */ #endif /* __LIBMEMCACHED_AUTO_H__ */
 End of changes. 1 change blocks. 
70 lines changed or deleted 87 lines changed or added


 constants.h   constants.h 
skipping to change at line 12 skipping to change at line 12
* Copyright (C) 2006-2009 Brian Aker * Copyright (C) 2006-2009 Brian Aker
* All rights reserved. * All rights reserved.
* *
* Use and distribution licensed under the BSD license. See * Use and distribution licensed under the BSD license. See
* the COPYING file in the parent directory for full text. * the COPYING file in the parent directory for full text.
* *
* Summary: Constants for libmemcached * Summary: Constants for libmemcached
* *
*/ */
#pragma once
#ifndef __LIBMEMCACHED_CONSTANTS_H__ #ifndef __LIBMEMCACHED_CONSTANTS_H__
#define __LIBMEMCACHED_CONSTANTS_H__ #define __LIBMEMCACHED_CONSTANTS_H__
/* Public defines */ /* Public defines */
#define MEMCACHED_DEFAULT_PORT 11211 #define MEMCACHED_DEFAULT_PORT 11211
#define MEMCACHED_MAX_KEY 251 /* We add one to have it null terminated */ #define MEMCACHED_MAX_KEY 251 /* We add one to have it null terminated */
#define MEMCACHED_MAX_BUFFER 8196 #define MEMCACHED_MAX_BUFFER 8196
#define MEMCACHED_MAX_HOST_SORT_LENGTH 86 /* Used for Ketama */ #define MEMCACHED_MAX_HOST_SORT_LENGTH 86 /* Used for Ketama */
#define MEMCACHED_POINTS_PER_SERVER 100 #define MEMCACHED_POINTS_PER_SERVER 100
#define MEMCACHED_POINTS_PER_SERVER_KETAMA 160 #define MEMCACHED_POINTS_PER_SERVER_KETAMA 160
#define MEMCACHED_CONTINUUM_SIZE MEMCACHED_POINTS_PER_SERVER*100 /* This wo uld then set max hosts to 100 */ #define MEMCACHED_CONTINUUM_SIZE MEMCACHED_POINTS_PER_SERVER*100 /* This wo uld then set max hosts to 100 */
#define MEMCACHED_STRIDE 4 #define MEMCACHED_STRIDE 4
#define MEMCACHED_DEFAULT_TIMEOUT 5000 #define MEMCACHED_DEFAULT_TIMEOUT 5000
#define MEMCACHED_DEFAULT_CONNECT_TIMEOUT 4000 #define MEMCACHED_DEFAULT_CONNECT_TIMEOUT 4000
#define MEMCACHED_CONTINUUM_ADDITION 10 /* How many extra slots we should b uild for in the continuum */ #define MEMCACHED_CONTINUUM_ADDITION 10 /* How many extra slots we should b uild for in the continuum */
#define MEMCACHED_PREFIX_KEY_MAX_SIZE 128 #define MEMCACHED_PREFIX_KEY_MAX_SIZE 128
#define MEMCACHED_EXPIRATION_NOT_ADD 0xffffffffU #define MEMCACHED_EXPIRATION_NOT_ADD 0xffffffffU
#define MEMCACHED_VERSION_STRING_LENGTH 24 #define MEMCACHED_VERSION_STRING_LENGTH 24
typedef enum { enum memcached_return_t {
MEMCACHED_SUCCESS, MEMCACHED_SUCCESS,
MEMCACHED_FAILURE, MEMCACHED_FAILURE,
MEMCACHED_HOST_LOOKUP_FAILURE, MEMCACHED_HOST_LOOKUP_FAILURE,
MEMCACHED_CONNECTION_FAILURE, MEMCACHED_CONNECTION_FAILURE,
MEMCACHED_CONNECTION_BIND_FAILURE, MEMCACHED_CONNECTION_BIND_FAILURE,
MEMCACHED_WRITE_FAILURE, MEMCACHED_WRITE_FAILURE,
MEMCACHED_READ_FAILURE, MEMCACHED_READ_FAILURE,
MEMCACHED_UNKNOWN_READ_FAILURE, MEMCACHED_UNKNOWN_READ_FAILURE,
MEMCACHED_PROTOCOL_ERROR, MEMCACHED_PROTOCOL_ERROR,
MEMCACHED_CLIENT_ERROR, MEMCACHED_CLIENT_ERROR,
skipping to change at line 75 skipping to change at line 76
MEMCACHED_BAD_KEY_PROVIDED, MEMCACHED_BAD_KEY_PROVIDED,
MEMCACHED_INVALID_HOST_PROTOCOL, MEMCACHED_INVALID_HOST_PROTOCOL,
MEMCACHED_SERVER_MARKED_DEAD, MEMCACHED_SERVER_MARKED_DEAD,
MEMCACHED_UNKNOWN_STAT_KEY, MEMCACHED_UNKNOWN_STAT_KEY,
MEMCACHED_E2BIG, MEMCACHED_E2BIG,
MEMCACHED_INVALID_ARGUMENTS, MEMCACHED_INVALID_ARGUMENTS,
MEMCACHED_KEY_TOO_BIG, MEMCACHED_KEY_TOO_BIG,
MEMCACHED_AUTH_PROBLEM, MEMCACHED_AUTH_PROBLEM,
MEMCACHED_AUTH_FAILURE, MEMCACHED_AUTH_FAILURE,
MEMCACHED_AUTH_CONTINUE, MEMCACHED_AUTH_CONTINUE,
MEMCACHED_PARSE_ERROR,
MEMCACHED_PARSE_USER_ERROR,
MEMCACHED_DEPRECATED,
MEMCACHED_MAXIMUM_RETURN /* Always add new error code before */ MEMCACHED_MAXIMUM_RETURN /* Always add new error code before */
} memcached_return_t; };
typedef enum { #ifndef __cplusplus
typedef enum memcached_return_t memcached_return_t;
#endif
enum memcached_server_distribution_t {
MEMCACHED_DISTRIBUTION_MODULA, MEMCACHED_DISTRIBUTION_MODULA,
MEMCACHED_DISTRIBUTION_CONSISTENT, MEMCACHED_DISTRIBUTION_CONSISTENT,
MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA, MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA,
MEMCACHED_DISTRIBUTION_RANDOM, MEMCACHED_DISTRIBUTION_RANDOM,
MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA_SPY, MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA_SPY,
MEMCACHED_DISTRIBUTION_CONSISTENT_WEIGHTED,
MEMCACHED_DISTRIBUTION_VIRTUAL_BUCKET,
MEMCACHED_DISTRIBUTION_CONSISTENT_MAX MEMCACHED_DISTRIBUTION_CONSISTENT_MAX
} memcached_server_distribution_t; };
#ifndef __cplusplus
typedef enum memcached_server_distribution_t memcached_server_distribution_
t;
#endif
typedef enum { typedef enum {
MEMCACHED_BEHAVIOR_NO_BLOCK, MEMCACHED_BEHAVIOR_NO_BLOCK,
MEMCACHED_BEHAVIOR_TCP_NODELAY, MEMCACHED_BEHAVIOR_TCP_NODELAY,
MEMCACHED_BEHAVIOR_HASH, MEMCACHED_BEHAVIOR_HASH,
MEMCACHED_BEHAVIOR_KETAMA, MEMCACHED_BEHAVIOR_KETAMA,
MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE, MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE,
MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE, MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE,
MEMCACHED_BEHAVIOR_CACHE_LOOKUPS, MEMCACHED_BEHAVIOR_CACHE_LOOKUPS,
MEMCACHED_BEHAVIOR_SUPPORT_CAS, MEMCACHED_BEHAVIOR_SUPPORT_CAS,
skipping to change at line 122 skipping to change at line 136
MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH, MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH,
MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY, MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY,
MEMCACHED_BEHAVIOR_NOREPLY, MEMCACHED_BEHAVIOR_NOREPLY,
MEMCACHED_BEHAVIOR_USE_UDP, MEMCACHED_BEHAVIOR_USE_UDP,
MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTS, MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTS,
MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS, MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS,
MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ, MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ,
MEMCACHED_BEHAVIOR_CORK, MEMCACHED_BEHAVIOR_CORK,
MEMCACHED_BEHAVIOR_TCP_KEEPALIVE, MEMCACHED_BEHAVIOR_TCP_KEEPALIVE,
MEMCACHED_BEHAVIOR_TCP_KEEPIDLE, MEMCACHED_BEHAVIOR_TCP_KEEPIDLE,
MEMCACHED_BEHAVIOR_LOAD_FROM_FILE,
MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS,
MEMCACHED_BEHAVIOR_MAX MEMCACHED_BEHAVIOR_MAX
} memcached_behavior_t; } memcached_behavior_t;
typedef enum { typedef enum {
MEMCACHED_CALLBACK_PREFIX_KEY = 0, MEMCACHED_CALLBACK_PREFIX_KEY = 0,
MEMCACHED_CALLBACK_USER_DATA = 1, MEMCACHED_CALLBACK_USER_DATA = 1,
MEMCACHED_CALLBACK_CLEANUP_FUNCTION = 2, MEMCACHED_CALLBACK_CLEANUP_FUNCTION = 2,
MEMCACHED_CALLBACK_CLONE_FUNCTION = 3, MEMCACHED_CALLBACK_CLONE_FUNCTION = 3,
#ifdef MEMCACHED_ENABLE_DEPRECATED #ifdef MEMCACHED_ENABLE_DEPRECATED
MEMCACHED_CALLBACK_MALLOC_FUNCTION = 4, MEMCACHED_CALLBACK_MALLOC_FUNCTION = 4,
 End of changes. 8 change blocks. 
4 lines changed or deleted 21 lines changed or added


 delete.h   delete.h 
skipping to change at line 25 skipping to change at line 25
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_delete(memcached_st *ptr, const char *key, siz e_t key_length, memcached_return_t memcached_delete(memcached_st *ptr, const char *key, siz e_t key_length,
time_t expiration); time_t expiration);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_delete_by_key(memcached_st *ptr, memcached_return_t memcached_delete_by_key(memcached_st *ptr,
const char *master_key, size_t m aster_key_length, const char *group_key, size_t gr oup_key_length,
const char *key, size_t key_leng th, const char *key, size_t key_leng th,
time_t expiration); time_t expiration);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __LIBMEMCACHED_DELETE_H__ */ #endif /* __LIBMEMCACHED_DELETE_H__ */
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 get.h   get.h 
skipping to change at line 35 skipping to change at line 35
memcached_return_t *error); memcached_return_t *error);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_mget(memcached_st *ptr, memcached_return_t memcached_mget(memcached_st *ptr,
const char * const *keys, const char * const *keys,
const size_t *key_length, const size_t *key_length,
size_t number_of_keys); size_t number_of_keys);
LIBMEMCACHED_API LIBMEMCACHED_API
char *memcached_get_by_key(memcached_st *ptr, char *memcached_get_by_key(memcached_st *ptr,
const char *master_key, size_t master_key_length , const char *group_key, size_t group_key_length,
const char *key, size_t key_length, const char *key, size_t key_length,
size_t *value_length, size_t *value_length,
uint32_t *flags, uint32_t *flags,
memcached_return_t *error); memcached_return_t *error);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_mget_by_key(memcached_st *ptr, memcached_return_t memcached_mget_by_key(memcached_st *ptr,
const char *master_key, const char *group_key,
size_t master_key_length, size_t group_key_length,
const char * const *keys, const char * const *keys,
const size_t *key_length, const size_t *key_length,
const size_t number_of_keys); const size_t number_of_keys);
LIBMEMCACHED_API LIBMEMCACHED_API
char *memcached_fetch(memcached_st *ptr, char *memcached_fetch(memcached_st *ptr,
char *key, char *key,
size_t *key_length, size_t *key_length,
size_t *value_length, size_t *value_length,
uint32_t *flags, uint32_t *flags,
skipping to change at line 73 skipping to change at line 73
memcached_return_t memcached_mget_execute(memcached_st *ptr, memcached_return_t memcached_mget_execute(memcached_st *ptr,
const char * const *keys, const char * const *keys,
const size_t *key_length, const size_t *key_length,
const size_t number_of_keys, const size_t number_of_keys,
memcached_execute_fn *callback, memcached_execute_fn *callback,
void *context, void *context,
const uint32_t number_of_callback s); const uint32_t number_of_callback s);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_mget_execute_by_key(memcached_st *ptr, memcached_return_t memcached_mget_execute_by_key(memcached_st *ptr,
const char *master_key, const char *group_key,
size_t master_key_length, size_t group_key_length,
const char * const *keys, const char * const *keys,
const size_t *key_length, const size_t *key_length,
size_t number_of_keys, size_t number_of_keys,
memcached_execute_fn *call back, memcached_execute_fn *call back,
void *context, void *context,
const uint32_t number_of_c allbacks); const uint32_t number_of_c allbacks);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
 End of changes. 3 change blocks. 
5 lines changed or deleted 5 lines changed or added


 hash.h   hash.h 
/* LibMemcached /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
* Copyright (C) 2010 Brian Aker
* All rights reserved.
* *
* Use and distribution licensed under the BSD license. See * Libmemcached library
* the COPYING file in the parent directory for full text.
* *
* Summary: hash interface code * Copyright (C) 2011 Data Differential, http://datadifferential.com/
* Copyright (C) 2006-2009 Brian Aker All rights reserved.
*
* 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.
* *
*/ */
#ifndef __MEMCACHED_HASH_H__ #ifndef __MEMCACHED_HASH_H__
#define __MEMCACHED_HASH_H__ #define __MEMCACHED_HASH_H__
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
skipping to change at line 38 skipping to change at line 64
LIBMEMCACHED_API LIBMEMCACHED_API
uint32_t memcached_generate_hash(const memcached_st *ptr, const char *key, size_t key_length); uint32_t memcached_generate_hash(const memcached_st *ptr, const char *key, size_t key_length);
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
uint32_t memcached_generate_hash_with_redistribution(memcached_st *ptr, con st char *key, size_t key_length); uint32_t memcached_generate_hash_with_redistribution(memcached_st *ptr, con st char *key, size_t key_length);
LIBMEMCACHED_API LIBMEMCACHED_API
void memcached_autoeject(memcached_st *ptr); void memcached_autoeject(memcached_st *ptr);
LIBMEMCACHED_API
const char * libmemcached_string_hash(memcached_hash_t type);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __MEMCACHED_HASH_H__ */ #endif /* __MEMCACHED_HASH_H__ */
 End of changes. 4 change blocks. 
6 lines changed or deleted 35 lines changed or added


 hashkit.h   hashkit.h 
skipping to change at line 24 skipping to change at line 24
#endif #endif
#include <inttypes.h> #include <inttypes.h>
#include <sys/types.h> #include <sys/types.h>
#include <libhashkit/visibility.h> #include <libhashkit/visibility.h>
#include <libhashkit/configure.h> #include <libhashkit/configure.h>
#include <libhashkit/types.h> #include <libhashkit/types.h>
#include <libhashkit/algorithm.h> #include <libhashkit/algorithm.h>
#include <libhashkit/behavior.h> #include <libhashkit/behavior.h>
#include <libhashkit/digest.h> #include <libhashkit/digest.h>
#include <libhashkit/function.h> #include <libhashkit/function.h>
#include <libhashkit/str_algorithm.h>
#include <libhashkit/strerror.h> #include <libhashkit/strerror.h>
#ifdef __cplusplus #ifdef __cplusplus
#include <string>
extern "C" { extern "C" {
#endif #endif
HASHKIT_API HASHKIT_API
hashkit_st *hashkit_create(hashkit_st *hash); hashkit_st *hashkit_create(hashkit_st *hash);
HASHKIT_API HASHKIT_API
hashkit_st *hashkit_clone(hashkit_st *destination, const hashkit_st *ptr); hashkit_st *hashkit_clone(hashkit_st *destination, const hashkit_st *ptr);
HASHKIT_API HASHKIT_API
skipping to change at line 69 skipping to change at line 67
struct { struct {
bool is_base_same_distributed:1; bool is_base_same_distributed:1;
} flags; } flags;
struct { struct {
bool is_allocated:1; bool is_allocated:1;
} options; } options;
}; };
#ifdef __cplusplus #ifdef __cplusplus
class Hashkit : private hashkit_st {
#include <string>
class Hashkit {
public: public:
Hashkit() Hashkit()
{ {
hashkit_create(this); hashkit_create(&self);
} }
Hashkit(const Hashkit& source) Hashkit(const Hashkit& source)
{ {
hashkit_clone(this, &source); hashkit_clone(&self, &source.self);
} }
Hashkit& operator=(const Hashkit& source) Hashkit& operator=(const Hashkit& source)
{ {
hashkit_free(this); hashkit_free(&self);
hashkit_clone(this, &source); hashkit_clone(&self, &source.self);
return *this; return *this;
} }
friend bool operator==(const Hashkit &left, const Hashkit &right) friend bool operator==(const Hashkit &left, const Hashkit &right)
{ {
return hashkit_compare(&left, &right); return hashkit_compare(&left.self, &right.self);
} }
uint32_t digest(std::string& str) uint32_t digest(std::string& str)
{ {
return hashkit_digest(this, str.c_str(), str.length()); return hashkit_digest(&self, str.c_str(), str.length());
} }
uint32_t digest(const char *key, size_t key_length) uint32_t digest(const char *key, size_t key_length)
{ {
return hashkit_digest(this, key, key_length); return hashkit_digest(&self, key, key_length);
} }
hashkit_return_t set_function(hashkit_hash_algorithm_t hash_algorithm) hashkit_return_t set_function(hashkit_hash_algorithm_t hash_algorithm)
{ {
return hashkit_set_function(this, hash_algorithm); return hashkit_set_function(&self, hash_algorithm);
} }
hashkit_return_t set_distribution_function(hashkit_hash_algorithm_t hash_ algorithm) hashkit_return_t set_distribution_function(hashkit_hash_algorithm_t hash_ algorithm)
{ {
return hashkit_set_function(this, hash_algorithm); return hashkit_set_function(&self, hash_algorithm);
} }
~Hashkit() ~Hashkit()
{ {
hashkit_free(this); hashkit_free(&self);
} }
private:
hashkit_st self;
}; };
#endif #endif
#endif /* HASHKIT_H */ #endif /* HASHKIT_H */
 End of changes. 13 change blocks. 
14 lines changed or deleted 18 lines changed or added


 memcached.h   memcached.h 
/* LibMemcached /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
* Copyright (C) 2006-2009 Brian Aker
* All rights reserved.
* *
* Use and distribution licensed under the BSD license. See * Libmemcached library
* the COPYING file in the parent directory for full text.
* *
* Summary: interface for memcached server * Copyright (C) 2011 Data Differential, http://datadifferential.com/
* Description: main include file for libmemcached * Copyright (C) 2006-2009 Brian Aker All rights reserved.
*
* 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.
* *
*/ */
#ifndef __LIBMEMCACHED_MEMCACHED_H__ #ifndef __LIBMEMCACHED_MEMCACHED_H__
#define __LIBMEMCACHED_MEMCACHED_H__ #define __LIBMEMCACHED_MEMCACHED_H__
#include <inttypes.h> #include <inttypes.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/types.h> #include <sys/types.h>
#if !defined(__cplusplus) #if !defined(__cplusplus)
# include <stdbool.h> # include <stdbool.h>
#endif #endif
#include <libmemcached/visibility.h> #include <libmemcached/visibility.h>
#include <libmemcached/configure.h> #include <libmemcached/configure.h>
#include <libmemcached/platform.h> #include <libmemcached/platform.h>
#include <libmemcached/constants.h> #include <libmemcached/constants.h>
#include <libmemcached/types.h> #include <libmemcached/types.h>
#include <libmemcached/string.h> #include <libmemcached/string.h>
#include <libmemcached/array.h>
#include <libmemcached/error.h>
#include <libmemcached/stats.h> #include <libmemcached/stats.h>
#include <libhashkit/hashkit.h> #include <libhashkit/hashkit.h>
// Everything above this line must be in the order specified. // Everything above this line must be in the order specified.
#include <libmemcached/allocators.h> #include <libmemcached/allocators.h>
#include <libmemcached/analyze.h> #include <libmemcached/analyze.h>
#include <libmemcached/auto.h> #include <libmemcached/auto.h>
#include <libmemcached/behavior.h> #include <libmemcached/behavior.h>
#include <libmemcached/callback.h> #include <libmemcached/callback.h>
#include <libmemcached/delete.h> #include <libmemcached/delete.h>
#include <libmemcached/dump.h> #include <libmemcached/dump.h>
#include <libmemcached/fetch.h> #include <libmemcached/fetch.h>
#include <libmemcached/flush.h> #include <libmemcached/flush.h>
#include <libmemcached/flush_buffers.h> #include <libmemcached/flush_buffers.h>
#include <libmemcached/get.h> #include <libmemcached/get.h>
#include <libmemcached/hash.h> #include <libmemcached/hash.h>
#include <libmemcached/options.h>
#include <libmemcached/parse.h> #include <libmemcached/parse.h>
#include <libmemcached/quit.h> #include <libmemcached/quit.h>
#include <libmemcached/result.h> #include <libmemcached/result.h>
#include <libmemcached/server.h> #include <libmemcached/server.h>
#include <libmemcached/server_list.h> #include <libmemcached/server_list.h>
#include <libmemcached/storage.h> #include <libmemcached/storage.h>
#include <libmemcached/strerror.h> #include <libmemcached/strerror.h>
#include <libmemcached/verbosity.h> #include <libmemcached/verbosity.h>
#include <libmemcached/version.h> #include <libmemcached/version.h>
#include <libmemcached/sasl.h> #include <libmemcached/sasl.h>
struct memcached_st { struct memcached_st {
/** /**
@note these are static and should not change without a call to behavior . @note these are static and should not change without a call to behavior .
*/ */
struct { struct {
bool is_purging:1; bool is_purging:1;
bool is_processing_input:1; bool is_processing_input:1;
bool is_time_for_rebuild:1; bool is_time_for_rebuild:1;
} state; } state;
struct { struct {
// Everything below here is pretty static. // Everything below here is pretty static.
bool auto_eject_hosts:1; bool auto_eject_hosts:1;
bool binary_protocol:1; bool binary_protocol:1;
bool buffer_requests:1; bool buffer_requests:1;
bool cork:1;
bool hash_with_prefix_key:1; bool hash_with_prefix_key:1;
bool ketama_weighted:1;
bool no_block:1; // Don't block bool no_block:1; // Don't block
bool no_reply:1; bool no_reply:1;
bool randomize_replica_read:1; bool randomize_replica_read:1;
bool reuse_memory:1;
bool support_cas:1; bool support_cas:1;
bool tcp_nodelay:1; bool tcp_nodelay:1;
bool use_cache_lookups:1;
bool use_sort_hosts:1; bool use_sort_hosts:1;
bool use_udp:1; bool use_udp:1;
bool verify_key:1; bool verify_key:1;
bool tcp_keepalive:1; bool tcp_keepalive:1;
} flags; } flags;
memcached_server_distribution_t distribution; memcached_server_distribution_t distribution;
hashkit_st hashkit; hashkit_st hashkit;
uint32_t continuum_points_counter; // Ketama
uint32_t number_of_hosts; uint32_t number_of_hosts;
memcached_server_st *servers; memcached_server_st *servers;
memcached_server_st *last_disconnected_server; memcached_server_st *last_disconnected_server;
int32_t snd_timeout; int32_t snd_timeout;
int32_t rcv_timeout; int32_t rcv_timeout;
uint32_t server_failure_limit; uint32_t server_failure_limit;
uint32_t io_msg_watermark; uint32_t io_msg_watermark;
uint32_t io_bytes_watermark; uint32_t io_bytes_watermark;
uint32_t io_key_prefetch; uint32_t io_key_prefetch;
uint32_t tcp_keepidle; uint32_t tcp_keepidle;
int cached_errno;
int32_t poll_timeout; int32_t poll_timeout;
int32_t connect_timeout; int32_t connect_timeout;
int32_t retry_timeout; int32_t retry_timeout;
uint32_t continuum_count; // Ketama
int send_size; int send_size;
int recv_size; int recv_size;
void *user_data; void *user_data;
time_t next_distribution_rebuild; // Ketama uint64_t query_id;
size_t prefix_key_length;
uint32_t number_of_replicas; uint32_t number_of_replicas;
hashkit_st distribution_hashkit; hashkit_st distribution_hashkit;
memcached_result_st result; memcached_result_st result;
memcached_continuum_item_st *continuum; // Ketama
struct {
bool weighted;
uint32_t continuum_count; // Ketama
uint32_t continuum_points_counter; // Ketama
time_t next_distribution_rebuild; // Ketama
memcached_continuum_item_st *continuum; // Ketama
} ketama;
struct memcached_virtual_bucket_t *virtual_bucket;
struct _allocators_st { struct _allocators_st {
memcached_calloc_fn calloc; memcached_calloc_fn calloc;
memcached_free_fn free; memcached_free_fn free;
memcached_malloc_fn malloc; memcached_malloc_fn malloc;
memcached_realloc_fn realloc; memcached_realloc_fn realloc;
void *context; void *context;
} allocators; } allocators;
memcached_clone_fn on_clone; memcached_clone_fn on_clone;
memcached_cleanup_fn on_cleanup; memcached_cleanup_fn on_cleanup;
memcached_trigger_key_fn get_key_failure; memcached_trigger_key_fn get_key_failure;
memcached_trigger_delete_key_fn delete_trigger; memcached_trigger_delete_key_fn delete_trigger;
memcached_callback_st *callbacks; memcached_callback_st *callbacks;
struct memcached_sasl_st sasl; struct memcached_sasl_st sasl;
char prefix_key[MEMCACHED_PREFIX_KEY_MAX_SIZE]; struct memcached_error_t *error_messages;
struct memcached_array_st *prefix_key;
struct {
uint32_t initial_pool_size;
uint32_t max_pool_size;
struct memcached_array_st *filename;
} configure;
struct { struct {
bool is_allocated:1; bool is_allocated:1;
} options; } options;
}; };
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
LIBMEMCACHED_API LIBMEMCACHED_API
void memcached_servers_reset(memcached_st *ptr); void memcached_servers_reset(memcached_st *ptr);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_st *memcached_create(memcached_st *ptr); memcached_st *memcached_create(memcached_st *ptr);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_st *memcached(const char *string, size_t string_length);
LIBMEMCACHED_API
void memcached_free(memcached_st *ptr); void memcached_free(memcached_st *ptr);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_reset(memcached_st *ptr);
LIBMEMCACHED_API
void memcached_reset_last_disconnected_server(memcached_st *ptr); void memcached_reset_last_disconnected_server(memcached_st *ptr);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_st *memcached_clone(memcached_st *clone, const memcached_st *ptr) ; memcached_st *memcached_clone(memcached_st *clone, const memcached_st *ptr) ;
LIBMEMCACHED_API LIBMEMCACHED_API
void *memcached_get_user_data(const memcached_st *ptr); void *memcached_get_user_data(const memcached_st *ptr);
LIBMEMCACHED_API LIBMEMCACHED_API
void *memcached_set_user_data(memcached_st *ptr, void *data); void *memcached_set_user_data(memcached_st *ptr, void *data);
skipping to change at line 172 skipping to change at line 215
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_server_instance_st memcached_server_instance_by_position(const me mcached_st *ptr, uint32_t server_key); memcached_server_instance_st memcached_server_instance_by_position(const me mcached_st *ptr, uint32_t server_key);
LIBMEMCACHED_API LIBMEMCACHED_API
uint32_t memcached_server_count(const memcached_st *); uint32_t memcached_server_count(const memcached_st *);
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
#endif #endif
#ifdef __cplusplus
class Memcached : private memcached_st {
public:
Memcached()
{
memcached_create(this);
}
~Memcached()
{
memcached_free(this);
}
Memcached(const Memcached& source)
{
memcached_clone(this, &source);
}
Memcached& operator=(const Memcached& source)
{
memcached_free(this);
memcached_clone(this, &source);
return *this;
}
};
#endif
#endif /* __LIBMEMCACHED_MEMCACHED_H__ */ #endif /* __LIBMEMCACHED_MEMCACHED_H__ */
 End of changes. 20 change blocks. 
47 lines changed or deleted 61 lines changed or added


 memcached.hpp   memcached.hpp 
skipping to change at line 15 skipping to change at line 15
* *
* Authors: Padraig O'Sullivan <osullivan.padraig@gmail.com> * Authors: Padraig O'Sullivan <osullivan.padraig@gmail.com>
* Patrick Galbraith <patg@patg.net> * Patrick Galbraith <patg@patg.net>
*/ */
/** /**
* @file memcached.hpp * @file memcached.hpp
* @brief Libmemcached C++ interface * @brief Libmemcached C++ interface
*/ */
#pragma once
#ifndef LIBMEMCACHEDPP_H #ifndef LIBMEMCACHEDPP_H
#define LIBMEMCACHEDPP_H #define LIBMEMCACHEDPP_H
#include <libmemcached/memcached.h> #include <libmemcached/memcached.h>
#include <libmemcached/exception.hpp> #include <libmemcached/exception.hpp>
#include <string.h> #include <string.h>
#include <sstream> #include <sstream>
#include <string> #include <string>
skipping to change at line 243 skipping to change at line 244
size_t value_length= 0; size_t value_length= 0;
size_t key_length= 0; size_t key_length= 0;
memcached_return_t rc; memcached_return_t rc;
uint32_t flags= 0; uint32_t flags= 0;
char *value= memcached_fetch(&memc, ret_key, &key_length, char *value= memcached_fetch(&memc, ret_key, &key_length,
&value_length, &flags, &rc); &value_length, &flags, &rc);
if (value && ret_val.empty()) if (value && ret_val.empty())
{ {
ret_val.reserve(value_length); ret_val.reserve(value_length);
ret_val.assign(value, value + value_length); ret_val.assign(value, value + value_length);
key.assign(ret_key); key.assign(ret_key, key_length);
free(value); free(value);
} }
else if (value) else if (value)
{ {
free(value); free(value);
} }
return rc; return rc;
} }
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added


 parse.h   parse.h 
skipping to change at line 12 skipping to change at line 12
* Copyright (C) 2010 Brian Aker * Copyright (C) 2010 Brian Aker
* All rights reserved. * All rights reserved.
* *
* Use and distribution licensed under the BSD license. See * Use and distribution licensed under the BSD license. See
* the COPYING file in the parent directory for full text. * the COPYING file in the parent directory for full text.
* *
* Summary: Work with fetching results * Summary: Work with fetching results
* *
*/ */
#ifndef __LIBMEMCACHED_PARSE_H__ #pragma once
#define __LIBMEMCACHED_PARSE_H__
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_server_list_st memcached_servers_parse(const char *server_strings ); memcached_server_list_st memcached_servers_parse(const char *server_strings );
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __LIBMEMCACHED_PARSE_H__ */
 End of changes. 2 change blocks. 
2 lines changed or deleted 1 lines changed or added


 pool.h   pool.h 
skipping to change at line 25 skipping to change at line 25
#include <libmemcached/memcached.h> #include <libmemcached/memcached.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
struct memcached_pool_st; struct memcached_pool_st;
typedef struct memcached_pool_st memcached_pool_st; typedef struct memcached_pool_st memcached_pool_st;
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_pool_st *memcached_pool_create(memcached_st* mmc, uint32_t initia memcached_pool_st *memcached_pool_create(memcached_st* mmc, uint32_t initia
l, l, uint32_t max);
uint32_t max);
LIBMEMCACHED_API
memcached_pool_st *memcached_pool(const char *option_string, size_t option_
string_length);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_st* memcached_pool_destroy(memcached_pool_st* pool); memcached_st* memcached_pool_destroy(memcached_pool_st* pool);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_st* memcached_pool_pop(memcached_pool_st* pool, memcached_st* memcached_pool_pop(memcached_pool_st* pool,
bool block, bool block,
memcached_return_t* rc); memcached_return_t* rc);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_pool_push(memcached_pool_st* pool, memcached_return_t memcached_pool_push(memcached_pool_st* pool,
memcached_st* mmc); memcached_st* mmc);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_pool_behavior_set(memcached_pool_st *ptr, memcached_return_t memcached_pool_behavior_set(memcached_pool_st *ptr,
 End of changes. 2 change blocks. 
3 lines changed or deleted 8 lines changed or added


 protocol_binary.h   protocol_binary.h 
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/* /*
* Copyright (c) <2008>, Sun Microsystems, Inc. * Copyright (c) <2008>, Sun Microsystems, Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are m et: * modification, are permitted provided that the following conditions are m et:
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright * * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in th e * notice, this list of conditions and the following disclaimer in th e
skipping to change at line 38 skipping to change at line 39
* Summary: Constants used by to implement the binary protocol. * Summary: Constants used by to implement the binary protocol.
* *
* Copy: See Copyright for the status of this software. * Copy: See Copyright for the status of this software.
* *
* Author: Trond Norbye <trond.norbye@sun.com> * Author: Trond Norbye <trond.norbye@sun.com>
*/ */
#ifndef PROTOCOL_BINARY_H #ifndef PROTOCOL_BINARY_H
#define PROTOCOL_BINARY_H #define PROTOCOL_BINARY_H
#include "vbucket.h"
/** /**
* \addtogroup Protocol * \addtogroup Protocol
* @{ * @{
*/ */
/** /**
* This file contains definitions of the constants and packet formats * This file contains definitions of the constants and packet formats
* defined in the binary specification. Please note that you _MUST_ remembe r * defined in the binary specification. Please note that you _MUST_ remembe r
* to convert each multibyte field to / from network byte order to / from * to convert each multibyte field to / from network byte order to / from
* host order. * host order.
skipping to change at line 75 skipping to change at line 78
* See section 3.2 Response Status * See section 3.2 Response Status
*/ */
typedef enum { typedef enum {
PROTOCOL_BINARY_RESPONSE_SUCCESS = 0x00, PROTOCOL_BINARY_RESPONSE_SUCCESS = 0x00,
PROTOCOL_BINARY_RESPONSE_KEY_ENOENT = 0x01, PROTOCOL_BINARY_RESPONSE_KEY_ENOENT = 0x01,
PROTOCOL_BINARY_RESPONSE_KEY_EEXISTS = 0x02, PROTOCOL_BINARY_RESPONSE_KEY_EEXISTS = 0x02,
PROTOCOL_BINARY_RESPONSE_E2BIG = 0x03, PROTOCOL_BINARY_RESPONSE_E2BIG = 0x03,
PROTOCOL_BINARY_RESPONSE_EINVAL = 0x04, PROTOCOL_BINARY_RESPONSE_EINVAL = 0x04,
PROTOCOL_BINARY_RESPONSE_NOT_STORED = 0x05, PROTOCOL_BINARY_RESPONSE_NOT_STORED = 0x05,
PROTOCOL_BINARY_RESPONSE_DELTA_BADVAL = 0x06, PROTOCOL_BINARY_RESPONSE_DELTA_BADVAL = 0x06,
PROTOCOL_BINARY_RESPONSE_NOT_MY_VBUCKET = 0x07,
PROTOCOL_BINARY_RESPONSE_AUTH_ERROR = 0x20, PROTOCOL_BINARY_RESPONSE_AUTH_ERROR = 0x20,
PROTOCOL_BINARY_RESPONSE_AUTH_CONTINUE = 0x21, PROTOCOL_BINARY_RESPONSE_AUTH_CONTINUE = 0x21,
PROTOCOL_BINARY_RESPONSE_UNKNOWN_COMMAND = 0x81, PROTOCOL_BINARY_RESPONSE_UNKNOWN_COMMAND = 0x81,
PROTOCOL_BINARY_RESPONSE_ENOMEM = 0x82, PROTOCOL_BINARY_RESPONSE_ENOMEM = 0x82,
PROTOCOL_BINARY_RESPONSE_NOT_SUPPORTED = 0x83,
PROTOCOL_BINARY_RESPONSE_PAUSE = 0xfe00, PROTOCOL_BINARY_RESPONSE_EINTERNAL = 0x84,
PROTOCOL_BINARY_RESPONSE_EIO = 0xff00 PROTOCOL_BINARY_RESPONSE_EBUSY = 0x85,
PROTOCOL_BINARY_RESPONSE_ETMPFAIL = 0x86
} protocol_binary_response_status; } protocol_binary_response_status;
/** /**
* Defintion of the different command opcodes. * Defintion of the different command opcodes.
* See section 3.3 Command Opcodes * See section 3.3 Command Opcodes
*/ */
typedef enum { typedef enum {
PROTOCOL_BINARY_CMD_GET = 0x00, PROTOCOL_BINARY_CMD_GET = 0x00,
PROTOCOL_BINARY_CMD_SET = 0x01, PROTOCOL_BINARY_CMD_SET = 0x01,
PROTOCOL_BINARY_CMD_ADD = 0x02, PROTOCOL_BINARY_CMD_ADD = 0x02,
skipping to change at line 117 skipping to change at line 121
PROTOCOL_BINARY_CMD_SETQ = 0x11, PROTOCOL_BINARY_CMD_SETQ = 0x11,
PROTOCOL_BINARY_CMD_ADDQ = 0x12, PROTOCOL_BINARY_CMD_ADDQ = 0x12,
PROTOCOL_BINARY_CMD_REPLACEQ = 0x13, PROTOCOL_BINARY_CMD_REPLACEQ = 0x13,
PROTOCOL_BINARY_CMD_DELETEQ = 0x14, PROTOCOL_BINARY_CMD_DELETEQ = 0x14,
PROTOCOL_BINARY_CMD_INCREMENTQ = 0x15, PROTOCOL_BINARY_CMD_INCREMENTQ = 0x15,
PROTOCOL_BINARY_CMD_DECREMENTQ = 0x16, PROTOCOL_BINARY_CMD_DECREMENTQ = 0x16,
PROTOCOL_BINARY_CMD_QUITQ = 0x17, PROTOCOL_BINARY_CMD_QUITQ = 0x17,
PROTOCOL_BINARY_CMD_FLUSHQ = 0x18, PROTOCOL_BINARY_CMD_FLUSHQ = 0x18,
PROTOCOL_BINARY_CMD_APPENDQ = 0x19, PROTOCOL_BINARY_CMD_APPENDQ = 0x19,
PROTOCOL_BINARY_CMD_PREPENDQ = 0x1a, PROTOCOL_BINARY_CMD_PREPENDQ = 0x1a,
PROTOCOL_BINARY_CMD_VERBOSITY = 0x1b,
PROTOCOL_BINARY_CMD_TOUCH = 0x1c,
PROTOCOL_BINARY_CMD_GAT = 0x1d,
PROTOCOL_BINARY_CMD_GATQ = 0x1e,
PROTOCOL_BINARY_CMD_SASL_LIST_MECHS = 0x20, PROTOCOL_BINARY_CMD_SASL_LIST_MECHS = 0x20,
PROTOCOL_BINARY_CMD_SASL_AUTH = 0x21, PROTOCOL_BINARY_CMD_SASL_AUTH = 0x21,
PROTOCOL_BINARY_CMD_SASL_STEP = 0x22, PROTOCOL_BINARY_CMD_SASL_STEP = 0x22,
/* These commands are used for range operations and exist within /* These commands are used for range operations and exist within
* this header for use in other projects. Range operations are * this header for use in other projects. Range operations are
* not expected to be implemented in the memcached server itself. * not expected to be implemented in the memcached server itself.
*/ */
PROTOCOL_BINARY_CMD_RGET = 0x30, PROTOCOL_BINARY_CMD_RGET = 0x30,
skipping to change at line 138 skipping to change at line 146
PROTOCOL_BINARY_CMD_RSETQ = 0x32, PROTOCOL_BINARY_CMD_RSETQ = 0x32,
PROTOCOL_BINARY_CMD_RAPPEND = 0x33, PROTOCOL_BINARY_CMD_RAPPEND = 0x33,
PROTOCOL_BINARY_CMD_RAPPENDQ = 0x34, PROTOCOL_BINARY_CMD_RAPPENDQ = 0x34,
PROTOCOL_BINARY_CMD_RPREPEND = 0x35, PROTOCOL_BINARY_CMD_RPREPEND = 0x35,
PROTOCOL_BINARY_CMD_RPREPENDQ = 0x36, PROTOCOL_BINARY_CMD_RPREPENDQ = 0x36,
PROTOCOL_BINARY_CMD_RDELETE = 0x37, PROTOCOL_BINARY_CMD_RDELETE = 0x37,
PROTOCOL_BINARY_CMD_RDELETEQ = 0x38, PROTOCOL_BINARY_CMD_RDELETEQ = 0x38,
PROTOCOL_BINARY_CMD_RINCR = 0x39, PROTOCOL_BINARY_CMD_RINCR = 0x39,
PROTOCOL_BINARY_CMD_RINCRQ = 0x3a, PROTOCOL_BINARY_CMD_RINCRQ = 0x3a,
PROTOCOL_BINARY_CMD_RDECR = 0x3b, PROTOCOL_BINARY_CMD_RDECR = 0x3b,
PROTOCOL_BINARY_CMD_RDECRQ = 0x3c PROTOCOL_BINARY_CMD_RDECRQ = 0x3c,
/* End Range operations */ /* End Range operations */
/* VBucket commands */
PROTOCOL_BINARY_CMD_SET_VBUCKET = 0x3d,
PROTOCOL_BINARY_CMD_GET_VBUCKET = 0x3e,
PROTOCOL_BINARY_CMD_DEL_VBUCKET = 0x3f,
/* End VBucket commands */
/* TAP commands */
PROTOCOL_BINARY_CMD_TAP_CONNECT = 0x40,
PROTOCOL_BINARY_CMD_TAP_MUTATION = 0x41,
PROTOCOL_BINARY_CMD_TAP_DELETE = 0x42,
PROTOCOL_BINARY_CMD_TAP_FLUSH = 0x43,
PROTOCOL_BINARY_CMD_TAP_OPAQUE = 0x44,
PROTOCOL_BINARY_CMD_TAP_VBUCKET_SET = 0x45,
PROTOCOL_BINARY_CMD_TAP_CHECKPOINT_START = 0x46,
PROTOCOL_BINARY_CMD_TAP_CHECKPOINT_END = 0x47,
/* End TAP */
PROTOCOL_BINARY_CMD_LAST_RESERVED = 0xef,
/* Scrub the data */
PROTOCOL_BINARY_CMD_SCRUB = 0xf0
} protocol_binary_command; } protocol_binary_command;
/** /**
* Definition of the data types in the packet * Definition of the data types in the packet
* See section 3.4 Data Types * See section 3.4 Data Types
*/ */
typedef enum { typedef enum {
PROTOCOL_BINARY_RAW_BYTES = 0x00 PROTOCOL_BINARY_RAW_BYTES = 0x00
} protocol_binary_datatypes; } protocol_binary_datatypes;
skipping to change at line 162 skipping to change at line 191
* Definition of the header structure for a request packet. * Definition of the header structure for a request packet.
* See section 2 * See section 2
*/ */
typedef union { typedef union {
struct { struct {
uint8_t magic; uint8_t magic;
uint8_t opcode; uint8_t opcode;
uint16_t keylen; uint16_t keylen;
uint8_t extlen; uint8_t extlen;
uint8_t datatype; uint8_t datatype;
uint16_t reserved; uint16_t vbucket;
uint32_t bodylen; uint32_t bodylen;
uint32_t opaque; uint32_t opaque;
uint64_t cas; uint64_t cas;
} request; } request;
uint8_t bytes[24]; uint8_t bytes[24];
} protocol_binary_request_header; } protocol_binary_request_header;
/** /**
* Definition of the header structure for a response packet. * Definition of the header structure for a response packet.
* See section 2 * See section 2
skipping to change at line 393 skipping to change at line 422
*/ */
typedef protocol_binary_request_no_extras protocol_binary_request_stats ; typedef protocol_binary_request_no_extras protocol_binary_request_stats ;
/** /**
* Definition of the packet returned from a successful stats command * Definition of the packet returned from a successful stats command
* See section 4 * See section 4
*/ */
typedef protocol_binary_response_no_extras protocol_binary_response_sta ts; typedef protocol_binary_response_no_extras protocol_binary_response_sta ts;
/** /**
* Definition of the packet used by the verbosity command
*/
typedef union {
struct {
protocol_binary_request_header header;
struct {
uint32_t level;
} body;
} message;
uint8_t bytes[sizeof(protocol_binary_request_header) + 4];
} protocol_binary_request_verbosity;
/**
* Definition of the packet returned from the verbosity command
*/
typedef protocol_binary_response_no_extras protocol_binary_response_ver
bosity;
/**
* Definition of the packet used by the touch command.
*/
typedef union {
struct {
protocol_binary_request_header header;
struct {
uint32_t expiration;
} body;
} message;
uint8_t bytes[sizeof(protocol_binary_request_header) + 4];
} protocol_binary_request_touch;
/**
* Definition of the packet returned from the touch command
*/
typedef protocol_binary_response_no_extras protocol_binary_response_tou
ch;
/**
* Definition of the packet used by the GAT(Q) command.
*/
typedef union {
struct {
protocol_binary_request_header header;
struct {
uint32_t expiration;
} body;
} message;
uint8_t bytes[sizeof(protocol_binary_request_header) + 4];
} protocol_binary_request_gat;
typedef protocol_binary_request_gat protocol_binary_request_gatq;
/**
* Definition of the packet returned from the GAT(Q)
*/
typedef protocol_binary_response_get protocol_binary_response_gat;
typedef protocol_binary_response_get protocol_binary_response_gatq;
/**
* Definition of a request for a range operation. * Definition of a request for a range operation.
* See http://code.google.com/p/memcached/wiki/RangeOps * See http://code.google.com/p/memcached/wiki/RangeOps
* *
* These types are used for range operations and exist within * These types are used for range operations and exist within
* this header for use in other projects. Range operations are * this header for use in other projects. Range operations are
* not expected to be implemented in the memcached server itself. * not expected to be implemented in the memcached server itself.
*/ */
typedef union { typedef union {
struct { struct {
protocol_binary_response_header header; protocol_binary_response_header header;
skipping to change at line 428 skipping to change at line 514
typedef protocol_binary_request_rangeop protocol_binary_request_rprepen d; typedef protocol_binary_request_rangeop protocol_binary_request_rprepen d;
typedef protocol_binary_request_rangeop protocol_binary_request_rprepen dq; typedef protocol_binary_request_rangeop protocol_binary_request_rprepen dq;
typedef protocol_binary_request_rangeop protocol_binary_request_rdelete ; typedef protocol_binary_request_rangeop protocol_binary_request_rdelete ;
typedef protocol_binary_request_rangeop protocol_binary_request_rdelete q; typedef protocol_binary_request_rangeop protocol_binary_request_rdelete q;
typedef protocol_binary_request_rangeop protocol_binary_request_rincr; typedef protocol_binary_request_rangeop protocol_binary_request_rincr;
typedef protocol_binary_request_rangeop protocol_binary_request_rincrq; typedef protocol_binary_request_rangeop protocol_binary_request_rincrq;
typedef protocol_binary_request_rangeop protocol_binary_request_rdecr; typedef protocol_binary_request_rangeop protocol_binary_request_rdecr;
typedef protocol_binary_request_rangeop protocol_binary_request_rdecrq; typedef protocol_binary_request_rangeop protocol_binary_request_rdecrq;
/** /**
* Definition of tap commands
* See To be written
*
*/
typedef union {
struct {
protocol_binary_request_header header;
struct {
/**
* flags is a bitmask used to set properties for the
* the connection. Please In order to be forward compatible
* you should set all undefined bits to 0.
*
* If the bit require extra userdata, it will be stored
* in the user-data field of the body (passed to the engine
* as enginespeciffic). That means that when you parse the
* flags and the engine-specific data, you have to work you
r
* way from bit 0 and upwards to find the correct offset fo
r
* the data.
*
*/
uint32_t flags;
/**
* Backfill age
*
* By using this flag you can limit the amount of data bein
g
* transmitted. If you don't specify a backfill age, the
* server will transmit everything it contains.
*
* The first 8 bytes in the engine specific data contains
* the oldest entry (from epoc) you're interested in.
* Specifying a time in the future (for the server you are
* connecting to), will cause it to start streaming current
* changes.
*/
#define TAP_CONNECT_FLAG_BACKFILL 0x01
/**
* Dump will cause the server to send the data stored on th
e
* server, but disconnect when the keys stored in the serve
r
* are transmitted.
*/
#define TAP_CONNECT_FLAG_DUMP 0x02
/**
* The body contains a list of 16 bits words in network byt
e
* order specifying the vbucket ids to monitor. The first 1
6
* bit word contains the number of buckets. The number of 0
* means "all buckets"
*/
#define TAP_CONNECT_FLAG_LIST_VBUCKETS 0x04
/**
* The responsibility of the vbuckets is to be transferred
* over to the caller when all items are transferred.
*/
#define TAP_CONNECT_FLAG_TAKEOVER_VBUCKETS 0x08
/**
* The tap consumer supports ack'ing of tap messages
*/
#define TAP_CONNECT_SUPPORT_ACK 0x10
/**
* The tap consumer would prefer to just get the keys
* back. If the engine supports this it will set
* the TAP_FLAG_NO_VALUE flag in each of the
* tap packets returned.
*/
#define TAP_CONNECT_REQUEST_KEYS_ONLY 0x20
/**
* The body contains a list of (vbucket_id, last_checkpoint
_id)
* pairs. This provides the checkpoint support in TAP strea
ms.
* The last checkpoint id represents the last checkpoint th
at
* was successfully persisted.
*/
#define TAP_CONNECT_CHECKPOINT 0x40
/**
* The tap consumer is a registered tap client, which means
that
* the tap server will maintain its checkpoint cursor perma
nently.
*/
#define TAP_CONNECT_REGISTERED_CLIENT 0x80
} body;
} message;
uint8_t bytes[sizeof(protocol_binary_request_header) + 4];
} protocol_binary_request_tap_connect;
typedef union {
struct {
protocol_binary_request_header header;
struct {
struct {
uint16_t enginespecific_length;
/*
* The flag section support the following flags
*/
/**
* Request that the consumer send a response packet
* for this packet. The opaque field must be preserved
* in the response.
*/
#define TAP_FLAG_ACK 0x01
/**
* The value for the key is not included in the packet
*/
#define TAP_FLAG_NO_VALUE 0x02
uint16_t flags;
uint8_t ttl;
uint8_t res1;
uint8_t res2;
uint8_t res3;
} tap;
struct {
uint32_t flags;
uint32_t expiration;
} item;
} body;
} message;
uint8_t bytes[sizeof(protocol_binary_request_header) + 16];
} protocol_binary_request_tap_mutation;
typedef union {
struct {
protocol_binary_request_header header;
struct {
struct {
uint16_t enginespecific_length;
/**
* See the definition of the flags for
* protocol_binary_request_tap_mutation for a descripti
on
* of the available flags.
*/
uint16_t flags;
uint8_t ttl;
uint8_t res1;
uint8_t res2;
uint8_t res3;
} tap;
} body;
} message;
uint8_t bytes[sizeof(protocol_binary_request_header) + 8];
} protocol_binary_request_tap_no_extras;
typedef protocol_binary_request_tap_no_extras protocol_binary_request_t
ap_delete;
typedef protocol_binary_request_tap_no_extras protocol_binary_request_t
ap_flush;
typedef protocol_binary_request_tap_no_extras protocol_binary_request_t
ap_opaque;
typedef protocol_binary_request_tap_no_extras protocol_binary_request_t
ap_vbucket_set;
/**
* Definition of the packet used by the scrub.
*/
typedef protocol_binary_request_no_extras protocol_binary_request_scrub
;
/**
* Definition of the packet returned from scrub.
*/
typedef protocol_binary_response_no_extras protocol_binary_response_scr
ub;
/**
* Definition of the packet used by set vbucket
*/
typedef union {
struct {
protocol_binary_request_header header;
struct {
vbucket_state_t state;
} body;
} message;
uint8_t bytes[sizeof(protocol_binary_request_header) + sizeof(vbuck
et_state_t)];
} protocol_binary_request_set_vbucket;
/**
* Definition of the packet returned from set vbucket
*/
typedef protocol_binary_response_no_extras protocol_binary_response_set
_vbucket;
/**
* Definition of the packet used by del vbucket
*/
typedef protocol_binary_request_no_extras protocol_binary_request_del_v
bucket;
/**
* Definition of the packet returned from del vbucket
*/
typedef protocol_binary_response_no_extras protocol_binary_response_del
_vbucket;
/**
* Definition of the packet used by get vbucket
*/
typedef protocol_binary_request_no_extras protocol_binary_request_get_v
bucket;
/**
* Definition of the packet returned from get vbucket
*/
typedef union {
struct {
protocol_binary_response_header header;
struct {
vbucket_state_t state;
} body;
} message;
uint8_t bytes[sizeof(protocol_binary_response_header) + sizeof(vbuc
ket_state_t)];
} protocol_binary_response_get_vbucket;
/**
* @} * @}
*/ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* PROTOCOL_BINARY_H */ #endif /* PROTOCOL_BINARY_H */
 End of changes. 10 change blocks. 
6 lines changed or deleted 318 lines changed or added


 quit.h   quit.h 
skipping to change at line 25 skipping to change at line 25
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
LIBMEMCACHED_API LIBMEMCACHED_API
void memcached_quit(memcached_st *ptr); void memcached_quit(memcached_st *ptr);
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
void memcached_quit_server(memcached_server_st *ptr, bool io_death); void memcached_quit_server(memcached_server_st *ptr, bool io_death);
LIBMEMCACHED_LOCAL
void send_quit(memcached_st *ptr);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __LIBMEMCACHED_QUIT_H__ */ #endif /* __LIBMEMCACHED_QUIT_H__ */
 End of changes. 1 change blocks. 
0 lines changed or deleted 3 lines changed or added


 result.h   result.h 
skipping to change at line 20 skipping to change at line 20
*/ */
#ifndef __LIBMEMCACHED_RESULT_H__ #ifndef __LIBMEMCACHED_RESULT_H__
#define __LIBMEMCACHED_RESULT_H__ #define __LIBMEMCACHED_RESULT_H__
struct memcached_result_st { struct memcached_result_st {
uint32_t item_flags; uint32_t item_flags;
time_t item_expiration; time_t item_expiration;
size_t key_length; size_t key_length;
uint64_t item_cas; uint64_t item_cas;
const memcached_st *root; memcached_st *root;
memcached_string_st value; memcached_string_st value;
char item_key[MEMCACHED_MAX_KEY]; char item_key[MEMCACHED_MAX_KEY];
struct { struct {
bool is_allocated:1; bool is_allocated:1;
bool is_initialized:1; bool is_initialized:1;
} options; } options;
/* Add result callback function */ /* Add result callback function */
}; };
#ifdef __cplusplus #ifdef __cplusplus
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 server.h   server.h 
skipping to change at line 19 skipping to change at line 19
* *
*/ */
#ifndef __LIBMEMCACHED_SERVER_H__ #ifndef __LIBMEMCACHED_SERVER_H__
#define __LIBMEMCACHED_SERVER_H__ #define __LIBMEMCACHED_SERVER_H__
struct memcached_server_st { struct memcached_server_st {
struct { struct {
bool is_allocated:1; bool is_allocated:1;
bool is_initialized:1; bool is_initialized:1;
bool sockaddr_inited:1;
bool is_shutting_down:1; bool is_shutting_down:1;
bool is_dead:1;
} options; } options;
uint32_t number_of_hosts; uint32_t number_of_hosts;
uint32_t cursor_active; uint32_t cursor_active;
in_port_t port; in_port_t port;
int cached_errno; int cached_errno;
memcached_socket_t fd; memcached_socket_t fd;
uint32_t io_bytes_sent; /* # bytes sent since last read */ uint32_t io_bytes_sent; /* # bytes sent since last read */
uint32_t server_failure_counter; uint32_t server_failure_counter;
uint32_t weight; uint32_t weight;
struct { // Place any "state" sort variables in here.
bool is_corked:1;
bool is_dead:1;
} state;
struct { struct {
uint32_t read; uint32_t read;
uint32_t write; uint32_t write;
} io_wait_count; } io_wait_count;
uint8_t major_version; // Default definition of UINT8_MAX means that it h as not been set. uint8_t major_version; // Default definition of UINT8_MAX means that it h as not been set.
uint8_t micro_version; // ditto uint8_t micro_version; // ditto
uint8_t minor_version; // ditto uint8_t minor_version; // ditto
memcached_connection_t type; memcached_connection_t type;
char *read_ptr; char *read_ptr;
char *cached_server_error; char *cached_server_error;
size_t read_buffer_length; size_t read_buffer_length;
size_t read_data_length; size_t read_data_length;
size_t write_buffer_offset; size_t write_buffer_offset;
struct addrinfo *address_info; struct addrinfo *address_info;
struct addrinfo *address_info_next;
time_t next_retry; time_t next_retry;
const memcached_st *root; const memcached_st *root;
uint64_t limit_maxbytes; uint64_t limit_maxbytes;
char read_buffer[MEMCACHED_MAX_BUFFER]; char read_buffer[MEMCACHED_MAX_BUFFER];
char write_buffer[MEMCACHED_MAX_BUFFER]; char write_buffer[MEMCACHED_MAX_BUFFER];
char hostname[NI_MAXHOST]; char hostname[NI_MAXHOST];
}; };
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
skipping to change at line 96 skipping to change at line 93
memcached_return_t memcached_server_add_udp(memcached_st *ptr, memcached_return_t memcached_server_add_udp(memcached_st *ptr,
const char *hostname, const char *hostname,
in_port_t port); in_port_t port);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_server_add_unix_socket(memcached_st *ptr, memcached_return_t memcached_server_add_unix_socket(memcached_st *ptr,
const char *filename); const char *filename);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_server_add(memcached_st *ptr, memcached_return_t memcached_server_add(memcached_st *ptr,
const char *hostname, in_port_t por t); const char *hostname, in_port_t por t);
LIBMEMCACHED_LOCAL
memcached_return_t memcached_server_add_parsed(memcached_st *ptr,
const char *hostname,
size_t hostname_length,
in_port_t port,
uint32_t weight);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_server_add_udp_with_weight(memcached_st *ptr, memcached_return_t memcached_server_add_udp_with_weight(memcached_st *ptr,
const char *hostnam e, const char *hostnam e,
in_port_t port, in_port_t port,
uint32_t weight); uint32_t weight);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_server_add_unix_socket_with_weight(memcached_s t *ptr, memcached_return_t memcached_server_add_unix_socket_with_weight(memcached_s t *ptr,
const char *filename, const char *filename,
uint32_t we ight); uint32_t we ight);
LIBMEMCACHED_API LIBMEMCACHED_API
 End of changes. 5 change blocks. 
5 lines changed or deleted 9 lines changed or added


 storage.h   storage.h 
skipping to change at line 59 skipping to change at line 59
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_cas(memcached_st *ptr, memcached_return_t memcached_cas(memcached_st *ptr,
const char *key, size_t key_length, const char *key, size_t key_length,
const char *value, size_t value_length, const char *value, size_t value_length,
time_t expiration, time_t expiration,
uint32_t flags, uint32_t flags,
uint64_t cas); uint64_t cas);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_set_by_key(memcached_st *ptr, memcached_return_t memcached_set_by_key(memcached_st *ptr,
const char *master_key, size_t mast er_key_length, const char *group_key, size_t group _key_length,
const char *key, size_t key_length, const char *key, size_t key_length,
const char *value, size_t value_len gth, const char *value, size_t value_len gth,
time_t expiration, time_t expiration,
uint32_t flags); uint32_t flags);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_add_by_key(memcached_st *ptr, memcached_return_t memcached_add_by_key(memcached_st *ptr,
const char *master_key, size_t mast er_key_length, const char *group_key, size_t group _key_length,
const char *key, size_t key_length, const char *key, size_t key_length,
const char *value, size_t value_len gth, const char *value, size_t value_len gth,
time_t expiration, time_t expiration,
uint32_t flags); uint32_t flags);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_replace_by_key(memcached_st *ptr, memcached_return_t memcached_replace_by_key(memcached_st *ptr,
const char *master_key, size_t master_key_length, const char *group_key, size_t g roup_key_length,
const char *key, size_t key_len gth, const char *key, size_t key_len gth,
const char *value, size_t value _length, const char *value, size_t value _length,
time_t expiration, time_t expiration,
uint32_t flags); uint32_t flags);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_prepend_by_key(memcached_st *ptr, memcached_return_t memcached_prepend_by_key(memcached_st *ptr,
const char *master_key, size_t master_key_length, const char *group_key, size_t g roup_key_length,
const char *key, size_t key_len gth, const char *key, size_t key_len gth,
const char *value, size_t value _length, const char *value, size_t value _length,
time_t expiration, time_t expiration,
uint32_t flags); uint32_t flags);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_append_by_key(memcached_st *ptr, memcached_return_t memcached_append_by_key(memcached_st *ptr,
const char *master_key, size_t m aster_key_length, const char *group_key, size_t gr oup_key_length,
const char *key, size_t key_leng th, const char *key, size_t key_leng th,
const char *value, size_t value_ length, const char *value, size_t value_ length,
time_t expiration, time_t expiration,
uint32_t flags); uint32_t flags);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_cas_by_key(memcached_st *ptr, memcached_return_t memcached_cas_by_key(memcached_st *ptr,
const char *master_key, size_t mast er_key_length, const char *group_key, size_t group _key_length,
const char *key, size_t key_length, const char *key, size_t key_length,
const char *value, size_t value_len gth, const char *value, size_t value_len gth,
time_t expiration, time_t expiration,
uint32_t flags, uint32_t flags,
uint64_t cas); uint64_t cas);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
 End of changes. 6 change blocks. 
6 lines changed or deleted 6 lines changed or added


 string.h   string.h 
skipping to change at line 12 skipping to change at line 12
* Copyright (C) 2006-2009 Brian Aker * Copyright (C) 2006-2009 Brian Aker
* All rights reserved. * All rights reserved.
* *
* Use and distribution licensed under the BSD license. See * Use and distribution licensed under the BSD license. See
* the COPYING file in the parent directory for full text. * the COPYING file in the parent directory for full text.
* *
* Summary: String structure used for libmemcached. * Summary: String structure used for libmemcached.
* *
*/ */
#pragma once
#ifndef __LIBMEMCACHED_STRING_H__ #ifndef __LIBMEMCACHED_STRING_H__
#define __LIBMEMCACHED_STRING_H__ #define __LIBMEMCACHED_STRING_H__
/** /**
Strings are always under our control so we make some assumptions Strings are always under our control so we make some assumptions
about them. about them.
1) is_initialized is always valid. 1) is_initialized is always valid.
2) A string once intialized will always be, until free where we 2) A string once intialized will always be, until free where we
unset this flag. unset this flag.
3) A string always has a root. 3) A string always has a root.
*/ */
struct memcached_string_st { struct memcached_string_st {
char *end; char *end;
char *string; char *string;
size_t current_size; size_t current_size;
const memcached_st *root; memcached_st *root;
struct { struct {
bool is_allocated:1; bool is_allocated:1;
bool is_initialized:1; bool is_initialized:1;
} options; } options;
}; };
struct memcached_string_t {
size_t size;
const char *c_str;
};
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
memcached_string_st *memcached_string_create(const memcached_st *ptr, memcached_string_st *memcached_string_create(const memcached_st *ptr,
memcached_string_st *string, memcached_string_st *string,
size_t initial_size); size_t initial_size);
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
memcached_return_t memcached_string_check(memcached_string_st *string, size _t need); memcached_return_t memcached_string_check(memcached_string_st *string, size _t need);
skipping to change at line 81 skipping to change at line 87
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
char *memcached_string_value_mutable(const memcached_string_st *self); char *memcached_string_value_mutable(const memcached_string_st *self);
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
void memcached_string_set_length(memcached_string_st *self, size_t length); void memcached_string_set_length(memcached_string_st *self, size_t length);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#ifdef BUILDING_LIBMEMCACHED
#ifdef __cplusplus
#define memcached_string_with_size(X) (X), (static_cast<size_t>((sizeof(X)
- 1)))
#define memcached_string_make(X) (static_cast<size_t>((sizeof(X) - 1))), (X
)
#else
#define memcached_string_with_size(X) (X), ((size_t)((sizeof(X) - 1)))
#define memcached_string_make(X) (((size_t)((sizeof(X) - 1))), (X)
#endif
#define memcached_string_make_from_cstr(X) (X), ((X) ? strlen(X) : 0)
#endif
#endif /* __LIBMEMCACHED_STRING_H__ */ #endif /* __LIBMEMCACHED_STRING_H__ */
 End of changes. 4 change blocks. 
1 lines changed or deleted 23 lines changed or added


 types.h   types.h 
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
/* HashKit *
* Copyright (C) 2009 Brian Aker * HashKit
* All rights reserved. *
* Copyright (C) 2011 Data Differential, http://datadifferential.com/
* Copyright (C) 2009 Brian Aker All rights reserved.
*
* 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.
* *
* Use and distribution licensed under the BSD license. See
* the COPYING file in the parent directory for full text.
*/ */
#ifndef HASHKIT_TYPES_H #ifndef HASHKIT_TYPES_H
#define HASHKIT_TYPES_H #define HASHKIT_TYPES_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
typedef enum { typedef enum {
HASHKIT_SUCCESS, HASHKIT_SUCCESS,
HASHKIT_FAILURE, HASHKIT_FAILURE,
HASHKIT_MEMORY_ALLOCATION_FAILURE, HASHKIT_MEMORY_ALLOCATION_FAILURE,
HASHKIT_INVALID_HASH,
HASHKIT_INVALID_ARGUMENT,
HASHKIT_MAXIMUM_RETURN /* Always add new error code before */ HASHKIT_MAXIMUM_RETURN /* Always add new error code before */
} hashkit_return_t; } hashkit_return_t;
typedef enum { typedef enum {
HASHKIT_HASH_DEFAULT= 0, // hashkit_one_at_a_time() HASHKIT_HASH_DEFAULT= 0, // hashkit_one_at_a_time()
HASHKIT_HASH_MD5, HASHKIT_HASH_MD5,
HASHKIT_HASH_CRC, HASHKIT_HASH_CRC,
HASHKIT_HASH_FNV1_64, HASHKIT_HASH_FNV1_64,
HASHKIT_HASH_FNV1A_64, HASHKIT_HASH_FNV1A_64,
HASHKIT_HASH_FNV1_32, HASHKIT_HASH_FNV1_32,
 End of changes. 3 change blocks. 
6 lines changed or deleted 36 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/