mirror of
https://github.com/rzzzwilson/pymlac.git
synced 2025-06-10 09:32:41 +00:00
Handle an internal error
This commit is contained in:
30
vimlac/error.c
Normal file
30
vimlac/error.c
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Error routines for the imlac simulator.
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
Description : printf()-style trace routine.
|
||||
Parameters : like printf()
|
||||
Returns :
|
||||
Comments :
|
||||
******************************************************************************/
|
||||
void
|
||||
error(char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char buff[1024];
|
||||
|
||||
va_start(ap, fmt);
|
||||
vsprintf(buff, fmt, ap);
|
||||
fprintf(stderr, "%s\n", buff);
|
||||
va_end(ap);
|
||||
|
||||
exit(10);
|
||||
}
|
||||
|
||||
|
||||
10
vimlac/error.h
Normal file
10
vimlac/error.h
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* Error routines for the imlac simulation.
|
||||
*/
|
||||
|
||||
#ifndef ERROR_H
|
||||
#define ERROR_H
|
||||
|
||||
void error(char *fmt, ...);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user