From 7c52e13134c29dbde4f7678be1be431b62afe91f Mon Sep 17 00:00:00 2001 From: "jakob.stendahl" Date: Sat, 13 Jul 2024 15:05:11 +0200 Subject: Add systemd service, add clear method call, add paging to snotifc --- snotif.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'snotif.c') diff --git a/snotif.c b/snotif.c index 8d914e5..5d8b387 100644 --- a/snotif.c +++ b/snotif.c @@ -72,3 +72,18 @@ void notifs_list_free(struct NotifsList* list) { free(list->list); free(list); } + +void notifs_list_clear(struct NotifsList* list) { + for (unsigned int i = 0; i < list->element_count; i++) { + if (list->list[i]->app_name) + free(list->list[i]->app_name); + if (list->list[i]->app_icon) + free(list->list[i]->app_icon); + if (list->list[i]->summary) + free(list->list[i]->summary); + if (list->list[i]->body) + free(list->list[i]->body); + free(list->list[i]); + } + list->element_count = 0; +} -- cgit v1.2.3