Open richfitz opened 3 years ago
Doing this appears hard as we want to write:
SEXP registered_address(SEXP ptr) {
R_RegisteredNativeSymbol *sym =
(R_RegisteredNativeSymbol *) R_ExternalPtrAddr(ptr);
return sym->symbol.c->fun;
}
but this requires definitions that are in R's src/include/Rdynpriv.h
typedef struct {
char *name;
DL_FUNC fun;
int numArgs;
R_NativePrimitiveArgType *types;
} Rf_DotCSymbol;
struct Rf_RegisteredNativeSymbol {
NativeSymbolType type;
union {
Rf_DotCSymbol *c;
Rf_DotCallSymbol *call;
Rf_DotFortranSymbol *fortran;
Rf_DotExternalSymbol *external;
} symbol;
DllInfo *dll;
};
This fails because deSolve will not accept function pointers of this type. Get this working with dde then try and get this ported to work with deSolve - doing this will help with getting odin and odin.dust to cohabit more gracefully as cpp11 adds this