transfer of the record length for io from internal files
Paul Thomas
paulthomas2@wanadoo.fr
Thu Jul 14 20:54:00 GMT 2005
Feng Wang has opened the door to full use of internal files with his
recent hollerith patches. There remains, however a need to transfer the
record length, aka the character length, and to use it it the library io
routines.
The enclosed patch accomplishes the transfer. It has been regtested on
RH9/Athlon.
This
program test
character*80 :: a(4)
write(a, *) "hello, welcome to Jamaica, have a nice day"
end program test
produces
MAIN__ ()
{
char a[4][1:80];
_gfortran_filename = "test.f90";
_gfortran_line = 3;
_gfortran_ioparm.internal_unit = (char *) &a;
_gfortran_ioparm.internal_unit_len = 320;
_gfortran_ioparm.recl_in = 80;
_gfortran_ioparm.list_format = 1;
_gfortran_st_write ();
_gfortran_transfer_character ("hello, welcome to Jamaica, have a nice
day", 42);
_gfortran_st_write_done ();
}
I have checked that the record length really is correctly picked up in
the library as ioparm.recl_in.
thus, we now need the modifications to the library, to recognise and
signal eor's, \n, \r and all the other good stuff.
I am open to changing the order of the arguments of set_string to making
it more pleasing to the eye. It was convenient to do it this way. Are
there any other ioparm string options that should be using the
character length? I have tested one or two and they seem to be
protected by the parser. For example, status will not accept an array
as its value. If only the one option uses ts->cl, should the few lines
of code be removed from set_string and deposited in build_dt?
Anyhow, over to you Jerry!
Best regards
Paul T
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: trans-io.diff
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20050714/ce37766d/attachment.ksh>
More information about the Fortran
mailing list