% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ffi.R
\name{tcc_enum}
\alias{tcc_enum}
\title{Declare enum for FFI helper generation}
\usage{
tcc_enum(ffi, name, constants = NULL, export_constants = FALSE)
}
\arguments{
\item{ffi}{A tcc_ffi object}

\item{name}{Enum name (as defined in C header)}

\item{constants}{Character vector of constant names to export}

\item{export_constants}{Whether to export enum constants as R functions}
}
\value{
Updated tcc_ffi object
}
\description{
Generate R-callable helpers for enum constants and type conversions.
The enum must be defined in a header.
}
\examples{
\dontrun{
ffi <- tcc_ffi() |>
  tcc_header("#include <errors.h>") |>
  tcc_enum("error_code", constants = c("OK", "ERROR"), export_constants = TRUE)
}
}
