OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_OS_H_ | 5 #ifndef VM_OS_H_ |
6 #define VM_OS_H_ | 6 #define VM_OS_H_ |
7 | 7 |
8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
9 | 9 |
10 // Forward declarations. | 10 // Forward declarations. |
(...skipping 24 matching lines...) Expand all Loading... |
35 // The given year is offset by 1900. The given month is 0-based. | 35 // The given year is offset by 1900. The given month is 0-based. |
36 // Returns true if the conversion succeeds, false otherwise. | 36 // Returns true if the conversion succeeds, false otherwise. |
37 static bool MkGmTime(tm* tm, int64_t* seconds_result); | 37 static bool MkGmTime(tm* tm, int64_t* seconds_result); |
38 | 38 |
39 // Takes the broken down date and time in local timezone and computes the | 39 // Takes the broken down date and time in local timezone and computes the |
40 // seconds since epoch (midnight, January 1, 1970 UTC). | 40 // seconds since epoch (midnight, January 1, 1970 UTC). |
41 // The given year is offset by 1900. The given month is 0-based. | 41 // The given year is offset by 1900. The given month is 0-based. |
42 // Returns true if the conversion succeeds, false otherwise. | 42 // Returns true if the conversion succeeds, false otherwise. |
43 static bool MkTime(tm* tm, int64_t* seconds_result); | 43 static bool MkTime(tm* tm, int64_t* seconds_result); |
44 | 44 |
| 45 // Returns the abbreviated time-zone name for the given instant. |
| 46 // For example "CET" or "CEST". |
| 47 static bool GetTimeZoneName(int64_t seconds_since_epoch, |
| 48 const char** name_result); |
| 49 |
| 50 // Returns the difference in seconds between local time and UTC for the given |
| 51 // instant. |
| 52 // For example 3600 for CET, and 7200 for CEST. |
| 53 static bool GetTimeZoneOffsetInSeconds(int64_t seconds_since_epoch, |
| 54 int* offset_result); |
| 55 |
45 // Returns the current time in milliseconds measured | 56 // Returns the current time in milliseconds measured |
46 // from midnight January 1, 1970 UTC. | 57 // from midnight January 1, 1970 UTC. |
47 static int64_t GetCurrentTimeMillis(); | 58 static int64_t GetCurrentTimeMillis(); |
48 | 59 |
49 // Returns the current time in microseconds measured | 60 // Returns the current time in microseconds measured |
50 // from midnight January 1, 1970 UTC. | 61 // from midnight January 1, 1970 UTC. |
51 static int64_t GetCurrentTimeMicros(); | 62 static int64_t GetCurrentTimeMicros(); |
52 | 63 |
53 // Returns the activation frame alignment constraint or zero if | 64 // Returns the activation frame alignment constraint or zero if |
54 // the platform doesn't care. Guaranteed to be a power of two. | 65 // the platform doesn't care. Guaranteed to be a power of two. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 static void Shutdown(); | 108 static void Shutdown(); |
98 | 109 |
99 static void Abort(); | 110 static void Abort(); |
100 | 111 |
101 static void Exit(int code); | 112 static void Exit(int code); |
102 }; | 113 }; |
103 | 114 |
104 } // namespace dart | 115 } // namespace dart |
105 | 116 |
106 #endif // VM_OS_H_ | 117 #endif // VM_OS_H_ |
OLD | NEW |