From owner-svn-src-all@FreeBSD.ORG Mon Oct 20 17:17:58 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E48061065670; Mon, 20 Oct 2008 17:17:58 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D28BF8FC2B; Mon, 20 Oct 2008 17:17:58 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KHHwc3076354; Mon, 20 Oct 2008 17:17:58 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KHHw4T076352; Mon, 20 Oct 2008 17:17:58 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810201717.m9KHHw4T076352@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 20 Oct 2008 17:17:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184088 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 17:17:59 -0000 Author: des Date: Mon Oct 20 17:17:58 2008 New Revision: 184088 URL: http://svn.freebsd.org/changeset/base/184088 Log: 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. Modified: head/lib/libutil/login_cap.h head/lib/libutil/login_times.3 Modified: head/lib/libutil/login_cap.h ============================================================================== --- head/lib/libutil/login_cap.h Mon Oct 20 17:09:50 2008 (r184087) +++ head/lib/libutil/login_cap.h Mon Oct 20 17:17:58 2008 (r184088) @@ -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 */ Modified: head/lib/libutil/login_times.3 ============================================================================== --- head/lib/libutil/login_times.3 Mon Oct 20 17:09:50 2008 (r184087) +++ head/lib/libutil/login_times.3 Mon Oct 20 17:17:58 2008 (r184088) @@ -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 .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