You have to coerce to numeric yourself if that's what you want. Eg in the R
code, as.numeric(1:12) rather than 1:12. Or check the type first in C with
TYPEOF before doing NUMERIC_POINTER or INTEGER_POINTER (the difference is
that the two do different casts; they both point a fixed offset into the R
ction from C. How do you
deal with SEXPs?
Reid Huntsinger
Reid Huntsinger
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Ricardo Luiz Andrade Abrantes
Sent: Tuesday, August 30, 2005 4:33 PM
To: r-devel@r-project.org
Subject: Re: [Rd] .Call and Segmentat
GUILLOT [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 15, 2005 11:50 AM
To: [EMAIL PROTECTED]
Cc: Huntsinger, Reid
Subject: Re: [Rd] Calling C from Fortran
Thanks for your reply.
Am I write if I say that the wrapper shoul be
double F77_SUB(mygammafn)(double *x) { return gammafn(*x); }
ins
The C wrappers are there to align the linking conventions expected by the
Fortran compiler (usually subroutine/function foo has its entry point in the
object file indicated by a symbol foo_, but it depends on the platform) to
that of the C compiler. (The C compiler just uses the function name.) The