mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
user-notification: config: various small cleanups
* Rename user_notification_add() to user_notification_add_fmt() * Add new user_notification_add() helper function * Use xvasprintf() to replace user_notification_add_va() * Make better use of helper functions in config.c
This commit is contained in:
parent
0686f94b18
commit
759bc8007b
3 changed files with 25 additions and 44 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue