On Thu, 2006-01-19 at 11:44 -0500, Aleksandar Donev wrote:
> Probably the best thing to do is to write a generic Perl script that
> takes a C header file and converts it into a Fortran module. defines
> go to parameters, prototypes to interfaces, typedefs I am not sure,
> depends on context. The tricky part is deciding what to do with C
> pointers. Sometimes they should convert to normal Fortran dummies,
> sometimes to "TYPE(C_PTR), VALUE". In general, (void*)->"TYPE(C_PTR),
> VALUE". Also, (some_typedef*)->"TYPE(C_PTR), VALUE", since those are
> usually handles and don't actually need typing. Some human
> intervention might be needed.
>
> Thanks a lot for doing this---it would be major help to everyone!
> Eventually the converse (Fortran->C header) would be great too.
You may remember that the way Kurt wanted to do C interop was to put a C
prototype, maybe in quotes, into the Fortran code.
--
Van Snyder | What fraction of Americans believe
[log in to unmask] | Wrestling is real and NASA is fake?
Any alleged opinions are my own and have not been approved or disapproved
by JPL, CalTech, NASA, Frederick Gregory, George Bush, or anybody else.
|