#endif
#include <memcached.h>
+#include <string.h>
#include <stdio.h>
class Memcached
public:
- Memcached();
- Memcached(memcached_st *clone);
+ Memcached()
+ {
+ memcached_create(&memc);
+ }
+
+ Memcached(memcached_st *clone)
+ {
+ WATCHPOINT;
+ memcached_clone(&memc, clone);
+ WATCHPOINT;
+ }
+
+ char *get(char *key, size_t *value_length)
+ {
+ uint32_t flags;
+ memcached_return rc;
+
+ return memcached_get(&memc, key, strlen(key),
+ value_length, &flags, &rc);
+ }
+
+ memcached_return set(char *key, char *value, size_t value_length)
+ {
+ return memcached_set(&memc, key, strlen(key),
+ value, value_length,
+ (time_t)0, (uint32_t)0);
+ }
~Memcached()
{
memcached_free(&memc);
}
-
- char *get(char *key, size_t *value_length);
- memcached_return set(char *key, char *value, size_t value_length);
};
memcached_io.h \
common.h
-lib_LTLIBRARIES = libmemcached.la libmemcachedPlus.la
+lib_LTLIBRARIES = libmemcached.la
libmemcached_la_SOURCES = crc.c \
hsieh_hash.c \
libmemcached_la_LIBADD =
libmemcached_la_LDFLAGS = -version-info $(MEMCACHED_LIBRARY_VERSION)
-libmemcachedPlus_la_SOURCES = memcachedplus.cpp
-libmemcachedPlus_la_LIBADD =
-libmemcachedPlus_la_LDFLAGS = -version-info $(MEMCACHED_LIBRARY_VERSION)
-
if HAVE_DTRACE
libmemcached_la_LIBADD += libmemcached_probes.o
endif
+++ /dev/null
-/*
- Memcached library
-*/
-
-#ifdef USE_PRAGMA_IMPLEMENTATION
-#pragma implementation // gcc: Class implementation
-#endif
-
-#include <strings.h>
-#include <memcached.hh>
-
-Memcached::Memcached()
-{
- memcached_create(&memc);
-}
-
-Memcached::Memcached(memcached_st *clone)
-{
- WATCHPOINT;
- memcached_clone(&memc, clone);
- WATCHPOINT;
-}
-
-char *Memcached::get(char *key, size_t *value_length)
-{
- uint32_t flags;
- memcached_return rc;
-
- return memcached_get(&memc, key, strlen(key),
- value_length, &flags, &rc);
-}
-
-memcached_return Memcached::set(char *key, char *value, size_t value_length)
-{
- return memcached_set(&memc, key, strlen(key),
- value, value_length,
- (time_t)0, (uint32_t)0);
-}
testapp_LDADD = $(LDADDS)
testplus_SOURCES = test.c plus.cpp
-testplus_LDADD = $(LDADDS) ../lib/libmemcachedPlus.la
+testplus_LDADD = $(LDADDS) ../lib/libmemcached.la
record:
./testapp > output.res