diff --git a/Makefile b/Makefile
index f284aed..f391e89 100644
--- a/Makefile
+++ b/Makefile
@@ -124,6 +124,9 @@ MOSH=mosh --loadpath=.
test-mosh-podman-amd64: libtest.so
podman run --arch=amd64 -it -v ${PWD}:/workdir docker.io/schemers/mosh:0 bash -c "cd /workdir && ${MOSH} test.scm"
+test-mosh-docker: libtest.so
+ docker run -it -v ${PWD}:/workdir docker.io/schemers/mosh:0 bash -c "cd /workdir && ${MOSH} test.scm"
+
test-mosh: libtest.so
${MOSH} test.scm
diff --git a/README.md b/README.md
index 0b4a5b0..4c1a148 100644
--- a/README.md
+++ b/README.md
@@ -36,8 +36,29 @@ guarantees are being made just yet.
## Implementation table
-| | Chibi | Chicken 5 | Cyclone | Gambit | Gauche | Gerbil | Guile | Kawa | Larceny | Mosh | Racket | Sagittarius | Skint | STklos | tr7 | Ypsilon |
-| ------------------------------- | ----- | --------- | ------- | ------- | ------ | ------ | ----- | ---- | ------- | ---- | ------ | ----------- | ----- | ------ | --- | ------- |
+
+
+ | Chibi |
+ Chicken 5 |
+ Cyclone |
+ Gambit |
+ Gauhe |
+ Gerbil |
+ Guile |
+ Kawa |
+ Larceny |
+ Mosh |
+ Racket |
+ Sagittarius |
+ Skint |
+ STklos |
+ tr7 |
+ Ypsilon |
+
+
+
+
+
| pffi-init | X | X | X | X | X | X | X | X | X | X | X | X | X | X | | |
| pffi-size-of | X | X | X | X | | | X | X | | X | X | X | | X | | |
| pffi-shared-object-auto-load | X | X | X | | | | X | X | | X | X | X | | X | | |
@@ -51,6 +72,7 @@ guarantees are being made just yet.
| pffi-pointer-get | X | X | X | | | | X | X | | X | X | X | | | | |
| pffi-string->pointer | X | X | X | | | | X | X | | X | X | X | | | | |
| pffi-pointer->string | X | X | X | | | | X | X | | X | X | X | | | | |
+| pffi-struct-make |
| pffi-define | X | X | X | | | | X | X | | X | X | X | | | | |
| pffi-define-callback | | X | | | | | X | | | X | X | X | | | | |
| pffi-pointer-address | | X | | | | | X | | | | X | X | | | | |
diff --git a/retropikzel/r7rs-pffi.sld b/retropikzel/r7rs-pffi.sld
index 35de5f7..ab0f3ac 100644
--- a/retropikzel/r7rs-pffi.sld
+++ b/retropikzel/r7rs-pffi.sld
@@ -561,7 +561,6 @@
;pffi-pointer-dereference
))
(else (error "Unsupported implementation")))
- (include "r7rs-pffi/struct.scm")
(cond-expand
(chibi (include "r7rs-pffi/chibi.scm"))
(chicken5 (include "r7rs-pffi/chicken.scm"))
@@ -581,4 +580,5 @@
(tr7 (include "r7rs-pffi/tr7.scm"))
(ypsilon (include "r7rs-pffi/ypsilon.scm"))
(else #t))
+ (include "r7rs-pffi/struct.scm")
(include "r7rs-pffi/main.scm"))
diff --git a/retropikzel/r7rs-pffi/mosh.scm b/retropikzel/r7rs-pffi/mosh.scm
index 3beeff4..b2774f2 100644
--- a/retropikzel/r7rs-pffi/mosh.scm
+++ b/retropikzel/r7rs-pffi/mosh.scm
@@ -2,16 +2,16 @@
(define pffi-size-of
(lambda (type)
- (cond ((eq? type 'int8) 1) ; FIXME
- ((eq? type 'uint8) 1) ; FIXME
- ((eq? type 'int16) 2) ; FIXME
- ((eq? type 'uint16) 2) ;FIXME
- ((eq? type 'int32) 4) ; FIXME
- ((eq? type 'uint32) 4) ; FIXME
- ((eq? type 'int64) 8) ; FIXME
- ((eq? type 'uint64) 8) ; FIXME
- ((eq? type 'char) size-of-bool)
- ((eq? type 'unsigned-char) size-of-bool)
+ (cond ((eq? type 'int8) 1)
+ ((eq? type 'uint8) 1)
+ ((eq? type 'int16) 2)
+ ((eq? type 'uint16) 2)
+ ((eq? type 'int32) 4)
+ ((eq? type 'uint32) 4)
+ ((eq? type 'int64) 8)
+ ((eq? type 'uint64) 8)
+ ((eq? type 'char) 1)
+ ((eq? type 'unsigned-char) 1)
((eq? type 'short) size-of-short)
((eq? type 'unsigned-short) size-of-unsigned-short)
((eq? type 'int) size-of-int)
@@ -59,11 +59,11 @@
((equal? type 'uint64) (pointer-set-c-uint64! pointer offset value))
((equal? type 'char) (pointer-set-c-char! pointer offset (char->integer value)))
((equal? type 'short) (pointer-set-c-short! pointer offset value))
- ((equal? type 'unsigned-short) (pointer-set-c-short! pointer offset value)) ;; FIXME
+ ((equal? type 'unsigned-short) (pointer-set-c-short! pointer offset value))
((equal? type 'int) (pointer-set-c-int! pointer offset value))
- ((equal? type 'unsigned-int) (pointer-set-c-int! pointer offset value)) ;; FIXME
+ ((equal? type 'unsigned-int) (pointer-set-c-int! pointer offset value))
((equal? type 'long) (pointer-set-c-long! pointer offset value))
- ((equal? type 'unsigned-long) (pointer-set-c-long! pointer offset value)) ;; FIXME
+ ((equal? type 'unsigned-long) (pointer-set-c-long! pointer offset value))
((equal? type 'float) (pointer-set-c-float! pointer offset value))
((equal? type 'double) (pointer-set-c-double! pointer offset value))
((equal? type 'void) (pointer-set-c-pointer! pointer offset value))
@@ -100,6 +100,7 @@
(pffi-pointer-set! pointer 'char (* index (pffi-size-of 'char)) c)
(set! index (+ index 1)))
string-content)
+ (pffi-pointer-set! pointer 'char (* index (pffi-size-of 'char)) #\null)
pointer)))
(define pffi-pointer->string
diff --git a/retropikzel/r7rs-pffi/struct.scm b/retropikzel/r7rs-pffi/struct.scm
index ab83bf7..f6acb9f 100644
--- a/retropikzel/r7rs-pffi/struct.scm
+++ b/retropikzel/r7rs-pffi/struct.scm
@@ -1,3 +1,4 @@
+
(define-record-type
(struct-make name size pointer members)
pffi-struct?