@@ -18,6 +18,7 @@ PFFI is a portable foreign function interface for R6RS Scheme implementations.
1818** New features**
1919
2020- ` define-type-alias ` is introduced, similar usage as ` typedef ` in C.
21+ - ` boolean ` support for Scheme boolean.
2122
2223## Example
2324
@@ -123,13 +124,22 @@ the difference. Currently following types are supported.
123124- ` int64_t `
124125- ` uint64_t `
125126- ` pointer `
127+ - ` boolean `
126128- ` void `
127129- ` callback `
128130
129131Above types are all variable except ` callback ` . Callback is a procedure
130132which is called from foreign world to Scheme world. Thus it may need to
131133have foreign types.
132134
135+ #### Foreign type size
136+
137+ The foreign type size can be retrieved from the variable, whose name
138+ is ` size-of-{type} ` , e.g. ` size-of-char ` , except ` void ` and ` callback ` .
139+
140+ NOTE: ` size-of-boolean ` may differs depending on the implementation.
141+ It can be either, 1 or 4.
142+
133143#### Variadic arguments
134144
135145C's variadic arguments (i.e. argument specified by ` ... ` ) can be written by
@@ -241,7 +251,8 @@ _field spec_ can be one the followings:
241251- (` fields ` (_ type_ _ field_ _ getter_ ))
242252- (` fields ` (_ type_ _ field_ _ getter_ _ setter_ ))
243253
244- _ type_ must be a type listed in _ Foreign types_ section except ` callback ` .
254+ _ type_ must be a type listed in _ Foreign types_ section except ` callback ` ,
255+ or ` (struct _struct-name_) ` for foreigin struct.
245256
246257_ field_ is the field name. This is used for generating _ getter_ and _ setter_ .
247258In other words, it doesn't have to be meaningful name as long as _ getter_
0 commit comments