Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make example with fortran bindings #25

Open
tkittel opened this issue Mar 31, 2017 · 0 comments
Open

Make example with fortran bindings #25

tkittel opened this issue Mar 31, 2017 · 0 comments

Comments

@tkittel
Copy link
Member

tkittel commented Mar 31, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant