31 lines
777 B
C
31 lines
777 B
C
#ifndef ERRORMSG_H
|
|
#define ERRORMSG_H
|
|
|
|
#include <time.h>
|
|
|
|
/** \file
|
|
* \brief Error message collection
|
|
*/
|
|
/** \brief Error message item
|
|
*/
|
|
typedef struct ErrMsg {
|
|
struct ErrMsg *next;
|
|
char *text; /**< the message text */
|
|
char *data; /**< additional text which may be different for the same message */
|
|
int cnt; /**< count */
|
|
time_t last; /**< time of last message */
|
|
} ErrMsg;
|
|
|
|
/* define type ErrMsgList and functions ErrMsgAdd etc. */
|
|
#define MC_NAME(T) ErrMsg##T
|
|
#include "mclist.h"
|
|
|
|
/** \brief Put a formatted message to the error message list
|
|
* \param dump the error message list
|
|
* \param data some additional text (may be NULL)
|
|
* \param fmt the format for the message
|
|
*/
|
|
ErrMsg *ErrPutMsg(ErrMsgList *dump, char *data, char *fmt, ...);
|
|
|
|
#endif
|