--- mstools/h/time.h 2018/08/09 18:20:01 1.1 +++ mstools/h/time.h 2018/08/09 18:22:58 1.1.1.4 @@ -1,7 +1,7 @@ /*** *time.h - definitions/declarations for time routines * -* Copyright (c) 1985-1991, Microsoft Corporation. All rights reserved. +* Copyright (c) 1985-1993, Microsoft Corporation. All rights reserved. * *Purpose: * This file has declarations of time routines and defines @@ -18,8 +18,26 @@ extern "C" { #endif -#if (_MSC_VER <= 600) -#define __cdecl _cdecl +/* + * Conditional macro definition for function calling type and variable type + * qualifiers. + */ +#if ( (_MSC_VER >= 800) && (_M_IX86 >= 300) ) + +/* + * Definitions for MS C8-32 (386/486) compiler + */ +#define _CRTAPI1 __cdecl +#define _CRTAPI2 __cdecl + +#else + +/* + * Other compilers (e.g., MIPS) + */ +#define _CRTAPI1 +#define _CRTAPI2 + #endif /* define the implementation defined time type */ @@ -76,6 +94,27 @@ struct tm { * routines. */ +#ifdef _DLL + +#define _daylight (*_daylight_dll) +#define _timezone (*_timezone_dll) + +/* non-zero if daylight savings time is used */ +extern int * _daylight_dll; + +/* difference in seconds between GMT and local time */ +extern long * _timezone_dll; + +/* standard/daylight savings time zone names */ +extern char ** _tzname; + +#else + + +#ifdef _POSIX_ +extern char * _rule; +#endif + /* non-zero if daylight savings time is used */ extern int _daylight; @@ -83,37 +122,65 @@ extern int _daylight; extern long _timezone; /* standard/daylight savings time zone names */ +#ifdef _POSIX_ +extern char * tzname[2]; +#else extern char * _tzname[2]; +#endif +#endif /* function prototypes */ -char * asctime(const struct tm *); -char * ctime(const time_t *); -clock_t clock(void); -double difftime(time_t, time_t); -struct tm * gmtime(const time_t *); -struct tm * localtime(const time_t *); -time_t mktime(struct tm *); -size_t strftime(char *, size_t, const char *, const struct tm *); -char * _strdate(char *); -char * _strtime(char *); -time_t time(time_t *); -void _tzset(void); -unsigned _getsystime(struct tm *); -unsigned _setsystime(struct tm *, unsigned); +char * _CRTAPI1 asctime(const struct tm *); +char * _CRTAPI1 ctime(const time_t *); +clock_t _CRTAPI1 clock(void); +double _CRTAPI1 difftime(time_t, time_t); +struct tm * _CRTAPI1 gmtime(const time_t *); +struct tm * _CRTAPI1 localtime(const time_t *); +time_t _CRTAPI1 mktime(struct tm *); +size_t _CRTAPI1 strftime(char *, size_t, const char *, const struct tm *); +char * _CRTAPI1 _strdate(char *); +char * _CRTAPI1 _strtime(char *); +time_t _CRTAPI1 time(time_t *); +#ifdef _POSIX_ +void _CRTAPI1 tzset(void); +#else +void _CRTAPI1 _tzset(void); +#endif +unsigned _CRTAPI1 _getsystime(struct tm *); +unsigned _CRTAPI1 _setsystime(struct tm *, unsigned); + +#if !__STDC__ +#ifndef _SIZE_T_DEFINED +typedef unsigned int size_t; +#define _SIZE_T_DEFINED +#endif +#ifndef _WCHAR_T_DEFINED +typedef unsigned short wchar_t; +#define _WCHAR_T_DEFINED +#endif -#if !__STDC__ +#ifndef _WTIME_DEFINED +size_t _CRTAPI1 wcsftime(wchar_t *, size_t, const char *, const struct tm *); +#define _WTIME_DEFINED +#endif +#endif /* __STDC__ */ + +#if !__STDC__ || defined(_POSIX_) /* Non-ANSI names for compatibility */ #define CLK_TCK CLOCKS_PER_SEC #define daylight _daylight -#define timezone _timezone +/* timezone cannot be #defined to _timezone because of */ + +#ifndef _POSIX_ #define tzname _tzname #define tzset _tzset +#endif /* _POSIX_ */ #endif /* __STDC__ */