summaryrefslogtreecommitdiff
path: root/src/wire
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-01-25 14:57:32 +0100
committerChristian Grothoff <christian@grothoff.org>2016-01-25 14:57:32 +0100
commit57c1d2318f14c4b5c21609cb96f32517d02752e7 (patch)
treedccb0cf9d1b5c0dd8a1693d023015dbd6f633b00 /src/wire
parentfae7db7e930af35e3dac9a6980b69464b4317a85 (diff)
downloadexchange-57c1d2318f14c4b5c21609cb96f32517d02752e7.tar.gz
exchange-57c1d2318f14c4b5c21609cb96f32517d02752e7.tar.bz2
exchange-57c1d2318f14c4b5c21609cb96f32517d02752e7.zip
getting aggregator structure laid out for #4141
Diffstat (limited to 'src/wire')
-rw-r--r--src/wire/Makefile.am13
-rw-r--r--src/wire/test_sepa_wireformat.c53
2 files changed, 17 insertions, 49 deletions
diff --git a/src/wire/Makefile.am b/src/wire/Makefile.am
index 528d91014..fb6f25616 100644
--- a/src/wire/Makefile.am
+++ b/src/wire/Makefile.am
@@ -15,6 +15,9 @@ plugin_LTLIBRARIES = \
noinst_LTLIBRARIES = \
libtaler_plugin_wire_template.la
+lib_LTLIBRARIES = \
+ libtalerwire.la
+
libtaler_plugin_wire_test_la_SOURCES = \
plugin_wire_test.c
@@ -47,6 +50,15 @@ libtaler_plugin_wire_template_la_LDFLAGS = \
-lgnunetutil $(XLIB)
+libtalerwire_la_SOURCES = \
+ wire.c
+libtalerwire_la_LIBADD = \
+ -lgnunetutil
+ $(XLIB)
+libtalerwire_la_LDFLAGS = \
+ -version-info 0:0:0 \
+ -export-dynamic -no-undefined
+
TESTS = \
test_sepa_wireformat
@@ -61,4 +73,5 @@ test_sepa_wireformat_SOURCES = \
test_sepa_wireformat_LDADD = \
-lgnunetutil \
-ljansson \
+ libtalerwire.la \
$(top_builddir)/src/util/libtalerutil.la
diff --git a/src/wire/test_sepa_wireformat.c b/src/wire/test_sepa_wireformat.c
index 958aac260..edbe5bc45 100644
--- a/src/wire/test_sepa_wireformat.c
+++ b/src/wire/test_sepa_wireformat.c
@@ -22,7 +22,7 @@
#include "platform.h"
#include "taler_util.h"
-#include "taler_wire_plugin.h"
+#include "taler_wire_lib.h"
/* Valid SEPA data */
@@ -62,51 +62,6 @@ static const char * const unsupported_wire_str =
\"address\": \"foobar\"}";
-/**
- * Initialize the plugin.
- *
- * @param cfg configuration to use
- * @return #GNUNET_OK on success
- */
-static struct TALER_WIRE_Plugin *
-wire_plugin_load (const struct GNUNET_CONFIGURATION_Handle *cfg,
- const char *plugin_name)
-{
- char *lib_name;
- struct TALER_WIRE_Plugin *plugin;
-
- (void) GNUNET_asprintf (&lib_name,
- "libtaler_plugin_wire_%s",
- plugin_name);
- plugin = GNUNET_PLUGIN_load (lib_name,
- (void *) cfg);
- if (NULL != plugin)
- plugin->library_name = lib_name;
- else
- GNUNET_free (lib_name);
- return plugin;
-}
-
-
-/**
- * Shutdown the plugin.
- *
- * @param plugin the plugin to unload
- */
-static void
-wire_plugin_unload (struct TALER_WIRE_Plugin *plugin)
-{
- char *lib_name;
-
- if (NULL == plugin)
- return;
- lib_name = plugin->library_name;
- GNUNET_assert (NULL == GNUNET_PLUGIN_unload (lib_name,
- plugin));
- GNUNET_free (lib_name);
-}
-
-
int
main(int argc,
const char *const argv[])
@@ -125,8 +80,8 @@ main(int argc,
"mint",
"currency",
"EUR");
- plugin = wire_plugin_load (cfg,
- "sepa");
+ plugin = TALER_WIRE_plugin_load (cfg,
+ "sepa");
GNUNET_assert (NULL != plugin);
(void) memset(&error, 0, sizeof(error));
GNUNET_assert (NULL != (wire = json_loads (unsupported_wire_str, 0, NULL)));
@@ -141,7 +96,7 @@ main(int argc,
GNUNET_assert (NULL != (wire = json_loads (valid_wire_str, 0, &error)));
ret = plugin->wire_validate (wire);
json_decref (wire);
- wire_plugin_unload (plugin);
+ TALER_WIRE_plugin_unload (plugin);
GNUNET_CONFIGURATION_destroy (cfg);
if (GNUNET_NO == ret)
return 1;