ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libptytty/src/ptytty.h
Revision: 1.3
Committed: Sat Jan 21 22:06:16 2006 UTC (18 years, 4 months ago) by root
Content type: text/plain
Branch: MAIN
Changes since 1.2: +3 -2 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 #ifndef PTYTTY_H
2     #define PTYTTY_H
3    
4 root 1.3 #include "libpty.h"
5    
6     #include "ptytty_conf.h"
7 root 1.1
8 root 1.2 #if defined(HAVE__GETPTY) || defined(HAVE_OPENPTY) || defined(UNIX98_PTY)
9 root 1.1 # define NO_SETOWNER_TTYDEV 1
10     #endif
11    
12 root 1.2 #if UTMP_SUPPORT
13     # if !defined(RXVT_UTMPX_FILE) || !defined(HAVE_STRUCT_UTMPX) || defined(__GLIBC__)
14     # undef HAVE_UTMPX_H
15     # undef HAVE_STRUCT_UTMPX
16     # endif
17     # if !defined(RXVT_UTMP_FILE) || !defined(HAVE_STRUCT_UTMP)
18     # undef HAVE_UTMP_H
19     # undef HAVE_STRUCT_UTMP
20     # endif
21    
22     # ifdef HAVE_UTMPX_H
23     # include <utmpx.h>
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 RXVT_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 root 1.1
48     #endif
49 root 1.2
50     struct rxvt_ptytty_unix : rxvt_ptytty
51     {
52     char *name;
53    
54 root 1.1 public:
55    
56 root 1.2 rxvt_ptytty_unix ();
57     ~rxvt_ptytty_unix ();
58 root 1.1
59     bool get ();
60     void put ();
61    
62 root 1.2 #if UTMP_SUPPORT
63     int utmp_pos;
64     int cmd_pid;
65     bool login_shell;
66 root 1.1
67 root 1.2 #ifdef HAVE_STRUCT_UTMP
68     struct utmp ut;
69     #endif
70     #ifdef HAVE_STRUCT_UTMPX
71     struct utmpx utx;
72     #endif
73     #if (defined(HAVE_STRUCT_UTMP) && defined(HAVE_UTMP_PID)) || defined(HAVE_STRUCT_UTMPX)
74     char ut_id[5];
75     #endif
76    
77     void login (int cmd_pid, bool login_shell, const char *hostname);
78     void logout ();
79     #endif
80 root 1.1 };
81    
82     #endif
83