Mac OS 9
UTCUtils.h
Go to the documentation of this file.
1 
20 #ifndef __UTCUTILS__
21 #define __UTCUTILS__
22 
23 #ifndef __MACTYPES__
24 #include <MacTypes.h>
25 #endif
26 
27 #ifndef __MACERRORS__
28 #include <MacErrors.h>
29 #endif
30 
31 #if PRAGMA_ONCE
32 #pragma once
33 #endif
34 
35 #ifdef __cplusplus
36 extern "C"
37 {
38 #endif
39 
40 #if PRAGMA_IMPORT
41 #pragma import on
42 #endif
43 
44 #if PRAGMA_STRUCT_ALIGN
45 #pragma options align = mac68k
46 #elif PRAGMA_STRUCT_PACKPUSH
47 #pragma pack(push, 2)
48 #elif PRAGMA_STRUCT_PACK
49 #pragma pack(2)
50 #endif
51 
53  enum
54  {
55  kUTCDefaultOptions = 0
56  };
57 
59  struct UTCDateTime
60  {
61  UInt16 highSeconds;
62  UInt32 lowSeconds;
63  UInt16 fraction;
64  };
65  typedef struct UTCDateTime UTCDateTime;
66  typedef UTCDateTime *UTCDateTimePtr;
69  {
70  UInt16 highSeconds;
71  UInt32 lowSeconds;
72  UInt16 fraction;
73  };
74  typedef struct LocalDateTime LocalDateTime;
86  OSStatus
87  ConvertLocalTimeToUTC(UInt32 localSeconds, UInt32 *utcSeconds);
88 
97  OSStatus
98  ConvertUTCToLocalTime(UInt32 utcSeconds, UInt32 *localSeconds);
99 
109  OSStatus
111  LocalDateTime *localDateTime);
112 
121  OSStatus
123  UTCDateTime *utcDateTime);
124 
134  OSStatus
135  GetUTCDateTime(UTCDateTime *utcDateTime, OptionBits options);
136 
145  OSStatus
146  SetUTCDateTime(const UTCDateTime *utcDateTime, OptionBits options);
147 
156  OSStatus
157  GetLocalDateTime(LocalDateTime *localDateTime, OptionBits options);
158 
167  OSStatus
168  SetLocalDateTime(const LocalDateTime *localDateTime, OptionBits options);
169 
170 #if PRAGMA_STRUCT_ALIGN
171 #pragma options align = reset
172 #elif PRAGMA_STRUCT_PACKPUSH
173 #pragma pack(pop)
174 #elif PRAGMA_STRUCT_PACK
175 #pragma pack()
176 #endif
177 
178 #ifdef PRAGMA_IMPORT_OFF
179 #pragma import off
180 #elif PRAGMA_IMPORT
181 #pragma import reset
182 #endif
183 
184 #ifdef __cplusplus
185 }
186 #endif
187 
188 #endif
OSErr codes.
Basic Macintosh data types.
OSStatus GetLocalDateTime(LocalDateTime *localDateTime, OptionBits options)
OSStatus SetLocalDateTime(const LocalDateTime *localDateTime, OptionBits options)
OSStatus ConvertUTCToLocalDateTime(const UTCDateTime *utcDateTime, LocalDateTime *localDateTime)
OSStatus GetUTCDateTime(UTCDateTime *utcDateTime, OptionBits options)
OSStatus ConvertUTCToLocalTime(UInt32 utcSeconds, UInt32 *localSeconds)
OSStatus SetUTCDateTime(const UTCDateTime *utcDateTime, OptionBits options)
OSStatus ConvertLocalToUTCDateTime(const LocalDateTime *localDateTime, UTCDateTime *utcDateTime)
OSStatus ConvertLocalTimeToUTC(UInt32 localSeconds, UInt32 *utcSeconds)
Definition: UTCUtils.h:69
Definition: UTCUtils.h:60