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

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

\item{accessors}{Named list of field accessors where
names are field names and values are FFI types (e.g., list(x="f64", y="f64")).
Named nested struct fields can use \code{"struct:<name>"} to generate borrowed
nested-view getters and copy-in setters (for example \code{child = "struct:child"}).}
}
\value{
Updated tcc_ffi object
}
\description{
Generate R-callable helpers for struct allocation, field access,
and pointer management. The struct must be defined in a header.
}
\examples{
\dontrun{
ffi <- tcc_ffi() |>
  tcc_header("#include <point.h>") |>
  tcc_struct("point", list(x = "f64", y = "f64", id = "i32"))
}
}
