ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/libptytty/src/ptytty.h
Revision: 1.11
Committed: Mon May 16 20:58:27 2011 UTC (15 years, 5 months ago) by sf-exg
Content type: text/plain
Branch: MAIN
Changes since 1.10: +0 -9 lines
Log Message:
Remove dead code.

File Contents

# User Rev Content
1 root 1.7 // This file is part of libptytty. Do not make local modifications.
2     // http://software.schmorp.de/pkg/libptytty
3    
4 root 1.1 #ifndef PTYTTY_H
5     #define PTYTTY_H
6    
7 root 1.5 #include "libptytty.h"
8 root 1.3 #include "ptytty_conf.h"
9 root 1.1
10 root 1.9 #if PTYTTY_REENTRANT
11     # define PTYTTY_NO_PID_CHECK 1
12     #endif
13    
14 root 1.2 #if defined(HAVE__GETPTY) || defined(HAVE_OPENPTY) || defined(UNIX98_PTY)
15 root 1.1 # define NO_SETOWNER_TTYDEV 1
16     #endif
17    
18 root 1.2 #if UTMP_SUPPORT
19 sf-exg 1.10 # if !defined(HAVE_STRUCT_UTMPX) || defined(__GLIBC__)
20 root 1.2 # undef HAVE_UTMPX_H
21     # undef HAVE_STRUCT_UTMPX
22     # endif
23 root 1.4 # if !defined(UTMP_FILE) || !defined(HAVE_STRUCT_UTMP)
24 root 1.2 # undef HAVE_UTMP_H
25     # undef HAVE_STRUCT_UTMP
26     # endif
27    
28     # ifdef HAVE_UTMPX_H
29     # include <utmpx.h>
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 root 1.1 #endif
46 root 1.2
47 root 1.8 #define fatal(msg) do { write (2, msg, sizeof (msg) - 1); _exit (255); } while (0)
48    
49 root 1.4 struct ptytty_unix : ptytty
50 root 1.2 {
51     char *name;
52    
53 root 1.1 public:
54    
55 root 1.4 ptytty_unix ();
56     ~ptytty_unix ();
57 root 1.1
58     bool get ();
59     void put ();
60    
61 root 1.6 void login (int cmd_pid, bool login_shell, const char *hostname);
62    
63 root 1.2 #if UTMP_SUPPORT
64     int utmp_pos;
65     int cmd_pid;
66     bool login_shell;
67 root 1.1
68 root 1.2 #ifdef HAVE_STRUCT_UTMP
69     struct utmp ut;
70     #endif
71     #ifdef HAVE_STRUCT_UTMPX
72     struct utmpx utx;
73     #endif
74     #if (defined(HAVE_STRUCT_UTMP) && defined(HAVE_UTMP_PID)) || defined(HAVE_STRUCT_UTMPX)
75     char ut_id[5];
76     #endif
77    
78     void logout ();
79     #endif
80 root 1.1 };
81    
82     #endif
83