diff --git a/README.md b/README.md index da858b9..883f751 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ --- title: foreign-c a portable foreign function interface for R7RS + version: 0.10.0 --- diff --git a/documentation/foreign-c.html b/documentation/foreign-c.html index c9acd1c..4574eaf 100644 --- a/documentation/foreign-c.html +++ b/documentation/foreign-c.html @@ -2,7 +2,7 @@
-(foreign c) is a C foreign function interface (FFI) library - for R7RS. It is portable in the sense that it supports multiple +
foreign-c is a C foreign function interface (FFI) library for + R7RS. It is portable in the sense that it supports multiple implementations, as opposed to being portable by conforming to some specification.
-The new readme is a work in progress.
+ + + +Either download the latest release from releases - page or git clone , preferably with a tag, and copy the - “foreign” directory to your library directory.
+ href="https://git.sr.ht/~retropikzel/foreign-c/refs">https://git.sr.ht/~retropikzel/foreign-c/refs + or git clone , preferably with a tag, and copy the “foreign” + directory to your library directory.As an example assuming you have a project and your libraries live in directory called snow in it:
git clone https://git.sr.ht/~retropikzel/foreign-c --branch LATEST_VERSION
@@ -317,10 +324,56 @@ make -C snow/foreign/c <SCHEME_IMPLEMENTATION_NAME>
(c-type-size type)
Returns the size of given C type.
(define-c-library scheme-name - headers object-name options) - define-c-procedure define-c-callback c-bytevector? - c-bytevector-u8-set! c-bytevector-u8-ref - c-bytevector-pointer-set! c-bytevector-pointer-ref
+ headers object-name options) +Takes a scheme-name to bind the library to, list of C headers + as strings, shared-object name and options.
+The C header strings should not contain “<” or “>”, + they are added automatically.
+The name of the shared object should not contain suffix like + .so or .dll. Nor should it contain any prefix like “lib”.
+The options are:
+Example:
+(cond-expand
+ (windows (define-c-library libc-stdlib
+ '("stdlib.h")
+ "ucrtbase"
+ '((additional-versions ("0" "6"))
+ (additiona-paths (".")))))
+ (else (define-c-library libc-stdlib
+ (list "stdlib.h")
+ "c"
+ '((additional-versions ("0" "6"))
+ (additiona-paths ("."))))))
+ make-c-bytevector make-c-null c-null? c-free native-endianness c-bytevector-s8-set! c-bytevector-s8-ref diff --git a/documentation/foreign-c.pdf b/documentation/foreign-c.pdf index 0c7ab47..41d8d83 100644 Binary files a/documentation/foreign-c.pdf and b/documentation/foreign-c.pdf differ