Hello again everyone.
Attached is a small tar file with a patch and a new dll.c, a header file
and a sample DLL module. This is very raw right now, so you will need to
do a bit of work to get this working. Extract in src. Apply the patch,
rebuild. You will need to edit the makefile and add "-Wl,-Bexport" to the
linker flags pretty early on ... preferably by making LD=gcc -Wl,-Bexport.
Then, compile the sample file with a syntax similar to:
gcc -I. -Demacs -fPIC -shared -o sample.so sample.c
The run xeamcs, and do M-x dll-load and load sample.so. You can omit the .so
when running dll-load.
The new code in dll.c works for adding variables *AND* subrs, complete with
documentation strings. The syntax is remarkably similar to all other emacs
code, as you will see. Doing things this way means we dont have to futz
about with .el's that add doc strings and load .so's ... it can all happen
in one place. cemacs.h contains a lot of stuff from lisp.h and symeval.h,
as customized for the purposes of making .so's. The difference will be
immediately obvious. There is a better way of doing this, but that would
require changes to lisp.h and symeval.h, as well as make-doc and every single
DEFUN in all of the C code. This, I felt, was too intrusive for some
proof-of-concept code.
I would like someone of suitable internal knowledge to look at dll.c and
see if I am doing everything correctly. I believe I am but some confirmation
will make me feel more warm and fuzy about all of this.
You will notice in the sample that the name "cemacs" still stands ... that
was what I called my original work. The symbol names for the module name,
version and description can change easily ... these are just ideas.
Any other comments (good or bad) are welcome. Hope this helps things along
somewhat.
--
J. Kean Johnston | "Truth and beauty, beauty and truth. This is all we know,
Engineer, SPG | and all we need ever know." -- John Keats, Endymion
Santa Cruz, CA +----------------------------------------------------------
Tel: 408-427-7569 Fax: 408-429-1887 E-mail: jkj(a)sco.com
Show replies by date