From 34a8c3858f30b02568c87f56a827f618aba6d6be Mon Sep 17 00:00:00 2001 From: Date: Mon, 10 Mar 2008 11:04:41 -0400 Subject: [PATCH] Huge refactoring of directory structure. --- .hgignore | 1 + Makefile.am | 4 ++-- {src => clients}/Makefile.am | 4 ++-- {src => clients}/client_options.h | 0 {src => clients}/execute.c | 0 {src => clients}/execute.h | 0 {src => clients}/generator.c | 0 {src => clients}/generator.h | 0 {src => clients}/memcat.c | 2 +- {src => clients}/memcp.c | 3 ++- {src => clients}/memerror.c | 2 +- {src => clients}/memflush.c | 2 +- {src => clients}/memrm.c | 2 +- {src => clients}/memslap.c | 2 +- {src => clients}/memstat.c | 2 +- {src => clients}/utilities.c | 1 + {src => clients}/utilities.h | 0 configure.ac | 6 +++--- include/Makefile.am | 3 --- {lib => libmemcached}/Makefile.am | 4 +++- {lib => libmemcached}/common.h | 0 {lib => libmemcached}/crc.c | 0 {lib => libmemcached}/hsieh_hash.c | 0 {lib => libmemcached}/libmemcached_probes.d | 0 {lib => libmemcached}/libmemcached_probes.h | 0 {lib => libmemcached}/md5.c | 0 {lib => libmemcached}/memcached.c | 0 {include => libmemcached}/memcached.h | 0 {include => libmemcached}/memcached.hh | 0 {lib => libmemcached}/memcached_auto.c | 0 {lib => libmemcached}/memcached_behavior.c | 0 {lib => libmemcached}/memcached_callback.c | 0 {lib => libmemcached}/memcached_connect.c | 0 {lib => libmemcached}/memcached_delete.c | 0 {lib => libmemcached}/memcached_do.c | 0 {lib => libmemcached}/memcached_fetch.c | 0 {lib => libmemcached}/memcached_fetch_execute.c | 0 {lib => libmemcached}/memcached_flush.c | 0 {lib => libmemcached}/memcached_get.c | 0 {lib => libmemcached}/memcached_hash.c | 0 {lib => libmemcached}/memcached_hosts.c | 0 {lib => libmemcached}/memcached_io.c | 0 {lib => libmemcached}/memcached_io.h | 0 {lib => libmemcached}/memcached_key.c | 0 {lib => libmemcached}/memcached_parse.c | 0 {lib => libmemcached}/memcached_quit.c | 0 {lib => libmemcached}/memcached_response.c | 0 {lib => libmemcached}/memcached_result.c | 0 {lib => libmemcached}/memcached_server.c | 0 {lib => libmemcached}/memcached_stats.c | 0 {lib => libmemcached}/memcached_storage.c | 0 {lib => libmemcached}/memcached_strerror.c | 0 {lib => libmemcached}/memcached_string.c | 0 {lib => libmemcached}/memcached_verbosity.c | 0 {lib => libmemcached}/memcached_version.c | 0 {lib => libmemcached}/murmur_hash.c | 0 tests/Makefile.am | 8 ++++---- tests/atomsmasher.c | 8 ++++---- tests/function.c | 8 ++++---- tests/server.c | 2 +- tests/test.h | 4 ++-- tests/udp.c | 2 +- 62 files changed, 36 insertions(+), 34 deletions(-) rename {src => clients}/Makefile.am (91%) rename {src => clients}/client_options.h (100%) rename {src => clients}/execute.c (100%) rename {src => clients}/execute.h (100%) rename {src => clients}/generator.c (100%) rename {src => clients}/generator.h (100%) rename {src => clients}/memcat.c (98%) rename {src => clients}/memcp.c (99%) rename {src => clients}/memerror.c (97%) rename {src => clients}/memflush.c (98%) rename {src => clients}/memrm.c (98%) rename {src => clients}/memslap.c (99%) rename {src => clients}/memstat.c (98%) rename {src => clients}/utilities.c (98%) rename {src => clients}/utilities.h (100%) delete mode 100644 include/Makefile.am rename {lib => libmemcached}/Makefile.am (96%) rename {lib => libmemcached}/common.h (100%) rename {lib => libmemcached}/crc.c (100%) rename {lib => libmemcached}/hsieh_hash.c (100%) rename {lib => libmemcached}/libmemcached_probes.d (100%) rename {lib => libmemcached}/libmemcached_probes.h (100%) rename {lib => libmemcached}/md5.c (100%) rename {lib => libmemcached}/memcached.c (100%) rename {include => libmemcached}/memcached.h (100%) rename {include => libmemcached}/memcached.hh (100%) rename {lib => libmemcached}/memcached_auto.c (100%) rename {lib => libmemcached}/memcached_behavior.c (100%) rename {lib => libmemcached}/memcached_callback.c (100%) rename {lib => libmemcached}/memcached_connect.c (100%) rename {lib => libmemcached}/memcached_delete.c (100%) rename {lib => libmemcached}/memcached_do.c (100%) rename {lib => libmemcached}/memcached_fetch.c (100%) rename {lib => libmemcached}/memcached_fetch_execute.c (100%) rename {lib => libmemcached}/memcached_flush.c (100%) rename {lib => libmemcached}/memcached_get.c (100%) rename {lib => libmemcached}/memcached_hash.c (100%) rename {lib => libmemcached}/memcached_hosts.c (100%) rename {lib => libmemcached}/memcached_io.c (100%) rename {lib => libmemcached}/memcached_io.h (100%) rename {lib => libmemcached}/memcached_key.c (100%) rename {lib => libmemcached}/memcached_parse.c (100%) rename {lib => libmemcached}/memcached_quit.c (100%) rename {lib => libmemcached}/memcached_response.c (100%) rename {lib => libmemcached}/memcached_result.c (100%) rename {lib => libmemcached}/memcached_server.c (100%) rename {lib => libmemcached}/memcached_stats.c (100%) rename {lib => libmemcached}/memcached_storage.c (100%) rename {lib => libmemcached}/memcached_strerror.c (100%) rename {lib => libmemcached}/memcached_string.c (100%) rename {lib => libmemcached}/memcached_verbosity.c (100%) rename {lib => libmemcached}/memcached_version.c (100%) rename {lib => libmemcached}/murmur_hash.c (100%) diff --git a/.hgignore b/.hgignore index 9aa168ed..a7097160 100644 --- a/.hgignore +++ b/.hgignore @@ -7,6 +7,7 @@ ^libtool$ ^autom4te.cache$ ^include/(libmemcached_config.h(.in)?|stamp-h1)$ +^libmemcached/libmemcached_config.h.in$ ^stamp-h1$ ^lib/libmemcachedPlus.la$ ^tests/testplus$ diff --git a/Makefile.am b/Makefile.am index 7c23b741..b9213a75 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ -INCLUDES = include -SUBDIRS = docs include lib src tests support +INCLUDES = +SUBDIRS = docs libmemcached tests support EXTRA_dist = README.FIRST test: all diff --git a/src/Makefile.am b/clients/Makefile.am similarity index 91% rename from src/Makefile.am rename to clients/Makefile.am index 004f2e1a..ccc90358 100644 --- a/src/Makefile.am +++ b/clients/Makefile.am @@ -1,5 +1,5 @@ -INCLUDES = -I$(top_builddir)/include -LDADDS = $(top_builddir)/lib/libmemcached.la +INCLUDES = +LDADDS = $(top_builddir)/libmemcached/libmemcached.la bin_PROGRAMS = memcat memcp memstat memrm memflush memslap memerror diff --git a/src/client_options.h b/clients/client_options.h similarity index 100% rename from src/client_options.h rename to clients/client_options.h diff --git a/src/execute.c b/clients/execute.c similarity index 100% rename from src/execute.c rename to clients/execute.c diff --git a/src/execute.h b/clients/execute.h similarity index 100% rename from src/execute.h rename to clients/execute.h diff --git a/src/generator.c b/clients/generator.c similarity index 100% rename from src/generator.c rename to clients/generator.c diff --git a/src/generator.h b/clients/generator.h similarity index 100% rename from src/generator.h rename to clients/generator.h diff --git a/src/memcat.c b/clients/memcat.c similarity index 98% rename from src/memcat.c rename to clients/memcat.c index 7d2c14db..b9db6497 100644 --- a/src/memcat.c +++ b/clients/memcat.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include "utilities.h" diff --git a/src/memcp.c b/clients/memcp.c similarity index 99% rename from src/memcp.c rename to clients/memcp.c index cbdbf449..780514c1 100644 --- a/src/memcp.c +++ b/clients/memcp.c @@ -12,7 +12,8 @@ #include #include -#include +#include + #include "client_options.h" #include "utilities.h" diff --git a/src/memerror.c b/clients/memerror.c similarity index 97% rename from src/memerror.c rename to clients/memerror.c index f6cf1aba..5654c212 100644 --- a/src/memerror.c +++ b/clients/memerror.c @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include "utilities.h" diff --git a/src/memflush.c b/clients/memflush.c similarity index 98% rename from src/memflush.c rename to clients/memflush.c index ed3a5f81..3bf25c34 100644 --- a/src/memflush.c +++ b/clients/memflush.c @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include "client_options.h" #include "utilities.h" diff --git a/src/memrm.c b/clients/memrm.c similarity index 98% rename from src/memrm.c rename to clients/memrm.c index 7b774d72..05fe404b 100644 --- a/src/memrm.c +++ b/clients/memrm.c @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include "client_options.h" #include "utilities.h" diff --git a/src/memslap.c b/clients/memslap.c similarity index 99% rename from src/memslap.c rename to clients/memslap.c index 899d8b81..164fc099 100644 --- a/src/memslap.c +++ b/clients/memslap.c @@ -11,7 +11,7 @@ #include #include -#include +#include #include "client_options.h" #include "utilities.h" diff --git a/src/memstat.c b/clients/memstat.c similarity index 98% rename from src/memstat.c rename to clients/memstat.c index 540d3f4f..3f1a78a3 100644 --- a/src/memstat.c +++ b/clients/memstat.c @@ -8,7 +8,7 @@ #include #include -#include +#include #include "client_options.h" #include "utilities.h" diff --git a/src/utilities.c b/clients/utilities.c similarity index 98% rename from src/utilities.c rename to clients/utilities.c index 2a63f9e5..d19f57ec 100644 --- a/src/utilities.c +++ b/clients/utilities.c @@ -81,6 +81,7 @@ void process_hash_option(memcached_st *memc, char *opt_hash) if (opt_hash == NULL) return; + set= MEMCACHED_HASH_DEFAULT; /* Just here to solve warning */ if (!strcasecmp(opt_hash, "CRC")) set= MEMCACHED_HASH_CRC; else if (!strcasecmp(opt_hash, "FNV1_64")) diff --git a/src/utilities.h b/clients/utilities.h similarity index 100% rename from src/utilities.h rename to clients/utilities.h diff --git a/configure.ac b/configure.ac index b70514ad..90072831 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ -AC_INIT(src/memcat.c) +AC_INIT(clients/memcat.c) AC_CONFIG_AUX_DIR(config) -AM_CONFIG_HEADER(include/libmemcached_config.h) +AM_CONFIG_HEADER(libmemcached/libmemcached_config.h) AC_CANONICAL_SYSTEM MEMCACHED_LIBRARY_NAME=libmemcached @@ -71,4 +71,4 @@ AC_C_CONST AC_HEADER_TIME AC_TYPE_SIZE_T AC_SEARCH_LIBS(getopt_long, gnugetopt) -AC_OUTPUT(Makefile src/Makefile tests/Makefile docs/Makefile lib/Makefile include/Makefile support/Makefile support/libmemcached.pc support/libmemcached.spec) +AC_OUTPUT(Makefile clients/Makefile tests/Makefile docs/Makefile libmemcached/Makefile support/Makefile support/libmemcached.pc support/libmemcached.spec) diff --git a/include/Makefile.am b/include/Makefile.am deleted file mode 100644 index d41e7b8b..00000000 --- a/include/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -INCLUDES = include - -pkginclude_HEADERS= memcached.h memcached.hh diff --git a/lib/Makefile.am b/libmemcached/Makefile.am similarity index 96% rename from lib/Makefile.am rename to libmemcached/Makefile.am index 7e99091a..bd35e18a 100644 --- a/lib/Makefile.am +++ b/libmemcached/Makefile.am @@ -1,6 +1,6 @@ EXTRA_DIST = libmemcached_probes.d -INCLUDES = -I$(top_builddir)/include -I$(top_builddir) +INCLUDES = -I$(top_builddir) LIBS = DTRACE = @DTRACE@ @@ -24,6 +24,8 @@ noinst_HEADERS = libmemcached_probes.h \ memcached_io.h \ common.h +pkginclude_HEADERS= memcached.h memcached.hh + lib_LTLIBRARIES = libmemcached.la libmemcached_la_SOURCES = crc.c \ diff --git a/lib/common.h b/libmemcached/common.h similarity index 100% rename from lib/common.h rename to libmemcached/common.h diff --git a/lib/crc.c b/libmemcached/crc.c similarity index 100% rename from lib/crc.c rename to libmemcached/crc.c diff --git a/lib/hsieh_hash.c b/libmemcached/hsieh_hash.c similarity index 100% rename from lib/hsieh_hash.c rename to libmemcached/hsieh_hash.c diff --git a/lib/libmemcached_probes.d b/libmemcached/libmemcached_probes.d similarity index 100% rename from lib/libmemcached_probes.d rename to libmemcached/libmemcached_probes.d diff --git a/lib/libmemcached_probes.h b/libmemcached/libmemcached_probes.h similarity index 100% rename from lib/libmemcached_probes.h rename to libmemcached/libmemcached_probes.h diff --git a/lib/md5.c b/libmemcached/md5.c similarity index 100% rename from lib/md5.c rename to libmemcached/md5.c diff --git a/lib/memcached.c b/libmemcached/memcached.c similarity index 100% rename from lib/memcached.c rename to libmemcached/memcached.c diff --git a/include/memcached.h b/libmemcached/memcached.h similarity index 100% rename from include/memcached.h rename to libmemcached/memcached.h diff --git a/include/memcached.hh b/libmemcached/memcached.hh similarity index 100% rename from include/memcached.hh rename to libmemcached/memcached.hh diff --git a/lib/memcached_auto.c b/libmemcached/memcached_auto.c similarity index 100% rename from lib/memcached_auto.c rename to libmemcached/memcached_auto.c diff --git a/lib/memcached_behavior.c b/libmemcached/memcached_behavior.c similarity index 100% rename from lib/memcached_behavior.c rename to libmemcached/memcached_behavior.c diff --git a/lib/memcached_callback.c b/libmemcached/memcached_callback.c similarity index 100% rename from lib/memcached_callback.c rename to libmemcached/memcached_callback.c diff --git a/lib/memcached_connect.c b/libmemcached/memcached_connect.c similarity index 100% rename from lib/memcached_connect.c rename to libmemcached/memcached_connect.c diff --git a/lib/memcached_delete.c b/libmemcached/memcached_delete.c similarity index 100% rename from lib/memcached_delete.c rename to libmemcached/memcached_delete.c diff --git a/lib/memcached_do.c b/libmemcached/memcached_do.c similarity index 100% rename from lib/memcached_do.c rename to libmemcached/memcached_do.c diff --git a/lib/memcached_fetch.c b/libmemcached/memcached_fetch.c similarity index 100% rename from lib/memcached_fetch.c rename to libmemcached/memcached_fetch.c diff --git a/lib/memcached_fetch_execute.c b/libmemcached/memcached_fetch_execute.c similarity index 100% rename from lib/memcached_fetch_execute.c rename to libmemcached/memcached_fetch_execute.c diff --git a/lib/memcached_flush.c b/libmemcached/memcached_flush.c similarity index 100% rename from lib/memcached_flush.c rename to libmemcached/memcached_flush.c diff --git a/lib/memcached_get.c b/libmemcached/memcached_get.c similarity index 100% rename from lib/memcached_get.c rename to libmemcached/memcached_get.c diff --git a/lib/memcached_hash.c b/libmemcached/memcached_hash.c similarity index 100% rename from lib/memcached_hash.c rename to libmemcached/memcached_hash.c diff --git a/lib/memcached_hosts.c b/libmemcached/memcached_hosts.c similarity index 100% rename from lib/memcached_hosts.c rename to libmemcached/memcached_hosts.c diff --git a/lib/memcached_io.c b/libmemcached/memcached_io.c similarity index 100% rename from lib/memcached_io.c rename to libmemcached/memcached_io.c diff --git a/lib/memcached_io.h b/libmemcached/memcached_io.h similarity index 100% rename from lib/memcached_io.h rename to libmemcached/memcached_io.h diff --git a/lib/memcached_key.c b/libmemcached/memcached_key.c similarity index 100% rename from lib/memcached_key.c rename to libmemcached/memcached_key.c diff --git a/lib/memcached_parse.c b/libmemcached/memcached_parse.c similarity index 100% rename from lib/memcached_parse.c rename to libmemcached/memcached_parse.c diff --git a/lib/memcached_quit.c b/libmemcached/memcached_quit.c similarity index 100% rename from lib/memcached_quit.c rename to libmemcached/memcached_quit.c diff --git a/lib/memcached_response.c b/libmemcached/memcached_response.c similarity index 100% rename from lib/memcached_response.c rename to libmemcached/memcached_response.c diff --git a/lib/memcached_result.c b/libmemcached/memcached_result.c similarity index 100% rename from lib/memcached_result.c rename to libmemcached/memcached_result.c diff --git a/lib/memcached_server.c b/libmemcached/memcached_server.c similarity index 100% rename from lib/memcached_server.c rename to libmemcached/memcached_server.c diff --git a/lib/memcached_stats.c b/libmemcached/memcached_stats.c similarity index 100% rename from lib/memcached_stats.c rename to libmemcached/memcached_stats.c diff --git a/lib/memcached_storage.c b/libmemcached/memcached_storage.c similarity index 100% rename from lib/memcached_storage.c rename to libmemcached/memcached_storage.c diff --git a/lib/memcached_strerror.c b/libmemcached/memcached_strerror.c similarity index 100% rename from lib/memcached_strerror.c rename to libmemcached/memcached_strerror.c diff --git a/lib/memcached_string.c b/libmemcached/memcached_string.c similarity index 100% rename from lib/memcached_string.c rename to libmemcached/memcached_string.c diff --git a/lib/memcached_verbosity.c b/libmemcached/memcached_verbosity.c similarity index 100% rename from lib/memcached_verbosity.c rename to libmemcached/memcached_verbosity.c diff --git a/lib/memcached_version.c b/libmemcached/memcached_version.c similarity index 100% rename from lib/memcached_version.c rename to libmemcached/memcached_version.c diff --git a/lib/murmur_hash.c b/libmemcached/murmur_hash.c similarity index 100% rename from lib/murmur_hash.c rename to libmemcached/murmur_hash.c diff --git a/tests/Makefile.am b/tests/Makefile.am index f23fde0b..664ce008 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,5 +1,5 @@ -INCLUDES = -I$(top_builddir)/include -I$(top_builddir)/lib -LDADDS = ../lib/libmemcached.la +INCLUDES = +LDADDS = $(top_builddir)/libmemcached/libmemcached.la EXTRA_DIST = output.res output2.res\ r/memcat.res\ @@ -18,7 +18,7 @@ LIBS = noinst_HEADERS = test.h server.h noinst_PROGRAMS = testapp testplus udptest atomsmasher startservers -testapp_SOURCES = test.c function.c ../src/generator.c ../src/execute.c server.c +testapp_SOURCES = test.c function.c server.c ../clients/generator.c ../clients/execute.c testapp_LDADD = $(LDADDS) testplus_SOURCES = test.c plus.cpp server.c @@ -27,7 +27,7 @@ testplus_LDADD = $(LDADDS) udptest_SOURCES = test.c udp.c server.c udptest_LDADD = $(LDADDS) -atomsmasher_SOURCES = test.c atomsmasher.c server.c ../src/generator.c ../src/execute.c +atomsmasher_SOURCES = test.c atomsmasher.c server.c ../clients/generator.c ../clients/execute.c atomsmasher_LDADD = $(LDADDS) startservers_SOURCES = start.c server.c diff --git a/tests/atomsmasher.c b/tests/atomsmasher.c index c4378877..a039fc4d 100644 --- a/tests/atomsmasher.c +++ b/tests/atomsmasher.c @@ -2,7 +2,7 @@ Sample test application. */ #include -#include +#include #include #include #include @@ -12,9 +12,9 @@ #include #include #include "server.h" -#include "../lib/common.h" -#include "../src/generator.h" -#include "../src/execute.h" +#include "../libmemcached/common.h" +#include "../clients/generator.h" +#include "../clients/execute.h" #ifndef INT64_MAX #define INT64_MAX LONG_MAX diff --git a/tests/function.c b/tests/function.c index 8d84c16f..f36110ea 100644 --- a/tests/function.c +++ b/tests/function.c @@ -2,7 +2,7 @@ Sample test application. */ #include -#include +#include #include #include #include @@ -12,9 +12,9 @@ #include #include #include "server.h" -#include "../lib/common.h" -#include "../src/generator.h" -#include "../src/execute.h" +#include "../libmemcached/common.h" +#include "../clients/generator.h" +#include "../clients/execute.h" #ifndef INT64_MAX #define INT64_MAX LONG_MAX diff --git a/tests/server.c b/tests/server.c index ce8db70b..58f45233 100644 --- a/tests/server.c +++ b/tests/server.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include "server.h" diff --git a/tests/test.h b/tests/test.h index 1c6b87be..0cbb5f0d 100644 --- a/tests/test.h +++ b/tests/test.h @@ -5,8 +5,8 @@ extern "C" { #endif -#include -#include "../lib/common.h" +#include +#include "../libmemcached/common.h" typedef struct world_st world_st; typedef struct collection_st collection_st; diff --git a/tests/udp.c b/tests/udp.c index df73b261..b6ad2065 100644 --- a/tests/udp.c +++ b/tests/udp.c @@ -2,7 +2,7 @@ Sample test application. */ #include -#include +#include #include #include #include -- 2.30.2