structs in calendar.windows

Doug Coleman 2009-08-29 13:39:48 -05:00
parent fc3d1fad0d
commit 341dca1825
2 changed files with 14 additions and 16 deletions

View File

@ -1,15 +1,13 @@
USING: calendar namespaces alien.c-types system USING: calendar namespaces alien.c-types system
windows.kernel32 kernel math combinators windows.errors ; windows.kernel32 kernel math combinators windows.errors
classes.struct accessors ;
IN: calendar.windows IN: calendar.windows
M: windows gmt-offset ( -- hours minutes seconds ) M: windows gmt-offset ( -- hours minutes seconds )
"TIME_ZONE_INFORMATION" <c-object> TIME_ZONE_INFORMATION <struct>
dup GetTimeZoneInformation { dup GetTimeZoneInformation {
{ TIME_ZONE_ID_INVALID [ win32-error-string throw ] } { TIME_ZONE_ID_INVALID [ win32-error-string throw ] }
{ TIME_ZONE_ID_UNKNOWN [ TIME_ZONE_INFORMATION-Bias ] } { TIME_ZONE_ID_UNKNOWN [ Bias>> ] }
{ TIME_ZONE_ID_STANDARD [ TIME_ZONE_INFORMATION-Bias ] } { TIME_ZONE_ID_STANDARD [ Bias>> ] }
{ TIME_ZONE_ID_DAYLIGHT [ { TIME_ZONE_ID_DAYLIGHT [ [ Bias>> ] [ DaylightBias>> ] bi + ] }
[ TIME_ZONE_INFORMATION-Bias ]
[ TIME_ZONE_INFORMATION-DaylightBias ] bi +
] }
} case neg 60 /mod 0 ; } case neg 60 /mod 0 ;

View File

@ -226,14 +226,14 @@ STRUCT: SYSTEMTIME
{ wSecond WORD } { wSecond WORD }
{ wMilliseconds WORD } ; { wMilliseconds WORD } ;
C-STRUCT: TIME_ZONE_INFORMATION STRUCT: TIME_ZONE_INFORMATION
{ "LONG" "Bias" } { Bias LONG }
{ { "WCHAR" 32 } "StandardName" } { StandardName WCHAR[32] }
{ "SYSTEMTIME" "StandardDate" } { StandardDate SYSTEMTIME }
{ "LONG" "StandardBias" } { StandardBias LONG }
{ { "WCHAR" 32 } "DaylightName" } { DaylightName WCHAR[32] }
{ "SYSTEMTIME" "DaylightDate" } { DaylightDate SYSTEMTIME }
{ "LONG" "DaylightBias" } ; { DaylightBias LONG } ;
STRUCT: FILETIME STRUCT: FILETIME
{ dwLowDateTime DWORD } { dwLowDateTime DWORD }