Skip to content
Snippets Groups Projects
Commit 09e176a5 authored by stepan's avatar stepan
Browse files

Add R_MakeExternalPtrFn and R_ExternalPtrAddrFn RAPI functions

parent 494e957f
No related branches found
No related tags found
No related merge requests found
...@@ -66,6 +66,15 @@ ...@@ -66,6 +66,15 @@
#include <rffiutils.h> #include <rffiutils.h>
// these two functions are here just to handle casting void* to void function pointers...
DL_FUNC R_ExternalPtrAddrFn(SEXP s) {
return (DL_FUNC) R_ExternalPtrAddr(s);
}
SEXP R_MakeExternalPtrFn(DL_FUNC p, SEXP tag, SEXP prot) {
return R_MakeExternalPtr((void *) p, tag, prot);
}
// R_GlobalEnv et al are not a variables in FASTR as they are RContext specific // R_GlobalEnv et al are not a variables in FASTR as they are RContext specific
SEXP FASTR_R_GlobalEnv() { SEXP FASTR_R_GlobalEnv() {
TRACE0(); TRACE0();
...@@ -1391,6 +1400,7 @@ SEXP R_MakeExternalPtr(void *p, SEXP tag, SEXP prot) { ...@@ -1391,6 +1400,7 @@ SEXP R_MakeExternalPtr(void *p, SEXP tag, SEXP prot) {
} }
void *R_ExternalPtrAddr(SEXP s) { void *R_ExternalPtrAddr(SEXP s) {
TRACE0(); TRACE0();
SEXP result = ((call_R_ExternalPtrAddr) callbacks[R_ExternalPtrAddr_x])(s); SEXP result = ((call_R_ExternalPtrAddr) callbacks[R_ExternalPtrAddr_x])(s);
checkExitCall(); checkExitCall();
......
40 41
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment