1 |
#ifndef LIBPTY_H_ /* public libpty header file */ |
2 |
#define LIBPTY_H_ |
3 |
|
4 |
struct ptytty { |
5 |
int pty; // pty file descriptor; connected to rxvt |
6 |
int tty; // tty file descriptor; connected to child |
7 |
|
8 |
virtual ~ptytty () |
9 |
{ |
10 |
} |
11 |
|
12 |
virtual bool get () = 0; |
13 |
#if UTMP_SUPPORT |
14 |
virtual void login (int cmd_pid, bool login_shell, const char *hostname) = 0; |
15 |
#endif |
16 |
|
17 |
void close_tty (); |
18 |
bool make_controlling_tty (); |
19 |
void set_utf8_mode (bool on); |
20 |
|
21 |
protected: |
22 |
ptytty () |
23 |
: pty(-1), tty(-1) |
24 |
{ |
25 |
} |
26 |
}; |
27 |
|
28 |
ptytty *ptytty_new (); // create a new pty object |
29 |
void ptytty_server (); // start the ptytty server process |
30 |
|
31 |
#endif |
32 |
|