Fortran 77 Interface

Freddie Akeroyd faa at isise.rl.ac.uk
Fri Sep 17 10:00:04 BST 1999


Hi Mark - you are reading on UNIX aren't you? I managed to fiddle things
so it worked on UNIX as the character length is passed at the end of the
argument list as a "dummy argument" and so can be ignored ... the string
bit is passed in the usual place C like (without the '\0' though). However
on PC's the length it is passed "by value" after the string argument
(unless you change the calling convention to something other than
"stdcall"), and in "stdcall" the name of a function is "mangled" depending
on how many arguments it has ... if "nxputattr" is prototyped to take a
character, and in your code you pass an integer, your program will not
link. Headaches. I think it may be possible to produce separate "unix",
"vms" and "pc" version of napif.f that would allow you to keep the
interface as it is, but we are in the realm of compiler and system quirks
...

Freddie

On Fri, 17 Sep 1999, Mark Koennecke wrote:

> High,
> 
> I got slightly confused about this because I am happily reading character SDS-data
> written by a C
> program from F77. I then realized that I call Freddy REPLACE_STRING function from
> my code
> to fix the character SDS up. Two points:
> 
> I still think we should keep the API as it is but modify NXFgetdata, ...etc to
> handle character data properly automatically. As Freddy already did with the
> attribute routines. Don't let the user worry about
> it.
> 
> It ocurred to me that we must make sure that any character data written from F77
> has a 0 at the end of
> the string otherwise we get in deep trouble when reading that from a C program.
> Again,  I think this should be handled automatically by the API.
> 
> 
> Mark
> 

-- 
Freddie Akeroyd                        Email:  Freddie.Akeroyd at rl.ac.uk
ISIS Facility                          Tel:    +44 1235 445457
Rutherford Appleton Laboratory         Fax:    +44 1235 445720
Chilton, DIDCOT, OX11 OQX, GB          WWW:    http://www.isis.rl.ac.uk/




More information about the NeXus-developers mailing list