TEMU  4.4
The Terma Emulator
Notifications.h File Reference
#include <stdint.h>
#include "temu-c/Support/Attributes.h"
#include "temu-c/Support/Objsys.h"
Include dependency graph for Notifications.h:

Go to the source code of this file.

Typedefs

typedef void(* temu_NotificationHandler) (void *Arg, temu_Object_ *Source, void *NotInfo)
 

Functions

TEMU_API int64_t temu_publishNotification (const char *NotName, temu_Object_ *Obj)
 
TEMU_API int temu_subscribeNotification (const char *NotName, temu_Object_ *Source, void *Arg, temu_NotificationHandler NotFunc)
 
TEMU_API int temu_unsubscribeNotification (const char *NotName, temu_Object_ *Source, temu_NotificationHandler NotFunc)
 
TEMU_API int temu_unsubscribeNotificationArg (const char *NotName, temu_Object_ *Source, temu_NotificationHandler NotFunc, void *Arg)
 
TEMU_API void temu_notify (int64_t Id, void *NotInfo)
 

Typedef Documentation

◆ temu_NotificationHandler

typedef void(* temu_NotificationHandler) (void *Arg, temu_Object_ *Source, void *NotInfo)

Function Documentation

◆ temu_notify()

TEMU_API void temu_notify ( int64_t  Id,
void *  NotInfo 
)

Call event subscriber, EvInfo is a per event specific struct the event handler must cast this to the appropriate type.

Parameters
IdNotification ID
NotInfoPonter to pass to notification handlers

◆ temu_publishNotification()

TEMU_API int64_t temu_publishNotification ( const char *  NotName,
temu_Object_ Obj 
)

Publish a notification source A notification source is identified by an event name and an object pointer

Parameters
NotNameName of the notification
ObjPointer to the object
Returns
Notification ID of the published event.

◆ temu_subscribeNotification()

TEMU_API int temu_subscribeNotification ( const char *  NotName,
temu_Object_ Source,
void *  Arg,
temu_NotificationHandler  NotFunc 
)

Install notification functions for the given event generated by source

Parameters
NotNameName of the notification
SourceIf source is NULL, the event subscriber will be notified by all the sources for the given name.
ArgContext argument to be passed to the callback notification function
NotFuncThe callback function on notification

◆ temu_unsubscribeNotification()

TEMU_API int temu_unsubscribeNotification ( const char *  NotName,
temu_Object_ Source,
temu_NotificationHandler  NotFunc 
)

Remove notification handler for the given name and source. Note that this function runs in O(N) time. It is not meant for being used in performance critical code.

Parameters
NotNameName of the notification
SourceIf source is NULL, the event subscriber will be notified by all the sources for the given name.
NotFuncThe callback function to be called on notification

◆ temu_unsubscribeNotificationArg()

TEMU_API int temu_unsubscribeNotificationArg ( const char *  NotName,
temu_Object_ Source,
temu_NotificationHandler  NotFunc,
void *  Arg 
)

Remove notification handler for the given name, source and arg. Note that this function runs in O(N) time. It is not meant for being used in performance critical code.

Parameters
NotNameName of the notification
SourceIf source is NULL, the event subscriber will be notified by all the sources for the given name.
NotFuncThe callback function to be called on notification
ArgContext argument to be passed to the callback notification function
Returns
zero on success, otherwise non-zero