(no commit message)
authorNathan S. Evans <evans@in.tum.de>
Tue, 20 Jul 2010 14:38:30 +0000 (14:38 +0000)
committerNathan S. Evans <evans@in.tum.de>
Tue, 20 Jul 2010 14:38:30 +0000 (14:38 +0000)
src/dht/Makefile.am
src/dht/dhtlog.h

index e304bb5b450275a2dd5d7bca4d9325c8de9775e6..592d6ea52341d95c2378f18e8662183dc1da0cf6 100644 (file)
@@ -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         
index c10e7c153f52fed3bcb0bb6c776ee0936c82b4de..b2ba1c96f7a9917f4f11984d051034cbf7392b4d 100644 (file)
@@ -30,7 +30,6 @@
 #define GNUNET_DHTLOG_SERVICE_H
 
 #include "gnunet_util_lib.h"
-#include <mysql/mysql.h>
 
 #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 */
 {