Add section describing cfn function

This commit is contained in:
Joshua Suskalo 2021-09-25 09:31:57 -05:00
parent ba7b5bc4aa
commit 739092ade6

View file

@ -43,6 +43,14 @@ native function reference, followed by an optional docstring and attribute map,
then the C function identifier, including the name of the native symbol, a
vector of argument types, and the return type.
If you wish to use a native function as an anonymous function, it can be done
with the `cfn` function.
```clojure
((ffi/cfn "strlen" [::ffi/c-string] ::ffi/long) "hello")
;; => 5
```
### Primitive Types
Coffi defines a basic set of primitive types:
- byte