memcached.h | memcached.h | |||
---|---|---|---|---|
skipping to change at line 69 | skipping to change at line 69 | |||
MEMCACHED_NOTSTORED, | MEMCACHED_NOTSTORED, | |||
MEMCACHED_STORED, | MEMCACHED_STORED, | |||
MEMCACHED_NOTFOUND, | MEMCACHED_NOTFOUND, | |||
MEMCACHED_MEMORY_ALLOCATION_FAILURE, | MEMCACHED_MEMORY_ALLOCATION_FAILURE, | |||
MEMCACHED_PARTIAL_READ, | MEMCACHED_PARTIAL_READ, | |||
MEMCACHED_SOME_ERRORS, | MEMCACHED_SOME_ERRORS, | |||
MEMCACHED_NO_SERVERS, | MEMCACHED_NO_SERVERS, | |||
MEMCACHED_END, | MEMCACHED_END, | |||
MEMCACHED_DELETED, | MEMCACHED_DELETED, | |||
MEMCACHED_VALUE, | MEMCACHED_VALUE, | |||
MEMCACHED_STAT, | ||||
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_BEHAVIOR_NO_BLOCK, | MEMCACHED_BEHAVIOR_NO_BLOCK, | |||
MEMCACHED_BEHAVIOR_BLOCK, | MEMCACHED_BEHAVIOR_TCP_NODELAY, | |||
MEMCACHED_BEHAVIOR_MD5_HASHING, | ||||
MEMCACHED_BEHAVIOR_KETAMA, | ||||
} memcached_behavior; | } memcached_behavior; | |||
typedef enum { | typedef enum { | |||
MEMCACHED_NOT_ALLOCATED= 0, | MEMCACHED_NOT_ALLOCATED= 0, | |||
MEMCACHED_ALLOCATED= 1, | MEMCACHED_ALLOCATED= 1, | |||
} memcached_allocated; | } memcached_allocated; | |||
struct memcached_server_st { | struct memcached_server_st { | |||
char *hostname; | char *hostname; | |||
unsigned int port; | unsigned int port; | |||
skipping to change at line 117 | skipping to change at line 120 | |||
unsigned long long cmd_get; | unsigned long long cmd_get; | |||
unsigned long long cmd_set; | unsigned long long cmd_set; | |||
unsigned long long get_hits; | unsigned long long get_hits; | |||
unsigned long long get_misses; | unsigned long long get_misses; | |||
unsigned long long evictions; | unsigned long long evictions; | |||
unsigned long long bytes_read; | unsigned long long bytes_read; | |||
unsigned long long bytes_written; | unsigned long long bytes_written; | |||
unsigned int limit_maxbytes; | unsigned int limit_maxbytes; | |||
}; | }; | |||
#define MEM_NO_BLOCK (1 << 0) | ||||
struct memcached_string_st { | struct memcached_string_st { | |||
char *string; | char *string; | |||
char *end; | char *end; | |||
size_t current_size; | size_t current_size; | |||
size_t block_size; | size_t block_size; | |||
}; | }; | |||
struct memcached_st { | struct memcached_st { | |||
memcached_allocated is_allocated; | memcached_allocated is_allocated; | |||
memcached_server_st *hosts; | memcached_server_st *hosts; | |||
skipping to change at line 165 | skipping to change at line 166 | |||
unsigned int offset, | unsigned int offset, | |||
unsigned int *value); | unsigned int *value); | |||
memcached_stat_st *memcached_stat(memcached_st *ptr, char *args, memcached_ return *error); | memcached_stat_st *memcached_stat(memcached_st *ptr, char *args, memcached_ return *error); | |||
memcached_return memcached_stat_servername(memcached_stat_st *stat, char *a rgs, | memcached_return memcached_stat_servername(memcached_stat_st *stat, char *a rgs, | |||
char *hostname, unsigned int por t); | char *hostname, unsigned int por t); | |||
memcached_return memcached_flush(memcached_st *ptr, time_t expiration); | memcached_return memcached_flush(memcached_st *ptr, time_t expiration); | |||
memcached_return memcached_verbosity(memcached_st *ptr, unsigned int verbos ity); | memcached_return memcached_verbosity(memcached_st *ptr, unsigned int verbos ity); | |||
void memcached_quit(memcached_st *ptr); | void memcached_quit(memcached_st *ptr); | |||
char *memcached_strerror(memcached_st *ptr, memcached_return rc); | char *memcached_strerror(memcached_st *ptr, memcached_return rc); | |||
memcached_return memcached_behavior_set(memcached_st *ptr, memcached_behavi or flag, void *data); | memcached_return memcached_behavior_set(memcached_st *ptr, memcached_behavi or flag, void *data); | |||
unsigned long long memcached_behavior_get(memcached_st *ptr, memcached_beha vior flag); | ||||
/* All of the functions for adding data to the server */ | /* All of the functions for adding data to the server */ | |||
memcached_return memcached_set(memcached_st *ptr, char *key, size_t key_len gth, | memcached_return memcached_set(memcached_st *ptr, char *key, size_t key_len gth, | |||
char *value, size_t value_length, | char *value, size_t value_length, | |||
time_t expiration, | time_t expiration, | |||
uint16_t flags); | uint16_t flags); | |||
memcached_return memcached_add(memcached_st *ptr, char *key, size_t key_len gth, | memcached_return memcached_add(memcached_st *ptr, char *key, size_t key_len gth, | |||
char *value, size_t value_length, | char *value, size_t value_length, | |||
time_t expiration, | time_t expiration, | |||
uint16_t flags); | uint16_t flags); | |||
skipping to change at line 207 | skipping to change at line 209 | |||
memcached_return memcached_server_add(memcached_st *ptr, char *hostname, | memcached_return memcached_server_add(memcached_st *ptr, char *hostname, | |||
unsigned int port); | unsigned int port); | |||
memcached_server_st *memcached_server_list_append(memcached_server_st *ptr, | memcached_server_st *memcached_server_list_append(memcached_server_st *ptr, | |||
char *hostname, unsigned int p ort, | char *hostname, unsigned int p ort, | |||
memcached_return *error); | memcached_return *error); | |||
void memcached_server_list_free(memcached_server_st *ptr); | void memcached_server_list_free(memcached_server_st *ptr); | |||
memcached_return memcached_server_push(memcached_st *ptr, memcached_server_ st *list); | memcached_return memcached_server_push(memcached_st *ptr, memcached_server_ st *list); | |||
unsigned int memcached_server_list_count(memcached_server_st *ptr); | unsigned int memcached_server_list_count(memcached_server_st *ptr); | |||
memcached_server_st *memcached_servers_parse(char *server_strings); | ||||
/* These are all private, do not use. */ | ||||
memcached_return memcached_connect(memcached_st *ptr); | ||||
memcached_return memcached_response(memcached_st *ptr, | ||||
char *buffer, size_t buffer_length, | ||||
unsigned int server_key); | ||||
unsigned int memcached_generate_hash(char *key, size_t key_length); | ||||
char *memcached_stat_get_value(memcached_st *ptr, memcached_stat_st *stat, | ||||
char *key, memcached_return *error); | ||||
char ** memcached_stat_get_keys(memcached_st *ptr, memcached_stat_st *stat, | ||||
memcached_return *error); | ||||
/* String Struct */ | /* String Struct */ | |||
#define memcached_string_length(A, B) (size_t)(B->end - B->string) | #define memcached_string_length(A, B) (size_t)(B->end - B->string) | |||
#define memcached_string_size(A, B) B->current_size | #define memcached_string_size(A, B) B->current_size | |||
#define memcached_string_value(A, B) B->string | #define memcached_string_value(A, B) B->string | |||
memcached_string_st *memcached_string_create(memcached_st *ptr, size_t init ial_size); | memcached_string_st *memcached_string_create(memcached_st *ptr, size_t init ial_size); | |||
memcached_return memcached_string_append_character(memcached_st *ptr, | memcached_return memcached_string_append_character(memcached_st *ptr, | |||
memcached_string_st *str ing, | memcached_string_st *str ing, | |||
char character); | char character); | |||
memcached_return memcached_string_append(memcached_st *ptr, memcached_strin g_st *string, | memcached_return memcached_string_append(memcached_st *ptr, memcached_strin g_st *string, | |||
char *value, size_t length); | char *value, size_t length); | |||
size_t memcached_string_backspace(memcached_st *ptr, memcached_string_st *s tring, size_t remove); | size_t memcached_string_backspace(memcached_st *ptr, memcached_string_st *s tring, size_t remove); | |||
memcached_return memcached_string_reset(memcached_st *ptr, memcached_string _st *string); | memcached_return memcached_string_reset(memcached_st *ptr, memcached_string _st *string); | |||
void memcached_string_free(memcached_st *ptr, memcached_string_st *string); | void memcached_string_free(memcached_st *ptr, memcached_string_st *string); | |||
char *memcached_stat_get_value(memcached_st *ptr, memcached_stat_st *stat, | ||||
char *key, memcached_return *error); | ||||
char ** memcached_stat_get_keys(memcached_st *ptr, memcached_stat_st *stat, | ||||
memcached_return *error); | ||||
/* Some personal debugging functions */ | /* Some personal debugging functions */ | |||
#define WATCHPOINT printf("\nWATCHPOINT %s:%d (%s)\n", __FILE__, __LINE__,_ _func__);fflush(stdout); | #define WATCHPOINT printf("\nWATCHPOINT %s:%d (%s)\n", __FILE__, __LINE__,_ _func__);fflush(stdout); | |||
#define WATCHPOINT_ERROR(A) printf("\nWATCHPOINT %s:%d %s\n", __FILE__, __L INE__, memcached_strerror(NULL, A));fflush(stdout); | #define WATCHPOINT_ERROR(A) printf("\nWATCHPOINT %s:%d %s\n", __FILE__, __L INE__, memcached_strerror(NULL, A));fflush(stdout); | |||
#define WATCHPOINT_STRING(A) printf("\nWATCHPOINT %s:%d %s\n", __FILE__, __ LINE__, A);fflush(stdout); | #define WATCHPOINT_STRING(A) printf("\nWATCHPOINT %s:%d %s\n", __FILE__, __ LINE__, A);fflush(stdout); | |||
#define WATCHPOINT_NUMBER(A) printf("\nWATCHPOINT %s:%d %d\n", __FILE__, __ LINE__, A);fflush(stdout); | #define WATCHPOINT_NUMBER(A) printf("\nWATCHPOINT %s:%d %d\n", __FILE__, __ LINE__, A);fflush(stdout); | |||
#define WATCHPOINT_ERRNO(A) printf("\nWATCHPOINT %s:%d %s\n", __FILE__, __L INE__, strerror(A));A= 0;fflush(stdout); | #define WATCHPOINT_ERRNO(A) printf("\nWATCHPOINT %s:%d %s\n", __FILE__, __L INE__, strerror(A));A= 0;fflush(stdout); | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
} | } | |||
#endif | #endif | |||
End of changes. 6 change blocks. | ||||
14 lines changed or deleted | 11 lines changed or added | |||