ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/ptytty.h
(Generate patch)

Comparing rxvt-unicode/src/ptytty.h (file contents):
Revision 1.5 by root, Wed Jan 4 02:01:38 2006 UTC vs.
Revision 1.18 by root, Sun Jan 22 00:48:13 2006 UTC

1#ifndef PTYTTY_H 1#ifndef PTYTTY_H
2#define PTYTTY_H 2#define PTYTTY_H
3 3
4#include "feature.h" 4#include "libptytty.h"
5 5
6#if defined(HAVE_GRANTPT) && defined(HAVE_UNLOCKPT) 6#include "ptytty_conf.h"
7# if defined(PTYS_ARE_GETPT) || defined(PTYS_ARE_PTMX) 7
8# define NO_SETOWNER_TTYDEV 1 8#if defined(HAVE__GETPTY) || defined(HAVE_OPENPTY) || defined(UNIX98_PTY)
9# endif
10#endif
11#if defined(__CYGWIN32__)
12# define NO_SETOWNER_TTYDEV 1 9# define NO_SETOWNER_TTYDEV 1
13#endif 10#endif
14 11
15enum rxvt_privaction { IGNORE = 'i', SAVE = 's', RESTORE = 'r' }; 12#if UTMP_SUPPORT
13# if !defined(UTMPX_FILE) || !defined(HAVE_STRUCT_UTMPX) || defined(__GLIBC__)
14# undef HAVE_UTMPX_H
15# undef HAVE_STRUCT_UTMPX
16# endif
17# if !defined(UTMP_FILE) || !defined(HAVE_STRUCT_UTMP)
18# undef HAVE_UTMP_H
19# undef HAVE_STRUCT_UTMP
20# endif
16 21
17struct rxvt_ptytty { 22# ifdef HAVE_UTMPX_H
18#ifndef RESET_TTY_TO_COMMON_DEFAULTS 23# include <utmpx.h>
19 struct stat savestat; /* original status of our tty */ 24# endif
25# ifdef HAVE_UTMP_H
26# include <utmp.h>
27# endif
28
29# if ! defined(HAVE_STRUCT_UTMPX) && ! defined(HAVE_STRUCT_UTMP)
30# error cannot build with utmp support - no utmp or utmpx struct found
31# endif
32
33# ifdef HAVE_LASTLOG_H
34# include <lastlog.h>
35# endif
36
37# include <pwd.h>
38
39# ifdef UTMP_SYSV
40# ifndef USER_PROCESS
41# define USER_PROCESS 7
42# endif
43# ifndef DEAD_PROCESS
44# define DEAD_PROCESS 8
45# endif
46# endif
47
20#endif 48#endif
21#ifndef NO_SETOWNER_TTYDEV 49
22 void privileges (rxvt_privaction action); 50struct ptytty_unix : ptytty
23 bool saved; 51{
24#endif
25public:
26 int pty; // pty file descriptor; connected to rxvt
27 int tty; // tty file descriptor; connected to child
28 char *name; 52 char *name;
29 53
30 rxvt_ptytty (); 54public:
31 ~rxvt_ptytty (); 55
56 ptytty_unix ();
57 ~ptytty_unix ();
32 58
33 bool get (); 59 bool get ();
34 void put (); 60 void put ();
35 61
36 void close_tty (); 62 void login (int cmd_pid, bool login_shell, const char *hostname);
37 63
38 bool make_controlling_tty (); 64#if UTMP_SUPPORT
39 void set_utf8_mode (bool on); 65 int utmp_pos;
66 int cmd_pid;
67 bool login_shell;
68
69#ifdef HAVE_STRUCT_UTMP
70 struct utmp ut;
71#endif
72#ifdef HAVE_STRUCT_UTMPX
73 struct utmpx utx;
74#endif
75#if (defined(HAVE_STRUCT_UTMP) && defined(HAVE_UTMP_PID)) || defined(HAVE_STRUCT_UTMPX)
76 char ut_id[5];
77#endif
78
79 void logout ();
80#endif
40}; 81};
41 82
42#endif 83#endif
43 84

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines