ðíOberon10.Scn.FntOberon10i.Scn.Fntöÿÿÿ@ïðIStampElemsAlloc2 Dec 96þ¨l6Oberon10m.Scn.Fnt%   ? <Oberon12i.Scn.Fnt ýÿÿÿ nN'LineElemsAlloc*ÜýÿÿÿpmE'   A AH . 1*%!¼B ”¸MODULE Host; (** SHML 19 Mar 96,  *) (*---------------------------------------------------------* * Copyright (c) 1990-1996 ETH Z…rich. All Rights Reserved. * Oberon is a trademark of Institut f…r Computersysteme, ETH Z…rich. *---------------------------------------------------------*) (** This module encapsulates all system_dependent variables and procedures of an Oberon System V4. This is the version for Unix Oberon with the object model (HP, SGI). *) (* Created by Stefan H._M. Ludwig, Institute for Computer Systems, ETH Zurich, ludwig@inf.ethz.ch, 19 Mar 96 *) IMPORT Input, Display, Kernel, Modules; VAR Host-: ARRAY 32 OF CHAR; (** string identifying the host machine *) TimeUnit-: LONGINT; (** resolution of Input.Time(), TimeUnit ticks happen per second *) OptionChar-: CHAR; (** character used by command interpreters for specifying options *) PathChar-: CHAR; (** character used in file names for separating subdirectories *) (* Support *)  PROCEDURE Append(VAR to(*inout*): ARRAY OF CHAR; this: ARRAY OF CHAR); (* append this to to, trim this to space left in to *) VAR toLen, i, j: LONGINT; BEGIN i := -1; REPEAT INC(i) UNTIL to[i] = 0X; toLen := LEN(to)-1; j := 0; WHILE (i # toLen) & (this[j] # 0X) DO to[i] := this[j]; INC(i); INC(j) END; to[i] := 0X END Append; (* Exported procedures *)  PROCEDURE Backup*(X, Y, W, H: INTEGER); (** Backup screen area X, Y, W, H; (must not be followed by Backup) *) BEGIN Display.CopyBlock(X, Y, W, H, X, -H, Display.replace) (* backup into secondary bitmap *) END Backup; PROCEDURE Restore*(X, Y, W, H: INTEGER); (** Restore screen area X, Y, W, H; (must be preceded by Backup) *) BEGIN Display.CopyBlock(X, -H, W, H, X, Y, Display.replace) (* restore from secondary bitmap *) END Restore; PROCEDURE IsFileNameChar*(ch: CHAR): BOOLEAN; (** Is ch part of a valid file name? *) BEGIN CASE ch OF | "A".."Z", "a".."z", "0".."9", ".", "/", "_": RETURN TRUE ELSE RETURN FALSE END END IsFileNameChar; PROCEDURE CallError*(command: ARRAY OF CHAR; res: INTEGER; VAR msg(*out*): ARRAY OF CHAR); (** Translate error message when the call of command fails; (res # 0, 100); (LEN(msg) >= 32, 101) *) VAR i, j: INTEGER; BEGIN ASSERT(res # 0, 100); ASSERT(LEN(msg) >= 32, 101); IF res > 0 THEN COPY("Call error: ", msg); Append(msg, Modules.importing); IF res = 1 THEN Append(msg, " not found") ELSIF res = 2 THEN Append(msg, " not an obj-file") ELSIF res = 3 THEN Append(msg, " imports "); Append(msg, Modules.objmode); Append(msg, " "); Append(msg, Modules.imported); Append(msg, "."); Append(msg, Modules.object); Append(msg, " with bad fingerprint") ELSIF res = 4 THEN Append(msg, " corrupted obj file") ELSIF res = 5 THEN Append(msg, command); Append(msg, " command not found") ELSIF res = 6 THEN Append(msg, " has too many imports") ELSIF res = 7 THEN Append(msg, " not enough space") ELSIF res = 10 THEN Append(msg, Modules.importing); Append(msg, " imports "); Append(msg, Modules.objmode); Append(msg, " "); Append(msg, Modules.imported); Append(msg, "."); Append(msg, Modules.object); Append(msg, ", not found") ELSIF res = 11 THEN Append(msg, " too many open files") END ELSIF res < 0 THEN i := -1; REPEAT INC(i) UNTIL (command[i] = ".") OR (command[i] = 0X); IF command[i] = 0X THEN i := -1 END; j := -1; REPEAT INC(i); INC(j); msg[j] := command[i] UNTIL command[i] = 0X; (* copy procedure name *) Append(msg, " not found") END END CallError; PROCEDURE Available*(): LONGINT; BEGIN RETURN Kernel.Available() END Available; BEGIN Host := "Unix Object Model"; OptionChar := "\"; PathChar := "/"; TimeUnit := Input.TimeUnit END Host.