42 lines
723 B
C
42 lines
723 B
C
|
#ifndef MK_STATUS_H
|
||
|
#define MK_STATUS_H
|
||
|
|
||
|
#include "commons.h"
|
||
|
#include "vec.h"
|
||
|
|
||
|
#define STATUS_KIND(G) \
|
||
|
G(STATUS_ERROR),\
|
||
|
G(STATUS_WARNING)
|
||
|
|
||
|
MK_ENUM_H(Status, STATUS_KIND);
|
||
|
|
||
|
struct message
|
||
|
{
|
||
|
Status kind;
|
||
|
char* what;
|
||
|
};
|
||
|
|
||
|
struct status
|
||
|
{
|
||
|
struct vec messages;
|
||
|
};
|
||
|
|
||
|
void message_init(struct message* self,
|
||
|
Status kind,
|
||
|
char const* what);
|
||
|
void message_free(struct message* self);
|
||
|
|
||
|
void status_init(struct status* self);
|
||
|
void status_free(struct status* self);
|
||
|
|
||
|
void status_push(struct status* self,
|
||
|
Status kind,
|
||
|
char const* format,
|
||
|
...);
|
||
|
|
||
|
void status_dump(struct status* self);
|
||
|
|
||
|
bool status_is_ok(struct status* self);
|
||
|
|
||
|
#endif
|