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/trunk/src/system/Basis/Implementation/Sockets/pre-sock.sml
ViewVC logotype

Diff of /sml/trunk/src/system/Basis/Implementation/Sockets/pre-sock.sml

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

revision 1392, Wed Sep 24 21:56:14 2003 UTC revision 1393, Fri Sep 26 17:00:32 2003 UTC
# Line 1  Line 1 
1  (* pre-sock.sml  (* pre-soc.ksml
2   *   *
3   * COPYRIGHT (c) 1995 AT&T Bell Laboratories.   * COPYRIGHT (c) 1995 AT&T Bell Laboratories.
4   *   *
# Line 12  Line 12 
12      structure Word8 = Word8Imp      structure Word8 = Word8Imp
13      structure Word = WordImp      structure Word = WordImp
14  in  in
15  structure PreSock =  structure Socket = struct
   struct  
16    
17    (* the raw representation address data *)    (* the raw representation address data *)
18      type addr = Word8Vector.vector      type addr = Word8Vector.vector
# Line 33  Line 32 
32     *)     *)
33      datatype in_addr = INADDR of addr      datatype in_addr = INADDR of addr
34    
   (* an address family *)  
     datatype addr_family = AF of af  
   
   (* socket types *)  
     datatype sock_type = SOCKTY of CInterface.system_const  
35    
36    (* sockets are polymorphic; the instantiation of the type variables    (* sockets are polymorphic; the instantiation of the type variables
37     * provides a way to distinguish between different kinds of sockets.     * provides a way to distinguish between different kinds of sockets.
# Line 45  Line 39 
39      datatype ('sock, 'af) sock = SOCK of socket      datatype ('sock, 'af) sock = SOCK of socket
40      datatype 'af sock_addr = ADDR of addr      datatype 'af sock_addr = ADDR of addr
41    
42      (* witness types for the socket parameter *)
43        datatype dgram = DGRAM
44        datatype 'a stream = STREAM
45        datatype passive = PASSIVE
46        datatype active = ACTIVE
47    
48        structure AF = struct
49            datatype addr_family = AF of af
50        end
51    
52        structure SOCK = struct
53            (* socket types *)
54            datatype sock_type = SOCKTY of CInterface.system_const
55        end
56    
57        datatype shutdown_mode = NO_RECVS | NO_SENDS | NO_RECVS_OR_SENDS
58        type sock_desc = OS.IO.iodesc
59    
60      (* Sock I/O option types *)
61        type out_flags = {don't_route : bool, oob : bool}
62        type in_flags = {peek : bool, oob : bool}
63    
64    (** Utility functions for parsing/unparsing network addresses **)    (** Utility functions for parsing/unparsing network addresses **)
65      local      local
66        structure SysW = SysWord        structure SysW = SysWord
# Line 105  Line 121 
121    
122    end (* PreSock *)    end (* PreSock *)
123  end  end
   
 (* We alias this structure to Socket so that the signature files will compile.  
  * We also need to keep the PreSock structure visible, so that structures  
  * compiled after the real Sock structure still have access to the representation  
  * types.  
  *)  
 structure Socket = PreSock;  

Legend:
Removed from v.1392  
changed lines
  Added in v.1393

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