(*
    Title: 	UtilError - Definitions
    LastEdit:	"Tue Sep 11 14:36:09 1984"
    Author: 	Mick Jordan
		Cambridge University Computer Laboratory

    Standard error reporting for utility programs.
    This module shares the same output formatting conventions
    as the WriteF module, and typically sends its output
    to the SysStreams.SysErr stream.
    
*)

DEFINITION MODULE UtilError;
FROM SYSTEM IMPORT WORD;

EXPORT QUALIFIED ReportError, ReportPError, SetPrompt;

PROCEDURE ReportPError(prompt: ARRAY OF CHAR; fatal: BOOLEAN; 
                      string: ARRAY OF CHAR; arg1, arg2: WORD);
(*  Outputs "prompt: ", followed by WriteF2(string, arg1, arg2) to
    Systreams.SysErr, and terminates the program via Stop.Stop
    if 'fatal=TRUE'.
*)

PROCEDURE ReportError(fatal: BOOLEAN; 
                      string: ARRAY OF CHAR; arg1, arg2: WORD);
(*  As above but used the default prompt set by SetPrompt.
*)
                      
PROCEDURE SetPrompt(prompt: ARRAY OF CHAR);
(*  Sets the default prompt to 'prompt'.
    The default prompt will be set to the program name
    if this is available from the host system, else to
    'Modula-2'.
*)

END UtilError.
