| 1 |
root |
1.1 |
#ifndef PTYTTY_H |
| 2 |
|
|
#define PTYTTY_H |
| 3 |
|
|
|
| 4 |
root |
1.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 |
| 14 |
root |
1.1 |
|
| 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 |
root |
1.4 |
#ifndef NO_SETOWNER_TTYDEV |
| 22 |
root |
1.1 |
void privileges (rxvt_privaction action); |
| 23 |
root |
1.4 |
bool saved; |
| 24 |
|
|
#endif |
| 25 |
root |
1.1 |
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 |
root |
1.2 |
void close_tty (); |
| 37 |
|
|
|
| 38 |
root |
1.1 |
bool make_controlling_tty (); |
| 39 |
root |
1.3 |
void set_utf8_mode (bool on); |
| 40 |
root |
1.1 |
}; |
| 41 |
|
|
|
| 42 |
|
|
#endif |
| 43 |
|
|
|