just fine).
+0.21
+ * Change of char * to const char * for all key based functions.
+
0.20 Mon May 5 08:34:26 PDT 2008
* New consistent distribution tests.
* Found a memory leak when a server constantly fails.
memcached_return
memcached_increment (memcached_st *ptr,
- char *key, size_t key_length,
+ const char *key, size_t key_length,
unsigned int offset,
uint64_t *value);
memcached_return
memcached_decrement (memcached_st *ptr,
- char *key, size_t key_length,
+ const char *key, size_t key_length,
unsigned int offset,
uint64_t *value);
memcached_return
memcached_delete (memcached_st *ptr,
- char *key, size_t key_length,
+ const char *key, size_t key_length,
time_t expiration);
memcached_return
memcached_delete_by_key (memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char *key, size_t key_length,
+ const char *master_key, size_t master_key_length,
+ const char *key, size_t key_length,
time_t expiration);
=head1 DESCRIPTION
memcached_return *error);
char *memcached_get (memcached_st *ptr,
- char *key, size_t key_length,
+ const char *key, size_t key_length,
size_t *value_length,
uint32_t *flags,
memcached_return *error);
unsigned int number_of_keys);
char *
memcached_get_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char *key, size_t key_length,
+ const char *master_key, size_t master_key_length,
+ const char *key, size_t key_length,
size_t *value_length,
uint32_t *flags,
memcached_return *error);
memcached_return
memcached_mget_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
+ const char *master_key, size_t master_key_length,
char **keys, size_t *key_length,
unsigned int number_of_keys);
char *memcached_fetch (memcached_st *ptr,
- char *key, size_t *key_length,
+ const char *key, size_t *key_length,
size_t *value_length,
uint32_t *flags,
memcached_return *error);
memcached_return
memcached_set (memcached_st *ptr,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags);
memcached_return
memcached_add (memcached_st *ptr,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags);
memcached_return
memcached_replace (memcached_st *ptr,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags);
memcached_return
memcached_prepend(memcached_st *ptr,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags)
memcached_return
memcached_append(memcached_st *ptr,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags)
memcached_return
memcached_cas(memcached_st *ptr,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags,
uint64_t cas);
memcached_return
memcached_set_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *master_key, size_t master_key_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags);
memcached_return
memcached_add_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *master_key, size_t master_key_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags);
memcached_return
memcached_replace_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *master_key, size_t master_key_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags);
memcached_return
memcached_prepend_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *master_key, size_t master_key_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags);
memcached_return
memcached_append_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *master_key, size_t master_key_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags);
memcached_return
memcached_cas_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *master_key, size_t master_key_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags,
uint64_t cas);
memcached.hh \
libmemcached_config.h \
memcached_constants.h \
+ memcached_get.h \
memcached_result.h \
memcached_server.h \
memcached_storage.h \
} memcached_flags;
/* Hashing algo */
-void md5_signature(unsigned char *key, unsigned int length, unsigned char *result);
+void md5_signature(const unsigned char *key, unsigned int length, unsigned char *result);
uint32_t hash_crc32(const char *data,
size_t data_len);
-uint32_t hsieh_hash(char *key, size_t key_length);
-uint32_t murmur_hash(char *key, size_t key_length);
+uint32_t hsieh_hash(const char *key, size_t key_length);
+uint32_t murmur_hash(const char *key, size_t key_length);
memcached_return memcached_connect(memcached_server_st *ptr);
memcached_return memcached_response(memcached_server_st *ptr,
char *buffer, size_t buffer_length,
memcached_result_st *result);
-uint32_t memcached_generate_hash(memcached_st *ptr, char *key, size_t key_length);
+uint32_t memcached_generate_hash(memcached_st *ptr, const char *key, size_t key_length);
void memcached_quit_server(memcached_server_st *ptr, uint8_t io_death);
#define memcached_server_response_increment(A) (A)->cursor_active++
#define memcached_server_response_decrement(A) (A)->cursor_active--
#define memcached_server_response_reset(A) (A)->cursor_active=0
-memcached_return memcached_do(memcached_server_st *ptr, char *commmand,
+memcached_return memcached_do(memcached_server_st *ptr, const char *commmand,
size_t command_length, uint8_t with_flush);
memcached_return memcached_version(memcached_st *ptr);
memcached_return value_fetch(memcached_server_st *ptr,
memcached_return run_distribution(memcached_st *ptr);
-uint32_t generate_hash(memcached_st *ptr, char *key, size_t key_length);
+uint32_t generate_hash(memcached_st *ptr, const char *key, size_t key_length);
#endif /* __COMMON_H__ */
+(uint32_t)(((const uint8_t *)(d))[0]) )
#endif
-uint32_t hsieh_hash(char *key, size_t key_length)
+uint32_t hsieh_hash(const char *key, size_t key_length)
{
uint32_t hash = 0, tmp;
int rem;
static void MD5Init (MD5_CTX *context); /* context */
static void MD5Update ( MD5_CTX *context, /* context */
- unsigned char *input, /* input block */
+ const unsigned char *input, /* input block */
unsigned int inputLen); /* length of input block */
static void MD5Final ( unsigned char digest[16], /* message digest */
MD5_CTX *context); /* context */
Just a simple method for getting the signature
result must be == 16
*/
-void md5_signature(unsigned char *key, unsigned int length, unsigned char *result)
+void md5_signature(const unsigned char *key, unsigned int length, unsigned char *result)
{
MD5_CTX my_md5;
static void MD5Update (
MD5_CTX *context, /* context */
- unsigned char *input, /* input block */
+ const unsigned char *input, /* input block */
unsigned int inputLen) /* length of input block */
{
unsigned int i, idx, partLen;
MD5Transform(context->state, context->buffer);
for (i = partLen; i + 63 < inputLen; i += 64)
- MD5Transform (context->state, &input[i]);
+ MD5Transform (context->state, (unsigned char *)&input[i]);
idx = 0;
}
#include <libmemcached/memcached_constants.h>
#include <libmemcached/memcached_types.h>
#include <libmemcached/memcached_watchpoint.h>
+#include <libmemcached/memcached_get.h>
#include <libmemcached/memcached_server.h>
#include <libmemcached/memcached_string.h>
#include <libmemcached/memcached_result.h>
void memcached_free(memcached_st *ptr);
memcached_st *memcached_clone(memcached_st *clone, memcached_st *ptr);
-memcached_return memcached_delete(memcached_st *ptr, char *key, size_t key_length,
+memcached_return memcached_delete(memcached_st *ptr, const char *key, size_t key_length,
time_t expiration);
memcached_return memcached_increment(memcached_st *ptr,
- char *key, size_t key_length,
+ const char *key, size_t key_length,
uint32_t offset,
uint64_t *value);
memcached_return memcached_decrement(memcached_st *ptr,
- char *key, size_t key_length,
+ const char *key, size_t key_length,
uint32_t offset,
uint64_t *value);
void memcached_stat_free(memcached_st *, memcached_stat_st *);
memcached_return memcached_behavior_set(memcached_st *ptr, memcached_behavior flag, uint64_t data);
uint64_t memcached_behavior_get(memcached_st *ptr, memcached_behavior flag);
-/* Get functions */
-char *memcached_get(memcached_st *ptr, char *key, size_t key_length,
- size_t *value_length,
- uint32_t *flags,
- memcached_return *error);
-memcached_return memcached_mget(memcached_st *ptr,
- char **keys, size_t *key_length,
- unsigned int number_of_keys);
-char *memcached_fetch(memcached_st *ptr, char *key, size_t *key_length,
- size_t *value_length, uint32_t *flags,
- memcached_return *error);
-memcached_result_st *memcached_fetch_result(memcached_st *ptr,
- memcached_result_st *result,
- memcached_return *error);
-
/* Server Public functions */
memcached_return memcached_server_add_udp(memcached_st *ptr,
char ** memcached_stat_get_keys(memcached_st *ptr, memcached_stat_st *stat,
memcached_return *error);
-char *memcached_get_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char *key, size_t key_length,
- size_t *value_length,
- uint32_t *flags,
- memcached_return *error);
-
-memcached_return memcached_mget_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char **keys, size_t *key_length,
- unsigned int number_of_keys);
-
memcached_return memcached_delete_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char *key, size_t key_length,
+ const char *master_key, size_t master_key_length,
+ const char *key, size_t key_length,
time_t expiration);
memcached_return memcached_fetch_execute(memcached_st *ptr,
#include "common.h"
static memcached_return memcached_auto(memcached_st *ptr,
- char *verb,
- char *key, size_t key_length,
+ const char *verb,
+ const char *key, size_t key_length,
unsigned int offset,
uint64_t *value)
{
unlikely (ptr->hosts == NULL || ptr->number_of_hosts == 0)
return MEMCACHED_NO_SERVERS;
- if ((ptr->flags & MEM_VERIFY_KEY) && (memcachd_key_test(&key, &key_length, 1) == MEMCACHED_BAD_KEY_PROVIDED))
+ if ((ptr->flags & MEM_VERIFY_KEY) && (memcachd_key_test((char **)&key, &key_length, 1) == MEMCACHED_BAD_KEY_PROVIDED))
return MEMCACHED_BAD_KEY_PROVIDED;
server_key= memcached_generate_hash(ptr, key, key_length);
}
memcached_return memcached_increment(memcached_st *ptr,
- char *key, size_t key_length,
+ const char *key, size_t key_length,
uint32_t offset,
uint64_t *value)
{
}
memcached_return memcached_decrement(memcached_st *ptr,
- char *key, size_t key_length,
+ const char *key, size_t key_length,
uint32_t offset,
uint64_t *value)
{
#include "common.h"
-memcached_return memcached_delete(memcached_st *ptr, char *key, size_t key_length,
+memcached_return memcached_delete(memcached_st *ptr, const char *key, size_t key_length,
time_t expiration)
{
return memcached_delete_by_key(ptr, key, key_length,
}
memcached_return memcached_delete_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char *key, size_t key_length,
+ const char *master_key, size_t master_key_length,
+ const char *key, size_t key_length,
time_t expiration)
{
char to_write;
#include "common.h"
-memcached_return memcached_do(memcached_server_st *ptr, char *command,
+memcached_return memcached_do(memcached_server_st *ptr, const char *command,
size_t command_length, uint8_t with_flush)
{
memcached_return rc;
/*
What happens if no servers exist?
*/
-char *memcached_get(memcached_st *ptr, char *key, size_t key_length,
+char *memcached_get(memcached_st *ptr, const char *key,
+ size_t key_length,
size_t *value_length,
uint32_t *flags,
memcached_return *error)
}
char *memcached_get_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char *key, size_t key_length,
+ const char *master_key,
+ size_t master_key_length,
+ const char *key, size_t key_length,
size_t *value_length,
uint32_t *flags,
memcached_return *error)
*error= memcached_mget_by_key(ptr,
master_key,
master_key_length,
- &key, &key_length, 1);
+ (char **)&key, &key_length, 1);
value= memcached_fetch(ptr, NULL, NULL,
value_length, flags, error);
}
memcached_return memcached_mget_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char **keys, size_t *key_length,
+ const char *master_key,
+ size_t master_key_length,
+ char **keys,
+ size_t *key_length,
unsigned int number_of_keys)
{
unsigned int x;
--- /dev/null
+/*
+ * Summary: Get functions for libmemcached
+ *
+ * Copy: See Copyright for the status of this software.
+ *
+ * Author: Brian Aker
+ */
+
+#ifndef __MEMCACHED_GET_H__
+#define __MEMCACHED_GET_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Public defines */
+char *memcached_get(memcached_st *ptr,
+ const char *key, size_t key_length,
+ size_t *value_length,
+ uint32_t *flags,
+ memcached_return *error);
+
+memcached_return memcached_mget(memcached_st *ptr,
+ char **keys, size_t *key_length,
+ unsigned int number_of_keys);
+
+char *memcached_get_by_key(memcached_st *ptr,
+ const char *master_key, size_t master_key_length,
+ const char *key, size_t key_length,
+ size_t *value_length,
+ uint32_t *flags,
+ memcached_return *error);
+
+memcached_return memcached_mget_by_key(memcached_st *ptr,
+ const char *master_key, size_t
+ master_key_length,
+ char **keys,
+ size_t *key_length,
+ unsigned int number_of_keys);
+
+char *memcached_fetch(memcached_st *ptr,
+ char *key, size_t *key_length,
+ size_t *value_length, uint32_t *flags,
+ memcached_return *error);
+
+memcached_result_st *memcached_fetch_result(memcached_st *ptr,
+ memcached_result_st *result,
+ memcached_return *error);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MEMCACHED_GET_H__ */
static uint32_t FNV_32_PRIME= 16777619;
/* Prototypes */
-static uint32_t internal_generate_hash(char *key, size_t key_length);
-static uint32_t internal_generate_md5(char *key, size_t key_length);
+static uint32_t internal_generate_hash(const char *key, size_t key_length);
+static uint32_t internal_generate_md5(const char *key, size_t key_length);
-uint32_t generate_hash(memcached_st *ptr, char *key, size_t key_length)
+uint32_t generate_hash(memcached_st *ptr, const char *key, size_t key_length)
{
uint32_t hash= 1; /* Just here to remove compile warning */
uint32_t x= 0;
One day make this public, and have it return the actual memcached_server_st
to the calling application.
*/
-uint32_t memcached_generate_hash(memcached_st *ptr, char *key, size_t key_length)
+uint32_t memcached_generate_hash(memcached_st *ptr, const char *key, size_t key_length)
{
uint32_t hash= 1; /* Just here to remove compile warning */
return dispatch_host(ptr, hash);
}
-static uint32_t internal_generate_hash(char *key, size_t key_length)
+static uint32_t internal_generate_hash(const char *key, size_t key_length)
{
- char *ptr= key;
+ const char *ptr= key;
uint32_t value= 0;
while (--key_length)
return value == 0 ? 1 : value;
}
-static uint32_t internal_generate_md5(char *key, size_t key_length)
+static uint32_t internal_generate_md5(const char *key, size_t key_length)
{
unsigned char results[16];
}
ssize_t memcached_io_write(memcached_server_st *ptr,
- char *buffer, size_t length, char with_flush)
+ const char *buffer, size_t length, char with_flush)
{
size_t original_length;
- char* buffer_ptr;
+ const char* buffer_ptr;
original_length= length;
buffer_ptr= buffer;
#include <memcached.h>
ssize_t memcached_io_write(memcached_server_st *ptr,
- char *buffer, size_t length, char with_flush);
+ const char *buffer, size_t length, char with_flush);
void memcached_io_reset(memcached_server_st *ptr);
ssize_t memcached_io_read(memcached_server_st *ptr,
char *buffer, size_t length);
else if (!memcmp("bytes_written", key, strlen("bytes_written")))
length= snprintf(buffer, SMALL_STRING_LEN,"%llu", (unsigned long long)stat->bytes_written);
else if (!memcmp("limit_maxbytes", key, strlen("limit_maxbytes")))
- length= snprintf(buffer, SMALL_STRING_LEN,"%llu", stat->limit_maxbytes);
+ length= snprintf(buffer, SMALL_STRING_LEN,"%llu", (unsigned long long)stat->limit_maxbytes);
else if (!memcmp("threads", key, strlen("threads")))
length= snprintf(buffer, SMALL_STRING_LEN,"%u", stat->threads);
else
}
static inline memcached_return memcached_send(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *master_key, size_t master_key_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags,
uint64_t cas,
unlikely (ptr->number_of_hosts == 0)
return MEMCACHED_NO_SERVERS;
- if ((ptr->flags & MEM_VERIFY_KEY) && (memcachd_key_test(&key, &key_length, 1) == MEMCACHED_BAD_KEY_PROVIDED))
+ if ((ptr->flags & MEM_VERIFY_KEY) && (memcachd_key_test((char **)&key, &key_length, 1) == MEMCACHED_BAD_KEY_PROVIDED))
return MEMCACHED_BAD_KEY_PROVIDED;
server_key= memcached_generate_hash(ptr, master_key, master_key_length);
return rc;
}
-memcached_return memcached_set(memcached_st *ptr, char *key, size_t key_length,
- char *value, size_t value_length,
+memcached_return memcached_set(memcached_st *ptr, const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags)
{
}
memcached_return memcached_add(memcached_st *ptr,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags)
{
}
memcached_return memcached_replace(memcached_st *ptr,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags)
{
}
memcached_return memcached_prepend(memcached_st *ptr,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags)
{
}
memcached_return memcached_append(memcached_st *ptr,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags)
{
}
memcached_return memcached_cas(memcached_st *ptr,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags,
uint64_t cas)
}
memcached_return memcached_set_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *master_key, size_t master_key_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags)
{
}
memcached_return memcached_add_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *master_key, size_t master_key_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags)
{
}
memcached_return memcached_replace_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *master_key, size_t master_key_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags)
{
}
memcached_return memcached_prepend_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *master_key, size_t master_key_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags)
{
}
memcached_return memcached_append_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *master_key, size_t master_key_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags)
{
}
memcached_return memcached_cas_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *master_key, size_t master_key_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags,
uint64_t cas)
#endif
/* All of the functions for adding data to the server */
-memcached_return memcached_set(memcached_st *ptr, char *key, size_t key_length,
- char *value, size_t value_length,
+memcached_return memcached_set(memcached_st *ptr, const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags);
-memcached_return memcached_add(memcached_st *ptr, char *key, size_t key_length,
- char *value, size_t value_length,
+memcached_return memcached_add(memcached_st *ptr, const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags);
-memcached_return memcached_replace(memcached_st *ptr, char *key, size_t key_length,
- char *value, size_t value_length,
+memcached_return memcached_replace(memcached_st *ptr, const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags);
memcached_return memcached_append(memcached_st *ptr,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags);
memcached_return memcached_prepend(memcached_st *ptr,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags);
memcached_return memcached_cas(memcached_st *ptr,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags,
uint64_t cas);
memcached_return memcached_set_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *master_key, size_t master_key_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags);
memcached_return memcached_add_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *master_key, size_t master_key_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags);
memcached_return memcached_replace_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *master_key, size_t master_key_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags);
memcached_return memcached_prepend_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *master_key, size_t master_key_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags);
memcached_return memcached_append_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *master_key, size_t master_key_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags);
memcached_return memcached_cas_by_key(memcached_st *ptr,
- char *master_key, size_t master_key_length,
- char *key, size_t key_length,
- char *value, size_t value_length,
+ const char *master_key, size_t master_key_length,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
time_t expiration,
uint32_t flags,
uint64_t cas);
typedef memcached_return (*memcached_execute_function)(memcached_st *ptr, memcached_result_st *result, void *context);
typedef memcached_return (*memcached_server_function)(memcached_st *ptr, memcached_server_st *server, void *context);
typedef memcached_return (*memcached_trigger_key)(memcached_st *ptr,
- char *key, size_t key_length,
+ const char *key, size_t key_length,
memcached_result_st *result);
typedef memcached_return (*memcached_trigger_delete_key)(memcached_st *ptr,
- char *key, size_t key_length);
+ const char *key, size_t key_length);
#ifdef __cplusplus
}
\r
#define MIX(h,k,m) { k *= m; k ^= k >> r; k *= m; h *= m; h ^= k; }\r
\r
-uint32_t murmur_hash(char *key, size_t length)\r
+uint32_t murmur_hash(const char *key, size_t length)\r
{\r
const uint32_t m= 0x5bd1e995;\r
const int r= 16;\r