SLGetSpoolerState(3)
SLGetSpoolerState, SLSetSpoolerState - gets/sets the spooling system printing and queueing state
As shipped in IRIX 6.5.5. Unchanged since IRIX 6.5.
NAME SLGetSpoolerState, SLSetSpoolerState - gets/sets the spooling system printing and queueing state SYNOPSIS #include <spool.h> int SLGetSpoolerState(const char *printer, int function, int *statep); int SLSetSpoolerState(const char *printer, int function, int state); DESCRIPTION Each printer (or class of printers in System V) is associated with a printer queue. This queue holds the jobs that have been submitted for printing. The jobs are fed one by one to the printer. The queue can be viewed as having a gate at each end. The gate at the front end of the queue controls whether jobs are sent to the printer. The gate at the back of the queue controls whether jobs are accepted into the queue for printing. The SLSetSpoolerState function controls the state of each of these queue gates. The SLGetSpoolerState function reports the current state of each gate. printer Specifies the printer whose spooler state is to be set or reported. If printer is specified as NULL, the default printer is used. function Specifies which gate or spooling function is to be set or reported. If the value is SL_PRINTING, the state of the printing gate is set or reported. If the value is SL_QUEUEING, the state of the queue entry gate is set or reported. state This value indicates the state to set for the spooling function specified by the function parameter. The value is one of SL_ENABLED or SL_DISABLED. statep This value indicates the current state of the spooling function specified by the function parameter. The value is one of SL_ENABLED or SL_DISABLED. RETURN VALUE 0 is returned if execution was successful. -1 is returned and SLerrno is set if an execution error has occurred. EXECUTION ERROR CODES SLGetSpoolerState and SLSetSpoolerState will fail under the following general circumstances. SL_ERR_FIND_SPOOLER An error occurred while attempting to determine the available printer spooling systems. SL_ERR_NO_SPOOLERS There are no printer spooling systems available. SL_ERR_NO_DEF_PRINTER There is no default printer registered with the printer spooling system. SL_ERR_SPOOLER_ERROR A printer spooling system error has occurred. SL_ERR_BAD_FUNCTION An invalid printer spooling function has been specified. SL_ERR_BAD_PRINTER_NAME The printer name specified is either an empty string (""), or a string consisting entirely of whitespace. In addition to the general failures above, SLGetSpoolerState will also fail under the following circumstances. SL_ERR_NO_STATE The printer spooling state could not be determined. In addition to the general failures above, SLSetSpoolerState will also fail under the following circumstances. SL_ERR_BAD_STATE An invalid printer spooling function state has been specified. SL_ERR_PRIVILEGE Super-user privilege is required to execute this function. System V permits certain functions to be executed with "lp" account privileges. NOTES 1. If BSD is the current spooling system, super-user privilege is required to successfully call the SLSetSpoolerState function. If the current spooling system is System V, the queueing state can be changed if the caller's uid is either super-user or lp, and the printing state can be changed if the caller's euid is either super- user or lp. 2. Under the System V spooling system, it is an error to attempt to disable printing (SL_PRINTING function) for a printer class. SEE ALSO SLPerror(3), libspool(3), accept(1), reject(1), enable(1), disable(1), lpc(1M)