Skip to content

Commit 57ab040

Browse files
committed
Adding document for boolean
1 parent 0de0495 commit 57ab040

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

129131
Above types are all variable except `callback`. Callback is a procedure
130132
which is called from foreign world to Scheme world. Thus it may need to
131133
have 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

135145
C'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_.
247258
In other words, it doesn't have to be meaningful name as long as _getter_

0 commit comments

Comments
 (0)