Am 09.08.17 um 16:38 schrieb Ralf Fassel:
Ffidl uses libffi (
https://github.com/libffi/libffi) to call functions
in a shared library via the C ABI. And most if not all of these
functions expect char* arrays with raw bytes, or pointers to structs, or
numeric base types,...
There is some documentation for Ffidl on the wiki here:
http://wiki.tcl.tk/1197, including a link to the old official version
with its documentation. Current development apparently takes place on
github, with a version that works on 8.6, but the old original
documentation is still valid.
> "string length" on the TCL data, does that take encodings into account
> when passing non-ASCII data to the C level?
On binary data I think it makes no difference. With Tcl strings and
encodings it might have an influence whether you use [string bytelen] or
[string len] for that hmac function. But I haven't tested that.
The HMAC function expects char* arrays and their length. Thats why I
made the [binary format] before the call, to make sure it is really a
char array and not a Tcl string (there are subtle errors when passing
Tcl strings to Ffidl hooked functions instead of byte arrays, when byte
arrays are expected).
--
EL