(*Copyright (C) 2017, 2018, 2019 Karl Landstrom <karl@miasap.se>

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.*)

MODULE Out;
(**Output to the standard output stream

Implements the basic library module from "The Oakwood Guidelines for Oberon-2 Compiler Developers".*)

(*implemented in C*)

	PROCEDURE Open*;
(**does nothing (included for compatibility with "The Oakwood Guidelines")*)
	END Open;


	PROCEDURE Char*(ch: CHAR);
(**writes the character ch to the end of the output stream*)
	END Char;


	PROCEDURE String*(s: ARRAY OF CHAR);
(**writes the null-terminated character sequence s to the end of the output stream (without 0X).*)
	END String;


	PROCEDURE Int*(i, n: INTEGER);
(**writes the integer i to the end of the output stream. If the textual representation of i requires m characters, i is right adjusted in a field of Max(n, m) characters padded with blanks at the left end. A plus sign is not written.*)
	END Int;


	PROCEDURE Hex*(i: INTEGER);
(**writes the integer i to the end of the output stream as a zero-padded unsigned hexadecimal number with a leading space. NOTE: This procedure is an extension to The Oakwood Guidelines.*)
	END Hex;


	PROCEDURE Real*(x: REAL; n: INTEGER);
(**writes the real number x to the end of the output stream using an exponential form. If the textual representation of x requires m characters (including a two-digit signed exponent), x is right adjusted in a field of Max(n, m) characters padded with blanks at the left end. A plus sign of the mantissa is not written.*)
	END Real;


	PROCEDURE Ln*;
(**writes an end-of-line symbol to the end of the output stream*)
	END Ln;

END Out.
