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
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; struct tm;
login_time_t parse_lt(const char *); 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_ltm(const login_time_t *, struct tm *, time_t *);
int in_ltms(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 */ /* helper functions */

View File

@ -19,13 +19,15 @@
.\" .\"
.\" $FreeBSD$ .\" $FreeBSD$
.\" .\"
.Dd January 2, 1997 .Dd October 20, 2008
.Os .Os
.Dt LOGIN_TIMES 3 .Dt LOGIN_TIMES 3
.Sh NAME .Sh NAME
.Nm parse_lt , .Nm parse_lt ,
.Nm in_lt ,
.Nm in_ltm , .Nm in_ltm ,
.Nm in_ltms .Nm in_ltms ,
.Nm in_lts
.Nd functions for parsing and checking login time periods .Nd functions for parsing and checking login time periods
.Sh LIBRARY .Sh LIBRARY
.Lb libutil .Lb libutil
@ -36,9 +38,13 @@
.Ft login_time_t .Ft login_time_t
.Fn parse_lt "const char *str" .Fn parse_lt "const char *str"
.Ft int .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" .Fn in_ltm "const login_time_t *lt" "struct tm *t" "time_t *ends"
.Ft int .Ft int
.Fn in_ltms "const login_time_t *lt" "struct tm *t" "time_t *ends" .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 .Sh DESCRIPTION
This set of functions may be used for parsing and checking login and This set of functions may be used for parsing and checking login and
session times against a predefined list of allowed login times as 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 .Ar lt_dow
field set to field set to
.Em LTM_NONE . .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 .Sh RETURN VALUES
The The
.Fn parse_lt .Fn parse_lt