diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2004-04-09 12:09:45 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2004-04-09 12:09:45 +0000 |
commit | 7aa88267c1df43b50cd3236e3e06747e1830d27b (patch) | |
tree | d06c953ba04d4c2d38dcd4eb5665ab5595c1d638 /winsup/cygwin/tty.h | |
parent | b79f85c28b63ccc3326ac78654c8171c3f8a5706 (diff) | |
download | cygnal-7aa88267c1df43b50cd3236e3e06747e1830d27b.tar.gz cygnal-7aa88267c1df43b50cd3236e3e06747e1830d27b.tar.bz2 cygnal-7aa88267c1df43b50cd3236e3e06747e1830d27b.zip |
* fhandler.h (fhandler_base::status): Declare private.
(fhandler_base::open_status): Ditto.
(class fhandler_socket): Move status bits into private bitfield struct
type status_flags. Change accessor methods appropriately.
* fhandler_socket.cc (fhandler_socket::fhandler_socket): Accomodate
above status bit changes.
* tty.h: Remove status bit enumerator.
(TTYISSETF): Remove.
(TTYSETF): Remove.
(TTYCLEARF): Remove.
(TTYCONDSETF): Remove.
(tty_min::status): Define as private bitfield struct type status_flags.
Add appropriate accessor methods.
* fhandler_console.cc: Use tty_min::status accessor methods throughout.
* fhandler_termios.cc: Ditto.
* winsup.h (__ISSETF): Remove.
(__SETF): Remove.
(__CLEARF): Remove.
(__CONDSETF): Remove.
Diffstat (limited to 'winsup/cygwin/tty.h')
-rw-r--r-- | winsup/cygwin/tty.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/winsup/cygwin/tty.h b/winsup/cygwin/tty.h index c5d01526f..355e21b9a 100644 --- a/winsup/cygwin/tty.h +++ b/winsup/cygwin/tty.h @@ -30,17 +30,6 @@ details. */ #include <sys/termios.h> -enum -{ - TTY_INITIALIZED = 1, /* Set if tty is initialized */ - TTY_RSTCONS = 2 /* Set if console needs to be set to "non-cooked" */ -}; - -#define TTYISSETF(x) __ISSETF (tc, x, TTY) -#define TTYSETF(x) __SETF (tc, x, TTY) -#define TTYCLEARF(x) __CLEARF (tc, x, TTY) -#define TTYCONDSETF(n, x) __CONDSETF(n, tc, x, TTY) - #ifndef MIN_CTRL_C_SLOP #define MIN_CTRL_C_SLOP 50 #endif @@ -48,13 +37,24 @@ enum class tty_min { pid_t sid; /* Session ID of tty */ + struct status_flags + { + unsigned initialized : 1; /* Set if tty is initialized */ + unsigned rstcons : 1; /* Set if console needs to be set to "non-cooked" */ + } status; + public: - DWORD status; pid_t pgid; int output_stopped; int ntty; DWORD last_ctrl_c; // tick count of last ctrl-c + void initialize () { status.initialized = 1; } + bool is_initialized () { return status.initialized; } + void set_rstcons () { status.rstcons = 1; } + void clear_rstcons () { status.rstcons = 1; } + bool needs_rstcons () { return status.rstcons; } + tty_min (int t = -1, pid_t s = -1) : sid (s), ntty (t) {} void setntty (int n) {ntty = n;} pid_t getpgid () {return pgid;} |