diff options
author | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-08-15 23:06:44 +0000 |
---|---|---|
committer | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-08-15 23:06:44 +0000 |
commit | 4d8ee55b7d3fd31406d095afb53a1fac983490c6 (patch) | |
tree | a00eb1bf11f7cace4d681ea98e21b7e72e529de0 /libgfortran/io/io.h | |
parent | e83964b23af081bec09add65a9ab27772c729bad (diff) | |
download | gcc-4d8ee55b7d3fd31406d095afb53a1fac983490c6.tar.gz |
2006-08-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/25828
* libgfortran.h: Rename GFC_LARGE_IO_INT to GFC_IO_INT.
* io/file_pos.c (st_backspace): Ignore if access=STREAM.
(st_rewind): Handle case of access=STREAM.
* io/open.c (access_opt): Add STREAM_ACCESS.
(edit_modes): Set current_record to zero only if not STREAM.
(new_unit): Initialize maxrec, recl, and last_record for STREAM.
* io/read.c (read_x): Advance file position for STREAM.
* io/io.h (enum unit_access): Align IOPARM flags with frontend.
Add ACCESS_STREAM. Add prototype for is_stream_io () function.
Use GFC_IO_INT.
* io/inquire.c (inquire_via_unit): Add text for access = "STREAM".
* io/unit.c (is_stream_io): New function to return true if access =
STREAM.
* io/transfer.c (file_mode): Add modes for unformatted stream and
formatted stream. (current_mode): Return appropriate file mode based
on access flags.
(read_block): Handle formatted stream reads.
(read_block_direct): Handle unformatted stream reads.
(write_block): Handle formatted stream writes.
(write_buf): Handle unformatted stream writes.
(unformatted_read): Fix up, use temporary for size.
(pre_position): Position file for STREAM access.
(data_transfer_init): Initialize for stream access, skip irrelevent
error checks.
(next_record_r),(next_record_w), and (next_record): Do nothing for
stream I/O.
(finalize_transfer): Flush when all done if stream I/O.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116172 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/io/io.h')
-rw-r--r-- | libgfortran/io/io.h | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/libgfortran/io/io.h b/libgfortran/io/io.h index e16d4b6ec02..fba0ae83991 100644 --- a/libgfortran/io/io.h +++ b/libgfortran/io/io.h @@ -156,7 +156,7 @@ namelist_info; /* Options for the OPEN statement. */ typedef enum -{ ACCESS_SEQUENTIAL, ACCESS_DIRECT, ACCESS_APPEND, +{ ACCESS_SEQUENTIAL, ACCESS_DIRECT, ACCESS_APPEND, ACCESS_STREAM, ACCESS_UNSPECIFIED } unit_access; @@ -290,29 +290,31 @@ st_parameter_filepos; #define IOPARM_INQUIRE_HAS_NAMED (1 << 10) #define IOPARM_INQUIRE_HAS_NEXTREC (1 << 11) #define IOPARM_INQUIRE_HAS_RECL_OUT (1 << 12) -#define IOPARM_INQUIRE_HAS_FILE (1 << 13) -#define IOPARM_INQUIRE_HAS_ACCESS (1 << 14) -#define IOPARM_INQUIRE_HAS_FORM (1 << 15) -#define IOPARM_INQUIRE_HAS_BLANK (1 << 16) -#define IOPARM_INQUIRE_HAS_POSITION (1 << 17) -#define IOPARM_INQUIRE_HAS_ACTION (1 << 18) -#define IOPARM_INQUIRE_HAS_DELIM (1 << 19) -#define IOPARM_INQUIRE_HAS_PAD (1 << 20) -#define IOPARM_INQUIRE_HAS_NAME (1 << 21) -#define IOPARM_INQUIRE_HAS_SEQUENTIAL (1 << 22) -#define IOPARM_INQUIRE_HAS_DIRECT (1 << 23) -#define IOPARM_INQUIRE_HAS_FORMATTED (1 << 24) -#define IOPARM_INQUIRE_HAS_UNFORMATTED (1 << 25) -#define IOPARM_INQUIRE_HAS_READ (1 << 26) -#define IOPARM_INQUIRE_HAS_WRITE (1 << 27) -#define IOPARM_INQUIRE_HAS_READWRITE (1 << 28) -#define IOPARM_INQUIRE_HAS_CONVERT (1 << 29) +#define IOPARM_INQUIRE_HAS_STRM_POS_OUT (1 << 13) +#define IOPARM_INQUIRE_HAS_FILE (1 << 14) +#define IOPARM_INQUIRE_HAS_ACCESS (1 << 15) +#define IOPARM_INQUIRE_HAS_FORM (1 << 16) +#define IOPARM_INQUIRE_HAS_BLANK (1 << 17) +#define IOPARM_INQUIRE_HAS_POSITION (1 << 18) +#define IOPARM_INQUIRE_HAS_ACTION (1 << 19) +#define IOPARM_INQUIRE_HAS_DELIM (1 << 20) +#define IOPARM_INQUIRE_HAS_PAD (1 << 21) +#define IOPARM_INQUIRE_HAS_NAME (1 << 22) +#define IOPARM_INQUIRE_HAS_SEQUENTIAL (1 << 23) +#define IOPARM_INQUIRE_HAS_DIRECT (1 << 24) +#define IOPARM_INQUIRE_HAS_FORMATTED (1 << 25) +#define IOPARM_INQUIRE_HAS_UNFORMATTED (1 << 26) +#define IOPARM_INQUIRE_HAS_READ (1 << 27) +#define IOPARM_INQUIRE_HAS_WRITE (1 << 28) +#define IOPARM_INQUIRE_HAS_READWRITE (1 << 29) +#define IOPARM_INQUIRE_HAS_CONVERT (1 << 30) typedef struct { st_parameter_common common; GFC_INTEGER_4 *exist, *opened, *number, *named; GFC_INTEGER_4 *nextrec, *recl_out; + GFC_IO_INT *strm_pos_out; CHARACTER1 (file); CHARACTER2 (access); CHARACTER1 (form); @@ -351,7 +353,7 @@ struct format_data; typedef struct st_parameter_dt { st_parameter_common common; - GFC_LARGE_IO_INT rec; + GFC_IO_INT rec; GFC_INTEGER_4 *size, *iolength; gfc_array_char *internal_unit_desc; CHARACTER1 (format); @@ -709,6 +711,9 @@ internal_proto(is_internal_unit); extern int is_array_io (st_parameter_dt *); internal_proto(is_array_io); +extern int is_stream_io (st_parameter_dt *); +internal_proto(is_stream_io); + extern gfc_unit *find_unit (int); internal_proto(find_unit); |