help with loading call stack
Quote:
> Is there anyway in C or C++ to dynamically push parameters onto the
> call stack. I realize that I could do this in assembly, but if
> something is already available in C then I'm game (and lazy too).
Check out the `ffcall' library, which is described in the
announcement that I have appended below.
WWW: < http://www.*-*-*.com/ ~fjh> | of excellence is a lethal habit"
-------------------------------------------------------
Subject: ffcall-1.0 released
The ffcall-1.0 foreign function call libraries are now available.
This is a collection of three C libraries which can be used to build
foreign function call interfaces in embedded interpreters. The three
packages are:
avcall - calling C functions with variable arguments
This library allows arbitrary C functions to be called from
embedded interpreters, de{*filter*}s, RPC calls, etc, by building up
a C argument-list incrementally from explicitly typed arguments.
This considerably reduces the amount of boilerplate glue code
required for such applications.
vacall - C functions accepting variable argument prototypes
This library allows C functions to be called with variable
arguments and to return variable return values. This is much like
the varargs(3) facility, but also allows the return value to be
specified at run time. A typical use is the implementation of
call-back functions in embedded interpreters.
{*filter*}oline - closures as first-class C functions
This library implements closures as first-class C functions. A
closure consists of a regular C function and a piece of data
which gets passed to the C function when the closure is called.
Typical uses of closures are nested functions in programming
languages, and call-back functions passed to other libraries.
It is free software, distributed under the GNU General Public License.
It supports the following CPUs and platforms: i[345]86 (Linux, SysVR4,
SCO 3.2 v4.2), m68k (NeXTstep 3.2), mips (Irix 4.0, Irix 5.2), sparc
(SunOS 4, Solaris 2.3), alpha (OSF/1 3.0), hppa (HP-UX 8.0), rs6000
(AIX 3.2.5), and is prepared to support more CPUs (arm, m88k, convex).
You can get it via anonymous ftp from:
ma2s2.mathematik.uni-karlsruhe.de [129.13.115.2]
/pub/gnu/ffcall-1.0.tar.gz
Enjoy!
Bruno Haible