New bitmap method SetRGBConversionFunction which can be used to
[tangerine.git] / compiler / autoinit / __showerror.c
blob96d43f005bd524098986c1fe7dc2cef48328d184
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: autoinit library - support function for showing errors to the user
6 Lang: english
7 */
9 #include <proto/exec.h>
10 #include <proto/dos.h>
11 #include <proto/intuition.h>
12 #include <aros/autoinit.h>
14 #include <stdarg.h>
16 int __forceerrorrequester __attribute__((weak)) = 0;
18 void __showerror(char *format, const IPTR *args)
20 AROS_GET_SYSBASE_OK
22 struct IntuitionBase *IntuitionBase;
23 struct DosLibrary *DOSBase = NULL;
24 const char *name = FindTask(NULL)->tc_Node.ln_Name;
28 !__forceerrorrequester &&
29 (DOSBase = (struct DosLibrary *)OpenLibrary("dos.library", 0)) != NULL &&
30 Cli() != NULL
33 if (name)
35 PutStr(name);
36 PutStr(": ");
39 if (args)
40 VPrintf(format, args);
41 else
42 PutStr(format);
44 PutStr("\n");
46 else
47 if ((IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library", 0)))
49 struct EasyStruct es =
51 sizeof(struct EasyStruct),
53 name,
54 format,
55 "Exit"
58 EasyRequestArgs(NULL, &es, NULL, args);
60 CloseLibrary((struct Library *)IntuitionBase);
63 if (DOSBase != NULL)
64 CloseLibrary((struct Library *)DOSBase);