Annotation of othersrc/usr.bin/sleepto/stime.h, revision 1.2

1.2     ! simonb      1: /* from        NetBSD: stime.h,v 1.4 2008/04/05 16:26:57 christos Exp  */
        !             2: /*     $NetBSD: stime.h,v 1.1 2021/02/25 07:52:27 simonb Exp $ */
1.1       simonb      3: 
                      4: /*
                      5:  * Copyright (c) 1993
                      6:  *     The Regents of the University of California.  All rights reserved.
                      7:  *
                      8:  * Redistribution and use in source and binary forms, with or without
                      9:  * modification, are permitted provided that the following conditions
                     10:  * are met:
                     11:  * 1. Redistributions of source code must retain the above copyright
                     12:  *    notice, this list of conditions and the following disclaimer.
                     13:  * 2. Redistributions in binary form must reproduce the above copyright
                     14:  *    notice, this list of conditions and the following disclaimer in the
                     15:  *    documentation and/or other materials provided with the distribution.
                     16:  * 3. Neither the name of the University nor the names of its contributors
                     17:  *    may be used to endorse or promote products derived from this software
                     18:  *    without specific prior written permission.
                     19:  *
                     20:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     21:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     22:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     23:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     24:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     25:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     26:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     27:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     28:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     29:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     30:  * SUCH DAMAGE.
                     31:  */
                     32: 
                     33: #ifndef _STIME_H_
                     34: #define _STIME_H_
                     35: 
                     36: /*
                     37:  * Convert a 2-digit year to a valid year as:
                     38:  *   00-68 <-> 2000-2068
                     39:  *   69-99 <-> 1969-1999
                     40:  *
                     41:  * Note: We choose the earliest year as 1969 rather than 1970 so that
                     42:  * dates near the Epoch (Jan 1, 1970 00:00:00 UTC) can be represented
                     43:  * with 2-digit years in all time zones.  This is the convention used
                     44:  * in parsedate(3), though it is not consistently applied in the
                     45:  * source tree.
                     46:  *
                     47:  * XXX - move this (or something like it) to time.h and use it
                     48:  *       consistently in the tree.
                     49:  */
                     50: #define conv_2dig_year(y) ((y) < 69 ? (y) + 2000 : (y) + 1900)
                     51: 
                     52: time_t stime(char *);
                     53: 
                     54: #endif /* _STIME_H_ */

CVSweb <webmaster@jp.NetBSD.org>