-AC_INIT(src/main.c)\r
+AC_INIT(src/memcat.c)\r
AC_CONFIG_AUX_DIR(config)\r
AM_CONFIG_HEADER(config.h)\r
AM_INIT_AUTOMAKE("?", 0.2 )\r
-#include <brian.h>
/*
* Summary: interface for memcached server
* Description: main include file for libmemcached
#define MEMCACHED_DEFAULT_COMMAND_SIZE 350
#define HUGE_STRING_LEN 8196
+#define WATCHPOINT printf("WATCHPOINT %s:%d\n", __FILE__, __LINE__);fflush(stdout);
+
typedef enum {
MEMCACHED_SUCCESS,
MEMCACHED_FAILURE,
INCLUDES = -I$(top_builddir)/include\r
LDADDS = ../lib/libmemcached.la\r
\r
-bin_PROGRAMS = main\r
-main_SOURCES = main.c\r
-main_LDADD = $(LDADDS)\r
+bin_PROGRAMS = memcat\r
+memcat_SOURCES = memcat.c\r
+memcat_LDADD = $(LDADDS)\r
+++ /dev/null
-#include <stdio.h>\r
-#include <memcached.h>\r
-\r
-int main(int argc, char *argv[])\r
-{\r
- memcached_st memc;\r
-\r
- (void)memcached_init(&memc);\r
- memcached_deinit(&memc);\r
-\r
- return 0;\r
-};\r
--- /dev/null
+#include <stdio.h>\r
+#include <memcached.h>\r
+\r
+int main(int argc, char *argv[])\r
+{\r
+ memcached_st *memc;\r
+ char *string;\r
+ unsigned int x;\r
+ size_t string_length;\r
+ uint16_t flags;\r
+ memcached_return rc;\r
+\r
+ if (argc == 1)\r
+ return 0;\r
+\r
+ memc= memcached_init(NULL);\r
+\r
+ for (x= 1; x <= argc; x++)\r
+ {\r
+ string= memcached_get(memc, argv[1], strlen(argv[1]),\r
+ &string_length, &flags, &rc);\r
+ if (string)\r
+ {\r
+ printf("%.*s\n", string_length, string);\r
+ free(string);\r
+ }\r
+ }\r
+\r
+ memcached_deinit(memc);\r
+\r
+ return 0;\r
+};\r