(*
    Title: 	Error handling for Utilities - Definitions
    LastEdit:	"Wed Aug 11 16:12:33 1982"
    Author: 	Mick Jordan
		Cambridge University Computer Laboratory
*)

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
    SysErr, and terminates the program via BStop.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 is initially set to the program name as acquired
    from the command line (argument 0).
*)

END UtilError.
