1 |
/* Declarations for GNU's read utmp module. |
/* Declarations for GNU's read utmp module. |
2 |
|
|
3 |
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, |
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, |
4 |
2001, 2002, 2003, 2004 Free Software Foundation, Inc. |
2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
5 |
|
|
6 |
This program is free software; you can redistribute it and/or modify |
This program is free software; you can redistribute it and/or modify |
7 |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
15 |
|
|
16 |
You should have received a copy of the GNU General Public License |
You should have received a copy of the GNU General Public License |
17 |
along with this program; if not, write to the Free Software Foundation, |
along with this program; if not, write to the Free Software Foundation, |
18 |
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ |
19 |
|
|
20 |
/* Written by jla; revised by djm */ |
/* Written by jla; revised by djm */ |
21 |
|
|
167 |
# define WTMP_FILE "/etc/wtmp" |
# define WTMP_FILE "/etc/wtmp" |
168 |
# endif |
# endif |
169 |
|
|
170 |
|
# if HAVE_STRUCT_XTMP_UT_PID |
171 |
|
# define UT_PID(U) ((U)->ut_pid) |
172 |
|
# else |
173 |
|
# define UT_PID(U) 0 |
174 |
|
# endif |
175 |
|
|
176 |
# if HAVE_STRUCT_UTMP_UT_TYPE || HAVE_STRUCT_UTMPX_UT_TYPE |
# if HAVE_STRUCT_UTMP_UT_TYPE || HAVE_STRUCT_UTMPX_UT_TYPE |
177 |
# define UT_TYPE_EQ(U, V) ((U)->ut_type == (V)) |
# define UT_TYPE_EQ(U, V) ((U)->ut_type == (V)) |
178 |
# define UT_TYPE_NOT_DEFINED 0 |
# define UT_TYPE_NOT_DEFINED 0 |
198 |
&& (UT_TYPE_USER_PROCESS (U) \ |
&& (UT_TYPE_USER_PROCESS (U) \ |
199 |
|| (UT_TYPE_NOT_DEFINED && UT_TIME_MEMBER (U) != 0))) |
|| (UT_TYPE_NOT_DEFINED && UT_TIME_MEMBER (U) != 0))) |
200 |
|
|
201 |
|
/* Options for read_utmp. */ |
202 |
|
enum |
203 |
|
{ |
204 |
|
READ_UTMP_CHECK_PIDS = 1 |
205 |
|
}; |
206 |
|
|
207 |
char *extract_trimmed_name (const STRUCT_UTMP *ut); |
char *extract_trimmed_name (const STRUCT_UTMP *ut); |
208 |
int read_utmp (const char *filename, size_t *n_entries, STRUCT_UTMP **utmp_buf); |
int read_utmp (char const *file, size_t *n_entries, STRUCT_UTMP **utmp_buf, |
209 |
|
int options); |
210 |
|
|
211 |
#endif /* __READUTMP_H__ */ |
#endif /* __READUTMP_H__ */ |