From a3513eefb075376ca401fe0dd591f70633b8791b Mon Sep 17 00:00:00 2001 From: "Nathan S. Evans" Date: Tue, 20 Jul 2010 14:38:30 +0000 Subject: [PATCH] --- src/dht/Makefile.am | 62 +++++++++++++++++++++++++++------------------ src/dht/dhtlog.h | 20 +++++---------- 2 files changed, 44 insertions(+), 38 deletions(-) diff --git a/src/dht/Makefile.am b/src/dht/Makefile.am index e304bb5b4..592d6ea52 100644 --- a/src/dht/Makefile.am +++ b/src/dht/Makefile.am @@ -3,6 +3,12 @@ if MINGW WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols -lole32 -lshell32 -liconv -lstdc++ -lcomdlg32 -lgdi32 endif +plugindir = $(libdir)/gnunet + +if HAVE_MYSQL + MYSQL_PLUGIN = libgnunet_plugin_dhtlog_mysql.la +endif + if HAVE_ZLIB ZLIB_LNK = -lz endif @@ -12,19 +18,37 @@ if USE_COVERAGE XLIB = -lgcov endif -lib_LTLIBRARIES = libgnunetdht.la -# libgnunetdhtlog.la +lib_LTLIBRARIES = libgnunetdht.la \ + libgnunetdhtlog.la + +plugin_LTLIBRARIES = \ + libgnunet_plugin_dhtlog_dummy.la $(MYSQL_PLUGIN) -#libgnunetdhtlog_la_SOURCES = \ -# dhtlog_mysql.c dhtlog.h -#libgnunetdhtlog_la_LIBADD = \ -# $(top_builddir)/src/util/libgnunetutil.la \ -# $(XLIB) -#libgnunetdhtlog_la_LDFLAGS = \ -# $(GN_LIB_LDFLAGS) $(WINFLAGS) \ -# -lmysqlclient $(ZLIB_LNK) \ -# -version-info 0:0:0 +libgnunet_plugin_dhtlog_dummy_la_SOURCES = \ + plugin_dhtlog_dummy.c +libgnunet_plugin_dhtlog_dummy_la_LIBADD = \ + $(top_builddir)/src/util/libgnunetutil.la \ + $(XLIB) +libgnunet_plugin_dhtlog_dummy_la_LDFLAGS = \ + $(GN_PLUGIN_LDFLAGS) +if HAVE_MYSQL +libgnunet_plugin_dhtlog_mysql_la_SOURCES = \ + plugin_dhtlog_mysql.c +libgnunet_plugin_dhtlog_mysql_la_LIBADD = \ + $(top_builddir)/src/util/libgnunetutil.la \ + $(XLIB) +libgnunet_plugin_dhtlog_mysql_la_LDFLAGS = \ + $(GN_PLUGIN_LDFLAGS) -lmysqlclient $(ZLIB_LNK) +endif + +libgnunetdhtlog_la_SOURCES = \ + dhtlog.c dhtlog.h +libgnunetdhtlog_la_LIBADD = \ + $(top_builddir)/src/util/libgnunetutil.la +libgnunetdhtlog_la_LDFLAGS = \ + $(GN_LIB_LDFLAGS) $(WINFLAGS) \ + -version-info 0:0:0 libgnunetdht_la_SOURCES = \ dht_api.c dht.h @@ -41,10 +65,8 @@ bin_PROGRAMS = \ gnunet-dht-get-peer \ gnunet-dht-put -if HAVE_MYSQL noinst_PROGRAMS = \ gnunet-dht-driver -endif gnunet_service_dht_SOURCES = \ gnunet-service-dht.c @@ -54,18 +76,8 @@ gnunet_service_dht_LDADD = \ $(top_builddir)/src/transport/libgnunettransport.la \ $(top_builddir)/src/hello/libgnunethello.la \ $(top_builddir)/src/datacache/libgnunetdatacache.la \ - $(top_builddir)/src/util/libgnunetutil.la - -#gnunet_service_dht_new_SOURCES = \ -# gnunet-service-dht-new.c -#gnunet_service_dht_new_LDADD = \ -# $(top_builddir)/src/statistics/libgnunetstatistics.la \ -# $(top_builddir)/src/core/libgnunetcore.la \ -# $(top_builddir)/src/transport/libgnunettransport.la \ -# $(top_builddir)/src/hello/libgnunethello.la \ -# $(top_builddir)/src/datacache/libgnunetdatacache.la \ -# $(top_builddir)/src/util/libgnunetutil.la \ -# $(top_builddir)/src/dht/libgnunetdhtlog.la + $(top_builddir)/src/util/libgnunetutil.la \ + $(top_builddir)/src/dht/libgnunetdhtlog.la gnunet_dht_get_SOURCES = \ gnunet-dht-get.c diff --git a/src/dht/dhtlog.h b/src/dht/dhtlog.h index c10e7c153..b2ba1c96f 100644 --- a/src/dht/dhtlog.h +++ b/src/dht/dhtlog.h @@ -30,7 +30,6 @@ #define GNUNET_DHTLOG_SERVICE_H #include "gnunet_util_lib.h" -#include #ifdef __cplusplus extern "C" @@ -157,6 +156,13 @@ struct GNUNET_DHTLOG_Handle }; +struct GNUNET_DHTLOG_Plugin +{ + const struct GNUNET_CONFIGURATION_Handle *cfg; + + struct GNUNET_DHTLOG_Handle *dhtlog_api; +}; + /** * Connect to mysql server using the DHT log plugin. * @@ -171,18 +177,6 @@ GNUNET_DHTLOG_connect (const struct GNUNET_CONFIGURATION_Handle *c); void GNUNET_DHTLOG_disconnect (struct GNUNET_DHTLOG_Handle *api); -/** - * Type of a callback that will be called for each - * data set returned from MySQL. - * - * @param cls user-defined argument - * @param num_values number of elements in values - * @param values values returned by MySQL - * @return GNUNET_OK to continue iterating, GNUNET_SYSERR to abort - */ -typedef int (*GNUNET_MysqlDataProcessor) (void *cls, - unsigned int num_values, - MYSQL_BIND * values); #if 0 /* keep Emacsens' auto-indent happy */ { -- 2.25.1