{-# LINE 1 "System\\Win32\\WindowsString\\Time.hsc" #-}----------------------------------------------------------------------------- -- | -- Module : System.Win32.Time -- Copyright : (c) Esa Ilari Vuokko, 2006 -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Esa Ilari Vuokko <ei@vuokko.info> -- Stability : provisional -- Portability : portable -- -- A collection of FFI declarations for interfacing with Win32 Time API. -- ----------------------------------------------------------------------------- moduleSystem.Win32.WindowsString.Time(moduleSystem.Win32.WindowsString.Time,moduleSystem.Win32.Time)whereimportSystem.Win32.Time.InternalimportSystem.Win32.Timehiding(getTimeFormatEx,getTimeFormat)importSystem.Win32.WindowsString.String(peekTStringLen,withTString)importSystem.Win32.WindowsString.Types(LCID,failIf)importSystem.Win32.Utils(trySized)importForeign(Storable(sizeOf),nullPtr,castPtr,with,allocaBytes)importForeign.C(CWchar(..),withCWString)importForeign.Marshal.Utils(maybeWith)importSystem.OsString.Windows #include "windows_cconv.h" getTimeFormatEx::MaybeWindowsString->GetTimeFormatFlags->MaybeSYSTEMTIME->MaybeWindowsString->IOStringgetTimeFormatExlocaleflagsstfmt=maybeWithwithTStringlocale$\c_locale->maybeWithwithst$\c_st->maybeWithwithTStringfmt$\c_fmt->doletc_func=c_GetTimeFormatExc_localeflagsc_stc_fmttrySized"GetTimeFormatEx"c_funcgetTimeFormat::LCID->GetTimeFormatFlags->MaybeSYSTEMTIME->MaybeString->IOWindowsStringgetTimeFormatlocaleflagsstfmt=maybeWithwithst$\c_st->maybeWithwithCWStringfmt$\c_fmt->dosize<-c_GetTimeFormatlocaleflagsc_stc_fmtnullPtr0allocaBytes((fromIntegralsize)*(sizeOf(undefined::CWchar)))$\out->dosize'<-failIf(==0)"getTimeFormat: GetTimeFormat"$c_GetTimeFormatlocaleflagsc_stc_fmt(castPtrout)sizepeekTStringLen(out,fromIntegralsize')