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.4 by root, Mon Jan 2 15:10:18 2006 UTC vs.
Revision 1.22 by sf-exg, Wed Jul 21 08:47:15 2010 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines