algorithm.h   algorithm.h 
skipping to change at line 14 skipping to change at line 14
* *
* 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.
*/ */
/** /**
* @file * @file
* @brief HashKit Header * @brief HashKit Header
*/ */
#ifndef HASHKIT_ALGORITHM_H #pragma once
#define HASHKIT_ALGORITHM_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
HASHKIT_API HASHKIT_API
uint32_t libhashkit_one_at_a_time(const char *key, size_t key_length); uint32_t libhashkit_one_at_a_time(const char *key, size_t key_length);
HASHKIT_API HASHKIT_API
uint32_t libhashkit_fnv1_64(const char *key, size_t key_length); uint32_t libhashkit_fnv1_64(const char *key, size_t key_length);
skipping to change at line 95 skipping to change at line 94
HASHKIT_LOCAL HASHKIT_LOCAL
uint32_t hashkit_md5(const char *key, size_t key_length, void *context); uint32_t hashkit_md5(const char *key, size_t key_length, void *context);
HASHKIT_API HASHKIT_API
void libhashkit_md5_signature(const unsigned char *key, size_t length, unsi gned char *result); void libhashkit_md5_signature(const unsigned char *key, size_t length, unsi gned char *result);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* HASHKIT_ALGORITHM_H */
 End of changes. 2 change blocks. 
2 lines changed or deleted 1 lines changed or added


 array.h   array.h 
skipping to change at line 45 skipping to change at line 45
* *
*/ */
#pragma once #pragma once
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
memcached_array_st *memcached_array_clone(memcached_st *memc, const memcach ed_array_st *original); memcached_array_st *memcached_array_clone(struct memcached_st *memc, const memcached_array_st *original);
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
memcached_array_st *memcached_strcpy(memcached_st *memc, const char *str, s ize_t str_length); memcached_array_st *memcached_strcpy(struct memcached_st *memc, const char *str, size_t str_length);
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
void memcached_array_free(memcached_array_st *array); void memcached_array_free(memcached_array_st *array);
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
size_t memcached_array_size(memcached_array_st *array); size_t memcached_array_size(memcached_array_st *array);
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
const char *memcached_array_string(memcached_array_st *array); const char *memcached_array_string(memcached_array_st *array);
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 behavior.h   behavior.h 
skipping to change at line 14 skipping to change at line 14
* *
* 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.
*/ */
/** /**
* @file * @file
* @brief HashKit Header * @brief HashKit Header
*/ */
#ifndef HASHKIT_BEHAVIOR_H #pragma once
#define HASHKIT_BEHAVIOR_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* HASHKIT_BEHAVIOR_H */
 End of changes. 2 change blocks. 
2 lines changed or deleted 1 lines changed or added


 callback.h   callback.h 
skipping to change at line 53 skipping to change at line 53
uint32_t number_of_callback; uint32_t number_of_callback;
}; };
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_callback_set(memcached_st *ptr, memcached_return_t memcached_callback_set(memcached_st *ptr,
const memcached_callback_t flag, const memcached_callback_t flag,
void *data); const void *data);
LIBMEMCACHED_API LIBMEMCACHED_API
void *memcached_callback_get(memcached_st *ptr, void *memcached_callback_get(memcached_st *ptr,
const memcached_callback_t flag, const memcached_callback_t flag,
memcached_return_t *error); memcached_return_t *error);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 configure.h   configure.h 
/* HashKit /* HashKit
* Copyright (C) 2009-2010 Brian Aker * Copyright (C) 2009-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.
*/ */
#ifndef LIBHASHKIT_CONFIGURE_H
#define LIBHASHKIT_CONFIGURE_H #pragma once
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* LIBHASHKIT_CONFIGURE_H */
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 constants.h   constants.h 
skipping to change at line 56 skipping to change at line 56
#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
#define MEMCACHED_MAXIMUM_INTEGER_DISPLAY_LENGTH 20 #define MEMCACHED_MAXIMUM_INTEGER_DISPLAY_LENGTH 20
#define MEMCACHED_SERVER_FAILURE_LIMIT 5
#define MEMCACHED_SERVER_FAILURE_RETRY_TIMEOUT 2
enum memcached_server_distribution_t { 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_CONSISTENT_WEIGHTED,
MEMCACHED_DISTRIBUTION_VIRTUAL_BUCKET, MEMCACHED_DISTRIBUTION_VIRTUAL_BUCKET,
MEMCACHED_DISTRIBUTION_CONSISTENT_MAX MEMCACHED_DISTRIBUTION_CONSISTENT_MAX
skipping to change at line 128 skipping to change at line 130
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,
MEMCACHED_CALLBACK_REALLOC_FUNCTION = 5, MEMCACHED_CALLBACK_REALLOC_FUNCTION = 5,
MEMCACHED_CALLBACK_FREE_FUNCTION = 6, MEMCACHED_CALLBACK_FREE_FUNCTION = 6,
#endif #endif
MEMCACHED_CALLBACK_GET_FAILURE = 7, MEMCACHED_CALLBACK_GET_FAILURE = 7,
MEMCACHED_CALLBACK_DELETE_TRIGGER = 8, MEMCACHED_CALLBACK_DELETE_TRIGGER = 8,
MEMCACHED_CALLBACK_MAX MEMCACHED_CALLBACK_MAX,
MEMCACHED_CALLBACK_NAMESPACE= MEMCACHED_CALLBACK_PREFIX_KEY
}; };
#ifndef __cplusplus #ifndef __cplusplus
typedef enum memcached_callback_t memcached_callback_t; typedef enum memcached_callback_t memcached_callback_t;
#endif #endif
enum memcached_hash_t { enum memcached_hash_t {
MEMCACHED_HASH_DEFAULT= 0, MEMCACHED_HASH_DEFAULT= 0,
MEMCACHED_HASH_MD5, MEMCACHED_HASH_MD5,
MEMCACHED_HASH_CRC, MEMCACHED_HASH_CRC,
skipping to change at line 155 skipping to change at line 158
MEMCACHED_HASH_JENKINS, MEMCACHED_HASH_JENKINS,
MEMCACHED_HASH_CUSTOM, MEMCACHED_HASH_CUSTOM,
MEMCACHED_HASH_MAX MEMCACHED_HASH_MAX
}; };
#ifndef __cplusplus #ifndef __cplusplus
typedef enum memcached_hash_t memcached_hash_t; typedef enum memcached_hash_t memcached_hash_t;
#endif #endif
enum memcached_connection_t { enum memcached_connection_t {
MEMCACHED_CONNECTION_UNKNOWN,
MEMCACHED_CONNECTION_TCP, MEMCACHED_CONNECTION_TCP,
MEMCACHED_CONNECTION_UDP, MEMCACHED_CONNECTION_UDP,
MEMCACHED_CONNECTION_UNIX_SOCKET, MEMCACHED_CONNECTION_UNIX_SOCKET
MEMCACHED_CONNECTION_MAX };
enum {
MEMCACHED_CONNECTION_UNKNOWN= 0,
MEMCACHED_CONNECTION_MAX= 0
}; };
#ifndef __cplusplus #ifndef __cplusplus
typedef enum memcached_connection_t memcached_connection_t; typedef enum memcached_connection_t memcached_connection_t;
#endif #endif
 End of changes. 4 change blocks. 
4 lines changed or deleted 10 lines changed or added


 digest.h   digest.h 
/* HashKit /* HashKit
* 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.
*/ */
#ifndef HASHKIT_DIGEST_H #pragma once
#define HASHKIT_DIGEST_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
HASHKIT_API HASHKIT_API
uint32_t hashkit_digest(const hashkit_st *self, const char *key, size_t key _length); uint32_t hashkit_digest(const hashkit_st *self, const char *key, size_t key _length);
/** /**
This is a utilitly function provided so that you can directly access hash es with a hashkit_st. This is a utilitly function provided so that you can directly access hash es with a hashkit_st.
*/ */
HASHKIT_API HASHKIT_API
uint32_t libhashkit_digest(const char *key, size_t key_length, hashkit_hash _algorithm_t hash_algorithm); uint32_t libhashkit_digest(const char *key, size_t key_length, hashkit_hash _algorithm_t hash_algorithm);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* HASHKIT_DIGEST_H */
 End of changes. 2 change blocks. 
2 lines changed or deleted 1 lines changed or added


 error.h   error.h 
skipping to change at line 44 skipping to change at line 44
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*/ */
#pragma once #pragma once
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
LIBMEMCACHED_LOCAL LIBMEMCACHED_API
void memcached_error_free(memcached_st *error); const char *memcached_last_error_message(memcached_st *);
LIBMEMCACHED_API
void memcached_error_print(const memcached_st *);
LIBMEMCACHED_API LIBMEMCACHED_API
const char *memcached_last_error_message(memcached_st *memc); memcached_return_t memcached_last_error(memcached_st *);
LIBMEMCACHED_API LIBMEMCACHED_API
void memcached_error_print(const memcached_st *self); int memcached_last_error_errno(memcached_st *);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_last_error(memcached_st *memc); const char *memcached_server_error(memcached_server_instance_st ptr);
LIBMEMCACHED_API LIBMEMCACHED_API
int memcached_last_error_errno(memcached_st *memc); memcached_return_t memcached_server_error_return(memcached_server_instanc e_st ptr);
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
#endif #endif
 End of changes. 5 change blocks. 
6 lines changed or deleted 9 lines changed or added


 exception.hpp   exception.hpp 
skipping to change at line 13 skipping to change at line 13
* *
* Copy: See Copyright for the status of this software. * Copy: See Copyright for the status of this software.
* *
*/ */
/** /**
* @file * @file
* @brief Exception declarations * @brief Exception declarations
*/ */
#ifndef LIBMEMACHED_EXCEPTION_HPP #pragma once
#define LIBMEMACHED_EXCEPTION_HPP
#include <stdexcept> #include <stdexcept>
#include <string> #include <string>
namespace memcache namespace memcache
{ {
class Exception : public std::runtime_error class Exception : public std::runtime_error
{ {
public: public:
Exception(const std::string& msg, int in_errno) Exception(const std::string& msg, int in_errno)
skipping to change at line 62 skipping to change at line 61
class Error : public Exception class Error : public Exception
{ {
public: public:
Error(const std::string& msg, int in_errno) : Exception(msg, in_errno) {} Error(const std::string& msg, int in_errno) : Exception(msg, in_errno) {}
Error(const char *msg, int in_errno) : Exception(msg, in_errno) {} Error(const char *msg, int in_errno) : Exception(msg, in_errno) {}
virtual ~Error() throw() {} virtual ~Error() throw() {}
}; };
} /* namespace libmemcached */ } /* namespace libmemcached */
#endif /* LIBMEMACHED_EXCEPTION_HPP */
 End of changes. 2 change blocks. 
2 lines changed or deleted 1 lines changed or added


 memcached.h   memcached.h 
skipping to change at line 73 skipping to change at line 73
#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/namespace.h>
#include <libmemcached/options.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>
skipping to change at line 100 skipping to change at line 101
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 hash_with_prefix_key:1; bool hash_with_namespace: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 support_cas:1; bool support_cas:1;
bool tcp_nodelay:1; bool tcp_nodelay: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;
struct {
unsigned int version;
} server_info;
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;
int32_t poll_timeout; int32_t poll_timeout;
int32_t connect_timeout; int32_t connect_timeout; // How long we will wait on connect() before we will timeout
int32_t retry_timeout; int32_t retry_timeout;
int send_size; int send_size;
int recv_size; int recv_size;
void *user_data; void *user_data;
uint64_t query_id; uint64_t query_id;
uint32_t number_of_replicas; uint32_t number_of_replicas;
memcached_result_st result; memcached_result_st result;
struct { struct {
bool weighted; bool weighted;
skipping to change at line 153 skipping to change at line 157
struct memcached_allocator_t allocators; struct memcached_allocator_t 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;
struct memcached_error_t *error_messages; struct memcached_error_t *error_messages;
struct memcached_array_st *prefix_key; struct memcached_array_st *_namespace;
struct { struct {
uint32_t initial_pool_size; uint32_t initial_pool_size;
uint32_t max_pool_size; uint32_t max_pool_size;
int32_t version; // This is used by pool and others to determine if the memcached_st is out of date. int32_t version; // This is used by pool and others to determine if the memcached_st is out of date.
struct memcached_array_st *filename; struct memcached_array_st *filename;
} configure; } configure;
struct { struct {
bool is_allocated:1; bool is_allocated:1;
} options; } options;
 End of changes. 5 change blocks. 
3 lines changed or deleted 7 lines changed or added


 memcached.hpp   memcached.hpp 
skipping to change at line 101 skipping to change at line 101
* *
* @param[in] rc a memcached_return_t structure * @param[in] rc a memcached_return_t structure
* @return error string corresponding to given return code in the library . * @return error string corresponding to given return code in the library .
*/ */
const std::string getError(memcached_return_t rc) const const std::string getError(memcached_return_t rc) const
{ {
/* first parameter to strerror is unused */ /* first parameter to strerror is unused */
return memcached_strerror(NULL, rc); return memcached_strerror(NULL, rc);
} }
bool error(std::string& error_message) const
{
if (memcached_failed(memcached_last_error(memc)))
{
error_message+= memcached_last_error_message(memc);
return true;
}
return false;
}
bool error() const
{
if (memcached_failed(memcached_last_error(memc)))
{
return true;
}
return false;
}
bool error(memcached_return_t& arg) const
{
arg= memcached_last_error(memc);
return memcached_failed(arg);
}
bool setBehavior(memcached_behavior_t flag, uint64_t data) bool setBehavior(memcached_behavior_t flag, uint64_t data)
{ {
return (memcached_success(memcached_behavior_set(memc, flag, data))); return (memcached_success(memcached_behavior_set(memc, flag, data)));
} }
uint64_t getBehavior(memcached_behavior_t flag) uint64_t getBehavior(memcached_behavior_t flag)
{ {
return memcached_behavior_get(memc, flag); return memcached_behavior_get(memc, flag);
} }
/** /**
* Configure the memcache object * Configure the memcache object
* *
* @param[in] in_config configuration * @param[in] in_config configuration
* @return true on success; false otherwise * @return true on success; false otherwise
*/ */
bool configure(const std::string &configuration) bool configure(const std::string &configuration)
{ {
return memcached_success(memcached_parse_configuration(memc, configurat memcached_st *new_memc= memcached(configuration.c_str(), configuration.
ion.c_str(), configuration.size())); size());
if (new_memc)
{
memcached_free(memc);
memc= new_memc;
return true;
}
return false;
} }
/** /**
* Add a server to the list of memcached servers to use. * Add a server to the list of memcached servers to use.
* *
* @param[in] server_name name of the server to add * @param[in] server_name name of the server to add
* @param[in] port port number of server to add * @param[in] port port number of server to add
* @return true on success; false otherwise * @return true on success; false otherwise
*/ */
bool addServer(const std::string &server_name, in_port_t port) bool addServer(const std::string &server_name, in_port_t port)
skipping to change at line 322 skipping to change at line 359
*/ */
bool set(const std::string &key, bool set(const std::string &key,
const std::vector<char> &value, const std::vector<char> &value,
time_t expiration, time_t expiration,
uint32_t flags) uint32_t flags)
{ {
memcached_return_t rc= memcached_set(memc, memcached_return_t rc= memcached_set(memc,
key.c_str(), key.length(), key.c_str(), key.length(),
&value[0], value.size(), &value[0], value.size(),
expiration, flags); expiration, flags);
return (rc == MEMCACHED_SUCCESS || rc == MEMCACHED_BUFFERED); return memcached_success(rc);
} }
/** /**
* Writes an object to a server specified by the master_key parameter. * Writes an object to a server specified by the master_key parameter.
* If the object already exists, it will overwrite the existing object. * If the object already exists, it will overwrite the existing object.
* *
* @param[in] master_key key that specifies server to write to * @param[in] master_key key that specifies server to write to
* @param[in] key key of object to write to server * @param[in] key key of object to write to server
* @param[in] value value of object to write to server * @param[in] value value of object to write to server
* @param[in] expiration time to keep the object stored in the server for * @param[in] expiration time to keep the object stored in the server for
 End of changes. 3 change blocks. 
3 lines changed or deleted 40 lines changed or added


 memcached_util.h   memcached_util.h 
skipping to change at line 40 skipping to change at line 40
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*/ */
#pragma once #pragma once
#include <libmemcached/util/pid.h>
#include <libmemcached/util/flush.h> #include <libmemcached/util/flush.h>
#include <libmemcached/util/ping.h> #include <libmemcached/util/ping.h>
#include <libmemcached/util/pool.h> #include <libmemcached/util/pool.h>
#include <libmemcached/util/version.h> #include <libmemcached/util/version.h>
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 options.h   options.h 
skipping to change at line 47 skipping to change at line 47
#pragma once #pragma once
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t libmemcached_check_configuration(const char *option_st ring, size_t length, char *error_buffer, size_t error_buffer_size); memcached_return_t libmemcached_check_configuration(const char *option_st ring, size_t length, char *error_buffer, size_t error_buffer_size);
LIBMEMCACHED_LOCAL
void memcached_set_configuration_file(memcached_st *self, const char *fil
ename, size_t filename_length);
LIBMEMCACHED_LOCAL
memcached_return_t memcached_parse_configuration(memcached_st *ptr, const
char *option_string, size_t length);
LIBMEMCACHED_LOCAL
const char *memcached_parse_filename(memcached_st *memc);
LIBMEMCACHED_LOCAL
size_t memcached_parse_filename_length(memcached_st *memc);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#ifdef __cplusplus
LIBMEMCACHED_LOCAL
memcached_return_t memcached_parse_configure_file(memcached_st *self, con
st char *filename, size_t length);
LIBMEMCACHED_LOCAL
memcached_return_t memcached_parse_configure_file(memcached_st *self, mem
cached_array_st *filename);
#endif
 End of changes. 2 change blocks. 
14 lines changed or deleted 0 lines changed or added


 ping.h   ping.h 
skipping to change at line 47 skipping to change at line 47
#pragma once #pragma once
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
LIBMEMCACHED_API LIBMEMCACHED_API
bool libmemcached_util_ping(const char *hostname, in_port_t port, memcached _return_t *ret); bool libmemcached_util_ping(const char *hostname, in_port_t port, memcached _return_t *ret);
LIBMEMCACHED_API
bool libmemcached_util_ping2(const char *hostname, in_port_t port, const ch
ar *username, const char *password, memcached_return_t *ret);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
 End of changes. 1 change blocks. 
0 lines changed or deleted 4 lines changed or added


 return.h   return.h 
skipping to change at line 87 skipping to change at line 87
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_ERROR,
MEMCACHED_PARSE_USER_ERROR, MEMCACHED_PARSE_USER_ERROR,
MEMCACHED_DEPRECATED, MEMCACHED_DEPRECATED,
MEMCACHED_IN_PROGRESS, MEMCACHED_IN_PROGRESS,
MEMCACHED_SERVER_TEMPORARILY_DISABLED,
MEMCACHED_MAXIMUM_RETURN /* Always add new error code before */ MEMCACHED_MAXIMUM_RETURN /* Always add new error code before */
}; };
#ifndef __cplusplus #ifndef __cplusplus
typedef enum memcached_return_t memcached_return_t; typedef enum memcached_return_t memcached_return_t;
#endif #endif
#define memcached_success(__memcached_return_t) ((__memcached_return_t) == static inline bool memcached_success(memcached_return_t rc)
MEMCACHED_SUCCESS or (__memcached_return_t) == MEMCACHED_END) {
#define memcached_failed(__memcached_return_t) ((__memcached_return_t) != M return (rc == MEMCACHED_BUFFERED ||
EMCACHED_SUCCESS and (__memcached_return_t) != MEMCACHED_END) rc == MEMCACHED_DELETED ||
rc == MEMCACHED_END ||
rc == MEMCACHED_ITEM ||
rc == MEMCACHED_STAT ||
rc == MEMCACHED_STORED ||
rc == MEMCACHED_SUCCESS ||
rc == MEMCACHED_VALUE);
}
static inline bool memcached_failed(memcached_return_t rc)
{
return (rc != MEMCACHED_SUCCESS &&
rc != MEMCACHED_END &&
rc != MEMCACHED_STORED &&
rc != MEMCACHED_STAT &&
rc != MEMCACHED_DELETED &&
rc != MEMCACHED_BUFFERED &&
rc != MEMCACHED_VALUE);
}
#define memcached_continue(__memcached_return_t) ((__memcached_return_t) == MEMCACHED_IN_PROGRESS) #define memcached_continue(__memcached_return_t) ((__memcached_return_t) == MEMCACHED_IN_PROGRESS)
 End of changes. 2 change blocks. 
4 lines changed or deleted 24 lines changed or added


 sasl.h   sasl.h 
skipping to change at line 40 skipping to change at line 40
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*/ */
#pragma once #pragma once
#ifdef LIBMEMCACHED_WITH_SASL_SUPPORT #if defined(LIBMEMCACHED_WITH_SASL_SUPPORT) && LIBMEMCACHED_WITH_SASL_SUPPO RT
#include <sasl/sasl.h> #include <sasl/sasl.h>
#else
#define sasl_callback_t void
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
LIBMEMCACHED_API LIBMEMCACHED_API
void memcached_set_sasl_callbacks(memcached_st *ptr, void memcached_set_sasl_callbacks(memcached_st *ptr,
const sasl_callback_t *callbacks); const sasl_callback_t *callbacks);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_set_sasl_auth_data(memcached_st *ptr, memcached_return_t memcached_set_sasl_auth_data(memcached_st *ptr,
const char *username, const char *username,
const char *password); const char *password);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_destroy_sasl_auth_data(memcached_st *ptr); memcached_return_t memcached_destroy_sasl_auth_data(memcached_st *ptr);
LIBMEMCACHED_API LIBMEMCACHED_API
const sasl_callback_t *memcached_get_sasl_callbacks(memcached_st *ptr); sasl_callback_t *memcached_get_sasl_callbacks(memcached_st *ptr);
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
memcached_return_t memcached_clone_sasl(memcached_st *clone, const memcach ed_st *source); memcached_return_t memcached_clone_sasl(memcached_st *clone, const memcach ed_st *source);
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
memcached_return_t memcached_sasl_authenticate_connection(memcached_server_ st *server); memcached_return_t memcached_sasl_authenticate_connection(memcached_server_ st *server);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* LIBMEMCACHED_WITH_SASL_SUPPORT */
struct memcached_sasl_st { struct memcached_sasl_st {
#ifdef LIBMEMCACHED_WITH_SASL_SUPPORT sasl_callback_t *callbacks;
const sasl_callback_t *callbacks; /*
#else ** Did we allocate data inside the callbacks, or did the user
const void *callbacks; ** supply that.
#endif */
/* bool is_allocated;
** Did we allocate data inside the callbacks, or did the user
** supply that.
*/
bool is_allocated;
}; };
 End of changes. 5 change blocks. 
14 lines changed or deleted 11 lines changed or added


 server.h   server.h 
skipping to change at line 40 skipping to change at line 40
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*/ */
#pragma once #pragma once
#ifndef WIN32
#include <netdb.h>
#endif
enum memcached_server_state_t { enum memcached_server_state_t {
MEMCACHED_SERVER_STATE_NEW, // fd == -1, no address lookup has been done MEMCACHED_SERVER_STATE_NEW, // fd == -1, no address lookup has been done
MEMCACHED_SERVER_STATE_ADDRINFO, // ADDRRESS information has been gathere d MEMCACHED_SERVER_STATE_ADDRINFO, // ADDRRESS information has been gathere d
MEMCACHED_SERVER_STATE_IN_PROGRESS, MEMCACHED_SERVER_STATE_IN_PROGRESS,
MEMCACHED_SERVER_STATE_CONNECTED MEMCACHED_SERVER_STATE_CONNECTED,
MEMCACHED_SERVER_STATE_IN_TIMEOUT
}; };
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 is_shutting_down:1; bool is_shutting_down:1;
bool is_dead: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;
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;
uint64_t server_failure_counter_query_id;
uint32_t weight; uint32_t weight;
uint32_t version;
enum memcached_server_state_t state; enum memcached_server_state_t 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;
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; struct addrinfo *address_info_next;
time_t next_retry; time_t next_retry;
memcached_st *root; memcached_st *root;
uint64_t limit_maxbytes; uint64_t limit_maxbytes;
struct memcached_error_t *error_messages;
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" {
#endif #endif
LIBMEMCACHED_API LIBMEMCACHED_API
skipping to change at line 110 skipping to change at line 116
memcached_return_t *error); memcached_return_t *error);
LIBMEMCACHED_API LIBMEMCACHED_API
void memcached_server_error_reset(memcached_server_st *ptr); void memcached_server_error_reset(memcached_server_st *ptr);
LIBMEMCACHED_API LIBMEMCACHED_API
void memcached_server_free(memcached_server_st *ptr); void memcached_server_free(memcached_server_st *ptr);
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
memcached_server_st *memcached_server_clone(memcached_server_st *destinatio n, memcached_server_st *memcached_server_clone(memcached_server_st *destinatio n,
const memcached_server_st *sour ce); memcached_server_st *source);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_server_instance_st memcached_server_get_last_disconnect(const mem cached_st *ptr); memcached_server_instance_st memcached_server_get_last_disconnect(const mem cached_st *ptr);
LIBMEMCACHED_API LIBMEMCACHED_API
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,
skipping to change at line 151 skipping to change at line 157
uint32_t we ight); uint32_t we ight);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_server_add_with_weight(memcached_st *ptr, cons t char *hostname, memcached_return_t memcached_server_add_with_weight(memcached_st *ptr, cons t char *hostname,
in_port_t port, in_port_t port,
uint32_t weight); uint32_t weight);
/** /**
Operations on Single Servers. Operations on Single Servers.
*/ */
LIBMEMCACHED_API LIBMEMCACHED_API
uint32_t memcached_server_response_count(memcached_server_instance_st self) ; uint32_t memcached_server_response_count(const memcached_server_instance_st self);
LIBMEMCACHED_API LIBMEMCACHED_API
const char *memcached_server_name(memcached_server_instance_st self); const char *memcached_server_name(const memcached_server_instance_st self);
LIBMEMCACHED_API LIBMEMCACHED_API
in_port_t memcached_server_port(memcached_server_instance_st self); in_port_t memcached_server_port(const memcached_server_instance_st self);
LIBMEMCACHED_API LIBMEMCACHED_API
const char *memcached_server_error(memcached_server_instance_st ptr); const char *memcached_server_type(const memcached_server_instance_st ptr);
LIBMEMCACHED_LOCAL
void __server_free(memcached_server_st *);
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
#endif #endif
 End of changes. 12 change blocks. 
8 lines changed or deleted 17 lines changed or added


 stats.h   stats.h 
skipping to change at line 44 skipping to change at line 44
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*/ */
#pragma once #pragma once
struct memcached_stat_st { struct memcached_stat_st {
unsigned long connection_structures; unsigned long connection_structures;
unsigned long curr_connections; unsigned long curr_connections;
unsigned long curr_items; unsigned long curr_items;
unsigned long pid; pid_t pid;
unsigned long pointer_size; unsigned long pointer_size;
unsigned long rusage_system_microseconds; unsigned long rusage_system_microseconds;
unsigned long rusage_system_seconds; unsigned long rusage_system_seconds;
unsigned long rusage_user_microseconds; unsigned long rusage_user_microseconds;
unsigned long rusage_user_seconds; unsigned long rusage_user_seconds;
unsigned long threads; unsigned long threads;
unsigned long time; unsigned long time;
unsigned long total_connections; unsigned long total_connections;
unsigned long total_items; unsigned long total_items;
unsigned long uptime; unsigned long uptime;
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 string.h   string.h 
skipping to change at line 63 skipping to change at line 63
char *end; char *end;
char *string; char *string;
size_t current_size; size_t current_size;
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;
}; };
#ifdef BUILDING_LIBMEMCACHED
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
memcached_string_st *memcached_string_create(memcached_st *ptr, memcached_string_st *memcached_string_create(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 112 skipping to change at line 110
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 __cplusplus
#define memcached_literal_param(X) (X), (static_cast<size_t>((sizeof(X) - 1
)))
#else
#define memcached_literal_param(X) (X), ((size_t)((sizeof(X) - 1)))
#endif
#define memcached_string_make_from_cstr(X) (X), ((X) ? strlen(X) : 0)
#endif
 End of changes. 2 change blocks. 
2 lines changed or deleted 0 lines changed or added


 watchpoint.h   watchpoint.h 
skipping to change at line 40 skipping to change at line 40
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*/ */
#pragma once #pragma once
/* Some personal debugging functions */
#if defined(DEBUG)
#ifdef TARGET_OS_LINUX
static inline void libmemcached_stack_dump(void)
{
void *array[10];
int size;
char **strings;
size= backtrace(array, 10);
strings= backtrace_symbols(array, size);
fprintf(stderr, "Found %d stack frames.\n", size);
for (int x= 0; x < size; x++)
fprintf(stderr, "%s\n", strings[x]);
free (strings);
fflush(stderr);
}
#elif defined(__sun)
#include <ucontext.h>
static inline void libmemcached_stack_dump(void)
{
fflush(stderr);
printstack(fileno(stderr));
}
#else
static inline void libmemcached_stack_dump(void)
{ }
#endif // libmemcached_stack_dump()
#include <assert.h>
#define WATCHPOINT do { fprintf(stderr, "\nWATCHPOINT %s:%d (%s)\n", __FILE
__, __LINE__,__func__);fflush(stdout); } while (0)
#define WATCHPOINT_ERROR(A) do {fprintf(stderr, "\nWATCHPOINT %s:%d %s\n",
__FILE__, __LINE__, memcached_strerror(NULL, A));fflush(stdout); } while (0
)
#define WATCHPOINT_IFERROR(A) do { if(A != MEMCACHED_SUCCESS)fprintf(stderr
, "\nWATCHPOINT %s:%d %s\n", __FILE__, __LINE__, memcached_strerror(NULL, A
));fflush(stdout); } while (0)
#define WATCHPOINT_STRING(A) do { fprintf(stderr, "\nWATCHPOINT %s:%d (%s)
%s\n", __FILE__, __LINE__,__func__,A);fflush(stdout); } while (0)
#define WATCHPOINT_STRING_LENGTH(A,B) do { fprintf(stderr, "\nWATCHPOINT %s
:%d (%s) %.*s\n", __FILE__, __LINE__,__func__,(int)B,A);fflush(stdout); } w
hile (0)
#define WATCHPOINT_NUMBER(A) do { fprintf(stderr, "\nWATCHPOINT %s:%d (%s)
%lu\n", __FILE__, __LINE__,__func__,(unsigned long)(A));fflush(stdout); } w
hile (0)
#define WATCHPOINT_LABELED_NUMBER(A,B) do { fprintf(stderr, "\nWATCHPOINT %
s:%d (%s) %s:%lu\n", __FILE__, __LINE__,__func__,(A),(unsigned long)(B));ff
lush(stdout); } while (0)
#define WATCHPOINT_IF_LABELED_NUMBER(A,B,C) do { if(A) {fprintf(stderr, "\n
WATCHPOINT %s:%d (%s) %s:%lu\n", __FILE__, __LINE__,__func__,(B),(unsigned
long)(C));fflush(stdout);} } while (0)
#define WATCHPOINT_ERRNO(A) do { fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %
s\n", __FILE__, __LINE__,__func__, strerror(A));fflush(stdout); } while (0)
#define WATCHPOINT_ASSERT_PRINT(A,B,C) do { if(!(A)){fprintf(stderr, "\nWAT
CHPOINT ASSERT %s:%d (%s) ", __FILE__, __LINE__,__func__);fprintf(stderr, (
B),(C));fprintf(stderr,"\n");fflush(stdout); libmemcached_stack_dump(); } a
ssert((A)); } while (0)
#define WATCHPOINT_ASSERT(A) do { if (! (A)) {libmemcached_stack_dump();} a
ssert((A)); } while (0)
#define WATCHPOINT_ASSERT_INITIALIZED(A) do { if (! (A)) { libmemcached_sta
ck_dump(); } assert(memcached_is_initialized((A))); } while (0);
#define WATCHPOINT_SET(A) do { A; } while(0);
#else
#define WATCHPOINT #define WATCHPOINT
#define WATCHPOINT_ERROR(A) #define WATCHPOINT_ERROR(A)
#define WATCHPOINT_IFERROR(__memcached_return_t) (void)(__memcached_return_ t) #define WATCHPOINT_IFERROR(__memcached_return_t) (void)(__memcached_return_ t)
#define WATCHPOINT_STRING(A) #define WATCHPOINT_STRING(A)
#define WATCHPOINT_NUMBER(A) #define WATCHPOINT_NUMBER(A)
#define WATCHPOINT_LABELED_NUMBER(A,B) #define WATCHPOINT_LABELED_NUMBER(A,B)
#define WATCHPOINT_IF_LABELED_NUMBER(A,B,C) #define WATCHPOINT_IF_LABELED_NUMBER(A,B,C)
#define WATCHPOINT_ERRNO(A) #define WATCHPOINT_ERRNO(A)
#define WATCHPOINT_ASSERT_PRINT(A,B,C) #define WATCHPOINT_ASSERT_PRINT(A,B,C)
#define WATCHPOINT_ASSERT(A) (void)(A) #define WATCHPOINT_ASSERT(A) (void)(A)
#define WATCHPOINT_ASSERT_INITIALIZED(A) #define WATCHPOINT_ASSERT_INITIALIZED(A)
#define WATCHPOINT_SET(A) #define WATCHPOINT_SET(A)
#endif /* DEBUG */
 End of changes. 2 change blocks. 
77 lines changed or deleted 0 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/