Since in_lt() and in_lts() are not static, assume that they are intended to

be part of the public API.  Accordingly, add prototypes and document them.
This commit is contained in:
Dag-Erling Smørgrav 2008-10-20 17:17:58 +00:00
parent 532045df2e
commit b1720f52d3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=184088
2 changed files with 22 additions and 2 deletions

View File

@ -146,8 +146,10 @@ int auth_timeok(login_cap_t *, time_t);
struct tm;
login_time_t parse_lt(const char *);
int in_lt(const login_time_t *, time_t *);
int in_ltm(const login_time_t *, struct tm *, time_t *);
int in_ltms(const login_time_t *, struct tm *, time_t *);
int in_lts(const login_time_t *, time_t *);
/* helper functions */

View File

@ -19,13 +19,15 @@
.\"
.\" $FreeBSD$
.\"
.Dd January 2, 1997
.Dd October 20, 2008
.Os
.Dt LOGIN_TIMES 3
.Sh NAME
.Nm parse_lt ,
.Nm in_lt ,
.Nm in_ltm ,
.Nm in_ltms
.Nm in_ltms ,
.Nm in_lts
.Nd functions for parsing and checking login time periods
.Sh LIBRARY
.Lb libutil
@ -36,9 +38,13 @@
.Ft login_time_t
.Fn parse_lt "const char *str"
.Ft int
.Fn in_lt "const login_time_t *lt" "time_t *ends"
.Ft int
.Fn in_ltm "const login_time_t *lt" "struct tm *t" "time_t *ends"
.Ft int
.Fn in_ltms "const login_time_t *lt" "struct tm *t" "time_t *ends"
.Ft int
.Fn in_lts "const login_time_t *lt" "time_t *ends"
.Sh DESCRIPTION
This set of functions may be used for parsing and checking login and
session times against a predefined list of allowed login times as
@ -135,6 +141,18 @@ elements in length, and terminated by an element with its
.Ar lt_dow
field set to
.Em LTM_NONE .
.Pp
The
.Fn in_lt
and
.Fn in_lts
functions are equivalent to
.Fn in_ltm
and
.Fn in_ltms ,
respectively, with the second argument set to the current time as
returned by
.Xr localtime 3 .
.Sh RETURN VALUES
The
.Fn parse_lt