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

SCM Repository

[smlnj] Diff of /sml/branches/idlbasis-devel/src/system/Basis/Implementation/Posix/posix-tty.sml
ViewVC logotype

Diff of /sml/branches/idlbasis-devel/src/system/Basis/Implementation/Posix/posix-tty.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 866, Mon Jul 2 16:33:10 2001 UTC revision 867, Mon Jul 2 20:14:11 2001 UTC
# Line 36  Line 36 
36          fun fromWord w = F w          fun fromWord w = F w
37          fun toWord (F w) = w          fun toWord (F w) = w
38    
39            val all = F (SysWord.notb 0w0)  (* too much? *)
40    
41          fun flags ms = F(List.foldl (fn (F m,acc) => m ++ acc) 0w0 ms)          fun flags ms = F(List.foldl (fn (F m,acc) => m ++ acc) 0w0 ms)
42            fun intersect ms = F(List.foldl (fn (F m,acc) => m & acc)
43                                            (SysWord.notb 0w0) ms)
44            fun clear (F m, F m') = F (SysWord.notb m & m')
45          fun anySet (F m, F m') = (m & m') <> 0w0          fun anySet (F m, F m') = (m & m') <> 0w0
46          fun allSet (F m, F m') = (m & m') = m          fun allSet (F m, F m') = (m & m') = m
47    
# Line 60  Line 65 
65          fun fromWord w = F w          fun fromWord w = F w
66          fun toWord (F w) = w          fun toWord (F w) = w
67    
68            val all = F (SysWord.notb 0w0)
69    
70          fun flags ms = F(List.foldl (fn (F m,acc) => m ++ acc) 0w0 ms)          fun flags ms = F(List.foldl (fn (F m,acc) => m ++ acc) 0w0 ms)
71            fun intersect ms = F(List.foldl (fn (F m,acc) => m & acc) (SysWord.notb 0w0) ms)
72            fun clear (F m, F m') = F (SysWord.notb m & m')
73          fun anySet (F m, F m') = (m & m') <> 0w0          fun anySet (F m, F m') = (m & m') <> 0w0
74          fun allSet (F m, F m') = (m & m') = m          fun allSet (F m, F m') = (m & m') = m
75    
# Line 74  Line 83 
83          fun fromWord w = F w          fun fromWord w = F w
84          fun toWord (F w) = w          fun toWord (F w) = w
85    
86            val all = F (SysWord.notb 0w0)
87    
88          fun flags ms = F(List.foldl (fn (F m,acc) => m ++ acc) 0w0 ms)          fun flags ms = F(List.foldl (fn (F m,acc) => m ++ acc) 0w0 ms)
89            fun intersect ms = F(List.foldl (fn (F m,acc) => m & acc) (SysWord.notb 0w0) ms)
90            fun clear (F m, F m') = F (SysWord.notb m & m')
91          fun anySet (F m, F m') = (m & m') <> 0w0          fun anySet (F m, F m') = (m & m') <> 0w0
92          fun allSet (F m, F m') = (m & m') = m          fun allSet (F m, F m') = (m & m') = m
93    
# Line 98  Line 111 
111          fun fromWord w = F w          fun fromWord w = F w
112          fun toWord (F w) = w          fun toWord (F w) = w
113    
114            val all = F (SysWord.notb 0w0)  (* too much ? *)
115    
116          fun flags ms = F(List.foldl (fn (F m,acc) => m ++ acc) 0w0 ms)          fun flags ms = F(List.foldl (fn (F m,acc) => m ++ acc) 0w0 ms)
117            fun intersect ms = F(List.foldl (fn (F m,acc) => m & acc)
118                                            (SysWord.notb 0w0) ms)
119            fun clear (F m, F m') = F (SysWord.notb m & m')
120          fun anySet (F m, F m') = (m & m') <> 0w0          fun anySet (F m, F m') = (m & m') <> 0w0
121          fun allSet (F m, F m') = (m & m') = m          fun allSet (F m, F m') = (m & m') = m
122    
# Line 190  Line 208 
208      fun getlflag (TIOS{lflag, ...}) = lflag      fun getlflag (TIOS{lflag, ...}) = lflag
209      fun getcc (TIOS{cc,...}) = cc      fun getcc (TIOS{cc,...}) = cc
210    
211        structure CF = struct
212      fun getospeed (TIOS{ospeed,...}) = ospeed      fun getospeed (TIOS{ospeed,...}) = ospeed
213      fun getispeed (TIOS{ispeed,...}) = ispeed      fun getispeed (TIOS{ispeed,...}) = ispeed
214    
# Line 213  Line 232 
232              ispeed = ispeed,              ispeed = ispeed,
233              ospeed = #ospeed r              ospeed = #ospeed r
234            }            }
235        end
236    
237      structure TC =      structure TC =
238        struct        struct
# Line 234  Line 254 
254          val iflush = QS (osval "TCIFLUSH")          val iflush = QS (osval "TCIFLUSH")
255          val oflush = QS (osval "TCOFLUSH")          val oflush = QS (osval "TCOFLUSH")
256          val ioflush = QS (osval "TCIOFLUSH")          val ioflush = QS (osval "TCIOFLUSH")
       end  
257    
258      type termio_rep = (      type termio_rep = (
259             word *               (* iflags *)             word *               (* iflags *)
# Line 262  Line 281 
281            end            end
282    
283      val tcsetattr : int * s_int * termio_rep -> unit = cfun "tcsetattr"      val tcsetattr : int * s_int * termio_rep -> unit = cfun "tcsetattr"
284      fun setattr (fd, TC.SA sa, TIOS tios) = let          fun setattr (fd, SA sa, TIOS tios) = let
285            val (I.F iflag) = #iflag tios            val (I.F iflag) = #iflag tios
286            val (O.F oflag) = #oflag tios            val (O.F oflag) = #oflag tios
287            val (C.F cflag) = #cflag tios            val (C.F cflag) = #cflag tios
# Line 282  Line 301 
301      fun drain fd = tcdrain (FS.intOf fd)      fun drain fd = tcdrain (FS.intOf fd)
302    
303      val tcflush : int * s_int -> unit = cfun "tcflush"      val tcflush : int * s_int -> unit = cfun "tcflush"
304      fun flush (fd, TC.QS qs) = tcflush (FS.intOf fd, qs)          fun flush (fd, QS qs) = tcflush (FS.intOf fd, qs)
305    
306      val tcflow : int * s_int -> unit = cfun "tcflow"      val tcflow : int * s_int -> unit = cfun "tcflow"
307      fun flow (fd, TC.FA action) = tcflow (FS.intOf fd, action)          fun flow (fd, FA action) = tcflow (FS.intOf fd, action)
308          end
309    
310      val tcgetpgrp : int -> s_int = cfun "tcgetpgrp"      val tcgetpgrp : int -> s_int = cfun "tcgetpgrp"
311      fun getpgrp fd = P.PID(tcgetpgrp(FS.intOf fd))      fun getpgrp fd = P.PID(tcgetpgrp(FS.intOf fd))

Legend:
Removed from v.866  
changed lines
  Added in v.867

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