aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/unix.h
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/io/unix.h')
-rw-r--r--libgfortran/io/unix.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/libgfortran/io/unix.h b/libgfortran/io/unix.h
index 3229d50..dc433d7 100644
--- a/libgfortran/io/unix.h
+++ b/libgfortran/io/unix.h
@@ -41,6 +41,29 @@ struct stream
int (*close) (struct stream *);
};
+
+typedef struct
+{
+ stream st;
+
+ gfc_offset buffer_offset; /* File offset of the start of the buffer */
+ gfc_offset physical_offset; /* Current physical file offset */
+ gfc_offset logical_offset; /* Current logical file offset */
+ gfc_offset file_length; /* Length of the file, -1 if not seekable. */
+
+ char *buffer; /* Pointer to the buffer. */
+ int fd; /* The POSIX file descriptor. */
+
+ int active; /* Length of valid bytes in the buffer */
+
+ int prot;
+ int ndirty; /* Dirty bytes starting at buffer_offset */
+
+ int special_file; /* =1 if the fd refers to a special file */
+}
+unix_stream;
+
+
/* Inline functions for doing file I/O given a stream. */
static inline ssize_t
sread (stream * s, void * buf, ssize_t nbyte)