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

Mac Allegro CL with Think C ?



   Date: Fri, 08 Jun 90 13:55:45 +0900
   From: Yasuaki Honda <honda@csl.sony.co.jp>

   Does anyone know how to write foreign functions using Think C4.0? The
   manual of MACL assumes MPW environment, which I don't use for my C
   program development.

This can be done, but to a limited extent.  It is not as flexible as
using MPW.

Because the MPW object file format is public, we can write a linker
for it.  This takes a bunch of MPW object files, links them together,
loads them into memory, and records the entry points in a map.  You
can then associate Lisp functions with the entry points.

Most of this can't be done with Think C, because their object file
format is proprietary.  All you can do is compile code to a code
resource, and load the resource (with _GetResource).  Then you have
a single entry point.  I believe this will be the first address
in the code resource, and will correspond to the first function from
your source code file.  You can call this entry point with FF-CALL.

What you probably want to do is make the first function in your C
file a dispatcher, which calls the other functions in the file.

Hope this helps.

    -andrew