2020-07-30 18:57:21 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <tllist.h>
|
|
|
|
|
|
2020-08-01 09:00:18 +02:00
|
|
|
enum user_notification_kind {
|
|
|
|
|
USER_NOTIFICATION_DEPRECATED,
|
|
|
|
|
USER_NOTIFICATION_WARNING,
|
|
|
|
|
USER_NOTIFICATION_ERROR,
|
|
|
|
|
};
|
|
|
|
|
|
2020-07-30 18:57:21 +02:00
|
|
|
struct user_notification {
|
2020-08-01 09:00:18 +02:00
|
|
|
enum user_notification_kind kind;
|
2020-07-30 18:57:21 +02:00
|
|
|
char *text;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef tll(struct user_notification) user_notifications_t;
|
2020-09-08 19:17:29 +02:00
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
|
user_notifications_free(user_notifications_t *notifications)
|
|
|
|
|
{
|
|
|
|
|
tll_foreach(*notifications, it)
|
|
|
|
|
free(it->item.text);
|
|
|
|
|
tll_free(*notifications);
|
|
|
|
|
}
|