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