pub unsafe fn package_init(dll: *mut DllInfo, pkg_name: &CStr)Expand description
Initialize a miniextendr R package.
This performs all initialization steps in the correct order:
- Record main thread ID
- Enter R unwind protection and install the panic hook
- Set ALTREP package name
- Register mx_abi C-callables for cross-package trait dispatch
- Register all
#[miniextendr]routines and ALTREP classes - Lock down dynamic symbols
The package loads in any locale: string conversions translate per string
(from_r::try_charsxp_to_str).
§Safety
Must be called from R’s main thread during R_init_*.
dll must be a valid pointer provided by R.
pkg_name must be a valid null-terminated C string that lives for the
duration of the R session (typically a string literal).