Re: s48_extract_string?

Michael Sperber <[email protected]>
Newsgroups gmane.lisp.scheme.scheme48
Message-ID <[email protected]>
Taylor R Campbell <[email protected]> writes:

>    Error: vm-exception
>           os-error
>           (call-external-value "shared_object_dlopen"
>    "/home/dca/Scheme48/test.so: undefined symbol: s48_extract_string")
>
>    If I substitute a call in the C code to, say, s48_extract_byte_vector,
>    then load-dynamic-externals is happy.
>
> The documentation appears to be outdated.  Since Scheme48 1.5 or so,
> when R6RSoid support for Unicode was introduced, s48_extract_string
> has been no more.  Instead you must use `OS strings' on the Scheme
> side and translate them to byte vectors for C use.

Actually, you don't.  Taylor is right that s48_extract_string doesn't
exist anymore because of Unicode support.  However, the FFI has various
functions for extracting C strings from Scheme strings in different
encodings.  You might want s48_copy_string_to_latin_1() or
s48_copy_string_to_utf_8().  These are documented here:

http://www.s48.org/1.8/manual/manual-Z-H-9.html#node_sec_8.5.2

("OS strings" are specifically for OS functions that accept byte
sequences commonly regarded as strings, such as filenames.)

Note that Scheme 48 is moving to a different kind of FFI, which has been
implemented in the development branch.  (Look under "Development" on the
home page.)  If you're writing new code, you might consider using this.

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.