summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornpmccallum <npmccallum@c587cffe-e639-0410-9787-d7902ae8ed56>2007-12-07 17:51:36 +0000
committernpmccallum <npmccallum@c587cffe-e639-0410-9787-d7902ae8ed56>2007-12-07 17:51:36 +0000
commit682487d17fc0f2fcd69cc8715271e5b4dca5d3ba (patch)
tree75ec82af02882ddc864b8543b5bffe43328b3c6c
parentcc881e6091cb72d62aad419388044d257b5fbc79 (diff)
downloadlibproxy-682487d17fc0f2fcd69cc8715271e5b4dca5d3ba.tar.gz
undo ltdl support, we'll handle this differently
git-svn-id: http://libproxy.googlecode.com/svn/trunk@64 c587cffe-e639-0410-9787-d7902ae8ed56
-rw-r--r--src/lib/Makefile.am2
-rw-r--r--src/lib/proxy_factory.c18
2 files changed, 8 insertions, 12 deletions
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 0352c62..955007e 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -2,7 +2,7 @@ lib_LTLIBRARIES = libproxy.la
libproxy_la_SOURCES = misc.c ip.c url.c pac.c dhcp.c dns.c slp.c wpad.c proxy_factory.c config_file.c \
misc.h ip.h url.h pac.h dhcp.h dns.h slp.h wpad.h proxy_factory.h proxy.h config_file.h
libproxy_la_CFLAGS = -Wall
-libproxy_la_LDFLAGS = -lltdl
+libproxy_la_LDFLAGS = -lm
include_HEADERS = proxy.h
diff --git a/src/lib/proxy_factory.c b/src/lib/proxy_factory.c
index 9c3272b..07e9eb0 100644
--- a/src/lib/proxy_factory.c
+++ b/src/lib/proxy_factory.c
@@ -25,7 +25,6 @@
#include <stdio.h>
#include <dlfcn.h>
#include <math.h>
-#include <ltdl.h>
#include "misc.h"
#include "proxy_factory.h"
@@ -48,7 +47,7 @@ struct _pxKeyVal {
typedef struct _pxKeyVal pxKeyVal;
struct _pxProxyFactory {
- lt_dlhandle *plugins;
+ void **plugins;
pxProxyFactoryConfig **configs;
pxKeyVal **misc;
pxProxyFactoryVoidCallback *on_get_proxy;
@@ -126,12 +125,9 @@ px_proxy_factory_new ()
DIR *plugindir = opendir(PLUGINDIR);
if (!plugindir) return self;
- // Initialize the DLL loader
- lt_dlinit();
-
// Count the number of plugins
for (i=0 ; readdir(plugindir) ; i++);
- self->plugins = (lt_dlhandle *) px_malloc0(sizeof(lt_dlhandle) * (i + 1));
+ self->plugins = (void **) px_malloc0(sizeof(void *) * (i + 1));
rewinddir(plugindir);
// For each plugin...
@@ -140,7 +136,7 @@ px_proxy_factory_new ()
{
// Load the plugin
char *tmp = px_strcat(PLUGINDIR, "/", ent->d_name, NULL);
- self->plugins[i] = lt_dlopen(tmp);
+ self->plugins[i] = dlopen(tmp, RTLD_LOCAL);
px_free(tmp);
if (!(self->plugins[i]))
{
@@ -150,10 +146,10 @@ px_proxy_factory_new ()
// Call the instantiation hook
pxProxyFactoryBoolCallback instantiate;
- instantiate = lt_dlsym(self->plugins[i], "on_proxy_factory_instantiate");
+ instantiate = dlsym(self->plugins[i], "on_proxy_factory_instantiate");
if (instantiate && !instantiate(self))
{
- lt_dlclose(self->plugins[i]);
+ dlclose(self->plugins[i]);
self->plugins[i--] = NULL;
continue;
}
@@ -638,12 +634,12 @@ px_proxy_factory_free (pxProxyFactory *self)
{
// Call the destantiation hook
pxProxyFactoryVoidCallback destantiate;
- destantiate = lt_dlsym(self->plugins[i], "on_proxy_factory_destantiate");
+ destantiate = dlsym(self->plugins[i], "on_proxy_factory_destantiate");
if (destantiate)
destantiate(self);
// Unload the plugin
- lt_dlclose(self->plugins[i]);
+ dlclose(self->plugins[i]);
self->plugins[i] = NULL;
}
px_free(self->plugins);