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

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

\item{members}{Named list of union members with FFI types}

\item{active}{Default active member for accessors}
}
\value{
Updated tcc_ffi object
}
\description{
Generate R-callable helpers for union allocation and member access.
The union must be defined in a header.
}
\examples{
\dontrun{
ffi <- tcc_ffi() |>
  tcc_union("data_variant",
    members = list(as_int = "i32", as_float = "f32"),
    active = "as_int"
  )
}
}
