Refactored debug library out of main include.
author <brian@gir-2.local> <>
Mon, 10 Mar 2008 18:17:55 +0000 (14:17 -0400)
committer <brian@gir-2.local> <>
Mon, 10 Mar 2008 18:17:55 +0000 (14:17 -0400)
clients/utilities.h
configure.ac
libmemcached/Makefile.am
libmemcached/memcached.h
libmemcached/memcached.hh
libmemcached/memcached_hosts.c
libmemcached/memcached_watchpoint.h [new file with mode: 0644]
tests/atomsmasher.c
tests/server.c

index 6d4d72d444419d38073ac6233bd6ce198ebec19f..6f8967af442b445f10734744a1978106279342e4 100644 (file)
@@ -1,4 +1,3 @@
-#include <memcached.h>
 #include <getopt.h>
 #include <assert.h>
 #include "client_options.h"
index a4d1205809528977022ff74ca7bd6401949f2294..40e1d67eb18f12191de594b74aa1b8c7e824a9c8 100644 (file)
@@ -57,9 +57,9 @@ if test "$GCC" = "yes"
 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"
index 01adbefa6056ac6439d4571e0b36a19a31e9498d..06480a5dad95e28973c9a5e29c2e3836f1b4ccc5 100644 (file)
@@ -31,7 +31,8 @@ pkginclude_HEADERS= memcached.h \
                    memcached_result.h \
                    memcached_server.h \
                    memcached_string.h \
-                   memcached_types.h
+                   memcached_types.h \
+                   memcached_watchpoint.h
 
 lib_LTLIBRARIES = libmemcached.la
 
index 4db72e946ae30266beadea673e5deedca4548afe..edf49157ba7faf632d512e1be49d3baafd305275 100644 (file)
@@ -17,6 +17,7 @@
 
 #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>
@@ -268,34 +269,6 @@ memcached_return memcached_server_cursor(memcached_st *ptr,
                                          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
 }
index e482f4bf517bbbd500b6d48fdf48b2a582974371..f7e349e7ee2fca05a4e28a8e8b5e78424f89610a 100644 (file)
@@ -19,9 +19,7 @@ public:
 
   Memcached(memcached_st *clone)
   {
-    WATCHPOINT;
     memcached_clone(&memc, clone);
-    WATCHPOINT;
   }
 
   char *get(char *key, size_t *value_length)
index fb53fa229c9f471a35a1e6b004bb22a60e9a12dd..c62c3b41984402665b324b097f3717ef930a1a01 100644 (file)
@@ -1,4 +1,3 @@
-#include <memcached.h>
 #include "common.h"
 
 /* Protoypes (static) */
diff --git a/libmemcached/memcached_watchpoint.h b/libmemcached/memcached_watchpoint.h
new file mode 100644 (file)
index 0000000..b0270b6
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * 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__ */
index 6ff68ca96a4851b8f40f1126190570243e9dd5d1..11b4258f55f9387c9d16d51533cd9981cc7ba2cd 100644 (file)
@@ -2,7 +2,6 @@
   Sample test application.
 */
 #include <assert.h>
-#include <libmemcached/memcached.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
index 58f45233cbe0f137c192c0ac23c107bfade6bed4..f5e44a9b182b8de8d8b257fd70383077ebccc274 100644 (file)
@@ -3,6 +3,7 @@
 */
 
 #define TEST_PORT_BASE MEMCACHED_DEFAULT_PORT+10 
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>