Purpose
Allow a UNIX client to register a file descriptor, socket, or port as an input source. A callback is registered to be invoked when an event occurs on that specified file descriptor.
Note: Note: This function is not supported in the Windows implementation of the Event Server API.
Syntax
#include "spd.h" SPD_inputTP SPD_AddInput( int fd, SPD_inputTypeTP type, SPD_inputCallbackTP callback, SPD_passbackTP passback );
Description
fd
is the file descriptor to be registered as an input source.
type
is the type of event for which the callback is to be invoked. This type definition is described in 8.1.
callback
is the callback function that is invoked when an I/O event occurs on a file descriptor. This callback function is described in 8.2.
passback
is a value passed to the callback function.
Return Value
This function returns an identifier for the input source, which is supplied when the callback is invoked and which you may use to remove the input source in calls to SPD_RemoveInput.
This function returns NULL if no callback could be registered.
See Also
See also the following client functions:
SPD_MainLoop (see [xref text to replace])
SPD_ProcessEvents (see [xref text to replace])
SPD_RemoveInput (see [xref text to replace])
Use of this function is illustrated in 6.6.