screen_notify()

Request Screen to send asynchronous notifications

Synopsis:

#include <screen/screen.h>
int screen_notify(screen_context_t ctx,
                  int flags,
                  const void *obj,
                  const struct sigevent *event)

Arguments:

ctx
The handle of the context that obj belongs to.
flags
The type of notification that you want to be notified of. Valid notification types are of type Screen notification types.
obj
The object that the notification is for. Not all object types are valid for each notification type. Refer to Screen notification types to determine which object type is valid for the notification you're registering for.
event
The notification event of type sigevent. Refer to sys/siginfo.h for more details. Set this argument to NULL or its type to SIGEV_NONE (e.g., use SIGEV_NONE_INIT()) to disable future notifications for specified flags from Screen.

Library:

libscreen

Description:

Function Type: Immediate Execution

This function causes Screen to send an asynchronous notification to your application; it behaves similarly to ionotify(). You specify which type of notification your application wants to receive using the flags argument. Valid notification types are of type Screen notification types.

Calling this function disables any previous calls to screen_notify() that were called with the same combination of arguments: ctx, flags, and obj.

If necessary, notifications can be filtered by your application. For example, events specific to a keyboard, can be detected by passing the appropriate screen_device_t handle in the obj argument. Refer to the Screen Developer's Guide for more information.

Returns:

0 if successful, or -1 if an error occurred (errno is set; refer to errno.h for more details).