2000-02-18 03:38:33 +08:00
|
|
|
/*
|
|
|
|
* time.h
|
2004-04-21 06:49:32 +08:00
|
|
|
* This file has no copyright assigned and is placed in the Public Domain.
|
|
|
|
* This file is a part of the mingw-runtime package.
|
|
|
|
* No warranty is given; refer to the file DISCLAIMER within the package.
|
2000-02-18 03:38:33 +08:00
|
|
|
*
|
|
|
|
* Date and time functions and types.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _TIME_H_
|
|
|
|
#define _TIME_H_
|
|
|
|
|
|
|
|
/* All the headers include this file. */
|
|
|
|
#include <_mingw.h>
|
|
|
|
|
|
|
|
#define __need_wchar_t
|
|
|
|
#define __need_size_t
|
2002-09-18 05:36:02 +08:00
|
|
|
#define __need_NULL
|
2000-02-18 03:38:33 +08:00
|
|
|
#ifndef RC_INVOKED
|
|
|
|
#include <stddef.h>
|
|
|
|
#endif /* Not RC_INVOKED */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Number of clock ticks per second. A clock tick is the unit by which
|
|
|
|
* processor time is measured and is returned by 'clock'.
|
|
|
|
*/
|
2001-01-30 20:44:46 +08:00
|
|
|
#define CLOCKS_PER_SEC ((clock_t)1000)
|
2000-02-18 03:38:33 +08:00
|
|
|
#define CLK_TCK CLOCKS_PER_SEC
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef RC_INVOKED
|
|
|
|
|
|
|
|
/*
|
|
|
|
* A type for storing the current time and date. This is the number of
|
|
|
|
* seconds since midnight Jan 1, 1970.
|
2004-07-10 12:06:09 +08:00
|
|
|
* NOTE: This is also defined in non-ISO sys/types.h.
|
2000-02-18 03:38:33 +08:00
|
|
|
*/
|
2010-02-14 Roumen Petrov <rumen@users.sourceforge.net>
Issue [2134161]: time64 functions and types for msvcrt >= 8.0
(initial implementation)
* new type: __time32_t
* new structures: _finddata32_t, _finddata32i64_t, _finddata64i32_t,
__stat32, _stat32i64, _stat64i32, __timeb32, __utimbuf32,
__wfinddata32_t, _wfinddata32i64_t, _wfinddata64i32_t
* new functions: _ctime32, _difftime32, _difftime64, _findfirst32
_findfirst32i64, _findfirst64i32, _findnext32, _findnext32i64,
_findnext64i32, _fstat32, _fstat32i64, _fstat64i32, _ftime32,
_futime32, _gmtime32, _localtime32, _mkgmtime32, _mkgmtime64,
_mktime32, _stat32, _stat32i64, _stat64i32, _time32, _utime32,
_wctime32, _wfindfirst32, _wfindfirst32i64, _wfindfirst64i32,
_wfindnext32, _wfindnext32i64, _wfindnext64i32, _wstat32,
_wstat32i64, _wstat64i32,_wutime32
* new define _USE_32BIT_TIME_T set 32 or 64 aliases for: time_t,
ctime, difftime, _findfirst, _findfirsti64, _findnext, _findnexti64,
_fstat, _fstati64, _ftime, _futime, gmtime, localtime, mktime,
_stat, _stati64, time, _utime, _wctime, _wfindfirst, _wfindfirsti64,
_wfindnext, _wfindnexti64, _wstat, _wstati64, _wutime
2010-02-17 10:41:06 +08:00
|
|
|
#ifndef _TIME32_T_DEFINED
|
|
|
|
typedef __int32 __time32_t;
|
|
|
|
#define _TIME32_T_DEFINED
|
2000-02-18 03:38:33 +08:00
|
|
|
#endif
|
|
|
|
|
2004-03-26 19:30:24 +08:00
|
|
|
#ifndef __STRICT_ANSI__
|
|
|
|
/* A 64-bit time_t to get to Y3K */
|
|
|
|
#ifndef _TIME64_T_DEFINED
|
2004-07-20 06:51:38 +08:00
|
|
|
typedef __int64 __time64_t;
|
2004-03-26 19:30:24 +08:00
|
|
|
#define _TIME64_T_DEFINED
|
|
|
|
#endif
|
|
|
|
#endif
|
2010-02-14 Roumen Petrov <rumen@users.sourceforge.net>
Issue [2134161]: time64 functions and types for msvcrt >= 8.0
(initial implementation)
* new type: __time32_t
* new structures: _finddata32_t, _finddata32i64_t, _finddata64i32_t,
__stat32, _stat32i64, _stat64i32, __timeb32, __utimbuf32,
__wfinddata32_t, _wfinddata32i64_t, _wfinddata64i32_t
* new functions: _ctime32, _difftime32, _difftime64, _findfirst32
_findfirst32i64, _findfirst64i32, _findnext32, _findnext32i64,
_findnext64i32, _fstat32, _fstat32i64, _fstat64i32, _ftime32,
_futime32, _gmtime32, _localtime32, _mkgmtime32, _mkgmtime64,
_mktime32, _stat32, _stat32i64, _stat64i32, _time32, _utime32,
_wctime32, _wfindfirst32, _wfindfirst32i64, _wfindfirst64i32,
_wfindnext32, _wfindnext32i64, _wfindnext64i32, _wstat32,
_wstat32i64, _wstat64i32,_wutime32
* new define _USE_32BIT_TIME_T set 32 or 64 aliases for: time_t,
ctime, difftime, _findfirst, _findfirsti64, _findnext, _findnexti64,
_fstat, _fstati64, _ftime, _futime, gmtime, localtime, mktime,
_stat, _stati64, time, _utime, _wctime, _wfindfirst, _wfindfirsti64,
_wfindnext, _wfindnexti64, _wstat, _wstati64, _wutime
2010-02-17 10:41:06 +08:00
|
|
|
|
|
|
|
#ifndef _TIME_T_DEFINED
|
|
|
|
/* FIXME __STRICT_ANSI__ ! */
|
|
|
|
#if __MSVCRT_VERSION__ >= 0x0800
|
|
|
|
#ifndef _USE_32BIT_TIME_T
|
|
|
|
typedef __time64_t time_t;
|
|
|
|
#else
|
|
|
|
typedef __time32_t time_t;
|
|
|
|
#endif /* !_USE_32BIT_TIME_T */
|
|
|
|
#else
|
|
|
|
typedef __time32_t time_t;
|
|
|
|
#endif /* __MSVCRT_VERSION__ >= 0x0800 */
|
|
|
|
#define _TIME_T_DEFINED
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2000-02-18 03:38:33 +08:00
|
|
|
/*
|
|
|
|
* A type for measuring processor time (in clock ticks).
|
|
|
|
*/
|
|
|
|
#ifndef _CLOCK_T_DEFINED
|
|
|
|
typedef long clock_t;
|
|
|
|
#define _CLOCK_T_DEFINED
|
|
|
|
#endif
|
|
|
|
|
2004-07-17 13:15:26 +08:00
|
|
|
#ifndef _TM_DEFINED
|
2000-02-18 03:38:33 +08:00
|
|
|
/*
|
|
|
|
* A structure for storing all kinds of useful information about the
|
|
|
|
* current (or another) time.
|
|
|
|
*/
|
|
|
|
struct tm
|
|
|
|
{
|
|
|
|
int tm_sec; /* Seconds: 0-59 (K&R says 0-61?) */
|
|
|
|
int tm_min; /* Minutes: 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 Jan. 1: 0-365 */
|
|
|
|
int tm_isdst; /* +1 Daylight Savings Time, 0 No DST,
|
|
|
|
* -1 don't know */
|
|
|
|
};
|
2004-07-17 13:15:26 +08:00
|
|
|
#define _TM_DEFINED
|
|
|
|
#endif
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2007-06-23 15:34:16 +08:00
|
|
|
_CRTIMP clock_t __cdecl __MINGW_NOTHROW clock (void);
|
2010-02-14 Roumen Petrov <rumen@users.sourceforge.net>
Issue [2134161]: time64 functions and types for msvcrt >= 8.0
(initial implementation)
* new type: __time32_t
* new structures: _finddata32_t, _finddata32i64_t, _finddata64i32_t,
__stat32, _stat32i64, _stat64i32, __timeb32, __utimbuf32,
__wfinddata32_t, _wfinddata32i64_t, _wfinddata64i32_t
* new functions: _ctime32, _difftime32, _difftime64, _findfirst32
_findfirst32i64, _findfirst64i32, _findnext32, _findnext32i64,
_findnext64i32, _fstat32, _fstat32i64, _fstat64i32, _ftime32,
_futime32, _gmtime32, _localtime32, _mkgmtime32, _mkgmtime64,
_mktime32, _stat32, _stat32i64, _stat64i32, _time32, _utime32,
_wctime32, _wfindfirst32, _wfindfirst32i64, _wfindfirst64i32,
_wfindnext32, _wfindnext32i64, _wfindnext64i32, _wstat32,
_wstat32i64, _wstat64i32,_wutime32
* new define _USE_32BIT_TIME_T set 32 or 64 aliases for: time_t,
ctime, difftime, _findfirst, _findfirsti64, _findnext, _findnexti64,
_fstat, _fstati64, _ftime, _futime, gmtime, localtime, mktime,
_stat, _stati64, time, _utime, _wctime, _wfindfirst, _wfindfirsti64,
_wfindnext, _wfindnexti64, _wstat, _wstati64, _wutime
2010-02-17 10:41:06 +08:00
|
|
|
#if __MSVCRT_VERSION__ < 0x0800
|
2007-06-23 15:34:16 +08:00
|
|
|
_CRTIMP time_t __cdecl __MINGW_NOTHROW time (time_t*);
|
|
|
|
_CRTIMP double __cdecl __MINGW_NOTHROW difftime (time_t, time_t);
|
|
|
|
_CRTIMP time_t __cdecl __MINGW_NOTHROW mktime (struct tm*);
|
2010-02-14 Roumen Petrov <rumen@users.sourceforge.net>
Issue [2134161]: time64 functions and types for msvcrt >= 8.0
(initial implementation)
* new type: __time32_t
* new structures: _finddata32_t, _finddata32i64_t, _finddata64i32_t,
__stat32, _stat32i64, _stat64i32, __timeb32, __utimbuf32,
__wfinddata32_t, _wfinddata32i64_t, _wfinddata64i32_t
* new functions: _ctime32, _difftime32, _difftime64, _findfirst32
_findfirst32i64, _findfirst64i32, _findnext32, _findnext32i64,
_findnext64i32, _fstat32, _fstat32i64, _fstat64i32, _ftime32,
_futime32, _gmtime32, _localtime32, _mkgmtime32, _mkgmtime64,
_mktime32, _stat32, _stat32i64, _stat64i32, _time32, _utime32,
_wctime32, _wfindfirst32, _wfindfirst32i64, _wfindfirst64i32,
_wfindnext32, _wfindnext32i64, _wfindnext64i32, _wstat32,
_wstat32i64, _wstat64i32,_wutime32
* new define _USE_32BIT_TIME_T set 32 or 64 aliases for: time_t,
ctime, difftime, _findfirst, _findfirsti64, _findnext, _findnexti64,
_fstat, _fstati64, _ftime, _futime, gmtime, localtime, mktime,
_stat, _stati64, time, _utime, _wctime, _wfindfirst, _wfindfirsti64,
_wfindnext, _wfindnexti64, _wstat, _wstati64, _wutime
2010-02-17 10:41:06 +08:00
|
|
|
#endif
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* These functions write to and return pointers to static buffers that may
|
|
|
|
* be overwritten by other function calls. Yikes!
|
|
|
|
*
|
|
|
|
* NOTE: localtime, and perhaps the others of the four functions grouped
|
|
|
|
* below may return NULL if their argument is not 'acceptable'. Also note
|
|
|
|
* that calling asctime with a NULL pointer will produce an Invalid Page
|
|
|
|
* Fault and crap out your program. Guess how I know. Hint: stat called on
|
|
|
|
* a directory gives 'invalid' times in st_atime etc...
|
|
|
|
*/
|
2007-06-23 15:34:16 +08:00
|
|
|
_CRTIMP char* __cdecl __MINGW_NOTHROW asctime (const struct tm*);
|
2010-02-14 Roumen Petrov <rumen@users.sourceforge.net>
Issue [2134161]: time64 functions and types for msvcrt >= 8.0
(initial implementation)
* new type: __time32_t
* new structures: _finddata32_t, _finddata32i64_t, _finddata64i32_t,
__stat32, _stat32i64, _stat64i32, __timeb32, __utimbuf32,
__wfinddata32_t, _wfinddata32i64_t, _wfinddata64i32_t
* new functions: _ctime32, _difftime32, _difftime64, _findfirst32
_findfirst32i64, _findfirst64i32, _findnext32, _findnext32i64,
_findnext64i32, _fstat32, _fstat32i64, _fstat64i32, _ftime32,
_futime32, _gmtime32, _localtime32, _mkgmtime32, _mkgmtime64,
_mktime32, _stat32, _stat32i64, _stat64i32, _time32, _utime32,
_wctime32, _wfindfirst32, _wfindfirst32i64, _wfindfirst64i32,
_wfindnext32, _wfindnext32i64, _wfindnext64i32, _wstat32,
_wstat32i64, _wstat64i32,_wutime32
* new define _USE_32BIT_TIME_T set 32 or 64 aliases for: time_t,
ctime, difftime, _findfirst, _findfirsti64, _findnext, _findnexti64,
_fstat, _fstati64, _ftime, _futime, gmtime, localtime, mktime,
_stat, _stati64, time, _utime, _wctime, _wfindfirst, _wfindfirsti64,
_wfindnext, _wfindnexti64, _wstat, _wstati64, _wutime
2010-02-17 10:41:06 +08:00
|
|
|
#if __MSVCRT_VERSION__ < 0x0800
|
2007-06-23 15:34:16 +08:00
|
|
|
_CRTIMP char* __cdecl __MINGW_NOTHROW ctime (const time_t*);
|
|
|
|
_CRTIMP struct tm* __cdecl __MINGW_NOTHROW gmtime (const time_t*);
|
|
|
|
_CRTIMP struct tm* __cdecl __MINGW_NOTHROW localtime (const time_t*);
|
2010-02-14 Roumen Petrov <rumen@users.sourceforge.net>
Issue [2134161]: time64 functions and types for msvcrt >= 8.0
(initial implementation)
* new type: __time32_t
* new structures: _finddata32_t, _finddata32i64_t, _finddata64i32_t,
__stat32, _stat32i64, _stat64i32, __timeb32, __utimbuf32,
__wfinddata32_t, _wfinddata32i64_t, _wfinddata64i32_t
* new functions: _ctime32, _difftime32, _difftime64, _findfirst32
_findfirst32i64, _findfirst64i32, _findnext32, _findnext32i64,
_findnext64i32, _fstat32, _fstat32i64, _fstat64i32, _ftime32,
_futime32, _gmtime32, _localtime32, _mkgmtime32, _mkgmtime64,
_mktime32, _stat32, _stat32i64, _stat64i32, _time32, _utime32,
_wctime32, _wfindfirst32, _wfindfirst32i64, _wfindfirst64i32,
_wfindnext32, _wfindnext32i64, _wfindnext64i32, _wstat32,
_wstat32i64, _wstat64i32,_wutime32
* new define _USE_32BIT_TIME_T set 32 or 64 aliases for: time_t,
ctime, difftime, _findfirst, _findfirsti64, _findnext, _findnexti64,
_fstat, _fstati64, _ftime, _futime, gmtime, localtime, mktime,
_stat, _stati64, time, _utime, _wctime, _wfindfirst, _wfindfirsti64,
_wfindnext, _wfindnexti64, _wstat, _wstati64, _wutime
2010-02-17 10:41:06 +08:00
|
|
|
#endif
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2007-06-23 15:34:16 +08:00
|
|
|
_CRTIMP size_t __cdecl __MINGW_NOTHROW strftime (char*, size_t, const char*, const struct tm*);
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
#ifndef __STRICT_ANSI__
|
2004-03-26 19:30:24 +08:00
|
|
|
|
2007-06-23 15:34:16 +08:00
|
|
|
extern _CRTIMP void __cdecl __MINGW_NOTHROW _tzset (void);
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
#ifndef _NO_OLDNAMES
|
2007-06-23 15:34:16 +08:00
|
|
|
extern _CRTIMP void __cdecl __MINGW_NOTHROW tzset (void);
|
2000-02-18 03:38:33 +08:00
|
|
|
#endif
|
|
|
|
|
2007-06-23 15:34:16 +08:00
|
|
|
_CRTIMP char* __cdecl __MINGW_NOTHROW _strdate(char*);
|
|
|
|
_CRTIMP char* __cdecl __MINGW_NOTHROW _strtime(char*);
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2004-03-26 19:30:24 +08:00
|
|
|
/* These require newer versions of msvcrt.dll (6.10 or higher). */
|
|
|
|
#if __MSVCRT_VERSION__ >= 0x0601
|
2007-06-23 15:34:16 +08:00
|
|
|
_CRTIMP __time64_t __cdecl __MINGW_NOTHROW _time64( __time64_t*);
|
|
|
|
_CRTIMP __time64_t __cdecl __MINGW_NOTHROW _mktime64 (struct tm*);
|
|
|
|
_CRTIMP char* __cdecl __MINGW_NOTHROW _ctime64 (const __time64_t*);
|
|
|
|
_CRTIMP struct tm* __cdecl __MINGW_NOTHROW _gmtime64 (const __time64_t*);
|
|
|
|
_CRTIMP struct tm* __cdecl __MINGW_NOTHROW _localtime64 (const __time64_t*);
|
2004-03-26 19:30:24 +08:00
|
|
|
#endif /* __MSVCRT_VERSION__ >= 0x0601 */
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2010-02-14 Roumen Petrov <rumen@users.sourceforge.net>
Issue [2134161]: time64 functions and types for msvcrt >= 8.0
(initial implementation)
* new type: __time32_t
* new structures: _finddata32_t, _finddata32i64_t, _finddata64i32_t,
__stat32, _stat32i64, _stat64i32, __timeb32, __utimbuf32,
__wfinddata32_t, _wfinddata32i64_t, _wfinddata64i32_t
* new functions: _ctime32, _difftime32, _difftime64, _findfirst32
_findfirst32i64, _findfirst64i32, _findnext32, _findnext32i64,
_findnext64i32, _fstat32, _fstat32i64, _fstat64i32, _ftime32,
_futime32, _gmtime32, _localtime32, _mkgmtime32, _mkgmtime64,
_mktime32, _stat32, _stat32i64, _stat64i32, _time32, _utime32,
_wctime32, _wfindfirst32, _wfindfirst32i64, _wfindfirst64i32,
_wfindnext32, _wfindnext32i64, _wfindnext64i32, _wstat32,
_wstat32i64, _wstat64i32,_wutime32
* new define _USE_32BIT_TIME_T set 32 or 64 aliases for: time_t,
ctime, difftime, _findfirst, _findfirsti64, _findnext, _findnexti64,
_fstat, _fstati64, _ftime, _futime, gmtime, localtime, mktime,
_stat, _stati64, time, _utime, _wctime, _wfindfirst, _wfindfirsti64,
_wfindnext, _wfindnexti64, _wstat, _wstati64, _wutime
2010-02-17 10:41:06 +08:00
|
|
|
/* These require newer versions of msvcrt.dll (8.00 or higher). */
|
|
|
|
#if __MSVCRT_VERSION__ >= 0x0800
|
|
|
|
_CRTIMP __time32_t __cdecl __MINGW_NOTHROW _time32 (__time32_t*);
|
|
|
|
_CRTIMP double __cdecl __MINGW_NOTHROW _difftime32 (__time32_t, __time32_t);
|
|
|
|
_CRTIMP double __cdecl __MINGW_NOTHROW _difftime64 (__time64_t, __time64_t);
|
|
|
|
_CRTIMP __time32_t __cdecl __MINGW_NOTHROW _mktime32 (struct tm*);
|
|
|
|
_CRTIMP __time32_t __cdecl __MINGW_NOTHROW _mkgmtime32 (struct tm*);
|
|
|
|
_CRTIMP __time64_t __cdecl __MINGW_NOTHROW _mkgmtime64 (struct tm*);
|
|
|
|
_CRTIMP char* __cdecl __MINGW_NOTHROW _ctime32 (const __time32_t*);
|
|
|
|
_CRTIMP struct tm* __cdecl __MINGW_NOTHROW _gmtime32 (const __time32_t*);
|
|
|
|
_CRTIMP struct tm* __cdecl __MINGW_NOTHROW _localtime32 (const __time32_t*);
|
|
|
|
#ifndef _USE_32BIT_TIME_T
|
|
|
|
_CRTALIAS time_t __cdecl __MINGW_NOTHROW time (time_t* _v) { return(_time64 (_v)); }
|
|
|
|
_CRTALIAS double __cdecl __MINGW_NOTHROW difftime (time_t _v1, time_t _v2) { return(_difftime64 (_v1,_v2)); }
|
|
|
|
_CRTALIAS time_t __cdecl __MINGW_NOTHROW mktime (struct tm* _v) { return(_mktime64 (_v)); }
|
|
|
|
_CRTALIAS time_t __cdecl __MINGW_NOTHROW _mkgmtime (struct tm* _v) { return(_mkgmtime64 (_v)); }
|
|
|
|
_CRTALIAS char* __cdecl __MINGW_NOTHROW ctime (const time_t* _v) { return(_ctime64 (_v)); }
|
|
|
|
_CRTALIAS struct tm* __cdecl __MINGW_NOTHROW gmtime (const time_t* _v) { return(_gmtime64 (_v)); }
|
|
|
|
_CRTALIAS struct tm* __cdecl __MINGW_NOTHROW localtime (const time_t* _v) { return(_localtime64 (_v)); }
|
|
|
|
#else
|
|
|
|
_CRTALIAS time_t __cdecl __MINGW_NOTHROW time (time_t* _v) { return(_time32 (_v)); }
|
|
|
|
_CRTALIAS double __cdecl __MINGW_NOTHROW difftime (time_t _v1, time_t _v2) { return(_difftime32 (_v1,_v2)); }
|
|
|
|
_CRTALIAS time_t __cdecl __MINGW_NOTHROW mktime (struct tm* _v) { return(_mktime32 (_v)); }
|
|
|
|
_CRTALIAS time_t __cdecl __MINGW_NOTHROW _mkgmtime (struct tm* _v) { return(_mkgmtime32 (_v)); }
|
|
|
|
_CRTALIAS char* __cdecl __MINGW_NOTHROW ctime (const time_t* _v) { return(_ctime32 (_v)); }
|
|
|
|
_CRTALIAS struct tm* __cdecl __MINGW_NOTHROW gmtime (const time_t* _v) { return(_gmtime32 (_v)); }
|
|
|
|
_CRTALIAS struct tm* __cdecl __MINGW_NOTHROW localtime (const time_t* _v) { return(_localtime32 (_v)); }
|
|
|
|
#endif /* !_USE_32BIT_TIME_T */
|
|
|
|
#endif /* __MSVCRT_VERSION__ >= 0x0800 */
|
|
|
|
|
|
|
|
|
2000-02-18 03:38:33 +08:00
|
|
|
/*
|
|
|
|
* _daylight: non zero if daylight savings time is used.
|
|
|
|
* _timezone: difference in seconds between GMT and local time.
|
|
|
|
* _tzname: standard/daylight savings time zone names (an array with two
|
|
|
|
* elements).
|
|
|
|
*/
|
|
|
|
#ifdef __MSVCRT__
|
|
|
|
|
|
|
|
/* These are for compatibility with pre-VC 5.0 suppied MSVCRT. */
|
2007-06-23 15:34:16 +08:00
|
|
|
extern _CRTIMP int* __cdecl __MINGW_NOTHROW __p__daylight (void);
|
|
|
|
extern _CRTIMP long* __cdecl __MINGW_NOTHROW __p__timezone (void);
|
|
|
|
extern _CRTIMP char** __cdecl __MINGW_NOTHROW __p__tzname (void);
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
__MINGW_IMPORT int _daylight;
|
|
|
|
__MINGW_IMPORT long _timezone;
|
|
|
|
__MINGW_IMPORT char *_tzname[2];
|
|
|
|
|
|
|
|
#else /* not __MSVCRT (ie. crtdll) */
|
|
|
|
|
|
|
|
#ifndef __DECLSPEC_SUPPORTED
|
|
|
|
|
2002-06-13 18:20:48 +08:00
|
|
|
extern int* _imp___daylight_dll;
|
|
|
|
extern long* _imp___timezone_dll;
|
|
|
|
extern char** _imp___tzname;
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2002-06-13 18:20:48 +08:00
|
|
|
#define _daylight (*_imp___daylight_dll)
|
|
|
|
#define _timezone (*_imp___timezone_dll)
|
|
|
|
#define _tzname (*_imp___tzname)
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
#else /* __DECLSPEC_SUPPORTED */
|
|
|
|
|
|
|
|
__MINGW_IMPORT int _daylight_dll;
|
|
|
|
__MINGW_IMPORT long _timezone_dll;
|
|
|
|
__MINGW_IMPORT char* _tzname[2];
|
|
|
|
|
|
|
|
#define _daylight _daylight_dll
|
|
|
|
#define _timezone _timezone_dll
|
|
|
|
|
|
|
|
#endif /* __DECLSPEC_SUPPORTED */
|
|
|
|
|
|
|
|
#endif /* not __MSVCRT__ */
|
|
|
|
|
2011-05-24 04:04:12 +08:00
|
|
|
#endif /* Not __STRICT_ANSI__ */
|
|
|
|
|
2000-02-18 03:38:33 +08:00
|
|
|
#ifndef _NO_OLDNAMES
|
|
|
|
|
|
|
|
#ifdef __MSVCRT__
|
|
|
|
|
|
|
|
/* These go in the oldnames import library for MSVCRT. */
|
|
|
|
__MINGW_IMPORT int daylight;
|
|
|
|
__MINGW_IMPORT long timezone;
|
|
|
|
__MINGW_IMPORT char *tzname[2];
|
|
|
|
|
|
|
|
#else /* not __MSVCRT__ */
|
|
|
|
|
|
|
|
/* CRTDLL is royally messed up when it comes to these macros.
|
|
|
|
TODO: import and alias these via oldnames import library instead
|
|
|
|
of macros. */
|
|
|
|
|
|
|
|
#define daylight _daylight
|
2006-06-23 05:57:44 +08:00
|
|
|
/* NOTE: timezone not defined as macro because it would conflict with
|
|
|
|
struct timezone in sys/time.h.
|
2000-02-18 03:38:33 +08:00
|
|
|
Also, tzname used to a be macro, but now it's in moldname. */
|
|
|
|
__MINGW_IMPORT char *tzname[2];
|
|
|
|
|
|
|
|
#endif /* not __MSVCRT__ */
|
|
|
|
|
|
|
|
#endif /* Not _NO_OLDNAMES */
|
2004-03-26 19:30:24 +08:00
|
|
|
|
|
|
|
#ifndef _WTIME_DEFINED
|
|
|
|
/* wide function prototypes, also declared in wchar.h */
|
2004-07-17 13:15:26 +08:00
|
|
|
#ifndef __STRICT_ANSI__
|
2004-03-26 19:30:24 +08:00
|
|
|
#ifdef __MSVCRT__
|
2007-06-23 15:34:16 +08:00
|
|
|
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wasctime(const struct tm*);
|
2010-02-14 Roumen Petrov <rumen@users.sourceforge.net>
Issue [2134161]: time64 functions and types for msvcrt >= 8.0
(initial implementation)
* new type: __time32_t
* new structures: _finddata32_t, _finddata32i64_t, _finddata64i32_t,
__stat32, _stat32i64, _stat64i32, __timeb32, __utimbuf32,
__wfinddata32_t, _wfinddata32i64_t, _wfinddata64i32_t
* new functions: _ctime32, _difftime32, _difftime64, _findfirst32
_findfirst32i64, _findfirst64i32, _findnext32, _findnext32i64,
_findnext64i32, _fstat32, _fstat32i64, _fstat64i32, _ftime32,
_futime32, _gmtime32, _localtime32, _mkgmtime32, _mkgmtime64,
_mktime32, _stat32, _stat32i64, _stat64i32, _time32, _utime32,
_wctime32, _wfindfirst32, _wfindfirst32i64, _wfindfirst64i32,
_wfindnext32, _wfindnext32i64, _wfindnext64i32, _wstat32,
_wstat32i64, _wstat64i32,_wutime32
* new define _USE_32BIT_TIME_T set 32 or 64 aliases for: time_t,
ctime, difftime, _findfirst, _findfirsti64, _findnext, _findnexti64,
_fstat, _fstati64, _ftime, _futime, gmtime, localtime, mktime,
_stat, _stati64, time, _utime, _wctime, _wfindfirst, _wfindfirsti64,
_wfindnext, _wfindnexti64, _wstat, _wstati64, _wutime
2010-02-17 10:41:06 +08:00
|
|
|
#if __MSVCRT_VERSION__ < 0x0800
|
2007-06-23 15:34:16 +08:00
|
|
|
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wctime(const time_t*);
|
2010-02-14 Roumen Petrov <rumen@users.sourceforge.net>
Issue [2134161]: time64 functions and types for msvcrt >= 8.0
(initial implementation)
* new type: __time32_t
* new structures: _finddata32_t, _finddata32i64_t, _finddata64i32_t,
__stat32, _stat32i64, _stat64i32, __timeb32, __utimbuf32,
__wfinddata32_t, _wfinddata32i64_t, _wfinddata64i32_t
* new functions: _ctime32, _difftime32, _difftime64, _findfirst32
_findfirst32i64, _findfirst64i32, _findnext32, _findnext32i64,
_findnext64i32, _fstat32, _fstat32i64, _fstat64i32, _ftime32,
_futime32, _gmtime32, _localtime32, _mkgmtime32, _mkgmtime64,
_mktime32, _stat32, _stat32i64, _stat64i32, _time32, _utime32,
_wctime32, _wfindfirst32, _wfindfirst32i64, _wfindfirst64i32,
_wfindnext32, _wfindnext32i64, _wfindnext64i32, _wstat32,
_wstat32i64, _wstat64i32,_wutime32
* new define _USE_32BIT_TIME_T set 32 or 64 aliases for: time_t,
ctime, difftime, _findfirst, _findfirsti64, _findnext, _findnexti64,
_fstat, _fstati64, _ftime, _futime, gmtime, localtime, mktime,
_stat, _stati64, time, _utime, _wctime, _wfindfirst, _wfindfirsti64,
_wfindnext, _wfindnexti64, _wstat, _wstati64, _wutime
2010-02-17 10:41:06 +08:00
|
|
|
#endif
|
2007-06-23 15:34:16 +08:00
|
|
|
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wstrdate(wchar_t*);
|
|
|
|
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wstrtime(wchar_t*);
|
2004-03-26 19:30:24 +08:00
|
|
|
#if __MSVCRT_VERSION__ >= 0x0601
|
2007-06-23 15:34:16 +08:00
|
|
|
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wctime64 (const __time64_t*);
|
2004-03-26 19:30:24 +08:00
|
|
|
#endif
|
2010-02-14 Roumen Petrov <rumen@users.sourceforge.net>
Issue [2134161]: time64 functions and types for msvcrt >= 8.0
(initial implementation)
* new type: __time32_t
* new structures: _finddata32_t, _finddata32i64_t, _finddata64i32_t,
__stat32, _stat32i64, _stat64i32, __timeb32, __utimbuf32,
__wfinddata32_t, _wfinddata32i64_t, _wfinddata64i32_t
* new functions: _ctime32, _difftime32, _difftime64, _findfirst32
_findfirst32i64, _findfirst64i32, _findnext32, _findnext32i64,
_findnext64i32, _fstat32, _fstat32i64, _fstat64i32, _ftime32,
_futime32, _gmtime32, _localtime32, _mkgmtime32, _mkgmtime64,
_mktime32, _stat32, _stat32i64, _stat64i32, _time32, _utime32,
_wctime32, _wfindfirst32, _wfindfirst32i64, _wfindfirst64i32,
_wfindnext32, _wfindnext32i64, _wfindnext64i32, _wstat32,
_wstat32i64, _wstat64i32,_wutime32
* new define _USE_32BIT_TIME_T set 32 or 64 aliases for: time_t,
ctime, difftime, _findfirst, _findfirsti64, _findnext, _findnexti64,
_fstat, _fstati64, _ftime, _futime, gmtime, localtime, mktime,
_stat, _stati64, time, _utime, _wctime, _wfindfirst, _wfindfirsti64,
_wfindnext, _wfindnexti64, _wstat, _wstati64, _wutime
2010-02-17 10:41:06 +08:00
|
|
|
#if __MSVCRT_VERSION__ >= 0x0800
|
|
|
|
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wctime32 (const __time32_t*);
|
|
|
|
#ifndef _USE_32BIT_TIME_T
|
|
|
|
_CRTALIAS wchar_t* __cdecl __MINGW_NOTHROW _wctime (const time_t* _v) { return(_wctime64 (_v)); }
|
|
|
|
#else
|
|
|
|
_CRTALIAS wchar_t* __cdecl __MINGW_NOTHROW _wctime (const time_t* _v) { return(_wctime32 (_v)); }
|
|
|
|
#endif
|
|
|
|
#endif /* __MSVCRT_VERSION__ >= 0x0800 */
|
2004-03-26 19:30:24 +08:00
|
|
|
#endif /* __MSVCRT__ */
|
2004-07-17 13:15:26 +08:00
|
|
|
#endif /* __STRICT_ANSI__ */
|
2007-06-23 15:34:16 +08:00
|
|
|
_CRTIMP size_t __cdecl __MINGW_NOTHROW wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*);
|
2004-03-26 19:30:24 +08:00
|
|
|
#define _WTIME_DEFINED
|
|
|
|
#endif /* _WTIME_DEFINED */
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* Not RC_INVOKED */
|
|
|
|
|
|
|
|
#endif /* Not _TIME_H_ */
|
|
|
|
|