cnet v4.0.4  

home topology files command‑line options the core API FAQ download and install

cnet's Application Programming Interface

NAME
CNET_get_handler - reports the function being called when a specific event occurs.

SYNOPSIS
#include <cnet.h> int CNET_get_handler(CnetEvent ev, void (**function)(), CnetData *data)

DESCRIPTION
CNET_get_handler() reports the function (its address) that is being called when the indicated cnet event occurs. The second parameter to CNET_get_handler() is "filled-in" with the address of the function. If the second parameter is NULL, the function's address is not reported. If the function's address is reported as NULL, it indicates that the current node is not interested in the indicated event.

In addition, the third parameter to CNET_get_handler() is "filled-in" with the data value being delivered to the indicated event handler. If the third parameter is NULL, this data value is not reported.

RETURN VALUE
The value 0 is returned on success. On failure, the value -1 is returned, and the global variable cnet_errno is set to one of the following values to describe the error:

ER_BADEVENT
The first parameter was not a valid cnet event.
ER_NOTSUPPORTED
An attempt was made to request the handler for an event that cannot occur on the current node. Examples include requesting the handler for EV_APPLICATIONREADY from nodes without an Application Layer, or requesting the handler for EV_KEYBOARDREADY from nodes without a keyboard.
SEE ALSO
CNET_set_handler.

cnet v4.0.4 - [email protected]