ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libptytty/src/libptytty.h
Revision: 1.11
Committed: Wed Jan 25 10:49:40 2006 UTC (18 years, 4 months ago) by root
Content type: text/plain
Branch: MAIN
CVS Tags: rel-0_1, rel-0_2
Changes since 1.10: +1 -1 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.10 // This file is part of libptytty. Do not make local modifications.
2     // http://software.schmorp.de/pkg/libptytty
3 root 1.5
4 root 1.10 #ifndef LIBPTYTTY_H_ /* public libptytty header file */
5     #define LIBPTYTTY_H_
6 root 1.1
7 root 1.10 #ifdef __cplusplus
8 root 1.8
9 root 1.10 // c++ api
10 root 1.8
11 root 1.10 struct ptytty {
12     int pty; // pty file descriptor; connected to rxvt
13     int tty; // tty file descriptor; connected to child
14 root 1.1
15 root 1.10 virtual ~ptytty ()
16     {
17     }
18 root 1.1
19 root 1.10 virtual bool get () = 0;
20     virtual void login (int cmd_pid, bool login_shell, const char *hostname) = 0;
21 root 1.1
22 root 1.10 void close_tty ();
23     bool make_controlling_tty ();
24     void set_utf8_mode (bool on);
25 root 1.1
26 root 1.10 static void init ();
27     static ptytty *create (); // create a new pty object
28 root 1.6
29 root 1.10 static void drop_privileges ();
30     static void use_helper ();
31 root 1.4
32 root 1.10 static bool send_fd (int socket, int fd);
33     static int recv_fd (int socket);
34 root 1.4
35 root 1.10 protected:
36 root 1.4
37 root 1.10 ptytty ()
38     : pty(-1), tty(-1)
39     {
40     }
41     };
42 root 1.1
43 root 1.10 #else
44 root 1.8
45 root 1.10 // c api
46 root 1.8
47 root 1.10 typedef void *PTYTTY;
48 root 1.8
49 root 1.10 int ptytty_pty (PTYTTY ptytty);
50     int ptytty_tty (PTYTTY ptytty);
51     void ptytty_delete (PTYTTY ptytty);
52     int ptytty_get (PTYTTY ptytty);
53 root 1.11 void ptytty_login (PTYTTY ptytty, int cmd_pid, int login_shell, const char *hostname);
54 root 1.8
55 root 1.10 void ptytty_close_tty (PTYTTY ptytty);
56     int ptytty_make_controlling_tty (PTYTTY ptytty);
57     void ptytty_set_utf8_mode (PTYTTY ptytty, int on);
58 root 1.8
59 root 1.10 void ptytty_init ();
60     PTYTTY ptytty_create ();
61 root 1.8
62 root 1.10 void ptytty_drop_privileges ();
63     void ptytty_use_helper ();
64 root 1.1
65 root 1.10 #endif
66 root 1.9
67 root 1.10 #endif
68 root 1.9