R/ptr.R

Defines functions .rxode2llPtr

Documented in .rxode2llPtr

#' External pointers to rxode2ll's log-likelihood functions
#'
#' Hands a consumer package the addresses of every `rxLlik*` function and its
#' exact derivatives, so it can call them from C/C++ without an ABI dependency
#' on this package.
#'
#' `R_GetCCallable()` is not sufficient for that.  It drops the link-time
#' dependency, but the consumer still compiles in a typedef'd signature and
#' caches a raw address: updating rxode2ll then requires the consumer to be
#' rebuilt, and reloading rxode2ll leaves the cached pointers dangling.  This is
#' the same external-pointer handshake rxode2, nlmixr2est, RcppTrust and n1qn1
#' already use, where the consumer re-reads the list in its own `.onLoad()` and
#' therefore picks up an updated rxode2ll instead of baking one in.
#'
#' The returned list is APPEND-ONLY and its order is fixed; see
#' `inst/include/rxode2llPtrs.h`, which is the matching consumer header.
#'
#' @return list of external pointers, in the order documented in
#'   `rxode2llPtrs.h`
#' @export
#' @examples
#' length(.rxode2llPtr())
.rxode2llPtr <- function() {
  .Call(`_rxode2ll_ptr`)
}

Try the rxode2ll package in your browser

Any scripts or data that you put into this service are public.

rxode2ll documentation built on Sept. 15, 2026, 5:10 p.m.