diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-07-20 14:38:30 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-07-20 14:38:30 +0000 |
commit | a3513eefb075376ca401fe0dd591f70633b8791b (patch) | |
tree | 90dc5adc9114629155ddfcf1a7a1fbab5bc06c37 /src/dht | |
parent | 5ae721068ce45ea3c3c81a8f52c09f86db849621 (diff) | |
download | gnunet-a3513eefb075376ca401fe0dd591f70633b8791b.tar.gz gnunet-a3513eefb075376ca401fe0dd591f70633b8791b.zip |
Diffstat (limited to 'src/dht')
-rw-r--r-- | src/dht/Makefile.am | 62 | ||||
-rw-r--r-- | 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 | |||
3 | WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols -lole32 -lshell32 -liconv -lstdc++ -lcomdlg32 -lgdi32 | 3 | WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols -lole32 -lshell32 -liconv -lstdc++ -lcomdlg32 -lgdi32 |
4 | endif | 4 | endif |
5 | 5 | ||
6 | plugindir = $(libdir)/gnunet | ||
7 | |||
8 | if HAVE_MYSQL | ||
9 | MYSQL_PLUGIN = libgnunet_plugin_dhtlog_mysql.la | ||
10 | endif | ||
11 | |||
6 | if HAVE_ZLIB | 12 | if HAVE_ZLIB |
7 | ZLIB_LNK = -lz | 13 | ZLIB_LNK = -lz |
8 | endif | 14 | endif |
@@ -12,19 +18,37 @@ if USE_COVERAGE | |||
12 | XLIB = -lgcov | 18 | XLIB = -lgcov |
13 | endif | 19 | endif |
14 | 20 | ||
15 | lib_LTLIBRARIES = libgnunetdht.la | 21 | lib_LTLIBRARIES = libgnunetdht.la \ |
16 | # libgnunetdhtlog.la | 22 | libgnunetdhtlog.la |
23 | |||
24 | plugin_LTLIBRARIES = \ | ||
25 | libgnunet_plugin_dhtlog_dummy.la $(MYSQL_PLUGIN) | ||
17 | 26 | ||
18 | #libgnunetdhtlog_la_SOURCES = \ | 27 | libgnunet_plugin_dhtlog_dummy_la_SOURCES = \ |
19 | # dhtlog_mysql.c dhtlog.h | 28 | plugin_dhtlog_dummy.c |
20 | #libgnunetdhtlog_la_LIBADD = \ | 29 | libgnunet_plugin_dhtlog_dummy_la_LIBADD = \ |
21 | # $(top_builddir)/src/util/libgnunetutil.la \ | 30 | $(top_builddir)/src/util/libgnunetutil.la \ |
22 | # $(XLIB) | 31 | $(XLIB) |
23 | #libgnunetdhtlog_la_LDFLAGS = \ | 32 | libgnunet_plugin_dhtlog_dummy_la_LDFLAGS = \ |
24 | # $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 33 | $(GN_PLUGIN_LDFLAGS) |
25 | # -lmysqlclient $(ZLIB_LNK) \ | ||
26 | # -version-info 0:0:0 | ||
27 | 34 | ||
35 | if HAVE_MYSQL | ||
36 | libgnunet_plugin_dhtlog_mysql_la_SOURCES = \ | ||
37 | plugin_dhtlog_mysql.c | ||
38 | libgnunet_plugin_dhtlog_mysql_la_LIBADD = \ | ||
39 | $(top_builddir)/src/util/libgnunetutil.la \ | ||
40 | $(XLIB) | ||
41 | libgnunet_plugin_dhtlog_mysql_la_LDFLAGS = \ | ||
42 | $(GN_PLUGIN_LDFLAGS) -lmysqlclient $(ZLIB_LNK) | ||
43 | endif | ||
44 | |||
45 | libgnunetdhtlog_la_SOURCES = \ | ||
46 | dhtlog.c dhtlog.h | ||
47 | libgnunetdhtlog_la_LIBADD = \ | ||
48 | $(top_builddir)/src/util/libgnunetutil.la | ||
49 | libgnunetdhtlog_la_LDFLAGS = \ | ||
50 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | ||
51 | -version-info 0:0:0 | ||
28 | 52 | ||
29 | libgnunetdht_la_SOURCES = \ | 53 | libgnunetdht_la_SOURCES = \ |
30 | dht_api.c dht.h | 54 | dht_api.c dht.h |
@@ -41,10 +65,8 @@ bin_PROGRAMS = \ | |||
41 | gnunet-dht-get-peer \ | 65 | gnunet-dht-get-peer \ |
42 | gnunet-dht-put | 66 | gnunet-dht-put |
43 | 67 | ||
44 | if HAVE_MYSQL | ||
45 | noinst_PROGRAMS = \ | 68 | noinst_PROGRAMS = \ |
46 | gnunet-dht-driver | 69 | gnunet-dht-driver |
47 | endif | ||
48 | 70 | ||
49 | gnunet_service_dht_SOURCES = \ | 71 | gnunet_service_dht_SOURCES = \ |
50 | gnunet-service-dht.c | 72 | gnunet-service-dht.c |
@@ -54,18 +76,8 @@ gnunet_service_dht_LDADD = \ | |||
54 | $(top_builddir)/src/transport/libgnunettransport.la \ | 76 | $(top_builddir)/src/transport/libgnunettransport.la \ |
55 | $(top_builddir)/src/hello/libgnunethello.la \ | 77 | $(top_builddir)/src/hello/libgnunethello.la \ |
56 | $(top_builddir)/src/datacache/libgnunetdatacache.la \ | 78 | $(top_builddir)/src/datacache/libgnunetdatacache.la \ |
57 | $(top_builddir)/src/util/libgnunetutil.la | 79 | $(top_builddir)/src/util/libgnunetutil.la \ |
58 | 80 | $(top_builddir)/src/dht/libgnunetdhtlog.la | |
59 | #gnunet_service_dht_new_SOURCES = \ | ||
60 | # gnunet-service-dht-new.c | ||
61 | #gnunet_service_dht_new_LDADD = \ | ||
62 | # $(top_builddir)/src/statistics/libgnunetstatistics.la \ | ||
63 | # $(top_builddir)/src/core/libgnunetcore.la \ | ||
64 | # $(top_builddir)/src/transport/libgnunettransport.la \ | ||
65 | # $(top_builddir)/src/hello/libgnunethello.la \ | ||
66 | # $(top_builddir)/src/datacache/libgnunetdatacache.la \ | ||
67 | # $(top_builddir)/src/util/libgnunetutil.la \ | ||
68 | # $(top_builddir)/src/dht/libgnunetdhtlog.la | ||
69 | 81 | ||
70 | gnunet_dht_get_SOURCES = \ | 82 | gnunet_dht_get_SOURCES = \ |
71 | gnunet-dht-get.c | 83 | 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 @@ | |||
30 | #define GNUNET_DHTLOG_SERVICE_H | 30 | #define GNUNET_DHTLOG_SERVICE_H |
31 | 31 | ||
32 | #include "gnunet_util_lib.h" | 32 | #include "gnunet_util_lib.h" |
33 | #include <mysql/mysql.h> | ||
34 | 33 | ||
35 | #ifdef __cplusplus | 34 | #ifdef __cplusplus |
36 | extern "C" | 35 | extern "C" |
@@ -157,6 +156,13 @@ struct GNUNET_DHTLOG_Handle | |||
157 | 156 | ||
158 | }; | 157 | }; |
159 | 158 | ||
159 | struct GNUNET_DHTLOG_Plugin | ||
160 | { | ||
161 | const struct GNUNET_CONFIGURATION_Handle *cfg; | ||
162 | |||
163 | struct GNUNET_DHTLOG_Handle *dhtlog_api; | ||
164 | }; | ||
165 | |||
160 | /** | 166 | /** |
161 | * Connect to mysql server using the DHT log plugin. | 167 | * Connect to mysql server using the DHT log plugin. |
162 | * | 168 | * |
@@ -171,18 +177,6 @@ GNUNET_DHTLOG_connect (const struct GNUNET_CONFIGURATION_Handle *c); | |||
171 | void | 177 | void |
172 | GNUNET_DHTLOG_disconnect (struct GNUNET_DHTLOG_Handle *api); | 178 | GNUNET_DHTLOG_disconnect (struct GNUNET_DHTLOG_Handle *api); |
173 | 179 | ||
174 | /** | ||
175 | * Type of a callback that will be called for each | ||
176 | * data set returned from MySQL. | ||
177 | * | ||
178 | * @param cls user-defined argument | ||
179 | * @param num_values number of elements in values | ||
180 | * @param values values returned by MySQL | ||
181 | * @return GNUNET_OK to continue iterating, GNUNET_SYSERR to abort | ||
182 | */ | ||
183 | typedef int (*GNUNET_MysqlDataProcessor) (void *cls, | ||
184 | unsigned int num_values, | ||
185 | MYSQL_BIND * values); | ||
186 | 180 | ||
187 | #if 0 /* keep Emacsens' auto-indent happy */ | 181 | #if 0 /* keep Emacsens' auto-indent happy */ |
188 | { | 182 | { |