gspool_jobmon(3)
NAME
gspool_jobmon - set a function to monitor changes to jobs
gspool_setmon - monitor job and printer list changes on Windows
SYNOPSIS
#include <gspool.h> int gspool_jobmon(const int fd, void (*fn)(const int)) int gspool_setmon(const int fd, HWND hWnd, UINT wMsg) int gspool_procmon(const int fd) void gspool_unsetmon(const int fd)
DESCRIPTION
- Unix and GNU/Linux
- The ggssppooooll__jjoobbmmoonn(()) function is used to set the function fn to be called upon notification of any changes to the jobs list.
- fd is a file descriptor previously returned by gspool_open.
- fn is a function which must be declared as returning void and taking
one "const int" argument. Alternatively, this may be "NULL" to cancel
monitoring. - The function fn will be called upon each change to the job list. The
argument passed will be fd. Note that any changes to the job queue are
reported (including changes on other hosts whose details are passed
through) as the API does not record which jobs the user is interested
in. - Windows
- The gspool_setmon routine may be used to monitor changes to the job queue or printer list. Its parameters are as follows.
- fd is a file descriptor previously returned by gspool_open.
- hWnd is a windows handle to which messages should be sent.
- wMsg is the message id to be passed to the window ("WM_USER" or a constant based on this is suggested).
- To decode the message, the gspool_procmon is provided. This returns
"XTWINAPI_JOBPROD" to indicate a change or changes to the job queue and
"XTWINAPI_PTRPROD" to indicate a change or changes to the printer list.
If there are changes to both, two or more messages will be sent, each
of which should be decoded via separate gspool_procmon calls. - To cancel monitoring, invoke the routine
gspool_unsetmon(fd) - If no monitoring is in progress, or the descriptor is invalid, this
call is just ignored.
RETURN VALUES
The function ggssppooooll__jjoobbmmoonn(()) returns 0 if successful otherwise the
error code "GSPOOL_INVALID_FD" if the file descriptor is invalid.
Invalid fn parameters will not be detected and the application program
will probably crash.
SEE ALSO
gspool_open(3), gspool_close(3), gspool_joblist(3), gspool_ptrlist(3),
gspool_ptrmon(3).
COPYRIGHT
Copyright (c) 2009 Free Software Foundation, Inc. This is free
software. You may redistribute copies of it under the terms of the GNU
General Public License <http://www.gnu.org/licenses/gpl.html>. There
is NO WARRANTY, to the extent permitted by law.
AUTHOR
- John M Collins, Xi Software Ltd.