DIRECTORY IO USING [STREAM], IPBasic USING [Op, Rational, XeroxPixelVectorType], Rope USING [ROPE]; IPWriter: CEDAR DEFINITIONS ~ BEGIN ROPE: TYPE ~ Rope.ROPE; STREAM: TYPE ~ IO.STREAM; Op: TYPE ~ IPBasic.Op; Rational: TYPE ~ IPBasic.Rational; ErrorCode: TYPE ~ { ok, -- initial value for an ErrorCode bug, -- implementation bug unimplemented, -- operation not currently implemented unknownEncoding, -- the requested encoding is not implemented illegalArgument, -- invalid argument for an operation closed -- tried to operate on a closed writer }; Error: ERROR[code: ErrorCode, explanation: ROPE _ NIL]; Writer: TYPE ~ REF WriterRep; WriterRep: TYPE ~ RECORD[class: Class, stream: STREAM]; Class: TYPE ~ REF ClassRep; ClassRep: TYPE ~ RECORD[ encoding: ATOM _, putOp: PROC[writer: Writer, op: Op] _, putInt: PROC[writer: Writer, value: INT] _, putReal: PROC[writer: Writer, value: REAL] _, putRational: PROC[writer: Writer, value: Rational] _, putIdentifier: PROC[writer: Writer, rope: ROPE] _, putString: PROC[writer: Writer, rope: ROPE] _, putInsertfile: PROC[writer: Writer, rope: ROPE] _, putComment: PROC[writer: Writer, rope: ROPE] _, putAnnotation: PROC[writer: Writer, rope: ROPE] _, putLargeVector: PROC[writer: Writer, putBytes: PROC[STREAM], bytesPerElement: [0..256), type: IPBasic.XeroxPixelVectorType] _ ]; Open: PROC[name: ROPE, encoding: ATOM] RETURNS[Writer]; Create: PROC[stream: STREAM, encoding: ATOM] RETURNS[Writer]; PutHeader: PROC[writer: Writer]; Close: PROC[writer: Writer]; PutOp: PROC[writer: Writer, op: Op]; PutInt: PROC[writer: Writer, value: INT]; PutReal: PROC[writer: Writer, value: REAL]; PutRational: PROC[writer: Writer, value: Rational]; PutIdentifier: PROC[writer: Writer, rope: ROPE]; PutString: PROC[writer: Writer, rope: ROPE]; PutComment: PROC[writer: Writer, rope: ROPE]; PutAnnotation: PROC[writer: Writer, rope: ROPE]; PutInsertfile: PROC[writer: Writer, rope: ROPE]; PutLargeVector: PROC[writer: Writer, putBytes: PROC[STREAM], bytesPerElement: [0..256), type: IPBasic.XeroxPixelVectorType _ $nil ]; Register: PROC[class: Class]; END. &IPWriter.mesa Copyright c 1984 Xerox Corporation. All rights reserved. Doug Wyatt, August 22, 1984 10:14:49 am PDT Token-level interface for writing encoded Interpress masters Create the named file, write a header for the specified encoding, and return a Writer. Create a Writer for the given stream. (Does not write a header.) Write an Interpress header for the writer's encoding. Close the writer's stream and prevent further calls on the writer. The number of bytes put into the stream by putBytes must be a multiple of bytesPerElement. ʯ˜šœ ™ Jšœ Ïmœ.™9Jšœ+™+—J™Jšœ<™