-#include <memcached.h>
#include <getopt.h>
#include <assert.h>
#include "client_options.h"
then
if test "$ENABLE_DEBUG" = "yes"
then
- CFLAGS="-Wall -ggdb -DHAVE_DEBUG"
+ CFLAGS="-Wall -ggdb -DMEMCACHED_INTERNAL -DHAVE_DEBUG"
else
- CFLAGS="-Wall -O3"
+ CFLAGS="-Wall -O3 -DMEMCACHED_INTERNAL "
fi
else
CFLAGS="-Xa -xstrconst -mt -D_FORTEC_ -fast -m64"
memcached_result.h \
memcached_server.h \
memcached_string.h \
- memcached_types.h
+ memcached_types.h \
+ memcached_watchpoint.h
lib_LTLIBRARIES = libmemcached.la
#include <libmemcached/memcached_constants.h>
#include <libmemcached/memcached_types.h>
+#include <libmemcached/memcached_watchpoint.h>
#include <libmemcached/memcached_server.h>
#include <libmemcached/memcached_string.h>
#include <libmemcached/memcached_result.h>
void *context,
unsigned int number_of_callbacks);
-#ifndef __WATCHPOINT_H__
-#define __WATCHPOINT_H__
-/* Some personal debugging functions */
-#ifdef HAVE_DEBUG
-#define WATCHPOINT fprintf(stderr, "\nWATCHPOINT %s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout);
-#ifdef __MEMCACHED_H__
-#define WATCHPOINT_ERROR(A) fprintf(stderr, "\nWATCHPOINT %s:%d %s\n", __FILE__, __LINE__, memcached_strerror(NULL, A));fflush(stdout);
-#define WATCHPOINT_IFERROR(A) if(A != MEMCACHED_SUCCESS)fprintf(stderr, "\nWATCHPOINT %s:%d %s\n", __FILE__, __LINE__, memcached_strerror(NULL, A));fflush(stdout);
-#endif
-#define WATCHPOINT_STRING(A) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s\n", __FILE__, __LINE__,__func__,A);fflush(stdout);
-#define WATCHPOINT_STRING_LENGTH(A,B) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %.*s\n", __FILE__, __LINE__,__func__,(int)B,A);fflush(stdout);
-#define WATCHPOINT_NUMBER(A) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %zu\n", __FILE__, __LINE__,__func__,(size_t)(A));fflush(stdout);
-#define WATCHPOINT_ERRNO(A) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s\n", __FILE__, __LINE__,__func__, strerror(A));fflush(stdout);
-#define WATCHPOINT_ASSERT(A) assert((A));
-#else
-#define WATCHPOINT
-#ifdef __MEMCACHED_H__
-#define WATCHPOINT_ERROR(A)
-#define WATCHPOINT_IFERROR(A)
-#endif
-#define WATCHPOINT_STRING(A)
-#define WATCHPOINT_NUMBER(A)
-#define WATCHPOINT_ERRNO(A)
-#define WATCHPOINT_ASSERT(A)
-#endif
-
-#endif /* __WATCHPOINT_H__ */
-
#ifdef __cplusplus
}
Memcached(memcached_st *clone)
{
- WATCHPOINT;
memcached_clone(&memc, clone);
- WATCHPOINT;
}
char *get(char *key, size_t *value_length)
-#include <memcached.h>
#include "common.h"
/* Protoypes (static) */
--- /dev/null
+/*
+ * Summary: Localized copy of WATCHPOINT debug symbols
+ *
+ * Copy: See Copyright for the status of this software.
+ *
+ * Author: Brian Aker
+ */
+
+#ifndef __MEMCACHED_WATCHPOINT_H__
+#define __MEMCACHED_WATCHPOINT_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Some personal debugging functions */
+#ifdef MEMCACHED_INTERNAL
+#ifdef HAVE_DEBUG
+#define WATCHPOINT fprintf(stderr, "\nWATCHPOINT %s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout);
+#define WATCHPOINT_ERROR(A) fprintf(stderr, "\nWATCHPOINT %s:%d %s\n", __FILE__, __LINE__, memcached_strerror(NULL, A));fflush(stdout);
+#define WATCHPOINT_IFERROR(A) if(A != MEMCACHED_SUCCESS)fprintf(stderr, "\nWATCHPOINT %s:%d %s\n", __FILE__, __LINE__, memcached_strerror(NULL, A));fflush(stdout);
+#define WATCHPOINT_STRING(A) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s\n", __FILE__, __LINE__,__func__,A);fflush(stdout);
+#define WATCHPOINT_STRING_LENGTH(A,B) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %.*s\n", __FILE__, __LINE__,__func__,(int)B,A);fflush(stdout);
+#define WATCHPOINT_NUMBER(A) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %zu\n", __FILE__, __LINE__,__func__,(size_t)(A));fflush(stdout);
+#define WATCHPOINT_ERRNO(A) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s\n", __FILE__, __LINE__,__func__, strerror(A));fflush(stdout);
+#define WATCHPOINT_ASSERT(A) assert((A));
+#else
+#define WATCHPOINT
+#define WATCHPOINT_ERROR(A)
+#define WATCHPOINT_IFERROR(A)
+#define WATCHPOINT_STRING(A)
+#define WATCHPOINT_NUMBER(A)
+#define WATCHPOINT_ERRNO(A)
+#define WATCHPOINT_ASSERT(A)
+#endif
+#endif /* MEMCACHED_INTERNAL */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MEMCACHED_WATCHPOINT_H__ */
Sample test application.
*/
#include <assert.h>
-#include <libmemcached/memcached.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
*/
#define TEST_PORT_BASE MEMCACHED_DEFAULT_PORT+10
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>