[Rd] Difference between .C and .Fortran (on Windows)

Duncan Murdoch murdoch at stats.uwo.ca
Thu Apr 17 11:36:23 MEST 2003

In updating my web page on using non-standard compilers in Windows,
I've been trying to figure out exactly what the differences are
between .C() and .Fortran(), but the code is pretty convoluted. 

Can someone let me know if the following is correct?

There are two differences between .C("foo", ...) and .Fortran("foo").

 1.  .C looks for the symbol "foo" in the external library, whereas
.Fortran("foo", ...) looks for the symbol "foo_" (which is how g77
would export the subroutine "foo").

 2.  .C passes character mode vectors as a pointer to an array of
pointers to the strings, whereas .Fortran just passes a pointer to a
255 character buffer containing the first string.  In both cases the
strings are null-terminated.

Are there other differences?  Are these platform-dependent?

Duncan Murdoch

More information about the R-devel mailing list