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/primop-branch/src/system/Basis/Implementation/Sockets/unix-sock.sml
ViewVC logotype

Diff of /sml/branches/primop-branch/src/system/Basis/Implementation/Sockets/unix-sock.sml

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

revision 1470, Mon Mar 29 22:45:55 2004 UTC revision 1471, Mon Mar 29 22:45:55 2004 UTC
# Line 4  Line 4 
4   *   *
5   *)   *)
6    
 local  
     structure Socket = SocketImp  
 in  
7  structure UnixSock : UNIX_SOCK =  structure UnixSock : UNIX_SOCK =
8    struct    struct
9      structure SOCK = Socket.SOCK      structure SOCK = SocketImp.SOCK
10    
11      fun sockFn x = CInterface.c_function "SMLNJ-Sockets" x      fun sockFn x = CInterface.c_function "SMLNJ-Sockets" x
12    
13      datatype unix = UNIX      datatype unix = UNIX
14    
15      type 'a sock = (unix, 'a) Socket.sock      type 'a sock = (unix, 'a) Socket.sock
16      type 'a stream_sock = 'a Socket.stream sock      type 'a stream_sock = 'a SocketImp.stream sock
17      type dgram_sock = Socket.dgram sock      type dgram_sock = SocketImp.dgram sock
18    
19      type sock_addr = unix Socket.sock_addr      type sock_addr = unix Socket.sock_addr
20    
21      val unixAF = Option.valOf(Socket.AF.fromString "UNIX")      val unixAF = Option.valOf(SocketImp.AF.fromString "UNIX")
22    
23  (** We should probably do some error checking on the length of the string *)  (** We should probably do some error checking on the length of the string *)
24      local      local
25        val toUnixAddr : string -> PreSock.addr = sockFn "toUnixAddr"        val toUnixAddr : string -> Socket.addr = sockFn "toUnixAddr"
26        val fromUnixAddr : PreSock.addr -> string = sockFn "fromUnixAddr"        val fromUnixAddr : Socket.addr -> string = sockFn "fromUnixAddr"
27      in      in
28      fun toAddr s = PreSock.ADDR(toUnixAddr s)      fun toAddr s = Socket.ADDR(toUnixAddr s)
29      fun fromAddr (PreSock.ADDR addr) = fromUnixAddr addr      fun fromAddr (Socket.ADDR addr) = fromUnixAddr addr
30      end      end
31    
32      structure Strm =      structure Strm =
# Line 47  Line 44 
44          fun socketPair' proto = GenericSock.socketPair' (unixAF, SOCK.dgram, proto)          fun socketPair' proto = GenericSock.socketPair' (unixAF, SOCK.dgram, proto)
45        end        end
46    end    end
 end  
   

Legend:
Removed from v.1470  
changed lines
  Added in v.1471

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