4 * Date and time functions and types.
6 * This file is part of the Mingw32 package.
9 * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23 * $Date: 2001/07/06 21:16:28 $
26 /* Appropriated for Reactos Crtdll by Ariadne */
30 #define __need_wchar_t
32 #include <msvcrt/stddef.h>
39 * Number of clock ticks per second. A clock tick is the unit by which
40 * processor time is measured and is returned by 'clock'.
42 #define CLOCKS_PER_SEC 1000.0
43 #define CLK_TICK CLOCKS_PER_SEC
46 * A type for measuring processor time (in clock ticks).
54 * Need a definition of time_t.
56 #include <msvcrt/sys/types.h>
59 * A type for storing the current time and date. This is the number of
60 * seconds since midnight Jan 1, 1970.
61 * NOTE: Normally this is defined by the above include of sys/types.h
69 * A structure for storing all kinds of useful information about the
70 * current (or another) time.
89 time_t time (time_t* tp
);
90 double difftime (time_t t2
, time_t t1
);
91 time_t mktime (struct tm
* tmsp
);
94 * These functions write to and return pointers to static buffers that may
95 * be overwritten by other function calls. Yikes!
97 * NOTE: localtime, and perhaps the others of the four functions grouped
98 * below may return NULL if their argument is not 'acceptable'. Also note
99 * that calling asctime with a NULL pointer will produce an Invalid Page
100 * Fault and crap out your program. Guess how I know. Hint: stat called on
101 * a directory gives 'invalid' times in st_atime etc...
103 char* asctime (const struct tm
* tmsp
);
104 wchar_t* _wasctime(const struct tm
*timeptr
);
105 char* ctime (const time_t* tp
);
106 wchar_t* _wctime(const time_t * const timep
);
107 struct tm
* gmtime (const time_t* tm
);
108 struct tm
* localtime (const time_t* tm
);
110 char* _strdate(const char *datestr
);
111 wchar_t* _wstrdate(const wchar_t *datestr
);
113 size_t strftime (char* caBuffer
, size_t sizeMax
, const char* szFormat
,
114 const struct tm
* tpPrint
);
116 size_t wcsftime (wchar_t* wcaBuffer
, size_t sizeMax
,
117 const wchar_t* wsFormat
, const struct tm
* tpPrint
);
119 char* _strtime(char* buf
);
120 wchar_t* _wstrtime(wchar_t* buf
);