Sorry I did not answer before, but I was in San Francisco.
On Monday 28 October 2002 06:17, dennis@... wrote:
> is it documented somewhere how to link to and call C libraries from ECL=
?
> For instance I want to use LDAP from ECL. I've got the openldap librari=
es
> libldap.a and libldap.so.
> Could I load libldap.so dynamically & call functions defined in it? If =
so,
> how?
Currently, there is no way to open a DLL and call arbitrary functions fro=
m it.=20
The only documented way consists on compiling a lisp extension to C, link=
ing=20
this extension with your DLL and loading it.
You can read the section "Embedding C code in lisp source" in the develop=
ers=20
manual (http://ecls.sourceforge.net/ecldev.html). There you find simple w=
ays=20
to define wrappers. The ECL compiler can generate wrappers for functions =
with=20
simple arguments (char, int, float, double). For other types you have to =
make=20
use of DEFCBODY and type the conversion yourself.
I admit that the FFI is an area which requires a lot of improvement :-(
Juanjo
--=20
Max-Planck-Institut fuer Quantenoptik=09+49/089/32905-127
Hans-Kopfermann-Str. 1, D-85748=09=09www.arrakis.es/~worm
Garching b. Muenchen, Germany=09=09worm@...
|