Of course: fixes to previous mods
This commit is contained in:
parent
31ddd5ca12
commit
dead814781
|
@ -132,7 +132,7 @@ IMPLEMENTATION MODULE InOut ;
|
|||
j : CARDINAL;
|
||||
BEGIN
|
||||
Done := TRUE;
|
||||
IF isatty(Streams.InputStream) THEN
|
||||
IF Streams.isatty(Streams.InputStream) THEN
|
||||
XWriteString(prompt);
|
||||
END;
|
||||
XReadString(buf);
|
||||
|
|
|
@ -22,7 +22,7 @@ IMPLEMENTATION MODULE PascalIO;
|
|||
FROM SYSTEM IMPORT ADR;
|
||||
|
||||
TYPE charset = SET OF CHAR;
|
||||
btype = (reading, writing, free);
|
||||
btype = (Preading, Pwriting, free);
|
||||
|
||||
CONST spaces = charset{11C, 12C, 13C, 14C, 15C, ' '};
|
||||
|
||||
|
@ -50,7 +50,7 @@ IMPLEMENTATION MODULE PascalIO;
|
|||
Traps.Message("could not open input file");
|
||||
HALT;
|
||||
END;
|
||||
type := reading;
|
||||
type := Preading;
|
||||
done := FALSE;
|
||||
eof := FALSE;
|
||||
END;
|
||||
|
@ -66,7 +66,7 @@ IMPLEMENTATION MODULE PascalIO;
|
|||
Traps.Message("could not open output file");
|
||||
HALT;
|
||||
END;
|
||||
type := writing;
|
||||
type := Pwriting;
|
||||
END;
|
||||
END Rewrite;
|
||||
|
||||
|
@ -107,7 +107,7 @@ IMPLEMENTATION MODULE PascalIO;
|
|||
|
||||
PROCEDURE Error(tp: btype);
|
||||
BEGIN
|
||||
IF tp = reading THEN
|
||||
IF tp = Preading THEN
|
||||
Traps.Message("input text expected");
|
||||
ELSE
|
||||
Traps.Message("output text expected");
|
||||
|
@ -124,7 +124,7 @@ IMPLEMENTATION MODULE PascalIO;
|
|||
PROCEDURE NextChar(InputText: Text): CHAR;
|
||||
BEGIN
|
||||
WITH InputText^ DO
|
||||
IF type # reading THEN Error(reading); END;
|
||||
IF type # Preading THEN Error(Preading); END;
|
||||
IF NOT done THEN
|
||||
Get(InputText);
|
||||
END;
|
||||
|
@ -135,7 +135,7 @@ IMPLEMENTATION MODULE PascalIO;
|
|||
PROCEDURE Get(InputText: Text);
|
||||
BEGIN
|
||||
WITH InputText^ DO
|
||||
IF type # reading THEN Error(reading); END;
|
||||
IF type # Preading THEN Error(Preading); END;
|
||||
IF eof THEN
|
||||
Traps.Message("unexpected EOF");
|
||||
HALT;
|
||||
|
@ -171,7 +171,7 @@ IMPLEMENTATION MODULE PascalIO;
|
|||
PROCEDURE WriteChar(OutputText: Text; char: CHAR);
|
||||
BEGIN
|
||||
WITH OutputText^ DO
|
||||
IF type # writing THEN Error(writing); END;
|
||||
IF type # Pwriting THEN Error(Pwriting); END;
|
||||
Write(stream, char, result);
|
||||
END;
|
||||
END WriteChar;
|
||||
|
@ -409,13 +409,13 @@ BEGIN (* PascalIO initialization *)
|
|||
WITH ibuf DO
|
||||
stream := InputStream;
|
||||
eof := FALSE;
|
||||
type := reading;
|
||||
type := Preading;
|
||||
done := FALSE;
|
||||
END;
|
||||
WITH obuf DO
|
||||
stream := OutputStream;
|
||||
eof := FALSE;
|
||||
type := writing;
|
||||
type := Pwriting;
|
||||
END;
|
||||
Notext := NIL;
|
||||
Input := ADR(ibuf);
|
||||
|
|
|
@ -373,7 +373,7 @@ IMPLEMENTATION MODULE Streams;
|
|||
result := succeeded;
|
||||
END SetPosition;
|
||||
|
||||
PROCEDURE isatty(stream: Stream): BOOLEAN;
|
||||
PROCEDURE isatty(stream: Stream; VAR result: StreamResult): BOOLEAN;
|
||||
VAR buf: ARRAY[1..100] OF CHAR;
|
||||
BEGIN
|
||||
IF (stream = NIL) OR (s^.kind = none) THEN
|
||||
|
|
|
@ -42,6 +42,6 @@ BEGIN
|
|||
END StartSeed;
|
||||
|
||||
BEGIN
|
||||
X0 := time(NIL);
|
||||
X[0] := time(NIL);
|
||||
StartSeed(CARDINAL(getpid()) * X[0]);
|
||||
END random.
|
||||
|
|
Loading…
Reference in a new issue