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/cml/src/IO/prim-io-fn.sml
ViewVC logotype

View of /sml/trunk/src/cml/src/IO/prim-io-fn.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1381 - (download) (annotate)
Wed Sep 17 21:28:41 2003 UTC (16 years, 1 month ago) by mblume
File size: 1866 byte(s)
various Basis-related changes (see HISTORY)
(* prim-io-fn.sml
 *
 * COPYRIGHT (c) 1996 AT&T Research.
 * COPYRIGHT (c) 1991 John H. Reppy.
 *
 *)

functor PrimIO (

    structure Vector : MONO_VECTOR
    structure Array : MONO_ARRAY
    structure VectorSlice : MONO_VECTOR_SLICE
    structure ArraySlice : MONO_ARRAY_SLICE
      sharing type Vector.vector = Array.vector =
		   VectorSlice.vector = ArraySlice.vector
      sharing type Vector.elem = Array.elem =
		   VectorSlice.elem = ArraySlice.elem
      sharing type ArraySlice.vector_slice = VectorSlice.slice
    val someElem : Vector.elem
    eqtype pos
    val compare : (pos * pos) -> order

  ) : PRIM_IO = struct

    type 'a event = 'a CML.event

    structure A = Array
    structure V = Vector

    type elem = A.elem
    type vector = V.vector
    type array = A.array
    type array_slice = ArraySlice.slice
    type vector_slice = VectorSlice.slice
    type pos = pos

    val compare = compare

    datatype reader = RD of {
	name       : string, 
	chunkSize  : int,
	readVec    : int -> vector,
        readArr    : array_slice -> int,
	readVecEvt : int -> vector event,
	readArrEvt : array_slice -> int event,
	avail      : unit -> int option,
	getPos     : (unit -> pos) option,
	setPos     : (pos -> unit) option,
        endPos     : (unit -> pos) option,
	verifyPos  : (unit -> pos) option,
	close      : unit -> unit,
	ioDesc     : OS.IO.iodesc option
      }

    datatype writer = WR of {
	name        : string,
	chunkSize   : int,
	writeVec    : vector_slice -> int,
	writeArr    : array_slice -> int,
	writeVecEvt : vector_slice -> int event,
	writeArrEvt : array_slice -> int event,
	getPos      : (unit -> pos) option,
	setPos      : (pos -> unit) option,
        endPos      : (unit -> pos) option,
	verifyPos  : (unit -> pos) option,
	close       : unit -> unit,
	ioDesc      : OS.IO.iodesc option
      }

  end (* PrimIO *)

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