Description
We don't currently have a use-case for it, but in principle we want to be able to use MCPL from fortran code as well. I am not an expert on C-Fortran bindings, but I am guessing that we can't communicate structs such as mcpl_file_t
across the interface. So we would need an alternative interface which would use "file numbers" rather than "file handles". E.g.
mcpl_file_t mcpl_open_file(const char * filename)
should be:
int mcplf_open_file(const char* filename)
(assuming functions can return values across boundaries - if only void functions are allowed, we should pass the an int* argument instead, maybe).
The file number should then be used in place of the file handle as the first argument of other "mcplf_" functions.
We should either put these "mcplf_" functions in dedicated files (mcplf.h/mcplf.c?) or we should simply create them inside mcpl.c and document them somewhere else, since fortran can anyway not include a c header file.