aboutsummaryrefslogtreecommitdiff
path: root/user-notification.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-11-14 16:56:24 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-11-14 16:56:24 +0000
commitef862bd747cdf3dcebf86ee801e17aff3976ffe8 (patch)
treec5313deb8e2c6e072983731394bacd541873638f /user-notification.h
parentconfig: remove options that were deprecated in 1.8.x (diff)
parentuser-notification: config: various small cleanups (diff)
Merge branch 'user-notification-cleanup'
Diffstat (limited to 'user-notification.h')
-rw-r--r--user-notification.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/user-notification.h b/user-notification.h
index 507c1791..df2390c7 100644
--- a/user-notification.h
+++ b/user-notification.h
@@ -1,6 +1,5 @@
#pragma once
-#include <stdbool.h>
#include <tllist.h>
#include "macros.h"
@@ -26,6 +25,17 @@ user_notifications_free(user_notifications_t *notifications)
tll_free(*notifications);
}
-bool user_notification_add(user_notifications_t *notifications,
+static inline void
+user_notification_add(user_notifications_t *notifications,
+ enum user_notification_kind kind, char *text)
+{
+ struct user_notification notification = {
+ .kind = kind,
+ .text = text
+ };
+ tll_push_back(*notifications, notification);
+}
+
+void user_notification_add_fmt(user_notifications_t *notifications,
enum user_notification_kind kind,
const char *fmt, ...) PRINTF(3);