Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/compiler/PervEnv/Win32/win32-general.sml
ViewVC logotype

Annotation of /sml/trunk/src/compiler/PervEnv/Win32/win32-general.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 114 - (view) (download)

1 : monnier 16 (* win32-general.sml
2 :     *
3 :     * COPYRIGHT (c) 1996 Bell Laboratories.
4 :     *
5 :     * General Win32 stuff.
6 :     *
7 :     *)
8 :    
9 :     structure Win32_General : WIN32_GENERAL =
10 :     struct
11 :     structure Word = Word32
12 :     type word = Word.word
13 :    
14 :     type hndl = word
15 :     type system_time = {year: int,
16 :     month: int,
17 :     dayOfWeek: int,
18 :     day: int,
19 :     hour: int,
20 :     minute: int,
21 :     second: int,
22 :     milliSeconds: int}
23 :    
24 :     val arcSepChar = #"\\"
25 :    
26 :     local
27 :     fun cfun' lib name = CInterface.c_function lib name
28 :     val sayDebug' : string -> unit = cfun' "WIN32" "debug"
29 :     in
30 :     val sayDebug = (* sayDebug' *) fn _ => ()
31 :     val log : string list ref = ref []
32 :     fun logMsg s = (log := s :: (!log);
33 :     sayDebug s)
34 :     fun cfun lib name =
35 :     (logMsg ("binding C function <"^lib^":"^name^">...");
36 :     cfun' lib name
37 :     before
38 :     logMsg "bound\n")
39 :     end
40 :    
41 :     val getConst' : (string * string) -> word =
42 :     cfun "WIN32" "get_const"
43 :     fun getConst kind name = getConst'(kind,name)
44 :    
45 :     val getLastError : unit -> word = cfun "WIN32" "get_last_error"
46 :    
47 :     val INVALID_HANDLE_VALUE = getConst "GENERAL" "INVALID_HANDLE_VALUE"
48 :     fun isValidHandle (h : word) = h <> INVALID_HANDLE_VALUE
49 :    
50 :     end
51 :    
52 :     (*
53 : monnier 113 * $Log$
54 : monnier 16 *)

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0