[Rd] Portability of a C function

Romain Francois romain.francois at dbmail.com
Sun Feb 14 13:14:42 CET 2010


Hello,

This was discussed this week in the thread "LinkingTo and C++".

It is possible, and documented in WRE section 5.4 : 
http://cran.r-project.org/doc/manuals/R-exts.html#Registering-native-routines

Romain

On 02/14/2010 12:58 PM, Christophe Genolini wrote:
>
> Hi the list,
>
> In a package P1, I write a function f1 in C, potentially an internal
> function (not to be called from R).
> In a package P2, I write a function f2 in C. The f2 function needs to
> use f1 from P1. Is it possible ?
>
> --- 8< ---- In file P1.c ---------
> double f1(x,y){
> ....
> }
>
> --- 8< ---- In file P2.c ---------
> void f2(x,y,z){
> double result;
> ....
> result = f1(x,y);
> ....
> }
>
> Thanks
> Christophe

-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://tr.im/O1wO : highlight 0.1-5
|- http://tr.im/O1qJ : Rcpp 0.7.6
`- http://tr.im/NrTG : Rcpp 0.7.5



More information about the R-devel mailing list