time.h revision 5231
16485Sache/* 26485Sache * Copyright (c) 1989, 1993 36485Sache * The Regents of the University of California. All rights reserved. 46485Sache * (c) UNIX System Laboratories, Inc. 56485Sache * All or some portions of this file are derived from material licensed 6227753Stheraven * to the University of California by American Telephone and Telegraph 7227753Stheraven * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8227753Stheraven * the permission of UNIX System Laboratories, Inc. 9227753Stheraven * 10227753Stheraven * Redistribution and use in source and binary forms, with or without 116485Sache * modification, are permitted provided that the following conditions 126485Sache * are met: 136485Sache * 1. Redistributions of source code must retain the above copyright 146485Sache * notice, this list of conditions and the following disclaimer. 156485Sache * 2. Redistributions in binary form must reproduce the above copyright 166485Sache * notice, this list of conditions and the following disclaimer in the 176485Sache * documentation and/or other materials provided with the distribution. 186485Sache * 3. All advertising materials mentioning features or use of this software 196485Sache * must display the following acknowledgement: 206485Sache * This product includes software developed by the University of 216485Sache * California, Berkeley and its contributors. 226485Sache * 4. Neither the name of the University nor the names of its contributors 236485Sache * may be used to endorse or promote products derived from this software 246485Sache * without specific prior written permission. 256485Sache * 266485Sache * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 276485Sache * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 286485Sache * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 296485Sache * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 306485Sache * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 316485Sache * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 326485Sache * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3392986Sobrien * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3492986Sobrien * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3592986Sobrien * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3671579Sdeischen * SUCH DAMAGE. 37102658Sache * 386485Sache * @(#)time.h 8.3 (Berkeley) 1/21/94 396485Sache */ 406485Sache 416523Sache#ifndef _TIME_H_ 426523Sache#define _TIME_H_ 436485Sache 4471579Sdeischen#include <machine/ansi.h> 4571579Sdeischen 466485Sache#ifndef NULL 4722330Sache#define NULL 0 48101498Sache#endif 496485Sache 5093399Smarkm#ifdef _BSD_CLOCK_T_ 5193399Smarkmtypedef _BSD_CLOCK_T_ clock_t; 52227753Stheraven#undef _BSD_CLOCK_T_ 53227753Stheraven#endif 54227753Stheraven 55227753Stheraven#ifdef _BSD_TIME_T_ 56227753Stheraventypedef _BSD_TIME_T_ time_t; 57227753Stheraven#undef _BSD_TIME_T_ 58227753Stheraven#endif 59227753Stheraven 60227753Stheraven#ifdef _BSD_SIZE_T_ 61227753Stheraventypedef _BSD_SIZE_T_ size_t; 62227753Stheraven#undef _BSD_SIZE_T_ 63238182Stheraven#endif 64101498Sache 656485Sachestruct tm { 66227753Stheraven int tm_sec; /* seconds after the minute [0-60] */ 67227753Stheraven int tm_min; /* minutes after the hour [0-59] */ 68227753Stheraven int tm_hour; /* hours since midnight [0-23] */ 69227753Stheraven int tm_mday; /* day of the month [1-31] */ 70227753Stheraven int tm_mon; /* months since January [0-11] */ 71227753Stheraven int tm_year; /* years since 1900 */ 72227753Stheraven int tm_wday; /* days since Sunday [0-6] */ 73227753Stheraven int tm_yday; /* days since January 1 [0-365] */ 7418286Sbde int tm_isdst; /* Daylight Savings Time flag */ 756523Sache long tm_gmtoff; /* offset from CUT in seconds */ 766523Sache char *tm_zone; /* timezone abbreviation */ 77227753Stheraven}; 78227753Stheraven 79227753Stheraven#include <machine/limits.h> /* Include file containing CLK_TCK. */ 80227753Stheraven 81227753Stheraven#include <sys/cdefs.h> 82227753Stheraven 83227753Stheraven__BEGIN_DECLS 84227753Stheravenchar *asctime __P((const struct tm *)); 85227753Stheravenclock_t clock __P((void)); 86227753Stheravenchar *ctime __P((const time_t *)); 87227753Stheravendouble difftime __P((time_t, time_t)); 88227753Stheravenstruct tm *gmtime __P((const time_t *)); 89227753Stheravenstruct tm *localtime __P((const time_t *)); 90227753Stheraventime_t mktime __P((struct tm *)); 91227753Stheravensize_t strftime __P((char *, size_t, const char *, const struct tm *)); 92227753Stheraventime_t time __P((time_t *)); 93227753Stheraven 94227753Stheraven#ifndef _ANSI_SOURCE 95227753Stheravenvoid tzset __P((void)); 96227753Stheraven#endif /* not ANSI */ 97227753Stheraven 98227753Stheraven#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) 99227753Stheravenchar *timezone __P((int, int)); 100227753Stheravenvoid tzsetwall __P((void)); 101227753Stheraventime_t timelocal __P((struct tm * const)); 102227753Stheraventime_t timegm __P((struct tm * const)); 103227753Stheraven#endif /* neither ANSI nor POSIX */ 104227753Stheraven__END_DECLS 105227753Stheraven 106227753Stheraven#endif /* !_TIME_H_ */ 107227753Stheraven