1
0
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:
Ross Wilson
2015-10-16 10:33:30 +07:00
parent 8827945e60
commit 7314772580
2 changed files with 40 additions and 0 deletions

30
vimlac/error.c Normal file
View 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
View File

@@ -0,0 +1,10 @@
/*
* Error routines for the imlac simulation.
*/
#ifndef ERROR_H
#define ERROR_H
void error(char *fmt, ...);
#endif