--- rxvt-unicode/src/ptytty.h 2006/01/17 10:14:26 1.6 +++ rxvt-unicode/src/ptytty.h 2006/01/17 11:02:10 1.9 @@ -4,7 +4,7 @@ #include "feature.h" #if defined(HAVE_GRANTPT) && defined(HAVE_UNLOCKPT) -# if defined(PTYS_ARE_GETPT) || defined(PTYS_ARE_PTMX) +# if defined(PTYS_ARE_GETPT) || defined(PTYS_ARE_POSIX) || defined(PTYS_ARE_PTMX) # define NO_SETOWNER_TTYDEV 1 # endif #endif @@ -48,38 +48,45 @@ # endif # endif -# ifdef __QNX__ -# include -# define ut_name ut_user -# endif - #endif enum rxvt_privaction { IGNORE = 'i', SAVE = 's', RESTORE = 'r' }; struct rxvt_ptytty { -#ifndef RESET_TTY_TO_COMMON_DEFAULTS - struct stat savestat; /* original status of our tty */ -#endif -#ifndef NO_SETOWNER_TTYDEV - void privileges (rxvt_privaction action); - bool saved; -#endif -public: int pty; // pty file descriptor; connected to rxvt int tty; // tty file descriptor; connected to child - char *name; - rxvt_ptytty (); - ~rxvt_ptytty (); + virtual ~rxvt_ptytty () + { + // + } - bool get (); - void put (); + virtual bool get () = 0; + virtual void put () = 0; + + virtual void login (int cmd_pid, bool login_shell, const char *hostname) = 0; + virtual void logout () = 0; void close_tty (); bool make_controlling_tty (); void set_utf8_mode (bool on); +}; + +struct rxvt_ptytty_unix : rxvt_ptytty { + char *name; + +#ifndef RESET_TTY_TO_COMMON_DEFAULTS + struct stat savestat; /* original status of our tty */ +#endif +#ifndef NO_SETOWNER_TTYDEV + void privileges (rxvt_privaction action); + bool saved; +#endif +public: + + rxvt_ptytty_unix (); + ~rxvt_ptytty_unix (); #if UTMP_SUPPORT int utmp_pos; @@ -96,6 +103,9 @@ char ut_id[5]; #endif + bool get (); + void put (); + void login (int cmd_pid, bool login_shell, const char *hostname); void logout (); #endif