summaryrefslogtreecommitdiff
path: root/source3/printing/pcap.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1999-12-13 13:27:58 +0000
committerAndrew Tridgell <tridge@samba.org>1999-12-13 13:27:58 +0000
commit3db52feb1f3b2c07ce0b06ad4a7099fa6efe3fc7 (patch)
tree866dd15416c3d8554bb207709f433a87ad0c012d /source3/printing/pcap.c
parentf6276724bafdb6145c0c7b565172d80cb04516ea (diff)
downloadsamba-3db52feb1f3b2c07ce0b06ad4a7099fa6efe3fc7.tar.gz
samba-3db52feb1f3b2c07ce0b06ad4a7099fa6efe3fc7.tar.bz2
samba-3db52feb1f3b2c07ce0b06ad4a7099fa6efe3fc7.zip
first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
(This used to be commit 453a822a76780063dff23526c35408866d0c0154)
Diffstat (limited to 'source3/printing/pcap.c')
-rw-r--r--source3/printing/pcap.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/source3/printing/pcap.c b/source3/printing/pcap.c
index 242406c974..62010706bb 100644
--- a/source3/printing/pcap.c
+++ b/source3/printing/pcap.c
@@ -9,6 +9,8 @@
Re-written again by Andrew Tridgell
Modified for SVID support by Norm Jacobs, 1997
+
+ Modified for CUPS support by Michael Sweet, 1999
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -54,6 +56,9 @@
*
* Modified to call SVID/XPG4 support if printcap name is set to "lpstat"
* in smb.conf under Solaris.
+ *
+ * Modified to call CUPS support if printcap name is set to "cups"
+ * in smb.conf.
*/
#include "includes.h"
@@ -69,7 +74,7 @@ extern int DEBUGLEVEL;
****************************************** */
static int strlocate(char *xpLine,char *xpS)
{
- int iS,iL,i,iRet;
+ int iS,iL,iRet;
char *p;
iS = strlen(xpS);
iL = strlen(xpLine);
@@ -91,9 +96,9 @@ static int strlocate(char *xpLine,char *xpS)
/* ******************************************************************* */
/* * Scan qconfig and search all virtual printer (device printer) * */
/* ******************************************************************* */
-static void ScanQconfig_fn(char *psz,void (*fn)())
+static void ScanQconfig_fn(char *psz,void (*fn)(char *, char *))
{
- int iLg,iEtat;
+ int iEtat;
FILE *pfile;
char *line,*p;
pstring name,comment;
@@ -262,6 +267,11 @@ BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname)
return(False);
}
+#ifdef HAVE_LIBCUPS
+ if (strequal(psz, "cups"))
+ return (cups_printername_ok(pszPrintername));
+#endif /* HAVE_LIBCUPS */
+
#ifdef SYSV
if (strequal(psz, "lpstat"))
return (sysv_printername_ok(pszPrintername));
@@ -329,6 +339,13 @@ void pcap_printer_fn(void (*fn)(char *, char *))
return;
}
+#ifdef HAVE_LIBCUPS
+ if (strequal(psz, "cups")) {
+ cups_printer_fn(fn);
+ return;
+ }
+#endif /* HAVE_LIBCUPS */
+
#ifdef SYSV
if (strequal(psz, "lpstat")) {
sysv_printer_fn(fn);