FFI Interface for STk under Windows/NT

From: David McClain <Dave_McClain_at_msn.com>
Date: Fri, 13 Jun 97 16:15:34 UT

To all interested parties,

I have a very simple but effective foreign function interface (FFI) for STk
that works with Windows/NT DLL's. It is roughly patterned after that found in
Allegro CL. It consists of one C module and one .stk interface file for the
high level interface. Using it I have successfully deployed an STk application
as an RPC client to a math/rendering server in our workstation environment.
This code can be made available for free. Snippet below gives an example of
how to use it...

        (defun-dll beep ((freqHz :long) (durms :long))
                :return-type :void
                :entry-name "Beep"
                :library-name "kernel32"
                :interface :winapi)

        (define (dyoop)
                (beep 3000 100)
                (beep 2000 200)
                (beep 1000 100)
                (beep 500 100))

The interface handles up to 16 arguments to the DLL routine consisting of any
mix of long, float, double, pointer, string types, and can return any one of
these data types. Pointer types must be used for call by reference. (The
Allegro interface cannot return doubles or strings - but mine can!). Interface
calling conventions supported are standard C, WINAPI, and argc/argv C styles.

David McClain,
Sr. Scientist
Hughes Missile Systems Co.
Tucson, AZ
Received on Fri Jun 13 1997 - 20:03:03 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST