ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libptytty/src/libptytty.h
Revision: 1.8
Committed: Mon Jan 23 11:21:48 2006 UTC (20 years, 7 months ago) by root
Content type: text/plain
Branch: MAIN
Changes since 1.7: +25 -0 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.5 // This file is part of libptytty. Do not make local modifications.
2     // http://software.schmorp.de/pkg/libptytty
3    
4 root 1.3 #ifndef LIBPTYTTY_H_ /* public libptytty header file */
5     #define LIBPTYTTY_H_
6 root 1.1
7 root 1.8 #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 root 1.4 static void init ();
27 root 1.6 static ptytty *create (); // create a new pty object
28    
29 root 1.4 static void drop_privileges ();
30 root 1.6 static void use_helper ();
31 root 1.4
32 root 1.7 static bool send_fd (int socket, int fd);
33 root 1.4 static int recv_fd (int socket);
34    
35 root 1.1 protected:
36 root 1.4
37 root 1.1 ptytty ()
38     : pty(-1), tty(-1)
39     {
40     }
41     };
42    
43 root 1.8 #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