You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

25 lines
488 B

  1. #pragma once
  2. #include <tllist.h>
  3. enum user_notification_kind {
  4. USER_NOTIFICATION_DEPRECATED,
  5. USER_NOTIFICATION_WARNING,
  6. USER_NOTIFICATION_ERROR,
  7. };
  8. struct user_notification {
  9. enum user_notification_kind kind;
  10. char *text;
  11. };
  12. typedef tll(struct user_notification) user_notifications_t;
  13. static inline void
  14. user_notifications_free(user_notifications_t *notifications)
  15. {
  16. tll_foreach(*notifications, it)
  17. free(it->item.text);
  18. tll_free(*notifications);
  19. }