(inet_net_pton_ipv4): Correct typo in comment.
[glibc/history.git] / login / utmp.h
blob799b1a17acd11ba423d4aee633d1f248d11f3492
1 /* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
20 #ifndef _UTMP_H_
22 #define _UTMP_H_ 1
23 #include <features.h>
25 #include <sys/types.h>
28 __BEGIN_DECLS
30 /* Get system dependent values and data structures. */
31 #include <utmpbits.h>
33 /* Compatibility names for the strings of the canonical file names. */
34 #define UTMP_FILE _PATH_UTMP
35 #define UTMP_FILENAME _PATH_UTMP
36 #define WTMP_FILE _PATH_WTMP
37 #define WTMP_FILENAME _PATH_WTMP
41 /* Make FD be the controlling terminal, stdin, stdout, and stderr;
42 then close FD. Returns 0 on success, nonzero on error. */
43 extern int login_tty __P ((int __fd));
46 /* Write the given entry into utmp and wtmp. */
47 extern void login __P ((__const struct utmp *__entry));
49 /* Write the utmp entry to say the user on UT_LINE has logged out. */
50 extern int logout __P ((__const char *__ut_line));
52 /* Append to wtmp an entry for the current time and the given info. */
53 extern void logwtmp __P ((__const char *__ut_line, __const char *__ut_name,
54 __const char *__ut_host));
56 /* Append entry UTMP to the wtmp-like file WTMP_FILE. */
57 extern void updwtmp __P ((__const char *__wtmp_file,
58 __const struct utmp *__utmp));
60 /* Change name of the utmp file to be examined. */
61 extern int __utmpname __P ((__const char *__file));
62 extern int utmpname __P ((__const char *__file));
64 /* Read next entry from a utmp-like file. */
65 extern struct utmp *getutent __P ((void));
67 /* Reset the input stream to the beginning of the file. */
68 extern void __setutent __P ((void));
69 extern void setutent __P ((void));
71 /* Close the current open file. */
72 extern void __endutent __P ((void));
73 extern void endutent __P ((void));
75 /* Search forward from the current point in the utmp file until the
76 next entry with a ut_type matching ID->ut_type. */
77 extern struct utmp *getutid __P ((__const struct utmp *__id));
79 /* Search forward from the current point in the utmp file until the
80 next entry with a ut_line matching LINE->ut_line. */
81 extern struct utmp *getutline __P ((__const struct utmp *__line));
83 /* Write out entry pointed to by UTMP_PTR into the utmp file. */
84 extern struct utmp *pututline __P ((__const struct utmp *__utmp_ptr));
87 #ifdef __USE_MISC
88 /* Reentrant versions of the file for handling utmp files. */
89 extern int __getutent_r __P ((struct utmp *__buffer, struct utmp **__result));
90 extern int getutent_r __P ((struct utmp *__buffer, struct utmp **__result));
92 extern int __getutid_r __P ((__const struct utmp *__id, struct utmp *__buffer,
93 struct utmp **__result));
94 extern int getutid_r __P ((__const struct utmp *__id, struct utmp *__buffer,
95 struct utmp **__result));
97 extern int __getutline_r __P ((__const struct utmp *__line,
98 struct utmp *__buffer, struct utmp **__result));
99 extern int getutline_r __P ((__const struct utmp *__line,
100 struct utmp *__buffer, struct utmp **__result));
102 #endif /* Use misc. */
104 __END_DECLS
106 #endif /* utmp.h */