summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDustin Sallings <dustin@spy.net>2009-03-24 08:10:47 -0700
committerDustin Sallings <dustin@spy.net>2009-03-24 13:17:36 -0700
commit37369b0d8181ef403e577a5ebe29ab8d5b749e60 (patch)
tree8924eb0b3ed44b4161cda43492bee0192482f553
parent53180103df1bbca1292a14ef96aab2e6a19e13cf (diff)
downloadmemcached-37369b0d8181ef403e577a5ebe29ab8d5b749e60.tar.gz
Make APPEND_STAT globally available.
-rw-r--r--memcached.c10
-rw-r--r--memcached.h11
2 files changed, 11 insertions, 10 deletions
diff --git a/memcached.c b/memcached.c
index a3f46aa..5ced667 100644
--- a/memcached.c
+++ b/memcached.c
@@ -2334,14 +2334,6 @@ uint32_t append_ascii_stats(char *buf, const char *key, const uint16_t klen,
return nbytes;
}
-/* Local macro existing specifically to process stats */
-#define APPEND_STAT(fmt, name, val) \
- vlen = sprintf(val_str, fmt, val); \
- size = add_stats(pos, name, strlen(name), val_str, vlen, c); \
- *buflen += size; \
- pos += size; \
- assert(*buflen < allocated);
-
static char *process_stat_settings(uint32_t (*add_stats)(char *buf,
const char *k,
const uint16_t kl,
@@ -2387,8 +2379,6 @@ static char *process_stat_settings(uint32_t (*add_stats)(char *buf,
return buf;
}
-#undef APPEND_STAT
-
static void process_stat(conn *c, token_t *tokens, const size_t ntokens) {
char *command;
char *subcommand;
diff --git a/memcached.h b/memcached.h
index 9298192..f4cbdd3 100644
--- a/memcached.h
+++ b/memcached.h
@@ -175,6 +175,17 @@ typedef struct _stritem {
+ (item)->nsuffix + (item)->nbytes \
+ (((item)->it_flags & ITEM_CAS) ? sizeof(uint64_t) : 0))
+/* Stat processing macros */
+
+/* Append a simple stat with a stat name, value format and value */
+#define APPEND_STAT(fmt, name, val) \
+ vlen = sprintf(val_str, fmt, val); \
+ size = add_stats(pos, name, strlen(name), val_str, vlen, c); \
+ *buflen += size; \
+ pos += size; \
+ assert(*buflen < allocated);
+
+
/**
* NOTE: If you modify this table you _MUST_ update the function state_text
*/