aboutsummaryrefslogtreecommitdiff
path: root/src/exchange-tools/taler-wire.c
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2019-02-10 18:35:05 +0100
committerMarcello Stanisci <stanisci.m@gmail.com>2019-02-10 18:35:05 +0100
commitcd0b9e8e0ab31f5697b6dfc04d85eeae7bef15b1 (patch)
treed21b0b30078e086177891bbfe7d7a9a8aa7c5336 /src/exchange-tools/taler-wire.c
parent4b4a851ab5633543ab567580d9bc656ae0c7b0e7 (diff)
load wire plugin
Diffstat (limited to 'src/exchange-tools/taler-wire.c')
-rw-r--r--src/exchange-tools/taler-wire.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/exchange-tools/taler-wire.c b/src/exchange-tools/taler-wire.c
index e49a0aed0..3c5550212 100644
--- a/src/exchange-tools/taler-wire.c
+++ b/src/exchange-tools/taler-wire.c
@@ -27,17 +27,23 @@
#include <platform.h>
#include <gnunet/gnunet_util_lib.h>
#include <taler/taler_util.h>
+#include <taler/taler_wire_lib.h>
/**
* Plugin name specified by the user.
*/
-char *plugin;
+char *plugin_name;
/**
* Global return code.
*/
unsigned int global_ret;
+/**
+ * Wire plugin handle.
+ */
+struct TALER_WIRE_Plugin *plugin_handle;
+
/**
* Main function that will be run.
@@ -54,13 +60,23 @@ run (void *cls,
const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *cfg)
{
- if (NULL == plugin)
+ if (NULL == plugin_name)
{
global_ret = 1;
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"The PLUGIN command line option is mandatory.\n");
return;
}
+
+ plugin_handle = TALER_WIRE_plugin_load (cfg,
+ plugin_name);
+ if (NULL == plugin_handle)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Could not load the wire plugin\n");
+ global_ret = 1;
+ return;
+ }
}
/**
@@ -83,7 +99,7 @@ main (int argc,
"plugin",
"PLUGIN",
"Wire plugin to use",
- &plugin),
+ &plugin_name),
GNUNET_GETOPT_OPTION_END
};