bps_io_events_t

The bits to use with the bps_add_fd() Adds a file descriptor to the currently active channel. function.

Synopsis:

#include <bps/bps.h>
 
typedef enum {
      BPS_IO_INPUT = 1 << 0   
      BPS_IO_OUTPUT = 1 << 1   
      BPS_IO_EXCEPT = 1 << 2   
} bps_io_events_t;

Data:

BPS_IO_INPUT
Indicates that there is data available for reading.
BPS_IO_OUTPUT
Indicates that there is room in the output buffer for more data.
BPS_IO_EXCEPT
Indicates one of three things occurred:
An error occurred.The device has been disconnected.The provided file descriptor was invalid.

Library:

libbps

Description:

When registering an I/O handler with a channel, you specify the type of I/O to monitor with a bitwise OR of the corresponding bps_io_event_t bits.

When the I/O handler is called by the BPS library, the type of I/O event is passed into the second argument of the callback. You can perform a bitwise OR operation on this argument with the values of the bps_io_events_t enumeration to determine the I/O condition that was met.