⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 error.h

📁 < 虚拟机设计与实现>>的 windows版本
💻 H
字号:
#ifndef _ERROR_H
#define _ERROR_H

#include "common.h"
#include <stdio.h>

extern int maxErrors;  /*maximum # errors before shutdown, default = 10 */
extern int nErrors;	/*keep track of number of errors*/

extern FILE * errPtr;

/*
	suffix indicates number of arguments in printf()
*/

#define ERROR0(str);				 incErrors();printf("error: "); printf(str); printf("\n"); xmlBegin();fprintf(errPtr,str);xmlEnd();
#define ERROR1(str,arg1);			 incErrors();printf("error: "); printf(str,arg1); printf("\n"); xmlBegin();fprintf(errPtr,str,arg1);xmlEnd();
#define ERROR2(str,arg1,arg2);		 incErrors();printf("error: "); printf(str,arg1,arg2); printf("\n"); xmlBegin();fprintf(errPtr,str,arg1,arg2);xmlEnd();
#define ERROR3(str,arg1,arg2,arg3);	 incErrors();printf("error: "); printf(str,arg1,arg2,arg3); printf("\n"); xmlBegin();fprintf(errPtr,str,arg1,arg2,arg3);xmlEnd();
#define ERROR4(str,arg1,arg2,arg3,arg4);		incErrors();printf("error: "); printf(str,arg1,arg2,arg3,arg4); printf("\n"); xmlBegin();fprintf(errPtr,str,arg1,arg2,arg3,arg4);xmlEnd();
#define ERROR5(str,arg1,arg2,arg3,arg4,arg5);	incErrors();printf("error: "); printf(str,arg1,arg2,arg3,arg4,arg5); printf("\n"); xmlBegin();fprintf(errPtr,str,arg1,arg2,arg3,arg4,arg5);xmlEnd();
//#define FATAL_ERROR();				printf("shutting down\n"); incErrors(); shutDown(SHUTDOWN_ERROR);	

void incErrors();

void setUpErrorFile();
void closeErrorFile();

void xmlBegin(); /* print beginning of XML error message markup*/
void xmlEnd(); /* print end of XML error message markup*/

void testErrorFile();
	
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -