english
version "1.0"
identify "%Z%%M% %I% %E%"

#: Copyright (c) 2005 by Wayne C. Gramlich.
#, All rights reserved.

module fail

#: This module is responsibe for managing failures.

define fail				#: Errors object
    routine_types
	procedure assertion_callback
	    takes string, unsigned
	    returns_nothing
    record
	callback_enabled logical	#: {true}=>use callback
	callback assertion_callback	#: Assertion callback
	file_name string		#: Assertion file name
	line_number unsigned		#: Assertion 
    generate allocate, erase, identical, print


#: {fail} procedures:

procedure one_and_only@fail
    takes_nothing
    returns fail

    #: This procedure will return the one and only {fail} object.


procedure assertion_failure@fail
    takes
	file_name string
	line_number unsigned
    returns_nothing

    #: This procedure is invoked when there is an assertion failure.
    #, {file_name} and {line_number} specify the location where
    #, the assertion failed.