| 1 |
root |
1.1 |
#ifndef PTYTTY_H |
| 2 |
|
|
#define PTYTTY_H |
| 3 |
|
|
|
| 4 |
root |
1.2 |
#include "rxvt.h" |
| 5 |
root |
1.1 |
#include "feature.h" |
| 6 |
|
|
|
| 7 |
root |
1.2 |
#if defined(HAVE__GETPTY) || defined(HAVE_OPENPTY) || defined(UNIX98_PTY) |
| 8 |
root |
1.1 |
# define NO_SETOWNER_TTYDEV 1 |
| 9 |
|
|
#endif |
| 10 |
|
|
|
| 11 |
root |
1.2 |
#if UTMP_SUPPORT |
| 12 |
|
|
# if !defined(RXVT_UTMPX_FILE) || !defined(HAVE_STRUCT_UTMPX) || defined(__GLIBC__) |
| 13 |
|
|
# undef HAVE_UTMPX_H |
| 14 |
|
|
# undef HAVE_STRUCT_UTMPX |
| 15 |
|
|
# endif |
| 16 |
|
|
# if !defined(RXVT_UTMP_FILE) || !defined(HAVE_STRUCT_UTMP) |
| 17 |
|
|
# undef HAVE_UTMP_H |
| 18 |
|
|
# undef HAVE_STRUCT_UTMP |
| 19 |
|
|
# endif |
| 20 |
|
|
|
| 21 |
|
|
# ifdef HAVE_UTMPX_H |
| 22 |
|
|
# include <utmpx.h> |
| 23 |
|
|
# endif |
| 24 |
|
|
# ifdef HAVE_UTMP_H |
| 25 |
|
|
# include <utmp.h> |
| 26 |
|
|
# endif |
| 27 |
|
|
|
| 28 |
|
|
# if ! defined(HAVE_STRUCT_UTMPX) && ! defined(HAVE_STRUCT_UTMP) |
| 29 |
|
|
# error cannot build with utmp support - no utmp or utmpx struct found |
| 30 |
|
|
# endif |
| 31 |
|
|
|
| 32 |
|
|
# ifdef HAVE_LASTLOG_H |
| 33 |
|
|
# include <lastlog.h> |
| 34 |
|
|
# endif |
| 35 |
|
|
|
| 36 |
|
|
# include <pwd.h> |
| 37 |
|
|
|
| 38 |
|
|
# ifdef RXVT_UTMP_SYSV |
| 39 |
|
|
# ifndef USER_PROCESS |
| 40 |
|
|
# define USER_PROCESS 7 |
| 41 |
|
|
# endif |
| 42 |
|
|
# ifndef DEAD_PROCESS |
| 43 |
|
|
# define DEAD_PROCESS 8 |
| 44 |
|
|
# endif |
| 45 |
|
|
# endif |
| 46 |
root |
1.1 |
|
| 47 |
|
|
#endif |
| 48 |
root |
1.2 |
|
| 49 |
|
|
struct rxvt_ptytty_unix : rxvt_ptytty |
| 50 |
|
|
{ |
| 51 |
|
|
char *name; |
| 52 |
|
|
|
| 53 |
root |
1.1 |
public: |
| 54 |
|
|
|
| 55 |
root |
1.2 |
rxvt_ptytty_unix (); |
| 56 |
|
|
~rxvt_ptytty_unix (); |
| 57 |
root |
1.1 |
|
| 58 |
|
|
bool get (); |
| 59 |
|
|
void put (); |
| 60 |
|
|
|
| 61 |
root |
1.2 |
#if UTMP_SUPPORT |
| 62 |
|
|
int utmp_pos; |
| 63 |
|
|
int cmd_pid; |
| 64 |
|
|
bool login_shell; |
| 65 |
root |
1.1 |
|
| 66 |
root |
1.2 |
#ifdef HAVE_STRUCT_UTMP |
| 67 |
|
|
struct utmp ut; |
| 68 |
|
|
#endif |
| 69 |
|
|
#ifdef HAVE_STRUCT_UTMPX |
| 70 |
|
|
struct utmpx utx; |
| 71 |
|
|
#endif |
| 72 |
|
|
#if (defined(HAVE_STRUCT_UTMP) && defined(HAVE_UTMP_PID)) || defined(HAVE_STRUCT_UTMPX) |
| 73 |
|
|
char ut_id[5]; |
| 74 |
|
|
#endif |
| 75 |
|
|
|
| 76 |
|
|
void login (int cmd_pid, bool login_shell, const char *hostname); |
| 77 |
|
|
void logout (); |
| 78 |
|
|
#endif |
| 79 |
root |
1.1 |
}; |
| 80 |
|
|
|
| 81 |
|
|
#endif |
| 82 |
|
|
|