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

SCM Repository

[smlnj] View of /sml/trunk/src/compiler/PervEnv/Sockets/unix-sock.sml
ViewVC logotype

View of /sml/trunk/src/compiler/PervEnv/Sockets/unix-sock.sml

Parent Directory Parent Directory | Revision Log Revision Log

Revision 250 - (download) (annotate)
Sat Apr 17 18:57:03 1999 UTC (21 years, 3 months ago) by monnier
File size: 1470 byte(s)
This commit was generated by cvs2svn to compensate for changes in r249,
which included commits to RCS files with non-trunk default branches.
(* unix-sock.sml
 * COPYRIGHT (c) 1995 AT&T Bell Laboratories.

structure UnixSock : UNIX_SOCK =
    structure SOCK = Socket.SOCK

    fun sockFn x = CInterface.c_function "SMLNJ-Sockets" x

    datatype unix = UNIX

    type 'a sock = (unix, 'a) Socket.sock
    type 'a stream_sock = 'a Socket.stream sock
    type dgram_sock = Socket.dgram sock

    type sock_addr = unix Socket.sock_addr

    val unixAF = Option.valOf(Socket.AF.fromString "UNIX")

(** We should probably do some error checking on the length of the string *)
      val toUnixAddr : string -> PreSock.addr = sockFn "toUnixAddr"
      val fromUnixAddr : PreSock.addr -> string = sockFn "fromUnixAddr"
    fun toAddr s = PreSock.ADDR(toUnixAddr s)
    fun fromAddr (PreSock.ADDR addr) = fromUnixAddr addr

    structure Strm =
	fun socket () = GenericSock.socket (unixAF, SOCK.stream)
	fun socket' proto = GenericSock.socket' (unixAF, SOCK.stream, proto)
	fun socketPair () = GenericSock.socketPair (unixAF, SOCK.stream)
	fun socketPair' proto = GenericSock.socketPair' (unixAF, SOCK.stream, proto)
    structure DGrm =
	fun socket () = GenericSock.socket (unixAF, SOCK.dgram)
	fun socket' proto = GenericSock.socket' (unixAF, SOCK.dgram, proto)
	fun socketPair () = GenericSock.socketPair (unixAF, SOCK.dgram)
	fun socketPair' proto = GenericSock.socketPair' (unixAF, SOCK.dgram, proto)

 * $Log$

ViewVC Help
Powered by ViewVC 1.0.0