gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gcl-devel] c/c++ binding


From: Camm Maguire
Subject: Re: [Gcl-devel] c/c++ binding
Date: 23 Mar 2004 13:45:09 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings!  This is somewhat hard.  Something like:

1) token=make_symple_string("MY_PACKAGE");
2) p=find_package(token);
3) token=make_simple_string("MY_FUNCTION");
4) s=find_symbol(token,p);

The procedure then varies depending on what the type of the function
is.  GCL has 4 compiled function types -- the function could also be
interpreted.  In brief, call_proc_new in funlink.c should give you the
idea. In the most optimal case, the function pointer is in
s->s.s_gfdef->sfn.sfn_self.  There are a variety of ways to get at the
number of arguments and their types, but again the most optimal is via
the macro SFUN_ARGS() when the function is of type sfun.  One can then
call the function just as in C.  In the least optimal compiled case,
one must push the arguments to the lisp stack with vs_push, and then
funcall(s->s.s_gfdef).

The value of global variables are accessed by their naming symbols as
in 1-4 above.  The object value is then in s->s.s_dbind.

Take care,


"Jonathan Hudson" <address@hidden> writes:

> How do I call lisp code compiled by gcl from c/c++ (using gcc)?
> How do I access global variables defined in the lisp code?
> 
> -- Jonathan 
> 
> -- 
> http://www.fastmail.fm - I mean, what is it about a decent email service?
> 
> 
> _______________________________________________
> Gcl-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/gcl-devel
> 
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

[Prev in Thread] Current Thread [Next in Thread]