1 |
#ifndef PTYTTY_H |
2 |
#define PTYTTY_H |
3 |
|
4 |
#include "feature.h" |
5 |
|
6 |
#if defined(HAVE_GRANTPT) && defined(HAVE_UNLOCKPT) |
7 |
# if defined(PTYS_ARE_GETPT) || defined(PTYS_ARE_PTMX) |
8 |
# define NO_SETOWNER_TTYDEV 1 |
9 |
# endif |
10 |
#endif |
11 |
#if defined(__CYGWIN32__) |
12 |
# define NO_SETOWNER_TTYDEV 1 |
13 |
#endif |
14 |
|
15 |
enum rxvt_privaction { IGNORE = 'i', SAVE = 's', RESTORE = 'r' }; |
16 |
|
17 |
struct rxvt_ptytty { |
18 |
#ifndef RESET_TTY_TO_COMMON_DEFAULTS |
19 |
struct stat savestat; /* original status of our tty */ |
20 |
#endif |
21 |
#ifndef NO_SETOWNER_TTYDEV |
22 |
void privileges (rxvt_privaction action); |
23 |
bool saved; |
24 |
#endif |
25 |
public: |
26 |
int pty; // pty file descriptor; connected to rxvt |
27 |
int tty; // tty file descriptor; connected to child |
28 |
char *name; |
29 |
|
30 |
rxvt_ptytty (); |
31 |
~rxvt_ptytty (); |
32 |
|
33 |
bool get (); |
34 |
void put (); |
35 |
|
36 |
void close_tty (); |
37 |
|
38 |
bool make_controlling_tty (); |
39 |
void set_utf8_mode (bool on); |
40 |
}; |
41 |
|
42 |
#endif |
43 |
|