memcached_create.3\\r
memcached_decrement.3\\r
memcached_delete.3\\r
+ memcached_delete_by_key.3\\r
memcached_fetch.3\\r
memcached_fetch_result.3\\r
memcached_free.3\\r
memcached_delete.3: memcached_delete.pod\r
pod2man -c "libmemcached" -r "" -s 3 memcached_delete.pod > memcached_delete.3\r
\r
+memcached_delete_by_key.3: memcached_delete.pod\r
+ pod2man -c "libmemcached" -r "" -s 3 memcached_delete.pod > memcached_delete_by_key.3\r
+\r
memcached_increment.3:\r
pod2man -c "libmemcached" -r "" -s 3 memcached_auto.pod > memcached_increment.3\r
\r
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,
+ time_t expiration);
+
=head1 DESCRIPTION
memcached_delete() is used to delete a particular key. An expiration value
can be applied so that the key is deleted after that many seconds.
+memcached_delete_by_key() works the same, but it takes a master key to
+find the given value.
=head1 RETURN
#define MEMCACHED_MAX_HOST_LENGTH 64
#define MEMCACHED_WHEEL_SIZE 1024
#define MEMCACHED_STRIDE 4
-#define MEMCACHED_DEFAULT_TIMEOUT 800
+#define MEMCACHED_DEFAULT_TIMEOUT 2000
typedef enum {
MEMCACHED_SUCCESS,
time_t expiration,
uint16_t flags,
uint64_t cas);
+memcached_return memcached_delete_by_key(memcached_st *ptr,
+ char *master_key, size_t master_key_length,
+ char *key, size_t key_length,
+ time_t expiration);
/* Result Struct */
void memcached_result_free(memcached_result_st *result);
memcached_return memcached_delete(memcached_st *ptr, char *key, size_t key_length,
time_t expiration)
+{
+ return memcached_delete_by_key(ptr, key, key_length,
+ key, key_length, expiration);
+}
+
+memcached_return memcached_delete_by_key(memcached_st *ptr,
+ char *master_key, size_t master_key_length,
+ char *key, size_t key_length,
+ time_t expiration)
{
char to_write;
size_t send_length;
if (ptr->hosts == NULL || ptr->number_of_hosts == 0)
return MEMCACHED_NO_SERVERS;
- server_key= memcached_generate_hash(ptr, key, key_length);
+ server_key= memcached_generate_hash(ptr, master_key, master_key_length);
if (expiration)
send_length= snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE,
%{_mandir}/man3/memcached_create.3.gz
%{_mandir}/man3/memcached_decrement.3.gz
%{_mandir}/man3/memcached_delete.3.gz
+%{_mandir}/man3/memcached_delete_by_key.3.gz
%{_mandir}/man3/memcached_fetch.3.gz
%{_mandir}/man3/memcached_fetch_result.3.gz
%{_mandir}/man3/memcached_free.3.gz