ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/logging.h
Revision: 1.5
Committed: Tue Jan 17 06:06:42 2006 UTC (18 years, 4 months ago) by root
Content type: text/plain
Branch: MAIN
Changes since 1.4: +38 -0 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 pcg 1.3 #ifndef LOGGING_H_
2     #define LOGGING_H_
3 pcg 1.1
4     #ifdef UTMP_SUPPORT
5 root 1.5 # if !defined(RXVT_UTMPX_FILE) || !defined(HAVE_STRUCT_UTMPX)
6     # undef HAVE_UTMPX_H
7     # undef HAVE_STRUCT_UTMPX
8     # endif
9     # if !defined(RXVT_UTMP_FILE) || !defined(HAVE_STRUCT_UTMP)
10     # undef HAVE_UTMP_H
11     # undef HAVE_STRUCT_UTMP
12     # endif
13    
14     # ifdef HAVE_UTMPX_H
15     # include <utmpx.h>
16     # endif
17     # ifdef HAVE_UTMP_H
18     # include <utmp.h>
19     # endif
20    
21 pcg 1.1 # if ! defined(HAVE_STRUCT_UTMPX) && ! defined(HAVE_STRUCT_UTMP)
22     # error cannot build with utmp support - no utmp or utmpx struct found
23     # endif
24    
25     # ifdef HAVE_LASTLOG_H
26     # include <lastlog.h>
27     # endif
28 root 1.5
29 pcg 1.1 # include <pwd.h>
30    
31     # ifdef RXVT_UTMP_SYSV
32     # ifndef USER_PROCESS
33     # define USER_PROCESS 7
34     # endif
35     # ifndef DEAD_PROCESS
36     # define DEAD_PROCESS 8
37     # endif
38     # endif
39    
40     # ifdef __QNX__
41     # include <sys/utsname.h>
42     # define ut_name ut_user
43     # endif
44    
45 root 1.5 struct rxvt_session
46     {
47     int utmp_pos;
48     int cmd_pid;
49     bool login_shell;
50    
51     #ifdef HAVE_STRUCT_UTMP
52     struct utmp ut;
53     #endif
54     #ifdef HAVE_STRUCT_UTMPX
55     struct utmpx utx;
56 pcg 1.1 #endif
57 root 1.5 #if (defined(HAVE_STRUCT_UTMP) && defined(HAVE_UTMP_PID)) || defined(HAVE_STRUCT_UTMPX)
58     char ut_id[5];
59     #endif
60    
61     void login (const char *pty, int cmd_pid, bool login_shell, const char *hostname);
62     void logout ();
63     };
64    
65     #endif
66    
67 pcg 1.1 #endif /* _LOGGING_H_ */