summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-07-16 00:06:29 +0000
committerJeremy Allison <jra@samba.org>1998-07-16 00:06:29 +0000
commitf1cd3cb54c6495db2a91c473f91c78d24622d98e (patch)
treeebcd5c9128b1025fbe19f1bb4911f9e6b47af286 /source3/printing
parent7ade0aa1d22367cb0d998d35573dc5e333a41f75 (diff)
downloadsamba-f1cd3cb54c6495db2a91c473f91c78d24622d98e.tar.gz
samba-f1cd3cb54c6495db2a91c473f91c78d24622d98e.tar.bz2
samba-f1cd3cb54c6495db2a91c473f91c78d24622d98e.zip
Makefile: Added CC=gcc to DGUX on Intel. Comment from ross@filmworks.com.
ipc.c: loadparm.c: printing.c: Added code from <Dirk.DeWachter@rug.ac.be> 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)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/printing.c33
1 files changed, 33 insertions, 0 deletions
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 */
+}