75 |
#include "libguile/lang.h" |
#include "libguile/lang.h" |
76 |
#include "libguile/validate.h" |
#include "libguile/validate.h" |
77 |
|
|
78 |
#include "libltdl/ltdl.h" |
#include "guile-ltdl.h" |
79 |
|
|
80 |
/* |
/* |
81 |
From the libtool manual: "Note that libltdl is not threadsafe, |
From the libtool manual: "Note that libltdl is not threadsafe, |
90 |
static void * |
static void * |
91 |
sysdep_dynl_link (const char *fname, const char *subr) |
sysdep_dynl_link (const char *fname, const char *subr) |
92 |
{ |
{ |
93 |
lt_dlhandle handle; |
scm_lt_dlhandle handle; |
94 |
handle = scm_lt_dlopenext (fname); |
handle = scm_lt_dlopenext (fname); |
95 |
if (NULL == handle) |
if (NULL == handle) |
96 |
{ |
{ |
107 |
static void |
static void |
108 |
sysdep_dynl_unlink (void *handle, const char *subr) |
sysdep_dynl_unlink (void *handle, const char *subr) |
109 |
{ |
{ |
110 |
if (scm_lt_dlclose ((lt_dlhandle) handle)) |
if (scm_lt_dlclose ((scm_lt_dlhandle) handle)) |
111 |
{ |
{ |
112 |
scm_misc_error (subr, (char *) scm_lt_dlerror (), SCM_EOL); |
scm_misc_error (subr, (char *) scm_lt_dlerror (), SCM_EOL); |
113 |
} |
} |
118 |
{ |
{ |
119 |
void *fptr; |
void *fptr; |
120 |
|
|
121 |
fptr = scm_lt_dlsym ((lt_dlhandle) handle, symb); |
fptr = scm_lt_dlsym ((scm_lt_dlhandle) handle, symb); |
122 |
if (!fptr) |
if (!fptr) |
123 |
{ |
{ |
124 |
scm_misc_error (subr, (char *) scm_lt_dlerror (), SCM_EOL); |
scm_misc_error (subr, (char *) scm_lt_dlerror (), SCM_EOL); |