## win32-general.pkg
# General Win32 stuff.
stipulate
package ci = mythryl_callable_c_library_interface; # mythryl_callable_c_library_interface is from
src/lib/std/src/unsafe/mythryl-callable-c-library-interface.pkgherein
package win32_general
: Win32_General
{
package unt = Word32Imp
type word = unt::word
type hndl = word
type system_time = { year: Int,
month: Int,
dayOfWeek: Int,
day: Int,
hour: Int,
minute: Int,
second: Int,
milliSeconds: Int }
arcSepChar = '\\'
local
fun cfun' lib_name fun_name
=
ci::find_c_function { lib_name, fun_name }; # If this code is revived, should consider whether to switch from using find_c_function to find_c_function'. -- 2012-04-23 CrT
#
my sayDebug' : String -> Void = cfun' "win32" "debug"
in
sayDebug = /* sayDebug' */ \\ _ => ()
my log: Ref( List( String ) ) = REF []
fun logMsg s = (log := s . *log;
sayDebug s)
fun cfun lib name =
(logMsg ("naming C function <"$lib$":"$name$">...");
cfun' lib name
then
logMsg "bound\n")
end
my getConst' : (String * String) -> word =
cfun "win32" "get_const"
fun getConst kind name = getConst'(kind, name)
my getLastError: Void -> word = cfun "win32" "get_last_error"
INVALID_HANDLE_VALUE = getConst "GENERAL" "INVALID_HANDLE_VALUE"
fun isValidHandle (h: word) = h != INVALID_HANDLE_VALUE
}
end;
## COPYRIGHT (c) 1996 Bell Laboratories.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.