2018-02-18 06:32:58 +00:00
|
|
|
#ifndef ERROR_H
|
|
|
|
#define ERROR_H
|
|
|
|
|
2018-08-23 16:57:38 +00:00
|
|
|
#include <type.h>
|
|
|
|
#include <list/list.h>
|
|
|
|
#include <error/error.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
*错误管理中日志信息的管理及操作的结构
|
|
|
|
*/
|
|
|
|
typedef struct Log{
|
|
|
|
FILE *fp;//日志文件的指针
|
|
|
|
int if_enable;//日志文件是否启用
|
|
|
|
unsigned long int id;//日志文件的ID
|
|
|
|
}Log;
|
2018-02-18 06:32:58 +00:00
|
|
|
|
2018-08-02 12:59:06 +00:00
|
|
|
Log logfile;
|
2018-02-18 11:22:12 +00:00
|
|
|
List *error_list = NULL;
|
2018-08-02 12:59:06 +00:00
|
|
|
List *notice_list = NULL;
|
2018-02-18 11:22:12 +00:00
|
|
|
int if_error = 0;
|
|
|
|
|
2018-08-02 12:59:06 +00:00
|
|
|
int initErrorSystem(void);
|
|
|
|
|
|
|
|
int setLogDirectory(const char *path);
|
|
|
|
int closeLogDirectory(void);
|
|
|
|
|
2018-08-03 10:32:20 +00:00
|
|
|
int loadFromFile(FILE *fp,char* number);
|
2018-08-02 12:59:06 +00:00
|
|
|
|
2018-08-03 10:32:20 +00:00
|
|
|
int saveError(Error *p_error);
|
|
|
|
int saveNotice(Notice *p_notice);
|
2018-08-02 12:59:06 +00:00
|
|
|
|
2018-08-03 10:32:20 +00:00
|
|
|
#endif
|