search for: set_callback2

Displaying 1 result from an estimated 1 matches for "set_callback2".

Did you mean: set_callbacks
2009 Jan 08
1
Callbacks seems to get GCed.
...ed.h> #include <Rinternals.h> #include <Rdefines.h> #include <R_ext/Parse.h> #include <R_ext/Rdynload.h> #include <R_ext/RStartup.h> #include <Rinterface.h> SEXP callback1; SEXP callback2; void set_callback1(SEXP func) { PROTECT(callback1 = func); } void set_callback2(SEXP func) { PROTECT(callback2 = func); } R_CMethodDef cMethods[] = { {NULL} }; R_CallMethodDef callMethods[] = { {"set_callback1", (DL_FUNC) &set_callback1, 1}, {"set_callback2", (DL_FUNC) &set_callback2, 1}, {NULL} }; void r_trigger_callback1() { i...