- *error= MEMCACHED_SUCCESS;
-
- if (!strcmp(key, "pid"))
- {
- length= snprintf(buffer, SMALL_STRING_LEN,"%lld", (signed long long)memc_stat->pid);
- }
- else if (!strcmp(key, "uptime"))
- {
- length= snprintf(buffer, SMALL_STRING_LEN,"%lu", memc_stat->uptime);
- }
- else if (!strcmp(key, "time"))
- {
- length= snprintf(buffer, SMALL_STRING_LEN,"%llu", (unsigned long long)memc_stat->time);
- }
- else if (!strcmp(key, "version"))
- {
- length= snprintf(buffer, SMALL_STRING_LEN,"%s", memc_stat->version);
- }
- else if (!strcmp(key, "pointer_size"))
- {
- length= snprintf(buffer, SMALL_STRING_LEN,"%lu", memc_stat->pointer_size);
- }
- else if (!strcmp(key, "rusage_user"))
- {
- length= snprintf(buffer, SMALL_STRING_LEN,"%lu.%lu", memc_stat->rusage_user_seconds, memc_stat->rusage_user_microseconds);
- }
- else if (!strcmp(key, "rusage_system"))
- {
- length= snprintf(buffer, SMALL_STRING_LEN,"%lu.%lu", memc_stat->rusage_system_seconds, memc_stat->rusage_system_microseconds);
- }
- else if (!strcmp(key, "curr_items"))
- {
- length= snprintf(buffer, SMALL_STRING_LEN,"%lu", memc_stat->curr_items);
- }
- else if (!strcmp(key, "total_items"))
- {
- length= snprintf(buffer, SMALL_STRING_LEN,"%lu", memc_stat->total_items);
- }
- else if (!strcmp(key, "curr_connections"))
- {
- length= snprintf(buffer, SMALL_STRING_LEN,"%lu", memc_stat->curr_connections);
- }
- else if (!strcmp(key, "total_connections"))
- {
- length= snprintf(buffer, SMALL_STRING_LEN,"%lu", memc_stat->total_connections);
- }
- else if (!strcmp(key, "connection_structures"))
- {
- length= snprintf(buffer, SMALL_STRING_LEN,"%lu", memc_stat->connection_structures);
- }
- else if (!strcmp(key, "cmd_get"))
- {
- length= snprintf(buffer, SMALL_STRING_LEN,"%llu", (unsigned long long)memc_stat->cmd_get);
- }
- else if (!strcmp(key, "cmd_set"))
- {
- length= snprintf(buffer, SMALL_STRING_LEN,"%llu", (unsigned long long)memc_stat->cmd_set);
- }
- else if (!strcmp(key, "get_hits"))
- {
- length= snprintf(buffer, SMALL_STRING_LEN,"%llu", (unsigned long long)memc_stat->get_hits);
- }
- else if (!strcmp(key, "get_misses"))
- {
- length= snprintf(buffer, SMALL_STRING_LEN,"%llu", (unsigned long long)memc_stat->get_misses);
- }
- else if (!strcmp(key, "evictions"))
- {
- length= snprintf(buffer, SMALL_STRING_LEN,"%llu", (unsigned long long)memc_stat->evictions);
- }
- else if (!strcmp(key, "bytes_read"))
- {
- length= snprintf(buffer, SMALL_STRING_LEN,"%llu", (unsigned long long)memc_stat->bytes_read);
- }
- else if (!strcmp(key, "bytes_written"))
- {
- length= snprintf(buffer, SMALL_STRING_LEN,"%llu", (unsigned long long)memc_stat->bytes_written);
- }
- else if (!strcmp(key, "bytes"))
- {
- length= snprintf(buffer, SMALL_STRING_LEN,"%llu", (unsigned long long)memc_stat->bytes);
- }
- else if (!strcmp(key, "limit_maxbytes"))
- {
- length= snprintf(buffer, SMALL_STRING_LEN,"%llu", (unsigned long long)memc_stat->limit_maxbytes);
- }
- else if (!strcmp(key, "threads"))
- {
- length= snprintf(buffer, SMALL_STRING_LEN,"%lu", memc_stat->threads);
- }
- else
- {
- Memcached* memc= (Memcached*)memcached2Memcached(shell);
- *error= memcached_set_error(*memc, MEMCACHED_INVALID_ARGUMENTS, MEMCACHED_AT, memcached_literal_param("Invalid key provided"));
+ *error = MEMCACHED_SUCCESS;
+
+ if (!strcmp(key, "pid")) {
+ length = snprintf(buffer, SMALL_STRING_LEN, "%lld", (signed long long) memc_stat->pid);
+ } else if (!strcmp(key, "uptime")) {
+ length = snprintf(buffer, SMALL_STRING_LEN, "%lu", memc_stat->uptime);
+ } else if (!strcmp(key, "time")) {
+ length = snprintf(buffer, SMALL_STRING_LEN, "%llu", (unsigned long long) memc_stat->time);
+ } else if (!strcmp(key, "version")) {
+ length = snprintf(buffer, SMALL_STRING_LEN, "%s", memc_stat->version);
+ } else if (!strcmp(key, "pointer_size")) {
+ length = snprintf(buffer, SMALL_STRING_LEN, "%lu", memc_stat->pointer_size);
+ } else if (!strcmp(key, "rusage_user")) {
+ length = snprintf(buffer, SMALL_STRING_LEN, "%lu.%lu", memc_stat->rusage_user_seconds,
+ memc_stat->rusage_user_microseconds);
+ } else if (!strcmp(key, "rusage_system")) {
+ length = snprintf(buffer, SMALL_STRING_LEN, "%lu.%lu", memc_stat->rusage_system_seconds,
+ memc_stat->rusage_system_microseconds);
+ } else if (!strcmp(key, "curr_items")) {
+ length = snprintf(buffer, SMALL_STRING_LEN, "%lu", memc_stat->curr_items);
+ } else if (!strcmp(key, "total_items")) {
+ length = snprintf(buffer, SMALL_STRING_LEN, "%lu", memc_stat->total_items);
+ } else if (!strcmp(key, "curr_connections")) {
+ length = snprintf(buffer, SMALL_STRING_LEN, "%lu", memc_stat->curr_connections);
+ } else if (!strcmp(key, "total_connections")) {
+ length = snprintf(buffer, SMALL_STRING_LEN, "%lu", memc_stat->total_connections);
+ } else if (!strcmp(key, "connection_structures")) {
+ length = snprintf(buffer, SMALL_STRING_LEN, "%lu", memc_stat->connection_structures);
+ } else if (!strcmp(key, "cmd_get")) {
+ length = snprintf(buffer, SMALL_STRING_LEN, "%llu", (unsigned long long) memc_stat->cmd_get);
+ } else if (!strcmp(key, "cmd_set")) {
+ length = snprintf(buffer, SMALL_STRING_LEN, "%llu", (unsigned long long) memc_stat->cmd_set);
+ } else if (!strcmp(key, "get_hits")) {
+ length = snprintf(buffer, SMALL_STRING_LEN, "%llu", (unsigned long long) memc_stat->get_hits);
+ } else if (!strcmp(key, "get_misses")) {
+ length = snprintf(buffer, SMALL_STRING_LEN, "%llu", (unsigned long long) memc_stat->get_misses);
+ } else if (!strcmp(key, "evictions")) {
+ length = snprintf(buffer, SMALL_STRING_LEN, "%llu", (unsigned long long) memc_stat->evictions);
+ } else if (!strcmp(key, "bytes_read")) {
+ length = snprintf(buffer, SMALL_STRING_LEN, "%llu", (unsigned long long) memc_stat->bytes_read);
+ } else if (!strcmp(key, "bytes_written")) {
+ length =
+ snprintf(buffer, SMALL_STRING_LEN, "%llu", (unsigned long long) memc_stat->bytes_written);
+ } else if (!strcmp(key, "bytes")) {
+ length = snprintf(buffer, SMALL_STRING_LEN, "%llu", (unsigned long long) memc_stat->bytes);
+ } else if (!strcmp(key, "limit_maxbytes")) {
+ length =
+ snprintf(buffer, SMALL_STRING_LEN, "%llu", (unsigned long long) memc_stat->limit_maxbytes);
+ } else if (!strcmp(key, "threads")) {
+ length = snprintf(buffer, SMALL_STRING_LEN, "%lu", memc_stat->threads);
+ } else {
+ Memcached *memc = (Memcached *) memcached2Memcached(shell);
+ *error = memcached_set_error(*memc, MEMCACHED_INVALID_ARGUMENTS, MEMCACHED_AT,
+ memcached_literal_param("Invalid key provided"));