From 331d060956a4b19fab3a88601e94e571a7fa07e4 Mon Sep 17 00:00:00 2001 From: dzaima Date: Sat, 8 Oct 2022 19:55:36 +0300 Subject: [PATCH] =?UTF-8?q?update=20docs=20of=20=E2=80=A2FFI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/system.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/system.md b/docs/system.md index 6cf449bf..b55ec4cc 100644 --- a/docs/system.md +++ b/docs/system.md @@ -112,6 +112,11 @@ Namespace of various internal functions. May change at any time. # FFI -Currently, there is no support for structs, nested pointers, or constant-length arrays, aka the only supported types are scalars (e.g. `i8`, `u64`), pointers to those (e.g. `*i8`, `&u64`), and conversions of either those or opaque pointers (e.g. `u64:i32`, `*i64:i32`, `**:c8`). +Currently, there is no support for nested pointers or constant-length arrays, and limited support of structs. -The `a` type maps to `BQNV` from [bqnffi.h](../include/bqnffi.h) (example usage in [FFI tests](../test/ffi/)). \ No newline at end of file +That is, the supported types are: +- scalars (e.g. `i8`, `u64`); +- pointers to scalars (e.g. `*i8`, `&u64`); +- conversions of either scalars, pointers to scalars, or opaque pointers (e.g. `u64:i32`, `*i64:i32`, `*:i8`, `**:c8`); +- structs of any of the above (except `&`-pointers) or other structs (e.g. `{*i8,*{*u32:i8,u64:i32}}`), except structs that are within `&` themselves cannot contain any pointers other than converted opaque pointers (e.g. `*{*i32,u64}`, `&{*:i32,u64}`, and `&{i32,u64}` are fine, but `&{*i32,u64}` is not); +- the `a` type, which maps to `BQNV` from [bqnffi.h](../include/bqnffi.h) (example usage in [FFI tests](../test/ffi/)).