*** empty log message ***
authorroot <root>
Sun, 22 Jan 2006 09:57:48 +0000 (09:57 +0000)
committerroot <root>
Sun, 22 Jan 2006 09:57:48 +0000 (09:57 +0000)
src/libptytty.h [new file with mode: 0644]

diff --git a/src/libptytty.h b/src/libptytty.h
new file mode 100644 (file)
index 0000000..b7f6c1c
--- /dev/null
@@ -0,0 +1,40 @@
+// This file is part of libptytty. Do not make local modifications.
+// http://software.schmorp.de/pkg/libptytty
+
+#ifndef LIBPTYTTY_H_ /* public libptytty header file */
+#define LIBPTYTTY_H_
+
+struct ptytty {
+  int pty; // pty file descriptor; connected to rxvt
+  int tty; // tty file descriptor; connected to child
+
+  virtual ~ptytty ()
+  {
+  }
+
+  virtual bool get () = 0;
+  virtual void login (int cmd_pid, bool login_shell, const char *hostname) = 0;
+
+  void close_tty ();
+  bool make_controlling_tty ();
+  void set_utf8_mode (bool on);
+
+  static void init ();
+  static ptytty *create (); // create a new pty object
+
+  static void drop_privileges ();
+  static void use_helper ();
+
+  static int send_fd (int socket, int fd);
+  static int recv_fd (int socket);
+
+protected:
+
+  ptytty ()
+  : pty(-1), tty(-1)
+  {
+  }
+};
+
+#endif
+