46 #include "dllexport.h" 80 CHARACTER(LEN=1,KIND=C_CHAR),
INTENT(IN) :: Cstring(:)
81 CHARACTER(LEN=*),
INTENT(OUT) :: Fstring
83 INTEGER(C_INT) :: i,LENGTH
85 IF(len(fstring)>=
SIZE(cstring,1)-1)
THEN 86 length=
SIZE(cstring,1)-1
92 IF(cstring(i)==c_null_char)
THEN 95 fstring(i:i)=cstring(i)
111 CHARACTER(LEN=*),
INTENT(IN) :: Fstring
112 CHARACTER(LEN=1,KIND=C_CHAR),
INTENT(OUT) :: Cstring(:)
114 INTEGER(C_INT) :: i,LENGTH
116 IF(
SIZE(cstring,1)>len_trim(fstring))
THEN 117 length=len_trim(fstring)
119 length=
SIZE(cstring,1)-1
122 cstring(i)=fstring(i:i)
125 cstring(length+1)=c_null_char
139 CHARACTER(LEN=1,KIND=C_CHAR),
INTENT(IN) :: Cstrings(:,:)
140 CHARACTER(LEN=*),
INTENT(INOUT) :: Fstrings(:)
142 INTEGER(C_INT) :: string_idx,i
143 INTEGER(C_INT) :: LENGTH=0
146 IF(len(fstrings(1))>=
SIZE(cstrings,1)-1)
THEN 147 length=
SIZE(cstrings,1)-1
149 length=len(fstrings(1))
151 DO string_idx=1,
SIZE(fstrings,1)
152 fstrings(string_idx)=
" " 154 IF(cstrings(i,string_idx)==c_null_char)
THEN 157 fstrings(string_idx)(i:i)=cstrings(i,string_idx)
This module contains all Fortran and C data conversion routines.
subroutine, public cmissc2fstring(Cstring, Fstring)
Copys/converts a C string (array of characters) to a Fortran String (length of characters) ...
subroutine, public cmissc2fstrings(Cstrings, Fstrings)
Copys/converts a list of C strings (2D array of characters) to an array of Fortran Strings...
subroutine, public cmissf2cstring(Fstring, Cstring)
Copys/converts a Fortran String (length of characters) to a C string (array of characters) ...