home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1997 March
/
VPR9703A.ISO
/
VPR_DATA
/
DOGA
/
SOURCES
/
POLYEDIT.LZH
/
ML
/
ERR.C
< prev
next >
Wrap
C/C++ Source or Header
|
1996-06-05
|
1KB
|
62 lines
#include <stdio.h>
#include <stdlib.h>
#include "inlib.h"
extern char *InputFile ;
extern int InputLine ;
extern int ExecLine ;
extern char *ExecFile ;
extern void (*ErrorExec)();
void ParseError( msg, arg1, arg2, arg3, arg4 )
char *msg ;
int arg1, arg2, arg3, arg4 ;
{
char fmt[256], buf[256] ;
sprintf( fmt, "%s:%d: Error %s", InputFile, InputLine, msg );
sprintf( buf, fmt, arg1, arg2, arg3, arg4 );
(*ErrorExec)( buf );
}
void ParseFatal( msg, arg1, arg2, arg3, arg4 )
char *msg ;
int arg1, arg2, arg3, arg4 ;
{
char fmt[256], buf[256] ;
if (InputFile == NULL || InputFile[0] == '\0') {
sprintf( fmt, "Fatal %s", msg );
} else {
sprintf( fmt, "%s:%d: Fatal %s", InputFile, InputLine, msg );
}
sprintf( buf, fmt, arg1, arg2, arg3, arg4 );
(*ErrorExec)( buf );
}
void ExecError( msg, arg1, arg2, arg3, arg4 )
char *msg ;
int arg1, arg2, arg3, arg4 ;
{
char fmt[256], buf[256] ;
#if 0
if (InputFile == NULL || InputFile[0] == '\0') {
sprintf( fmt, "Error %s", msg );
} else {
sprintf( fmt, "%s:%d: Error %s", ExecFile, ExecLine, msg );
}
#else
if (ExecFile == NULL || ExecFile[0] == '\0') {
sprintf( fmt, "Error %s", msg );
} else {
sprintf( fmt, "%s:%d: Error %s", ExecFile, ExecLine, msg );
}
#endif
sprintf( buf, fmt, arg1, arg2, arg3, arg4 );
(*ErrorExec)( buf );
}