1 /* 2 * Notification-related functions and types. 3 * 4 * Copyright (C) 2023 Paul Boddie <paul@boddie.org.uk> 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License as 8 * published by the Free Software Foundation; either version 2 of 9 * the License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * Boston, MA 02110-1301, USA 20 */ 21 22 #pragma once 23 24 #include <systypes/base.h> 25 26 27 28 /* C compatibility types (defined in the implementation). */ 29 30 struct notifier; 31 32 typedef struct notifier notifier_t; 33 34 35 36 EXTERN_C_BEGIN 37 38 notifiable_t *notify_notifiable(notifiable_base_t *notifiable); 39 notify_flags_t notify_notifications(notifiable_base_t *notifiable); 40 notify_values_t notify_notification_values(notifiable_base_t *notifiable); 41 42 void notify_close(notifier_t *notifier); 43 44 notifier_t *notify_get_local(void); 45 notifier_t *notify_get_task(void); 46 47 long notify_subscribe(notifiable_t *notifiable, notify_flags_t flags, notifier_t *notifier); 48 long notify_unsubscribe(notifiable_t *notifiable, notifier_t *notifier); 49 50 long notify_wait(notifiable_t *notifiable, notifier_t *notifier); 51 long notify_wait_many(notifiable_t **notifiable, notifier_t *notifier); 52 53 EXTERN_C_END 54 55 // vim: tabstop=2 expandtab shiftwidth=2