* Adding support for CRC hash method
* Adding support for UNIX sockets
* Added additional HASHing methods of FNV1_64,FNV1A_64, FNV1_32, FNV1A_32
+ * Added pkgconfig support
+ * Fixed conflict with defined type in MySQL
0.7 Tue Oct 30 09:24:05 PDT 2007
* Poved to poll() from select()
--- /dev/null
+AC_INIT(src/memcat.c)
+AC_CONFIG_AUX_DIR(config)
+AM_CONFIG_HEADER(include/libmemcached_config.h)
+
+MEMCACHED_LIBRARY_NAME=libmemcached
+
+#release versioning
+MEMCACHED_MAJOR_VERSION=0
+MEMCACHED_MINOR_VERSION=8
+MEMCACHED_MICRO_VERSION=0
+
+#API version
+MEMCACHED_API_VERSION=1.0
+AC_SUBST(MEMCACHED_API_VERSION)
+
+#shared library versioning
+MEMCACHED_LIBRARY_VERSION=1:0:0
+# | | |
+# +------+ | +---+
+# | | |
+# current:revision:age
+# | | |
+# | | +- increment if interfaces have been added
+# | | set to zero if interfaces have been removed or changed
+# | +- increment if source code has changed
+# | set to zero if current is incremented
+# +- increment if interfaces have been added, removed or changed
+
+AC_SUBST(MEMCACHED_LIBRARY_VERSION)
+
+PACKAGE=$MEMCACHED_LIBRARY_NAME
+AC_SUBST(MEMCACHED_LIBRARY_NAME)
+
+MEMCACHED_VERSION=$MEMCACHED_MAJOR_VERSION.$MEMCACHED_MINOR_VERSION.$MEMCACHED_MICRO_VERSION
+MEMCACHED_RELEASE=$MEMCACHED_MAJOR_VERSION.$MEMCACHED_MINOR_VERSION
+AC_SUBST(MEMCACHED_RELEASE)
+AC_SUBST(MEMCACHED_VERSION)
+
+VERSION=$MEMCACHED_VERSION
+
+AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
+
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_LIBTOOL
+AM_SANITY_CHECK
+LIBTOOL="$LIBTOOL --preserve-dup-deps"
+AC_SUBST(LIBTOOL)dnl
+AC_LANG_CPLUSPLUS
+
+sinclude(config/debug.m4)
+sinclude(config/dtrace.m4)
+
+# We only support GCC and Sun's forte at the moment
+if test "$GCC" = "yes"
+then
+ if test "$ENABLE_DEBUG" = "yes"
+ then
+ CFLAGS="-Wall -ggdb -DHAVE_DEBUG"
+ else
+ CFLAGS="-Wall -O3"
+ fi
+else
+ CFLAGS="-Xa -xstrconst -mt -D_FORTEC_ -fast -m64"
+ LDFLAGS="-lsocket -lnsl"
+ DTRACEFLAGS="-64"
+fi
+
+AC_C_CONST
+AC_TYPE_SIZE_T
+AC_CHECK_HEADERS(limits.h syslimits.h)
+AC_OUTPUT(Makefile src/Makefile tests/Makefile docs/Makefile lib/Makefile include/Makefile support/Makefile support/libmemcached.pc)
+++ /dev/null
-AC_INIT(src/memcat.c)
-AC_CONFIG_AUX_DIR(config)
-AM_CONFIG_HEADER(include/libmemcached_config.h)
-AM_INIT_AUTOMAKE("libmemcached", 0.8)
-
-AC_PROG_CC
-AC_PROG_LIBTOOL
-LIBTOOL="$LIBTOOL --preserve-dup-deps"
-AC_SUBST(LIBTOOL)dnl
-
-sinclude(config/debug.m4)
-sinclude(config/dtrace.m4)
-
-# We only support GCC and Sun's forte at the moment
-if test "$GCC" = "yes"
-then
- if test "$ENABLE_DEBUG" = "yes"
- then
- CFLAGS="-Wall -ggdb -DHAVE_DEBUG"
- else
- CFLAGS="-Wall -O3"
- fi
-else
- CFLAGS="-Xa -xstrconst -mt -D_FORTEC_ -fast -m64"
- LDFLAGS="-lsocket -lnsl"
- DTRACEFLAGS="-64"
-fi
-
-AC_C_CONST
-AC_TYPE_SIZE_T
-AC_CHECK_HEADERS(limits.h syslimits.h)
-AC_OUTPUT(Makefile src/Makefile tests/Makefile docs/Makefile lib/Makefile include/Makefile support/Makefile)
#define SMALL_STRING_LEN 1024
#define HUGE_STRING_LEN 8196
#define MEMCACHED_MAX_KEY 251 /* We add one to have it null terminated */
-//#define MEMCACHED_MAX_BUFFER 8196
#define MEMCACHED_MAX_BUFFER HUGE_STRING_LEN
typedef enum {
char write_buffer[MEMCACHED_MAX_BUFFER];
size_t write_buffer_offset;
char connected;
- int my_errno;
+ int cached_errno;
unsigned long long flags;
int send_size;
int recv_size;
char *key, size_t key_length,
unsigned int offset,
unsigned int *value);
+void memcached_stat_free(memcached_st *, memcached_stat_st *);
memcached_stat_st *memcached_stat(memcached_st *ptr, char *args, memcached_return *error);
memcached_return memcached_stat_servername(memcached_stat_st *stat, char *args,
char *hostname, unsigned int port);
memcached_strerror.c \
memcached_verbosity.c
libmemcached_la_LIBADD =
+libmemcached_la_LDFLAGS = -version-info $(MEMCACHED_LIBRARY_VERSION) -release $(MEMCACHED_RELEASE)
if HAVE_DTRACE
libmemcached_la_LIBADD += libmemcached_probes.o
{
if ((ptr->hosts[server_key].fd= socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
{
- ptr->my_errno= errno;
+ ptr->cached_errno= errno;
return MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE;
}
addrlen= strlen(servAddr.sun_path) + sizeof(servAddr.sun_family);
test_connect:
- if (connect(ptr->hosts[server_key].fd, (struct sockaddr_un *)&servAddr, sizeof(servAddr)) < 0)
+ if (connect(ptr->hosts[server_key].fd, (struct sockaddr *)&servAddr, sizeof(servAddr)) < 0)
{
switch (errno) {
/* We are spinning waiting on connect */
case EISCONN: /* We were spinning waiting on connect */
break;
default:
- ptr->my_errno= errno;
+ ptr->cached_errno= errno;
return MEMCACHED_ERRNO;
}
ptr->connected++;
if ((h= gethostbyname(ptr->hosts[server_key].hostname)) == NULL)
{
- ptr->my_errno= h_errno;
+ ptr->cached_errno= h_errno;
return MEMCACHED_HOST_LOCKUP_FAILURE;
}
/* Create the socket */
if ((ptr->hosts[server_key].fd= socket(AF_INET, SOCK_STREAM, 0)) < 0)
{
- ptr->my_errno= errno;
+ ptr->cached_errno= errno;
return MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE;
}
case EISCONN: /* We were spinning waiting on connect */
break;
default:
- ptr->my_errno= errno;
+ ptr->cached_errno= errno;
return MEMCACHED_ERRNO;
}
ptr->connected++;
break;
default:
{
- ptr->my_errno= errno;
+ ptr->cached_errno= errno;
return -1;
}
}
}
/* Yes, we want to fall through */
default:
- ptr->my_errno= errno;
+ ptr->cached_errno= errno;
return -1;
}
}
return list;
}
+
+void memcached_stat_free(memcached_st *ptr, memcached_stat_st *stat)
+{
+ free(stat);
+}
{
fprintf(stderr, "memcat: %s: memcache error %s",
argv[optind], memcached_strerror(memc, rc));
- if (memc->my_errno)
- fprintf(stderr, " system error %s", strerror(memc->my_errno));
+ if (memc->cached_errno)
+ fprintf(stderr, " system error %s", strerror(memc->cached_errno));
fprintf(stderr, "\n");
}
optind++;
{
fprintf(stderr, "memcp: %s: memcache error %s",
ptr, memcached_strerror(memc, rc));
- if (memc->my_errno)
- fprintf(stderr, " system error %s", strerror(memc->my_errno));
+ if (memc->cached_errno)
+ fprintf(stderr, " system error %s", strerror(memc->cached_errno));
fprintf(stderr, "\n");
}
{
fprintf(stderr, "memflush: memcache error %s",
memcached_strerror(memc, rc));
- if (memc->my_errno)
- fprintf(stderr, " system error %s", strerror(memc->my_errno));
+ if (memc->cached_errno)
+ fprintf(stderr, " system error %s", strerror(memc->cached_errno));
fprintf(stderr, "\n");
}
{
fprintf(stderr, "memrm: %s: memcache error %s",
argv[optind], memcached_strerror(memc, rc));
- if (memc->my_errno)
- fprintf(stderr, " system error %s", strerror(memc->my_errno));
+ if (memc->cached_errno)
+ fprintf(stderr, " system error %s", strerror(memc->cached_errno));
fprintf(stderr, "\n");
}
EXTRA_DIST = libmemcached.spec set_benchmark.sh
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libmemcached.pc
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libmemcached
+Description: libmemcached C library.
+Version: @VERSION@
+Libs: -L${libdir} -lmemcached
+Cflags: -I${includedir}/@MEMCACHED_LIBRARY_NAME@
+
free(list);
}
- free(stat);
+ memcached_stat_free(NULL, stat);
}
void add_host_test(memcached_st *memc)