File tree Expand file tree Collapse file tree 4 files changed +45
-19
lines changed
Expand file tree Collapse file tree 4 files changed +45
-19
lines changed Original file line number Diff line number Diff line change @@ -3,26 +3,9 @@ R6RS Portable Foreign Function Interface
33
44PFFI is a portable foreign function interface for R6RS Scheme implementations.
55
6- ## Changes
6+ ## Release notes
77
8- ### version 25.05.16
9-
10- ** Breaking changes**
11-
12- - Using ftype for ` define-foreign-struct ` and ` define-foreign-union ` on Chez
13- This means, ` alignment ` keyword doesn't work on Chez.
14- - Introducing ` struct ` keyword on struct member to distinguish primitive
15- and struct.
16- - Foreign types are now wrapped or ftype (on Chez), instead of symbols.
17-
18- ** New features**
19-
20- - ` define-type-alias ` is introduced, similar usage as ` typedef ` in C.
21- - ` boolean ` support for Scheme boolean.
22- - Supporting array foreign variable.
23- - Supporting ` (* type) ` pointer form for foreign variable.
24- - Empty struct, i.e. ` (define-foreign-struct foo) ` , is supported
25- - Supporting ` wchar_t ` as Scheme character.
8+ See [ ReleasNotes] ( ./ReleaseNotes.md )
269
2710## Example
2811
Original file line number Diff line number Diff line change 1+ ### version x.x.x (future release)
2+
3+
4+ ### version 25.05.16
5+
6+ ** Breaking changes**
7+
8+ - Using ftype for ` define-foreign-struct ` and ` define-foreign-union ` on Chez
9+ This means, ` alignment ` keyword doesn't work on Chez.
10+ - Introducing ` struct ` keyword on struct member to distinguish primitive
11+ and struct.
12+ - Foreign types are now wrapped or ftype (on Chez), instead of symbols.
13+
14+ ** New features**
15+
16+ - ` define-type-alias ` is introduced, similar usage as ` typedef ` in C.
17+ - ` boolean ` support for Scheme boolean.
18+ - Supporting array foreign variable.
19+ - Supporting ` (* type) ` pointer form for foreign variable.
20+ - Empty struct, i.e. ` (define-foreign-struct foo) ` , is supported
21+ - Supporting ` wchar_t ` as Scheme character.
Original file line number Diff line number Diff line change @@ -148,5 +148,15 @@ wchar_t wcallback(wchar_t wc, wchar_t (* proc)(wchar_t))
148148 return proc (wc );
149149}
150150
151+ char * str_cb (char * st , char * (* cb )(char * ))
152+ {
153+ return cb (st );
154+ }
155+
156+ wchar_t * wstr_cb (wchar_t * st , wchar_t * (* cb )(wchar_t * ))
157+ {
158+ return cb (st );
159+ }
160+
151161
152162/* TODO more */
Original file line number Diff line number Diff line change 411411 (lambda (wc ) (char-upcase wc)))))
412412 (test-equal " wcallback" #\A (wcallback #\a callback))))
413413
414+ ; ; (define-syntax test-string-argument
415+ ; ; (syntax-rules ()
416+ ; ; ((_ type name)
417+ ; ; (let ()
418+ ; ; (define proc
419+ ; ; (foreign-procedure test-lib type name (type (callback type (type)))))
420+ ; ; (define cb (c-callback type (type) string-upcase))
421+ ; ; (test-equal "AA" (proc "aa" cb))))))
422+ ; ; ;; char*
423+ ; ; (test-string-argument char* str_cb)
424+ ; ; (test-string-argument wchar* wstr_cb)
425+
414426(test-end)
You can’t perform that action at this time.
0 commit comments