ZE-Standard-Libraries/include/error/error.h

55 lines
1.3 KiB
C
Raw Normal View History

2018-08-23 16:57:38 +00:00
#ifndef error_h
#define error_h
#include <type.h>
/*
*
*/
typedef struct Info{
char head[64];//信息头
char body[256];//信息内容
}Info;
/*
*
*/
typedef struct Error{
unsigned int type;//错误类型号
int priority;//优先级
time_t time;//错误产生的时间
Info info;//信息指针
}Error;
/*
*
*/
typedef struct Notice{
unsigned int type;//警告类型号
time_t time;//警告产生的时间
Info info;//信息指针
}Notice;
/***********************************************
*:,,
* 便.
**********************************************/
extern int pushInfo(Info *p_info, const char *head,const char *body);
extern Error *pushError(unsigned int type, int pri, Info *p_info);
extern Notice *pushNotice(unsigned int type, Info *p_info);
extern Info *initInfo(const char *head, const char *body);
extern Error *createError(Info *info,unsigned int type,int pri);
extern Notice *createWarning(Info *info, unsigned int type, int pri);
extern int showError(Error *);
extern int showWarning(Notice *);
#endif /* error_h */