1 |
// This file is part of libptytty. Do not make local modifications. |
2 |
// http://software.schmorp.de/pkg/libptytty |
3 |
|
4 |
#ifndef LIBPTYTTY_H_ /* public libptytty header file */ |
5 |
#define LIBPTYTTY_H_ |
6 |
|
7 |
struct ptytty { |
8 |
int pty; // pty file descriptor; connected to rxvt |
9 |
int tty; // tty file descriptor; connected to child |
10 |
|
11 |
virtual ~ptytty () |
12 |
{ |
13 |
} |
14 |
|
15 |
virtual bool get () = 0; |
16 |
virtual void login (int cmd_pid, bool login_shell, const char *hostname) = 0; |
17 |
|
18 |
void close_tty (); |
19 |
bool make_controlling_tty (); |
20 |
void set_utf8_mode (bool on); |
21 |
|
22 |
static void init (); |
23 |
static ptytty *create (); // create a new pty object |
24 |
|
25 |
static void drop_privileges (); |
26 |
static void use_helper (); |
27 |
|
28 |
static int send_fd (int socket, int fd); |
29 |
static int recv_fd (int socket); |
30 |
|
31 |
protected: |
32 |
|
33 |
ptytty () |
34 |
: pty(-1), tty(-1) |
35 |
{ |
36 |
} |
37 |
}; |
38 |
|
39 |
#endif |
40 |
|