% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/callbacks.R
\name{tcc_callback_ptr}
\alias{tcc_callback_ptr}
\title{Get the C-compatible function pointer}
\usage{
tcc_callback_ptr(callback)
}
\arguments{
\item{callback}{A tcc_callback object}
}
\value{
An external pointer (address of the callback token)
}
\description{
Returns an external pointer that can be passed to compiled C code
as user data for trampolines. Keep this handle (and the original
\code{tcc_callback}) alive for as long as C may call back.
The pointer handle keeps the underlying token storage alive until it is
garbage collected. Closing the original callback still invalidates the
callback registry entry, so C must not continue invoking it after
\code{tcc_callback_close()}.
}
\details{
Pointer arguments and return values are treated as external pointers.
Use \code{tcc_read_bytes()}, \code{tcc_read_u8()}, or \code{tcc_read_f64()}
to inspect pointed data when needed.
}
