From tkeitt@mail.utexas.edu  Sat Nov  9 15:51:45 2002
From: tkeitt@mail.utexas.edu (Timothy H. Keitt)
Date: 09 Nov 2002 07:51:45 -0800
Subject: Calling function with proto in Rinternals.h
In-Reply-To: <x21y5vlzh5.fsf@biostat.ku.dk>
References: <1036816477.4523.8.camel@ip68-6-78-9.sb.sd.cox.net>
 <x21y5vlzh5.fsf@biostat.ku.dk>
Message-ID: <1036857106.8203.5.camel@ip68-6-78-9.sb.sd.cox.net>

Ah, perfect (reg.finalizer). Thanks.

T.

On Sat, 2002-11-09 at 04:05, Peter Dalgaard BSA wrote:
> "Timothy H. Keitt" <tkeitt@mail.utexas.edu> writes:
> 
> > (Tried this query on r-help with no luck, maybe someone here can help?)
> > 
> > I would like to call the 'RFinalizerEx' function that appears in
> > Rinternals.h using ".Call". It worked for me in the past, but now I get
> > an error message something like: 'call function name not in call table'.
> > I'm using the 1.6.1 rpm from CRAN. Anyone know what's going on? Thanks.
> 
> I don't see a function of that name in there?
> 
> $ find BUILD/include -name *.[ch] | xargs grep FinalizerEx
> BUILD/include/Rinternals.h:void R_RegisterFinalizerEx(SEXP s,
>  SEXP fun, Rboolean onexit);
> BUILD/include/Rinternals.h:void R_RegisterCFinalizerEx(SEXP s,
>  R_CFinalizer_t fun, Rboolean onexit);
> 
> However, you can't find those with is.loaded either. I'm getting rusty
> on the linker issues, but I don't think you can expect to call just
> any function in the C level interface using .Call. (Perhaps we need
> another section in "Writing R Extensions"? -- I couldn't find a clear
> indication of what, if any, functions are getting exported to .C and
> friends from the main binary and by which mechanism.)
> 
> Notice the existence of reg.finalizer(), which may be the
> functionality you were looking for in the first place.
> 
> -- 
>    O__  ---- Peter Dalgaard             Blegdamsvej 3  
>   c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
>  (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
> ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
-- 
Timothy H. Keitt
The University of Texas at Austin
Section of Integrative Biology
1 University Station C0930
Austin, Texas 78712-0253 USA

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


Calling function with proto in Rinternals.h
Timothy H. Keitt