From ead2fccdbb18190e466bd4b23844d72b6966f179 Mon Sep 17 00:00:00 2001 From: Thierry Marianne Date: Thu, 5 Mar 2026 09:02:59 +0100 Subject: [PATCH] add documentation Signed-off-by: Thierry Marianne --- src/lib/ffi.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/ffi.pl b/src/lib/ffi.pl index 78545094..e3128010 100644 --- a/src/lib/ffi.pl +++ b/src/lib/ffi.pl @@ -68,6 +68,11 @@ ffi:FUNCTION_NAME(+InputArg1, ..., +InputArgN). % for void and bool - When using `cstr` as an argument type the string will be deallocated once the function returns. - When using `cstr` as a return type the string will be copied and won't be deallocated. +- When an ffi function returns bytes that are not a valid utf8-string the bytes will be turned into a list of `codes` (integers) + instead of a string (list of `chars`). Note: passing a list of `codes` is not accepted in argument position. +- In argument position you can also pass a pointer directly instead of a string, + e.g. to pass a null-pointer one can provide the integer 0 as the argument. +- In return position a null-pointer will be returned as the integer 0 ## Example -- 2.54.0