*
* This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
- * DISCLAMED. This includes but is not limited to warranties of
+ * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* $Revision$
*
*/
/* Appropriated for Reactos Crtdll by Ariadne */
-#ifndef _TIME_H_
-#define _TIME_H_
+#ifndef _TIME_H_
+#define _TIME_H_
#define __need_wchar_t
#define __need_size_t
#include <msvcrt/stddef.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
/*
* Number of clock ticks per second. A clock tick is the unit by which
* processor time is measured and is returned by 'clock'.
*/
-#define CLOCKS_PER_SEC 1000.0
-#define CLK_TICK CLOCKS_PER_SEC
+#define CLOCKS_PER_SEC 1000.0
+#define CLK_TICK CLOCKS_PER_SEC
-/*
- * A type for measuring processor time (in clock ticks).
- */
-#ifndef _CLOCK_T_
-#define _CLOCK_T_
-typedef long clock_t;
-#endif
/*
* Need a definition of time_t.
* NOTE: Normally this is defined by the above include of sys/types.h
*/
#ifndef _TIME_T_
+typedef long time_t;
#define _TIME_T_
-typedef long time_t;
+#endif
+
+/*
+ * A type for measuring processor time (in clock ticks).
+ */
+#ifndef _CLOCK_T_
+typedef long clock_t;
+#define _CLOCK_T_
#endif
/*
* A structure for storing all kinds of useful information about the
* current (or another) time.
*/
-struct tm {
- int tm_sec;
- int tm_min;
- int tm_hour;
- int tm_mday;
- int tm_mon;
- int tm_year;
- int tm_wday;
- int tm_yday;
- int tm_isdst;
- char *tm_zone;
- int tm_gmtoff;
+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 */
+ char *tm_zone;
+ int tm_gmtoff;
};
+#ifdef __cplusplus
+extern "C" {
+#endif
-
-clock_t clock (void);
-time_t time (time_t* tp);
-double difftime (time_t t2, time_t t1);
-time_t mktime (struct tm* tmsp);
+clock_t clock(void);
+time_t time(time_t*);
+double difftime(time_t, time_t);
+time_t mktime(struct tm*);
/*
* These functions write to and return pointers to static buffers that may
* Fault and crap out your program. Guess how I know. Hint: stat called on
* a directory gives 'invalid' times in st_atime etc...
*/
-char* asctime (const struct tm* tmsp);
-wchar_t* _wasctime(const struct tm *timeptr);
-char* ctime (const time_t* tp);
-wchar_t* _wctime(const time_t * const timep);
-struct tm* gmtime (const time_t* tm);
-struct tm* localtime (const time_t* tm);
-
-char* _strdate(const char *datestr);
-wchar_t* _wstrdate(const wchar_t *datestr);
-
-size_t strftime (char* caBuffer, size_t sizeMax, const char* szFormat,
- const struct tm* tpPrint);
-
-size_t wcsftime (wchar_t* wcaBuffer, size_t sizeMax,
- const wchar_t* wsFormat, const struct tm* tpPrint);
-
-char* _strtime(char* buf);
-wchar_t* _wstrtime(wchar_t* buf);
-
-#ifdef __cplusplus
+char* asctime(const struct tm*);
+char* ctime(const time_t*);
+struct tm* gmtime(const time_t*);
+struct tm* localtime(const time_t*);
+
+size_t strftime(char*, size_t, const char*, const struct tm*);
+size_t wcsftime(wchar_t*, size_t, const wchar_t*, const struct tm*);
+
+wchar_t* _wasctime(const struct tm *timeptr);
+wchar_t* _wctime(const time_t * const timep);
+char* _strdate(const char *datestr);
+wchar_t* _wstrdate(const wchar_t *datestr);
+char* _strtime(char* buf);
+wchar_t* _wstrtime(wchar_t* buf);
+
+#ifdef __cplusplus
}
#endif
-#endif
+#endif /* Not _TIME_H_ */
+