|
infix
A JIT-Powered FFI Library for C
|
Cookbook Chapter 2: Working with Enums. More...
Enumerations | |
| enum | StatusCode { STATUS_OK = 0 , STATUS_WARN = 1 , STATUS_ERR = -1 } |
Functions | |
| static const char * | status_to_string (StatusCode code) |
| int | main () |
Cookbook Chapter 2: Working with Enums.
This example shows how to handle C enum types. For the purpose of an FFI call, an enum behaves identically to its underlying integer type (which is int by default, unless specified otherwise).
The infix signature e:<type> is used to represent an enum. This makes the signature more descriptive, but for ABI purposes, it is treated exactly like its underlying <type>.
| enum StatusCode |
| int main | ( | void | ) |
|
static |