Skip to content
Prev 8384 / 63421 Next

Calling function with proto in Rinternals.h

"Timothy H. Keitt" <tkeitt@mail.utexas.edu> writes:
I don't see a function of that name in there?

$ find BUILD/include -name *.[ch] | xargs grep FinalizerEx
BUILD/include/Rinternals.h:void R_RegisterFinalizerEx(SEXP s,
 SEXP fun, Rboolean onexit);
BUILD/include/Rinternals.h:void R_RegisterCFinalizerEx(SEXP s,
 R_CFinalizer_t fun, Rboolean onexit);

However, you can't find those with is.loaded either. I'm getting rusty
on the linker issues, but I don't think you can expect to call just
any function in the C level interface using .Call. (Perhaps we need
another section in "Writing R Extensions"? -- I couldn't find a clear
indication of what, if any, functions are getting exported to .C and
friends from the main binary and by which mechanism.)

Notice the existence of reg.finalizer(), which may be the
functionality you were looking for in the first place.