aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/fhandler.h
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2004-04-09 20:39:19 +0000
committerCorinna Vinschen <corinna@vinschen.de>2004-04-09 20:39:19 +0000
commitff0843433a4597a55a31bad84f82886ce9943612 (patch)
tree0a7c30e18e8414f19b15082e403f3a0b49f4858a /winsup/cygwin/fhandler.h
parent535309a6e303db4a6bf38eb202eee08136efb2cf (diff)
downloadnewlib-ff0843433a4597a55a31bad84f82886ce9943612.zip
newlib-ff0843433a4597a55a31bad84f82886ce9943612.tar.gz
newlib-ff0843433a4597a55a31bad84f82886ce9943612.tar.bz2
* fhandler.h (class fhandler_dev_raw): Move status bits into protected
bitfield struct type status_flags. Drop unused has_written bit. Add accessor methods. (fhandler_dev_raw::clear): Remove. (fhandler_dev_raw::reset_devbuf): Remove. * fhandler_floppy.cc (fhandler_dev_floppy::lseek): Use accessor method for is_writing. * fhandler_raw.cc: Use status accessor methods throughout. (fhandler_dev_raw::clear): Remove. (fhandler_dev_raw::fhandler_dev_raw): Drop clear call. (fhandler_dev_raw::~fhandler_dev_raw): Ditto. * fhandler_tape.cc: Use mtinfo::status accessor methods throughout. (mtinfo_drive::close): Fix conditional to enable BSD semantics correctly. (mtinfo_drive::get_status): Rename from mtinfo_drive::status. * mtinfo.h (class mtinfo_drive): Move status bits into private bitfield struct type status_flags. Add accessor methods. Rename status method to get_status.
Diffstat (limited to 'winsup/cygwin/fhandler.h')
-rw-r--r--winsup/cygwin/fhandler.h33
1 files changed, 20 insertions, 13 deletions
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index b889c84..c3922b5 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -497,13 +497,27 @@ class fhandler_dev_raw: public fhandler_base
size_t devbufsiz;
size_t devbufstart;
size_t devbufend;
- int eom_detected : 1;
- int eof_detected : 1;
- int lastblk_to_read : 1;
- int is_writing : 1;
- int has_written : 1;
+ struct status_flags
+ {
+ unsigned eom_detected : 1;
+ unsigned eof_detected : 1;
+ unsigned lastblk_to_read : 1;
+ unsigned is_writing : 1;
+ public:
+ status_flags () :
+ eom_detected (0), eof_detected (0), lastblk_to_read (0), is_writing (0)
+ {}
+ } status;
+
+ void eom_detected (bool b) { status.eom_detected = b; }
+ bool eom_detected () { return status.eom_detected; }
+ void eof_detected (bool b) { status.eof_detected = b; }
+ bool eof_detected () { return status.eof_detected; }
+ void lastblk_to_read (bool b) { status.lastblk_to_read = b; }
+ bool lastblk_to_read () { return status.lastblk_to_read; }
+ void is_writing (bool b) { status.is_writing = b; }
+ bool is_writing () { return status.is_writing; }
- virtual void clear (void);
virtual BOOL write_file (const void *buf, DWORD to_write,
DWORD *written, int *err);
virtual BOOL read_file (void *buf, DWORD to_read, DWORD *read, int *err);
@@ -516,13 +530,6 @@ class fhandler_dev_raw: public fhandler_base
fhandler_dev_raw ();
- inline void reset_devbuf (void)
- {
- devbufstart = devbufend = 0;
- eom_detected = eof_detected = 0;
- lastblk_to_read = is_writing = has_written = 0;
- }
-
public:
~fhandler_dev_raw (void);