--- rxvt-unicode/src/rxvt.h 2006/01/17 05:47:42 1.212 +++ rxvt-unicode/src/rxvt.h 2006/01/17 12:29:40 1.219 @@ -96,6 +96,8 @@ # define STDERR_FILENO 2 #endif +enum rxvt_privaction { IGNORE = 'i', SAVE = 's', RESTORE = 'r' };//TODO + /* ***************************************************************************** * PROTOTYPES @@ -174,6 +176,29 @@ } bgPixmap_t; #endif +struct rxvt_ptytty { + int pty; // pty file descriptor; connected to rxvt + int tty; // tty file descriptor; connected to child + + virtual ~rxvt_ptytty () + { + // + } + + virtual bool get () = 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); +}; + +// a "factory" *g* +rxvt_ptytty *rxvt_new_ptytty (); + /* * the 'essential' information for reporting Mouse Events * pared down from XButtonEvent @@ -791,24 +816,6 @@ # define XPMClearArea(a, b, c, d, e, f, g) #endif -#ifdef UTMP_SUPPORT -# if !defined(RXVT_UTMPX_FILE) || !defined(HAVE_STRUCT_UTMPX) -# undef HAVE_UTMPX_H -# undef HAVE_STRUCT_UTMPX -# endif -# if !defined(RXVT_UTMP_FILE) || !defined(HAVE_STRUCT_UTMP) -# undef HAVE_UTMP_H -# undef HAVE_STRUCT_UTMP -# endif - -# ifdef HAVE_UTMPX_H -# include -# endif -# ifdef HAVE_UTMP_H -# include -# endif -#endif - #ifdef DEBUG_CMD # define D_CMD(x) fprintf x ; fputc('\n', stderr) #else @@ -1100,18 +1107,6 @@ struct mouse_event MEvent; XComposeStatus compose; ttymode_t tio; -#ifdef UTMP_SUPPORT -# ifdef HAVE_STRUCT_UTMP - struct utmp ut; -# endif -# ifdef HAVE_STRUCT_UTMPX - struct utmpx utx; -# endif -# if (defined(HAVE_STRUCT_UTMP) && defined(HAVE_UTMP_PID)) || defined(HAVE_STRUCT_UTMPX) - char ut_id[5]; -# endif - int utmp_pos; -#endif row_col_t oldcursor; #ifdef XPM_BACKGROUND bgPixmap_t bgPixmap; @@ -1154,6 +1149,8 @@ char *cmdbuf_ptr, *cmdbuf_endp; char cmdbuf_base[CBUFSIZ]; + rxvt_ptytty *pty; + rxvt_salloc *talloc; // text line allocator rxvt_salloc *ralloc; // rend line allocator @@ -1331,9 +1328,6 @@ // init.C void Get_Colours (); void get_ourmods (); - // logging.C - void makeutent (const char *pty, const char *hostname); - void cleanutent (); // main.C void privileged_utmp (rxvt_privaction action); bool set_fonts ();