-INCLUDES = include\r
-SUBDIRS = docs include lib src tests support\r
-\r
-test: all\r
- cd tests; make test; cd ..\r
-\r
-test-extended: all\r
- cd tests; make test-extended; cd ..\r
-\r
-valgrind:\r
- cd tests; make valgrind; cd ..\r
-\r
-valgrind-extended:\r
- cd tests; make valgrind-extended; cd ..\r
-\r
-\r
-rpm: all dist\r
- cp libmemcached-$(VERSION).tar.gz /home/brian/rpmbuild/SOURCES/\r
- rpmbuild -ba support/libmemcached.spec\r
- cp /home/brian/rpmbuild/RPMS/x86_64/libmemcached-$(VERSION)*.rpm .\r
- cp /home/brian/rpmbuild/SRPMS/libmemcached-$(VERSION)*.rpm .\r
+INCLUDES = include
+SUBDIRS = docs include lib src tests support
+
+test: all
+ cd tests; make test; cd ..
+
+test-extended: all
+ cd tests; make test-extended; cd ..
+
+valgrind:
+ cd tests; make valgrind; cd ..
+
+valgrind-extended:
+ cd tests; make valgrind-extended; cd ..
+
+
+rpm: all dist
+ cp libmemcached-$(VERSION).tar.gz /home/brian/rpmbuild/SOURCES/
+ rpmbuild -ba support/libmemcached.spec
+ cp /home/brian/rpmbuild/RPMS/x86_64/libmemcached-$(VERSION)*.rpm .
+ cp /home/brian/rpmbuild/SRPMS/libmemcached-$(VERSION)*.rpm .
AC_INIT(src/memcat.c)
AC_CONFIG_AUX_DIR(config)
-AM_CONFIG_HEADER(config.h)
+AM_CONFIG_HEADER(libmemcached_config.h)
AM_INIT_AUTOMAKE("libmemcached", 0.2 )
AC_PROG_CC
LIBTOOL="$LIBTOOL --preserve-dup-deps"
AC_SUBST(LIBTOOL)dnl
+sinclude(config/dtrace.m4)
+
# We only support GCC and Sun's forte at the moment
if test "$GCC" = "yes"
then
-INCLUDES = -I$(top_builddir)/include
+EXTRA_DIST = libmemcached_probes.d
+
+INCLUDES = -I$(top_builddir)/include -I$(top_builddir)
LIBS =
+DTRACE = @DTRACE@
+DTRACEFLAGS = @DTRACEFLAGS@
+DTRACEFILES = memcached.o \
+ memcached_strerror.o \
+ memcached_connect.o \
+ memcached_response.o \
+ memcached_get.o \
+ memcached_storage.o \
+ memcached_delete.o \
+ memcached_hash.o \
+ memcached_auto.o \
+ memcached_verbosity.o \
+ memcached_quit.o \
+ memcached_flush.o \
+ memcached_string.o \
+ memcached_stats.o
+
+noinst_HEADERS = libmemcached_probes.h \
+ common.h
+
lib_LTLIBRARIES = libmemcached.la
libmemcached_la_SOURCES = memcached.c \
memcached_strerror.c \
memcached_flush.c \
memcached_string.c \
memcached_stats.c
+libmemcached_la_LIBADD =
+
+if HAVE_DTRACE
+ libmemcached_la_LIBADD += libmemcached_probes.o
+endif
+
+libmemcached_probes.h: libmemcached_probes.d
+ $(DTRACE) $(DTRACEFLAGS) -h -s libmemcached_probes.d
+ mv libmemcached_probes.h libmemcached_probes.h.bak
+ sed "s/#include <unistd.h>//g" libmemcached_probes.h.bak > libmemcached_probes.h
+ rm libmemcached_probes.h.bak
+
+libmemcached_probes.o:
+ $(DTRACE) $(DTRACEFLAGS) -G -s libmemcached_probes.d $(DTRACEFILES)
--- /dev/null
+provider libmemcached {
+ probe memcached_delete_start();
+ probe memcached_delete_end();
+ probe memcached_increment_start();
+ probe memcached_increment_end();
+ probe memcached_decrement_start();
+ probe memcached_decrement_end();
+ probe memcached_flush_start();
+ probe memcached_flush_end();
+ probe memcached_set_start();
+ probe memcached_set_end();
+ probe memcached_add_start();
+ probe memcached_add_end();
+ probe memcached_replace_start();
+ probe memcached_replace_end();
+ probe memcached_get_start();
+ probe memcached_get_end();
+ probe memcached_mget_start();
+ probe memcached_mget_end();
+ probe memcached_connect_start();
+ probe memcached_connect_end();
+ probe memcached_server_add_start();
+ probe memcached_server_add_end();
+};
--- /dev/null
+/*
+ * Generated by dtrace(1M).
+ */
+
+#ifndef _LIBMEMCACHED_PROBES_H
+#define _LIBMEMCACHED_PROBES_H
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if _DTRACE_VERSION
+
+#warning "Trying to BUILD WITH DTRACE!!!!"
+
+#define LIBMEMCACHED_MEMCACHED_ADD_END() \
+ __dtrace_libmemcached___memcached_add_end()
+#define LIBMEMCACHED_MEMCACHED_ADD_END_ENABLED() \
+ __dtraceenabled_libmemcached___memcached_add_end()
+#define LIBMEMCACHED_MEMCACHED_ADD_START() \
+ __dtrace_libmemcached___memcached_add_start()
+#define LIBMEMCACHED_MEMCACHED_ADD_START_ENABLED() \
+ __dtraceenabled_libmemcached___memcached_add_start()
+#define LIBMEMCACHED_MEMCACHED_CONNECT_END() \
+ __dtrace_libmemcached___memcached_connect_end()
+#define LIBMEMCACHED_MEMCACHED_CONNECT_END_ENABLED() \
+ __dtraceenabled_libmemcached___memcached_connect_end()
+#define LIBMEMCACHED_MEMCACHED_CONNECT_START() \
+ __dtrace_libmemcached___memcached_connect_start()
+#define LIBMEMCACHED_MEMCACHED_CONNECT_START_ENABLED() \
+ __dtraceenabled_libmemcached___memcached_connect_start()
+#define LIBMEMCACHED_MEMCACHED_DECREMENT_END() \
+ __dtrace_libmemcached___memcached_decrement_end()
+#define LIBMEMCACHED_MEMCACHED_DECREMENT_END_ENABLED() \
+ __dtraceenabled_libmemcached___memcached_decrement_end()
+#define LIBMEMCACHED_MEMCACHED_DECREMENT_START() \
+ __dtrace_libmemcached___memcached_decrement_start()
+#define LIBMEMCACHED_MEMCACHED_DECREMENT_START_ENABLED() \
+ __dtraceenabled_libmemcached___memcached_decrement_start()
+#define LIBMEMCACHED_MEMCACHED_DELETE_END() \
+ __dtrace_libmemcached___memcached_delete_end()
+#define LIBMEMCACHED_MEMCACHED_DELETE_END_ENABLED() \
+ __dtraceenabled_libmemcached___memcached_delete_end()
+#define LIBMEMCACHED_MEMCACHED_DELETE_START() \
+ __dtrace_libmemcached___memcached_delete_start()
+#define LIBMEMCACHED_MEMCACHED_DELETE_START_ENABLED() \
+ __dtraceenabled_libmemcached___memcached_delete_start()
+#define LIBMEMCACHED_MEMCACHED_FLUSH_END() \
+ __dtrace_libmemcached___memcached_flush_end()
+#define LIBMEMCACHED_MEMCACHED_FLUSH_END_ENABLED() \
+ __dtraceenabled_libmemcached___memcached_flush_end()
+#define LIBMEMCACHED_MEMCACHED_FLUSH_START() \
+ __dtrace_libmemcached___memcached_flush_start()
+#define LIBMEMCACHED_MEMCACHED_FLUSH_START_ENABLED() \
+ __dtraceenabled_libmemcached___memcached_flush_start()
+#define LIBMEMCACHED_MEMCACHED_GET_END() \
+ __dtrace_libmemcached___memcached_get_end()
+#define LIBMEMCACHED_MEMCACHED_GET_END_ENABLED() \
+ __dtraceenabled_libmemcached___memcached_get_end()
+#define LIBMEMCACHED_MEMCACHED_GET_START() \
+ __dtrace_libmemcached___memcached_get_start()
+#define LIBMEMCACHED_MEMCACHED_GET_START_ENABLED() \
+ __dtraceenabled_libmemcached___memcached_get_start()
+#define LIBMEMCACHED_MEMCACHED_INCREMENT_END() \
+ __dtrace_libmemcached___memcached_increment_end()
+#define LIBMEMCACHED_MEMCACHED_INCREMENT_END_ENABLED() \
+ __dtraceenabled_libmemcached___memcached_increment_end()
+#define LIBMEMCACHED_MEMCACHED_INCREMENT_START() \
+ __dtrace_libmemcached___memcached_increment_start()
+#define LIBMEMCACHED_MEMCACHED_INCREMENT_START_ENABLED() \
+ __dtraceenabled_libmemcached___memcached_increment_start()
+#define LIBMEMCACHED_MEMCACHED_MGET_END() \
+ __dtrace_libmemcached___memcached_mget_end()
+#define LIBMEMCACHED_MEMCACHED_MGET_END_ENABLED() \
+ __dtraceenabled_libmemcached___memcached_mget_end()
+#define LIBMEMCACHED_MEMCACHED_MGET_START() \
+ __dtrace_libmemcached___memcached_mget_start()
+#define LIBMEMCACHED_MEMCACHED_MGET_START_ENABLED() \
+ __dtraceenabled_libmemcached___memcached_mget_start()
+#define LIBMEMCACHED_MEMCACHED_REPLACE_END() \
+ __dtrace_libmemcached___memcached_replace_end()
+#define LIBMEMCACHED_MEMCACHED_REPLACE_END_ENABLED() \
+ __dtraceenabled_libmemcached___memcached_replace_end()
+#define LIBMEMCACHED_MEMCACHED_REPLACE_START() \
+ __dtrace_libmemcached___memcached_replace_start()
+#define LIBMEMCACHED_MEMCACHED_REPLACE_START_ENABLED() \
+ __dtraceenabled_libmemcached___memcached_replace_start()
+#define LIBMEMCACHED_MEMCACHED_SERVER_ADD_END() \
+ __dtrace_libmemcached___memcached_server_add_end()
+#define LIBMEMCACHED_MEMCACHED_SERVER_ADD_END_ENABLED() \
+ __dtraceenabled_libmemcached___memcached_server_add_end()
+#define LIBMEMCACHED_MEMCACHED_SERVER_ADD_START() \
+ __dtrace_libmemcached___memcached_server_add_start()
+#define LIBMEMCACHED_MEMCACHED_SERVER_ADD_START_ENABLED() \
+ __dtraceenabled_libmemcached___memcached_server_add_start()
+#define LIBMEMCACHED_MEMCACHED_SET_END() \
+ __dtrace_libmemcached___memcached_set_end()
+#define LIBMEMCACHED_MEMCACHED_SET_END_ENABLED() \
+ __dtraceenabled_libmemcached___memcached_set_end()
+#define LIBMEMCACHED_MEMCACHED_SET_START() \
+ __dtrace_libmemcached___memcached_set_start()
+#define LIBMEMCACHED_MEMCACHED_SET_START_ENABLED() \
+ __dtraceenabled_libmemcached___memcached_set_start()
+
+
+extern void __dtrace_libmemcached___memcached_add_end(void);
+extern int __dtraceenabled_libmemcached___memcached_add_end(void);
+extern void __dtrace_libmemcached___memcached_add_start(void);
+extern int __dtraceenabled_libmemcached___memcached_add_start(void);
+extern void __dtrace_libmemcached___memcached_connect_end(void);
+extern int __dtraceenabled_libmemcached___memcached_connect_end(void);
+extern void __dtrace_libmemcached___memcached_connect_start(void);
+extern int __dtraceenabled_libmemcached___memcached_connect_start(void);
+extern void __dtrace_libmemcached___memcached_decrement_end(void);
+extern int __dtraceenabled_libmemcached___memcached_decrement_end(void);
+extern void __dtrace_libmemcached___memcached_decrement_start(void);
+extern int __dtraceenabled_libmemcached___memcached_decrement_start(void);
+extern void __dtrace_libmemcached___memcached_delete_end(void);
+extern int __dtraceenabled_libmemcached___memcached_delete_end(void);
+extern void __dtrace_libmemcached___memcached_delete_start(void);
+extern int __dtraceenabled_libmemcached___memcached_delete_start(void);
+extern void __dtrace_libmemcached___memcached_flush_end(void);
+extern int __dtraceenabled_libmemcached___memcached_flush_end(void);
+extern void __dtrace_libmemcached___memcached_flush_start(void);
+extern int __dtraceenabled_libmemcached___memcached_flush_start(void);
+extern void __dtrace_libmemcached___memcached_get_end(void);
+extern int __dtraceenabled_libmemcached___memcached_get_end(void);
+extern void __dtrace_libmemcached___memcached_get_start(void);
+extern int __dtraceenabled_libmemcached___memcached_get_start(void);
+extern void __dtrace_libmemcached___memcached_increment_end(void);
+extern int __dtraceenabled_libmemcached___memcached_increment_end(void);
+extern void __dtrace_libmemcached___memcached_increment_start(void);
+extern int __dtraceenabled_libmemcached___memcached_increment_start(void);
+extern void __dtrace_libmemcached___memcached_mget_end(void);
+extern int __dtraceenabled_libmemcached___memcached_mget_end(void);
+extern void __dtrace_libmemcached___memcached_mget_start(void);
+extern int __dtraceenabled_libmemcached___memcached_mget_start(void);
+extern void __dtrace_libmemcached___memcached_replace_end(void);
+extern int __dtraceenabled_libmemcached___memcached_replace_end(void);
+extern void __dtrace_libmemcached___memcached_replace_start(void);
+extern int __dtraceenabled_libmemcached___memcached_replace_start(void);
+extern void __dtrace_libmemcached___memcached_server_add_end(void);
+extern int __dtraceenabled_libmemcached___memcached_server_add_end(void);
+extern void __dtrace_libmemcached___memcached_server_add_start(void);
+extern int __dtraceenabled_libmemcached___memcached_server_add_start(void);
+extern void __dtrace_libmemcached___memcached_set_end(void);
+extern int __dtraceenabled_libmemcached___memcached_set_end(void);
+extern void __dtrace_libmemcached___memcached_set_start(void);
+extern int __dtraceenabled_libmemcached___memcached_set_start(void);
+
+#else
+
+#define LIBMEMCACHED_MEMCACHED_ADD_END()
+#define LIBMEMCACHED_MEMCACHED_ADD_END_ENABLED() (0)
+#define LIBMEMCACHED_MEMCACHED_ADD_START()
+#define LIBMEMCACHED_MEMCACHED_ADD_START_ENABLED() (0)
+#define LIBMEMCACHED_MEMCACHED_CONNECT_END()
+#define LIBMEMCACHED_MEMCACHED_CONNECT_END_ENABLED() (0)
+#define LIBMEMCACHED_MEMCACHED_CONNECT_START()
+#define LIBMEMCACHED_MEMCACHED_CONNECT_START_ENABLED() (0)
+#define LIBMEMCACHED_MEMCACHED_DECREMENT_END()
+#define LIBMEMCACHED_MEMCACHED_DECREMENT_END_ENABLED() (0)
+#define LIBMEMCACHED_MEMCACHED_DECREMENT_START()
+#define LIBMEMCACHED_MEMCACHED_DECREMENT_START_ENABLED() (0)
+#define LIBMEMCACHED_MEMCACHED_DELETE_END()
+#define LIBMEMCACHED_MEMCACHED_DELETE_END_ENABLED() (0)
+#define LIBMEMCACHED_MEMCACHED_DELETE_START()
+#define LIBMEMCACHED_MEMCACHED_DELETE_START_ENABLED() (0)
+#define LIBMEMCACHED_MEMCACHED_FLUSH_END()
+#define LIBMEMCACHED_MEMCACHED_FLUSH_END_ENABLED() (0)
+#define LIBMEMCACHED_MEMCACHED_FLUSH_START()
+#define LIBMEMCACHED_MEMCACHED_FLUSH_START_ENABLED() (0)
+#define LIBMEMCACHED_MEMCACHED_GET_END()
+#define LIBMEMCACHED_MEMCACHED_GET_END_ENABLED() (0)
+#define LIBMEMCACHED_MEMCACHED_GET_START()
+#define LIBMEMCACHED_MEMCACHED_GET_START_ENABLED() (0)
+#define LIBMEMCACHED_MEMCACHED_INCREMENT_END()
+#define LIBMEMCACHED_MEMCACHED_INCREMENT_END_ENABLED() (0)
+#define LIBMEMCACHED_MEMCACHED_INCREMENT_START()
+#define LIBMEMCACHED_MEMCACHED_INCREMENT_START_ENABLED() (0)
+#define LIBMEMCACHED_MEMCACHED_MGET_END()
+#define LIBMEMCACHED_MEMCACHED_MGET_END_ENABLED() (0)
+#define LIBMEMCACHED_MEMCACHED_MGET_START()
+#define LIBMEMCACHED_MEMCACHED_MGET_START_ENABLED() (0)
+#define LIBMEMCACHED_MEMCACHED_REPLACE_END()
+#define LIBMEMCACHED_MEMCACHED_REPLACE_END_ENABLED() (0)
+#define LIBMEMCACHED_MEMCACHED_REPLACE_START()
+#define LIBMEMCACHED_MEMCACHED_REPLACE_START_ENABLED() (0)
+#define LIBMEMCACHED_MEMCACHED_SERVER_ADD_END()
+#define LIBMEMCACHED_MEMCACHED_SERVER_ADD_END_ENABLED() (0)
+#define LIBMEMCACHED_MEMCACHED_SERVER_ADD_START()
+#define LIBMEMCACHED_MEMCACHED_SERVER_ADD_START_ENABLED() (0)
+#define LIBMEMCACHED_MEMCACHED_SET_END()
+#define LIBMEMCACHED_MEMCACHED_SET_END_ENABLED() (0)
+#define LIBMEMCACHED_MEMCACHED_SET_START()
+#define LIBMEMCACHED_MEMCACHED_SET_START_ENABLED() (0)
+
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _LIBMEMCACHED_PROBES_H */
/*
Memcached library
*/
-#include <memcached.h>
+#include "common.h"
memcached_st *memcached_init(memcached_st *ptr)
{
-#include <memcached.h>
+#include "common.h"
static memcached_return memcached_auto(memcached_st *ptr,
char *verb,
unsigned int offset,
unsigned int *value)
{
- return memcached_auto(ptr, "incr", key, key_length, offset, value);
+ memcached_return rc;
+
+ LIBMEMCACHED_MEMCACHED_INCREMENT_START();
+ rc= memcached_auto(ptr, "incr", key, key_length, offset, value);
+ LIBMEMCACHED_MEMCACHED_INCREMENT_END();
+
+ return rc;
}
memcached_return memcached_decrement(memcached_st *ptr,
unsigned int offset,
unsigned int *value)
{
- return memcached_auto(ptr, "decr", key, key_length, offset, value);
+ memcached_return rc;
+
+ LIBMEMCACHED_MEMCACHED_DECREMENT_START();
+ rc= memcached_auto(ptr, "decr", key, key_length, offset, value);
+ LIBMEMCACHED_MEMCACHED_DECREMENT_END();
+
+ return rc;
}
-#include <memcached.h>
+#include "common.h"
memcached_return memcached_server_add(memcached_st *ptr, char *hostname, unsigned int port)
{
memcached_server_st *new_host_list;
char *new_hostname;
+ LIBMEMCACHED_MEMCACHED_SERVER_ADD_START();
if (!port)
port= MEMCACHED_DEFAULT_PORT;
ptr->hosts[ptr->number_of_hosts].fd= -1;
ptr->number_of_hosts++;
+ LIBMEMCACHED_MEMCACHED_SERVER_ADD_END();
+
return MEMCACHED_SUCCESS;
}
struct sockaddr_in localAddr, servAddr;
struct hostent *h;
+ LIBMEMCACHED_MEMCACHED_CONNECT_START();
+
if (ptr->connected == ptr->number_of_hosts)
return MEMCACHED_SUCCESS;
ptr->connected++;
}
}
+ LIBMEMCACHED_MEMCACHED_CONNECT_END();
return MEMCACHED_SUCCESS;
}
-#include <memcached.h>
+#include "common.h"
memcached_return memcached_delete(memcached_st *ptr, char *key, size_t key_length,
time_t expiration)
char buffer[MEMCACHED_DEFAULT_COMMAND_SIZE];
unsigned int server_key;
+ LIBMEMCACHED_MEMCACHED_DELETE_START();
+
rc= memcached_connect(ptr);
if (rc != MEMCACHED_SUCCESS)
if (sent_length == -1 || sent_length != send_length)
return MEMCACHED_WRITE_FAILURE;
- return memcached_response(ptr, buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, server_key);
+ rc= memcached_response(ptr, buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, server_key);
+ LIBMEMCACHED_MEMCACHED_DELETE_END();
+
+ return rc;
}
-#include <memcached.h>
+#include "common.h"
memcached_return memcached_flush(memcached_st *ptr, time_t expiration)
{
size_t send_length, sent_length;
memcached_return rc;
char buffer[MEMCACHED_DEFAULT_COMMAND_SIZE];
+ LIBMEMCACHED_MEMCACHED_FLUSH_START();
rc= memcached_connect(ptr);
rc= MEMCACHED_SOME_ERRORS;
}
+ LIBMEMCACHED_MEMCACHED_FLUSH_END();
return rc;
}
-#include <memcached.h>
+#include "common.h"
static char *memcached_value_fetch(memcached_st *ptr, char *key, size_t *key_length,
size_t *value_length,
size_t send_length;
char buffer[MEMCACHED_DEFAULT_COMMAND_SIZE];
unsigned int server_key;
+ char *value;
+ LIBMEMCACHED_MEMCACHED_GET_START();
*value_length= 0;
*error= memcached_connect(ptr);
return NULL;
}
- return memcached_value_fetch(ptr, key, &key_length, value_length, flags,
+ value= memcached_value_fetch(ptr, key, &key_length, value_length, flags,
error, 0, server_key);
+ LIBMEMCACHED_MEMCACHED_GET_END();
+
+ return value;
}
memcached_return memcached_mget(memcached_st *ptr,
unsigned int x;
memcached_return rc;
memcached_string_st **cursor_key_exec;
+ LIBMEMCACHED_MEMCACHED_MGET_START();
ptr->cursor_server= 0;
memset(buffer, 0, HUGE_STRING_LEN);
free(cursor_key_exec);
+ LIBMEMCACHED_MEMCACHED_MGET_END();
return rc;
}
-#include <memcached.h>
+#include "common.h"
unsigned int memcached_generate_hash(char *key, size_t key_length)
{
-#include <memcached.h>
+#include "common.h"
/*
This closes all connections (forces flush of input as well).
from an issued command.
*/
-#include <memcached.h>
+#include "common.h"
memcached_return memcached_response(memcached_st *ptr,
char *buffer, size_t buffer_length,
/*
*/
-#include <memcached.h>
+#include "common.h"
static char *memcached_stat_keys[] = {
"pid",
{
char **list= (char **)malloc(sizeof(memcached_stat_keys));
+ memset(list, 0, sizeof(memcached_stat_keys));
+
if (!list)
{
*error= MEMCACHED_MEMORY_ALLOCATION_FAILURE;
*/
-#include <memcached.h>
+#include "common.h"
static memcached_return memcached_send(memcached_st *ptr,
char *key, size_t key_length,
time_t expiration,
uint16_t flags)
{
- return memcached_send(ptr, key, key_length, value, value_length,
+ memcached_return rc;
+ LIBMEMCACHED_MEMCACHED_SET_START();
+ rc= memcached_send(ptr, key, key_length, value, value_length,
expiration, flags, "set");
+ LIBMEMCACHED_MEMCACHED_SET_END();
+ return rc;
}
memcached_return memcached_add(memcached_st *ptr, char *key, size_t key_length,
time_t expiration,
uint16_t flags)
{
- return memcached_send(ptr, key, key_length, value, value_length,
+ memcached_return rc;
+ LIBMEMCACHED_MEMCACHED_ADD_START();
+ rc= memcached_send(ptr, key, key_length, value, value_length,
expiration, flags, "add");
+ LIBMEMCACHED_MEMCACHED_ADD_END();
+ return rc;
}
memcached_return memcached_replace(memcached_st *ptr, char *key, size_t key_length,
time_t expiration,
uint16_t flags)
{
- return memcached_send(ptr, key, key_length, value, value_length,
+ memcached_return rc;
+ LIBMEMCACHED_MEMCACHED_REPLACE_START();
+ rc= memcached_send(ptr, key, key_length, value, value_length,
expiration, flags, "replace");
+ LIBMEMCACHED_MEMCACHED_REPLACE_END();
+ return rc;
}
-#include <memcached.h>
+#include "common.h"
char *memcached_strerror(memcached_st *ptr, memcached_return rc)
{
-#include <memcached.h>
+#include "common.h"
memcached_return memcached_string_check(memcached_string_st *string, size_t need)
{
-#include <memcached.h>
+#include "common.h"
memcached_return memcached_verbosity(memcached_st *ptr, unsigned int verbosity)
{
free(opt_servers);
return 0;
-};
+}
void options_parse(int argc, char *argv[])
memcached_st *memc;
memc= memcached_init(NULL);
assert(memc);
- rc= memcached_server_add(memc, "zim.tangent.org", 0);
+ rc= memcached_server_add(memc, "localhost", 0);
assert(rc == MEMCACHED_SUCCESS);
assert(memc);
memcached_deinit(memc);
memc= memcached_init(NULL);
assert(memc);
- rc= memcached_server_add(memc, "zim.tangent.org", 0);
+ rc= memcached_server_add(memc, "localhost", 0);
assert(rc == MEMCACHED_SUCCESS);
rc= memcached_set(memc, key, strlen(key),
value, strlen(value),
memc= memcached_init(NULL);
assert(memc);
- rc= memcached_server_add(memc, "zim.tangent.org", 0);
+ rc= memcached_server_add(memc, "localhost", 0);
assert(rc == MEMCACHED_SUCCESS);
rc= memcached_add(memc, key, strlen(key),
value, strlen(value),
memc= memcached_init(NULL);
assert(memc);
- rc= memcached_server_add(memc, "zim.tangent.org", 0);
+ rc= memcached_server_add(memc, "localhost", 0);
assert(rc == MEMCACHED_SUCCESS);
rc= memcached_replace(memc, key, strlen(key),
value, strlen(value),
memc= memcached_init(NULL);
assert(memc);
- rc= memcached_server_add(memc, "zim.tangent.org", 0);
+ rc= memcached_server_add(memc, "localhost", 0);
assert(rc == MEMCACHED_SUCCESS);
rc= memcached_set(memc, key, strlen(key),
value, strlen(value),
memc= memcached_init(NULL);
assert(memc);
- rc= memcached_server_add(memc, "zim.tangent.org", 0);
+ rc= memcached_server_add(memc, "localhost", 0);
assert(rc == MEMCACHED_SUCCESS);
rc= memcached_flush(memc, 0);
assert(rc == MEMCACHED_SUCCESS);
memc= memcached_init(NULL);
assert(memc);
- rc= memcached_server_add(memc, "zim.tangent.org", 0);
+ rc= memcached_server_add(memc, "localhost", 0);
assert(rc == MEMCACHED_SUCCESS);
string= memcached_get(memc, key, strlen(key),
memc= memcached_init(NULL);
assert(memc);
- rc= memcached_server_add(memc, "zim.tangent.org", 0);
+ rc= memcached_server_add(memc, "localhost", 0);
assert(rc == MEMCACHED_SUCCESS);
rc= memcached_set(memc, key, strlen(key),
memc= memcached_init(NULL);
assert(memc);
- rc= memcached_server_add(memc, "zim.tangent.org", 0);
+ rc= memcached_server_add(memc, "localhost", 0);
assert(rc == MEMCACHED_SUCCESS);
rc= memcached_set(memc, key, strlen(key),
memcached_return rc;
memcached_stat_st stat;
rc= memcached_stat_servername(&stat, NULL,
- "zim.tangent.org",
+ "localhost",
MEMCACHED_DEFAULT_PORT);
}
memc= memcached_init(NULL);
assert(memc);
- rc= memcached_server_add(memc, "zim.tangent.org", 0);
+ rc= memcached_server_add(memc, "localhost", 0);
assert(rc == MEMCACHED_SUCCESS);
rc= memcached_set(memc, key, strlen(key),
memc= memcached_init(NULL);
assert(memc);
- rc= memcached_server_add(memc, "zim.tangent.org", 0);
+ rc= memcached_server_add(memc, "localhost", 0);
assert(rc == MEMCACHED_SUCCESS);
rc= memcached_set(memc, key, strlen(key),
memc= memcached_init(NULL);
assert(memc);
- rc= memcached_server_add(memc, "zim.tangent.org", 0);
+ rc= memcached_server_add(memc, "localhost", 0);
assert(rc == MEMCACHED_SUCCESS);
rc= memcached_set(memc, key, strlen(key),
memc= memcached_init(NULL);
assert(memc);
- rc= memcached_server_add(memc, "zim.tangent.org", 0);
+ rc= memcached_server_add(memc, "localhost", 0);
assert(rc == MEMCACHED_SUCCESS);
/* We need to empty the server before continueing test */
memc= memcached_init(NULL);
assert(memc);
- rc= memcached_server_add(memc, "zim.tangent.org", 0);
+ rc= memcached_server_add(memc, "localhost", 0);
assert(rc == MEMCACHED_SUCCESS);
stat= memcached_stat(memc, NULL, &rc);
memc= memcached_init(NULL);
assert(memc);
- rc= memcached_server_add(memc, "zim.tangent.org", 0);
+ rc= memcached_server_add(memc, "localhost", 0);
assert(rc == MEMCACHED_SUCCESS);
- rc= memcached_server_add(memc, "zim.tangent.org", 5555);
+ rc= memcached_server_add(memc, "localhost", 5555);
assert(rc == MEMCACHED_SUCCESS);
stat= memcached_stat(memc, NULL, &rc);