ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/libptytty.h
Revision: 1.3
Committed: Mon Jan 23 12:05:12 2006 UTC (18 years, 4 months ago) by root
Content type: text/plain
Branch: MAIN
Changes since 1.2: +25 -0 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.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 root 1.3 #ifdef __cplusplus
8    
9     // c++ api
10    
11 root 1.1 struct ptytty {
12     int pty; // pty file descriptor; connected to rxvt
13     int tty; // tty file descriptor; connected to child
14    
15     virtual ~ptytty ()
16     {
17     }
18    
19     virtual bool get () = 0;
20     virtual void login (int cmd_pid, bool login_shell, const char *hostname) = 0;
21    
22     void close_tty ();
23     bool make_controlling_tty ();
24     void set_utf8_mode (bool on);
25    
26     static void init ();
27     static ptytty *create (); // create a new pty object
28    
29     static void drop_privileges ();
30     static void use_helper ();
31    
32 root 1.2 static bool send_fd (int socket, int fd);
33 root 1.1 static int recv_fd (int socket);
34    
35     protected:
36    
37     ptytty ()
38     : pty(-1), tty(-1)
39     {
40     }
41     };
42    
43 root 1.3 #else
44    
45     // c api
46     int ptytty_pty (void *ptytty);
47     int ptytty_tty (void *ptytty);
48     void ptytty_delete (void *ptytty);
49     int ptytty_get (void *ptytty);
50     void ptytty_login (void *ptytty, int cmd_pid, bool login_shell, const char *hostname);
51    
52     void ptytty_close_tty (void *ptytty);
53     int ptytty_make_controlling_tty (void *ptytty);
54     void ptytty_set_utf8_mode (void *ptytty, int on);
55    
56     void ptytty_init ();
57     void *ptytty_create ();
58    
59     void ptytty_drop_privileges ();
60     void ptytty_use_helper ();
61    
62     #endif
63    
64 root 1.1 #endif
65