Tizen 2.0 Release
[framework/uifw/xorg/util/x11-xserver-utils.git] / sessreg / sessreg.h
1 /*
2  * Copyright 1990, 1998  The Open Group
3  *
4  * Permission to use, copy, modify, distribute, and sell this software and its
5  * documentation for any purpose is hereby granted without fee, provided that
6  * the above copyright notice appear in all copies and that both that
7  * copyright notice and this permission notice appear in supporting
8  * documentation.
9  *
10  * The above copyright notice and this permission notice shall be included
11  * in all copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
14  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16  * IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
17  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
19  * OTHER DEALINGS IN THE SOFTWARE.
20  *
21  * Except as contained in this notice, the name of The Open Group shall
22  * not be used in advertising or otherwise to promote the sale, use or
23  * other dealings in this Software without prior written authorization
24  * from The Open Group.
25  *
26  */
27
28 /*
29  * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
30  *
31  * Permission is hereby granted, free of charge, to any person obtaining a
32  * copy of this software and associated documentation files (the "Software"),
33  * to deal in the Software without restriction, including without limitation
34  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
35  * and/or sell copies of the Software, and to permit persons to whom the
36  * Software is furnished to do so, subject to the following conditions:
37  *
38  * The above copyright notice and this permission notice (including the next
39  * paragraph) shall be included in all copies or substantial portions of the
40  * Software.
41  *
42  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
43  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
44  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
45  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
46  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
47  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
48  * DEALINGS IN THE SOFTWARE.
49  */
50
51 #include "config.h"
52
53 #include <sys/types.h>
54 #include <time.h>
55
56 #ifdef HAVE_UTMP_H
57 # include <utmp.h>
58 # define USE_UTMP
59 #endif
60
61 #ifdef HAVE_UTMPX_H
62 # include <utmpx.h>
63 # define USE_UTMPX
64 #endif
65
66 #ifdef HAVE_SYS_PARAM_H
67 # include <sys/param.h>
68 #endif
69
70 #if defined(HAVE_STRUCT_LASTLOG) && defined(HAVE_PWD_H)
71 # ifdef HAVE_LASTLOG_H
72 #  include <lastlog.h>
73 # endif
74 # include <pwd.h>
75 # define USE_LASTLOG
76 #endif
77
78 #ifdef CSRG_BASED
79 #if !defined(__FreeBSD__) && !defined(__OpenBSD__)
80 /* *BSD doesn't like a ':0' type entry in utmp */
81 #define NO_UTMP
82 #endif
83 #endif
84
85 #ifndef WTMP_FILE
86 # ifdef _PATH_WTMP
87 #  define WTMP_FILE     _PATH_WTMP
88 # else
89 #  define WTMP_FILE     "/usr/adm/wtmp"
90 # endif
91 #endif
92 #ifndef UTMP_FILE
93 # ifdef _PATH_UTMP
94 #  define UTMP_FILE     _PATH_UTMP
95 # else
96 #  define UTMP_FILE     "/etc/utmp"
97 # endif
98 #endif
99 #ifndef LLOG_FILE
100 # ifdef _PATH_LASTLOG
101 #  define LLOG_FILE     _PATH_LASTLOG
102 # else
103 #  define LLOG_FILE     "/usr/adm/lastlog"
104 # endif
105 #endif
106 #ifndef TTYS_FILE
107 # define TTYS_FILE      "/etc/ttys"
108 #endif