request_choice(3G)
NAME
request_choice − wait for input device to be triggered then return measured value
SYNOPSIS
C Syntax:
void request_choice ( fildes, ordinal, timeout, valid, value );
int fildes, ordinal, *valid, *value;
float timeout;
FORTRAN77 Syntax:
subroutine request_choice ( fildes, ordinal, timeout,
valid, value )
integer*4 fildes, ordinal, valid, value
real timeout
Pascal Syntax:
procedure request_choice ( fildes, ordinal:integer;
timeout:real; var valid, value:integer );
DESCRIPTION
Input Parameters
fildes Integer file descriptor returned by gopen when an I/O path to a graphics device is opened.
ordinal Logical device number ranging from 1 to number of devices of this class.
timeout Time, in seconds, to wait for a trigger.
Output Parameters
valid TRUE (1 in Pascal) if data is valid.
FALSE (0 in Pascal) if data is invalid (timeout period exceeded or device not initialized). If FALSE, value is undefined.
value Set to the current measure value if valid is set to TRUE (1 in Pascal)
Discussion
Request_choice returns the measure value of the device specified by fildes and ordinal when a trigger occurs, or when when the time period specified by timeout is exceeded. If the request was not previously posted with initiate_request and no request data is ready for this device, it is posted by this call. If a request was previously posted but not yet satisfied, the timeout runs from the time this call was made.
A request can be performed on an input device while it is enabled for event generation. The mode of (events enabled/events disabled) is saved by the device and restored after the request has been satisfied. The request data does not go into the event queue, but into a separate virtual register.
Use inquire_request_status to determine whether a previously posted request is ready.
To discard a request that was previously posted and satisfied, but which has not been read, use request_choice with a zero timeout and discard the result.
SEE ALSO
initiate_request(3G), inquire_request_status(3G), request_locator(3G).
Hewlett-Packard Company — November 03, 1994