ImagerSys.mesa
Copyright Ó 1988, 1989, 1990, 1991 by Xerox Corporation. All rights reserved.
Michael Plass, October 16, 1991 1:55 pm PDT
Tim Diebert: January 20, 1990 7:05:23 am PST
Doug Wyatt, June 5, 1990 3:34 pm PDT
~
BEGIN
OPEN Rope;
doAbortCheck: BOOL; -- Turn on to enable abort checking.
CheckForAbort: PROC = INLINE { IF doAbortCheck THEN ReallyCheckForAbort[] };
ReallyCheckForAbort:
PRIVATE
PROC;
RawHash:
UNSAFE
PROC [block: Basics.UnsafeBlock, modulus:
CARDINAL]
RETURNS [
CARDINAL];
Computes a hash function on a block of raw bytes. Answer is in [0..modulus);
modulus should be produced by GoodModulus to ensure a good hash distribution.
GoodModulus:
PROC [size:
CARDINAL]
RETURNS [
CARDINAL];
Computes an appropriate modulus near the given size.
LongMult:
PROC [a, b:
CARDINAL]
RETURNS [
CARD32];
SMul:
PROC [a:
INTEGER, b:
INTEGER]
RETURNS [
INT] ~
INLINE {
RETURN [IF a#0 THEN Smul[a, b] ELSE 0]
};
Smul: PRIVATE PROC [a: INTEGER, b: INTEGER] RETURNS [INT];
FileError:
ERROR [code:
ATOM, explanation:
ROPE];
FileError is raised instead of the underlying file system error
OpenInputFile:
PROC [fileName:
ROPE]
RETURNS [stream:
IO.
STREAM];
Returns NIL if named file does not exist. Other errors are turned into FileErrors.
RopeFromFile:
PROC [fileName:
ROPE]
RETURNS [
ROPE];
Returns NIL if named file does not exist. Other errors are turned into FileErrors.
RopeFromStream:
PROC [stream:
IO.
STREAM]
RETURNS [
ROPE];
Client loses ownership of stream.
StreamFileName:
PROC [stream:
IO.
STREAM]
RETURNS [fullFName:
ROPE];
RETURNS NIL if unknown
StreamCreateDate:
PROC [stream:
IO.
STREAM]
RETURNS [created: BasicTime.
GMT];
RETURNS nullGMT if unknown
OpenOutputFile: PROC [fileName: ROPE] RETURNS [stream: IO.STREAM];