| tcc_enum | R Documentation |
Generate R-callable helpers for enum constants and type conversions. The enum must be defined in a header.
tcc_enum(ffi, name, constants = NULL, export_constants = FALSE)
ffi |
A tcc_ffi object |
name |
Enum name (as defined in C header) |
constants |
Character vector of constant names to export |
export_constants |
Whether to export enum constants as R functions |
Updated tcc_ffi object
## Not run:
ffi <- tcc_ffi() |>
tcc_header("#include <errors.h>") |>
tcc_enum("error_code", constants = c("OK", "ERROR"), export_constants = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.