cdev_input_available()

Read available data from a host device into the internal input buffer

Synopsis:

#include <qvm/cdev.h>
int cdev_input_available(struct cdev_state *cds)

Arguments:

cds
A pointer to a structure with the state of the character device.

Library:

Provided by qvm; no external library is required.

Description:

If you aren't providing your own buffer (see cdev_setup()), then you must call this function when handling the CDEV_INPUT_AVAILABLE_PULSE_CODE pulse.

Returns:

If successful:
  • 1 if the input buffer is full
  • 0 if the input buffer isn't full. otherwise, a negative errno value.