search for: r_callmethoddef

Displaying 11 results from an estimated 11 matches for "r_callmethoddef".

2009 Oct 08
1
R_CallMethodDef: 'type' and 'style' fields?
According to Writing R Extensions, the R_CallMethodDef struct has two optional fields for specifying the 'type' and 'style' (where 'style' is said to distinguish in/out/inout). But it gives no details of the possible values of 'style'. And looking in the header file Rdynload.h the definition of R_CallMethodDef does not i...
2003 Oct 10
1
number of arguments in .Call function registration
...teresting. Many of us use a macro like #define CALL_DEF(fname, nargs) { #fname, (DL_FUNC)&fname, nargs} for use in function registration for use with .Call. For example, using the example from R Extension manual, if we want to register a C function myCall with three arguments, we will use R_CallMethodDef callMethods[] = { CALL_DEF(myCall, 3), {NULL, NULL, 0} }; instead of using R_CallMethodDef callMethods[] = { {"myCall", (DL_FUNC)&myCall, 3}, {NULL, NULL, 0} }; However, there is no way for the compiler to make sure that myCall is really a function taking three SEXP...
2009 Jan 08
1
Callbacks seems to get GCed.
...lude <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() { int errorOccurred; SEXP f = NULL; f = allocVector(LANGSXP, 1); SETCAR(f, callback1); PROTECT...
2007 Mar 19
3
Rinternals.h and undefined symbols
Hi, I'm trying to register my native routines using R_registerRoutines (...). I can compile the code, but the loader cannot resolve the symbol: undefined symbol: _Z18R_registerRoutinesP8_DllInfoPK12R_CMethodDefPK15R_CallMethodDefS3_S6 _ $ nm bgx.Rcheck/bgx/libs/bgx.so | grep R_registerRoutines U _Z18R_registerRoutinesP8_DllInfoPK12R_CMethodDefPK15R_CallMethodDefS3_S6 _ Why does it have this funny name? If I look at libR.so, I get an ordinary symbol name: $ nm ~/lib64/R/lib/libR.so | grep R_registe...
2009 Sep 03
1
Running an expression 1MN times using embedded R
...extern void (*ptr_R_ShowMessage)(const char *); extern void (*ptr_R_WriteConsole)(const char *, int); extern int (*ptr_R_ReadConsole)(char *, unsigned char *, int, int); extern void (*ptr_R_WriteConsoleEx)(const char *, int , int ); SEXP rh_status(SEXP); static uint8_t SET_STATUS = 0x02; static R_CallMethodDef callMethods [] = { {"rh_status",(DL_FUNC)&rh_status,1}, {NULL, NULL, 0} }; uint32_t reverseUInt (uint32_t i) { uint8_t c1, c2, c3, c4; if (is_bigendian()) { return i; } else { c1 = i & 255; c2 = (i >> 8) & 255; c...
2017 Feb 20
0
[patch] Eliminate warnings from gcc -Wold-style-declaration
...piler flags, I have '-Wextra' permanently set for installing packages. When installing the modified package, I got the following warning (tested with gcc 4.8.4 and 6.3.0): > init.c:10:1: warning: ?static? is not at beginning of declaration [-Wold-style-declaration] > const static R_CallMethodDef R_CallDef[] = { I believe this is a case of the compiler (with '-Wold-style-declaration' as part of '-Wextra') adhering to the following section of the C99 (or C11) standard, see e.g. <http://www.open-std.org/JTC1/SC22/WG14/www/standards.html>: > 6.11 Future language di...
2003 May 28
0
R_GlobalEnv
..._ext/Applic.h> static SEXP assignValueToFooInRhoEnv(SEXP Value,SEXP Rho) { defineVar(install("Foo"),Value,Rho); return Value; } static SEXP assignValueToFooInR_GlobalEnv(SEXP Value) { defineVar(install("Foo"),Value,R_GlobalEnv); return Value; } static const R_CallMethodDef CallEntries[] = { {"assignValueToFooInRhoEnv", (DL_FUNC)&assignValueToFooInRhoEnv,2}, {"assignValueToFooInR_GlobalEnv", (DL_FUNC)&assignValueToFooInR_GlobalEnv,1}, {NULL,NULL,0} }; void R_init_testR_GlobalEnv(DllInfo *info) { R_registerRoutines(info,NULL,CallEnt...
2007 May 01
1
Embedding R and registering routines
Hello, The use of .Call and the like all depend on loading shared libraries and registering routines from it. Also, .Primitive and .Internal depend on routines being registered in the R binary. And applications that embed R can override routines declared in Rinterfac.h, but is there a way for an application embedding R to register other routines defined in the application without loading a
2010 Feb 18
3
R CMD check: OK in LINUX. Crashes in Windows!
Hi, I have followed the recommended steps for creating a package (rctest). As of now, my goal is simply to understand how various pieces fit together. The package includes: (1) C code with source in sub-directories, compiled to create a static library. (a) There is a single C-struct (dns) a simple 'matrix': {int m; int n; double *d;} (b) C code to create random matrix of a certain size.
2010 Mar 14
1
Segfault Problem c++ R interface (detailed)
...;Rinternals.h> #include <R_ext/Rdynload.h> void RSymbReg(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP); static R_FortranMethodDef FortEntries[] = { {NULL, NULL, 0} }; static R_CMethodDef cEntries[] = { {NULL, NULL, 0, NULL} }; static R_CallMethodDef callEntries[] = { {"RSymbReg", (DL_FUNC) &RSymbReg, 14}, {NULL, NULL, 0} }; void R_init_testing(DllInfo *info) { R_registerRoutines(info, cEntries, callEntries, FortEntries, NULL); } void R_unload_testing(DllInfo *info) { } !!!!!!!!Makevars: PKG_CXXFLAGS="-DR_PACKAGE=1...
2018 Dec 04
3
patch to support custom HTTP headers in download.file() and url()
...cally.} + \item{\dots}{allow additional arguments to be passed, unused.} } \details{ diff --git a/src/library/utils/src/init.c b/src/library/utils/src/init.c index ebbaf1054a..785347b772 100644 --- a/src/library/utils/src/init.c +++ b/src/library/utils/src/init.c @@ -74,9 +74,9 @@ static const R_CallMethodDef CallEntries[] = { static const R_ExternalMethodDef ExtEntries[] = { #ifdef Win32 - EXTDEF(download, 6), + EXTDEF(download, 7), #else - EXTDEF(download, 5), + EXTDEF(download, 6), #endif EXTDEF(unzip, 7), EXTDEF(Rprof, 8), diff --git a/src/library/utils/tests/download.file...