FortranGIS
Version2.5
|
Utility module for supporting Fortran 2003 C language interface module. More...
Data Types | |
type | c_ptr_ptr |
Fortran derived type for handling void** , char** , etc C objects (pointer to pointer or array of pointers). More... | |
interface | c_ptr_ptr_new |
Constructor for a c_ptr_ptr object. More... | |
interface | strlen |
Equivalent of the strlen C function. More... | |
interface | strtofchar |
Convert a null-terminated C string into a Fortran CHARACTER variable of the proper length. More... | |
Functions/Subroutines | |
character(kind=c_char, len=len(fchar)+1) function, public | fchartostr (fchar) |
Convert a Fortran CHARACTER variable into a null-terminated C string. More... | |
character(kind=c_char, len=len_trim(fchar)+1) function, public | fchartrimtostr (fchar) |
Trim trailing blanks and convert a Fortran CHARACTER variable into a null-terminated C string. More... | |
integer function, public | c_ptr_ptr_getsize (this) |
Return the number of valid pointers in the array pointer this. More... | |
type(c_ptr) function, public | c_ptr_ptr_getptr (this, n) |
Return the n-th pointer in the array pointer this. More... | |
type(c_ptr) function, public | c_ptr_ptr_getobject (this) |
Return the C pointer to the first pointer in the array pointer this. More... | |
Utility module for supporting Fortran 2003 C language interface module.
This module contains various utilties for simplifying the exchange of character variables between Fortran and C when using the ISO_C_BINDING
intrinsic module of Fortran 2003.
For an example of application of the fortranc module, please refer to the following test program, which, among the other operations, decodes the output of a C function returning a char**
result: