Thread View: comp.emacs
1 messages
1 total messages
Started by Eric Hoffman
Fri, 29 Jan 1993 00:34
Adding C source to 18.59
Author: Eric Hoffman
Date: Fri, 29 Jan 1993 00:34
Date: Fri, 29 Jan 1993 00:34
31 lines
1332 bytes
1332 bytes
I've been having difficulty adding C code to emacs (18.59). Any attempt
to use a function that I have written, even if it is exactly the same
as an emacs internal, results in a segv and trashing of the stack
if I try to execute it. I am unable to use gdb because of the
stack-trashing feature, and I suspect that it has more to do with
the loading and dumping of the executable image, rather than
the function that I copied verbatim from data.c.
Is there a special procedure required to link new C into emacs? Is
there a programming guide which explains extending emacs from the
C side?
What follows is my attempt to re-implement "int-to-string":
#include "lisp.h"
DEFUN ("bar", Fbar, Sbar, 1, 1, 0,"test")(obj)
register Lisp_Object obj;
{
char buffer[20];
CHECK_NUMBER (obj, 0);
sprintf (buffer, "%d", XINT (obj));
return build_string (buffer);
}
syms_of_bar ()
{
defsubr (&Sbar);
}
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads