.TH LIBTERMINPUT_IS_READY 3 LIBTERMINPUT .SH NAME libterminput_is_ready \- Check if there is read data buffered .SH SYNOPSIS .nf #include inline int libterminput_is_ready(const union libterminput_input *\fIinput\fP, const struct libterminput_state *\fIctx\fP); .fi .PP Link with .IR \-lterminput . .SH DESCRIPTION The .BR libterminput_is_ready () function check if a call to the .BR libterminput_read (3) function will skip reading from the file descriptor passed to it because it already has read data buffered. However, if there is buffered data but the library knows it it not enough to return something they, it will also return that there is nothing buffered. .PP The .BR libterminput_is_ready () function should only be used if using blocking read operations (terminal file descriptor configured with .I O_NONBLOCK cleared). The flags .I LIBTERMINPUT_ESC_ON_BLOCK and .I LIBTERMINPUT_MACRO_ON_BLOCK are only meaningful for non-blocking reads. With non-blocking reads, the application should call .BR libterminput_read (3) and check for .I EAGAIN error rather than using the .BR libterminput_is_ready () function, as .I EAGAIN errors on read can cause the .BR libterminput_read (3) function to output keypresses it would otherwise not output, but in doing so not report .I EAGAIN (although .I errno will still be set to .IR EAGAIN , so the application can still check if this occurred). .SH RETURN VALUE The .BR libterminput_is_ready () function return 1 if the next call to the .BR libterminput_read (3) function will not from file descriptor passed to it, and 0 otherwise. .SH ERRORS The .BR libterminput_is_ready () function cannot fail. .SH EXAMPLES None. .SH APPLICATION USAGE None. .SH RATIONALE None. .SH FUTURE DIRECTIONS None. .SH NOTES None. .SH BUGS None. .SH SEE ALSO .BR libterminput_read (3), .BR fcntl (3)