home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 June
/
SIMTEL_0692.cdr
/
msdos
/
tex
/
dvivga9.arc
/
ABORTRUN.H
next >
Wrap
Text File
|
1988-06-11
|
1KB
|
50 lines
/* -*-C-*- abortrun.h */
/*-->abortrun*/
/**********************************************************************/
/*************************** abortrun *******************************/
/**********************************************************************/
void
abortrun(code)
int code;
{
/*******************************************************************
This routine is called on both success and failure to terminate
execution. All open files (except stdin, stdout, stderr) are closed
before calling EXIT() to quit.
*******************************************************************/
UNSIGN16 k;
for (k = 0; k < (UNSIGN16)nopen; ++k)
if (font_files[k].font_id != (FILE*)NULL)
(void)fclose(font_files[k].font_id);
if (dvifp != (FILE*)NULL)
(void)fclose(dvifp);
if (plotfp != (FILE*)NULL)
(void)fclose(plotfp);
if (g_dolog && (g_logfp != (FILE *)NULL))
(void)fclose(g_logfp);
#if (OS_TOPS20 | OS_VAXVMS)
if (code)
{
NEWLINE(stderr);
(void)fprintf(stderr,"?Aborted with error code %d",code);
NEWLINE(stderr);
(void)perror("?perror() says");
}
#endif
#if VGASCREEN
devterm();
#endif
(void)EXIT(code);
}