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 | |
56 // Returns the current time in milliseconds measured | 45 // Returns the current time in milliseconds measured |
57 // from midnight January 1, 1970 UTC. | 46 // from midnight January 1, 1970 UTC. |
58 static int64_t GetCurrentTimeMillis(); | 47 static int64_t GetCurrentTimeMillis(); |
59 | 48 |
60 // Returns the current time in microseconds measured | 49 // Returns the current time in microseconds measured |
61 // from midnight January 1, 1970 UTC. | 50 // from midnight January 1, 1970 UTC. |
62 static int64_t GetCurrentTimeMicros(); | 51 static int64_t GetCurrentTimeMicros(); |
63 | 52 |
64 // Returns the activation frame alignment constraint or zero if | 53 // Returns the activation frame alignment constraint or zero if |
65 // the platform doesn't care. Guaranteed to be a power of two. | 54 // 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... |
108 static void Shutdown(); | 97 static void Shutdown(); |
109 | 98 |
110 static void Abort(); | 99 static void Abort(); |
111 | 100 |
112 static void Exit(int code); | 101 static void Exit(int code); |
113 }; | 102 }; |
114 | 103 |
115 } // namespace dart | 104 } // namespace dart |
116 | 105 |
117 #endif // VM_OS_H_ | 106 #endif // VM_OS_H_ |
OLD | NEW |