From f1cd3cb54c6495db2a91c473f91c78d24622d98e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 16 Jul 1998 00:06:29 +0000 Subject: Makefile: Added CC=gcc to DGUX on Intel. Comment from ross@filmworks.com. ipc.c: loadparm.c: printing.c: Added code from to implement print queue pausing. New parameters are "queuepause command" and "queueresume command". util.c: Added fix for mount options in autmount map. lib/rpc/include/rpc_misc.h: Removed duplicate pipe names for Jean-Francois. Jeremy. (This used to be commit 559a9bf2bbdeae3e76ba9178779cd3a9537c4e91) --- source3/printing/printing.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'source3/printing/printing.c') diff --git a/source3/printing/printing.c b/source3/printing/printing.c index 2b9c0c7199..6fa7091677 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -1213,3 +1213,36 @@ void printjob_decode(int jobid, int *snum, int *job) (*snum) = (jobid >> 8) & 0xFF; (*job) = jobid & 0xFF; } + +/**************************************************************************** + Change status of a printer queue +****************************************************************************/ + +void status_printqueue(int cnum,int snum,int status) +{ + char *queuestatus_command = (status==LPSTAT_STOPPED ? + lp_queuepausecommand(snum):lp_queueresumecommand(snum)); + char *printername = PRINTERNAME(snum); + pstring syscmd; + int ret; + + if (!printername || !*printername) { + DEBUG(6,("replacing printer name with service (snum=(%s,%d))\n", + lp_servicename(snum),snum)); + printername = lp_servicename(snum); + } + + if (!queuestatus_command || !(*queuestatus_command)) { + DEBUG(5,("No queuestatus command to %s job\n", + (status==LPSTAT_STOPPED?"pause":"resume"))); + return; + } + + pstrcpy(syscmd,queuestatus_command); + string_sub(syscmd,"%p",printername); + standard_sub(cnum,syscmd); + + ret = smbrun(syscmd,NULL,False); + DEBUG(3,("Running the command `%s' gave %d\n",syscmd,ret)); + lpq_reset(snum); /* queue has changed */ +} -- cgit