From murdoch at stats.uwo.ca  Thu Apr 17 11:36:23 2003
From: murdoch at stats.uwo.ca (Duncan Murdoch)
Date: Thu Apr 17 16:34:43 2003
Subject: [Rd] Difference between .C and .Fortran (on Windows)
Message-ID: <6let9vodriirivok48gitiednh79lc30dn@4ax.com>

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


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