97 lines
3.6 KiB
C
97 lines
3.6 KiB
C
/* $NetBSD: time.h,v 1.40 2010/12/16 18:36:47 christos Exp $ */
|
|
|
|
/*
|
|
* Copyright (c) 1989, 1993
|
|
* The Regents of the University of California. All rights reserved.
|
|
* (c) UNIX System Laboratories, Inc.
|
|
* All or some portions of this file are derived from material licensed
|
|
* to the University of California by American Telephone and Telegraph
|
|
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
|
|
* the permission of UNIX System Laboratories, Inc.
|
|
*
|
|
* Redistribution and use in source and binary forms, with or without
|
|
* modification, are permitted provided that the following conditions
|
|
* are met:
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
* notice, this list of conditions and the following disclaimer.
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
* documentation and/or other materials provided with the distribution.
|
|
* 3. Neither the name of the University nor the names of its contributors
|
|
* may be used to endorse or promote products derived from this software
|
|
* without specific prior written permission.
|
|
*
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
* SUCH DAMAGE.
|
|
*
|
|
* @(#)time.h 8.3 (Berkeley) 1/21/94
|
|
*/
|
|
|
|
/**
|
|
* @file tz.h
|
|
* @brief
|
|
* Parts of this file was retrieved from:
|
|
* ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-release-6/src/include/time.h
|
|
*/
|
|
|
|
#ifndef _TZ_HEADER
|
|
#define _TZ_HEADER
|
|
|
|
extern char *tzname[2];
|
|
|
|
#define TZVARIABLE "timezone.prefs"
|
|
#define TZDIR "LOCALE:Zoneinfo"
|
|
#define TZDEFAULT "localtime"
|
|
|
|
struct tm {
|
|
int tm_sec; /* seconds after the minute [0-61] */
|
|
int tm_min; /* minutes after the hour [0-59] */
|
|
int tm_hour; /* hours since midnight [0-23] */
|
|
int tm_mday; /* day of the month [1-31] */
|
|
int tm_mon; /* months since January [0-11] */
|
|
int tm_year; /* years since 1900 */
|
|
int tm_wday; /* days since Sunday [0-6] */
|
|
int tm_yday; /* days since January 1 [0-365] */
|
|
int tm_isdst; /* Daylight Savings Time flag */
|
|
long tm_gmtoff; /* offset from UTC in seconds */
|
|
char *tm_zone; /* timezone abbreviation */
|
|
};
|
|
|
|
#ifndef HAVE_TIME_T
|
|
typedef long time_t;
|
|
#endif
|
|
|
|
typedef struct state *timezone_t;
|
|
|
|
void tzset(void);
|
|
void tzfree(const timezone_t);
|
|
timezone_t tzalloc(const char *);
|
|
time_t time(time_t *);
|
|
time_t mktime_z(const timezone_t, struct tm *);
|
|
time_t mktime(struct tm *);
|
|
struct tm *localtime_rz(const timezone_t, const time_t *, struct tm *);
|
|
struct tm *localtime_r(const time_t *, struct tm *);
|
|
struct tm *localtime(const time_t *);
|
|
struct tm *gmtime_r(const time_t *, struct tm *);
|
|
struct tm *gmtime(const time_t *);
|
|
char *ctime_r(const time_t *, char *);
|
|
char *ctime(const time_t *);
|
|
double difftime(time_t, time_t);
|
|
time_t time(time_t *x);
|
|
|
|
#ifndef HAVE_ASCTIME
|
|
char *asctime_r(const struct tm *, char *);
|
|
char *asctime(const struct tm *);
|
|
#endif
|
|
|
|
#endif
|