multiple DNS lookups.
* Added CAS support, though this is optional and must be enabled during
runtime.
+ * Added the utility memerror to create human readable error strings
+ from memcached errors (aka convert ints to strings)
0.9 Thu Nov 15 07:44:00 PST 2007
* fix for when no servers are definied.
memcached_flush.pod\\r
memcached_stats.pod\\r
memrm.pod\\r
+ memerror.pod\\r
libmemcached_examples.pod\\r
memcached_get.pod\\r
memcached_strerror.pod\\r
libmemcached_examples.3\\r
memcat.1\\r
memcp.1\\r
+ memerror.1\\r
memflush.1\\r
memrm.1\\r
memslap.1\\r
memrm.1: memrm.pod\r
pod2man -c "libmemcached" -r "" -s 1 memrm.pod > memrm.1\r
\r
+memerror.1: memerror.pod\r
+ pod2man -c "libmemcached" -r "" -s 1 memerror.pod > memerror.1\r
+\r
memflush.1: memflush.pod\r
pod2man -c "libmemcached" -r "" -s 1 memflush.pod > memflush.1\r
\r
=head1 SEE ALSO
-memcached(1) libmemcached_examples(3) libmemcached(1) memcat(1) memcp(1) memflush(1) memrm(1) memslap(1) memstat(1) memcached_fetch(3) memcached_replace(3) memcached_server_list_free(3) libmemcached_examples(3) memcached_clone(3) memcached_free(3) memcached_server_add(3) memcached_server_push(3) memcached_add(3) memcached_get(3) memcached_server_count(3) memcached_servers_parse(3) memcached_create(3) memcached_increment(3) memcached_server_list(3) memcached_set(3) memcached_decrement(3) memcached_mget(3) memcached_server_list_append(3) memcached_strerror(3) memcached_delete(3) memcached_quit(3) memcached_server_list_count(3) memcached_verbosity(3) memcached_server_add_unix_socket(3) memcahed_result_create(3) memcached_result_free(3) memcached_result_key_value(3) memcached_result_key_length(3) memcached_result_value(3) memcached_result_length(3) memcached_result_flags(3) memcached_result_cas(3) memcached_result_st(3) memcached_append(3) memcached_prepend(3) memcached_fetch_result(3)
+memcached(1) libmemcached_examples(3) libmemcached(1) memcat(1) memcp(1) memflush(1) memrm(1) memslap(1) memstat(1) memcached_fetch(3) memcached_replace(3) memcached_server_list_free(3) libmemcached_examples(3) memcached_clone(3) memcached_free(3) memcached_server_add(3) memcached_server_push(3) memcached_add(3) memcached_get(3) memcached_server_count(3) memcached_servers_parse(3) memcached_create(3) memcached_increment(3) memcached_server_list(3) memcached_set(3) memcached_decrement(3) memcached_mget(3) memcached_server_list_append(3) memcached_strerror(3) memcached_delete(3) memcached_quit(3) memcached_server_list_count(3) memcached_verbosity(3) memcached_server_add_unix_socket(3) memcahed_result_create(3) memcached_result_free(3) memcached_result_key_value(3) memcached_result_key_length(3) memcached_result_value(3) memcached_result_length(3) memcached_result_flags(3) memcached_result_cas(3) memcached_result_st(3) memcached_append(3) memcached_prepend(3) memcached_fetch_result(3) memerror(1)
=cut
--- /dev/null
+=head1 NAME
+
+memerror - Translate a memcached error code to a string
+
+=head1 SYNOPSIS
+
+ memerror [options] error_code
+
+=head1 DESCRIPTION
+
+B<memerror> translate an error code from libmemcached(3) to a human
+readable string.
+
+For a full list of operations run the tool with the B<--help> option.
+
+=head1 HOME
+
+To find out more infoerroration please check:
+L<http://tangent.org/552/libmemcached.html>
+
+=head1 AUTHOR
+
+Brian Aker, E<lt>brian@tangent.orgE<gt>
+
+=head1 SEE ALSO
+
+memcached(1) libmemcached(3)
+
+=cut
+
INCLUDES = -I$(top_builddir)/include
LDADDS = ../lib/libmemcached.la
-bin_PROGRAMS = memcat memcp memstat memrm memflush memslap
+bin_PROGRAMS = memcat memcp memstat memrm memflush memslap memerror
noinst_HEADERS = client_options.h \
utilities.h \
memflush_SOURCES = memflush.c utilities.c
memflush_LDADD = $(LDADDS)
+memerror_SOURCES = memerror.c utilities.c
+memerror_LDADD = $(LDADDS)
+
memslap_SOURCES = memslap.c utilities.c generator.c execute.c
memslap_LDADD = $(LDADDS) -lpthread
--- /dev/null
+#include <stdio.h>
+#include <stdint.h>
+#include <string.h>
+#include <unistd.h>
+#include <getopt.h>
+#include <stdlib.h>
+#include <memcached.h>
+
+#include "utilities.h"
+
+#define PROGRAM_NAME "memerror"
+#define PROGRAM_DESCRIPTION "Translate a memcached errror code into a string."
+
+
+/* Prototypes */
+void options_parse(int argc, char *argv[]);
+
+static int opt_verbose= 0;
+
+int main(int argc, char *argv[])
+{
+ options_parse(argc, argv);
+
+ if (argc != 2)
+ return 1;
+
+ printf("%s\n", memcached_strerror(NULL, atoi(argv[1])));
+
+ return 0;
+}
+
+
+void options_parse(int argc, char *argv[])
+{
+ int option_index= 0;
+ int option_rv;
+
+ memcached_programs_help_st help_options[]=
+ {
+ {0},
+ };
+
+ static struct option long_options[]=
+ {
+ {"version", no_argument, NULL, OPT_VERSION},
+ {"help", no_argument, NULL, OPT_HELP},
+ {"verbose", no_argument, &opt_verbose, OPT_VERBOSE},
+ {"debug", no_argument, &opt_verbose, OPT_DEBUG},
+ {0, 0, 0, 0},
+ };
+
+ while (1)
+ {
+ option_rv= getopt_long(argc, argv, "Vhvds:", long_options, &option_index);
+ if (option_rv == -1) break;
+ switch (option_rv)
+ {
+ case 0:
+ break;
+ case OPT_VERBOSE: /* --verbose or -v */
+ opt_verbose = OPT_VERBOSE;
+ break;
+ case OPT_DEBUG: /* --debug or -d */
+ opt_verbose = OPT_DEBUG;
+ break;
+ case OPT_VERSION: /* --version or -V */
+ version_command(PROGRAM_NAME);
+ break;
+ case OPT_HELP: /* --help or -h */
+ help_command(PROGRAM_NAME, PROGRAM_DESCRIPTION, long_options, help_options);
+ break;
+ case '?':
+ /* getopt_long already printed an error message. */
+ exit(1);
+ default:
+ abort();
+ }
+ }
+}
memstat - Dump the stats of your servers to standard output.
memslap - Generate testing loads on a memcached cluster.
memcp - Copy files to memcached servers.
+memerror - Creates human readable messages from libmemecached error codes.
%prep
%setup -q
%files
%{_bindir}/memcat
%{_bindir}/memcp
+%{_bindir}/memerror
%{_bindir}/memflush
%{_bindir}/memrm
%{_bindir}/memstat