]> git.proxmox.com Git - mirror_edk2.git/blame - StdLib/Include/time.h
Add device abstraction code for the UEFI Console and UEFI Shell-based file systems.
[mirror_edk2.git] / StdLib / Include / time.h
CommitLineData
2aa62f2b 1/** @file\r
2 The header <time.h> defines two macros, and declares several types and\r
3 functions for manipulating time. Many functions deal with a calendar time\r
4 that represents the current date (according to the Gregorian calendar) and\r
5 time. Some functions deal with local time, which is the calendar time\r
6 expressed for some specific time zone, and with Daylight Saving Time, which\r
7 is a temporary change in the algorithm for determining local time. The local\r
8 time zone and Daylight Saving Time are implementation-defined.\r
9\r
10 The macros defined are NULL; and CLOCKS_PER_SEC which expands to an\r
11 expression with type clock_t (described below) that is the number per second\r
12 of the value returned by the clock function.\r
13\r
14 The types declared are size_t along with clock_t and time_t which are\r
15 arithmetic types capable of representing times; and struct tm which holds\r
16 the components of a calendar time, called the broken-down time.\r
17\r
18 The range and precision of times representable in clock_t and time_t are\r
19 implementation-defined. The tm structure shall contain at least the following\r
20 members, in any order. The semantics of the members and their normal ranges\r
21 are expressed in the comments.\r
22 - int tm_sec; // seconds after the minute - [0, 60]\r
23 - int tm_min; // minutes after the hour - [0, 59]\r
24 - int tm_hour; // hours since midnight - [0, 23]\r
25 - int tm_mday; // day of the month - [1, 31]\r
26 - int tm_mon; // months since January - [0, 11]\r
27 - int tm_year; // years since 1900\r
28 - int tm_wday; // days since Sunday - [0, 6]\r
29 - int tm_yday; // days since January 1 - [0, 365]\r
30 - int tm_isdst; // Daylight Saving Time flag\r
31\r
32 The value of tm_isdst is positive if Daylight Saving Time is in effect, zero\r
33 if Daylight Saving Time is not in effect, and negative if the information\r
34 is not available.\r
35\r
36 Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
37 This program and the accompanying materials are licensed and made available under\r
38 the terms and conditions of the BSD License that accompanies this distribution.\r
39 The full text of the license may be found at\r
40 http://opensource.org/licenses/bsd-license.php.\r
41\r
42 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
43 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
44\r
45**/\r
46#ifndef _TIME_H\r
47#define _TIME_H\r
48#include <sys/EfiCdefs.h>\r
49\r
50#define CLOCKS_PER_SEC __getCPS()\r
51\r
52#ifdef _EFI_SIZE_T_\r
53 typedef _EFI_SIZE_T_ size_t;\r
54 #undef _EFI_SIZE_T_\r
55 #undef _BSD_SIZE_T_\r
56#endif\r
57\r
58/** An arithmetic type capable of representing values returned by clock(); **/\r
59#ifdef _EFI_CLOCK_T\r
60 typedef _EFI_CLOCK_T clock_t;\r
61 #undef _EFI_CLOCK_T\r
62#endif\r
63\r
64/** An arithmetic type capable of representing values returned as calendar time\r
65 values, such as that returned by mktime();\r
66**/\r
67#ifdef _EFI_TIME_T\r
68 typedef _EFI_TIME_T time_t;\r
69 #undef _EFI_TIME_T\r
70#endif\r
71\r
72/** A structure holding the components of a calendar time, called the\r
73 broken-down time. The first nine (9) members are as mandated by the\r
74 C95 standard. Additional fields have been added for EFI support.\r
75**/\r
76struct tm {\r
77 int tm_year; // years since 1900\r
78