Supported types

Unifex supports generating code both for usage with NIF's and CNode's. Nevertheless, some types can be not implemented yet. Below we present which types you can use at this moment. You can also refer to #42 to see state of work on remaining types.

NIF

typeas function parameteras return type
atomyesyes
boolyesyes
uintyesyes
uint64yesyes
intyesyes
int64yesyes
floatyesyes
listyesyes
payloadyesyes
pidyesyes
stringyesyes

CNode

typeas function parameteras return type
atomyesyes
boolyesyes
uintyesyes
uint64nono
intyesyes
int64nono
floatyesyes
listyesyes
payloadyesyes
pidyesyes
stringyesyes

Types mapping

List of examples, how specific type in *.spec.exs will be translated onto native side

Elixir typeNative type
atomchar *
boolint
floatdouble
intint
int64int64_t
payloadUnifexPayload
pidUnifexPid
stateUnifexState *
stringchar *
uint64uint64_t
unsignedunsigned int
[int]int *, unsigned int