SCGetStatus(3)
SCGetStatus, SCGetStatusFD - Get status information about a scanner
As shipped in IRIX 6.5.15. Unchanged since IRIX 6.5.
NAME SCGetStatus, SCGetStatusFD - Get status information about a scanner SYNOPSIS #include <stdio.h> #include <scanner.h> int SCGetStatus(SCANNER *s, SCSTATUS *st); int SCGetStatusFD(SCANNER *s); DESCRIPTION SCGetStatus gets status information from a scanner driver. s specifies a connection to a scanner driver obtained from a call to SCOpen(3), SCOpenFile(3), or SCOpenScreen(3). SCSTATUS is defined in <scanner.h> as follows: enum scstate { SC_READY, SC_SCANNING, SC_ERROR }; typdef struct tag_scstatus { enum scstate state; int errno; long curline; int pass; } SCSTATUS; state is SC_READY if the scanner is idle, waiting for commands. If a scan is in progress, state is SC_SCANNING, and if an error has occurred state is SC_ERROR and errno will be set to indicate the cause of the error condition. errno takes on the same values that the global variable SCerrno does. If state is SC_SCANNING, curline indicates the number of the last scan line which was fully processed by the scanner driver, and pass indicates which pass is currently being processed. During the first scanning pass of a multiple pass scan, pass will be 0, during the second pass will be 1, etc. SCGetStatusFD returns a file descriptor which can be passed to the select(2) system call. When select(2) indicates that the file descriptor is ready for reading, the scanner driver has updated the scanning status. Retrieve the status by calling SCGetStatus; do NOT pass the file descriptor returned from SCGetStatusFD to any other system call. SCGetStatusFD provides a mechanism whereby it is not necessary for an application to periodically call SCGetStatus in a timer loop to detect changes in scanner status. RETURN VALUE SCGetStatus returns 0 if successful, or -1 if an error occurs. SCGetStatusFD returns a file descriptor if successful, or -1 if an error occurs. If either function returns -1, The global variable SCerrno will be set to indicate the reason for the error. EXECUTION ERROR CODES SCGetStatus and SCGetStatusFD will fail under the following circumstances. SCECOMM Error communicating with scanner driver SCEDRVMSG Driver specific error. SCErrorString(3) will return a custom message supplied by the scanner driver SEE ALSO libscan(3), SCOpen(3), SCScan(3), SCScanFD(3).