% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ffi.R
\name{tcc_container_of}
\alias{tcc_container_of}
\title{Generate container_of helper for struct member}
\usage{
tcc_container_of(ffi, struct_name, member_name)
}
\arguments{
\item{ffi}{A tcc_ffi object}

\item{struct_name}{Struct name}

\item{member_name}{Member field name to compute offset from}
}
\value{
Updated tcc_ffi object
}
\description{
Creates a function that recovers the parent struct pointer from
a pointer to one of its members. This is the classic Linux kernel
container_of macro made accessible from R.
}
\examples{
\dontrun{
ffi <- tcc_ffi() |>
  tcc_struct("student", list(id = "i32", marks = "i32")) |>
  tcc_container_of("student", "marks") # Creates struct_student_from_marks()
}
}
