Trying to verify this guide "https://mongoose-os.com/docs/mongoose-os/quickstart/develop-in-js.md" by create a C function that takes 3 char arguments and return an double.
I implement in src/main.c
double threectoi(char a, char b, char c);
and in fs/init.js
let f = ffi('double threectoi(char,char,char)');
when building I get 'MJS error: bad ffi signature: "double threectoi( char,char,char)" : failed to parse val type "char" '
I have tried to modify function to take int arguments instead of char, but then it gives me this error: failed to call FFIed function: actual arg#2 is not an int (the type idx is : string) : actual arg#1 is not an int (the type idx is : string) : actual arg#0 is not an int (the type idx is : string)
the three arguments are single bytes from a JSON char string.
Can ffi only handle double and int arguments? Or what have I missed?