From f6533a71e4996f2f4cd45336966cebf6c3f34b1e Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 30 Jul 2020 18:57:21 +0200 Subject: user-notification: 'productify' the user-warning system * Rename user_warning to user_notification * Add warning and error types (in addition to the existing deprecated) * Simplify logic when emitting a user notification after forking; we don't need to copy the notification data since we're in a new process and have total control over that memory. --- user-notification.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 user-notification.h (limited to 'user-notification.h') diff --git a/user-notification.h b/user-notification.h new file mode 100644 index 00000000..dada7fbe --- /dev/null +++ b/user-notification.h @@ -0,0 +1,14 @@ +#pragma once + +#include + +struct user_notification { + enum { + USER_NOTIFICATION_DEPRECATED, + USER_NOTIFICATION_WARNING, + USER_NOTIFICATION_ERROR, + } kind; + char *text; +}; + +typedef tll(struct user_notification) user_notifications_t; -- cgit v1.3