if Daylight Saving Time is not in effect, and negative if the information\r
is not available.\r
\r
+ The following macros are defined in this file:<BR>\r
+ @verbatim\r
+ NULL\r
+ CLOCKS_PER_SEC The number of values per second returned by the clock function.\r
+ @endverbatim\r
+\r
+ The following types are defined in this file:<BR>\r
+ @verbatim\r
+ size_t Unsigned integer type of the result of the sizeof operator.\r
+ clock_t Arithmetic type capable of representing a time from the clock function.\r
+ time_t Arithmetic type capable of representing a time.\r
+ struct tm Holds the components of a calendar time; or broken-down time.\r
+ @endverbatim\r
+\r
+ The following functions are declared in this file:<BR>\r
+ @verbatim\r
+ ############### Time Manipulation Functions\r
+ clock_t clock (void);\r
+ double difftime (time_t time1, time_t time0);\r
+ time_t mktime (struct tm *timeptr);\r
+ time_t time (time_t *timer);\r
+\r
+ ################# Time Conversion Functions\r
+ char * asctime (const struct tm *timeptr);\r
+ char * ctime (const time_t *timer);\r
+ struct tm * gmtime (const time_t *timer);\r
+ time_t timegm (struct tm*);\r
+ struct tm * localtime (const time_t *timer);\r
+ size_t strftime (char * __restrict s, size_t maxsize,\r
+ const char * __restrict format,\r
+ const struct tm * __restrict timeptr);\r
+ char * strptime (const char *, const char * format, struct tm*);\r
+ @endverbatim\r
+\r
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials are licensed and made available under\r
the terms and conditions of the BSD License that accompanies this distribution.\r
\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
**/\r
#ifndef _TIME_H\r
#define _TIME_H\r
#undef _BSD_SIZE_T_\r
#endif\r
\r
-/** An arithmetic type capable of representing values returned by clock(); **/\r
#ifdef _EFI_CLOCK_T\r
+ /** An arithmetic type capable of representing values returned by clock(); **/\r
typedef _EFI_CLOCK_T clock_t;\r
#undef _EFI_CLOCK_T\r
#endif\r
\r
-/** An arithmetic type capable of representing values returned as calendar time\r
- values, such as that returned by mktime();\r
-**/\r
#ifdef _EFI_TIME_T\r
+ /** An arithmetic type capable of representing values returned as calendar time\r
+ values, such as that returned by mktime();\r
+ **/\r
typedef _EFI_TIME_T time_t;\r
#undef _EFI_TIME_T\r
#endif\r
\r
-/** Value added to tm_year to get the full year value. TM_YEAR_BASE + 110 --> 2010\r
-**/\r
+/** Value added to tm_year to get the full year value. TM_YEAR_BASE + 110 --> 2010 **/\r
#define TM_YEAR_BASE 1900\r
\r
-/** Values for the tm_wday member of struct tm.\r
- @{\r
+/** @{\r
+ Values for the tm_wday member of struct tm.\r
**/\r
#define TM_SUNDAY 0\r
#define TM_MONDAY 1\r
#define TM_THURSDAY 4\r
#define TM_FRIDAY 5\r
#define TM_SATURDAY 6\r
-/** @} **/\r
+/*@}*/\r
\r
-/** Values for the tm_mon member of struct tm.\r
- @{\r
+/** @{\r
+ Values for the tm_mon member of struct tm.\r
**/\r
#define TM_JANUARY 0\r
#define TM_FEBRUARY 1\r
#define TM_OCTOBER 9\r
#define TM_NOVEMBER 10\r
#define TM_DECEMBER 11\r
-/** @} **/\r
+/*@}*/\r
\r
/** A structure holding the components of a calendar time, called the\r
broken-down time. The first nine (9) members are as mandated by the\r
the macro CLOCKS_PER_SEC. If the processor time used is not\r
available or its value cannot be represented, the function\r
returns the value (clock_t)(-1).\r
-\r
- On IA32 or X64 platforms, the value returned is the number of\r
- CPU TimeStamp Counter ticks since the appliation started.\r
**/\r
clock_t clock(void);\r
\r
-/**\r
+/** Compute the difference between two calendar times: time1 - time0.\r
+\r
+ @param[in] time1 An arithmetic calendar time.\r
+ @param[in] time2 Another arithmetic calendar time.\r
+\r
+ @return The difference between the two times expressed in seconds.\r
**/\r
double difftime(time_t time1, time_t time0);\r
\r
-/** The mktime function converts the broken-down time, expressed as local time,\r
+/** Convert a broken-down time into an arithmetic calendar time.\r
+\r
+ The mktime function converts the broken-down time, expressed as local time,\r
in the structure pointed to by timeptr into a calendar time value with the\r
same encoding as that of the values returned by the time function. The\r
original values of the tm_wday and tm_yday components of the structure are\r
the final value of tm_mday is not set until tm_mon and tm_year\r
are determined.\r
\r
+ @param[in] timeptr Pointer to a broken-down time to be converted.\r
+\r
@return The mktime function returns the specified calendar time encoded\r
as a value of type time_t. If the calendar time cannot be\r
represented, the function returns the value (time_t)(-1).\r
\r
/** The time function determines the current calendar time.\r
\r
- The encoding of the value is unspecified.\r
+ The encoding of the value is unspecified and undocumented.\r
+\r
+ @param[out] timer An optional pointer to an object in which to\r
+ store the calendar time.\r
\r
@return The time function returns the implementation's best approximation\r
of the current calendar time. The value (time_t)(-1) is returned\r
/* ################# Time Conversion Functions ########################## */\r
\r
/** The asctime function converts the broken-down time in the structure pointed\r
- to by timeptr into a string in the form\r
+ to by timeptr into a string in the form<BR>\r
+ @verbatim\r
Sun Sep 16 01:03:52 1973\n\0\r
+ @endverbatim\r
+\r
+ @param[in] timeptr A pointer to a broken-down time to convert.\r
\r
@return The asctime function returns a pointer to the string.\r
**/\r
char * asctime(const struct tm *timeptr);\r
\r
-/** The ctime function converts the calendar time pointed to by timer to local\r
+/** The ctime function converts the calendar time pointed to by timer to a local\r
time in the form of a string. It is equivalent to asctime(localtime(timer))\r
\r
+ @param[in] timer Pointer to a calendar time value to convert into a\r
+ string representation.\r
+\r
@return The ctime function returns the pointer returned by the asctime\r
function with that broken-down time as argument.\r
**/\r
char * ctime(const time_t *timer);\r
\r
/** The gmtime function converts the calendar time pointed to by timer into a\r
- brokendown time, expressed as UTC.\r
+ broken-down time, expressed as UTC.\r
+\r
+ @param[in] timer Pointer to a calendar time value to convert into a\r
+ broken-down time.\r
\r
@return The gmtime function returns a pointer to the broken-down time,\r
or a null pointer if the specified time cannot be converted to UTC.\r
\r
/** The timegm function is the opposite of gmtime.\r
\r
+ @param[in] tm Pointer to a broken-down time to convert into a\r
+ calendar time.\r
+\r
@return The calendar time expressed as UTC.\r
**/\r
time_t timegm(struct tm*);\r
/** The localtime function converts the calendar time pointed to by timer into\r
a broken-down time, expressed as local time.\r
\r
+ @param[in] timer Pointer to a calendar time value to be converted.\r
+\r
@return The localtime function returns a pointer to the broken-down time,\r
or a null pointer if the specified time cannot be converted to\r
local time.\r