1 |
// This file is part of libptytty. Do not make local modifications. |
2 |
// http://software.schmorp.de/pkg/libptytty |
3 |
|
4 |
#ifndef PTYTTY_H |
5 |
#define PTYTTY_H |
6 |
|
7 |
#include "libptytty.h" |
8 |
#include "ptytty_conf.h" |
9 |
|
10 |
#if PTYTTY_REENTRANT |
11 |
# define PTYTTY_NO_PID_CHECK 1 |
12 |
#endif |
13 |
|
14 |
#if defined(HAVE__GETPTY) || defined(HAVE_OPENPTY) || defined(UNIX98_PTY) |
15 |
# define NO_SETOWNER_TTYDEV 1 |
16 |
#endif |
17 |
|
18 |
#if UTMP_SUPPORT |
19 |
# if defined(__GLIBC__) |
20 |
# undef HAVE_STRUCT_UTMPX |
21 |
# endif |
22 |
|
23 |
# if ! defined(HAVE_STRUCT_UTMPX) && ! defined(HAVE_STRUCT_UTMP) |
24 |
# error cannot build with utmp support - no utmp or utmpx struct found |
25 |
# endif |
26 |
|
27 |
#endif |
28 |
|
29 |
struct ptytty_unix : ptytty |
30 |
{ |
31 |
char *name; |
32 |
|
33 |
void log_session (bool login, const char *hostname); |
34 |
|
35 |
public: |
36 |
|
37 |
ptytty_unix (); |
38 |
~ptytty_unix (); |
39 |
|
40 |
bool get (); |
41 |
void put (); |
42 |
|
43 |
void login (int cmd_pid, bool login_shell, const char *hostname); |
44 |
|
45 |
#if UTMP_SUPPORT |
46 |
int utmp_pos; |
47 |
int cmd_pid; |
48 |
bool login_shell; |
49 |
|
50 |
void logout (); |
51 |
#endif |
52 |
}; |
53 |
|
54 |
#endif |
55 |
|