+static char *analyze_mode= NULL;
+
+static struct option long_options[]=
+{
+ {(OPTIONSTRING)"version", no_argument, NULL, OPT_VERSION},
+ {(OPTIONSTRING)"help", no_argument, NULL, OPT_HELP},
+ {(OPTIONSTRING)"verbose", no_argument, &opt_verbose, OPT_VERBOSE},
+ {(OPTIONSTRING)"debug", no_argument, &opt_verbose, OPT_DEBUG},
+ {(OPTIONSTRING)"servers", required_argument, NULL, OPT_SERVERS},
+ {(OPTIONSTRING)"flag", no_argument, &opt_displayflag, OPT_FLAG},
+ {(OPTIONSTRING)"analyze", optional_argument, NULL, OPT_ANALYZE},
+ {0, 0, 0, 0},
+};
+
+
+static memcached_return_t server_print_callback(const memcached_st *memc,
+ memcached_server_instance_st instance,
+ void *context)
+{
+ memcached_stat_st server_stat;
+ memcached_return_t rc;
+ char **list;
+ char **ptr;
+
+ (void)context;
+
+ rc= memcached_stat_servername(&server_stat, NULL,
+ memcached_server_name(instance),
+ memcached_server_port(instance));
+
+ list= memcached_stat_get_keys(memc, &server_stat, &rc);
+
+ printf("Server: %s (%u)\n", memcached_server_name(instance),
+ (uint32_t)memcached_server_port(instance));
+
+ for (ptr= list; *ptr; ptr++)
+ {
+ char *value= memcached_stat_get_value(memc, &server_stat, *ptr, &rc);
+
+ printf("\t %s: %s\n", *ptr, value);
+ free(value);
+ }
+
+ free(list);
+ printf("\n");
+
+ return MEMCACHED_SUCCESS;
+}