aboutsummaryrefslogtreecommitdiff
path: root/src/backenddb/merchantdb_plugin.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-11-14 22:31:23 +0100
committerChristian Grothoff <christian@grothoff.org>2024-11-14 22:31:23 +0100
commit15980ee476270bc0af4dc1327be0744ce1e6194e (patch)
tree5be1bdbe0044161d516f5c480ea8fdd2a641f9d0 /src/backenddb/merchantdb_plugin.c
parentaf66f5c044f57937f87b86eea95b606e52f7deb8 (diff)
adaptations of merchant to GNUnet fix #8962
Diffstat (limited to 'src/backenddb/merchantdb_plugin.c')
-rw-r--r--src/backenddb/merchantdb_plugin.c75
1 files changed, 3 insertions, 72 deletions
diff --git a/src/backenddb/merchantdb_plugin.c b/src/backenddb/merchantdb_plugin.c
index 1207d499..99c2717e 100644
--- a/src/backenddb/merchantdb_plugin.c
+++ b/src/backenddb/merchantdb_plugin.c
@@ -21,6 +21,7 @@
*/
#include "platform.h"
#include <taler/taler_util.h>
+#include "taler_merchant_util.h"
#include "taler_merchantdb_plugin.h"
#include "taler_merchantdb_lib.h"
#include <ltdl.h>
@@ -48,7 +49,8 @@ TALER_MERCHANTDB_plugin_load (const struct GNUNET_CONFIGURATION_Handle *cfg)
"libtaler_plugin_merchantdb_%s",
plugin_name);
GNUNET_free (plugin_name);
- plugin = GNUNET_PLUGIN_load (lib_name,
+ plugin = GNUNET_PLUGIN_load (TALER_MERCHANT_project_data (),
+ lib_name,
(void *) cfg);
if (NULL == plugin)
{
@@ -74,75 +76,4 @@ TALER_MERCHANTDB_plugin_unload (struct TALER_MERCHANTDB_Plugin *plugin)
}
-/**
- * Libtool search path before we started.
- */
-static char *old_dlsearchpath;
-
-
-/**
- * Setup libtool paths.
- */
-void __attribute__ ((constructor))
-plugin_init (void);
-
-/* Declaration to avoid compiler warning */
-void __attribute__ ((constructor))
-plugin_init (void)
-{
- int err;
- const char *opath;
- char *path;
- char *cpath;
-
- err = lt_dlinit ();
- if (err > 0)
- {
- fprintf (stderr,
- _ ("Initialization of plugin mechanism failed: %s!\n"),
- lt_dlerror ());
- return;
- }
- opath = lt_dlgetsearchpath ();
- if (NULL != opath)
- old_dlsearchpath = GNUNET_strdup (opath);
- path = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_LIBDIR);
- if (NULL != path)
- {
- if (NULL != opath)
- {
- GNUNET_asprintf (&cpath, "%s:%s", opath, path);
- lt_dlsetsearchpath (cpath);
- GNUNET_free (path);
- GNUNET_free (cpath);
- }
- else
- {
- lt_dlsetsearchpath (path);
- GNUNET_free (path);
- }
- }
-}
-
-
-/**
- * Shutdown libtool.
- */
-void __attribute__ ((destructor))
-plugin_fini (void);
-
-/* Declaration to avoid compiler warning */
-void __attribute__ ((destructor))
-plugin_fini (void)
-{
- lt_dlsetsearchpath (old_dlsearchpath);
- if (NULL != old_dlsearchpath)
- {
- GNUNET_free (old_dlsearchpath);
- old_dlsearchpath = NULL;
- }
- lt_dlexit ();
-}
-
-
/* end of merchantdb_plugin.c */