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/OS/os-io.sig
ViewVC logotype

Annotation of /sml/trunk/src/compiler/PervEnv/OS/os-io.sig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 93 - (view) (download) (as text)
Original Path: sml/branches/SMLNJ/src/compiler/PervEnv/OS/os-io.sig

1 : monnier 93 (* os-io.sig
2 : monnier 16 *
3 :     * COPYRIGHT (c) 1995 AT&T Bell Laboratories.
4 :     *
5 :     * NOTE: this interface has been proposed, but not yet adopted by the
6 :     * Standard basis committee.
7 :     *
8 :     *)
9 :    
10 :     signature OS_IO =
11 :     sig
12 :     eqtype iodesc
13 :     (* an iodesc is an abstract descriptor for an OS object that
14 :     * supports I/O (e.g., file, tty device, socket, ...).
15 :     *)
16 :     eqtype iodesc_kind
17 :    
18 :     val hash : iodesc -> word
19 :     (* return a hash value for the I/O descriptor. *)
20 :    
21 :     val compare : (iodesc * iodesc) -> order
22 :     (* compare two I/O descriptors *)
23 :    
24 :     val kind : iodesc -> iodesc_kind
25 :     (* return the kind of I/O descriptor. *)
26 :    
27 :     structure Kind : sig
28 :     val file : iodesc_kind
29 :     val dir : iodesc_kind
30 :     val symlink : iodesc_kind
31 :     val tty : iodesc_kind
32 :     val pipe : iodesc_kind
33 :     val socket : iodesc_kind
34 :     val device : iodesc_kind
35 :     end
36 :    
37 :     type poll_desc
38 :     (* this is an abstract representation of a polling operation on
39 :     * an I/O descriptor.
40 :     *)
41 :     type poll_info
42 :     (* this is an abstract representation of the per-descriptor
43 :     * information returned by the poll operation.
44 :     *)
45 :    
46 :     val pollDesc : iodesc -> poll_desc option
47 :     (* create a polling operation on the given descriptor; note that
48 :     * not all I/O devices support polling.
49 :     *)
50 :     val pollToIODesc : poll_desc -> iodesc
51 :     (* return the I/O descriptor that is being polled *)
52 :    
53 :     exception Poll
54 :    
55 :     (* set polling events; if the polling operation is not appropriate
56 :     * for the underlying I/O device, then the Poll exception is raised.
57 :     *)
58 :     val pollIn : poll_desc -> poll_desc
59 :     val pollOut : poll_desc -> poll_desc
60 :     val pollPri : poll_desc -> poll_desc
61 :    
62 :     (* polling function *)
63 :     val poll : (poll_desc list * Time.time option) -> poll_info list
64 :     (* a timeout of NONE means wait indefinitely; a timeout of
65 :     * (SOME Time.zeroTime) means do not block.
66 :     *)
67 :    
68 :     (* check for conditions *)
69 :     val isIn : poll_info -> bool
70 :     val isOut : poll_info -> bool
71 :     val isPri : poll_info -> bool
72 :     val infoToPollDesc : poll_info -> poll_desc
73 :    
74 :     end (* OS_IO *)
75 :    
76 :    
77 :     (*
78 : monnier 93 * $Log: os-io.sig,v $
79 :     * Revision 1.1.1.1 1998/04/08 18:39:56 george
80 :     * Version 110.5
81 : monnier 16 *
82 :     *)

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