Browse Source

TSize -> Position
TOffset -> Offset

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@8127 8c9fc860-2736-0410-a75d-ab315db34111

eth.metacore 7 năm trước cách đây
mục cha
commit
95c2375e27
3 tập tin đã thay đổi với 81 bổ sung82 xóa
  1. 7 7
      source/FSTools64.Mod
  2. 30 31
      source/Files64.Mod
  3. 44 44
      source/Streams64.Mod

+ 7 - 7
source/FSTools64.Mod

@@ -225,7 +225,7 @@ BEGIN
 END SetDefault;
 
 (* using the NIST standard for Kibi, Mebi & Gibi: http://physics.nist.gov/cuu/Units/binary.html *)
-PROCEDURE WriteK( k: Files.TSize; out : Streams.Writer);
+PROCEDURE WriteK( k: Files.Position; out : Streams.Writer);
 VAR suffix: ARRAY 3 OF CHAR;
 BEGIN
 	IF k < 10*1024 THEN COPY("Ki", suffix)
@@ -289,8 +289,8 @@ VAR
 	string, pattern : ARRAY 256 OF CHAR;
 	enum : Files.Enumerator;
 	flags, fileflags : SET;
-	count: LONGINT; total : Files.TSize;
-	time, date: LONGINT; size : Files.TSize;
+	count: LONGINT; total : Files.Position;
+	time, date: LONGINT; size : Files.Position;
 	name : ARRAY MaxNameLen OF CHAR;
 	dt : Dates.DateTime;
 BEGIN
@@ -344,7 +344,7 @@ PROCEDURE EnumerateDirectory(
 	CONST arguments : ARRAY OF CHAR);
 VAR
 	name : Files.FileName;
-	flags : SET; time, date: LONGINT; size : Files.TSize;
+	flags : SET; time, date: LONGINT; size : Files.Position;
 	subDirEnum : Files.Enumerator;
 
 	PROCEDURE PrepareContext(context : Commands.Context; CONST currentFile, arguments : ARRAY OF CHAR);
@@ -443,7 +443,7 @@ END Enumerate;
 PROCEDURE CreateFile*(context : Commands.Context); (** [Options] filename [content] ~ *)
 VAR
 	options : Options.Options; cr, removeWhitespace : BOOLEAN;
-	file : Files.File; filename : Files.FileName; writer : Files.Writer; ch : CHAR; pos: Files.TSize;
+	file : Files.File; filename : Files.FileName; writer : Files.Writer; ch : CHAR; pos: Files.Position;
 BEGIN
 	NEW(options);
 	options.Add("c", "cr", Options.Flag);
@@ -856,7 +856,7 @@ PROCEDURE InsertFiles(CONST mask : ARRAY OF CHAR; VAR filelist : FileList; VAR i
 VAR
 	enum : Files.Enumerator;
 	fileflags : SET;
-	time, date: LONGINT; size : Files.TSize;
+	time, date: LONGINT; size : Files.Position;
 	name : ARRAY MaxNameLen OF CHAR;
 BEGIN
 	NEW(enum); enum.Open(mask, {});
@@ -955,7 +955,7 @@ PROCEDURE InsertFilesAndFixDestination(context : Commands.Context; CONST sourceM
 VAR
 	enum : Files.Enumerator;
 	fileflags : SET;
-	time, date: LONGINT; size : Files.TSize;
+	time, date: LONGINT; size : Files.Position;
 	name : ARRAY MaxNameLen OF CHAR;
 BEGIN
 	IF ~IsValidTargetMask(context, targetMask) THEN RETURN FALSE; END;

+ 30 - 31
source/Files64.Mod

@@ -59,8 +59,7 @@ CONST
 	NeedsPrefix*		= Files.NeedsPrefix; (* if no prefix given, then this file system cannot handle it, to prevent file systems from being in the search path *)
 
 TYPE
-	TSize* = Streams.TSize;
-	TOffset* = Streams.TOffset;
+	Position* = Streams.Position;
 
 TYPE
 (** All record fields are read-only for users, and read-write for extenders. *)
@@ -71,9 +70,9 @@ TYPE
 	Rider* = RECORD	(** not shareable between multiple processes *)
 		(* the rider must be a record, otherwise the Oberon text system will not work *)
 		eof*: BOOLEAN;	(** has end of file been passed *)
-		res*: TOffset;	(** leftover byte count for ReadBytes/WriteBytes *)
+		res*: Streams.Offset;	(** leftover byte count for ReadBytes/WriteBytes *)
 			(** private fields for implementors *)
-		apos*: TSize;
+		apos*: Streams.Position;
 		bpos*: LONGINT;
 		hint*: Hint;
 		file*: File;
@@ -88,7 +87,7 @@ TYPE
 		file : File;
 		r: Rider;
 
-		PROCEDURE Receive(VAR buf: ARRAY OF CHAR; ofs, size, min: TOffset; VAR len: TOffset; VAR res: WORD);
+		PROCEDURE Receive(VAR buf: ARRAY OF CHAR; ofs, size, min: Streams.Offset; VAR len: Streams.Offset; VAR res: WORD);
 		BEGIN
 			file.ReadBytes(r, buf, ofs, size);
 			len := size - r.res;
@@ -100,14 +99,14 @@ TYPE
 			RETURN TRUE;
 		END CanSetPos;
 
-		PROCEDURE SetPos*(pos : TSize);
+		PROCEDURE SetPos*(pos : Streams.Position);
 		BEGIN
 			file.Set(r, pos);
 			Reset;
 			received := pos; (* this effects that Streams.Reader.Pos() returns the correct location in the file *)
 		END SetPos;
 
-		PROCEDURE &InitFileReader*(file : File; pos: TSize);
+		PROCEDURE &InitFileReader*(file : File; pos: Streams.Position);
 		BEGIN
 			ASSERT(file # NIL);
 			SELF.file := file;
@@ -126,7 +125,7 @@ TYPE
 		file : File;
 		r: Rider;
 
-		PROCEDURE Send(CONST buf: ARRAY OF CHAR; ofs, len: TOffset; propagate: BOOLEAN; VAR res: WORD);
+		PROCEDURE Send(CONST buf: ARRAY OF CHAR; ofs, len: Streams.Offset; propagate: BOOLEAN; VAR res: WORD);
 		BEGIN
 			r.file.WriteBytes(r, buf, ofs, len);
 			IF propagate THEN r.file.Update END;
@@ -138,20 +137,20 @@ TYPE
 			RETURN TRUE;
 		END CanSetPos;
 
-		PROCEDURE SetPos*(pos : TSize);
+		PROCEDURE SetPos*(pos : Streams.Position);
 			BEGIN
 			Update;
 			file.Set(r, pos);
 			Reset;
 		END SetPos;
 
-		PROCEDURE Pos*(): TSize;
+		PROCEDURE Pos*(): Streams.Position;
 		BEGIN
 			Update;
 			RETURN file.Pos(r)
 		END Pos;
 
-		PROCEDURE &InitFileWriter*(file: File; pos: TSize);
+		PROCEDURE &InitFileWriter*(file: File; pos: Streams.Position);
 		BEGIN
 			ASSERT(file # NIL);
 			SELF.file := file;
@@ -235,7 +234,7 @@ TYPE
 
 		(* default implementation using an enumerator *)
 		PROCEDURE Has*(CONST name: ARRAY OF CHAR; VAR fullName: ARRAY OF CHAR; VAR flags: SET): BOOLEAN;
-		VAR enum: Enumerator; time, date: LONGINT; size: TSize;
+		VAR enum: Enumerator; time, date: LONGINT; size: Streams.Position;
 		BEGIN
 			NEW(enum);
 			enum.Open(name,{});
@@ -263,14 +262,14 @@ TYPE
 			key*: LONGINT;	(* unique id for registered file, never 0 *)
 			fs*: FileSystem;	(* file system containing file *)
 
-		(** Position a Rider at a certain position in a file. Multiple Riders can be positioned at different locations in a file. A Rider cannot be positioned beyond the end of a file. *)
+		(** ddPosition a Rider at a certain position in a file. Multiple Riders can be positioned at different locations in a file. A Rider cannot be positioned beyond the end of a file. *)
 
-		PROCEDURE Set*(VAR r: Rider; pos: TSize);
+		PROCEDURE Set*(VAR r: Rider; pos: Streams.Position);
 		BEGIN HALT(301) END Set;	(* abstract *)
 
 		(** Return the offset of a Rider positioned on a file. *)
 
-		PROCEDURE Pos*(VAR r: Rider): TSize;
+		PROCEDURE Pos*(VAR r: Rider): Streams.Position;
 		BEGIN HALT(301) END Pos;	(* abstract *)
 
 		(** Read a byte from a file, advancing the Rider one byte further.  R.eof indicates if the end of the file has been passed. *)
@@ -280,7 +279,7 @@ TYPE
 
 		(** Read a sequence of len bytes into the buffer x at offset ofs, advancing the Rider. Less bytes will be read when reading over the end of the file. r.res indicates the number of unread bytes. x must be big enough to hold all the bytes. *)
 
-		PROCEDURE ReadBytes*(VAR r: Rider; VAR x: ARRAY OF CHAR; ofs, len: TOffset);
+		PROCEDURE ReadBytes*(VAR r: Rider; VAR x: ARRAY OF CHAR; ofs, len: Streams.Offset);
 		BEGIN HALT(301) END ReadBytes;	(* abstract *)
 
 		(** Write a byte into the file at the Rider position, advancing the Rider by one. *)
@@ -290,12 +289,12 @@ TYPE
 
 		(** Write the buffer x containing len bytes (starting at offset ofs) into a file at the Rider position. *)
 
-		PROCEDURE WriteBytes*(VAR r: Rider; CONST x: ARRAY OF CHAR; ofs, len: TOffset);
+		PROCEDURE WriteBytes*(VAR r: Rider; CONST x: ARRAY OF CHAR; ofs, len: Streams.Offset);
 		BEGIN HALT(301) END WriteBytes;	(* abstract *)
 
 		(** Return the current length of a file. *)
 
-		PROCEDURE Length*(): TSize;
+		PROCEDURE Length*(): Streams.Position;
 		BEGIN HALT(301) END Length;	(* abstract *)
 
 		(** Return the time (t) and date (d) when a file was last modified. *)
@@ -378,7 +377,7 @@ TYPE
 
 		(** Get one entry from the enumerator. *)
 
-		PROCEDURE GetEntry*(VAR name: ARRAY OF CHAR; VAR flags: SET; VAR time, date: LONGINT; VAR size: TSize): BOOLEAN;
+		PROCEDURE GetEntry*(VAR name: ARRAY OF CHAR; VAR flags: SET; VAR time, date: LONGINT; VAR size: Streams.Position): BOOLEAN;
 		VAR len: LONGINT;
 		BEGIN
 			ReadNum(r, len);
@@ -401,7 +400,7 @@ TYPE
 
 		(** For internal use only. *)
 
-		PROCEDURE PutEntry*(VAR name: ARRAY OF CHAR; flags: SET; time, date: LONGINT; size:TSize);
+		PROCEDURE PutEntry*(VAR name: ARRAY OF CHAR; flags: SET; time, date: LONGINT; size:Streams.Position);
 		VAR len: LONGINT;
 		BEGIN
 			ASSERT(adding);
@@ -445,7 +444,7 @@ VAR
 
 (** Open a reader on a file at the specified position. *)
 
-PROCEDURE OpenReader*(VAR b: Reader; f: File; pos: TSize);
+PROCEDURE OpenReader*(VAR b: Reader; f: File; pos: Streams.Position);
 BEGIN
 	IF b = NIL THEN
 		NEW(b, f, pos)
@@ -456,7 +455,7 @@ END OpenReader;
 
 (** Open a writer on a file at the specified position.  Remember to call Streams.Update before registering or closing the file! *)
 
-PROCEDURE OpenWriter*(VAR b: Writer; f: File; pos: TSize);
+PROCEDURE OpenWriter*(VAR b: Writer; f: File; pos: Streams.Position);
 BEGIN
 	NEW(b, f, pos)
 END OpenWriter;
@@ -812,7 +811,7 @@ VAR writer : Writer;
 	reader : Reader;
 	file : File;
 	chunk : ARRAY 4096 OF CHAR;
-	len : TOffset;
+	len : Streams.Offset;
 BEGIN
 	IF fileClipboard = NIL THEN RETURN END;
 	IF Old(name) # NIL THEN res := FileAlreadyExists;			(* File already exists *)
@@ -846,7 +845,7 @@ VAR
 	sfs, dfs : FileSystem;
 	sfile, dfile : File;
 	buffer : ARRAY BufferSize OF CHAR;
-	i : TSize;
+	i : Streams.Position;
 BEGIN
 	SplitName(source, sprefix, sname);
 	SplitName(destination, dprefix, dname);
@@ -894,8 +893,8 @@ BEGIN
 		dfile.WriteBytes(dPos, buffer, 0, BufferSize);
 		INC(i);
 	END;
-	sfile.ReadBytes(sPos, buffer, 0, TOffset(sfile.Length() MOD BufferSize));
-	dfile.WriteBytes(dPos, buffer, 0, TOffset(sfile.Length() MOD BufferSize));
+	sfile.ReadBytes(sPos, buffer, 0, Streams.Offset(sfile.Length() MOD BufferSize));
+	dfile.WriteBytes(dPos, buffer, 0, Streams.Offset(sfile.Length() MOD BufferSize));
 	dfile.Update;
 	Register(dfile); (* Will enter exclusive region *)
 END CopyFile;
@@ -1081,8 +1080,8 @@ BEGIN
 	r.file.ReadBytes(r, SYSTEM.VAL(Bytes8, x), 0, 8)
 END ReadHInt;
 
-PROCEDURE ReadTSize*(VAR r: Rider; VAR x: TSize);
-CONST Size = SIZEOF (TSize);
+PROCEDURE ReadTSize*(VAR r: Rider; VAR x: Streams.Position);
+CONST Size = SIZEOF (Streams.Position);
 TYPE Bytes = ARRAY Size OF CHAR;
 BEGIN
 	r.file.ReadBytes(r, SYSTEM.VAL(Bytes, x), 0, Size)
@@ -1162,8 +1161,8 @@ BEGIN
 	r.file.WriteBytes(r, SYSTEM.VAL(Bytes8, x), 0, 8)
 END WriteHInt;
 
-PROCEDURE WriteTSize*(VAR r: Rider; x: TSize);
-CONST Size = SIZEOF (TSize);
+PROCEDURE WriteTSize*(VAR r: Rider; x: Streams.Position);
+CONST Size = SIZEOF (Streams.Position);
 TYPE Bytes = ARRAY Size OF CHAR;
 BEGIN
 	r.file.WriteBytes(r, SYSTEM.VAL(Bytes, x), 0, Size)
@@ -1192,7 +1191,7 @@ BEGIN
 END WriteLReal;
 
 PROCEDURE WriteString*(VAR r: Rider; x: ARRAY OF CHAR);
-VAR i: TOffset;
+VAR i: Streams.Offset;
 BEGIN
 	i := 0; WHILE x[i] # 0X DO INC(i) END;
 	r.file.WriteBytes(r, x, 0, i+1)

+ 44 - 44
source/Streams64.Mod

@@ -23,22 +23,22 @@ VAR
 	H, L: INTEGER;
 
 TYPE
-	TSize*		= HUGEINT;
-	TOffset*	= LONGWORD;
+	Position*		= HUGEINT;
+	Offset*	= LONGWORD;
 
 TYPE
 	(** Any stream output procedure or method. *)
-	Sender* = PROCEDURE {DELEGATE} ( CONST buf: ARRAY OF CHAR;  ofs, len: TOffset;  propagate: BOOLEAN;  VAR res: WORD );
+	Sender* = PROCEDURE {DELEGATE} ( CONST buf: ARRAY OF CHAR;  ofs, len: Offset;  propagate: BOOLEAN;  VAR res: WORD );
 
 	(** Any stream input procedure or method. *)
-	Receiver* = PROCEDURE {DELEGATE} ( VAR buf: ARRAY OF CHAR;  ofs, size, min: TOffset;  VAR len: TOffset; VAR res: WORD );
+	Receiver* = PROCEDURE {DELEGATE} ( VAR buf: ARRAY OF CHAR;  ofs, size, min: Offset;  VAR len: Offset; VAR res: WORD );
 
 	Connection* = OBJECT
 
-		PROCEDURE Send*( CONST data: ARRAY OF CHAR;  ofs, len: TOffset;  propagate: BOOLEAN;  VAR res: WORD );
+		PROCEDURE Send*( CONST data: ARRAY OF CHAR;  ofs, len: Offset;  propagate: BOOLEAN;  VAR res: WORD );
 		END Send;
 
-		PROCEDURE Receive*( VAR data: ARRAY OF CHAR;  ofs, size, min: TOffset;  VAR len: TOffset; VAR res: WORD );
+		PROCEDURE Receive*( VAR data: ARRAY OF CHAR;  ofs, size, min: Offset;  VAR len: Offset; VAR res: WORD );
 		END Receive;
 
 		PROCEDURE Close*;
@@ -50,14 +50,14 @@ TYPE
 TYPE
 	Writer* = OBJECT
 	VAR
-		tail: TOffset;
+		tail: Offset;
 		buf: POINTER TO ARRAY OF CHAR;
 		res*: WORD; (** result of last output operation. *)
 		send: Sender;
-		sent*: TSize;  (** count of sent bytes *)
+		sent*: Position;  (** count of sent bytes *)
 		(* buf[0..tail-1] contains data to write. *)
 
-		PROCEDURE & InitWriter*( send: Sender;  size: TOffset );
+		PROCEDURE & InitWriter*( send: Sender;  size: Offset );
 		BEGIN
 			ASSERT ( send # NIL );
 			IF (buf = NIL) OR (LEN(buf) # size) THEN
@@ -76,7 +76,7 @@ TYPE
 			RETURN FALSE
 		END CanSetPos;
 
-		PROCEDURE SetPos*( pos: TSize );
+		PROCEDURE SetPos*( pos: Position );
 		BEGIN
 			HALT( 1234 )
 		END SetPos;
@@ -90,7 +90,7 @@ TYPE
 		END Update;
 
 	(** Current write position. *)
-		PROCEDURE Pos*( ): TSize;
+		PROCEDURE Pos*( ): Position;
 		BEGIN
 			RETURN sent + tail;
 		END Pos;
@@ -108,8 +108,8 @@ TYPE
 		END Char;
 
 	(** Write len bytes from x, starting at ofs. *)
-		PROCEDURE Bytes*(CONST x: ARRAY OF CHAR;  ofs, len: TOffset );
-		VAR n: TOffset;
+		PROCEDURE Bytes*(CONST x: ARRAY OF CHAR;  ofs, len: Offset );
+		VAR n: Offset;
 		BEGIN
 			ASSERT ( len >= 0 );
 			LOOP
@@ -501,12 +501,12 @@ TYPE
 	(** A special writer that buffers output to be fetched by GetString or GetRawString. *)
 	StringWriter* = OBJECT (Writer)
 
-		PROCEDURE & InitStringWriter*( size: TOffset );
+		PROCEDURE & InitStringWriter*( size: Offset );
 		BEGIN
 			InitWriter( Send, size )
 		END InitStringWriter;
 
-		PROCEDURE Send( CONST buf: ARRAY OF CHAR;  ofs, len: TOffset;  propagate: BOOLEAN;  VAR res: WORD );
+		PROCEDURE Send( CONST buf: ARRAY OF CHAR;  ofs, len: Offset;  propagate: BOOLEAN;  VAR res: WORD );
 		BEGIN
 			res := StringFull
 		END Send;
@@ -517,10 +517,10 @@ TYPE
 		END CanSetPos;
 
 	(* Set the position for the writer *)
-		PROCEDURE SetPos*( pos: TSize );
+		PROCEDURE SetPos*( pos: Position );
 		BEGIN
 			IF pos > LEN( buf ) THEN pos := LEN( buf ) END;
-			tail := TOffset( pos );  sent := 0;  res := Ok;
+			tail := Offset( pos );  sent := 0;  res := Ok;
 		END SetPos;
 
 		PROCEDURE Update*;
@@ -529,7 +529,7 @@ TYPE
 
 	(** Return the contents of the string writer (0X-terminated). *)
 		PROCEDURE Get*( VAR s: ARRAY OF CHAR );
-		VAR i, m: TOffset;
+		VAR i, m: Offset;
 		BEGIN
 			m := LEN( s ) - 1;  i := 0;
 			WHILE (i # tail) & (i < m) DO s[i] := buf[i];  INC( i ) END;
@@ -537,8 +537,8 @@ TYPE
 		END Get;
 
 	(** Return the contents of the string writer (not 0X-terminated).  The len parameters returns the string length. *)
-		PROCEDURE GetRaw*( VAR s: ARRAY OF CHAR;  VAR len: TOffset );
-		VAR i, m: TOffset;
+		PROCEDURE GetRaw*( VAR s: ARRAY OF CHAR;  VAR len: Offset );
+		VAR i, m: Offset;
 		BEGIN
 			m := LEN( s );  i := 0;
 			WHILE (i # tail) & (i < m) DO s[i] := buf[i];  INC( i ) END;
@@ -551,14 +551,14 @@ TYPE
 	(** A reader buffers input received from a Receiver.  Must not be shared between processes. *)
 	Reader* = OBJECT
 	VAR
-		head, tail: TOffset;
+		head, tail: Offset;
 		buf: POINTER TO ARRAY OF CHAR;
 		res*: WORD;   (** result of last input operation. *)
 		receive: Receiver;
-		received*: TSize;   (** count of received bytes *)
+		received*: Position;   (** count of received bytes *)
 		(* buf[buf.head..buf.tail-1] contains data to read. *)
 
-		PROCEDURE & InitReader*( receive: Receiver;  size: TOffset );
+		PROCEDURE & InitReader*( receive: Receiver;  size: Offset );
 		BEGIN
 			ASSERT ( receive # NIL );
 			IF (buf = NIL) OR (LEN(buf) # size) THEN
@@ -579,14 +579,14 @@ TYPE
 			RETURN FALSE
 		END CanSetPos;
 
-		PROCEDURE SetPos*( pos: TSize );
+		PROCEDURE SetPos*( pos: Position );
 		BEGIN
 			HALT( 1234 )
 		END SetPos;
 
 	(** Return bytes currently available in input buffer. *)
-		PROCEDURE Available*( ): TOffset;
-		VAR n: TOffset;
+		PROCEDURE Available*( ): Offset;
+		VAR n: Offset;
 		BEGIN
 			IF (res = Ok) THEN
 				IF (head = tail) THEN head := 0;  receive( buf^, 0, LEN( buf ), 0, tail, res );  INC( received, tail );
@@ -600,7 +600,7 @@ TYPE
 		END Available;
 
 	(** Current read position. *)
-		PROCEDURE Pos*( ): TSize;
+		PROCEDURE Pos*( ): Position;
 		BEGIN
 			RETURN received - (tail - head)
 		END Pos;
@@ -634,8 +634,8 @@ TYPE
 		END Peek;
 
 	(** Read size bytes into x, starting at ofs.  The len parameter returns the number of bytes that were actually read. *)
-		PROCEDURE Bytes*( VAR x: ARRAY OF CHAR;  ofs, size: TOffset;  VAR len: TOffset );
-		VAR n: TOffset;
+		PROCEDURE Bytes*( VAR x: ARRAY OF CHAR;  ofs, size: Offset;  VAR len: Offset );
+		VAR n: Offset;
 		BEGIN
 			ASSERT ( size >= 0 );
 			len := 0;
@@ -662,7 +662,7 @@ TYPE
 		END Bytes;
 
 	(** Skip n bytes on the reader. *)
-		PROCEDURE SkipBytes*( n: TSize );
+		PROCEDURE SkipBytes*( n: Position );
 		VAR ch: CHAR;
 		BEGIN
 			WHILE n > 0 DO ch := Get();  DEC( n ) END
@@ -684,14 +684,14 @@ TYPE
 
 	(** Read a LONGINT. *)
 		PROCEDURE RawLInt*( VAR x: LONGINT );
-		VAR ignore: TOffset;
+		VAR ignore: Offset;
 		BEGIN
 			Bytes( SYSTEM.VAL( Bytes4, x ), 0, 4, ignore )
 		END RawLInt;
 
 	(** Read a HUGEINT. *)
 		PROCEDURE RawHInt*( VAR x: HUGEINT );
-		VAR ignore: TOffset;
+		VAR ignore: Offset;
 		BEGIN
 			Bytes( SYSTEM.VAL( Bytes8, x ), 0, 8, ignore )
 		END RawHInt;
@@ -722,7 +722,7 @@ TYPE
 
 	(** Read a SET. *)
 		PROCEDURE RawSet*( VAR x: SET );
-		VAR ignore: TOffset;
+		VAR ignore: Offset;
 		BEGIN
 			Bytes( SYSTEM.VAL( Bytes4, x ), 0, 4, ignore )
 		END RawSet;
@@ -735,21 +735,21 @@ TYPE
 
 	(** Read a REAL. *)
 		PROCEDURE RawReal*( VAR x: REAL );
-		VAR ignore: TOffset;
+		VAR ignore: Offset;
 		BEGIN
 			Bytes( SYSTEM.VAL( Bytes4, x ), 0, 4, ignore )
 		END RawReal;
 
 	(** Read a LONGREAL. *)
 		PROCEDURE RawLReal*( VAR x: LONGREAL );
-		VAR ignore: TOffset;
+		VAR ignore: Offset;
 		BEGIN
 			Bytes( SYSTEM.VAL( Bytes8, x ), 0, 8, ignore )
 		END RawLReal;
 
 	(** Read a 0X-terminated string.  If the input string is larger than x, read the full string and assign the truncated 0X-terminated value to x. *)
 		PROCEDURE RawString*( VAR x: ARRAY OF CHAR );
-		VAR i, m: TOffset;  ch: CHAR;
+		VAR i, m: Offset;  ch: CHAR;
 		BEGIN
 			i := 0;  m := LEN( x ) - 1;
 			LOOP
@@ -854,7 +854,7 @@ TYPE
 	(** Read all characters until the end of the line (inclusive).  If the input string is larger than x, read the full string and assign
 			the truncated 0X-terminated value to x. *)
 		PROCEDURE Ln*( VAR x: ARRAY OF CHAR );
-		VAR i, m: TOffset;  ch: CHAR;
+		VAR i, m: Offset;  ch: CHAR;
 		BEGIN
 			i := 0;  m := LEN( x ) - 1;
 			LOOP
@@ -872,7 +872,7 @@ TYPE
 			If the input string is larger than x, read the full string and assign the truncated 0X-terminated
 			value to x. *)
 		PROCEDURE LnEOT*( VAR x: ARRAY OF CHAR );
-		VAR i, m: TOffset;  ch: CHAR;
+		VAR i, m: Offset;  ch: CHAR;
 		BEGIN
 			i := 0;  m := LEN( x ) - 1;
 			LOOP
@@ -990,7 +990,7 @@ TYPE
 	(** A special reader that buffers input set by SetString or SetRawString. *)
 	StringReader* = OBJECT (Reader)
 
-		PROCEDURE & InitStringReader*( size: TOffset );
+		PROCEDURE & InitStringReader*( size: Offset );
 		BEGIN
 			InitReader( Receive, size )
 		END InitStringReader;
@@ -1001,13 +1001,13 @@ TYPE
 		END CanSetPos;
 
 	(** Set the reader position *)
-		PROCEDURE SetPos*( pos: TSize );
+		PROCEDURE SetPos*( pos: Position );
 		BEGIN
 			IF pos > LEN( buf ) THEN pos := LEN( buf ) END;
-			head := TOffset( pos );  tail := LEN( buf );  received := LEN( buf );  res := Ok;
+			head := Offset( pos );  tail := LEN( buf );  received := LEN( buf );  res := Ok;
 		END SetPos;
 
-		PROCEDURE Receive( VAR buf: ARRAY OF CHAR;  ofs, size, min: TOffset;  VAR len: TOffset; VAR res: WORD );
+		PROCEDURE Receive( VAR buf: ARRAY OF CHAR;  ofs, size, min: Offset;  VAR len: Offset; VAR res: WORD );
 		BEGIN
 			IF min = 0 THEN res := Ok ELSE res := EOF END;
 			len := 0;
@@ -1015,7 +1015,7 @@ TYPE
 
 	(** Set the contents of the string buffer.  The s parameter is a 0X-terminated string. *)
 		PROCEDURE Set*(CONST  s: ARRAY OF CHAR );
-		VAR len: TOffset;
+		VAR len: Offset;
 		BEGIN
 			len := 0;
 			WHILE s[len] # 0X DO INC( len ) END;
@@ -1027,7 +1027,7 @@ TYPE
 		END Set;
 
 	(** Set the contents of the string buffer.  The len parameter specifies the size of the buffer s. *)
-		PROCEDURE SetRaw*(CONST s: ARRAY OF CHAR;  ofs, len: TOffset );
+		PROCEDURE SetRaw*(CONST s: ARRAY OF CHAR;  ofs, len: Offset );
 		BEGIN
 			IF len > LEN( buf ) THEN len := LEN( buf ) END;
 			head := 0;  tail := len;  received := len;  res := Ok;