memcached.h   memcached.h 
skipping to change at line 34 skipping to change at line 34
#include <libmemcached/memcached_result.h> #include <libmemcached/memcached_result.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* These are Private and should not be used by applications */ /* These are Private and should not be used by applications */
#define MEMCACHED_VERSION_STRING_LENGTH 12 #define MEMCACHED_VERSION_STRING_LENGTH 12
/* string value */ /* string value */
#define LIBMEMCACHED_VERSION_STRING "0.19" struct memcached_continuum_item_st {
uint32_t index;
uint32_t value;
};
#define LIBMEMCACHED_VERSION_STRING "0.20"
struct memcached_stat_st { struct memcached_stat_st {
uint32_t pid; uint32_t pid;
uint32_t uptime; uint32_t uptime;
uint32_t threads; uint32_t threads;
uint32_t time; uint32_t time;
uint32_t pointer_size; uint32_t pointer_size;
uint32_t rusage_user_seconds; uint32_t rusage_user_seconds;
uint32_t rusage_user_microseconds; uint32_t rusage_user_microseconds;
uint32_t rusage_system_seconds; uint32_t rusage_system_seconds;
skipping to change at line 79 skipping to change at line 84
uint32_t flags; uint32_t flags;
int send_size; int send_size;
int recv_size; int recv_size;
int32_t poll_timeout; int32_t poll_timeout;
int32_t connect_timeout; int32_t connect_timeout;
int32_t retry_timeout; int32_t retry_timeout;
memcached_result_st result; memcached_result_st result;
memcached_hash hash; memcached_hash hash;
memcached_server_distribution distribution; memcached_server_distribution distribution;
void *user_data; void *user_data;
unsigned int wheel[MEMCACHED_WHEEL_SIZE]; unsigned int *wheel;
uint32_t wheel_count;
uint32_t continuum_count;
memcached_continuum_item_st *continuum;
memcached_clone_func on_clone; memcached_clone_func on_clone;
memcached_cleanup_func on_cleanup; memcached_cleanup_func on_cleanup;
memcached_free_function call_free; memcached_free_function call_free;
memcached_malloc_function call_malloc; memcached_malloc_function call_malloc;
memcached_realloc_function call_realloc; memcached_realloc_function call_realloc;
memcached_trigger_key get_key_failure; memcached_trigger_key get_key_failure;
memcached_trigger_delete_key delete_trigger; memcached_trigger_delete_key delete_trigger;
#ifdef NOT_USED /* Future Use */ #ifdef NOT_USED /* Future Use */
uint8_t replicas; uint8_t replicas;
memcached_return warning; memcached_return warning;
skipping to change at line 177 skipping to change at line 185
char *master_key, size_t master_key_ length, char *master_key, size_t master_key_ length,
char **keys, size_t *key_length, char **keys, size_t *key_length,
unsigned int number_of_keys); unsigned int number_of_keys);
memcached_return memcached_delete_by_key(memcached_st *ptr, memcached_return memcached_delete_by_key(memcached_st *ptr,
char *master_key, size_t master_ke y_length, char *master_key, size_t master_ke y_length,
char *key, size_t key_length, char *key, size_t key_length,
time_t expiration); time_t expiration);
memcached_return memcached_fetch_execute(memcached_st *ptr, memcached_return memcached_fetch_execute(memcached_st *ptr,
unsigned int (*callback[])(mem cached_st *ptr, memcached_result_st *result, void *context), memcached_execute_function *ca llback,
void *context, void *context,
unsigned int number_of_callbac unsigned int number_of_callbac
ks ks);
);
memcached_return memcached_callback_set(memcached_st *ptr, memcached_return memcached_callback_set(memcached_st *ptr,
memcached_callback flag, memcached_callback flag,
void *data); void *data);
void *memcached_callback_get(memcached_st *ptr, void *memcached_callback_get(memcached_st *ptr,
memcached_callback flag, memcached_callback flag,
memcached_return *error); memcached_return *error);
memcached_return memcached_server_cursor(memcached_st *ptr, memcached_return memcached_server_cursor(memcached_st *ptr,
memcached_server_function *callbac k, memcached_server_function *callbac k,
 End of changes. 4 change blocks. 
6 lines changed or deleted 13 lines changed or added


 memcached.hh   memcached.hh 
skipping to change at line 12 skipping to change at line 12
#pragma interface /* gcc class implementation */ #pragma interface /* gcc class implementation */
#endif #endif
#include <memcached.h> #include <memcached.h>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
class Memcached class Memcached
{ {
memcached_st memc; memcached_st memc;
memcached_result_st result;
public: public:
Memcached() Memcached()
{ {
memcached_create(&memc); memcached_create(&memc);
} }
Memcached(memcached_st *clone) Memcached(memcached_st *clone)
{ {
memcached_clone(&memc, clone); memcached_clone(&memc, clone);
} }
char *fetch (char *key, size_t *key_length, size_t *value_length)
{
uint32_t flags;
memcached_return rc;
return memcached_fetch(&memc, key, key_length,
value_length, &flags, &rc);
}
char *get(char *key, size_t *value_length) char *get(char *key, size_t *value_length)
{ {
uint32_t flags; uint32_t flags;
memcached_return rc; memcached_return rc;
return memcached_get(&memc, key, strlen(key), return memcached_get(&memc, key, strlen(key),
value_length, &flags, &rc); value_length, &flags, &rc);
} }
char *get_by_key(char *master_key, char *key, size_t *value_length) char *get_by_key(char *master_key, char *key, size_t *value_length)
skipping to change at line 64 skipping to change at line 72
} }
memcached_return set_by_key(char *master_key, char *key, char *value, siz e_t value_length) memcached_return set_by_key(char *master_key, char *key, char *value, siz e_t value_length)
{ {
return memcached_set_by_key(&memc, master_key, strlen(master_key), return memcached_set_by_key(&memc, master_key, strlen(master_key),
key, strlen(key), key, strlen(key),
value, value_length, value, value_length,
(time_t)0, (time_t)0,
(uint32_t)0 ); (uint32_t)0 );
} }
memcached_return
increment(char *key, unsigned int offset, uint64_t *value)
{
return memcached_increment(&memc, key, strlen(key),
offset, value);
}
memcached_return
decrement(char *key, unsigned int offset, uint64_t *value)
{
return memcached_decrement(&memc, key, strlen(key),
offset, value);
}
memcached_return add(char *key, char *value, size_t value_length) memcached_return add(char *key, char *value, size_t value_length)
{ {
return memcached_add(&memc, key, strlen(key), return memcached_add(&memc, key, strlen(key),
value, value_length, value, value_length,
(time_t)0, (uint32_t)0); (time_t)0, (uint32_t)0);
} }
memcached_return add_by_key(char *master_key, char *key, char *value, siz
e_t value_length)
{
return memcached_add_by_key(&memc, master_key, strlen(master_key),
key, strlen(key),
value, value_length,
(time_t)0, (uint32_t)0);
}
memcached_return replace(char *key, char *value, size_t value_length) memcached_return replace(char *key, char *value, size_t value_length)
{ {
return memcached_replace(&memc, key, strlen(key), return memcached_replace(&memc, key, strlen(key),
value, value_length, value, value_length,
(time_t)0, (uint32_t)0); (time_t)0, (uint32_t)0);
} }
memcached_return replace_by_key(char *master_key,
char *key, char *value, size_t value_leng
th)
{
return memcached_replace_by_key(&memc, master_key, strlen(master_key),
key, strlen(key),
value, value_length,
(time_t)0, (uint32_t)0);
}
memcached_return prepend(char *key, char *value, size_t value_length) memcached_return prepend(char *key, char *value, size_t value_length)
{ {
return memcached_prepend(&memc, key, strlen(key), return memcached_prepend(&memc, key, strlen(key),
value, value_length, value, value_length,
(time_t)0, (time_t)0,
(uint32_t)0); (uint32_t)0);
} }
memcached_return prepend_by_key(char *master_key,
char *key, char *value, size_t value_leng
th)
{
return memcached_prepend_by_key(&memc, master_key, strlen(master_key),
key, strlen(key),
value, value_length,
(time_t)0,
(uint32_t)0);
}
memcached_return append(char *key, char *value, size_t value_length) memcached_return append(char *key, char *value, size_t value_length)
{ {
return memcached_append(&memc, key, strlen(key), return memcached_append(&memc, key, strlen(key),
value, value_length, value, value_length,
(time_t)0, (time_t)0,
(uint32_t)0); (uint32_t)0);
} }
memcached_return append_by_key(char *master_key,
char *key, char *value, size_t value_leng
th)
{
return memcached_append_by_key(&memc,
master_key, strlen(master_key),
key, strlen(key),
value, value_length,
(time_t)0,
(uint32_t)0);
}
memcached_return cas(char *key, char *value, size_t value_length, uint64
_t cas)
{
return memcached_cas(&memc, key, strlen(key),
value, value_length,
(time_t)0,
(uint32_t)0,
cas);
}
memcached_return cas_by_key(char *master_key, char *key, char *value,
size_t value_length, uint64_t cas)
{
return memcached_cas_by_key(&memc,
master_key, strlen(master_key),
key, strlen(key),
value, value_length,
(time_t)0,
(uint32_t)0,
cas);
}
// using 'remove' vs. 'delete' since 'delete' is a keyword
memcached_return remove(char *key)
{
return memcached_delete (&memc, key, strlen(key), (time_t)0);
}
memcached_return delete_by_key(char *master_key, char *key)
{
return memcached_delete_by_key(&memc, master_key, strlen(master_key),
key, strlen(key), (time_t)0);
}
~Memcached() ~Memcached()
{ {
memcached_free(&memc); memcached_free(&memc);
} }
}; };
 End of changes. 8 change blocks. 
0 lines changed or deleted 89 lines changed or added


 memcached_constants.h   memcached_constants.h 
skipping to change at line 21 skipping to change at line 21
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* 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_LENGTH 64 #define MEMCACHED_MAX_HOST_LENGTH 64
#define MEMCACHED_WHEEL_SIZE 1024 #define MEMCACHED_MAX_HOST_SORT_LENGTH 86 /* Used for Ketama */
#define MEMCACHED_POINTS_PER_SERVER 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 INT32_MAX #define MEMCACHED_DEFAULT_TIMEOUT 1000
#define MEMCACHED_CONTINUUM_ADDITION 10 /* How many extra slots we should b
uild for in the continuum */
typedef enum { typedef enum {
MEMCACHED_SUCCESS, MEMCACHED_SUCCESS,
MEMCACHED_FAILURE, MEMCACHED_FAILURE,
MEMCACHED_HOST_LOOKUP_FAILURE, MEMCACHED_HOST_LOOKUP_FAILURE,
MEMCACHED_CONNECTION_FAILURE, MEMCACHED_CONNECTION_FAILURE,
MEMCACHED_CONNECTION_BIND_FAILURE, MEMCACHED_CONNECTION_BIND_FAILURE,
MEMCACHED_WRITE_FAILURE, MEMCACHED_WRITE_FAILURE,
MEMCACHED_READ_FAILURE, MEMCACHED_READ_FAILURE,
MEMCACHED_UNKNOWN_READ_FAILURE, MEMCACHED_UNKNOWN_READ_FAILURE,
skipping to change at line 65 skipping to change at line 68
MEMCACHED_FETCH_NOTFINISHED, MEMCACHED_FETCH_NOTFINISHED,
MEMCACHED_TIMEOUT, MEMCACHED_TIMEOUT,
MEMCACHED_BUFFERED, MEMCACHED_BUFFERED,
MEMCACHED_BAD_KEY_PROVIDED, MEMCACHED_BAD_KEY_PROVIDED,
MEMCACHED_MAXIMUM_RETURN, /* Always add new error code before */ MEMCACHED_MAXIMUM_RETURN, /* Always add new error code before */
} memcached_return; } memcached_return;
typedef enum { typedef enum {
MEMCACHED_DISTRIBUTION_MODULA, MEMCACHED_DISTRIBUTION_MODULA,
MEMCACHED_DISTRIBUTION_CONSISTENT, MEMCACHED_DISTRIBUTION_CONSISTENT,
MEMCACHED_DISTRIBUTION_CONSISTENT_WHEEL,
MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA,
} memcached_server_distribution; } memcached_server_distribution;
typedef enum { typedef enum {
MEMCACHED_BEHAVIOR_NO_BLOCK, MEMCACHED_BEHAVIOR_NO_BLOCK,
MEMCACHED_BEHAVIOR_TCP_NODELAY, MEMCACHED_BEHAVIOR_TCP_NODELAY,
MEMCACHED_BEHAVIOR_HASH, MEMCACHED_BEHAVIOR_HASH,
MEMCACHED_BEHAVIOR_KETAMA, MEMCACHED_BEHAVIOR_KETAMA,
MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE, MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE,
MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE, MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE,
MEMCACHED_BEHAVIOR_CACHE_LOOKUPS, MEMCACHED_BEHAVIOR_CACHE_LOOKUPS,
skipping to change at line 105 skipping to change at line 110
} memcached_callback; } memcached_callback;
typedef enum { typedef enum {
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_KETAMA,
MEMCACHED_HASH_HSIEH, MEMCACHED_HASH_HSIEH,
MEMCACHED_HASH_MURMUR, MEMCACHED_HASH_MURMUR,
} memcached_hash; } memcached_hash;
typedef enum { typedef enum {
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; } memcached_connection;
 End of changes. 4 change blocks. 
3 lines changed or deleted 9 lines changed or added


 memcached_types.h   memcached_types.h 
skipping to change at line 21 skipping to change at line 21
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
typedef struct memcached_st memcached_st; typedef struct memcached_st memcached_st;
typedef struct memcached_stat_st memcached_stat_st; typedef struct memcached_stat_st memcached_stat_st;
typedef struct memcached_result_st memcached_result_st; typedef struct memcached_result_st memcached_result_st;
typedef struct memcached_string_st memcached_string_st; typedef struct memcached_string_st memcached_string_st;
typedef struct memcached_server_st memcached_server_st; typedef struct memcached_server_st memcached_server_st;
typedef struct memcached_continuum_item_st memcached_continuum_item_st;
typedef memcached_return (*memcached_clone_func)(memcached_st *parent, memc ached_st *clone); typedef memcached_return (*memcached_clone_func)(memcached_st *parent, memc ached_st *clone);
typedef memcached_return (*memcached_cleanup_func)(memcached_st *ptr); typedef memcached_return (*memcached_cleanup_func)(memcached_st *ptr);
typedef void (*memcached_free_function)(memcached_st *ptr, void *mem); typedef void (*memcached_free_function)(memcached_st *ptr, void *mem);
typedef void *(*memcached_malloc_function)(memcached_st *ptr, const size_t size); typedef void *(*memcached_malloc_function)(memcached_st *ptr, const size_t size);
typedef void *(*memcached_realloc_function)(memcached_st *ptr, void *mem, c onst size_t size); typedef void *(*memcached_realloc_function)(memcached_st *ptr, void *mem, c onst size_t size);
typedef memcached_return (*memcached_execute_function)(memcached_st *ptr, m emcached_result_st *result, void *context); typedef memcached_return (*memcached_execute_function)(memcached_st *ptr, m emcached_result_st *result, void *context);
typedef memcached_return (*memcached_server_function)(memcached_st *ptr, me mcached_server_st *server, void *context); typedef memcached_return (*memcached_server_function)(memcached_st *ptr, me mcached_server_st *server, void *context);
typedef memcached_return (*memcached_trigger_key)(memcached_st *ptr, typedef memcached_return (*memcached_trigger_key)(memcached_st *ptr,
char *key, size_t key_len gth, char *key, size_t key_len gth,
memcached_result_st *resu lt); memcached_result_st *resu lt);
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 memcached_watchpoint.h   memcached_watchpoint.h 
skipping to change at line 17 skipping to change at line 17
*/ */
#ifndef __MEMCACHED_WATCHPOINT_H__ #ifndef __MEMCACHED_WATCHPOINT_H__
#define __MEMCACHED_WATCHPOINT_H__ #define __MEMCACHED_WATCHPOINT_H__
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* Some personal debugging functions */ /* Some personal debugging functions */
#ifdef MEMCACHED_INTERNAL #if defined(MEMCACHED_INTERNAL) && defined(HAVE_DEBUG)
#ifdef HAVE_DEBUG #include <assert.h>
#define WATCHPOINT fprintf(stderr, "\nWATCHPOINT %s:%d (%s)\n", __FILE__, _ _LINE__,__func__);fflush(stdout); #define WATCHPOINT fprintf(stderr, "\nWATCHPOINT %s:%d (%s)\n", __FILE__, _ _LINE__,__func__);fflush(stdout);
#define WATCHPOINT_ERROR(A) fprintf(stderr, "\nWATCHPOINT %s:%d %s\n", __FI LE__, __LINE__, memcached_strerror(NULL, A));fflush(stdout); #define WATCHPOINT_ERROR(A) fprintf(stderr, "\nWATCHPOINT %s:%d %s\n", __FI LE__, __LINE__, memcached_strerror(NULL, A));fflush(stdout);
#define WATCHPOINT_IFERROR(A) if(A != MEMCACHED_SUCCESS)fprintf(stderr, "\n WATCHPOINT %s:%d %s\n", __FILE__, __LINE__, memcached_strerror(NULL, A));ff lush(stdout); #define WATCHPOINT_IFERROR(A) if(A != MEMCACHED_SUCCESS)fprintf(stderr, "\n WATCHPOINT %s:%d %s\n", __FILE__, __LINE__, memcached_strerror(NULL, A));ff lush(stdout);
#define WATCHPOINT_STRING(A) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s\n" , __FILE__, __LINE__,__func__,A);fflush(stdout); #define WATCHPOINT_STRING(A) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s\n" , __FILE__, __LINE__,__func__,A);fflush(stdout);
#define WATCHPOINT_STRING_LENGTH(A,B) fprintf(stderr, "\nWATCHPOINT %s:%d ( %s) %.*s\n", __FILE__, __LINE__,__func__,(int)B,A);fflush(stdout); #define WATCHPOINT_STRING_LENGTH(A,B) fprintf(stderr, "\nWATCHPOINT %s:%d ( %s) %.*s\n", __FILE__, __LINE__,__func__,(int)B,A);fflush(stdout);
#define WATCHPOINT_NUMBER(A) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %zu\n ", __FILE__, __LINE__,__func__,(size_t)(A));fflush(stdout); #define WATCHPOINT_NUMBER(A) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %zu\n ", __FILE__, __LINE__,__func__,(size_t)(A));fflush(stdout);
#define WATCHPOINT_ERRNO(A) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s\n", __FILE__, __LINE__,__func__, strerror(A));fflush(stdout); #define WATCHPOINT_ERRNO(A) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s\n", __FILE__, __LINE__,__func__, strerror(A));fflush(stdout);
#define WATCHPOINT_ASSERT_PRINT(A,B,C) if(!(A)){fprintf(stderr, "\nWATCHPOI NT ASSERT %s:%d (%s) ", __FILE__, __LINE__,__func__);fprintf(stderr, (B),(C ));fprintf(stderr,"\n");fflush(stdout);}assert((A));
#define WATCHPOINT_ASSERT(A) assert((A)); #define WATCHPOINT_ASSERT(A) assert((A));
#else #else
#define WATCHPOINT #define WATCHPOINT
#define WATCHPOINT_ERROR(A) #define WATCHPOINT_ERROR(A)
#define WATCHPOINT_IFERROR(A) #define WATCHPOINT_IFERROR(A)
#define WATCHPOINT_STRING(A) #define WATCHPOINT_STRING(A)
#define WATCHPOINT_NUMBER(A) #define WATCHPOINT_NUMBER(A)
#define WATCHPOINT_ERRNO(A) #define WATCHPOINT_ERRNO(A)
#define WATCHPOINT_ASSERT_PRINT(A,B,C)
#define WATCHPOINT_ASSERT(A) #define WATCHPOINT_ASSERT(A)
#endif
#endif /* MEMCACHED_INTERNAL */ #endif /* MEMCACHED_INTERNAL && HAVE_DEBUG */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __MEMCACHED_WATCHPOINT_H__ */ #endif /* __MEMCACHED_WATCHPOINT_H__ */
 End of changes. 4 change blocks. 
4 lines changed or deleted 7 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/