allocators.h   allocators.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: work with user defined memory allocators * Copyright (C) 2011 Data Differential, http://datadifferential.com/
* Copyright (C) 2010 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_ALLOCATORS_H__ #pragma once
#define __LIBMEMCACHED_ALLOCATORS_H__
struct memcached_allocator_t {
memcached_calloc_fn calloc;
memcached_free_fn free;
memcached_malloc_fn malloc;
memcached_realloc_fn realloc;
void *context;
};
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_set_memory_allocators(memcached_st *ptr, memcached_return_t memcached_set_memory_allocators(memcached_st *ptr,
memcached_malloc_fn mem_ malloc, memcached_malloc_fn mem_ malloc,
memcached_free_fn mem_fr ee, memcached_free_fn mem_fr ee,
memcached_realloc_fn mem _realloc, memcached_realloc_fn mem _realloc,
skipping to change at line 50 skipping to change at line 83
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
void *_libmemcached_malloc(const memcached_st *ptr, const size_t size, void *context); void *_libmemcached_malloc(const memcached_st *ptr, const size_t size, void *context);
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
void *_libmemcached_realloc(const memcached_st *ptr, void *mem, const size_ t size, void *context); void *_libmemcached_realloc(const memcached_st *ptr, void *mem, const size_ t size, void *context);
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
void *_libmemcached_calloc(const memcached_st *ptr, size_t nelem, size_t si ze, void *context); void *_libmemcached_calloc(const memcached_st *ptr, size_t nelem, size_t si ze, void *context);
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
struct _allocators_st memcached_allocators_return_default(void); struct memcached_allocator_t memcached_allocators_return_default(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __LIBMEMCACHED_ALLOCATORS_H__ */
 End of changes. 6 change blocks. 
9 lines changed or deleted 42 lines changed or added


 analyze.h   analyze.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: Generate a memcached_analysis_st * 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 __LIBMEMCACHED_ANALYZE_H__ #pragma once
#define __LIBMEMCACHED_ANALYZE_H__
struct memcached_analysis_st { struct memcached_analysis_st {
memcached_st *root; memcached_st *root;
uint32_t average_item_size; uint32_t average_item_size;
uint32_t longest_uptime; uint32_t longest_uptime;
uint32_t least_free_server; uint32_t least_free_server;
uint32_t most_consumed_server; uint32_t most_consumed_server;
uint32_t oldest_server; uint32_t oldest_server;
double pool_hit_ratio; double pool_hit_ratio;
uint64_t most_used_bytes; uint64_t most_used_bytes;
skipping to change at line 42 skipping to change at line 67
memcached_analysis_st *memcached_analyze(memcached_st *memc, memcached_analysis_st *memcached_analyze(memcached_st *memc,
memcached_stat_st *memc_stat, memcached_stat_st *memc_stat,
memcached_return_t *error); memcached_return_t *error);
LIBMEMCACHED_API LIBMEMCACHED_API
void memcached_analyze_free(memcached_analysis_st *); void memcached_analyze_free(memcached_analysis_st *);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __LIBMEMCACHED_ANALYZE_H__ */
 End of changes. 5 change blocks. 
8 lines changed or deleted 33 lines changed or added


 array.h   array.h 
skipping to change at line 62 skipping to change at line 62
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);
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
memcached_string_t memcached_array_to_string(memcached_array_st *array); memcached_string_t memcached_array_to_string(memcached_array_st *array);
LIBMEMCACHED_LOCAL
bool memcached_array_is_null(memcached_array_st *array);
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
#define memcached_print_array(X) static_cast<int>(memcached_array_size(X)), memcached_array_string(X) #define memcached_print_array(X) static_cast<int>(memcached_array_size(X)), memcached_array_string(X)
#define memcached_param_array(X) memcached_array_string(X), memcached_array _size(X) #define memcached_param_array(X) memcached_array_string(X), memcached_array _size(X)
#else #else
#define memcached_print_array(X) (int)memcached_array_size((X)), memcached_ array_string((X)) #define memcached_print_array(X) (int)memcached_array_size((X)), memcached_ array_string((X))
#define memcached_param_array(X) memcached_array_string(X), memcached_array _size(X) #define memcached_param_array(X) memcached_array_string(X), memcached_array _size(X)
 End of changes. 1 change blocks. 
0 lines changed or deleted 3 lines changed or added


 auto.h   auto.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: Change the behavior of the memcached connection. * 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 __LIBMEMCACHED_AUTO_H__ #pragma once
#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, uint32_t offset,
uint64_t *value); uint64_t *value);
skipping to change at line 87 skipping to change at line 112
const char *ke y, const char *ke y,
size_t key_len gth, size_t key_len gth,
uint64_t offse t, uint64_t offse t,
uint64_t initi al, uint64_t initi al,
time_t expirat ion, time_t expirat ion,
uint64_t *valu e); uint64_t *valu e);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __LIBMEMCACHED_AUTO_H__ */
 End of changes. 5 change blocks. 
8 lines changed or deleted 33 lines changed or added


 callback.h   callback.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: Change any of the possible callbacks. * 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 __LIBMEMCACHED_CALLBACK_H__ #pragma once
#define __LIBMEMCACHED_CALLBACK_H__
struct memcached_callback_st { struct memcached_callback_st {
memcached_execute_fn *callback; memcached_execute_fn *callback;
void *context; void *context;
uint32_t number_of_callback; uint32_t number_of_callback;
}; };
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
skipping to change at line 37 skipping to change at line 62
const memcached_callback_t flag, const memcached_callback_t flag,
void *data); 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
#endif /* __LIBMEMCACHED_CALLBACK_H__ */
 End of changes. 5 change blocks. 
8 lines changed or deleted 33 lines changed or added


 constants.h   constants.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: Constants for libmemcached * 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.
* *
*/ */
#pragma once #pragma once
#ifndef __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
#define MEMCACHED_MAXIMUM_INTEGER_DISPLAY_LENGTH 20
enum memcached_return_t {
MEMCACHED_SUCCESS,
MEMCACHED_FAILURE,
MEMCACHED_HOST_LOOKUP_FAILURE,
MEMCACHED_CONNECTION_FAILURE,
MEMCACHED_CONNECTION_BIND_FAILURE,
MEMCACHED_WRITE_FAILURE,
MEMCACHED_READ_FAILURE,
MEMCACHED_UNKNOWN_READ_FAILURE,
MEMCACHED_PROTOCOL_ERROR,
MEMCACHED_CLIENT_ERROR,
MEMCACHED_SERVER_ERROR,
MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE,
MEMCACHED_DATA_EXISTS,
MEMCACHED_DATA_DOES_NOT_EXIST,
MEMCACHED_NOTSTORED,
MEMCACHED_STORED,
MEMCACHED_NOTFOUND,
MEMCACHED_MEMORY_ALLOCATION_FAILURE,
MEMCACHED_PARTIAL_READ,
MEMCACHED_SOME_ERRORS,
MEMCACHED_NO_SERVERS,
MEMCACHED_END,
MEMCACHED_DELETED,
MEMCACHED_VALUE,
MEMCACHED_STAT,
MEMCACHED_ITEM,
MEMCACHED_ERRNO,
MEMCACHED_FAIL_UNIX_SOCKET,
MEMCACHED_NOT_SUPPORTED,
MEMCACHED_NO_KEY_PROVIDED, /* Deprecated. Use MEMCACHED_BAD_KEY_PROVIDED!
*/
MEMCACHED_FETCH_NOTFINISHED,
MEMCACHED_TIMEOUT,
MEMCACHED_BUFFERED,
MEMCACHED_BAD_KEY_PROVIDED,
MEMCACHED_INVALID_HOST_PROTOCOL,
MEMCACHED_SERVER_MARKED_DEAD,
MEMCACHED_UNKNOWN_STAT_KEY,
MEMCACHED_E2BIG,
MEMCACHED_INVALID_ARGUMENTS,
MEMCACHED_KEY_TOO_BIG,
MEMCACHED_AUTH_PROBLEM,
MEMCACHED_AUTH_FAILURE,
MEMCACHED_AUTH_CONTINUE,
MEMCACHED_PARSE_ERROR,
MEMCACHED_PARSE_USER_ERROR,
MEMCACHED_DEPRECATED,
MEMCACHED_MAXIMUM_RETURN /* Always add new error code before */
};
#ifndef __cplusplus
typedef enum memcached_return_t memcached_return_t;
#endif
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
}; };
#ifndef __cplusplus #ifndef __cplusplus
typedef enum memcached_server_distribution_t memcached_server_distribution_ t; typedef enum memcached_server_distribution_t memcached_server_distribution_ t;
#endif #endif
typedef enum { enum memcached_behavior_t {
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,
MEMCACHED_BEHAVIOR_POLL_TIMEOUT, MEMCACHED_BEHAVIOR_POLL_TIMEOUT,
MEMCACHED_BEHAVIOR_DISTRIBUTION, MEMCACHED_BEHAVIOR_DISTRIBUTION,
skipping to change at line 139 skipping to change at line 110
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_LOAD_FROM_FILE,
MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS, MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS,
MEMCACHED_BEHAVIOR_MAX MEMCACHED_BEHAVIOR_MAX
} memcached_behavior_t; };
typedef enum { #ifndef __cplusplus
typedef enum memcached_behavior_t memcached_behavior_t;
#endif
enum memcached_callback_t {
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,
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_t; };
#ifndef __cplusplus
typedef enum memcached_callback_t memcached_callback_t;
#endif
typedef enum { enum memcached_hash_t {
MEMCACHED_HASH_DEFAULT= 0, MEMCACHED_HASH_DEFAULT= 0,
MEMCACHED_HASH_MD5, MEMCACHED_HASH_MD5,
MEMCACHED_HASH_CRC, MEMCACHED_HASH_CRC,
MEMCACHED_HASH_FNV1_64, MEMCACHED_HASH_FNV1_64,
MEMCACHED_HASH_FNV1A_64, MEMCACHED_HASH_FNV1A_64,
MEMCACHED_HASH_FNV1_32, MEMCACHED_HASH_FNV1_32,
MEMCACHED_HASH_FNV1A_32, MEMCACHED_HASH_FNV1A_32,
MEMCACHED_HASH_HSIEH, MEMCACHED_HASH_HSIEH,
MEMCACHED_HASH_MURMUR, MEMCACHED_HASH_MURMUR,
MEMCACHED_HASH_JENKINS, MEMCACHED_HASH_JENKINS,
MEMCACHED_HASH_CUSTOM, MEMCACHED_HASH_CUSTOM,
MEMCACHED_HASH_MAX MEMCACHED_HASH_MAX
} memcached_hash_t; };
typedef enum { #ifndef __cplusplus
typedef enum memcached_hash_t memcached_hash_t;
#endif
enum memcached_connection_t {
MEMCACHED_CONNECTION_UNKNOWN, 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 MEMCACHED_CONNECTION_MAX
} memcached_connection_t; };
#endif /* __LIBMEMCACHED_CONSTANTS_H__ */ #ifndef __cplusplus
typedef enum memcached_connection_t memcached_connection_t;
#endif
 End of changes. 14 change blocks. 
71 lines changed or deleted 53 lines changed or added


 delete.h   delete.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: Delete a key from the server. * Copyright (C) 2011 Data Differential, http://datadifferential.com/
* Copyright (C) 2010 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_DELETE_H__ #pragma once
#define __LIBMEMCACHED_DELETE_H__
#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 *group_key, size_t gr oup_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__ */
 End of changes. 5 change blocks. 
8 lines changed or deleted 33 lines changed or added


 dump.h   dump.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: Simple method for dumping data from Memcached. * 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 __LIBMEMCACHED_DUMP_H__ #pragma once
#define __LIBMEMCACHED_DUMP_H__
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_dump(memcached_st *ptr, memcached_dump_fn *fun ction, void *context, uint32_t number_of_callbacks); memcached_return_t memcached_dump(memcached_st *ptr, memcached_dump_fn *fun ction, void *context, uint32_t number_of_callbacks);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __LIBMEMCACHED_DUMP_H__ */
 End of changes. 5 change blocks. 
8 lines changed or deleted 33 lines changed or added


 error.h   error.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_return_t memcached_set_error(memcached_st *memc, memcached_retu
rn_t rc, memcached_string_t *str);
LIBMEMCACHED_LOCAL
memcached_return_t memcached_set_error_string(memcached_st *memc, memcach
ed_return_t rc, const char *str, size_t length);
LIBMEMCACHED_LOCAL
memcached_return_t memcached_set_errno(memcached_st *memc, int local_errn
o, memcached_string_t *str);
LIBMEMCACHED_LOCAL
void memcached_error_free(memcached_st *error); void memcached_error_free(memcached_st *error);
LIBMEMCACHED_API LIBMEMCACHED_API
const char *memcached_last_error_message(memcached_st *memc); const char *memcached_last_error_message(memcached_st *memc);
LIBMEMCACHED_API LIBMEMCACHED_API
void memcached_error_print(const memcached_st *self); void memcached_error_print(const memcached_st *self);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_last_error(memcached_st *memc); memcached_return_t memcached_last_error(memcached_st *memc);
 End of changes. 1 change blocks. 
12 lines changed or deleted 0 lines changed or added


 fetch.h   fetch.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: Work with fetching results * Copyright (C) 2011 Data Differential, http://datadifferential.com/
* Copyright (C) 2010 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_FETCH_H__ #pragma once
#define __LIBMEMCACHED_FETCH_H__
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_fetch_execute(memcached_st *ptr, memcached_return_t memcached_fetch_execute(memcached_st *ptr,
memcached_execute_fn *callback, memcached_execute_fn *callback,
void *context, void *context,
uint32_t number_of_callbacks); uint32_t number_of_callbacks);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __LIBMEMCACHED_FETCH_H__ */
 End of changes. 5 change blocks. 
8 lines changed or deleted 33 lines changed or added


 flush.h   flush.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: Flush connections. * Copyright (C) 2011 Data Differential, http://datadifferential.com/
* Copyright (C) 2010 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_FLUSH_H__ #pragma once
#define __LIBMEMCACHED_FLUSH_H__
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_flush(memcached_st *ptr, time_t expiration); memcached_return_t memcached_flush(memcached_st *ptr, time_t expiration);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __LIBMEMCACHED_FLUSH_H__ */
 End of changes. 5 change blocks. 
8 lines changed or deleted 33 lines changed or added


 flush_buffers.h   flush_buffers.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: Work with fetching results * Copyright (C) 2011 Data Differential, http://datadifferential.com/
* Copyright (C) 2010 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_FLUSH_BUFFERS_H__ #pragma once
#define __LIBMEMCACHED_FLUSH_BUFFERS_H__
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_flush_buffers(memcached_st *mem); memcached_return_t memcached_flush_buffers(memcached_st *mem);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __LIBMEMCACHED_FLUSH_BUFFERS_H__ */
 End of changes. 5 change blocks. 
8 lines changed or deleted 33 lines changed or added


 get.h   get.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: Get functions for libmemcached * Copyright (C) 2011 Data Differential, http://datadifferential.com/
* Copyright (C) 2010 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_GET_H__ #pragma once
#define __LIBMEMCACHED_GET_H__
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* Public defines */ /* Public defines */
LIBMEMCACHED_API LIBMEMCACHED_API
char *memcached_get(memcached_st *ptr, char *memcached_get(memcached_st *ptr,
const char *key, size_t key_length, const char *key, size_t key_length,
size_t *value_length, size_t *value_length,
skipping to change at line 85 skipping to change at line 110
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
#endif /* __LIBMEMCACHED_GET_H__ */
 End of changes. 5 change blocks. 
8 lines changed or deleted 33 lines changed or added


 hash.h   hash.h 
skipping to change at line 38 skipping to change at line 38
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* 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.
* *
*/ */
#ifndef __MEMCACHED_HASH_H__ #pragma once
#define __MEMCACHED_HASH_H__
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* The two public hash bits */ /* The two public hash bits */
LIBMEMCACHED_API LIBMEMCACHED_API
uint32_t memcached_generate_hash_value(const char *key, size_t key_length, memcached_hash_t hash_algorithm); uint32_t memcached_generate_hash_value(const char *key, size_t key_length, memcached_hash_t hash_algorithm);
LIBMEMCACHED_API LIBMEMCACHED_API
skipping to change at line 70 skipping to change at line 69
LIBMEMCACHED_API LIBMEMCACHED_API
void memcached_autoeject(memcached_st *ptr); void memcached_autoeject(memcached_st *ptr);
LIBMEMCACHED_API LIBMEMCACHED_API
const char * libmemcached_string_hash(memcached_hash_t type); const char * libmemcached_string_hash(memcached_hash_t type);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __MEMCACHED_HASH_H__ */
 End of changes. 2 change blocks. 
2 lines changed or deleted 1 lines changed or added


 hashkit.h   hashkit.h 
/* HashKit /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
* Copyright (C) 2009-2010 Brian Aker *
* All rights reserved. * HashKit library
*
* Copyright (C) 2011 Data Differential, http://datadifferential.com/
* Copyright (C) 2009-2010 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_H #pragma once
#define HASHKIT_H
#if !defined(__cplusplus) #if !defined(__cplusplus)
# include <stdbool.h> # include <stdbool.h>
#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/str_algorithm.h>
#include <libhashkit/strerror.h> #include <libhashkit/strerror.h>
#ifdef __cplusplus
extern "C" {
#endif
HASHKIT_API
hashkit_st *hashkit_create(hashkit_st *hash);
HASHKIT_API
hashkit_st *hashkit_clone(hashkit_st *destination, const hashkit_st *ptr);
HASHKIT_API
bool hashkit_compare(const hashkit_st *first, const hashkit_st *second);
HASHKIT_API
void hashkit_free(hashkit_st *hash);
#define hashkit_is_allocated(__object) ((__object)->options.is_allocated)
#define hashkit_is_initialized(__object) ((__object)->options.is_initialize
d)
#ifdef __cplusplus
} // extern "C"
#endif
struct hashkit_st struct hashkit_st
{ {
struct hashkit_function_st { struct hashkit_function_st {
hashkit_hash_fn function; hashkit_hash_fn function;
void *context; void *context;
} base_hash, distribution_hash; } base_hash, distribution_hash;
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
extern "C" {
#endif
HASHKIT_API
hashkit_st *hashkit_create(hashkit_st *hash);
#include <string> HASHKIT_API
hashkit_st *hashkit_clone(hashkit_st *destination, const hashkit_st *ptr);
class Hashkit { HASHKIT_API
bool hashkit_compare(const hashkit_st *first, const hashkit_st *second);
public: HASHKIT_API
void hashkit_free(hashkit_st *hash);
Hashkit() #define hashkit_is_allocated(__object) ((__object)->options.is_allocated)
{ #define hashkit_is_initialized(__object) ((__object)->options.is_initialize
hashkit_create(&self); d)
}
Hashkit(const Hashkit& source)
{
hashkit_clone(&self, &source.self);
}
Hashkit& operator=(const Hashkit& source)
{
hashkit_free(&self);
hashkit_clone(&self, &source.self);
return *this;
}
friend bool operator==(const Hashkit &left, const Hashkit &right)
{
return hashkit_compare(&left.self, &right.self);
}
uint32_t digest(std::string& str)
{
return hashkit_digest(&self, str.c_str(), str.length());
}
uint32_t digest(const char *key, size_t key_length)
{
return hashkit_digest(&self, key, key_length);
}
hashkit_return_t set_function(hashkit_hash_algorithm_t hash_algorithm)
{
return hashkit_set_function(&self, hash_algorithm);
}
hashkit_return_t set_distribution_function(hashkit_hash_algorithm_t hash_
algorithm)
{
return hashkit_set_function(&self, hash_algorithm);
}
~Hashkit()
{
hashkit_free(&self);
}
private:
hashkit_st self; #ifdef __cplusplus
}; } // extern "C"
#endif #endif
#endif /* HASHKIT_H */
 End of changes. 12 change blocks. 
85 lines changed or deleted 52 lines changed or added


 memcached.h   memcached.h 
skipping to change at line 38 skipping to change at line 38
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* 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.
* *
*/ */
#ifndef __LIBMEMCACHED_MEMCACHED_H__ #pragma once
#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/return.h>
#include <libmemcached/types.h> #include <libmemcached/types.h>
#include <libmemcached/string.h> #include <libmemcached/string.h>
#include <libmemcached/array.h> #include <libmemcached/array.h>
#include <libmemcached/error.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>
skipping to change at line 131 skipping to change at line 132
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;
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;
hashkit_st distribution_hashkit;
memcached_result_st result; memcached_result_st result;
struct { struct {
bool weighted; bool weighted;
uint32_t continuum_count; // Ketama uint32_t continuum_count; // Ketama
uint32_t continuum_points_counter; // Ketama uint32_t continuum_points_counter; // Ketama
time_t next_distribution_rebuild; // Ketama time_t next_distribution_rebuild; // Ketama
memcached_continuum_item_st *continuum; // Ketama memcached_continuum_item_st *continuum; // Ketama
} ketama; } ketama;
struct memcached_virtual_bucket_t *virtual_bucket; struct memcached_virtual_bucket_t *virtual_bucket;
struct _allocators_st { struct memcached_allocator_t allocators;
memcached_calloc_fn calloc;
memcached_free_fn free;
memcached_malloc_fn malloc;
memcached_realloc_fn realloc;
void *context;
} 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 *prefix_key;
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.
struct memcached_array_st *filename; struct memcached_array_st *filename;
} configure; } configure;
struct { struct {
bool is_allocated:1; bool is_allocated:1;
} options; } options;
}; };
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
skipping to change at line 211 skipping to change at line 206
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_push(memcached_st *destination, const memcache d_st *source); memcached_return_t memcached_push(memcached_st *destination, const memcache d_st *source);
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 *);
LIBMEMCACHED_API
uint64_t memcached_query_id(const memcached_st *);
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
#endif #endif
#endif /* __LIBMEMCACHED_MEMCACHED_H__ */
 End of changes. 8 change blocks. 
10 lines changed or deleted 8 lines changed or added


 memcached.hpp   memcached.hpp 
skipping to change at line 16 skipping to change at line 16
* 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 #pragma once
#ifndef 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>
#include <vector> #include <vector>
#include <map> #include <map>
skipping to change at line 41 skipping to change at line 39
/** /**
* This is the core memcached library (if later, other objects * This is the core memcached library (if later, other objects
* are needed, they will be created from this class). * are needed, they will be created from this class).
*/ */
class Memcache class Memcache
{ {
public: public:
Memcache() Memcache()
:
servers_list(),
memc(),
result()
{ {
memcached_create(&memc); memc= memcached("", 0);
} }
Memcache(const std::string &in_servers_list) Memcache(const std::string &config)
:
servers_list(in_servers_list),
memc(),
result()
{ {
memcached_create(&memc); memc= memcached(config.c_str(), config.size());
init();
} }
Memcache(const std::string &hostname, Memcache(const std::string &hostname, in_port_t port)
in_port_t port)
:
servers_list(),
memc(),
result()
{ {
memcached_create(&memc); memc= memcached("", 0);
if (memc)
servers_list.append(hostname); memcached_server_add(memc, hostname.c_str(), port);
servers_list.append(":");
std::ostringstream strsmt;
strsmt << port;
servers_list.append(strsmt.str());
init();
} }
Memcache(memcached_st *clone) Memcache(memcached_st *clone)
:
servers_list(),
memc(),
result()
{ {
memcached_clone(&memc, clone); memc= memcached_clone(NULL, clone);
} }
Memcache(const Memcache &rhs) Memcache(const Memcache &rhs)
:
servers_list(rhs.servers_list),
memc(),
result()
{ {
memcached_clone(&memc, const_cast<memcached_st *>(&rhs.getImpl())); memc= memcached_clone(NULL, rhs.getImpl());
init();
} }
Memcache &operator=(const Memcache &rhs) Memcache &operator=(const Memcache &rhs)
{ {
if (this != &rhs) if (this != &rhs)
{ {
memcached_clone(&memc, const_cast<memcached_st *>(&rhs.getImpl())); memcached_free(memc);
init(); memc= memcached_clone(NULL, rhs.getImpl());
} }
return *this; return *this;
} }
~Memcache() ~Memcache()
{ {
memcached_free(&memc); memcached_free(memc);
}
void init()
{
memcached_server_st *servers;
servers= memcached_servers_parse(servers_list.c_str());
memcached_server_push(&memc, servers);
memcached_server_free(servers);
}
/**
* Get the internal memcached_st *
*/
memcached_st &getImpl()
{
return memc;
} }
/** /**
* Get the internal memcached_st * * Get the internal memcached_st *
*/ */
const memcached_st &getImpl() const const memcached_st *getImpl() const
{ {
return memc; return memc;
} }
/** /**
* Return an error string for the given return structure. * Return an error string for the given return structure.
* *
* @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 setBehavior(memcached_behavior_t flag, uint64_t data) bool setBehavior(memcached_behavior_t flag, uint64_t data)
{ {
memcached_return_t rc; return (memcached_success(memcached_behavior_set(memc, flag, data)));
rc= memcached_behavior_set(&memc, flag, data);
return (rc == MEMCACHED_SUCCESS);
} }
uint64_t getBehavior(memcached_behavior_t flag) { uint64_t getBehavior(memcached_behavior_t flag)
return memcached_behavior_get(&memc, flag);
}
/**
* Return the string which contains the list of memcached servers being
* used.
*
* @return a std::string containing the list of memcached servers
*/
const std::string getServersList() const
{ {
return servers_list; return memcached_behavior_get(memc, flag);
} }
/** /**
* Set the list of memcached servers to use. * Configure the memcache object
* *
* @param[in] in_servers_list list of servers * @param[in] in_config configuration
* @return true on success; false otherwise * @return true on success; false otherwise
*/ */
bool setServers(const std::string &in_servers_list) bool configure(const std::string &configuration)
{ {
servers_list.assign(in_servers_list); return memcached_success(memcached_parse_configuration(memc, configurat
init(); ion.c_str(), configuration.size()));
return (memcached_server_count(&memc));
} }
/** /**
* 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)
{ {
memcached_return_t rc; return memcached_success(memcached_server_add(memc, server_name.c_str()
, port));
rc= memcached_server_add(&memc, server_name.c_str(), port);
return (rc == MEMCACHED_SUCCESS);
} }
/** /**
* Remove a server from the list of memcached servers to use. * Remove a server from the list of memcached servers to use.
* *
* @param[in] server_name name of the server to remove * @param[in] server_name name of the server to remove
* @param[in] port port number of server to remove * @param[in] port port number of server to remove
* @return true on success; false otherwise * @return true on success; false otherwise
*/ */
bool removeServer(const std::string &server_name, in_port_t port) bool removeServer(const std::string &server_name, in_port_t port)
skipping to change at line 231 skipping to change at line 165
/** /**
* Fetches an individual value from the server. mget() must always * Fetches an individual value from the server. mget() must always
* be called before using this method. * be called before using this method.
* *
* @param[in] key key of object to fetch * @param[in] key key of object to fetch
* @param[out] ret_val store returned object in this vector * @param[out] ret_val store returned object in this vector
* @return a memcached return structure * @return a memcached return structure
*/ */
memcached_return_t fetch(std::string &key, memcached_return_t fetch(std::string &key,
std::vector<char> &ret_val) std::vector<char> &ret_val,
uint32_t &flags,
uint64_t &cas_value)
{ {
char ret_key[MEMCACHED_MAX_KEY];
size_t value_length= 0;
size_t key_length= 0;
memcached_return_t rc; memcached_return_t rc;
uint32_t flags= 0;
char *value= memcached_fetch(&memc, ret_key, &key_length, memcached_result_st *result;
&value_length, &flags, &rc); if ((result= memcached_fetch_result(memc, NULL, &rc)))
if (value && ret_val.empty())
{
ret_val.reserve(value_length);
ret_val.assign(value, value + value_length);
key.assign(ret_key, key_length);
free(value);
}
else if (value)
{ {
free(value); // Key
key.assign(memcached_result_key_value(result), memcached_result_key_l
ength(result));
// Actual value, null terminated
ret_val.reserve(memcached_result_length(result) +1);
ret_val.assign(memcached_result_value(result),
memcached_result_value(result) +memcached_result_lengt
h(result));
// Misc
flags= memcached_result_flags(result);
cas_value= memcached_result_cas(result);
} }
memcached_result_free(result);
return rc; return rc;
} }
memcached_return_t fetch(std::string &key,
std::vector<char> &ret_val)
{
uint32_t flags= 0;
uint64_t cas_value= 0;
return fetch(key, ret_val, flags, cas_value);
}
/** /**
* Fetches an individual value from the server. * Fetches an individual value from the server.
* *
* @param[in] key key of object whose value to get * @param[in] key key of object whose value to get
* @param[out] ret_val object that is retrieved is stored in * @param[out] ret_val object that is retrieved is stored in
* this vector * this vector
* @return true on success; false otherwise * @return true on success; false otherwise
*/ */
bool get(const std::string &key, bool get(const std::string &key, std::vector<char> &ret_val)
std::vector<char> &ret_val) throw (Error)
{ {
uint32_t flags= 0; uint32_t flags= 0;
memcached_return_t rc; memcached_return_t rc;
size_t value_length= 0; size_t value_length= 0;
if (key.empty()) char *value= memcached_get(memc, key.c_str(), key.length(),
{
throw(Error("the key supplied is empty!", false));
}
char *value= memcached_get(&memc, key.c_str(), key.length(),
&value_length, &flags, &rc); &value_length, &flags, &rc);
if (value != NULL && ret_val.empty()) if (value != NULL && 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);
free(value); free(value);
return true; return true;
} }
return false; return false;
} }
/** /**
* Fetches an individual from a server which is specified by * Fetches an individual from a server which is specified by
* the master_key parameter that is used for determining which * the master_key parameter that is used for determining which
* server an object was stored in if key partitioning was * server an object was stored in if key partitioning was
* used for storage. * used for storage.
* *
* @param[in] master_key key that specifies server object is stored on * @param[in] master_key key that specifies server object is stored on
* @param[in] key key of object whose value to get * @param[in] key key of object whose value to get
* @param[out] ret_val object that is retrieved is stored in * @param[out] ret_val object that is retrieved is stored in
* this vector * this vector
* @return true on success; false otherwise * @return true on success; false otherwise
*/ */
bool getByKey(const std::string &master_key, bool getByKey(const std::string &master_key,
const std::string &key, const std::string &key,
std::vector<char> &ret_val) throw(Error) std::vector<char> &ret_val)
{ {
uint32_t flags= 0; uint32_t flags= 0;
memcached_return_t rc; memcached_return_t rc;
size_t value_length= 0; size_t value_length= 0;
if (master_key.empty() || key.empty()) char *value= memcached_get_by_key(memc,
{
throw(Error("the master key or key supplied is empty!", false));
}
char *value= memcached_get_by_key(&memc,
master_key.c_str(), master_key.length (), master_key.c_str(), master_key.length (),
key.c_str(), key.length(), key.c_str(), key.length(),
&value_length, &flags, &rc); &value_length, &flags, &rc);
if (value) if (value)
{ {
ret_val.reserve(value_length); ret_val.reserve(value_length);
ret_val.assign(value, value + value_length); ret_val.assign(value, value + value_length);
free(value); free(value);
return true; return true;
} }
skipping to change at line 357 skipping to change at line 294
{ {
real_keys.push_back(const_cast<char *>((*it).c_str())); real_keys.push_back(const_cast<char *>((*it).c_str()));
key_len.push_back((*it).length()); key_len.push_back((*it).length());
++it; ++it;
} }
/* /*
* If the std::vector of keys is empty then we cannot * If the std::vector of keys is empty then we cannot
* call memcached_mget as we will get undefined behavior. * call memcached_mget as we will get undefined behavior.
*/ */
if (! real_keys.empty()) if (not real_keys.empty())
{ {
memcached_return_t rc= memcached_mget(&memc, &real_keys[0], &key_len[ return memcached_success(memcached_mget(memc, &real_keys[0], &key_len
0], [0], real_keys.size()));
real_keys.size());
return (rc == MEMCACHED_SUCCESS);
} }
return false; return false;
} }
/** /**
* Writes an object to the server. If the object already exists, it will * Writes an object to the server. If the object already exists, it will
* overwrite the existing object. This method always returns true * overwrite the existing object. This method always returns true
* when using non-blocking mode unless a network error occurs. * when using non-blocking mode unless a network error occurs.
* *
* @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
* @param[in] flags flags to store with the object * @param[in] flags flags to store with the object
* @return true on succcess; false otherwise * @return true on succcess; false otherwise
*/ */
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) throw(Error) uint32_t flags)
{ {
if (key.empty() || value.empty()) memcached_return_t rc= memcached_set(memc,
{ key.c_str(), key.length(),
throw(Error("the key or value supplied is empty!", false)); &value[0], value.size(),
} expiration, flags);
memcached_return_t rc= memcached_set(&memc,
key.c_str(), key.length(),
&value[0], value.size(),
expiration, flags);
return (rc == MEMCACHED_SUCCESS || rc == MEMCACHED_BUFFERED); return (rc == MEMCACHED_SUCCESS || rc == MEMCACHED_BUFFERED);
} }
/** /**
* 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
* @param[in] flags flags to store with the object * @param[in] flags flags to store with the object
* @return true on succcess; false otherwise * @return true on succcess; false otherwise
*/ */
bool setByKey(const std::string &master_key, bool setByKey(const std::string &master_key,
const std::string &key, const std::string &key,
const std::vector<char> &value, const std::vector<char> &value,
time_t expiration, time_t expiration,
uint32_t flags) throw(Error) uint32_t flags)
{ {
if (master_key.empty() || return memcached_success(memcached_set_by_key(memc, master_key.c_str(),
key.empty() || master_key.length(),
value.empty()) key.c_str(), key.length()
{ ,
throw(Error("the key or value supplied is empty!", false)); &value[0], value.size(),
} expiration,
memcached_return_t rc= memcached_set_by_key(&memc, master_key.c_str(), flags));
master_key.length(),
key.c_str(), key.length(),
&value[0], value.size(),
expiration,
flags);
return (rc == MEMCACHED_SUCCESS);
} }
/** /**
* Writes a list of objects to the server. Objects are specified by * Writes a list of objects to the server. Objects are specified by
* 2 vectors - 1 vector of keys and 1 vector of values. * 2 vectors - 1 vector of keys and 1 vector of values.
* *
* @param[in] keys vector of keys of objects to write to server * @param[in] keys vector of keys of objects to write to server
* @param[in] values vector of values of objects to write to server * @param[in] values vector of values of objects to write to server
* @param[in] expiration time to keep the objects stored in server for * @param[in] expiration time to keep the objects stored in server for
* @param[in] flags flags to store with the objects * @param[in] flags flags to store with the objects
* @return true on success; false otherwise * @return true on success; false otherwise
*/ */
bool setAll(std::vector<std::string> &keys, bool setAll(std::vector<std::string> &keys,
std::vector< std::vector<char> *> &values, std::vector< std::vector<char> *> &values,
time_t expiration, time_t expiration,
uint32_t flags) throw(Error) uint32_t flags)
{ {
if (keys.size() != values.size())
{
throw(Error("The number of keys and values do not match!", false));
}
bool retval= true; bool retval= true;
std::vector<std::string>::iterator key_it= keys.begin(); std::vector<std::string>::iterator key_it= keys.begin();
std::vector< std::vector<char> *>::iterator val_it= values.begin(); std::vector< std::vector<char> *>::iterator val_it= values.begin();
while (key_it != keys.end()) while (key_it != keys.end())
{ {
retval= set((*key_it), *(*val_it), expiration, flags); retval= set((*key_it), *(*val_it), expiration, flags);
if (retval == false) if (retval == false)
{ {
return retval; return retval;
} }
skipping to change at line 472 skipping to change at line 392
* Writes a list of objects to the server. Objects are specified by * Writes a list of objects to the server. Objects are specified by
* a map of keys to values. * a map of keys to values.
* *
* @param[in] key_value_map map of keys and values to store in server * @param[in] key_value_map map of keys and values to store in server
* @param[in] expiration time to keep the objects stored in server for * @param[in] expiration time to keep the objects stored in server for
* @param[in] flags flags to store with the objects * @param[in] flags flags to store with the objects
* @return true on success; false otherwise * @return true on success; false otherwise
*/ */
bool setAll(std::map<const std::string, std::vector<char> > &key_value_ma p, bool setAll(std::map<const std::string, std::vector<char> > &key_value_ma p,
time_t expiration, time_t expiration,
uint32_t flags) throw(Error) uint32_t flags)
{ {
if (key_value_map.empty())
{
throw(Error("The key/values are not properly set!", false));
}
bool retval= true; bool retval= true;
std::map<const std::string, std::vector<char> >::iterator it= std::map<const std::string, std::vector<char> >::iterator it= key_value
key_value_map.begin(); _map.begin();
while (it != key_value_map.end()) while (it != key_value_map.end())
{ {
retval= set(it->first, it->second, expiration, flags); retval= set(it->first, it->second, expiration, flags);
if (retval == false) if (retval == false)
{ {
std::string err_buff("There was an error setting the key "); // We should tell the user what the key that failed was
err_buff.append(it->first); return false;
throw(Error(err_buff, false));
} }
++it; ++it;
} }
return true; return true;
} }
/** /**
* Increment the value of the object associated with the specified * Increment the value of the object associated with the specified
* key by the offset given. The resulting value is saved in the value * key by the offset given. The resulting value is saved in the value
* parameter. * parameter.
* *
* @param[in] key key of object in server whose value to increment * @param[in] key key of object in server whose value to increment
* @param[in] offset amount to increment object's value by * @param[in] offset amount to increment object's value by
* @param[out] value store the result of the increment here * @param[out] value store the result of the increment here
* @return true on success; false otherwise * @return true on success; false otherwise
*/ */
bool increment(const std::string &key, uint32_t offset, uint64_t *value) throw(Error) bool increment(const std::string &key, uint32_t offset, uint64_t *value)
{ {
if (key.empty()) return memcached_success(memcached_increment(memc, key.c_str(), key.len
{ gth(), offset, value));
throw(Error("the key supplied is empty!", false));
}
memcached_return_t rc= memcached_increment(&memc, key.c_str(), key.leng
th(),
offset, value);
return (rc == MEMCACHED_SUCCESS);
} }
/** /**
* Decrement the value of the object associated with the specified * Decrement the value of the object associated with the specified
* key by the offset given. The resulting value is saved in the value * key by the offset given. The resulting value is saved in the value
* parameter. * parameter.
* *
* @param[in] key key of object in server whose value to decrement * @param[in] key key of object in server whose value to decrement
* @param[in] offset amount to increment object's value by * @param[in] offset amount to increment object's value by
* @param[out] value store the result of the decrement here * @param[out] value store the result of the decrement here
* @return true on success; false otherwise * @return true on success; false otherwise
*/ */
bool decrement(const std::string &key, uint32_t offset, uint64_t *value) bool decrement(const std::string &key, uint32_t offset, uint64_t *value)
throw(Error)
{ {
if (key.empty()) return memcached_success(memcached_decrement(memc, key.c_str(),
{ key.length(),
throw(Error("the key supplied is empty!", false)); offset, value));
}
memcached_return_t rc= memcached_decrement(&memc, key.c_str(),
key.length(),
offset, value);
return (rc == MEMCACHED_SUCCESS);
} }
/** /**
* Add an object with the specified key and value to the server. This * Add an object with the specified key and value to the server. This
* function returns false if the object already exists on the server. * function returns false if the object already exists on the server.
* *
* @param[in] key key of object to add * @param[in] key key of object to add
* @param[in] value of object to add * @param[in] value of object to add
* @return true on success; false otherwise * @return true on success; false otherwise
*/ */
bool add(const std::string &key, const std::vector<char> &value) bool add(const std::string &key, const std::vector<char> &value)
throw(Error)
{ {
if (key.empty() || value.empty()) return memcached_success(memcached_add(memc, key.c_str(), key.length(),
{ &value[0], value.size(), 0, 0));
throw(Error("the key or value supplied is empty!", false));
}
memcached_return_t rc= memcached_add(&memc, key.c_str(), key.length(),
&value[0], value.size(), 0, 0);
return (rc == MEMCACHED_SUCCESS);
} }
/** /**
* Add an object with the specified key and value to the server. This * Add an object with the specified key and value to the server. This
* function returns false if the object already exists on the server. The * function returns false if the object already exists on the server. The
* server to add the object to is specified by the master_key parameter. * server to add the object to is specified by the master_key parameter.
* *
* @param[in[ master_key key of server to add object to * @param[in[ master_key key of server to add object to
* @param[in] key key of object to add * @param[in] key key of object to add
* @param[in] value of object to add * @param[in] value of object to add
* @return true on success; false otherwise * @return true on success; false otherwise
*/ */
bool addByKey(const std::string &master_key, bool addByKey(const std::string &master_key,
const std::string &key, const std::string &key,
const std::vector<char> &value) throw(Error) const std::vector<char> &value)
{ {
if (master_key.empty() || return memcached_success(memcached_add_by_key(memc,
key.empty() || master_key.c_str(),
value.empty()) master_key.length(),
{ key.c_str(),
throw(Error("the master key or key supplied is empty!", false)); key.length(),
} &value[0],
memcached_return_t rc= memcached_add_by_key(&memc, value.size(),
master_key.c_str(), 0, 0));
master_key.length(),
key.c_str(),
key.length(),
&value[0],
value.size(),
0, 0);
return (rc == MEMCACHED_SUCCESS);
} }
/** /**
* Replaces an object on the server. This method only succeeds * Replaces an object on the server. This method only succeeds
* if the object is already present on the server. * if the object is already present on the server.
* *
* @param[in] key key of object to replace * @param[in] key key of object to replace
* @param[in[ value value to replace object with * @param[in[ value value to replace object with
* @return true on success; false otherwise * @return true on success; false otherwise
*/ */
bool replace(const std::string &key, const std::vector<char> &value) thro w(Error) bool replace(const std::string &key, const std::vector<char> &value)
{ {
if (key.empty() || return memcached_success(memcached_replace(memc, key.c_str(), key.lengt
value.empty()) h(),
{ &value[0], value.size(),
throw(Error("the key or value supplied is empty!", false)); 0, 0));
}
memcached_return_t rc= memcached_replace(&memc, key.c_str(), key.length
(),
&value[0], value.size(),
0, 0);
return (rc == MEMCACHED_SUCCESS);
} }
/** /**
* Replaces an object on the server. This method only succeeds * Replaces an object on the server. This method only succeeds
* if the object is already present on the server. The server * if the object is already present on the server. The server
* to replace the object on is specified by the master_key param. * to replace the object on is specified by the master_key param.
* *
* @param[in] master_key key of server to replace object on * @param[in] master_key key of server to replace object on
* @param[in] key key of object to replace * @param[in] key key of object to replace
* @param[in[ value value to replace object with * @param[in[ value value to replace object with
* @return true on success; false otherwise * @return true on success; false otherwise
*/ */
bool replaceByKey(const std::string &master_key, bool replaceByKey(const std::string &master_key,
const std::string &key, const std::string &key,
const std::vector<char> &value) const std::vector<char> &value)
{ {
if (master_key.empty() || return memcached_success(memcached_replace_by_key(memc,
key.empty() || master_key.c_str(),
value.empty()) master_key.length(),
{ key.c_str(),
throw(Error("the master key or key supplied is empty!", false)); key.length(),
} &value[0],
memcached_return_t rc= memcached_replace_by_key(&memc, value.size(),
master_key.c_str(), 0, 0));
master_key.length(),
key.c_str(),
key.length(),
&value[0],
value.size(),
0, 0);
return (rc == MEMCACHED_SUCCESS);
} }
/** /**
* Places a segment of data before the last piece of data stored. * Places a segment of data before the last piece of data stored.
* *
* @param[in] key key of object whose value we will prepend data to * @param[in] key key of object whose value we will prepend data to
* @param[in] value data to prepend to object's value * @param[in] value data to prepend to object's value
* @return true on success; false otherwise * @return true on success; false otherwise
*/ */
bool prepend(const std::string &key, const std::vector<char> &value) bool prepend(const std::string &key, const std::vector<char> &value)
throw(Error)
{ {
if (key.empty() || value.empty()) return memcached_success(memcached_prepend(memc, key.c_str(), key.lengt
{ h(),
throw(Error("the key or value supplied is empty!", false)); &value[0], value.size(), 0,
} 0));
memcached_return_t rc= memcached_prepend(&memc, key.c_str(), key.length
(),
&value[0], value.size(), 0, 0);
return (rc == MEMCACHED_SUCCESS);
} }
/** /**
* Places a segment of data before the last piece of data stored. The * Places a segment of data before the last piece of data stored. The
* server on which the object where we will be prepending data is stored * server on which the object where we will be prepending data is stored
* on is specified by the master_key parameter. * on is specified by the master_key parameter.
* *
* @param[in] master_key key of server where object is stored * @param[in] master_key key of server where object is stored
* @param[in] key key of object whose value we will prepend data to * @param[in] key key of object whose value we will prepend data to
* @param[in] value data to prepend to object's value * @param[in] value data to prepend to object's value
* @return true on success; false otherwise * @return true on success; false otherwise
*/ */
bool prependByKey(const std::string &master_key, bool prependByKey(const std::string &master_key,
const std::string &key, const std::string &key,
const std::vector<char> &value) const std::vector<char> &value)
throw(Error)
{ {
if (master_key.empty() || return memcached_success(memcached_prepend_by_key(memc,
key.empty() || master_key.c_str(),
value.empty()) master_key.length(),
{ key.c_str(),
throw(Error("the master key or key supplied is empty!", false)); key.length(),
} &value[0],
memcached_return_t rc= memcached_prepend_by_key(&memc, value.size(),
master_key.c_str(), 0,
master_key.length(), 0));
key.c_str(),
key.length(),
&value[0],
value.size(),
0,
0);
return (rc == MEMCACHED_SUCCESS);
} }
/** /**
* Places a segment of data at the end of the last piece of data stored. * Places a segment of data at the end of the last piece of data stored.
* *
* @param[in] key key of object whose value we will append data to * @param[in] key key of object whose value we will append data to
* @param[in] value data to append to object's value * @param[in] value data to append to object's value
* @return true on success; false otherwise * @return true on success; false otherwise
*/ */
bool append(const std::string &key, const std::vector<char> &value) bool append(const std::string &key, const std::vector<char> &value)
throw(Error)
{ {
if (key.empty() || value.empty()) return memcached_success(memcached_append(memc,
{ key.c_str(),
throw(Error("the key or value supplied is empty!", false)); key.length(),
} &value[0],
memcached_return_t rc= memcached_append(&memc, value.size(),
key.c_str(), 0, 0));
key.length(),
&value[0],
value.size(),
0, 0);
return (rc == MEMCACHED_SUCCESS);
} }
/** /**
* Places a segment of data at the end of the last piece of data stored. The * Places a segment of data at the end of the last piece of data stored. The
* server on which the object where we will be appending data is stored * server on which the object where we will be appending data is stored
* on is specified by the master_key parameter. * on is specified by the master_key parameter.
* *
* @param[in] master_key key of server where object is stored * @param[in] master_key key of server where object is stored
* @param[in] key key of object whose value we will append data to * @param[in] key key of object whose value we will append data to
* @param[in] value data to append to object's value * @param[in] value data to append to object's value
* @return true on success; false otherwise * @return true on success; false otherwise
*/ */
bool appendByKey(const std::string &master_key, bool appendByKey(const std::string &master_key,
const std::string &key, const std::string &key,
const std::vector<char> &value) const std::vector<char> &value)
throw(Error)
{ {
if (master_key.empty() || return memcached_success(memcached_append_by_key(memc,
key.empty() || master_key.c_str(),
value.empty()) master_key.length(),
{ key.c_str(),
throw(Error("the master key or key supplied is empty!", false)); key.length(),
} &value[0],
memcached_return_t rc= memcached_append_by_key(&memc, value.size(),
master_key.c_str(), 0, 0));
master_key.length(),
key.c_str(),
key.length(),
&value[0],
value.size(),
0, 0);
return (rc == MEMCACHED_SUCCESS);
} }
/** /**
* Overwrite data in the server as long as the cas_arg value * Overwrite data in the server as long as the cas_arg value
* is still the same in the server. * is still the same in the server.
* *
* @param[in] key key of object in server * @param[in] key key of object in server
* @param[in] value value to store for object in server * @param[in] value value to store for object in server
* @param[in] cas_arg "cas" value * @param[in] cas_arg "cas" value
*/ */
bool cas(const std::string &key, bool cas(const std::string &key,
const std::vector<char> &value, const std::vector<char> &value,
uint64_t cas_arg) throw(Error) uint64_t cas_arg)
{ {
if (key.empty() || value.empty()) return memcached_success(memcached_cas(memc, key.c_str(), key.length(),
{ &value[0], value.size(),
throw(Error("the key or value supplied is empty!", false)); 0, 0, cas_arg));
}
memcached_return_t rc= memcached_cas(&memc, key.c_str(), key.length(),
&value[0], value.size(),
0, 0, cas_arg);
return (rc == MEMCACHED_SUCCESS);
} }
/** /**
* Overwrite data in the server as long as the cas_arg value * Overwrite data in the server as long as the cas_arg value
* is still the same in the server. The server to use is * is still the same in the server. The server to use is
* specified by the master_key parameter. * specified by the master_key parameter.
* *
* @param[in] master_key specifies server to operate on * @param[in] master_key specifies server to operate on
* @param[in] key key of object in server * @param[in] key key of object in server
* @param[in] value value to store for object in server * @param[in] value value to store for object in server
* @param[in] cas_arg "cas" value * @param[in] cas_arg "cas" value
*/ */
bool casByKey(const std::string &master_key, bool casByKey(const std::string &master_key,
const std::string &key, const std::string &key,
const std::vector<char> &value, const std::vector<char> &value,
uint64_t cas_arg) throw(Error) uint64_t cas_arg)
{ {
if (master_key.empty() || return memcached_success(memcached_cas_by_key(memc,
key.empty() || master_key.c_str(),
value.empty()) master_key.length(),
{ key.c_str(),
throw(Error("the master key, key or value supplied is empty!", false) key.length(),
); &value[0],
} value.size(),
memcached_return_t rc= memcached_cas_by_key(&memc, 0, 0, cas_arg));
master_key.c_str(),
master_key.length(),
key.c_str(),
key.length(),
&value[0],
value.size(),
0, 0, cas_arg);
return (rc == MEMCACHED_SUCCESS);
} }
/** /**
* Delete an object from the server specified by the key given. * Delete an object from the server specified by the key given.
* *
* @param[in] key key of object to delete * @param[in] key key of object to delete
* @return true on success; false otherwise * @return true on success; false otherwise
*/ */
bool remove(const std::string &key) throw(Error) bool remove(const std::string &key)
{ {
if (key.empty()) return memcached_success(memcached_delete(memc, key.c_str(), key.length
{ (), 0));
throw(Error("the key supplied is empty!", false));
}
memcached_return_t rc= memcached_delete(&memc, key.c_str(), key.length(
), 0);
return (rc == MEMCACHED_SUCCESS);
} }
/** /**
* Delete an object from the server specified by the key given. * Delete an object from the server specified by the key given.
* *
* @param[in] key key of object to delete * @param[in] key key of object to delete
* @param[in] expiration time to delete the object after * @param[in] expiration time to delete the object after
* @return true on success; false otherwise * @return true on success; false otherwise
*/ */
bool remove(const std::string &key, bool remove(const std::string &key, time_t expiration)
time_t expiration) throw(Error)
{ {
if (key.empty()) return memcached_success(memcached_delete(memc,
{ key.c_str(),
throw(Error("the key supplied is empty!", false)); key.length(),
} expiration));
memcached_return_t rc= memcached_delete(&memc,
key.c_str(),
key.length(),
expiration);
return (rc == MEMCACHED_SUCCESS);
} }
/** /**
* Delete an object from the server specified by the key given. * Delete an object from the server specified by the key given.
* *
* @param[in] master_key specifies server to remove object from * @param[in] master_key specifies server to remove object from
* @param[in] key key of object to delete * @param[in] key key of object to delete
* @return true on success; false otherwise * @return true on success; false otherwise
*/ */
bool removeByKey(const std::string &master_key, bool removeByKey(const std::string &master_key,
const std::string &key) throw(Error) const std::string &key)
{ {
if (master_key.empty() || key.empty()) return memcached_success(memcached_delete_by_key(memc,
{ master_key.c_str(),
throw(Error("the master key or key supplied is empty!", false)); master_key.length(),
} key.c_str(),
memcached_return_t rc= memcached_delete_by_key(&memc, key.length(),
master_key.c_str(), 0));
master_key.length(),
key.c_str(),
key.length(),
0);
return (rc == MEMCACHED_SUCCESS);
} }
/** /**
* Delete an object from the server specified by the key given. * Delete an object from the server specified by the key given.
* *
* @param[in] master_key specifies server to remove object from * @param[in] master_key specifies server to remove object from
* @param[in] key key of object to delete * @param[in] key key of object to delete
* @param[in] expiration time to delete the object after * @param[in] expiration time to delete the object after
* @return true on success; false otherwise * @return true on success; false otherwise
*/ */
bool removeByKey(const std::string &master_key, bool removeByKey(const std::string &master_key,
const std::string &key, const std::string &key,
time_t expiration) throw(Error) time_t expiration)
{ {
if (master_key.empty() || key.empty()) return memcached_success(memcached_delete_by_key(memc,
{ master_key.c_str(),
throw(Error("the master key or key supplied is empty!", false)); master_key.length(),
} key.c_str(),
memcached_return_t rc= memcached_delete_by_key(&memc, key.length(),
master_key.c_str(), expiration));
master_key.length(),
key.c_str(),
key.length(),
expiration);
return (rc == MEMCACHED_SUCCESS);
} }
/** /**
* Wipe the contents of memcached servers. * Wipe the contents of memcached servers.
* *
* @param[in] expiration time to wait until wiping contents of * @param[in] expiration time to wait until wiping contents of
* memcached servers * memcached servers
* @return true on success; false otherwise * @return true on success; false otherwise
*/ */
bool flush(time_t expiration) bool flush(time_t expiration= 0)
{ {
memcached_return_t rc= memcached_flush(&memc, expiration); return memcached_success(memcached_flush(memc, expiration));
return (rc == MEMCACHED_SUCCESS);
}
/**
* Callback function for result sets. It passes the result
* sets to the list of functions provided.
*
* @param[in] callback list of callback functions
* @param[in] context pointer to memory reference that is
* supplied to the calling function
* @param[in] num_of_callbacks number of callback functions
* @return true on success; false otherwise
*/
bool fetchExecute(memcached_execute_fn *callback,
void *context,
uint32_t num_of_callbacks)
{
memcached_return_t rc= memcached_fetch_execute(&memc,
callback,
context,
num_of_callbacks);
return (rc == MEMCACHED_SUCCESS);
} }
/** /**
* Get the library version string. * Get the library version string.
* @return std::string containing a copy of the library version string. * @return std::string containing a copy of the library version string.
*/ */
const std::string libVersion() const const std::string libVersion() const
{ {
const char *ver= memcached_lib_version(); const char *ver= memcached_lib_version();
const std::string version(ver); const std::string version(ver);
skipping to change at line 945 skipping to change at line 739
* stats. Each server will map to another std::map of the key:value stats . * stats. Each server will map to another std::map of the key:value stats .
* *
* @param[out] stats_map a std::map to be populated with the memcached * @param[out] stats_map a std::map to be populated with the memcached
* stats * stats
* @return true on success; false otherwise * @return true on success; false otherwise
*/ */
bool getStats(std::map< std::string, std::map<std::string, std::string> > bool getStats(std::map< std::string, std::map<std::string, std::string> >
&stats_map) &stats_map)
{ {
memcached_return_t rc; memcached_return_t rc;
memcached_stat_st *stats= memcached_stat(&memc, NULL, &rc); memcached_stat_st *stats= memcached_stat(memc, NULL, &rc);
if (rc != MEMCACHED_SUCCESS && if (rc != MEMCACHED_SUCCESS &&
rc != MEMCACHED_SOME_ERRORS) rc != MEMCACHED_SOME_ERRORS)
{ {
return false; return false;
} }
uint32_t server_count= memcached_server_count(&memc); uint32_t server_count= memcached_server_count(memc);
/* /*
* For each memcached server, construct a std::map for its stats and ad d * For each memcached server, construct a std::map for its stats and ad d
* it to the std::map of overall stats. * it to the std::map of overall stats.
*/ */
for (uint32_t x= 0; x < server_count; x++) for (uint32_t x= 0; x < server_count; x++)
{ {
memcached_server_instance_st instance= memcached_server_instance_st instance=
memcached_server_instance_by_position(&memc, x); memcached_server_instance_by_position(memc, x);
std::ostringstream strstm; std::ostringstream strstm;
std::string server_name(memcached_server_name(instance)); std::string server_name(memcached_server_name(instance));
server_name.append(":"); server_name.append(":");
strstm << memcached_server_port(instance); strstm << memcached_server_port(instance);
server_name.append(strstm.str()); server_name.append(strstm.str());
std::map<std::string, std::string> server_stats; std::map<std::string, std::string> server_stats;
char **list= NULL; char **list= NULL;
char **ptr= NULL; char **ptr= NULL;
list= memcached_stat_get_keys(&memc, &stats[x], &rc); list= memcached_stat_get_keys(memc, &stats[x], &rc);
for (ptr= list; *ptr; ptr++) for (ptr= list; *ptr; ptr++)
{ {
char *value= memcached_stat_get_value(&memc, &stats[x], *ptr, &rc); char *value= memcached_stat_get_value(memc, &stats[x], *ptr, &rc);
server_stats[*ptr]= value; server_stats[*ptr]= value;
free(value); free(value);
} }
stats_map[server_name]= server_stats; stats_map[server_name]= server_stats;
free(list); free(list);
} }
memcached_stat_free(&memc, stats); memcached_stat_free(memc, stats);
return true; return true;
} }
private: private:
memcached_st *memc;
std::string servers_list;
memcached_st memc;
memcached_result_st result;
}; };
} }
#endif /* LIBMEMCACHEDPP_H */
 End of changes. 86 change blocks. 
384 lines changed or deleted 181 lines changed or added


 memcached_util.h   memcached_util.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: Connection pool library. * Copyright (C) 2011 Data Differential, http://datadifferential.com/
* Copyright (C) 2006-2009 Brian Aker All rights reserved.
* *
* Author: Trond Norbye, Brian Aker * 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_UTIL_H__ #pragma once
#define __LIBMEMCACHED__MEMCACHED_UTIL_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>
#endif /* __LIBMEMCACHED__MEMCACHED_UTIL_H__ */
 End of changes. 7 change blocks. 
9 lines changed or deleted 33 lines changed or added


 options.h   options.h 
skipping to change at line 54 skipping to change at line 54
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 LIBMEMCACHED_LOCAL
void memcached_set_configuration_file(memcached_st *self, const char *fil ename, size_t filename_length); void memcached_set_configuration_file(memcached_st *self, const char *fil ename, size_t filename_length);
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
memcached_return_t memcached_parse_configuration(memcached_st *ptr, const char *option_string, size_t length); memcached_return_t memcached_parse_configuration(memcached_st *ptr, const char *option_string, size_t length);
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
memcached_return_t memcached_parse_configure_file(memcached_st *ptr, cons
t char *filename, size_t filename_length);
LIBMEMCACHED_LOCAL
const char *memcached_parse_filename(memcached_st *memc); const char *memcached_parse_filename(memcached_st *memc);
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
size_t memcached_parse_filename_length(memcached_st *memc); 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. 
4 lines changed or deleted 0 lines changed or added


 ping.h   ping.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: connects to a host, and makes sure it is alive. * Copyright (C) 2011 Data Differential, http://datadifferential.com/
* Copyright (C) 2010 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_PING_H__ #pragma once
#define __LIBMEMCACHED_PING_H__
#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);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __LIBMEMCACHED_PING_H__ */
 End of changes. 5 change blocks. 
8 lines changed or deleted 33 lines changed or added


 platform.h   platform.h 
/* LibMemcached /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
* Copyright (C) 2006-2010 Brian Aker, Trond Norbye
* 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: Try to hide platform-specific stuff * Copyright (C) 2011 Data Differential, http://datadifferential.com/
* Copyright (C) 2006-2009 Brian Aker, Trond Norbye 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_PLATFORM_H
#define LIBMEMCACHED_PLATFORM_H 1 #pragma once
#ifdef WIN32 #ifdef WIN32
#include <winsock2.h> #include <winsock2.h>
#include <ws2tcpip.h> #include <ws2tcpip.h>
typedef short in_port_t; typedef short in_port_t;
typedef SOCKET memcached_socket_t; typedef SOCKET memcached_socket_t;
#else #else
typedef int memcached_socket_t; typedef int memcached_socket_t;
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netdb.h> #include <netdb.h>
#include <sys/un.h> #include <sys/un.h>
#include <netinet/tcp.h> #include <netinet/tcp.h>
#endif /* WIN32 */ #endif /* WIN32 */
#endif /* LIBMEMCACHED_PLATFORM_H */
 End of changes. 5 change blocks. 
8 lines changed or deleted 34 lines changed or added


 pool.h   pool.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: Connection pool implementation for libmemcached. * 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 __LIMEMCACHED_UTIL_POOL_H__ #pragma once
#define __LIMEMCACHED_UTIL_POOL_H__
#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;
skipping to change at line 53 skipping to change at line 78
memcached_behavior_t flag, memcached_behavior_t flag,
uint64_t data); uint64_t data);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_pool_behavior_get(memcached_pool_st *ptr, memcached_return_t memcached_pool_behavior_get(memcached_pool_st *ptr,
memcached_behavior_t flag, memcached_behavior_t flag,
uint64_t *value); uint64_t *value);
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
#endif #endif
#endif /* __LIMEMCACHED_UTIL_POOL_H__ */
 End of changes. 5 change blocks. 
8 lines changed or deleted 33 lines changed or added


 protocol_binary.h   protocol_binary.h 
skipping to change at line 221 skipping to change at line 221
uint32_t bodylen; uint32_t bodylen;
uint32_t opaque; uint32_t opaque;
uint64_t cas; uint64_t cas;
} response; } response;
uint8_t bytes[24]; uint8_t bytes[24];
} protocol_binary_response_header; } protocol_binary_response_header;
/** /**
* Definition of a request-packet containing no extras * Definition of a request-packet containing no extras
*/ */
typedef union { union protocol_binary_request_no_extras {
struct { struct {
protocol_binary_request_header header; protocol_binary_request_header header;
} message; } message;
uint8_t bytes[sizeof(protocol_binary_request_header)]; uint8_t bytes[sizeof(protocol_binary_request_header)];
} protocol_binary_request_no_extras; };
typedef union protocol_binary_request_no_extras protocol_binary_request
_no_extras;
/** /**
* Definition of a response-packet containing no extras * Definition of a response-packet containing no extras
*/ */
typedef union { typedef union {
struct { struct {
protocol_binary_response_header header; protocol_binary_response_header header;
} message; } message;
uint8_t bytes[sizeof(protocol_binary_response_header)]; uint8_t bytes[sizeof(protocol_binary_response_header)];
} protocol_binary_response_no_extras; } protocol_binary_response_no_extras;
 End of changes. 2 change blocks. 
2 lines changed or deleted 4 lines changed or added


 protocol_handler.h   protocol_handler.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.
* *
* Summary: Definition of the callback interface to the protocol handler * Summary: Definition of the callback interface to the protocol handler
* *
* Author: Trond Norbye * Author: Trond Norbye
* *
*/ */
#ifndef __LIBMEMCACHED_PROTOCOL_H__ #pragma once
#define __LIBMEMCACHED_PROTOCOL_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/platform.h> #include <libmemcached/platform.h>
#include <libmemcached/memcached/protocol_binary.h> #include <libmemcached/memcached/protocol_binary.h>
#include <libmemcached/visibility.h> #include <libmemcached/visibility.h>
#include <libmemcached/protocol/callback.h> #include <libmemcached/protocol/callback.h>
skipping to change at line 216 skipping to change at line 215
* @param cookie the cookie passed along into the callback * @param cookie the cookie passed along into the callback
* @return the raw reponse handler you may use if you find * @return the raw reponse handler you may use if you find
* the generic callback too limiting * the generic callback too limiting
*/ */
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_binary_protocol_raw_response_handler memcached_binary_protocol_ge t_raw_response_handler(const void *cookie); memcached_binary_protocol_raw_response_handler memcached_binary_protocol_ge t_raw_response_handler(const void *cookie);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif
 End of changes. 2 change blocks. 
2 lines changed or deleted 1 lines changed or added


 quit.h   quit.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: returns a human readable string for the error message * Copyright (C) 2011 Data Differential, http://datadifferential.com/
* Copyright (C) 2010 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_QUIT_H__ #pragma once
#define __LIBMEMCACHED_QUIT_H__
#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 LIBMEMCACHED_LOCAL
void send_quit(memcached_st *ptr); void send_quit(memcached_st *ptr);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __LIBMEMCACHED_QUIT_H__ */
 End of changes. 5 change blocks. 
8 lines changed or deleted 33 lines changed or added


 result.h   result.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: Functions to manipulate the result structure. * 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 __LIBMEMCACHED_RESULT_H__ #pragma once
#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;
memcached_st *root; memcached_st *root;
memcached_string_st value; memcached_string_st value;
uint64_t count;
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
extern "C" { extern "C" {
skipping to change at line 75 skipping to change at line 101
LIBMEMCACHED_API LIBMEMCACHED_API
void memcached_result_set_flags(memcached_result_st *self, uint32_t flags); void memcached_result_set_flags(memcached_result_st *self, uint32_t flags);
LIBMEMCACHED_API LIBMEMCACHED_API
void memcached_result_set_expiration(memcached_result_st *self, time_t expi ration); void memcached_result_set_expiration(memcached_result_st *self, time_t expi ration);
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
#endif #endif
#endif /* __LIBMEMCACHED_RESULT_H__ */
 End of changes. 6 change blocks. 
8 lines changed or deleted 34 lines changed or added


 sasl.h   sasl.h 
/* LibMemcached /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
* Copyright (C) 2006-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: 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_SASL_H
#define LIBMEMCACHED_MEMCACHED_SASL_H #pragma once
#ifdef LIBMEMCACHED_WITH_SASL_SUPPORT #ifdef LIBMEMCACHED_WITH_SASL_SUPPORT
#include <sasl/sasl.h> #include <sasl/sasl.h>
#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,
skipping to change at line 61 skipping to change at line 86
const sasl_callback_t *callbacks; const sasl_callback_t *callbacks;
#else #else
const void *callbacks; const void *callbacks;
#endif #endif
/* /*
** Did we allocate data inside the callbacks, or did the user ** Did we allocate data inside the callbacks, or did the user
** supply that. ** supply that.
*/ */
bool is_allocated; bool is_allocated;
}; };
#endif /* LIBMEMCACHED_MEMCACHED_SASL_H */
 End of changes. 5 change blocks. 
9 lines changed or deleted 34 lines changed or added


 server.h   server.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: String structure used for libmemcached. * 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 __LIBMEMCACHED_SERVER_H__ #pragma once
#define __LIBMEMCACHED_SERVER_H__
enum memcached_server_state_t {
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_IN_PROGRESS,
MEMCACHED_SERVER_STATE_CONNECTED
};
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; 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;
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; 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;
const memcached_st *root; 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" {
#endif #endif
skipping to change at line 132 skipping to change at line 165
LIBMEMCACHED_API LIBMEMCACHED_API
in_port_t memcached_server_port(memcached_server_instance_st self); in_port_t memcached_server_port(memcached_server_instance_st self);
LIBMEMCACHED_API LIBMEMCACHED_API
const char *memcached_server_error(memcached_server_instance_st ptr); const char *memcached_server_error(memcached_server_instance_st ptr);
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
#endif #endif
#endif /* __LIBMEMCACHED_SERVER_H__ */
 End of changes. 7 change blocks. 
9 lines changed or deleted 43 lines changed or added


 server_list.h   server_list.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: Types for libmemcached * 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 __LIBMEMCACHED_SERVER_LIST_H__ #pragma once
#define __LIBMEMCACHED_SERVER_LIST_H__
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* Server List Public functions */ /* Server List Public functions */
LIBMEMCACHED_API LIBMEMCACHED_API
void memcached_server_list_free(memcached_server_list_st ptr); void memcached_server_list_free(memcached_server_list_st ptr);
LIBMEMCACHED_API LIBMEMCACHED_API
skipping to change at line 52 skipping to change at line 77
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
memcached_server_st *memcached_server_list(const memcached_st *); memcached_server_st *memcached_server_list(const memcached_st *);
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
void memcached_server_list_set(memcached_st *self, memcached_server_list_ st list); void memcached_server_list_set(memcached_st *self, memcached_server_list_ st list);
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
#endif #endif
#endif /* __LIBMEMCACHED_SERVER_LIST_H__ */
 End of changes. 5 change blocks. 
8 lines changed or deleted 33 lines changed or added


 stats.h   stats.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: Collect up the stats for a memcached server. * 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 __LIBMEMCACHED_STATS_H__ #pragma once
#define __LIBMEMCACHED_STATS_H__
struct memcached_stat_st { struct memcached_stat_st {
uint32_t connection_structures; unsigned long connection_structures;
uint32_t curr_connections; unsigned long curr_connections;
uint32_t curr_items; unsigned long curr_items;
uint32_t pid; unsigned long pid;
uint32_t pointer_size; unsigned long pointer_size;
uint32_t rusage_system_microseconds; unsigned long rusage_system_microseconds;
uint32_t rusage_system_seconds; unsigned long rusage_system_seconds;
uint32_t rusage_user_microseconds; unsigned long rusage_user_microseconds;
uint32_t rusage_user_seconds; unsigned long rusage_user_seconds;
uint32_t threads; unsigned long threads;
uint32_t time; unsigned long time;
uint32_t total_connections; unsigned long total_connections;
uint32_t total_items; unsigned long total_items;
uint32_t uptime; unsigned long uptime;
uint64_t bytes; unsigned long long bytes;
uint64_t bytes_read; unsigned long long bytes_read;
uint64_t bytes_written; unsigned long long bytes_written;
uint64_t cmd_get; unsigned long long cmd_get;
uint64_t cmd_set; unsigned long long cmd_set;
uint64_t evictions; unsigned long long evictions;
uint64_t get_hits; unsigned long long get_hits;
uint64_t get_misses; unsigned long long get_misses;
uint64_t limit_maxbytes; unsigned long long limit_maxbytes;
char version[MEMCACHED_VERSION_STRING_LENGTH]; char version[MEMCACHED_VERSION_STRING_LENGTH];
void *__future; // @todo create a new structure to place here for future usage
memcached_st *root; memcached_st *root;
}; };
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
LIBMEMCACHED_API LIBMEMCACHED_API
void memcached_stat_free(const memcached_st *, memcached_stat_st *); void memcached_stat_free(const memcached_st *, memcached_stat_st *);
skipping to change at line 62 skipping to change at line 88
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_stat_servername(memcached_stat_st *memc_stat, char *args, memcached_return_t memcached_stat_servername(memcached_stat_st *memc_stat, char *args,
const char *hostname, in_port_ t port); const char *hostname, in_port_ t port);
LIBMEMCACHED_API LIBMEMCACHED_API
char *memcached_stat_get_value(const memcached_st *ptr, memcached_stat_st * memc_stat, char *memcached_stat_get_value(const memcached_st *ptr, memcached_stat_st * memc_stat,
const char *key, memcached_return_t *error); const char *key, memcached_return_t *error);
LIBMEMCACHED_API LIBMEMCACHED_API
char ** memcached_stat_get_keys(const memcached_st *ptr, memcached_stat_st *memc_stat, char ** memcached_stat_get_keys(memcached_st *ptr, memcached_stat_st *memc_ stat,
memcached_return_t *error); memcached_return_t *error);
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_stat_execute(memcached_st *memc, const char *a rgs, memcached_stat_fn func, void *context); memcached_return_t memcached_stat_execute(memcached_st *memc, const char *a rgs, memcached_stat_fn func, void *context);
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
#endif #endif
#endif /* __LIBMEMCACHED_STATS_H__ */
 End of changes. 8 change blocks. 
32 lines changed or deleted 58 lines changed or added


 storage.h   storage.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: Storage related functions, aka set, replace,.. * 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 __LIBMEMCACHED_STORAGE_H__ #pragma once
#define __LIBMEMCACHED_STORAGE_H__
#include "libmemcached/memcached.h" #include "libmemcached/memcached.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* All of the functions for adding data to the server */ /* All of the functions for adding data to the server */
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_set(memcached_st *ptr, const char *key, size_t key_length, memcached_return_t memcached_set(memcached_st *ptr, const char *key, size_t key_length,
skipping to change at line 109 skipping to change at line 134
const char *group_key, size_t group _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
#endif /* __LIBMEMCACHED_STORAGE_H__ */
 End of changes. 5 change blocks. 
8 lines changed or deleted 33 lines changed or added


 string.h   string.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: String structure used for libmemcached. * 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.
* *
*/ */
#pragma once #pragma once
#ifndef __LIBMEMCACHED_STRING_H__
#define __LIBMEMCACHED_STRING_H__ #include <libmemcached/basic_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.
*/ */
skipping to change at line 37 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;
}; };
struct memcached_string_t { #ifdef BUILDING_LIBMEMCACHED
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(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);
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
char *memcached_string_c_copy(memcached_string_st *string); char *memcached_string_c_copy(memcached_string_st *string);
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
memcached_return_t memcached_string_append_character(memcached_string_st *s tring, memcached_return_t memcached_string_append_character(memcached_string_st *s tring,
skipping to change at line 78 skipping to change at line 101
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
size_t memcached_string_length(const memcached_string_st *self); size_t memcached_string_length(const memcached_string_st *self);
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
size_t memcached_string_size(const memcached_string_st *self); size_t memcached_string_size(const memcached_string_st *self);
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
const char *memcached_string_value(const memcached_string_st *self); const char *memcached_string_value(const memcached_string_st *self);
LIBMEMCACHED_LOCAL LIBMEMCACHED_LOCAL
char *memcached_string_take_value(memcached_string_st *self);
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 #ifdef __cplusplus
#define memcached_string_with_size(X) (X), (static_cast<size_t>((sizeof(X) #define memcached_literal_param(X) (X), (static_cast<size_t>((sizeof(X) - 1
- 1))) )))
#define memcached_string_make(X) (static_cast<size_t>((sizeof(X) - 1))), (X
)
#else #else
#define memcached_string_with_size(X) (X), ((size_t)((sizeof(X) - 1))) #define memcached_literal_param(X) (X), ((size_t)((sizeof(X) - 1)))
#define memcached_string_make(X) (((size_t)((sizeof(X) - 1))), (X)
#endif #endif
#define memcached_string_make_from_cstr(X) (X), ((X) ? strlen(X) : 0) #define memcached_string_make_from_cstr(X) (X), ((X) ? strlen(X) : 0)
#endif #endif
#endif /* __LIBMEMCACHED_STRING_H__ */
 End of changes. 11 change blocks. 
21 lines changed or deleted 42 lines changed or added


 types.h   types.h 
skipping to change at line 38 skipping to change at line 38
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* 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.
* *
*/ */
#ifndef HASHKIT_TYPES_H #pragma once
#define HASHKIT_TYPES_H
#ifdef __cplusplus
extern "C" {
#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_HASH,
HASHKIT_INVALID_ARGUMENT, 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;
#define hashkit_success(X) ((X) == HASHKIT_SUCCESS)
#define hashkit_failed(X) ((X) != HASHKIT_SUCCESS)
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,
HASHKIT_HASH_FNV1A_32, HASHKIT_HASH_FNV1A_32,
HASHKIT_HASH_HSIEH, HASHKIT_HASH_HSIEH,
HASHKIT_HASH_MURMUR, HASHKIT_HASH_MURMUR,
skipping to change at line 81 skipping to change at line 78
* Hash distributions that are available to use. * Hash distributions that are available to use.
*/ */
typedef enum typedef enum
{ {
HASHKIT_DISTRIBUTION_MODULA, HASHKIT_DISTRIBUTION_MODULA,
HASHKIT_DISTRIBUTION_RANDOM, HASHKIT_DISTRIBUTION_RANDOM,
HASHKIT_DISTRIBUTION_KETAMA, HASHKIT_DISTRIBUTION_KETAMA,
HASHKIT_DISTRIBUTION_MAX /* Always add new values before this. */ HASHKIT_DISTRIBUTION_MAX /* Always add new values before this. */
} hashkit_distribution_t; } hashkit_distribution_t;
#ifdef __cplusplus
extern "C" {
#endif
typedef struct hashkit_st hashkit_st; typedef struct hashkit_st hashkit_st;
typedef uint32_t (*hashkit_hash_fn)(const char *key, size_t key_length, voi d *context); typedef uint32_t (*hashkit_hash_fn)(const char *key, size_t key_length, voi d *context);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* HASHKIT_TYPES_H */
 End of changes. 4 change blocks. 
7 lines changed or deleted 8 lines changed or added


 util.h   util.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: Connection pool library. * Copyright (C) 2011 Data Differential, http://datadifferential.com/
* Copyright (C) 2006-2009 Brian Aker All rights reserved.
* *
* Author: Trond Norbye, Brian Aker * 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__UTIL_H__ #pragma once
#define __LIBMEMCACHED__UTIL_H__
#include <libmemcached/memcached_util.h> #include <libmemcached/memcached_util.h>
#endif /* __LIBMEMCACHED__UTIL_H__ */
 End of changes. 6 change blocks. 
9 lines changed or deleted 32 lines changed or added


 verbosity.h   verbosity.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: Change the verbository level of the memcached server * Copyright (C) 2011 Data Differential, http://datadifferential.com/
* Copyright (C) 2010 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_VERBOSITY_H__ #pragma once
#define __LIBMEMCACHED_VERBOSITY_H__
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_verbosity(memcached_st *ptr, uint32_t verbosit y); memcached_return_t memcached_verbosity(memcached_st *ptr, uint32_t verbosit y);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __LIBMEMCACHED_VERBOSITY_H__ */
 End of changes. 5 change blocks. 
8 lines changed or deleted 33 lines changed or added


 version.h   version.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: Find version information * Copyright (C) 2011 Data Differential, http://datadifferential.com/
* Copyright (C) 2010 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_VERSION_H__ #pragma once
#define __LIBMEMCACHED_VERSION_H__
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
LIBMEMCACHED_API LIBMEMCACHED_API
memcached_return_t memcached_version(memcached_st *ptr); memcached_return_t memcached_version(memcached_st *ptr);
LIBMEMCACHED_API LIBMEMCACHED_API
const char * memcached_lib_version(void); const char * memcached_lib_version(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __LIBMEMCACHED_VERSION_H__ */
 End of changes. 5 change blocks. 
8 lines changed or deleted 33 lines changed or added


 visibility.h   visibility.h 
skipping to change at line 16 skipping to change at line 16
* the COPYING file in this directory for full text. * the COPYING file in this directory for full text.
* *
* Author: Monty Taylor * Author: Monty Taylor
*/ */
/** /**
* @file * @file
* @brief Visibility control macros * @brief Visibility control macros
*/ */
#ifndef HASHKIT_VISIBILITY_H #pragma once
#define HASHKIT_VISIBILITY_H
/** /**
* *
* HASHKIT_API is used for the public API symbols. It either DLL imports or * HASHKIT_API is used for the public API symbols. It either DLL imports or
* DLL exports (or does nothing for static build). * DLL exports (or does nothing for static build).
* *
* HASHKIT_LOCAL is used for non-api symbols. * HASHKIT_LOCAL is used for non-api symbols.
*/ */
#if defined(BUILDING_HASHKIT) #if defined(BUILDING_HASHKIT)
skipping to change at line 50 skipping to change at line 49
# endif /* defined(HAVE_VISIBILITY) */ # endif /* defined(HAVE_VISIBILITY) */
#else /* defined(BUILDING_HASHKIT) */ #else /* defined(BUILDING_HASHKIT) */
# if defined(_MSC_VER) # if defined(_MSC_VER)
# define HASHKIT_API extern __declspec(dllimport) # define HASHKIT_API extern __declspec(dllimport)
# define HASHKIT_LOCAL # define HASHKIT_LOCAL
# else # else
# define HASHKIT_API # define HASHKIT_API
# define HASHKIT_LOCAL # define HASHKIT_LOCAL
# endif /* defined(_MSC_VER) */ # endif /* defined(_MSC_VER) */
#endif /* defined(BUILDING_HASHKIT) */ #endif /* defined(BUILDING_HASHKIT) */
#endif /* HASHKIT_VISIBILITY_H */
 End of changes. 2 change blocks. 
2 lines changed or deleted 1 lines changed or added


 watchpoint.h   watchpoint.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: Localized copy of WATCHPOINT debug symbols * 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 __LIBMEMCACHED_WATCHPOINT_H__ #pragma once
#define __LIBMEMCACHED_WATCHPOINT_H__
/* Some personal debugging functions */ /* Some personal debugging functions */
#if defined(DEBUG) #if defined(DEBUG)
#ifdef TARGET_OS_LINUX #ifdef TARGET_OS_LINUX
static inline void libmemcached_stack_dump(void) static inline void libmemcached_stack_dump(void)
{ {
void *array[10]; void *array[10];
int size; int size;
char **strings; char **strings;
skipping to change at line 74 skipping to change at line 99
#define WATCHPOINT_ERRNO(A) do { fprintf(stderr, "\nWATCHPOINT %s:%d (%s) % s\n", __FILE__, __LINE__,__func__, strerror(A));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_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(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_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); #define WATCHPOINT_SET(A) do { A; } while(0);
#else #else
#define WATCHPOINT #define WATCHPOINT
#define WATCHPOINT_ERROR(A) #define WATCHPOINT_ERROR(A)
#define WATCHPOINT_IFERROR(A) #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) #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 */ #endif /* DEBUG */
#endif /* __LIBMEMCACHED_WATCHPOINT_H__ */
 End of changes. 7 change blocks. 
10 lines changed or deleted 35 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/