home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of A1200
/
World_Of_A1200.iso
/
programs
/
monitors
/
rsys
/
source.lha
/
src
/
RSysError.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-01-09
|
3KB
|
123 lines
/*
***************************************************************************
*
* Datei:
* RSysError.c
*
* Inhalt:
* void ErrorHandleFull(enum err_objects errobj, enum err_actions erract, int kill, char *file, char *func, int line);
*
* Bemerkungen:
* Enthält die Fehlerbehandlungsroutinen für RSys. Es werden der
* Quelldateiname, die Funktion und die entsprechende
* Zeilennummer unterstützt.
*
* Erstellungsdatum:
* 20-Apr-93 Rolf Böhme
*
* Änderungen:
* 20-Apr-93 Rolf Böhme Erstellung
*
***************************************************************************
*/
#include "RSysDebug.h"
#include "RSysFunc.h"
char *str_err_objects[] = {
"Broker",
"Ports",
"Files and Directories",
"Screens",
"Windows",
"Libraries",
"Devices",
"Icons",
"Gadgets and Menus",
"Environment and Prefs",
"DOS-ExAll()",
"Fonts",
"Lists and Nodes",
"Memory",
"Tasks",
"Clipboard",
"Miscallaneous"
};
char *str_err_actions[] = {
"Duplicate name attempted",
"Creation failed",
"Can't find object",
"Can't kill object",
"Can't open object",
"Can't read file",
"Can't write file",
"ExAll() failed",
"Size of object to large",
"Object not saved",
"Wrong input or argument given",
"Can't examine object info",
"Object does no exist",
"Object has wrong type",
"Allocation failed"
};
/*
* ErrorHandleFull() gibt im Falle eines Fehlers eine
* vollständige Beschreibung des Fehlers unter Angabe der
* Zeilennummer und der Quelldatei sowie der Funktion, in der
* der Fehler auftrat
*/
void
ErrorHandleFull(enum err_objects errobj, enum err_actions erract,
int kill, char *file, char *func, int line)
{
UBYTE header[BUFSIZE],
kind[BUFSIZE];
UBYTE *errfmt = (UBYTE *)"Error object : %s\n"
"Error action : %s\n"
"Source file : %s\n"
"Function : %s()\n"
"Source line : %ld\n"
"Count entries : %ld\n"
"-- %s";
DPOS;
sprintf((char *)header, "%s %s message", NAME, (kill ? "Error" : "Info"));
strcpy((char *)kind, (kill == KILL) ?
"Sorry...this killed the Program!" :
"Don't worry! The program continues...");
if (IntuitionBase)
{
MyEasyRequest(SysWnd, header,
(UBYTE *)((kill == KILL) ? "Kill!" : "Continue"),
errfmt,
(UBYTE *) str_err_objects[errobj],
(UBYTE *) str_err_actions[erract],
(UBYTE *) file,
(UBYTE *) func,
line,
countentries,
kind);
}
else if (NOT(Flags.wb_start))
{
strcat((char *)kind, "\n");
Printf(errfmt,(ULONG) str_err_objects[errobj],
(UBYTE *) str_err_actions[erract],
(UBYTE *) file,
(UBYTE *) func,
line,
countentries,
kind);
}
if (kill == KILL)
CloseAll();
return;
}