23
#ifndef __H_GLOBAL_NOTIFY__
24
#define __H_GLOBAL_NOTIFY__
32
* @defgroup GlobalNotify GlobalNotify
33
* @addtogroup GlobalNotify
24
36
* SSTS provides a system for global notifications. Global notifications are
25
37
* like signals, but have global scope, IE: there is only one GlobalNotify
26
38
* object that can exist in the system at any point.
28
40
* It in not possible to directly access the GlobalNotify object, and it's
29
* structiral stability can not be guaranteed.
41
* structural stability can not be guaranteed.
31
43
* SSTS does not initialise the the GlobalNotify object until one of it's
35
#ifndef __H_GLOBAL_NOTIFY__
36
#define __H_GLOBAL_NOTIFY__
44
51
* An opaque object.
45
52
* It is not possible to access the data inside this object.
47
typedef struct _GlobalNotify GlobalNotify;
54
typedef struct GlobalNotify GlobalNotify;
50
57
* Notify all subscribers of the to the
52
void s_global_notify (char * name, spointer * user_data);
55
void s_global_notiy_add (char * name, );
58
void s_global_notify_subscribe (char * name, Callback)
59
void s_global_notify (char * name, spointer user_data);
62
* Add a new global notification.
64
* @param name The name of the notification.
66
* @return The unique handle of the notification on success.
70
* You can safely dismiss the handle for the notify.
72
int s_global_notify_add (char * name);
75
* A convenience method to check if a notify name is already taken.
77
* @param name The notify name to get the handle from.
80
* @return The numerical handle of the notify.
82
int s_global_notify_get_handle (char * name);
85
* Substribe to a notify using a callback.
87
* @param name The name of the notify to subscribe to.
88
* @param callback The callback to be triggered when a notify is sent.
90
* @return The unique subscription handle, this is what is used in
91
* s_global_notify_unsubscribe() to unsubscribe to a notify.
94
* A notify Callback has to have the following signature:
95
* <code> void my_callback (char * name, spointer user_data) </code>
97
int s_global_notify_subscribe (char * name, Callback callback);