Skip to main content

miniextendr_write_wrappers

Function miniextendr_write_wrappers 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn miniextendr_write_wrappers( path_sexp: SEXP, ) -> SEXP
Expand description

C-callable entry point for R wrapper generation.

Called from Makevars via Rscript: loads the installed shared object with dyn.load(), then .Call("miniextendr_write_wrappers", c(path, r_dir)) to write R/miniextendr-wrappers.R. NAMESPACE generation is left to roxygen2 (devtools::document()).

The second element, the package’s R/ directory, is optional: without it, or when it is NA or empty, the hand-written R files are not checked (write_r_wrappers_to_file). It is an element and not a second argument so the routine keeps one argument: R refuses a .Call whose argument count differs from the registered one, and a package’s tools/write-wrappers.R can be older or newer than its miniextendr-api.

A panic, such as a name collision found while assembling the wrappers, is raised as an R error, so the install stops with the message instead of aborting R at this non-unwinding boundary.

§Safety

path_sexp must be a valid STRSXP of length >= 1.