X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=include%2Fmemcached.h;h=1131de2baff3c4d47469ca4e5c2f5dd025f2c177;hb=b662f45011eb691eab9fdf8e8e683c42c1e5694f;hp=a706fea657048c8b15b87fd01f21e8c1765e780f;hpb=c11af7ccccd3260444da4f575022de655d2ffc26;p=m6w6%2Flibmemcached diff --git a/include/memcached.h b/include/memcached.h index a706fea6..1131de2b 100644 --- a/include/memcached.h +++ b/include/memcached.h @@ -12,6 +12,7 @@ #include #include +#include #ifdef __cplusplus extern "C" { @@ -28,7 +29,7 @@ typedef struct memcached_server_st memcached_server_st; #define HUGE_STRING_LEN 8196 #define MEMCACHED_MAX_KEY 251 /* We add one to have it null terminated */ //#define MEMCACHED_MAX_BUFFER 8196 -#define MEMCACHED_MAX_BUFFER HUGE_STRING_LEN*2 +#define MEMCACHED_MAX_BUFFER HUGE_STRING_LEN typedef enum { MEMCACHED_SUCCESS, @@ -210,11 +211,29 @@ char ** memcached_stat_get_keys(memcached_st *ptr, memcached_stat_st *stat, memcached_return *error); /* Some personal debugging functions */ -#define WATCHPOINT printf("\nWATCHPOINT %s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout); -#define WATCHPOINT_ERROR(A) printf("\nWATCHPOINT %s:%d %s\n", __FILE__, __LINE__, memcached_strerror(NULL, A));fflush(stdout); -#define WATCHPOINT_STRING(A) printf("\nWATCHPOINT %s:%d (%s) %s\n", __FILE__, __LINE__,__func__,A);fflush(stdout); -#define WATCHPOINT_NUMBER(A) printf("\nWATCHPOINT %s:%d (%s) %d\n", __FILE__, __LINE__,__func__,A);fflush(stdout); -#define WATCHPOINT_ERRNO(A) printf("\nWATCHPOINT %s:%d (%s) %s\n", __FILE__, __LINE__,__func__, strerror(A));A= 0;fflush(stdout); +#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_STRING(A) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s\n", __FILE__, __LINE__,__func__,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));A= 0;fflush(stdout); +#define WATCHPOINT_ASSERT(A) assert((A)); +#else +/* +#define WATCHPOINT { 1; }; +#define WATCHPOINT_ERROR(A) { 1; }; +#define WATCHPOINT_STRING(A) { 1; }; +#define WATCHPOINT_NUMBER(A) { 1; }; +#define WATCHPOINT_ERRNO(A) { 1; }; +#define WATCHPOINT_ASSERT(A) { 1; }; +*/ +#define WATCHPOINT +#define WATCHPOINT_ERROR(A) +#define WATCHPOINT_STRING(A) +#define WATCHPOINT_NUMBER(A) +#define WATCHPOINT_ERRNO(A) +#define WATCHPOINT_ASSERT(A) +#endif #ifdef __cplusplus