2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
8 #include <proto/exec.h>
9 #include "dos_intern.h"
11 #include <aros/debug.h>
14 /*****************************************************************************
17 #include <proto/dos.h>
19 AROS_LH2(BOOL
, PrintFault
,
22 AROS_LHA(LONG
, code
, D1
),
23 AROS_LHA(CONST_STRPTR
, header
, D2
),
26 struct DosLibrary
*, DOSBase
, 79, Dos
)
29 Prints the header and the text associated with the error code to
30 the console (buffered), then sets the value returned by IoErr() to
35 header - Text to print before the error message. This may be NULL
36 in which case only the error message is printed.
39 Boolean success indicator.
48 IoErr(), Fault(), SetIoErr()
52 *****************************************************************************/
56 struct Process
*me
= (struct Process
*)FindTask(NULL
);
57 /* BPTR stream = me->pr_CES ? me->pr_CES : me->pr_COS; */
58 BPTR stream
= me
->pr_COS
; /* unfortunately AmigaOS programs expect
59 this to be sent to Output() */
63 ASSERT_VALID_PROCESS(me
);
64 ASSERT_VALID_PTR_OR_NULL(BADDR(stream
));
65 ASSERT_VALID_PTR_OR_NULL(header
);
67 /* Fault() will do all the formatting of the string */
68 Fault(code
, NULL
, buffer
, 80);
74 else if (header
!= NULL
)
76 if(!FPuts(stream
, header
) && !FPuts(stream
, ": ") &&
77 !FPuts(stream
, buffer
) && !FPuts(stream
, "\n"))
88 if (!FPuts(stream
, buffer
) && !FPuts(stream
,"\n"))