From: "jeff (j.d.) sparkes" <jsparkes@bnr.ca>
To: caml-list@margaux.inria.fr
Subject: building stubs and modules from ANSI C include files
Date: Tue, 19 Sep 1995 11:03:00 -0400 [thread overview]
Message-ID: <"24806 Tue Sep 19 11:05:34 1995"@bnr.ca> (raw)
I've been thinking about the problem of interfacing to external C
libraries.
The tkcompiler program in camltk4 is very good start, but it's not
that general.
It seems that the "external" keyword in CSL gives most of the
information about how to call a C function. It should be possible to
build the stub routines from a module description.
And it should be possible to build a module description from an ANSI C
include file which gives the types of all of the arguments.
What's missing? Off the top of my head... please feel free to
contribute more...
- no way to say that returned memory needs to be freed
- how to raise exceptions, and which ones...
- descriptions of C structures that are returned or passed in
- currently no interface to dlopen if it exists. Easy to add on
Solaris, at least.
A useful experiment would be to try and generate the current libunix
and libstr just from include files. I'll try to take a look at what
would be needed.
I got started thinking about this because I wanted DLL support on
windows. Since I know nothing about windows, I thought about how I'd
do this on unix. Once its done there, maybe we can transfer the interface.
--
Jeff Sparkes
jsparkes@bnr.ca Bell-Northern Research, Ottawa, Ontario, Canada
next reply other threads:[~1995-09-19 15:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-09-19 15:03 jeff (j.d.) sparkes [this message]
1995-09-20 12:12 ` Xavier Leroy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='"24806 Tue Sep 19 11:05:34 1995"@bnr.ca' \
--to=jsparkes@bnr.ca \
--cc=caml-list@margaux.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox