From romain.francois at dbmail.com  Sun Feb 14 13:14:42 2010
From: romain.francois at dbmail.com (Romain Francois)
Date: Sun, 14 Feb 2010 13:14:42 +0100
Subject: [Rd] Portability of a C function
In-Reply-To: <4B77E567.4060603@u-paris10.fr>
References: <4B77E567.4060603@u-paris10.fr>
Message-ID: <4B77E932.2090401@dbmail.com>

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



[Rd] Portability of a C function
Romain Francois