aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/unix.h
diff options
context:
space:
mode:
authorJanne Blomqvist <jb@gcc.gnu.org>2014-06-08 08:43:29 +0300
committerJanne Blomqvist <jb@gcc.gnu.org>2014-06-08 08:43:29 +0300
commit89a862b40a387ef42618176addf192b33c556f7d (patch)
treece7c2693e80de90ba4a312ca3616c556a673856e /libgfortran/io/unix.h
parent136a5f4548a68455967a2f4b9eab4b3f78fff6d3 (diff)
downloadgcc-89a862b40a387ef42618176addf192b33c556f7d.zip
gcc-89a862b40a387ef42618176addf192b33c556f7d.tar.gz
gcc-89a862b40a387ef42618176addf192b33c556f7d.tar.bz2
PR 56981 Flush buffer at record boundary if possible.
2014-06-08 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/56981 * io/unix.h (struct stream_vtable): Add new member function, markeor. (smarkeor): New inline function. (flush_if_unbuffered): Remove prototype. * io/unix.c (raw_markeor): New function. (raw_vtable): Initialize markeor member. (buf_markeor): New function. (buf_vtable): Initialize markeor member. (mem_vtable): Likewise. (mem4_vtable): Likewise. (flush_if_unbuffered): Remove function. * io/transfer.c (next_record): Call smarkeor instead of flush_if_unbuffered. From-SVN: r211353
Diffstat (limited to 'libgfortran/io/unix.h')
-rw-r--r--libgfortran/io/unix.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/libgfortran/io/unix.h b/libgfortran/io/unix.h
index 910f2c2..0f696df 100644
--- a/libgfortran/io/unix.h
+++ b/libgfortran/io/unix.h
@@ -38,6 +38,7 @@ struct stream_vtable
int (* const trunc) (struct stream *, gfc_offset);
int (* const flush) (struct stream *);
int (* const close) (struct stream *);
+ int (* const markeor) (struct stream *);
};
struct stream
@@ -94,6 +95,12 @@ sclose (stream * s)
return s->vptr->close (s);
}
+static inline int
+smarkeor (stream * s)
+{
+ return s->vptr->markeor (s);
+}
+
extern int compare_files (stream *, stream *);
internal_proto(compare_files);
@@ -167,9 +174,6 @@ internal_proto(inquire_readwrite);
extern void flush_if_preconnected (stream *);
internal_proto(flush_if_preconnected);
-extern int flush_if_unbuffered (stream*);
-internal_proto(flush_if_unbuffered);
-
extern int stream_isatty (stream *);
internal_proto(stream_isatty);