home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Graphics 16,000
/
graphics-16000.iso
/
msdos
/
animutil
/
pvquan
/
animdat
/
error.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-11-30
|
2KB
|
44 lines
/*--------------------------------------------------------------*/
/* ANIMDAT 1.1 */
/* copyright 1992 - TODD SANKEY */
/* */
/* The author hereby grants permission for the use and sharing */
/* of both source code end executable versions of this software */
/* at no charge. This software is not for sale and no other */
/* shall charge for it without the expressed consent of the */
/* author. */
/* */
/* The source code can be freely modified, but it must retain */
/* the original copyright notice, and the author must be */
/* notified of these changes if the altered code is to be */
/* distributed. */
/*--------------------------------------------------------------*/
/*------------------------------------------------------*/
/* error.c Default error handler. */
/*------------------------------------------------------*/
#include <stdlib.h>
#include <stdio.h>
#include "common.h"
char *error_msg[] = { "No error","Syntax error","Failed file open",
"Invalid number","Missing right parenthesis",
"Invalid expression","Missing identifier",
"Stack overflow","Failed memory allocation",
"Symbol redefined","Line too long in input file",
"Symbol not defined","Unsupported function",
"Nothing to do - num_scenes not defined",
"File system error"
};
void error(ERROR_CODE code,char *error_string)
{
if (error_string != NULL)
printf("\n%s\n",error_string);
printf("%s: %s",cur_file,error_msg[code]);
if (cur_line_num)
printf(" on line %u",cur_line_num);
printf("\n");
exit(1);
}