HPlogo MPE/iX Developer's Kit Reference Manual Volume 2: HP 3000 MPE/iX Computer Systems > Chapter 4 CURSES

timeout wtimeout

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

The timeout and wtimeout routines are used to set a timed blocking or nonblocking read for a window.

Syntax

   #include <curses.h>



   int timeout(int delay);

   int wtimeout(WINDOW win, int delay);

Parameters

delay

The number of milliseconds to block or wait for input.

win

A pointer to the window in which to set the timed blocking.

Return Values

OK

Successful completion.

ERR

An error occurred.

Description

The timeout() and wtimeout() routines set the length of time getch() waits for input for windows stdscr and win, respectively. These routines are similar to nodelay except the time to block or wait for input can be specified.

A negative delay causes the program to wait indefinitely for input; a delay of 0 returns ERR if no input is ready; and a positive delay blocks until input arrives or the time specified expires (in which case, ERR is returned).

NOTE: The timeout() routine is a macro.

Implementation Considerations

UNIX System V implementation

See Also

wgetch(), nodelay()

Portability

UNIX System V

Feedback to webmaster