1 // This file is part of libptytty. Do not make local modifications.
2 // http://software.schmorp.de/pkg/libptytty
4 #ifndef LIBPTYTTY_H_ /* public libptytty header file */
12 int pty; // pty file descriptor; connected to terminal emulator
13 int tty; // tty file descriptor; connected to child
19 virtual bool get () = 0;
20 virtual void login (int cmd_pid, bool login_shell, const char *hostname) = 0;
23 bool make_controlling_tty ();
24 void set_utf8_mode (bool on);
26 static void sanitise_stdfd ();
28 static ptytty *create (); // create a new pty object
30 static void drop_privileges ();
31 static void use_helper ();
33 static bool send_fd (int socket, int fd);
34 static int recv_fd (int socket);
50 int ptytty_pty (PTYTTY ptytty);
51 int ptytty_tty (PTYTTY ptytty);
52 void ptytty_delete (PTYTTY ptytty);
53 int ptytty_get (PTYTTY ptytty);
54 void ptytty_login (PTYTTY ptytty, int cmd_pid, int login_shell, const char *hostname);
56 void ptytty_close_tty (PTYTTY ptytty);
57 int ptytty_make_controlling_tty (PTYTTY ptytty);
58 void ptytty_set_utf8_mode (PTYTTY ptytty, int on);
60 void ptytty_sanitise_stdfd ();
62 PTYTTY ptytty_create ();
64 void ptytty_drop_privileges ();
65 void ptytty_use_helper ();