2020-05-25 23:48:33 +03:00
|
|
|
(*
|
2019-03-11 11:59:55 +03:00
|
|
|
Copyright 2016, 2018 Anton Krotov
|
2016-10-24 02:30:27 +03:00
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*)
|
|
|
|
|
|
|
|
MODULE Read;
|
|
|
|
|
|
|
|
IMPORT File, sys := SYSTEM;
|
|
|
|
|
|
|
|
PROCEDURE Char*(F: File.FS; VAR x: CHAR): BOOLEAN;
|
|
|
|
RETURN File.Read(F, sys.ADR(x), sys.SIZE(CHAR)) = sys.SIZE(CHAR)
|
|
|
|
END Char;
|
|
|
|
|
|
|
|
PROCEDURE Int*(F: File.FS; VAR x: INTEGER): BOOLEAN;
|
|
|
|
RETURN File.Read(F, sys.ADR(x), sys.SIZE(INTEGER)) = sys.SIZE(INTEGER)
|
|
|
|
END Int;
|
|
|
|
|
|
|
|
PROCEDURE Real*(F: File.FS; VAR x: REAL): BOOLEAN;
|
|
|
|
RETURN File.Read(F, sys.ADR(x), sys.SIZE(REAL)) = sys.SIZE(REAL)
|
|
|
|
END Real;
|
|
|
|
|
|
|
|
PROCEDURE Boolean*(F: File.FS; VAR x: BOOLEAN): BOOLEAN;
|
|
|
|
RETURN File.Read(F, sys.ADR(x), sys.SIZE(BOOLEAN)) = sys.SIZE(BOOLEAN)
|
|
|
|
END Boolean;
|
|
|
|
|
|
|
|
PROCEDURE Set*(F: File.FS; VAR x: SET): BOOLEAN;
|
|
|
|
RETURN File.Read(F, sys.ADR(x), sys.SIZE(SET)) = sys.SIZE(SET)
|
|
|
|
END Set;
|
|
|
|
|
2019-10-06 20:55:12 +03:00
|
|
|
PROCEDURE WChar*(F: File.FS; VAR x: WCHAR): BOOLEAN;
|
|
|
|
RETURN File.Read(F, sys.ADR(x), sys.SIZE(WCHAR)) = sys.SIZE(WCHAR)
|
|
|
|
END WChar;
|
2016-10-24 02:30:27 +03:00
|
|
|
|
2020-05-25 23:48:33 +03:00
|
|
|
END Read.
|