[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Mac Allegro CL with Think C ?
- To: firstname.lastname@example.org
- Subject: Mac Allegro CL with Think C ?
- From: email@example.com (Andrew L. M. Shalit)
- Date: Mon, 11 Jun 90 11:58:49 -0400
- Cc: info-macl
- In-reply-to: Yasuaki Honda's message of Fri, 08 Jun 90 13:55:45 +0900 <9006080455.AA07860@lyra.csl.sony.co.jp>
Date: Fri, 08 Jun 90 13:55:45 +0900
From: Yasuaki Honda <firstname.lastname@example.org>
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
This can be done, but to a limited extent. It is not as flexible as
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.