<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
A related question then:<br>
<br>
Why aren't there variables in mzscheme to be able to<br>
determine the :<br>
<br>
* directory of a module the is being loaded.<br>
* the system library directory<br>
<br>
?<br>
<br>
--Hans<br>
<br>
<br>
Matthew Flatt schreef:
<blockquote cite="mid20060628011040.19E7965007D@mail-svr1.cs.utah.edu"
type="cite">
<pre wrap="">At Tue, 27 Jun 2006 22:17:54 +0200, Hans Oesterholt-Dijkema wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Now I've ported the code to something that can be used with
the FFI, but I still need the "scheme_malloc", "scheme_make_type",
etc. functions.
How can I load these in, [...]?
</pre>
</blockquote>
<pre wrap=""><!---->
Starting with the current SVN code for v350.2, you can access them via
`(ffi-lib #f)'.
For earlier versions, unfortunately, the result of `(ffi-lib #f)' only
searches the exports of the process's .exe, where it finds practically
nothing. Here's old code from "mzssl.ss" (now removed) that finds the
MzScheme DLL:
(require (lib "filename-version.ss" "dynext"))
(define (ffi-lib-xxxxxxx name)
(let* ([f (format "~a~a" name filename-version-part)])
(or (with-handlers ([exn? (lambda (x) #f)])
(ffi-lib (format "~a~a" name filename-version-part)))
         (ffi-lib (format "~axxxxxxx" name)))))
(define 3m? (regexp-match #rx#"3m" (path->bytes (system-library-subpath))))
(define libmz
(case (system-type)
[(windows)
(ffi-lib-xxxxxxx (format "libmzsch~a" (if 3m? "3m" "")))]
[else (ffi-lib #f)]))
Matthew
</pre>
</blockquote>
<br>
</body>
</html>