Comparar commits
1 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 5324bb809f |
-1261
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+943
-297
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+4
-8
@@ -1,4 +1,4 @@
|
||||
CREDITS.txt - 2007-09-10
|
||||
CREDITS.txt - 2006-10-02
|
||||
------------------------
|
||||
|
||||
Few projects are completed by one person, and CUPS is no exception. We'd
|
||||
@@ -6,7 +6,6 @@ like to thank the following individuals for their contributions:
|
||||
|
||||
Nathaniel Barbour - Lots of testing and feedback.
|
||||
N. Becker - setsid().
|
||||
Philippe Combes - French localization and buttons script.
|
||||
Jean-Eric Cuendet - GhostScript filters for CUPS.
|
||||
Van Dang - HTTP and IPP policeman.
|
||||
L. Peter Deutsch - MD5 code.
|
||||
@@ -19,7 +18,6 @@ like to thank the following individuals for their contributions:
|
||||
Till Kamppeter - Bug fixes, beta testing, evangelism.
|
||||
Kenshi Muto - Japanese localization, patches, and
|
||||
testing.
|
||||
Tomohiro Kato - Japanese localization.
|
||||
Kiko - Bug fixes.
|
||||
Sergey V. Kovalyov - ESP Print Pro and CUPS beta tester.
|
||||
Marek Laane - Estonian translation.
|
||||
@@ -31,16 +29,14 @@ like to thank the following individuals for their contributions:
|
||||
Giulio Orsero - Bug fixes and testing.
|
||||
Michal Osowiecki - Polish localization.
|
||||
Kurt Pfeifle - Bug fixes, beta testing, evangelism.
|
||||
Vincenzo Reale - Italian localization.
|
||||
Petter Reinholdtsen - HP-UX compiler stuff.
|
||||
Juan Pablo González Riopedre - Spanish localization.
|
||||
Opher Shachar - Hebrew localization.
|
||||
Juan Pablo González Riopedre - Spanish localization
|
||||
Stuart Stevens - HP JetDirect IPP information.
|
||||
Andrea Suatoni - IRIX desktop integration and testing.
|
||||
Teppo Turlianen - Finnish localization.
|
||||
Tomohiro Kato - Japanese localization.
|
||||
Tim Waugh - Lots of patches, testing, and Linux
|
||||
integration.
|
||||
Yugami - LDAP browsing support.
|
||||
|
||||
If I've missed someone, please let me know by sending an email to
|
||||
"msweet@apple.com".
|
||||
"mike@easysw.com".
|
||||
|
||||
+6
-14
@@ -1,4 +1,4 @@
|
||||
INSTALL - CUPS v1.3.2 - 2007-09-18
|
||||
INSTALL - CUPS v1.2.5 - 2006-10-20
|
||||
----------------------------------
|
||||
|
||||
This file describes how to compile and install CUPS from source
|
||||
@@ -6,10 +6,8 @@ code. For more information on CUPS see the file called
|
||||
"README.txt". A complete change log can be found in
|
||||
"CHANGES.txt".
|
||||
|
||||
**** IF YOU HAVE A NON-POSTSCRIPT PRINTER AND ARE NOT ****
|
||||
**** RUNNING MAC OS X, YOU WILL ALSO NEED TO INSTALL GPL ****
|
||||
**** GHOSTSCRIPT WITH THE "cups" DRIVER AFTER YOU INSTALL ****
|
||||
**** CUPS. ****
|
||||
**** IF YOU HAVE A NON-POSTSCRIPT PRINTER, YOU WILL ALSO ****
|
||||
**** NEED TO INSTALL ESP GHOSTSCRIPT AFTER YOU INSTALL CUPS ****
|
||||
|
||||
|
||||
BEFORE YOU BEGIN
|
||||
@@ -22,7 +20,7 @@ BEFORE YOU BEGIN
|
||||
The makefiles used by the project should work with all
|
||||
versions of make. We've tested them with GNU make as well as
|
||||
the make programs shipped by Compaq, HP, SGI, and Sun.
|
||||
BSD users should use GNU make (gmake).
|
||||
FreeBSD users should use GNU make (gmake).
|
||||
|
||||
Besides these tools you'll want the JPEG, PNG, TIFF, and ZLIB
|
||||
libraries for image support, the CDSA, GNU TLS, or OpenSSL
|
||||
@@ -31,16 +29,10 @@ BEFORE YOU BEGIN
|
||||
compile and run without these, however you'll miss out on
|
||||
many of the features provided by CUPS.
|
||||
|
||||
Kerberos support requires a very recent version of the MIT
|
||||
implementation with the krb5_cc_new_unique() function or the
|
||||
Heimdal implementation, along with the corresponding GSSAPI
|
||||
pieces.
|
||||
|
||||
Also, please note that CUPS no longer includes the
|
||||
Ghostscript- based pstoraster filter. You *must* download
|
||||
GPL Ghostscript separately from the CUPS web site if you want
|
||||
to print PostScript files to non-PostScript printers on
|
||||
operating systems other than Mac OS X.
|
||||
ESP Ghostscript separately from the CUPS web site if you want
|
||||
to print PostScript files to non-PostScript printers.
|
||||
|
||||
|
||||
COMPILING FROM SUBVERSION
|
||||
|
||||
+61
-65
@@ -1,10 +1,12 @@
|
||||
Common UNIX Printing System License Agreement
|
||||
|
||||
Copyright 2007 by Apple Inc.
|
||||
1 Infinite Loop
|
||||
Cupertino, CA 95014 USA
|
||||
Copyright 1997-2006 by Easy Software Products
|
||||
44141 AIRPORT VIEW DR STE 204
|
||||
HOLLYWOOD, MARYLAND 20636 USA
|
||||
|
||||
WWW: http://www.cups.org/
|
||||
Voice: +1.301.373.9600
|
||||
Email: cups-info@cups.org
|
||||
WWW: http://www.cups.org
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
@@ -15,12 +17,12 @@ General Public License ("LGPL"), Version 2, with exceptions for
|
||||
Apple operating systems and the OpenSSL toolkit. A copy of the
|
||||
exceptions and licenses follow this introduction.
|
||||
|
||||
The GNU LGPL applies to the CUPS and CUPS Imaging libraries
|
||||
located in the "cups" and "filter" subdirectories of the CUPS
|
||||
source distribution and in the "cups" include directory and
|
||||
library files in the binary distributions. The GNU GPL applies to
|
||||
the remainder of the CUPS distribution, including the "pdftops"
|
||||
filter which is based upon Xpdf.
|
||||
The GNU LGPL applies to the CUPS API library, located in the
|
||||
"cups" subdirectory of the CUPS source distribution and in the
|
||||
"cups" include directory and library files in the binary
|
||||
distributions. The GNU GPL applies to the remainder of the CUPS
|
||||
distribution, including the "pdftops" filter which is based upon
|
||||
Xpdf and the CUPS imaging library.
|
||||
|
||||
For those not familiar with the GNU GPL, the license basically
|
||||
allows you to:
|
||||
@@ -30,25 +32,28 @@ allows you to:
|
||||
binary form.
|
||||
- Sell verbatim copies of the software for a media fee, or
|
||||
sell support for the software.
|
||||
- Distribute or sell printer drivers and filters that use
|
||||
CUPS so long as source code is made available under the
|
||||
GPL.
|
||||
|
||||
What this license *does not* allow you to do is make changes or
|
||||
add features to CUPS and then sell a binary distribution without
|
||||
source code. You must provide source for any changes or additions
|
||||
to the software, and all code must be provided under the GPL or
|
||||
LGPL as appropriate. The only exceptions to this are the portions
|
||||
of the CUPS software covered by the Apple operating system
|
||||
license exceptions outlined later in this license agreement.
|
||||
source code. You must provide source for any new drivers,
|
||||
changes, or additions to the software, and all code must be
|
||||
provided under the GPL or LGPL as appropriate. The only
|
||||
exceptions to this are the portions of the CUPS software covered
|
||||
by the Apple operating system license exceptions outlined later
|
||||
in this license agreement.
|
||||
|
||||
The GNU LGPL relaxes the "link-to" restriction, allowing you to
|
||||
develop applications that use the CUPS and CUPS Imaging libraries
|
||||
under other licenses and/or conditions as appropriate for your
|
||||
application, driver, or filter.
|
||||
develop applications that use the CUPS API library under other
|
||||
licenses and/or conditions as appropriate for your application.
|
||||
|
||||
|
||||
LICENSE EXCEPTIONS
|
||||
|
||||
In addition, as the copyright holder of CUPS, Apple Inc. grants
|
||||
the following special exceptions:
|
||||
In addition, as the copyright holder of CUPS, Easy Software
|
||||
Products grants the following special exceptions:
|
||||
|
||||
1. Apple Operating System Development License Exception;
|
||||
|
||||
@@ -91,58 +96,49 @@ the following special exceptions:
|
||||
|
||||
2. OpenSSL Toolkit License Exception;
|
||||
|
||||
a. Apple Inc. explicitly allows the compilation and
|
||||
distribution of the CUPS software with the OpenSSL
|
||||
Toolkit.
|
||||
a. Easy Software Products explicitly allows the
|
||||
compilation and distribution of the CUPS software
|
||||
with the OpenSSL Toolkit.
|
||||
|
||||
No developer is required to provide these exceptions in a
|
||||
derived work.
|
||||
|
||||
|
||||
KERBEROS SUPPORT CODE
|
||||
|
||||
The Kerberos support code ("KSC") is copyright 2006 by Jelmer
|
||||
Vernooij and is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the author or Apple Inc. be held
|
||||
liable for any damages arising from the use of the KSC.
|
||||
|
||||
Sources files containing KSC have the following text at the top
|
||||
of each source file:
|
||||
|
||||
This file contains Kerberos support code, copyright 2006 by
|
||||
Jelmer Vernooij.
|
||||
|
||||
The KSC copyright and license apply only to Kerberos-related
|
||||
feature code in CUPS. Such code is typically conditionally
|
||||
compiled based on the present of the HAVE_GSSAPI preprocessor
|
||||
definition.
|
||||
|
||||
Permission is granted to anyone to use the KSC for any purpose,
|
||||
including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of the KSC must not be misrepresented; you
|
||||
must not claim that you wrote the original software. If
|
||||
you use the KSC in a product, an acknowledgment in the
|
||||
product documentation would be appreciated but is not
|
||||
required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such,
|
||||
and must not be misrepresented as being the original
|
||||
software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
|
||||
TRADEMARKS
|
||||
|
||||
Apple Inc. has trademarked the Common UNIX Printing System, CUPS,
|
||||
and CUPS logo. You may use these names and logos in any direct port
|
||||
or binary distribution of CUPS. Please contact Apple Inc. for written
|
||||
permission to use them in derivative products. Our intention is to
|
||||
protect the value of these trademarks and ensure that any derivative
|
||||
product meets the same high-quality standards as the original.
|
||||
Easy Software Products has trademarked the Common UNIX Printing
|
||||
System, CUPS, and CUPS logo. You may use these names and logos
|
||||
in any direct port or binary distribution of CUPS. Please
|
||||
contact Easy Software Products for written permission to use
|
||||
them in derivative products. Our intention is to protect the
|
||||
value of these trademarks and ensure that any derivative product
|
||||
meets the same high-quality standards as the original.
|
||||
|
||||
|
||||
BINARY DISTRIBUTION RIGHTS
|
||||
|
||||
Easy Software Products also sells rights to the CUPS source code
|
||||
under a binary distribution license for vendors that are unable
|
||||
to release source code for their drivers, additions, and
|
||||
modifications to CUPS under the GNU GPL and LGPL. For
|
||||
information please contact us at the address shown above.
|
||||
|
||||
The Common UNIX Printing System provides a "pdftops" filter that
|
||||
is based on the Xpdf software. For binary distribution licensing
|
||||
of this software, please contact:
|
||||
|
||||
Derek B. Noonburg
|
||||
Email: derekn@glyphandcog.com
|
||||
WWW: http://www.glyphandcog.com/
|
||||
|
||||
|
||||
SUPPORT
|
||||
|
||||
Easy Software Products sells software support for CUPS as well
|
||||
as a commercial printing product based on CUPS called ESP Print
|
||||
Pro. You can find out more at our web site:
|
||||
|
||||
http://www.easysw.com/
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
+24
-27
@@ -3,14 +3,23 @@
|
||||
#
|
||||
# Common makefile definitions for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
# Copyright 2007 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# property of Easy Software Products and are protected by Federal
|
||||
# copyright law. Distribution and use rights are outlined in the file
|
||||
# "LICENSE.txt" which should have been included with this file. If this
|
||||
# file is missing or damaged please contact Easy Software Products
|
||||
# at:
|
||||
#
|
||||
# Attn: CUPS Licensing Information
|
||||
# Easy Software Products
|
||||
# 44141 Airport View Drive, Suite 204
|
||||
# Hollywood, Maryland 20636 USA
|
||||
#
|
||||
# Voice: (301) 373-9600
|
||||
# EMail: cups-info@cups.org
|
||||
# WWW: http://www.cups.org
|
||||
#
|
||||
|
||||
#
|
||||
@@ -84,7 +93,6 @@ LIBMALLOC = @LIBMALLOC@
|
||||
LIBPAPER = @LIBPAPER@
|
||||
LIBPNG = @LIBPNG@
|
||||
LIBSLP = @LIBSLP@
|
||||
LIBGSSAPI = @LIBGSSAPI@
|
||||
LIBTIFF = @LIBTIFF@
|
||||
LIBZ = @LIBZ@
|
||||
|
||||
@@ -97,7 +105,8 @@ INSTALLSTATIC = @INSTALLSTATIC@
|
||||
#
|
||||
# Program options...
|
||||
#
|
||||
# ARCHFLAGS Defines the default architecture build options.
|
||||
# ARCHFLAGS Defines the default architecture build options, used
|
||||
# when compiling separate 32/64-bit libraries.
|
||||
# ARCH32FLAGS Defines the 32-bit architecture build options, used
|
||||
# when compiling separate 32/64-bit libraries.
|
||||
# ARCH64FLAGS Defines the 64-bit architecture build options, used
|
||||
@@ -108,12 +117,10 @@ INSTALLSTATIC = @INSTALLSTATIC@
|
||||
# for extra debug info)
|
||||
#
|
||||
|
||||
ALL_CFLAGS = $(SSLFLAGS) @LARGEFILE@ @PTHREAD_FLAGS@ \
|
||||
$(OPTIONS) $(CFLAGS)
|
||||
ARCHFLAGS = @ARCHFLAGS@
|
||||
ARFLAGS = @ARFLAGS@
|
||||
BACKLIBS = @BACKLIBS@
|
||||
CFLAGS = -I.. @CPPFLAGS@ @CFLAGS@ \
|
||||
CFLAGS = -I.. $(SSLFLAGS) @CPPFLAGS@ @CFLAGS@ \
|
||||
@LARGEFILE@ @PTHREAD_FLAGS@ $(OPTIONS)
|
||||
COMMONLIBS = @LIBS@
|
||||
CUPSDLIBS = @CUPSDLIBS@
|
||||
@@ -122,16 +129,10 @@ CXXFLAGS = -I.. $(SSLFLAGS) @CPPFLAGS@ @CXXFLAGS@ \
|
||||
CXXLIBS = @CXXLIBS@
|
||||
DSOFLAGS = @DSOFLAGS@
|
||||
DSOLIBS = @DSOLIBS@ $(COMMONLIBS)
|
||||
DNSSDLIBS = @DNSSDLIBS@
|
||||
FONTS = @FONTS@
|
||||
IMGLIBS = @IMGLIBS@
|
||||
IMGFILTERS = @IMGFILTERS@
|
||||
LAUNCHDLIBS = @LAUNCHDLIBS@
|
||||
LDFLAGS = -L../cups -L../filter @LDARCHFLAGS@ \
|
||||
@LDFLAGS@ @RELROFLAGS@ @PIEFLAGS@ $(OPTIM)
|
||||
LEGACY_BACKENDS = @LEGACY_BACKENDS@
|
||||
LIBCUPSORDER = @LIBCUPSORDER@
|
||||
LIBCUPSIMAGEORDER = @LIBCUPSIMAGEORDER@
|
||||
LDFLAGS = -L../cups -L../filter $(ARCHFLAGS) \
|
||||
@LDFLAGS@ @PIEFLAGS@ $(OPTIM)
|
||||
LINKCUPS = @LINKCUPS@ $(SSLLIBS)
|
||||
LINKCUPSIMAGE = @LINKCUPSIMAGE@
|
||||
LIBS = $(LINKCUPS) $(COMMONLIBS)
|
||||
@@ -143,6 +144,7 @@ PDFTOPS = @PDFTOPS@
|
||||
PHPDIR = @PHPDIR@
|
||||
SSLFLAGS = @SSLFLAGS@
|
||||
SSLLIBS = @SSLLIBS@
|
||||
LAUNCHDLIBS = @LAUNCHDLIBS@
|
||||
|
||||
#
|
||||
# Separate 32/64-bit library support...
|
||||
@@ -204,7 +206,6 @@ BINDIR = $(BUILDROOT)@bindir@
|
||||
CACHEDIR = $(BUILDROOT)@CUPS_CACHEDIR@
|
||||
DATADIR = $(BUILDROOT)@CUPS_DATADIR@
|
||||
DOCDIR = $(BUILDROOT)@CUPS_DOCROOT@
|
||||
ICONDIR = @ICONDIR@
|
||||
INCLUDEDIR = $(BUILDROOT)$(includedir)
|
||||
INITDIR = @INITDIR@
|
||||
INITDDIR = @INITDDIR@
|
||||
@@ -212,11 +213,7 @@ LIBDIR = $(BUILDROOT)$(libdir)
|
||||
LOCALEDIR = $(BUILDROOT)@CUPS_LOCALEDIR@
|
||||
LOGDIR = $(BUILDROOT)@CUPS_LOGDIR@
|
||||
MANDIR = $(BUILDROOT)@mandir@
|
||||
MENUDIR = @MENUDIR@
|
||||
PMANDIR = $(BUILDROOT)@PMANDIR@
|
||||
RCLEVELS = @RCLEVELS@
|
||||
RCSTART = @RCSTART@
|
||||
RCSTOP = @RCSTOP@
|
||||
REQUESTS = $(BUILDROOT)@CUPS_REQUESTS@
|
||||
SBINDIR = $(BUILDROOT)@sbindir@
|
||||
SERVERBIN = $(BUILDROOT)@CUPS_SERVERBIN@
|
||||
@@ -246,15 +243,15 @@ DBUSDIR = @DBUSDIR@
|
||||
|
||||
.c.o:
|
||||
echo Compiling $<...
|
||||
$(CC) $(ARCHFLAGS) $(OPTIM) $(ALL_CFLAGS) -c $<
|
||||
$(CC) $(ARCHFLAGS) $(OPTIM) $(CFLAGS) -c $<
|
||||
|
||||
.c.32.o:
|
||||
echo Compiling 32-bit $<...
|
||||
$(CC) $(ARCH32FLAGS) $(OPTIM) $(ALL_CFLAGS) -c -o $@ $<
|
||||
$(CC) $(ARCH32FLAGS) $(OPTIM) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
.c.64.o:
|
||||
echo Compiling 64-bit $<...
|
||||
$(CC) $(ARCH64FLAGS) $(OPTIM) $(ALL_CFLAGS) -c -o $@ $<
|
||||
$(CC) $(ARCH64FLAGS) $(OPTIM) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
.cxx.o:
|
||||
echo Compiling $<...
|
||||
|
||||
+42
-63
@@ -3,14 +3,23 @@
|
||||
#
|
||||
# Top-level Makefile for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
# Copyright 2007 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# property of Easy Software Products and are protected by Federal
|
||||
# copyright law. Distribution and use rights are outlined in the file
|
||||
# "LICENSE.txt" which should have been included with this file. If this
|
||||
# file is missing or damaged please contact Easy Software Products
|
||||
# at:
|
||||
#
|
||||
# Attn: CUPS Licensing Information
|
||||
# Easy Software Products
|
||||
# 44141 Airport View Drive, Suite 204
|
||||
# Hollywood, Maryland 20636-3142 USA
|
||||
#
|
||||
# Voice: (301) 373-9600
|
||||
# EMail: cups-info@cups.org
|
||||
# WWW: http://www.cups.org
|
||||
#
|
||||
|
||||
include Makedefs
|
||||
@@ -22,7 +31,7 @@ include Makedefs
|
||||
DIRS = cups backend berkeley cgi-bin filter locale man monitor \
|
||||
notifier $(PDFTOPS) scheduler systemv test \
|
||||
$(PHPDIR) \
|
||||
conf data doc $(FONTS) ppd templates
|
||||
conf data doc fonts ppd templates
|
||||
|
||||
|
||||
#
|
||||
@@ -55,16 +64,14 @@ clean:
|
||||
distclean: clean
|
||||
$(RM) Makedefs config.h config.log config.status
|
||||
$(RM) cups-config conf/cupsd.conf conf/pam.std
|
||||
$(RM) doc/help/ref-cupsd-conf.html doc/help/standard.html
|
||||
$(RM) doc/index.html
|
||||
$(RM) doc/help/standard.html doc/index.html
|
||||
$(RM) init/cups.sh init/cups-lpd
|
||||
$(RM) man/client.conf.man
|
||||
$(RM) man/cups-deviced.man man/cups-driverd.man
|
||||
$(RM) man/cups-lpd.man man/cupsaddsmb.man man/cupsd.man
|
||||
$(RM) man/cupsd.conf.man man/lpoptions.man
|
||||
$(RM) packaging/cups.list
|
||||
$(RM) templates/header.tmpl
|
||||
$(RM) packaging/cups templates/edit-config.tmpl templates/header.tmpl
|
||||
-$(RM) doc/*/index.html
|
||||
-$(RM) templates/*/edit-config.tmpl
|
||||
-$(RM) templates/*/header.tmpl
|
||||
-$(RM) -r autom4te*.cache
|
||||
|
||||
@@ -80,14 +87,6 @@ depend:
|
||||
done
|
||||
|
||||
|
||||
#
|
||||
# Generate a ctags file...
|
||||
#
|
||||
|
||||
ctags:
|
||||
ctags -R .
|
||||
|
||||
|
||||
#
|
||||
# Install object and target files...
|
||||
#
|
||||
@@ -104,17 +103,14 @@ install: installhdrs
|
||||
echo Installing init scripts...; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/init.d; \
|
||||
$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \
|
||||
for level in $(RCLEVELS); do \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \
|
||||
$(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/S$(RCSTART)cups; \
|
||||
if test `uname` = HP-UX; then \
|
||||
level=`expr $$level - 1`; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \
|
||||
fi; \
|
||||
$(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/K$(RCSTOP)cups; \
|
||||
done; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc0.d; \
|
||||
$(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc0.d/K$(RCSTOP)cups; \
|
||||
$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/rc0.d/K00cups; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc2.d; \
|
||||
$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/rc2.d/S99cups; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc3.d; \
|
||||
$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/rc3.d/S99cups; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc5.d; \
|
||||
$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/rc5.d/S99cups; \
|
||||
fi
|
||||
if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
|
||||
$(INSTALL_DIR) $(BUILDROOT)$(INITDDIR); \
|
||||
@@ -122,21 +118,12 @@ install: installhdrs
|
||||
echo Installing StartupItems files...; \
|
||||
$(INSTALL_SCRIPT) init/PrintingServices $(BUILDROOT)$(INITDDIR)/PrintingServices; \
|
||||
$(INSTALL_DATA) init/StartupParameters.plist $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \
|
||||
$(INSTALL_DIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
|
||||
$(INSTALL_DATA) init/Localizable.strings $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \
|
||||
elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
|
||||
echo Installing LaunchDaemons configuration files...; \
|
||||
$(INSTALL_DATA) init/org.cups.cupsd.plist $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \
|
||||
$(INSTALL_DATA) init/org.cups.cups-lpd.plist $(BUILDROOT)/System/Library/LaunchDaemons; \
|
||||
case `uname -r` in \
|
||||
8.*) \
|
||||
$(INSTALL_DIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \
|
||||
$(INSTALL_SCRIPT) init/PrintingServices.launchd $(BUILDROOT)/System/Library/StartupItems/PrintingServices/PrintingServices; \
|
||||
$(INSTALL_DATA) init/StartupParameters.plist $(BUILDROOT)/System/Library/StartupItems/PrintingServices/StartupParameters.plist; \
|
||||
$(INSTALL_DIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices/Resources/English.lproj; \
|
||||
$(INSTALL_DATA) init/Localizable.strings $(BUILDROOT)/System/Library/StartupItems/PrintingServices/Resources/English.lproj/Localizable.strings; \
|
||||
;; \
|
||||
esac \
|
||||
else \
|
||||
echo Installing RC script...; \
|
||||
$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
|
||||
@@ -144,29 +131,26 @@ install: installhdrs
|
||||
fi
|
||||
if test "x$(DBUSDIR)" != x; then \
|
||||
echo Installing cups.conf in $(DBUSDIR)...;\
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(DBUSDIR)/system.d; \
|
||||
$(INSTALL_DATA) packaging/cups-dbus.conf $(BUILDROOT)$(DBUSDIR)/system.d/cups.conf; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(DBUSDIR); \
|
||||
$(INSTALL_DATA) packaging/cups-dbus.conf $(BUILDROOT)$(DBUSDIR)/cups.conf; \
|
||||
fi
|
||||
if test "x$(XINETD)" != x; then \
|
||||
echo Installing xinetd configuration file for cups-lpd...; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(XINETD); \
|
||||
$(INSTALL_DATA) init/cups-lpd $(BUILDROOT)$(XINETD)/cups-lpd; \
|
||||
fi
|
||||
if test "x$(MENUDIR)" != x; then \
|
||||
echo Installing desktop menu...; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(MENUDIR); \
|
||||
$(INSTALL_DATA) desktop/cups.desktop $(BUILDROOT)$(MENUDIR); \
|
||||
fi
|
||||
if test "x$(ICONDIR)" != x; then \
|
||||
if test -d /usr/share/applications; then \
|
||||
echo Installing desktop icons...; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/16x16/apps; \
|
||||
$(INSTALL_DATA) desktop/cups-16.png $(BUILDROOT)$(ICONDIR)/hicolor/16x16/apps/cups.png; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/32x32/apps; \
|
||||
$(INSTALL_DATA) desktop/cups-32.png $(BUILDROOT)$(ICONDIR)/hicolor/32x32/apps/cups.png; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/64x64/apps; \
|
||||
$(INSTALL_DATA) desktop/cups-64.png $(BUILDROOT)$(ICONDIR)/hicolor/64x64/apps/cups.png; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/128x128/apps; \
|
||||
$(INSTALL_DATA) desktop/cups-128.png $(BUILDROOT)$(ICONDIR)/hicolor/128x128/apps/cups.png; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)/usr/share/applications; \
|
||||
$(INSTALL_DATA) desktop/cups.desktop $(BUILDROOT)/usr/share/applications; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)/usr/share/icons/hicolor/16x16/apps; \
|
||||
$(INSTALL_DATA) desktop/cups-16.png $(BUILDROOT)/usr/share/icons/hicolor/16x16/apps/cups.png; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)/usr/share/icons/hicolor/32x32/apps; \
|
||||
$(INSTALL_DATA) desktop/cups-32.png $(BUILDROOT)/usr/share/icons/hicolor/32x32/apps/cups.png; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)/usr/share/icons/hicolor/64x64/apps; \
|
||||
$(INSTALL_DATA) desktop/cups-64.png $(BUILDROOT)/usr/share/icons/hicolor/64x64/apps/cups.png; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)/usr/share/icons/hicolor/128x128/apps; \
|
||||
$(INSTALL_DATA) desktop/cups-128.png $(BUILDROOT)/usr/share/icons/hicolor/128x128/apps/cups.png; \
|
||||
fi
|
||||
|
||||
|
||||
@@ -214,9 +198,7 @@ uninstall:
|
||||
$(RM) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \
|
||||
$(RMDIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
|
||||
elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
|
||||
$(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cupsd.plist; \
|
||||
$(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cups-lpd.plist; \
|
||||
$(RMDIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \
|
||||
$(RM) $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \
|
||||
else \
|
||||
$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
|
||||
fi \
|
||||
@@ -255,7 +237,7 @@ check: all
|
||||
|
||||
EPMFLAGS = -v --output-dir dist $(EPMARCH)
|
||||
|
||||
aix bsd deb depot inst pkg setld slackware swinstall tardist:
|
||||
aix bsd deb depot inst pkg rpm setld slackware swinstall tardist:
|
||||
epm $(EPMFLAGS) -f $@ cups packaging/cups.list
|
||||
|
||||
epm:
|
||||
@@ -264,9 +246,6 @@ epm:
|
||||
osx:
|
||||
epm $(EPMFLAGS) -f osx -s packaging/installer.tif cups packaging/cups.list
|
||||
|
||||
rpm:
|
||||
epm $(EPMFLAGS) -f rpm -s packaging/installer.gif cups packaging/cups.list
|
||||
|
||||
.PHONEY: dist
|
||||
dist: all
|
||||
$(RM) -r dist
|
||||
|
||||
+49
-17
@@ -1,4 +1,4 @@
|
||||
README - CUPS v1.3.2 - 2007-09-18
|
||||
README - CUPS v1.2.5 - 2006-10-20
|
||||
---------------------------------
|
||||
|
||||
Looking for compile instructions? Read the file "INSTALL.txt"
|
||||
@@ -8,10 +8,10 @@ instead...
|
||||
INTRODUCTION
|
||||
|
||||
CUPS provides a portable printing layer for UNIX(r)-based
|
||||
operating systems. It was developed by Easy Software Products
|
||||
and is now owned and maintained by Apple Inc. to promote a
|
||||
standard printing solution for all UNIX vendors and users. CUPS
|
||||
provides the System V and Berkeley command-line interfaces.
|
||||
operating systems. It has been developed by Easy Software
|
||||
Products to promote a standard printing solution for all UNIX
|
||||
vendors and users. CUPS provides the System V and Berkeley
|
||||
command-line interfaces.
|
||||
|
||||
CUPS uses the Internet Printing Protocol ("IPP") as the basis
|
||||
for managing print jobs and queues. The Line Printer Daemon
|
||||
@@ -22,14 +22,22 @@ INTRODUCTION
|
||||
to support real-world printing under UNIX.
|
||||
|
||||
CUPS includes an image file RIP that supports printing of
|
||||
image files to non-PostScript printers. GPL Ghostscript now
|
||||
includes the "cups" driver to support printing of PostScript
|
||||
files within the CUPS driver framework. Sample drivers for
|
||||
Dymo, EPSON, HP, OKIDATA, and Zebra printers are included that
|
||||
use these filters.
|
||||
image files to non-PostScript printers. A customized version
|
||||
of GPL Ghostscript for CUPS called ESP Ghostscript is
|
||||
available separately to support printing of PostScript files
|
||||
within the CUPS driver framework. Sample drivers for Dymo,
|
||||
EPSON, HP, OKIDATA, and Zebra printers are included that use
|
||||
these filters.
|
||||
|
||||
Drivers for thousands of printers are provided with our ESP
|
||||
Print Pro software, available at:
|
||||
|
||||
http://www.easysw.com/printpro/
|
||||
|
||||
CUPS is licensed under the GNU General Public License and GNU
|
||||
Library General Public License versions 2.
|
||||
Library General Public License. Please contact Easy Software
|
||||
Products for commercial support and "binary distribution"
|
||||
rights.
|
||||
|
||||
|
||||
READING THE DOCUMENTATION
|
||||
@@ -52,13 +60,19 @@ GETTING SUPPORT AND OTHER RESOURCES
|
||||
|
||||
http://www.cups.org/newsgroups.php
|
||||
|
||||
Commercial support (with a guaranteed response time) is
|
||||
available from Easy Software Products. For more information
|
||||
see:
|
||||
|
||||
http://www.easysw.com/cups/
|
||||
|
||||
See the CUPS web site at "http://www.cups.org/" for other
|
||||
site links.
|
||||
|
||||
|
||||
SETTING UP PRINTER QUEUES USING YOUR WEB BROWSER
|
||||
|
||||
CUPS 1.3 includes a web-based administration tool that allows
|
||||
CUPS 1.2 includes a web-based administration tool that allows
|
||||
you to manage printers, classes, and jobs on your server.
|
||||
Open the following URL in your browser to access the printer
|
||||
administration tools:
|
||||
@@ -87,7 +101,6 @@ SETTING UP PRINTER QUEUES FROM THE COMMAND-LINE
|
||||
Driver PPD File
|
||||
----------------------------- ------------
|
||||
Dymo Label Printers dymo.ppd
|
||||
Intellitech Intellibar intelbar.ppd
|
||||
EPSON Stylus Color Series stcolor.ppd
|
||||
EPSON Stylus Photo Series stphoto.ppd
|
||||
EPSON Stylus New Color Series stcolor2.ppd
|
||||
@@ -95,6 +108,7 @@ SETTING UP PRINTER QUEUES FROM THE COMMAND-LINE
|
||||
EPSON 9-pin Series epson9.ppd
|
||||
EPSON 24-pin Series epson24.ppd
|
||||
HP DeskJet Series deskjet.ppd
|
||||
HP New DeskJet Series deskjet2.ppd
|
||||
HP LaserJet Series laserjet.ppd
|
||||
OKIDATA 9-Pin Series okidata9.ppd
|
||||
OKIDATA 24-Pin Series okidat24.ppd
|
||||
@@ -119,7 +133,10 @@ SETTING UP PRINTER QUEUES FROM THE COMMAND-LINE
|
||||
|
||||
The sample drivers provide basic printing capabilities, but
|
||||
generally do not exercise the full potential of the printers
|
||||
or CUPS.
|
||||
or CUPS. For fully-functional commercial printer drivers
|
||||
check out our ESP Print Pro software at:
|
||||
|
||||
http://www.easysw.com/printpro/
|
||||
|
||||
|
||||
PRINTING FILES
|
||||
@@ -153,9 +170,9 @@ PRINTING FILES
|
||||
|
||||
LEGAL STUFF
|
||||
|
||||
CUPS is Copyright 2007 by Apple Inc. CUPS, the CUPS logo, and
|
||||
the Common UNIX Printing System are the trademark property of
|
||||
Apple Inc.
|
||||
CUPS is Copyright 1993-2006 by Easy Software Products. CUPS,
|
||||
the CUPS logo, and the Common UNIX Printing System are the
|
||||
trademark property of Easy Software Products.
|
||||
|
||||
The MD5 Digest code is Copyright 1999 Aladdin Enterprises.
|
||||
|
||||
@@ -172,3 +189,18 @@ LEGAL STUFF
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
"doc/help/license.html" or "LICENSE.txt" files for more
|
||||
information.
|
||||
|
||||
For commercial licensing information, please contact:
|
||||
|
||||
Attn: CUPS Licensing Information
|
||||
Easy Software Products
|
||||
44141 Airport View Drive, Suite 204
|
||||
Hollywood, Maryland 20636 USA
|
||||
|
||||
Voice: +1.301.373.9600
|
||||
Email: cups-info@cups.org
|
||||
WWW: http://www.cups.org/
|
||||
|
||||
Note that commercial licensors may also require a license from
|
||||
Derek B. Noonburg who developed the Xpdf software used to print
|
||||
PDF files.
|
||||
|
||||
+39
-50
@@ -1,50 +1,39 @@
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
betest.o: betest.c ../cups/string.h ../config.h
|
||||
ipp.o: ipp.c ../cups/http-private.h ../config.h ../cups/http.h \
|
||||
../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/backend.h \
|
||||
../cups/cups.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/language.h ../cups/i18n.h \
|
||||
../cups/transcode.h ../cups/string.h
|
||||
lpd.o: lpd.c ../cups/backend.h ../cups/http-private.h ../config.h \
|
||||
../cups/http.h ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h \
|
||||
../cups/cups.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/i18n.h ../cups/transcode.h ../cups/string.h
|
||||
pap.o: pap.c ../config.h ../cups/cups.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \
|
||||
../cups/backend.h ../cups/sidechannel.h ../cups/i18n.h \
|
||||
../cups/transcode.h
|
||||
parallel.o: parallel.c backend-private.h ../cups/backend.h \
|
||||
../cups/sidechannel.h ../cups/cups.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \
|
||||
../cups/debug.h ../cups/i18n.h ../cups/transcode.h ../cups/string.h \
|
||||
../config.h
|
||||
scsi.o: scsi.c ../cups/backend.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/i18n.h ../cups/transcode.h ../cups/string.h \
|
||||
../config.h scsi-linux.c
|
||||
serial.o: serial.c backend-private.h ../cups/backend.h \
|
||||
../cups/sidechannel.h ../cups/cups.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \
|
||||
../cups/debug.h ../cups/i18n.h ../cups/transcode.h ../cups/string.h \
|
||||
../config.h
|
||||
snmp.o: snmp.c ../cups/http-private.h ../config.h ../cups/http.h \
|
||||
../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h backend-private.h \
|
||||
../cups/backend.h ../cups/sidechannel.h ../cups/cups.h ../cups/ppd.h \
|
||||
../cups/array.h ../cups/file.h ../cups/language.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../cups/array.h \
|
||||
../cups/file.h
|
||||
socket.o: socket.c ../cups/http-private.h ../config.h ../cups/http.h \
|
||||
../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h backend-private.h \
|
||||
../cups/backend.h ../cups/sidechannel.h ../cups/cups.h ../cups/ppd.h \
|
||||
../cups/array.h ../cups/file.h ../cups/language.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h ../cups/string.h
|
||||
test1284.o: test1284.c ../cups/string.h ../config.h ieee1284.c \
|
||||
backend-private.h ../cups/backend.h ../cups/sidechannel.h \
|
||||
../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h \
|
||||
../cups/array.h ../cups/file.h ../cups/language.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h
|
||||
usb.o: usb.c ../cups/backend.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/string.h ../config.h ../cups/i18n.h \
|
||||
../cups/transcode.h usb-unix.c ieee1284.c backend-private.h \
|
||||
../cups/sidechannel.h ../cups/debug.h
|
||||
# DO NOT DELETE
|
||||
|
||||
betest.o: ../cups/string.h ../config.h
|
||||
ipp.o: ../cups/http-private.h ../config.h ../cups/http.h ../cups/md5.h
|
||||
ipp.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/backend.h ../cups/cups.h
|
||||
ipp.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
ipp.o: ../cups/language.h ../cups/string.h
|
||||
lpd.o: ../cups/backend.h ../cups/http-private.h ../config.h ../cups/http.h
|
||||
lpd.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/cups.h
|
||||
lpd.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
lpd.o: ../cups/string.h
|
||||
pap.o: ../cups/http.h ../cups/md5.h
|
||||
parallel.o: backend-private.h ../cups/backend.h ../cups/cups.h ../cups/ipp.h
|
||||
parallel.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
|
||||
parallel.o: ../cups/file.h ../cups/language.h ../cups/debug.h
|
||||
parallel.o: ../cups/string.h ../config.h
|
||||
scsi.o: ../cups/backend.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
scsi.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
scsi.o: ../cups/language.h ../cups/string.h ../config.h
|
||||
serial.o: backend-private.h ../cups/backend.h ../cups/cups.h ../cups/ipp.h
|
||||
serial.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
|
||||
serial.o: ../cups/file.h ../cups/language.h ../cups/debug.h ../cups/string.h
|
||||
serial.o: ../config.h
|
||||
snmp.o: ../cups/http-private.h ../config.h ../cups/http.h ../cups/md5.h
|
||||
snmp.o: ../cups/ipp-private.h ../cups/ipp.h backend-private.h
|
||||
snmp.o: ../cups/backend.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
|
||||
snmp.o: ../cups/file.h ../cups/language.h ../cups/debug.h ../cups/string.h
|
||||
snmp.o: ../cups/array.h ../cups/file.h
|
||||
socket.o: ../cups/http-private.h ../config.h ../cups/http.h ../cups/md5.h
|
||||
socket.o: ../cups/ipp-private.h ../cups/ipp.h backend-private.h
|
||||
socket.o: ../cups/backend.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
|
||||
socket.o: ../cups/file.h ../cups/language.h ../cups/debug.h ../cups/string.h
|
||||
test1284.o: ../cups/string.h ../config.h ieee1284.c backend-private.h
|
||||
test1284.o: ../cups/backend.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
test1284.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
test1284.o: ../cups/language.h ../cups/debug.h
|
||||
usb.o: ../cups/backend.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
usb.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
usb.o: ../cups/language.h ../cups/string.h ../config.h
|
||||
|
||||
+17
-14
@@ -3,14 +3,23 @@
|
||||
#
|
||||
# Backend makefile for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
# Copyright 2007 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# property of Easy Software Products and are protected by Federal
|
||||
# copyright law. Distribution and use rights are outlined in the file
|
||||
# "LICENSE.txt" which should have been included with this file. If this
|
||||
# file is missing or damaged please contact Easy Software Products
|
||||
# at:
|
||||
#
|
||||
# Attn: CUPS Licensing Information
|
||||
# Easy Software Products
|
||||
# 44141 Airport View Drive, Suite 204
|
||||
# Hollywood, Maryland 20636 USA
|
||||
#
|
||||
# Voice: (301) 373-9600
|
||||
# EMail: cups-info@cups.org
|
||||
# WWW: http://www.cups.org
|
||||
#
|
||||
# This file is subject to the Apple OS-Developed Software exception.
|
||||
#
|
||||
@@ -18,7 +27,7 @@
|
||||
include ../Makedefs
|
||||
|
||||
RBACKENDS = ipp lpd
|
||||
UBACKENDS = $(PAP) $(LEGACY_BACKENDS) serial snmp socket usb
|
||||
UBACKENDS = $(PAP) parallel scsi serial snmp socket usb
|
||||
TARGETS = betest test1284 libbackend.a $(RBACKENDS) $(UBACKENDS)
|
||||
LIBOBJS = ieee1284.o runloop.o
|
||||
OBJS = betest.o ipp.o lpd.o pap.o parallel.o scsi.o \
|
||||
@@ -37,7 +46,7 @@ all: $(TARGETS)
|
||||
#
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) $(TARGETS) $(LIBOBJS) http
|
||||
$(RM) $(OBJS) $(TARGETS) http
|
||||
|
||||
|
||||
#
|
||||
@@ -62,12 +71,6 @@ install: all
|
||||
done
|
||||
$(RM) $(SERVERBIN)/backend/http
|
||||
$(LN) ipp $(SERVERBIN)/backend/http
|
||||
if test "x$(SYMROOT)" != "x"; then \
|
||||
$(INSTALL_DIR) $(SYMROOT); \
|
||||
for file in $(TARGETS); do \
|
||||
cp $$file $(SYMROOT); \
|
||||
done \
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
|
||||
+15
-11
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* Backend support definitions for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
@@ -24,10 +33,8 @@
|
||||
*/
|
||||
|
||||
# include <cups/backend.h>
|
||||
# include <cups/sidechannel.h>
|
||||
# include <cups/cups.h>
|
||||
# include <cups/debug.h>
|
||||
# include <cups/i18n.h>
|
||||
# include <stdlib.h>
|
||||
# include <errno.h>
|
||||
# include <cups/string.h>
|
||||
@@ -47,15 +54,12 @@ extern "C" {
|
||||
* Prototypes...
|
||||
*/
|
||||
|
||||
extern int backendDrainOutput(int print_fd, int device_fd);
|
||||
extern int backendGetDeviceID(int fd, char *device_id, int device_id_size,
|
||||
char *make_model, int make_model_size,
|
||||
const char *scheme, char *uri, int uri_size);
|
||||
extern int backendGetMakeModel(const char *device_id, char *make_model,
|
||||
int make_model_size);
|
||||
extern ssize_t backendRunLoop(int print_fd, int device_fd, int use_bc,
|
||||
void (*side_cb)(int print_fd, int device_fd,
|
||||
int use_bc));
|
||||
extern ssize_t backendRunLoop(int print_fd, int device_fd, int use_bc);
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
|
||||
+13
-4
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* Backend test program for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
Preliminary Design for CUPS Firewire Printer Backend - 03/19/2002
|
||||
-----------------------------------------------------------------
|
||||
|
||||
OVERVIEW
|
||||
|
||||
Easy Software Products will develop an IEEE-1394, a.k.a.
|
||||
Firewire, printing interface for its Common UNIX Printing
|
||||
System ("CUPS") for initial use under the Linux operating
|
||||
system. A follow-on implementation for MacOS X is
|
||||
anticipated as well.
|
||||
|
||||
The operating system interfaces for IEEE-1394 ports vary
|
||||
widely; the CUPS printing interface will abstract the OS
|
||||
layer to a simpler interface geared towards discovering,
|
||||
opening, reading from, writing to, and closing IEEE-1394
|
||||
printers.
|
||||
|
||||
The initial development of the CUPS backend will be targeted
|
||||
at the EPSON Stylus Pro 10000 large format printer, which
|
||||
requires the bandwidth provided by Firewire in order to
|
||||
print at full speed. This printer supports printing via
|
||||
Serial Bus Protocol 2 (SBP-2) using the SCSI and PWG command
|
||||
sets. The CUPS backend will implement the PWG command set on
|
||||
LUN 0 only.
|
||||
|
||||
|
||||
OS ABSTRACTION LAYER
|
||||
|
||||
The OS abstraction layer will be a thin client library that
|
||||
implements the following functions:
|
||||
|
||||
ieee1394_list
|
||||
ieee1394_open
|
||||
ieee1394_close
|
||||
ieee1394_read
|
||||
ieee1394_write
|
||||
ieee1394_error
|
||||
|
||||
The "ieee1394_list" function will list all of the available
|
||||
printer devices on the bus. The device information will
|
||||
consist of the device URI (ieee1394:/something) used to
|
||||
access the device and the make and model information, if
|
||||
available, for the device ("EPSON Stylus Printer").
|
||||
|
||||
The "ieee1394_open" and "ieee1394_close" functions will open
|
||||
and close a connection to the printer, respectively.
|
||||
|
||||
The "ieee1394_read" and "ieee1394_write" functions will read
|
||||
and write data to and from the printer, respectively. The
|
||||
read function will be non-blocking, returning data only if
|
||||
there is data coming back from the printer.
|
||||
|
||||
The "ieee1394_error" function will return a string
|
||||
describing the last error or NULL if no error occurred.
|
||||
|
||||
The library will be responsible for creating any background
|
||||
threads that are needed to monitor the connection to the
|
||||
printer.
|
||||
|
||||
|
||||
CUPS BACKEND
|
||||
|
||||
The CUPS backend will use the OS abstraction layer to list
|
||||
and access the Firewire printers. The "main" function will
|
||||
read and write printer data, while the "list_devices"
|
||||
function will be called as necessary to identify the
|
||||
available devices.
|
||||
|
||||
The CUPS 1.1 backend will record any status information in
|
||||
the error log file, while the 1.2 backend will supply it to
|
||||
the printer driver process.
|
||||
@@ -1,35 +0,0 @@
|
||||
Easy Software Products
|
||||
44141 Airport View Drive
|
||||
Suite 204
|
||||
Hollywood, Maryland 20636
|
||||
+1.301.373.9600
|
||||
March 8, 2002
|
||||
|
||||
|
||||
Subject: EPSON Firewire Printer Driver for Linux
|
||||
|
||||
Currently, no Firewire printer support exists for Linux. Since
|
||||
the latest EPSON printer products depend on the Firewire
|
||||
interface to print at full speed, a solution is needed to
|
||||
support customers using Linux as their server platform.
|
||||
|
||||
The Linux Firewire subsystem provides a user-mode driver
|
||||
interface that allows driver programs to access Firewire
|
||||
devices. Easy Software Products will utilize this interface to
|
||||
develop a "backend" program for the Common UNIX Printing System
|
||||
that will allow users to print to EPSON printers using the
|
||||
Firewire interface.
|
||||
|
||||
After examining the Linux interface, we estimate that it will
|
||||
require approximately 30 hours of development time to write,
|
||||
test, and document the Firewire backend, for a total cost of
|
||||
$3,000. The new backend will become a standard part of the CUPS
|
||||
software distribution and will be included with at least the
|
||||
following Linux distributions:
|
||||
|
||||
- Caldera Linux
|
||||
- Mandrake Linux
|
||||
- Red Hat Linux
|
||||
- SuSE Linux
|
||||
|
||||
ESP will provide EPSON with binaries for Red Hat Linux 7.2.
|
||||
+66
-61
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* IEEE-1284 support functions for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
@@ -84,87 +93,84 @@ backendGetDeviceID(
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
if (!device_id || device_id_size < 32)
|
||||
if (fd < 0 ||
|
||||
!device_id || device_id_size < 32 ||
|
||||
!make_model || make_model_size < 32)
|
||||
{
|
||||
DEBUG_puts("backendGetDeviceID: Bad args!");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (make_model)
|
||||
*make_model = '\0';
|
||||
*device_id = '\0';
|
||||
*make_model = '\0';
|
||||
|
||||
if (uri)
|
||||
*uri = '\0';
|
||||
|
||||
if (fd >= 0)
|
||||
{
|
||||
/*
|
||||
* Get the device ID string...
|
||||
*/
|
||||
|
||||
*device_id = '\0';
|
||||
/*
|
||||
* Get the device ID string...
|
||||
*/
|
||||
|
||||
#ifdef __linux
|
||||
if (!ioctl(fd, LPIOC_GET_DEVICE_ID(device_id_size), device_id))
|
||||
{
|
||||
/*
|
||||
* Extract the length of the device ID string from the first two
|
||||
* bytes. The 1284 spec says the length is stored MSB first...
|
||||
*/
|
||||
if (!ioctl(fd, LPIOC_GET_DEVICE_ID(device_id_size), device_id))
|
||||
{
|
||||
/*
|
||||
* Extract the length of the device ID string from the first two
|
||||
* bytes. The 1284 spec says the length is stored MSB first...
|
||||
*/
|
||||
|
||||
length = (((unsigned)device_id[0] & 255) << 8) +
|
||||
((unsigned)device_id[1] & 255);
|
||||
length = (((unsigned)device_id[0] & 255) << 8) +
|
||||
((unsigned)device_id[1] & 255);
|
||||
|
||||
/*
|
||||
* Check to see if the length is larger than our buffer; first
|
||||
* assume that the vendor incorrectly implemented the 1284 spec,
|
||||
* and then limit the length to the size of our buffer...
|
||||
*/
|
||||
/*
|
||||
* Check to see if the length is larger than our buffer; first
|
||||
* assume that the vendor incorrectly implemented the 1284 spec,
|
||||
* and then limit the length to the size of our buffer...
|
||||
*/
|
||||
|
||||
if (length > (device_id_size - 2))
|
||||
length = (((unsigned)device_id[1] & 255) << 8) +
|
||||
((unsigned)device_id[0] & 255);
|
||||
if (length > (device_id_size - 2))
|
||||
length = (((unsigned)device_id[1] & 255) << 8) +
|
||||
((unsigned)device_id[0] & 255);
|
||||
|
||||
if (length > (device_id_size - 2))
|
||||
length = device_id_size - 2;
|
||||
if (length > (device_id_size - 2))
|
||||
length = device_id_size - 2;
|
||||
|
||||
/*
|
||||
* Copy the device ID text to the beginning of the buffer and
|
||||
* nul-terminate.
|
||||
*/
|
||||
/*
|
||||
* Copy the device ID text to the beginning of the buffer and
|
||||
* nul-terminate.
|
||||
*/
|
||||
|
||||
memmove(device_id, device_id + 2, length);
|
||||
device_id[length] = '\0';
|
||||
}
|
||||
memmove(device_id, device_id + 2, length);
|
||||
device_id[length] = '\0';
|
||||
}
|
||||
# ifdef DEBUG
|
||||
else
|
||||
printf("backendGetDeviceID: ioctl failed - %s\n", strerror(errno));
|
||||
else
|
||||
printf("backendGetDeviceID: ioctl failed - %s\n", strerror(errno));
|
||||
# endif /* DEBUG */
|
||||
#endif /* __linux */
|
||||
|
||||
#if defined(__sun) && defined(ECPPIOC_GETDEVID)
|
||||
did.mode = ECPP_CENTRONICS;
|
||||
did.len = device_id_size - 1;
|
||||
did.rlen = 0;
|
||||
did.addr = device_id;
|
||||
did.mode = ECPP_CENTRONICS;
|
||||
did.len = device_id_size - 1;
|
||||
did.rlen = 0;
|
||||
did.addr = device_id;
|
||||
|
||||
if (!ioctl(fd, ECPPIOC_GETDEVID, &did))
|
||||
{
|
||||
/*
|
||||
* Nul-terminate the device ID text.
|
||||
*/
|
||||
if (!ioctl(fd, ECPPIOC_GETDEVID, &did))
|
||||
{
|
||||
/*
|
||||
* Nul-terminate the device ID text.
|
||||
*/
|
||||
|
||||
if (did.rlen < (device_id_size - 1))
|
||||
device_id[did.rlen] = '\0';
|
||||
else
|
||||
device_id[device_id_size - 1] = '\0';
|
||||
}
|
||||
# ifdef DEBUG
|
||||
if (did.rlen < (device_id_size - 1))
|
||||
device_id[did.rlen] = '\0';
|
||||
else
|
||||
printf("backendGetDeviceID: ioctl failed - %s\n", strerror(errno));
|
||||
device_id[device_id_size - 1] = '\0';
|
||||
}
|
||||
# ifdef DEBUG
|
||||
else
|
||||
printf("backendGetDeviceID: ioctl failed - %s\n", strerror(errno));
|
||||
# endif /* DEBUG */
|
||||
#endif /* __sun && ECPPIOC_GETDEVID */
|
||||
}
|
||||
|
||||
DEBUG_printf(("backendGetDeviceID: device_id=\"%s\"\n", device_id));
|
||||
|
||||
@@ -175,8 +181,7 @@ backendGetDeviceID(
|
||||
* Get the make and model...
|
||||
*/
|
||||
|
||||
if (make_model)
|
||||
backendGetMakeModel(device_id, make_model, make_model_size);
|
||||
backendGetMakeModel(device_id, make_model, make_model_size);
|
||||
|
||||
/*
|
||||
* Then generate a device URI...
|
||||
|
||||
@@ -1,878 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Linux IEEE-1394 glue for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2002 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the
|
||||
* above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or
|
||||
* other materials provided with the distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use
|
||||
* of this software must display the following
|
||||
* acknowledgement:
|
||||
*
|
||||
* This product includes software developed by Easy
|
||||
* Software Products.
|
||||
*
|
||||
* 4. The name of Easy Software Products may not be used to
|
||||
* endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
|
||||
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* get_device_id() - Get the IEEE-1284 device ID for a node...
|
||||
* get_unit_type() - Get the unit type for a node...
|
||||
* show_data() - Show a data node...
|
||||
* show_dir() - Show a directory list...
|
||||
* ieee1394_list() - List the available printer devices.
|
||||
* ieee1394_open() - Open a printer device.
|
||||
* ieee1394_close() - Close a printer device.
|
||||
* ieee1394_read() - Read from a printer device.
|
||||
* ieee1394_write() - Write data to a printer device.
|
||||
* ieee1394_error() - Return the last error.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers.
|
||||
*/
|
||||
|
||||
#include "ieee1394.h"
|
||||
#include <cups/debug.h>
|
||||
#include <libraw1394/raw1394.h>
|
||||
#include <libraw1394/csr.h>
|
||||
|
||||
|
||||
/*
|
||||
* Limits...
|
||||
*/
|
||||
|
||||
#define MAX_NODES 100
|
||||
|
||||
|
||||
/*
|
||||
* Structures...
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char uri[HTTP_MAX_URI],/* URI for this node... */
|
||||
description[128],/* Description of port */
|
||||
make_model[128];/* Make and model */
|
||||
int port, /* Port where this node is found */
|
||||
node; /* Node number */
|
||||
unsigned long long addr; /* Management address */
|
||||
} linux1394_node_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
raw1394handle_t handle; /* Handle for printer device */
|
||||
int node; /* Node number for printer device */
|
||||
unsigned long long addr; /* Management address */
|
||||
} linux1394_dev_t;
|
||||
|
||||
|
||||
/*
|
||||
* ORB messages for communication with the device...
|
||||
*/
|
||||
|
||||
typedef struct /**** Login ORB Message */
|
||||
{
|
||||
unsigned char passwd_addr[8]; /* Password address */
|
||||
unsigned char resp_addr[8]; /* Login response address */
|
||||
unsigned char notify_excl; /* Notify and exclusive bits */
|
||||
unsigned char recon_func; /* Reconnect time and function */
|
||||
unsigned char lun[2]; /* Logical unit number */
|
||||
unsigned char passwd_len[2]; /* Length of password */
|
||||
unsigned char resp_len[2]; /* Length of login response */
|
||||
unsigned char fifo_addr[8]; /* Local status FIFO address */
|
||||
} login_orb_t;
|
||||
|
||||
typedef struct /**** Login Response Message ****/
|
||||
{
|
||||
unsigned char length[2]; /* Length of response */
|
||||
unsigned char login_id[2]; /* Login ID */
|
||||
unsigned char cmd_addr[8]; /* Command block agent address */
|
||||
unsigned char reserved[2]; /* Reserved (0) */
|
||||
unsigned char recon_hold[2]; /* Number of seconds to hold login */
|
||||
} login_resp_t;
|
||||
|
||||
|
||||
/*
|
||||
* Local globals...
|
||||
*/
|
||||
|
||||
static char error_string[1024] = "";
|
||||
static int num_nodes;
|
||||
static linux1394_node_t nodes[MAX_NODES];
|
||||
|
||||
|
||||
/*
|
||||
* 'get_device_id()' - Get the IEEE-1284 device ID for a node...
|
||||
*/
|
||||
|
||||
static char * /* O - Device ID */
|
||||
get_device_id(raw1394handle_t handle,/* I - Handle for device */
|
||||
int node, /* I - Node number */
|
||||
unsigned long long offset,/* I - Offset to directory */
|
||||
char *id, /* O - ID string */
|
||||
int idlen) /* I - Size of ID string */
|
||||
{
|
||||
unsigned char data[1024], /* Data from ROM */
|
||||
*dataptr; /* Pointer into data */
|
||||
int length; /* Length of directory */
|
||||
int datalen; /* Length of data */
|
||||
unsigned long long dataoff; /* Offset of data */
|
||||
|
||||
|
||||
DEBUG_printf(("get_device_id(handle = %p, node = %d, offset = %llx, id = %p, idlen = %d)\n",
|
||||
handle, node, offset, id, idlen));
|
||||
|
||||
*id = '\0';
|
||||
|
||||
/*
|
||||
* Read the directory length from the first quadlet...
|
||||
*/
|
||||
|
||||
if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
|
||||
return (NULL);
|
||||
|
||||
offset += 4;
|
||||
|
||||
/*
|
||||
* The length is in the upper 16 bits...
|
||||
*/
|
||||
|
||||
length = (data[0] << 8) | data[1];
|
||||
|
||||
DEBUG_printf((" length = %d\n", length));
|
||||
|
||||
/*
|
||||
* Then read the directory, looking for unit directory or device tags...
|
||||
*/
|
||||
|
||||
while (length > 0)
|
||||
{
|
||||
if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
|
||||
return (NULL);
|
||||
|
||||
DEBUG_printf((" data = %02X %02X %02X %02X\n", data[0], data[1],
|
||||
data[2], data[3]));
|
||||
|
||||
if (data[0] == 0xd1)
|
||||
{
|
||||
/*
|
||||
* Found the unit directory...
|
||||
*/
|
||||
|
||||
offset += ((((data[1] << 8) | data[2]) << 8) | data[3]) << 2;
|
||||
|
||||
return (get_device_id(handle, node, offset, id, idlen));
|
||||
}
|
||||
else if (data[0] == 0x81)
|
||||
{
|
||||
/*
|
||||
* Found potential IEEE-1284 device ID...
|
||||
*/
|
||||
|
||||
dataoff = offset + (((((data[1] << 8) | data[2]) << 8) | data[3]) << 2);
|
||||
|
||||
if (raw1394_read(handle, 0xffc0 | node, dataoff, 4, (quadlet_t *)data) < 0)
|
||||
return (NULL);
|
||||
|
||||
dataoff += 4;
|
||||
|
||||
/*
|
||||
* Read the leaf value...
|
||||
*/
|
||||
|
||||
datalen = (data[0] << 8) | data[1];
|
||||
|
||||
if (datalen > (sizeof(data) / 4))
|
||||
datalen = sizeof(data) / 4;
|
||||
|
||||
for (dataptr = data; datalen > 0; datalen --, dataptr += 4, dataoff += 4)
|
||||
if (raw1394_read(handle, 0xffc0 | node, dataoff, 4,
|
||||
(quadlet_t *)dataptr) < 0)
|
||||
return (NULL);
|
||||
|
||||
if (data[0] == 0 && memcmp(data + 8, "MFG:", 4) == 0)
|
||||
{
|
||||
/*
|
||||
* Found the device ID...
|
||||
*/
|
||||
|
||||
datalen = dataptr - data - 8;
|
||||
if (datalen >= idlen)
|
||||
datalen --;
|
||||
|
||||
memcpy(id, data + 8, datalen);
|
||||
id[datalen] = '\0';
|
||||
|
||||
return (id);
|
||||
}
|
||||
}
|
||||
|
||||
offset += 4;
|
||||
length --;
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'get_man_addr()' - Get the management address for a node...
|
||||
*/
|
||||
|
||||
static int /* O - Unit type */
|
||||
get_man_addr(raw1394handle_t handle, /* I - Handle for device */
|
||||
int node, /* I - Node number */
|
||||
unsigned long long offset) /* I - Offset to directory */
|
||||
{
|
||||
unsigned char data[4]; /* Data from ROM */
|
||||
int length; /* Length of directory */
|
||||
|
||||
|
||||
DEBUG_printf(("get_man_addr(handle = %p, node = %d, offset = %llx)\n",
|
||||
handle, node, offset));
|
||||
|
||||
/*
|
||||
* Read the directory length from the first quadlet...
|
||||
*/
|
||||
|
||||
if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
|
||||
return (-1);
|
||||
|
||||
offset += 4;
|
||||
|
||||
/*
|
||||
* The length is in the upper 16 bits...
|
||||
*/
|
||||
|
||||
length = (data[0] << 8) | data[1];
|
||||
|
||||
DEBUG_printf((" length = %d\n", length));
|
||||
|
||||
/*
|
||||
* Then read the directory, looking for unit directory or type tags...
|
||||
*/
|
||||
|
||||
while (length > 0)
|
||||
{
|
||||
if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
|
||||
return (-1);
|
||||
|
||||
DEBUG_printf((" data = %02X %02X %02X %02X\n", data[0], data[1],
|
||||
data[2], data[3]));
|
||||
|
||||
if (data[0] == 0xd1)
|
||||
{
|
||||
/*
|
||||
* Found the unit directory...
|
||||
*/
|
||||
|
||||
offset += ((((data[1] << 8) | data[2]) << 8) | data[3]) << 2;
|
||||
|
||||
return (get_man_addr(handle, node, offset));
|
||||
}
|
||||
else if (data[0] == 0x54)
|
||||
{
|
||||
/*
|
||||
* Found the management address...
|
||||
*/
|
||||
|
||||
return (((((data[1] << 8) | data[2]) << 8) | data[3]) << 2);
|
||||
}
|
||||
|
||||
offset += 4;
|
||||
length --;
|
||||
}
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'get_unit_type()' - Get the unit type for a node...
|
||||
*/
|
||||
|
||||
static int /* O - Unit type */
|
||||
get_unit_type(raw1394handle_t handle,/* I - Handle for device */
|
||||
int node, /* I - Node number */
|
||||
unsigned long long offset)/* I - Offset to directory */
|
||||
{
|
||||
unsigned char data[4]; /* Data from ROM */
|
||||
int length; /* Length of directory */
|
||||
|
||||
|
||||
DEBUG_printf(("get_unit_type(handle = %p, node = %d, offset = %llx)\n",
|
||||
handle, node, offset));
|
||||
|
||||
/*
|
||||
* Read the directory length from the first quadlet...
|
||||
*/
|
||||
|
||||
if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
|
||||
return (-1);
|
||||
|
||||
offset += 4;
|
||||
|
||||
/*
|
||||
* The length is in the upper 16 bits...
|
||||
*/
|
||||
|
||||
length = (data[0] << 8) | data[1];
|
||||
|
||||
DEBUG_printf((" length = %d\n", length));
|
||||
|
||||
/*
|
||||
* Then read the directory, looking for unit directory or type tags...
|
||||
*/
|
||||
|
||||
while (length > 0)
|
||||
{
|
||||
if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
|
||||
return (-1);
|
||||
|
||||
DEBUG_printf((" data = %02X %02X %02X %02X\n", data[0], data[1],
|
||||
data[2], data[3]));
|
||||
|
||||
if (data[0] == 0xd1)
|
||||
{
|
||||
/*
|
||||
* Found the unit directory...
|
||||
*/
|
||||
|
||||
offset += ((((data[1] << 8) | data[2]) << 8) | data[3]) << 2;
|
||||
|
||||
return (get_unit_type(handle, node, offset));
|
||||
}
|
||||
else if (data[0] == 0x14)
|
||||
{
|
||||
/*
|
||||
* Found the unit type...
|
||||
*/
|
||||
|
||||
return (data[1] & 0x1f);
|
||||
}
|
||||
|
||||
offset += 4;
|
||||
length --;
|
||||
}
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
/*
|
||||
* 'show_data()' - Show a data node...
|
||||
*/
|
||||
|
||||
static void
|
||||
show_data(raw1394handle_t handle, /* I - Handle for device */
|
||||
int node, /* I - Node number */
|
||||
unsigned long long offset, /* I - Offset to directory */
|
||||
int indent) /* Amount to indent */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
unsigned char data[4]; /* Data from ROM */
|
||||
int length; /* Length of data */
|
||||
|
||||
|
||||
/*
|
||||
* Read the data length from the first quadlet...
|
||||
*/
|
||||
|
||||
if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
|
||||
return;
|
||||
|
||||
offset += 4;
|
||||
|
||||
/*
|
||||
* The length is in the upper 16 bits...
|
||||
*/
|
||||
|
||||
length = (data[0] << 8) | data[1];
|
||||
|
||||
/*
|
||||
* Then read the data...
|
||||
*/
|
||||
|
||||
for (i = 0; i < indent; i ++)
|
||||
putchar(' ');
|
||||
|
||||
printf("LEAF (%d quadlets)\n", length);
|
||||
|
||||
while (length > 0)
|
||||
{
|
||||
if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
|
||||
return;
|
||||
|
||||
for (i = 0; i < indent; i ++)
|
||||
putchar(' ');
|
||||
|
||||
printf("%02X %02X %02X %02X '%c%c%c%c'\n",
|
||||
data[0], data[1], data[2], data[3],
|
||||
(data[0] < ' ' || data[0] >= 0x7f) ? '.' : data[0],
|
||||
(data[1] < ' ' || data[1] >= 0x7f) ? '.' : data[1],
|
||||
(data[2] < ' ' || data[2] >= 0x7f) ? '.' : data[2],
|
||||
(data[3] < ' ' || data[3] >= 0x7f) ? '.' : data[3]);
|
||||
|
||||
offset += 4;
|
||||
length --;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'show_dir()' - Show a directory list...
|
||||
*/
|
||||
|
||||
static void
|
||||
show_dir(raw1394handle_t handle, /* I - Handle for device */
|
||||
int node, /* I - Node number */
|
||||
unsigned long long offset, /* I - Offset to directory */
|
||||
int indent) /* Amount to indent */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
unsigned char data[4]; /* Data from ROM */
|
||||
int length; /* Length of directory */
|
||||
int value; /* Value in directory */
|
||||
|
||||
|
||||
/*
|
||||
* Read the directory length from the first quadlet...
|
||||
*/
|
||||
|
||||
if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
|
||||
return;
|
||||
|
||||
offset += 4;
|
||||
|
||||
/*
|
||||
* The length is in the upper 16 bits...
|
||||
*/
|
||||
|
||||
length = (data[0] << 8) | data[1];
|
||||
|
||||
/*
|
||||
* Then read the directory...
|
||||
*/
|
||||
|
||||
while (length > 0)
|
||||
{
|
||||
if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
|
||||
return;
|
||||
|
||||
for (i = 0; i < indent; i ++)
|
||||
putchar(' ');
|
||||
|
||||
printf("%02X %02X %02X %02X\n", data[0], data[1], data[2], data[3]);
|
||||
|
||||
value = (((data[1] << 8) | data[2]) << 8) | data[3];
|
||||
|
||||
switch (data[0] & 0xc0)
|
||||
{
|
||||
case 0x00 :
|
||||
for (i = -4; i < indent; i ++)
|
||||
putchar(' ');
|
||||
|
||||
printf("IMMEDIATE %d\n", value);
|
||||
break;
|
||||
|
||||
case 0x40 :
|
||||
for (i = -4; i < indent; i ++)
|
||||
putchar(' ');
|
||||
|
||||
printf("CSR OFFSET +%06X\n", value);
|
||||
break;
|
||||
|
||||
case 0x80 :
|
||||
show_data(handle, node, offset + value * 4, indent + 4);
|
||||
break;
|
||||
|
||||
case 0xc0 :
|
||||
show_dir(handle, node, offset + value * 4, indent + 4);
|
||||
break;
|
||||
}
|
||||
|
||||
offset += 4;
|
||||
length --;
|
||||
}
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
|
||||
|
||||
/*
|
||||
* 'ieee1394_list()' - List the available printer devices.
|
||||
*/
|
||||
|
||||
ieee1394_info_t * /* O - Printer information */
|
||||
ieee1394_list(int *num_devices) /* O - Number of printers */
|
||||
{
|
||||
int i, j; /* Looping vars */
|
||||
raw1394handle_t handle; /* 1394 handle */
|
||||
int num_ports; /* Number of ports */
|
||||
struct raw1394_portinfo ports[100]; /* Port data... */
|
||||
unsigned char guid[8]; /* Global unique ID */
|
||||
int vendor; /* Vendor portion of GUID */
|
||||
int unit_type; /* Unit type */
|
||||
int addr; /* Management address offset */
|
||||
char id[1024], /* Device ID string */
|
||||
*idptr, /* Pointer into ID string */
|
||||
*idsep; /* Pointer to separator */
|
||||
ieee1394_info_t *devices; /* Device list */
|
||||
|
||||
|
||||
/*
|
||||
* Connect to the user-mode driver interface...
|
||||
*/
|
||||
|
||||
handle = raw1394_new_handle();
|
||||
num_ports = raw1394_get_port_info(handle, ports,
|
||||
sizeof(ports) / sizeof(ports[0]));
|
||||
|
||||
DEBUG_printf(("num_ports = %d\n", num_ports));
|
||||
|
||||
/*
|
||||
* Loop through the ports to discover what nodes are available.
|
||||
*/
|
||||
|
||||
num_nodes = 0;
|
||||
|
||||
for (i = 0; i < num_ports; i ++)
|
||||
{
|
||||
DEBUG_printf(("ports[%d] = { nodes = %d, name = \"%s\" }\n", i,
|
||||
ports[i].nodes, ports[i].name));
|
||||
|
||||
raw1394_set_port(handle, i);
|
||||
|
||||
for (j = 0; j < ports[i].nodes; j ++)
|
||||
{
|
||||
if (raw1394_read(handle, 0xffc0 | j,
|
||||
CSR_REGISTER_BASE + CSR_CONFIG_ROM + 12, 4,
|
||||
(quadlet_t *)guid) < 0)
|
||||
{
|
||||
DEBUG_printf((" Node #%d: Unable to contact (%s)!\n", j,
|
||||
strerror(errno)));
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
raw1394_read(handle, 0xffc0 | j,
|
||||
CSR_REGISTER_BASE + CSR_CONFIG_ROM + 16, 4,
|
||||
(quadlet_t *)(guid + 4));
|
||||
|
||||
DEBUG_printf((" Node #%d: GUID = %02X%02X%02X%02X%02X%02X%02X%02X\n",
|
||||
j, guid[0], guid[1], guid[2], guid[3], guid[4],
|
||||
guid[5], guid[6], guid[7]));
|
||||
|
||||
vendor = (((guid[0] << 8) | guid[1]) << 8) | guid[2];
|
||||
unit_type = get_unit_type(handle, j,
|
||||
CSR_REGISTER_BASE + CSR_CONFIG_ROM + 20);
|
||||
|
||||
DEBUG_printf(("vendor = %x, unit_type = %d\n", vendor, unit_type));
|
||||
|
||||
if (unit_type == 2 && num_nodes < MAX_NODES)
|
||||
{
|
||||
/*
|
||||
* Found a printer device; add it to the nodes list...
|
||||
*/
|
||||
|
||||
#ifdef DEBUG
|
||||
show_dir(handle, j, CSR_REGISTER_BASE + CSR_CONFIG_ROM + 20, 0);
|
||||
#endif /* DEBUG */
|
||||
|
||||
memset(nodes + num_nodes, 0, sizeof(linux1394_node_t));
|
||||
|
||||
sprintf(nodes[num_nodes].uri, "ieee1394://%02X%02X%02X%02X%02X%02X%02X%02X",
|
||||
guid[0], guid[1], guid[2], guid[3], guid[4],
|
||||
guid[5], guid[6], guid[7]);
|
||||
|
||||
nodes[num_nodes].port = i;
|
||||
nodes[num_nodes].node = j;
|
||||
|
||||
addr = get_man_addr(handle, j, CSR_REGISTER_BASE + CSR_CONFIG_ROM + 20);
|
||||
|
||||
if (addr < 0)
|
||||
continue;
|
||||
|
||||
nodes[num_nodes].addr = CSR_REGISTER_BASE + addr;
|
||||
|
||||
DEBUG_printf(("Node address = %llx\n", nodes[num_nodes].addr));
|
||||
|
||||
get_device_id(handle, j, CSR_REGISTER_BASE + CSR_CONFIG_ROM + 20,
|
||||
id, sizeof(id));
|
||||
|
||||
if (id[0])
|
||||
{
|
||||
/*
|
||||
* Grab the manufacturer and model name from the device ID
|
||||
* string...
|
||||
*/
|
||||
|
||||
idptr = id + 4;
|
||||
idsep = strchr(id, ';');
|
||||
if (idsep)
|
||||
*idsep++ = '\0';
|
||||
else
|
||||
idsep = idptr;
|
||||
|
||||
snprintf(nodes[num_nodes].description,
|
||||
sizeof(nodes[num_nodes].description),
|
||||
"%s Firewire Printer", idptr);
|
||||
|
||||
if ((idptr = strstr(idsep, "DES:")) == NULL)
|
||||
idptr = strstr(idsep, "MDL:");
|
||||
|
||||
if (idptr == NULL)
|
||||
strcpy(nodes[num_nodes].make_model, "Unknown");
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Grab the DES or MDL code...
|
||||
*/
|
||||
|
||||
idptr += 4;
|
||||
idsep = strchr(idptr, ';');
|
||||
if (idsep)
|
||||
*idsep = '\0';
|
||||
|
||||
if (strncmp(id + 4, idptr, strlen(id + 4)) == 0)
|
||||
{
|
||||
/*
|
||||
* Use the description directly...
|
||||
*/
|
||||
|
||||
strlcpy(nodes[num_nodes].make_model, idptr,
|
||||
sizeof(nodes[num_nodes].make_model));
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Add the manufacturer to the front of the name...
|
||||
*/
|
||||
|
||||
snprintf(nodes[num_nodes].make_model,
|
||||
sizeof(nodes[num_nodes].make_model),
|
||||
"%s %s", id + 4, idptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Flag it as an unknown printer...
|
||||
*/
|
||||
|
||||
sprintf(nodes[num_nodes].description,
|
||||
"Unknown%06X Firewire Printer", vendor);
|
||||
strcpy(nodes[num_nodes].make_model, "Unknown");
|
||||
}
|
||||
|
||||
num_nodes ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Done querying the Firewire bus...
|
||||
*/
|
||||
|
||||
raw1394_destroy_handle(handle);
|
||||
|
||||
/*
|
||||
* Build an array of device info structures as needed...
|
||||
*/
|
||||
|
||||
if (num_devices == NULL)
|
||||
return (NULL);
|
||||
|
||||
*num_devices = num_nodes;
|
||||
|
||||
if (num_nodes)
|
||||
{
|
||||
if ((devices = calloc(sizeof(ieee1394_info_t), num_nodes)) != NULL)
|
||||
{
|
||||
for (i = 0; i < num_nodes; i ++)
|
||||
{
|
||||
strcpy(devices[i].uri, nodes[i].uri);
|
||||
strcpy(devices[i].description, nodes[i].description);
|
||||
strcpy(devices[i].make_model, nodes[i].make_model);
|
||||
}
|
||||
}
|
||||
|
||||
return (devices);
|
||||
}
|
||||
else
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ieee1394_open()' - Open a printer device.
|
||||
*/
|
||||
|
||||
ieee1394_dev_t /* O - Printer device or NULL */
|
||||
ieee1394_open(const char *uri) /* I - Device URI */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
linux1394_dev_t *ldev; /* Linux device */
|
||||
|
||||
|
||||
/*
|
||||
* Return early if we can't see any printers...
|
||||
*/
|
||||
|
||||
if (num_nodes == 0)
|
||||
ieee1394_list(NULL);
|
||||
|
||||
if (num_nodes == 0)
|
||||
{
|
||||
strcpy(error_string, "No IEEE-1394 printers found!");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Look for the URI...
|
||||
*/
|
||||
|
||||
for (i = 0; i < num_nodes; i ++)
|
||||
if (strcmp(nodes[i].uri, uri) == 0)
|
||||
break;
|
||||
|
||||
if (i >= num_nodes)
|
||||
{
|
||||
snprintf(error_string, sizeof(error_string), "Device %s not found!", uri);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now create a new device structure...
|
||||
*/
|
||||
|
||||
if ((ldev = calloc(sizeof(linux1394_dev_t), 1)) == NULL)
|
||||
{
|
||||
strcpy(error_string, "Out of memory!");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
ldev->handle = raw1394_new_handle();
|
||||
ldev->node = nodes[i].node;
|
||||
ldev->addr = nodes[i].addr;
|
||||
|
||||
raw1394_set_port(ldev->handle, nodes[i].port);
|
||||
|
||||
error_string[0] = '\0';
|
||||
|
||||
return ((ieee1394_dev_t)ldev);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ieee1394_close()' - Close a printer device.
|
||||
*/
|
||||
|
||||
int /* O - 0 on success, -1 on failure */
|
||||
ieee1394_close(ieee1394_dev_t dev) /* I - Printer device */
|
||||
{
|
||||
linux1394_dev_t *ldev; /* Linux device */
|
||||
|
||||
|
||||
ldev = (linux1394_dev_t *)dev;
|
||||
|
||||
raw1394_destroy_handle(ldev->handle);
|
||||
|
||||
free(ldev);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ieee1394_read()' - Read from a printer device.
|
||||
*/
|
||||
|
||||
int /* O - Number of bytes read or -1 */
|
||||
ieee1394_read(ieee1394_dev_t dev, /* I - Printer device */
|
||||
char *buffer, /* I - Read buffer */
|
||||
int len) /* I - Max bytes to read */
|
||||
{
|
||||
linux1394_dev_t *ldev; /* Linux device */
|
||||
|
||||
|
||||
ldev = (linux1394_dev_t *)dev;
|
||||
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ieee1394_write()' - Write data to a printer device.
|
||||
*/
|
||||
|
||||
int /* O - Number of bytes written or -1 */
|
||||
ieee1394_write(ieee1394_dev_t dev, /* I - Printer device */
|
||||
char *buffer, /* I - Buffer to write */
|
||||
int len) /* I - Number of bytes to write */
|
||||
{
|
||||
linux1394_dev_t *ldev; /* Linux device */
|
||||
|
||||
|
||||
ldev = (linux1394_dev_t *)dev;
|
||||
|
||||
|
||||
/* if (raw1394_write(handle, 0xffc0 | j, 0, ,
|
||||
(quadlet_t *)guid) < 0)*/
|
||||
|
||||
return (len);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ieee1394_error()' - Return the last error.
|
||||
*/
|
||||
|
||||
const char * /* O - Error string or NULL */
|
||||
ieee1394_error(void)
|
||||
{
|
||||
if (error_string[0])
|
||||
return (error_string);
|
||||
else
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,268 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* IEEE-1394 backend for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2002 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the
|
||||
* above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or
|
||||
* other materials provided with the distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use
|
||||
* of this software must display the following
|
||||
* acknowledgement:
|
||||
*
|
||||
* This product includes software developed by Easy
|
||||
* Software Products.
|
||||
*
|
||||
* 4. The name of Easy Software Products may not be used to
|
||||
* endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
|
||||
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Send a file to the printer.
|
||||
* list_devices() - List all known printer devices...
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers.
|
||||
*/
|
||||
|
||||
#include "ieee1394.h"
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
void list_devices(void);
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Send a file to the printer.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* printer-uri job-id user title copies options [file]
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
ieee1394_dev_t dev; /* Printer device */
|
||||
int fp; /* Print file */
|
||||
int copies; /* Number of copies to print */
|
||||
int rbytes; /* Number of bytes read from device */
|
||||
size_t nbytes, /* Number of bytes read from file */
|
||||
tbytes; /* Total number of bytes written */
|
||||
char buffer[8192]; /* Input/output buffer */
|
||||
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
struct sigaction action; /* Actions for POSIX signals */
|
||||
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
|
||||
|
||||
|
||||
/*
|
||||
* Make sure status messages are not buffered...
|
||||
*/
|
||||
|
||||
setbuf(stderr, NULL);
|
||||
|
||||
/*
|
||||
* Check command-line...
|
||||
*/
|
||||
|
||||
if (argc == 1)
|
||||
{
|
||||
list_devices();
|
||||
|
||||
return (0);
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
fprintf(stderr, "Usage: %s job-id user title copies options [file]\n",
|
||||
argv[0]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* If we have 7 arguments, print the file named on the command-line.
|
||||
* Otherwise, send stdin instead...
|
||||
*/
|
||||
|
||||
if (argc == 6)
|
||||
{
|
||||
fp = 0;
|
||||
copies = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Try to open the print file...
|
||||
*/
|
||||
|
||||
if ((fp = open(argv[6], O_RDONLY)) < 0)
|
||||
{
|
||||
perror("ERROR: unable to open print file");
|
||||
return (1);
|
||||
}
|
||||
|
||||
copies = atoi(argv[4]);
|
||||
}
|
||||
|
||||
/*
|
||||
* Try to open the printer device...
|
||||
*/
|
||||
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
|
||||
do
|
||||
{
|
||||
if ((dev = ieee1394_open(argv[0])) == NULL)
|
||||
{
|
||||
fputs("INFO: Firewire printer busy; will retry in 30 seconds...\n", stderr);
|
||||
sleep(30);
|
||||
}
|
||||
}
|
||||
while (dev == NULL);
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
|
||||
/*
|
||||
* Now that we are "connected" to the port, ignore SIGTERM so that we
|
||||
* can finish out any page data the driver sends (e.g. to eject the
|
||||
* current page... Only ignore SIGTERM if we are printing data from
|
||||
* stdin (otherwise you can't cancel raw jobs...)
|
||||
*/
|
||||
|
||||
if (argc < 7)
|
||||
{
|
||||
#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
|
||||
sigset(SIGTERM, SIG_IGN);
|
||||
#elif defined(HAVE_SIGACTION)
|
||||
memset(&action, 0, sizeof(action));
|
||||
|
||||
sigemptyset(&action.sa_mask);
|
||||
action.sa_handler = SIG_IGN;
|
||||
sigaction(SIGTERM, &action, NULL);
|
||||
#else
|
||||
signal(SIGTERM, SIG_IGN);
|
||||
#endif /* HAVE_SIGSET */
|
||||
}
|
||||
|
||||
/*
|
||||
* Finally, send the print file...
|
||||
*/
|
||||
|
||||
while (copies > 0)
|
||||
{
|
||||
copies --;
|
||||
|
||||
if (fp != 0)
|
||||
{
|
||||
fputs("PAGE: 1 1\n", stderr);
|
||||
lseek(fp, 0, SEEK_SET);
|
||||
}
|
||||
|
||||
tbytes = 0;
|
||||
while ((nbytes = read(fp, buffer, sizeof(buffer))) > 0)
|
||||
{
|
||||
/*
|
||||
* Write the print data to the printer...
|
||||
*/
|
||||
|
||||
tbytes += nbytes;
|
||||
|
||||
if (ieee1394_write(dev, buffer, nbytes) < 0)
|
||||
{
|
||||
perror("ERROR: Unable to send print file to printer");
|
||||
break;
|
||||
}
|
||||
|
||||
if ((rbytes = ieee1394_read(dev, buffer, sizeof(buffer))) > 0)
|
||||
fprintf(stderr, "INFO: Read %d bytes from printer...\n", rbytes);
|
||||
|
||||
if (argc > 6)
|
||||
fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
|
||||
(unsigned long)tbytes);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Close the printer device and input file and return...
|
||||
*/
|
||||
|
||||
ieee1394_close(dev);
|
||||
|
||||
if (fp != 0)
|
||||
close(fp);
|
||||
|
||||
fputs("INFO: Ready to print.\n", stderr);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'list_devices()' - List all known devices...
|
||||
*/
|
||||
|
||||
void
|
||||
list_devices(void)
|
||||
{
|
||||
int i, /* Looping var */
|
||||
num_info; /* Number of devices */
|
||||
ieee1394_info_t *info; /* Devices... */
|
||||
|
||||
|
||||
/*
|
||||
* Get the available devices...
|
||||
*/
|
||||
|
||||
info = ieee1394_list(&num_info);
|
||||
|
||||
/*
|
||||
* List them as needed...
|
||||
*/
|
||||
|
||||
if (num_info > 0)
|
||||
{
|
||||
for (i = 0; i < num_info; i ++)
|
||||
printf("direct %s \"%s\" \"%s\"\n", info[i].uri,
|
||||
info[i].make_model, info[i].description);
|
||||
|
||||
free(info);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,104 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* IEEE-1394 header for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2002 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the
|
||||
* above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or
|
||||
* other materials provided with the distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use
|
||||
* of this software must display the following
|
||||
* acknowledgement:
|
||||
*
|
||||
* This product includes software developed by Easy
|
||||
* Software Products.
|
||||
*
|
||||
* 4. The name of Easy Software Products may not be used to
|
||||
* endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
|
||||
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers.
|
||||
*/
|
||||
|
||||
#include <cups/cups.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <cups/string.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <signal.h>
|
||||
|
||||
#ifdef WIN32
|
||||
# include <io.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
# include <fcntl.h>
|
||||
#endif /* WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
* Device information structure...
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char uri[HTTP_MAX_URI], /* Device URI */
|
||||
description[128], /* Description of port */
|
||||
make_model[128]; /* Make and model */
|
||||
} ieee1394_info_t;
|
||||
|
||||
|
||||
/*
|
||||
* Private device connection information...
|
||||
*/
|
||||
|
||||
typedef void *ieee1394_dev_t;
|
||||
|
||||
|
||||
/*
|
||||
* Prototypes for standard IEEE-1394 interface...
|
||||
*/
|
||||
|
||||
extern ieee1394_info_t *ieee1394_list(int *num_devices);
|
||||
extern ieee1394_dev_t ieee1394_open(const char *uri);
|
||||
extern int ieee1394_close(ieee1394_dev_t dev);
|
||||
extern int ieee1394_read(ieee1394_dev_t dev, char *buffer, int len);
|
||||
extern int ieee1394_write(ieee1394_dev_t dev, char *buffer, int len);
|
||||
extern const char *ieee1394_error(void);
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
+222
-327
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+185
-269
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* Line Printer Daemon backend for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
@@ -32,7 +41,6 @@
|
||||
#include <cups/backend.h>
|
||||
#include <cups/http-private.h>
|
||||
#include <cups/cups.h>
|
||||
#include <cups/i18n.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
@@ -65,14 +73,6 @@ static char tmpfilename[1024] = ""; /* Temporary spool file name */
|
||||
static int abort_job = 0; /* Non-zero if we get SIGTERM */
|
||||
|
||||
|
||||
/*
|
||||
* Print mode...
|
||||
*/
|
||||
|
||||
#define MODE_STANDARD 0 /* Queue a copy */
|
||||
#define MODE_STREAM 1 /* Stream a copy */
|
||||
|
||||
|
||||
/*
|
||||
* The order for control and data files in LPD requests...
|
||||
*/
|
||||
@@ -96,9 +96,9 @@ static int abort_job = 0; /* Non-zero if we get SIGTERM */
|
||||
|
||||
static int lpd_command(int lpd_fd, int timeout, char *format, ...);
|
||||
static int lpd_queue(const char *hostname, int port, const char *printer,
|
||||
int print_fd, int mode, const char *user,
|
||||
const char *title, int copies, int banner,
|
||||
int format, int order, int reserve,
|
||||
const char *filename,
|
||||
const char *user, const char *title, int copies,
|
||||
int banner, int format, int order, int reserve,
|
||||
int manual_copies, int timeout, int contimeout);
|
||||
static void lpd_timeout(int sig);
|
||||
static int lpd_write(int lpd_fd, char *buffer, int length);
|
||||
@@ -125,15 +125,13 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
username[255], /* Username info */
|
||||
resource[1024], /* Resource info (printer name) */
|
||||
*options, /* Pointer to options */
|
||||
*name, /* Name of option */
|
||||
*value, /* Value of option */
|
||||
sep, /* Separator character */
|
||||
name[255], /* Name of option */
|
||||
value[255], /* Value of option */
|
||||
*ptr, /* Pointer into name or value */
|
||||
*filename, /* File to print */
|
||||
title[256]; /* Title string */
|
||||
int port; /* Port number */
|
||||
int fd; /* Print file */
|
||||
int status; /* Status of LPD job */
|
||||
int mode; /* Print mode */
|
||||
int banner; /* Print banner page? */
|
||||
int format; /* Print format */
|
||||
int order; /* Order of control/data files */
|
||||
@@ -186,12 +184,49 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
fprintf(stderr, "Usage: %s job-id user title copies options [file]\n",
|
||||
argv[0]);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
/*
|
||||
* If we have 7 arguments, print the file named on the command-line.
|
||||
* Otherwise, copy stdin to a temporary file and print the temporary
|
||||
* file.
|
||||
*/
|
||||
|
||||
if (argc == 6)
|
||||
{
|
||||
/*
|
||||
* Copy stdin to a temporary file...
|
||||
*/
|
||||
|
||||
int fd; /* Temporary file */
|
||||
char buffer[8192]; /* Buffer for copying */
|
||||
int bytes; /* Number of bytes read */
|
||||
|
||||
|
||||
if ((fd = cupsTempFd(tmpfilename, sizeof(tmpfilename))) < 0)
|
||||
{
|
||||
perror("ERROR: unable to create temporary file");
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
while ((bytes = fread(buffer, 1, sizeof(buffer), stdin)) > 0)
|
||||
if (write(fd, buffer, bytes) < bytes)
|
||||
{
|
||||
perror("ERROR: unable to write to temporary file");
|
||||
close(fd);
|
||||
unlink(tmpfilename);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
close(fd);
|
||||
filename = tmpfilename;
|
||||
}
|
||||
else
|
||||
filename = argv[6];
|
||||
|
||||
/*
|
||||
* Extract the hostname and printer name from the URI...
|
||||
*/
|
||||
@@ -214,7 +249,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* See if there are any options...
|
||||
*/
|
||||
|
||||
mode = MODE_STANDARD;
|
||||
banner = 0;
|
||||
format = 'l';
|
||||
order = ORDER_CONTROL_DATA;
|
||||
@@ -224,16 +258,10 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
contimeout = 7 * 24 * 60 * 60;
|
||||
|
||||
#ifdef __APPLE__
|
||||
/*
|
||||
* We want to pass utf-8 characters, not re-map them (3071945)
|
||||
*/
|
||||
|
||||
/* We want to pass utf-8 characters, not re-map them (3071945) */
|
||||
sanitize_title = 0;
|
||||
|
||||
/*
|
||||
* Get the default timeout from a system preference...
|
||||
*/
|
||||
|
||||
/* Get the default timeout from a system preference... */
|
||||
{
|
||||
CFPropertyListRef pvalue; /* Preference value */
|
||||
SInt32 toval; /* Timeout value */
|
||||
@@ -277,30 +305,29 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Get the name...
|
||||
*/
|
||||
|
||||
name = options;
|
||||
for (ptr = name; *options && *options != '=';)
|
||||
if (ptr < (name + sizeof(name) - 1))
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
|
||||
while (*options && *options != '=' && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
if ((sep = *options) != '\0')
|
||||
*options++ = '\0';
|
||||
|
||||
if (sep == '=')
|
||||
if (*options == '=')
|
||||
{
|
||||
/*
|
||||
* Get the value...
|
||||
*/
|
||||
|
||||
value = options;
|
||||
options ++;
|
||||
|
||||
while (*options && *options != '+' && *options != '&')
|
||||
for (ptr = value; *options && *options != '+' && *options != '&';)
|
||||
if (ptr < (value + sizeof(value) - 1))
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
|
||||
if (*options == '+' || *options == '&')
|
||||
options ++;
|
||||
|
||||
if (*options)
|
||||
*options++ = '\0';
|
||||
}
|
||||
else
|
||||
value = (char *)"";
|
||||
value[0] = '\0';
|
||||
|
||||
/*
|
||||
* Process the option...
|
||||
@@ -324,22 +351,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
if (strchr("cdfglnoprtv", value[0]))
|
||||
format = value[0];
|
||||
else
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unknown format character \"%c\"\n"),
|
||||
value[0]);
|
||||
}
|
||||
else if (!strcasecmp(name, "mode") && value[0])
|
||||
{
|
||||
/*
|
||||
* Set control/data order...
|
||||
*/
|
||||
|
||||
if (!strcasecmp(value, "standard"))
|
||||
mode = MODE_STANDARD;
|
||||
else if (!strcasecmp(value, "stream"))
|
||||
mode = MODE_STREAM;
|
||||
else
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unknown print mode \"%s\"\n"),
|
||||
value);
|
||||
fprintf(stderr, "ERROR: Unknown format character \"%c\"\n", value[0]);
|
||||
}
|
||||
else if (!strcasecmp(name, "order") && value[0])
|
||||
{
|
||||
@@ -352,8 +364,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
else if (!strcasecmp(value, "data,control"))
|
||||
order = ORDER_DATA_CONTROL;
|
||||
else
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unknown file order \"%s\"\n"),
|
||||
value);
|
||||
fprintf(stderr, "ERROR: Unknown file order \"%s\"\n", value);
|
||||
}
|
||||
else if (!strcasecmp(name, "reserve"))
|
||||
{
|
||||
@@ -400,7 +411,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
else if (!strcasecmp(name, "contimeout"))
|
||||
{
|
||||
/*
|
||||
* Set the connection timeout...
|
||||
* Set the timeout...
|
||||
*/
|
||||
|
||||
if (atoi(value) > 0)
|
||||
@@ -409,64 +420,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
}
|
||||
|
||||
if (mode == MODE_STREAM)
|
||||
order = ORDER_CONTROL_DATA;
|
||||
|
||||
/*
|
||||
* If we have 7 arguments, print the file named on the command-line.
|
||||
* Otherwise, copy stdin to a temporary file and print the temporary
|
||||
* file.
|
||||
*/
|
||||
|
||||
if (argc == 6 && mode == MODE_STANDARD)
|
||||
{
|
||||
/*
|
||||
* Copy stdin to a temporary file...
|
||||
*/
|
||||
|
||||
char buffer[8192]; /* Buffer for copying */
|
||||
int bytes; /* Number of bytes read */
|
||||
|
||||
|
||||
if ((fd = cupsTempFd(tmpfilename, sizeof(tmpfilename))) < 0)
|
||||
{
|
||||
perror("ERROR: unable to create temporary file");
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
while ((bytes = fread(buffer, 1, sizeof(buffer), stdin)) > 0)
|
||||
if (write(fd, buffer, bytes) < bytes)
|
||||
{
|
||||
perror("ERROR: unable to write to temporary file");
|
||||
close(fd);
|
||||
unlink(tmpfilename);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
filename = tmpfilename;
|
||||
}
|
||||
else if (argc == 6)
|
||||
{
|
||||
/*
|
||||
* Stream from stdin...
|
||||
*/
|
||||
|
||||
filename = NULL;
|
||||
fd = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
filename = argv[6];
|
||||
fd = open(filename, O_RDONLY);
|
||||
|
||||
if (fd == -1)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to open print file %s: %s\n"),
|
||||
filename, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Sanitize the document title...
|
||||
*/
|
||||
@@ -480,8 +433,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* the remote end...
|
||||
*/
|
||||
|
||||
char *ptr;
|
||||
|
||||
for (ptr = title; *ptr; ptr ++)
|
||||
if (!isalnum(*ptr & 255) && !isspace(*ptr & 255))
|
||||
*ptr = '_';
|
||||
@@ -504,7 +455,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
copies = atoi(argv[4]);
|
||||
}
|
||||
|
||||
status = lpd_queue(hostname, port, resource + 1, fd, mode,
|
||||
status = lpd_queue(hostname, port, resource + 1, filename,
|
||||
username, title, copies,
|
||||
banner, format, order, reserve, manual_copies,
|
||||
timeout, contimeout);
|
||||
@@ -513,7 +464,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
fprintf(stderr, "PAGE: 1 %d\n", atoi(argv[4]));
|
||||
}
|
||||
else
|
||||
status = lpd_queue(hostname, port, resource + 1, fd, mode,
|
||||
status = lpd_queue(hostname, port, resource + 1, filename,
|
||||
username, title, 1,
|
||||
banner, format, order, reserve, 1,
|
||||
timeout, contimeout);
|
||||
@@ -525,9 +476,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
if (tmpfilename[0])
|
||||
unlink(tmpfilename);
|
||||
|
||||
if (fd)
|
||||
close(fd);
|
||||
|
||||
/*
|
||||
* Return the queue status...
|
||||
*/
|
||||
@@ -585,15 +533,14 @@ lpd_command(int fd, /* I - Socket connection to LPD host */
|
||||
* Read back the status from the command and return it...
|
||||
*/
|
||||
|
||||
fputs("DEBUG: Reading command status...\n", stderr);
|
||||
fprintf(stderr, "DEBUG: Reading command status...\n");
|
||||
|
||||
alarm(timeout);
|
||||
|
||||
if (recv(fd, &status, 1, 0) < 1)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: Remote host did not respond with command "
|
||||
"status byte after %d seconds!\n"), timeout);
|
||||
fprintf(stderr, "WARNING: Remote host did not respond with command "
|
||||
"status byte after %d seconds!\n", timeout);
|
||||
status = errno;
|
||||
}
|
||||
|
||||
@@ -613,8 +560,7 @@ static int /* O - Zero on success, non-zero on failure */
|
||||
lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
int port, /* I - Port to connect on */
|
||||
const char *printer, /* I - Printer/queue name */
|
||||
int print_fd, /* I - File to print */
|
||||
int mode, /* I - Print mode */
|
||||
const char *filename, /* I - File to print */
|
||||
const char *user, /* I - Requesting user */
|
||||
const char *title, /* I - Job title */
|
||||
int copies, /* I - Number of copies */
|
||||
@@ -626,6 +572,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
int timeout, /* I - Timeout... */
|
||||
int contimeout) /* I - Connection timeout */
|
||||
{
|
||||
FILE *fp; /* Job file */
|
||||
char localhost[255]; /* Local host name */
|
||||
int error; /* Error number */
|
||||
struct stat filestats; /* File statistics */
|
||||
@@ -635,13 +582,13 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
*cptr; /* Pointer into control file string */
|
||||
char status; /* Status byte from command */
|
||||
char portname[255]; /* Port name */
|
||||
int delay; /* Delay for retries... */
|
||||
char addrname[256]; /* Address name */
|
||||
http_addrlist_t *addrlist, /* Address list */
|
||||
*addr; /* Socket address */
|
||||
int copy; /* Copies written */
|
||||
time_t start_time; /* Time of first connect */
|
||||
#ifdef __APPLE__
|
||||
int recoverable; /* Recoverable error shown? */
|
||||
#endif /* __APPLE__ */
|
||||
size_t nbytes; /* Number of bytes written */
|
||||
off_t tbytes; /* Total bytes written */
|
||||
char buffer[32768]; /* Output buffer */
|
||||
@@ -674,16 +621,18 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
if ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, portname)) == NULL)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"),
|
||||
hostname);
|
||||
fprintf(stderr, "ERROR: Unable to locate printer \'%s\'!\n",
|
||||
hostname);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
/*
|
||||
* Remember when we started trying to connect to the printer...
|
||||
* Remember when we starting trying to connect to the printer...
|
||||
*/
|
||||
|
||||
#ifdef __APPLE__
|
||||
recoverable = 0;
|
||||
#endif /* __APPLE__ */
|
||||
start_time = time(NULL);
|
||||
|
||||
/*
|
||||
@@ -697,12 +646,10 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
*/
|
||||
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("INFO: Attempting to connect to host %s for printer %s\n"),
|
||||
hostname, printer);
|
||||
fprintf(stderr, "INFO: Attempting to connect to host %s for printer %s\n",
|
||||
hostname, printer);
|
||||
|
||||
for (lport = reserve == RESERVE_RFC1179 ? 732 : 1024, addr = addrlist,
|
||||
delay = 5;;
|
||||
for (lport = reserve == RESERVE_RFC1179 ? 732 : 1024, addr = addrlist;;
|
||||
addr = addr->next)
|
||||
{
|
||||
/*
|
||||
@@ -798,9 +745,8 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
fprintf(stderr, "INFO: Unable to connect to %s, queuing on next printer in class...\n",
|
||||
hostname);
|
||||
|
||||
httpAddrFreeList(addrlist);
|
||||
|
||||
@@ -818,20 +764,23 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
{
|
||||
if (contimeout && (time(NULL) - start_time) > contimeout)
|
||||
{
|
||||
_cupsLangPuts(stderr, _("ERROR: Printer not responding!\n"));
|
||||
fputs("ERROR: Printer not responding!\n", stderr);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
recoverable = 1;
|
||||
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: recoverable: Network host \'%s\' is busy; "
|
||||
"will retry in %d seconds...\n"), hostname, delay);
|
||||
|
||||
sleep(delay);
|
||||
|
||||
if (delay < 30)
|
||||
delay += 5;
|
||||
fprintf(stderr, "WARNING: recoverable: "
|
||||
"Network host \'%s\' is busy, down, or "
|
||||
"unreachable; will retry in 30 seconds...\n",
|
||||
hostname);
|
||||
#else
|
||||
fprintf(stderr, "WARNING: "
|
||||
"Network host \'%s\' is busy, down, or "
|
||||
"unreachable; will retry in 30 seconds...\n",
|
||||
hostname);
|
||||
#endif /* __APPLE__ */
|
||||
sleep(30);
|
||||
}
|
||||
else if (error == EADDRINUSE)
|
||||
{
|
||||
@@ -843,16 +792,19 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
recoverable = 1;
|
||||
|
||||
fprintf(stderr, "DEBUG: Connection error: %s\n", strerror(errno));
|
||||
_cupsLangPuts(stderr,
|
||||
_("ERROR: recoverable: Unable to connect to printer; "
|
||||
"will retry in 30 seconds...\n"));
|
||||
sleep(30);
|
||||
perror("ERROR: recoverable: "
|
||||
"Unable to connect to printer; will retry in 30 seconds...");
|
||||
#else
|
||||
perror("ERROR: "
|
||||
"Unable to connect to printer; will retry in 30 seconds...");
|
||||
#endif /* __APPLE__ */
|
||||
sleep(30);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
if (recoverable)
|
||||
{
|
||||
/*
|
||||
@@ -864,55 +816,35 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
fputs("INFO: recovered: \n", stderr);
|
||||
sleep(5);
|
||||
}
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
_cupsLangPrintf(stderr, _("INFO: Connected to %s...\n"), hostname);
|
||||
|
||||
#ifdef AF_INET6
|
||||
if (addr->addr.addr.sa_family == AF_INET6)
|
||||
fprintf(stderr, "DEBUG: Connected to [%s]:%d (IPv6) (local port %d)...\n",
|
||||
httpAddrString(&addr->addr, addrname, sizeof(addrname)),
|
||||
ntohs(addr->addr.ipv6.sin6_port), lport);
|
||||
else
|
||||
#endif /* AF_INET6 */
|
||||
if (addr->addr.addr.sa_family == AF_INET)
|
||||
fprintf(stderr, "DEBUG: Connected to %s:%d (IPv4) (local port %d)...\n",
|
||||
httpAddrString(&addr->addr, addrname, sizeof(addrname)),
|
||||
ntohs(addr->addr.ipv4.sin_port), lport);
|
||||
fprintf(stderr, "INFO: Connected to %s...\n", hostname);
|
||||
fprintf(stderr, "DEBUG: Connected on ports %d (local %d)...\n", port,
|
||||
lport);
|
||||
|
||||
/*
|
||||
* Next, open the print file and figure out its size...
|
||||
*/
|
||||
|
||||
if (print_fd)
|
||||
if (stat(filename, &filestats))
|
||||
{
|
||||
/*
|
||||
* Use the size from the print file...
|
||||
*/
|
||||
httpAddrFreeList(addrlist);
|
||||
close(fd);
|
||||
|
||||
if (fstat(print_fd, &filestats))
|
||||
{
|
||||
httpAddrFreeList(addrlist);
|
||||
close(fd);
|
||||
|
||||
perror("ERROR: unable to stat print file");
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
filestats.st_size *= manual_copies;
|
||||
perror("ERROR: unable to stat print file");
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Use a "very large value" for the size so that the printer will
|
||||
* keep printing until we close the connection...
|
||||
*/
|
||||
|
||||
#ifdef _LARGEFILE_SOURCE
|
||||
filestats.st_size = (size_t)(999999999999.0);
|
||||
#else
|
||||
filestats.st_size = 2147483647;
|
||||
#endif /* _LARGEFILE_SOURCE */
|
||||
filestats.st_size *= manual_copies;
|
||||
|
||||
if ((fp = fopen(filename, "rb")) == NULL)
|
||||
{
|
||||
httpAddrFreeList(addrlist);
|
||||
close(fd);
|
||||
|
||||
perror("ERROR: unable to open print file for reading");
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -972,8 +904,8 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
_cupsLangPrintf(stderr, _("INFO: Sending control file (%u bytes)\n"),
|
||||
(unsigned)strlen(control));
|
||||
fprintf(stderr, "INFO: Sending control file (%u bytes)\n",
|
||||
(unsigned)strlen(control));
|
||||
|
||||
if (lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
|
||||
{
|
||||
@@ -986,9 +918,8 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
if (read(fd, &status, 1) < 1)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: Remote host did not respond with control "
|
||||
"status byte after %d seconds!\n"), timeout);
|
||||
fprintf(stderr, "WARNING: Remote host did not respond with control "
|
||||
"status byte after %d seconds!\n", timeout);
|
||||
status = errno;
|
||||
}
|
||||
|
||||
@@ -996,11 +927,10 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
}
|
||||
|
||||
if (status != 0)
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Remote host did not accept control file "
|
||||
"(%d)\n"), status);
|
||||
fprintf(stderr, "ERROR: Remote host did not accept control file (%d)\n",
|
||||
status);
|
||||
else
|
||||
_cupsLangPuts(stderr, _("INFO: Control file sent successfully\n"));
|
||||
fputs("INFO: Control file sent successfully\n", stderr);
|
||||
}
|
||||
else
|
||||
status = 0;
|
||||
@@ -1021,24 +951,18 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
_cupsLangPrintf(stderr,
|
||||
#ifdef HAVE_LONG_LONG
|
||||
_("INFO: Sending data file (%lld bytes)\n"),
|
||||
#else
|
||||
_("INFO: Sending data file (%ld bytes)\n"),
|
||||
#endif /* HAVE_LONG_LONG */
|
||||
CUPS_LLCAST filestats.st_size);
|
||||
fprintf(stderr, "INFO: Sending data file (" CUPS_LLFMT " bytes)\n",
|
||||
CUPS_LLCAST filestats.st_size);
|
||||
|
||||
tbytes = 0;
|
||||
for (copy = 0; copy < manual_copies; copy ++)
|
||||
{
|
||||
lseek(print_fd, 0, SEEK_SET);
|
||||
rewind(fp);
|
||||
|
||||
while ((nbytes = read(print_fd, buffer, sizeof(buffer))) > 0)
|
||||
while ((nbytes = fread(buffer, 1, sizeof(buffer), fp)) > 0)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("INFO: Spooling LPR job, %.0f%% complete...\n"),
|
||||
100.0 * tbytes / filestats.st_size);
|
||||
fprintf(stderr, "INFO: Spooling LPR job, %.0f%% complete...\n",
|
||||
100.0 * tbytes / filestats.st_size);
|
||||
|
||||
if (lpd_write(fd, buffer, nbytes) < nbytes)
|
||||
{
|
||||
@@ -1050,46 +974,39 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
}
|
||||
}
|
||||
|
||||
if (mode == MODE_STANDARD)
|
||||
if (tbytes < filestats.st_size)
|
||||
status = errno;
|
||||
else if (lpd_write(fd, "", 1) < 1)
|
||||
{
|
||||
if (tbytes < filestats.st_size)
|
||||
status = errno;
|
||||
else if (lpd_write(fd, "", 1) < 1)
|
||||
{
|
||||
perror("ERROR: Unable to send trailing nul to printer");
|
||||
status = errno;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Read the status byte from the printer; if we can't read the byte
|
||||
* back now, we should set status to "errno", however at this point
|
||||
* we know the printer got the whole file and we don't necessarily
|
||||
* want to requeue it over and over...
|
||||
*/
|
||||
|
||||
alarm(timeout);
|
||||
|
||||
if (recv(fd, &status, 1, 0) < 1)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: Remote host did not respond with data "
|
||||
"status byte after %d seconds!\n"), timeout);
|
||||
status = 0;
|
||||
}
|
||||
|
||||
alarm(0);
|
||||
}
|
||||
perror("ERROR: Unable to send trailing nul to printer");
|
||||
status = errno;
|
||||
}
|
||||
else
|
||||
status = 0;
|
||||
{
|
||||
/*
|
||||
* Read the status byte from the printer; if we can't read the byte
|
||||
* back now, we should set status to "errno", however at this point
|
||||
* we know the printer got the whole file and we don't necessarily
|
||||
* want to requeue it over and over...
|
||||
*/
|
||||
|
||||
alarm(timeout);
|
||||
|
||||
if (recv(fd, &status, 1, 0) < 1)
|
||||
{
|
||||
fprintf(stderr, "WARNING: Remote host did not respond with data "
|
||||
"status byte after %d seconds!\n", timeout);
|
||||
status = 0;
|
||||
}
|
||||
|
||||
alarm(0);
|
||||
}
|
||||
|
||||
if (status != 0)
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Remote host did not accept data file (%d)\n"),
|
||||
status);
|
||||
fprintf(stderr, "ERROR: Remote host did not accept data file (%d)\n",
|
||||
status);
|
||||
else
|
||||
_cupsLangPuts(stderr, _("INFO: Data file sent successfully\n"));
|
||||
fputs("INFO: Data file sent successfully\n", stderr);
|
||||
}
|
||||
|
||||
if (status == 0 && order == ORDER_DATA_CONTROL)
|
||||
@@ -1103,8 +1020,8 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
_cupsLangPrintf(stderr, _("INFO: Sending control file (%lu bytes)\n"),
|
||||
(unsigned long)strlen(control));
|
||||
fprintf(stderr, "INFO: Sending control file (%lu bytes)\n",
|
||||
(unsigned long)strlen(control));
|
||||
|
||||
if (lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
|
||||
{
|
||||
@@ -1117,9 +1034,8 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
if (read(fd, &status, 1) < 1)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: Remote host did not respond with control "
|
||||
"status byte after %d seconds!\n"), timeout);
|
||||
fprintf(stderr, "WARNING: Remote host did not respond with control "
|
||||
"status byte after %d seconds!\n", timeout);
|
||||
status = errno;
|
||||
}
|
||||
|
||||
@@ -1127,11 +1043,10 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
}
|
||||
|
||||
if (status != 0)
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Remote host did not accept control file "
|
||||
"(%d)\n"), status);
|
||||
fprintf(stderr, "ERROR: Remote host did not accept control file (%d)\n",
|
||||
status);
|
||||
else
|
||||
_cupsLangPuts(stderr, _("INFO: Control file sent successfully\n"));
|
||||
fputs("INFO: Control file sent successfully\n", stderr);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1139,6 +1054,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
*/
|
||||
|
||||
close(fd);
|
||||
fclose(fp);
|
||||
|
||||
if (status == 0)
|
||||
{
|
||||
|
||||
+233
-353
@@ -42,36 +42,31 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* This program implements the Printer Access Protocol (PAP) on top of AppleTalk
|
||||
* Transaction Protocol (ATP). If it were to use the blocking pap functions of
|
||||
* the AppleTalk library it would need seperate threads for reading, writing
|
||||
* and status.
|
||||
* This program implements the Printer Access Protocol (PAP) on top of AppleTalk Transaction
|
||||
* Protocol (ATP). If it were to use the blocking pap functions of the AppleTalk library it
|
||||
* would need seperate threads for reading, writing and status.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Send a file to the specified Appletalk printer.
|
||||
* listDevices() - List all LaserWriter printers in the local zone.
|
||||
* printFile() - Print file.
|
||||
* papOpen() - Open a pap session to a printer.
|
||||
* papClose() - Close a pap session.
|
||||
* papWrite() - Write bytes to a printer.
|
||||
* papCloseResp() - Send a pap close response.
|
||||
* papSendRequest() - Fomrat and send a pap packet.
|
||||
* papCancelRequest() - Cancel a pending pap request.
|
||||
* sidechannel_request() - Handle side-channel requests.
|
||||
* statusUpdate() - Print printer status to stderr.
|
||||
* parseUri() - Extract the print name and zone from a uri.
|
||||
* addPercentEscapes() - Encode a string with percent escapes.
|
||||
* removePercentEscapes - Remove percent escape sequences from a string.
|
||||
* nbptuple_compare() - Compare routine for qsort.
|
||||
* okayToUseAppleTalk() - Returns true if AppleTalk is available and enabled.
|
||||
* packet_name() - Returns packet name string.
|
||||
* connectTimeout() - Returns the connect timeout preference value.
|
||||
* signalHandler() - handle SIGINT to close the session before quiting.
|
||||
* main() - Send a file to the specified Appletalk printer.
|
||||
* listDevices() - List all LaserWriter printers in the local zone.
|
||||
* printFile() - Print from a file descriptor to an NBP specified printer.
|
||||
* papOpen() - Open a pap session to a printer.
|
||||
* papClose() - Close a pap session after cleaning up pending transactions.
|
||||
* papWrite() - Write bytes to a printer.
|
||||
* papCloseResp() - Send a pap close response in the rare case we receive a close connection request.
|
||||
* papSendRequest() - Fomrat and send a pap packet.
|
||||
* papCancelRequest() - Cancel a pending pap request.
|
||||
* statusUpdate() - Print printer status to stderr.
|
||||
* parseUri() - Extract the print name and zone from a uri.
|
||||
* addPercentEscapes() - Encode a string with percent escapes.
|
||||
* removePercentEscapes - Returns a string with any percent escape sequences replaced with their equivalent.
|
||||
* nbptuple_compare() - Compare routine for qsort.
|
||||
* okayToUseAppleTalk() - Returns true if AppleTalk is available and enabled.
|
||||
* connectTimeout() - Returns the connect timeout preference value.
|
||||
* signalHandler() - handle SIGINT to close the session before quiting.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
@@ -91,10 +86,7 @@
|
||||
#include <netat/nbp.h>
|
||||
#include <netat/pap.h>
|
||||
|
||||
#include <cups/cups.h>
|
||||
#include <cups/backend.h>
|
||||
#include <cups/sidechannel.h>
|
||||
#include <cups/i18n.h>
|
||||
#include <cups/http.h>
|
||||
|
||||
#include <libkern/OSByteOrder.h>
|
||||
|
||||
@@ -103,25 +95,19 @@
|
||||
#else
|
||||
/* These definitions come from at_proto.h... */
|
||||
# define ZIP_DEF_INTERFACE NULL
|
||||
enum { RUNNING, NOTLOADED, LOADED, OTHERERROR };
|
||||
enum { RUNNING, NOTLOADED, LOADED, OTHERERROR }; /* Appletalk Stack status Function. */
|
||||
|
||||
extern int atp_abort(int fd, at_inet_t *dest, u_short tid);
|
||||
extern int atp_close(int fd);
|
||||
extern int atp_getreq(int fd, at_inet_t *src, char *buf, int *len, int *userdata,
|
||||
int *xo, u_short *tid, u_char *bitmap, int nowait);
|
||||
extern int atp_getreq(int fd, at_inet_t *src, char *buf, int *len, int *userdata, int *xo, u_short *tid, u_char *bitmap, int nowait);
|
||||
extern int atp_getresp(int fd, u_short *tid, at_resp_t *resp);
|
||||
extern int atp_look(int fd);
|
||||
extern int atp_open(at_socket *sock);
|
||||
extern int atp_sendreq(int fd, at_inet_t *dest, char *buf, int len,
|
||||
int userdata, int xo, int xo_relt, u_short *tid,
|
||||
at_resp_t *resp, at_retry_t *retry, int nowait);
|
||||
extern int atp_sendrsp(int fd, at_inet_t *dest, int xo, u_short tid,
|
||||
at_resp_t *resp);
|
||||
extern int atp_sendreq(int fd, at_inet_t *dest, char *buf, int len, int userdata, int xo, int xo_relt, u_short *tid, at_resp_t *resp, at_retry_t *retry, int nowait);
|
||||
extern int atp_sendrsp(int fd, at_inet_t *dest, int xo, u_short tid, at_resp_t *resp);
|
||||
extern int checkATStack();
|
||||
extern int nbp_lookup(at_entity_t *entity, at_nbptuple_t *buf, int max,
|
||||
at_retry_t *retry);
|
||||
extern int nbp_make_entity(at_entity_t *entity, char *obj, char *type,
|
||||
char *zone);
|
||||
extern int nbp_lookup(at_entity_t *entity, at_nbptuple_t *buf, int max, at_retry_t *retry);
|
||||
extern int nbp_make_entity(at_entity_t *entity, char *obj, char *type, char *zone);
|
||||
extern int zip_getmyzone(char *ifName, at_nvestr_t *zone);
|
||||
#endif /* HAVE_APPLETALK_AT_PROTO_H */
|
||||
|
||||
@@ -130,7 +116,7 @@ extern int zip_getmyzone(char *ifName, at_nvestr_t *zone);
|
||||
#include <CoreFoundation/CFPreferences.h>
|
||||
|
||||
/* Defines */
|
||||
#define MAX_PRINTERS 500 /* Max number of printers we can lookup */
|
||||
#define MAX_PRINTERS 500 /* Max number of printers we can lookup in listDevices */
|
||||
#define PAP_CONNID 0
|
||||
#define PAP_TYPE 1
|
||||
#define PAP_EOF 2
|
||||
@@ -140,44 +126,50 @@ extern int zip_getmyzone(char *ifName, at_nvestr_t *zone);
|
||||
#define SEQUENCE_NUM(p) (((u_char *)&p)[2])
|
||||
#define IS_PAP_EOF(p) (((u_char *)&p)[2])
|
||||
|
||||
#define PAPPacketStr(x) \
|
||||
((x) == AT_PAP_TYPE_OPEN_CONN) ? "PAP_OPEN_CONN" : \
|
||||
((x) == AT_PAP_TYPE_OPEN_CONN_REPLY) ? "PAP_OPEN_CONN_REPLY" : \
|
||||
((x) == AT_PAP_TYPE_SEND_DATA) ? "PAP_SEND_DATA" : \
|
||||
((x) == AT_PAP_TYPE_DATA) ? "PAP_DATA" : \
|
||||
((x) == AT_PAP_TYPE_TICKLE) ? "PAP_TICKLE" : \
|
||||
((x) == AT_PAP_TYPE_CLOSE_CONN) ? "PAP_CLOSE_CONN" : \
|
||||
((x) == AT_PAP_TYPE_CLOSE_CONN_REPLY) ? "PAP_CLOSE_CONN_REPLY" : \
|
||||
((x) == AT_PAP_TYPE_SEND_STATUS) ? "PAP_SEND_STATUS" : \
|
||||
((x) == AT_PAP_TYPE_SEND_STS_REPLY) ? "PAP_SEND_STS_REPLY" : \
|
||||
((x) == AT_PAP_TYPE_READ_LW) ? "PAP_READ_LW" : \
|
||||
"<Unknown>"
|
||||
|
||||
#ifndef true
|
||||
#define true 1
|
||||
#define false 0
|
||||
#endif
|
||||
|
||||
/* Globals */
|
||||
int gSockfd = 0; /* Socket descriptor */
|
||||
at_inet_t gSessionAddr = { 0 }; /* Address of the session responding socket */
|
||||
u_char gConnID = 0; /* PAP session connection id */
|
||||
u_short gSendDataID = 0; /* Transaction id of pending send-data request */
|
||||
u_short gTickleID = 0; /* Transaction id of outstanding tickle request*/
|
||||
int gWaitEOF = false; /* Option: wait for a remote's EOF */
|
||||
int gSockfd = 0; /* Socket descriptor */
|
||||
at_inet_t gSessionAddr = { 0 }; /* Address of the session responding socket */
|
||||
u_char gConnID = 0; /* PAP session connection id */
|
||||
u_short gSendDataID = 0; /* Transaction id of our pending send-data request */
|
||||
u_short gTickleID = 0; /* Transaction id of our outstanding tickle request*/
|
||||
int gWaitEOF = false; /* Option: causes us to wait for a remote's EOF */
|
||||
int gStatusInterval= 5; /* Option: 0=off else seconds between status requests*/
|
||||
int gErrorlogged = false; /* If an error was logged don't send any more INFO messages */
|
||||
int gDebug = 0; /* Option: emit debugging info */
|
||||
int gDebug = 0; /* Option: causes us to emit debugging info */
|
||||
|
||||
/* Local functions */
|
||||
static int listDevices(void);
|
||||
static int printFile(char* name, char* type, char* zone, int fdin, int fdout,
|
||||
int fderr, int copies, int argc);
|
||||
static int papOpen(at_nbptuple_t* tuple, u_char* connID, int* fd,
|
||||
at_inet_t* pap_to, u_char* flowQuantum);
|
||||
static int papClose();
|
||||
static int papWrite(int sockfd, at_inet_t* dest, u_short tid, u_char connID,
|
||||
u_char flowQuantum, char* data, int len, int eof);
|
||||
static int papCloseResp(int sockfd, at_inet_t* dest, int xo, u_short tid,
|
||||
u_char connID);
|
||||
static int papSendRequest(int sockfd, at_inet_t* dest, u_char connID,
|
||||
int function, u_char bitmap, int xo, int seqno);
|
||||
static int printFile(char* name, char* type, char* zone, int fdin, int fdout, int fderr, int copies, int argc);
|
||||
static int papOpen(at_nbptuple_t* tuple, u_char* connID, int* fd, at_inet_t* pap_to, u_char* flowQuantum);
|
||||
static int papClose(int abortflag);
|
||||
static int papWrite(int sockfd, at_inet_t* dest, u_short tid, u_char connID, u_char flowQuantum, char* data, int len, int eof);
|
||||
static int papCloseResp(int sockfd, at_inet_t* dest, int xo, u_short tid, u_char connID);
|
||||
static int papSendRequest(int sockfd, at_inet_t* dest, u_char connID, int function, u_char bitmap, int xo, int seqno);
|
||||
static int papCancelRequest(int sockfd, u_short tid);
|
||||
static void sidechannel_request();
|
||||
static void statusUpdate(char* status, u_char statusLen);
|
||||
static int parseUri(const char* argv0, char* name, char* type, char* zone);
|
||||
static int addPercentEscapes(const char* src, char* dst, int dstMax);
|
||||
static int removePercentEscapes(const char* src, char* dst, int dstMax);
|
||||
static int nbptuple_compare(const void *p1, const void *p2);
|
||||
static int okayToUseAppleTalk(void);
|
||||
static const char *packet_name(u_char x);
|
||||
static int connectTimeout(void);
|
||||
static void signalHandler(int sigraised);
|
||||
|
||||
@@ -207,13 +199,10 @@ int main (int argc, const char * argv[])
|
||||
|
||||
if (argc == 1 || (argc == 2 && strcmp(argv[1], "-discover") == 0))
|
||||
{
|
||||
/* If listDevices() didn't find any devices or returns an error output a
|
||||
* legacy style announcement.
|
||||
*
|
||||
/* Ignore errors returned by listDevices - they may be transitory
|
||||
* and we don't want cupsd to think that pap is forever unusable.
|
||||
*/
|
||||
if (listDevices() <= 0)
|
||||
puts("network pap \"Unknown\" \"AppleTalk Printer Access Protocol (pap)\"");
|
||||
|
||||
listDevices();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -242,9 +231,7 @@ int main (int argc, const char * argv[])
|
||||
/* Try to open the print file... */
|
||||
if ((fp = fopen(argv[6], "rb")) == NULL)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open print file \"%s\": %s\n"),
|
||||
argv[6], strerror(errno));
|
||||
fprintf(stderr, "ERROR: unable to open print file \"%s\": %s\n", argv[6], strerror(errno));
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -252,9 +239,9 @@ int main (int argc, const char * argv[])
|
||||
}
|
||||
|
||||
/* Extract the device name and options from the URI... */
|
||||
parseUri(cupsBackendDeviceURI((char **)argv), name, type, zone);
|
||||
parseUri(argv[0], name, type, zone);
|
||||
|
||||
err = printFile(name, type, zone, fileno(fp), STDOUT_FILENO, STDERR_FILENO, copies, argc);
|
||||
err = printFile(name, type, zone, fileno(fp), 3, STDERR_FILENO, copies, argc);
|
||||
|
||||
if (fp != stdin)
|
||||
fclose(fp);
|
||||
@@ -276,7 +263,7 @@ int main (int argc, const char * argv[])
|
||||
static int listDevices(void)
|
||||
{
|
||||
int err = noErr;
|
||||
int i;
|
||||
int ind;
|
||||
int numberFound;
|
||||
|
||||
at_nvestr_t at_zone;
|
||||
@@ -300,13 +287,10 @@ static int listDevices(void)
|
||||
perror("ERROR: Unable to get default AppleTalk zone");
|
||||
return -2;
|
||||
}
|
||||
|
||||
memcpy(zone, at_zone.str, MIN(at_zone.len, sizeof(zone)-1));
|
||||
zone[MIN(at_zone.len, sizeof(zone)-1)] = '\0';
|
||||
|
||||
fprintf(stderr, "INFO: Using default AppleTalk zone \"%s\"\n", zone);
|
||||
|
||||
addPercentEscapes(zone, encodedZone, sizeof(encodedZone));
|
||||
err = addPercentEscapes(zone, encodedZone, sizeof(encodedZone));
|
||||
|
||||
/* Look up all the printers in our zone */
|
||||
nbp_make_entity(&entity, "=", "LaserWriter", zone);
|
||||
@@ -326,10 +310,10 @@ static int listDevices(void)
|
||||
/* Not required but sort them so they look nice */
|
||||
qsort(buf, numberFound, sizeof(at_nbptuple_t), nbptuple_compare);
|
||||
|
||||
for (i = 0; i < numberFound; i++)
|
||||
for (ind = 0; ind < numberFound; ind++)
|
||||
{
|
||||
memcpy(name, buf[i].enu_entity.object.str, MIN(buf[i].enu_entity.object.len, sizeof(name)-1));
|
||||
name[MIN(buf[i].enu_entity.object.len, sizeof(name)-1)] = '\0';
|
||||
memcpy(name, buf[ind].enu_entity.object.str, MIN(buf[ind].enu_entity.object.len, sizeof(name)-1));
|
||||
name[MIN(buf[ind].enu_entity.object.len, sizeof(name)-1)] = '\0';
|
||||
|
||||
if (addPercentEscapes(name, encodedName, sizeof(encodedName)) == 0)
|
||||
{
|
||||
@@ -387,7 +371,7 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in
|
||||
int err;
|
||||
int rc;
|
||||
int val;
|
||||
int len, i;
|
||||
int len, ind;
|
||||
|
||||
char fileBuffer[4096]; /* File buffer */
|
||||
int fileBufferNbytes;
|
||||
@@ -398,7 +382,6 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in
|
||||
char sockBuffer[4096 + 1]; /* Socket buffer with room for nul */
|
||||
char atpReqBuf[AT_PAP_DATA_SIZE];
|
||||
fd_set readSet;
|
||||
int use_sidechannel; /* Use side channel? */
|
||||
|
||||
at_nbptuple_t tuple;
|
||||
at_inet_t sendDataAddr;
|
||||
@@ -407,40 +390,25 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in
|
||||
int userdata, xo, reqlen;
|
||||
u_short tid;
|
||||
u_char bitmap;
|
||||
int maxfdp1,
|
||||
nbp_failures = 0;
|
||||
int maxfdp1;
|
||||
struct timeval timeout, *timeoutPtr;
|
||||
u_char flowQuantum = 1;
|
||||
u_short recvSequence = 0;
|
||||
time_t now,
|
||||
start_time,
|
||||
connect_time,
|
||||
elasped_time,
|
||||
sleep_time,
|
||||
connect_timeout = -1,
|
||||
nextStatusTime = 0;
|
||||
at_entity_t entity;
|
||||
at_retry_t retry;
|
||||
Boolean recoverableErrShown = false;
|
||||
|
||||
|
||||
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
struct sigaction action; /* Actions for POSIX signals */
|
||||
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
|
||||
|
||||
/*
|
||||
* Test the side channel descriptor before calling papOpen() since it may open
|
||||
* an unused fd 4 (a.k.a. CUPS_SC_FD)...
|
||||
*/
|
||||
|
||||
FD_ZERO(&readSet);
|
||||
FD_SET(CUPS_SC_FD, &readSet);
|
||||
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_usec = 0;
|
||||
|
||||
if ((select(CUPS_SC_FD+1, &readSet, NULL, NULL, &timeout)) >= 0)
|
||||
use_sidechannel = 1;
|
||||
else
|
||||
use_sidechannel = 0;
|
||||
|
||||
/* try to find our printer */
|
||||
if ((err = nbp_make_entity(&entity, name, type, zone)) != noErr)
|
||||
{
|
||||
@@ -452,60 +420,51 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in
|
||||
* Remember when we started looking for the printer.
|
||||
*/
|
||||
|
||||
start_time = time(NULL);
|
||||
connect_time = time(NULL);
|
||||
|
||||
retry.interval = 1;
|
||||
retry.retries = 5;
|
||||
retry.backoff = 0;
|
||||
|
||||
fprintf(stderr, "STATE: +connecting-to-device\n");
|
||||
|
||||
/* Loop forever trying to get an open session with the printer. */
|
||||
for (;;)
|
||||
{
|
||||
/* Make sure it's okay to use appletalk */
|
||||
if (okayToUseAppleTalk())
|
||||
{
|
||||
/* Clear this printer-state-reason in case we've set it */
|
||||
fprintf(stderr, "STATE: -apple-appletalk-disabled-warning\n");
|
||||
|
||||
/* Resolve the name into an address. Returns the number found or an error */
|
||||
if ((err = nbp_lookup(&entity, &tuple, 1, &retry)) > 0)
|
||||
{
|
||||
if (err > 1)
|
||||
fprintf(stderr, "DEBUG: Found more than one printer with the name \"%s\"\n", name);
|
||||
|
||||
if (nbp_failures)
|
||||
{
|
||||
fprintf(stderr, "STATE: -apple-nbp-lookup-warning\n");
|
||||
nbp_failures = 0;
|
||||
if (recoverableErrShown)
|
||||
{
|
||||
fprintf(stderr, "INFO: recovered: \n");
|
||||
sleep(5);
|
||||
recoverableErrShown = false;
|
||||
}
|
||||
|
||||
/* Open a connection to the device */
|
||||
if ((err = papOpen(&tuple, &gConnID, &gSockfd, &gSessionAddr, &flowQuantum)) == 0)
|
||||
break;
|
||||
|
||||
fprintf(stderr, "WARNING: Unable to open \"%s:%s\": %s\n", name, zone, strerror(err));
|
||||
fprintf(stderr, "WARNING: Unable to open \"%s:%s\": %s\n", name, zone, strerror(errno));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* It's not unusual to have to call nbp_lookup() twice before it's sucessful... */
|
||||
if (++nbp_failures > 2)
|
||||
{
|
||||
retry.interval = 2;
|
||||
retry.retries = 3;
|
||||
fprintf(stderr, "STATE: +apple-nbp-lookup-warning\n");
|
||||
fprintf(stderr, "WARNING: Printer not responding\n");
|
||||
}
|
||||
fprintf(stderr, "WARNING: recoverable: Printer not responding\n");
|
||||
recoverableErrShown = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "STATE: +apple-appletalk-disabled-warning\n");
|
||||
fprintf(stderr, "INFO: AppleTalk disabled in System Preferences.\n");
|
||||
fprintf(stderr, "WARNING: recoverable: AppleTalk disabled in System Preferences.\n");
|
||||
recoverableErrShown = true;
|
||||
}
|
||||
|
||||
elasped_time = time(NULL) - start_time;
|
||||
retry.retries = 3;
|
||||
elasped_time = time(NULL) - connect_time;
|
||||
|
||||
if (connect_timeout == -1)
|
||||
connect_timeout = connectTimeout();
|
||||
@@ -516,9 +475,9 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in
|
||||
err = ETIMEDOUT;
|
||||
goto Exit; /* Waiting too long... */
|
||||
}
|
||||
else if (elasped_time < (30 * 60))
|
||||
else if (elasped_time < 30 /*(30 * 60)*/)
|
||||
sleep_time = 10; /* Waiting < 30 minutes */
|
||||
else if (elasped_time < (24 * 60 * 60))
|
||||
else if (elasped_time < 60 /*(24 * 60 * 60)*/)
|
||||
sleep_time = 30; /* Waiting < 24 hours */
|
||||
else
|
||||
sleep_time = 60; /* Waiting > 24 hours */
|
||||
@@ -527,8 +486,6 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in
|
||||
sleep(sleep_time);
|
||||
}
|
||||
|
||||
fprintf(stderr, "STATE: -connecting-to-device\n");
|
||||
|
||||
/*
|
||||
* Now that we are connected to the printer ignore SIGTERM so that we
|
||||
* can finish out any page data the driver sends (e.g. to eject the
|
||||
@@ -579,15 +536,26 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in
|
||||
val = fcntl(fdin, F_GETFL, 0);
|
||||
fcntl(fdin, F_SETFL, val | O_NONBLOCK);
|
||||
|
||||
/* Set non-blocking mode on our data destination descriptor */
|
||||
val = fcntl(fdout, F_GETFL, 0);
|
||||
if (val < 0)
|
||||
{
|
||||
/*
|
||||
* Map output to stdout if we don't have the backchannel pipe
|
||||
* available on file descriptor 3...
|
||||
*/
|
||||
|
||||
if (fdout == 3 && errno == EBADF)
|
||||
fdout = 1;
|
||||
}
|
||||
else
|
||||
fcntl(fdout, F_SETFL, val | O_NONBLOCK);
|
||||
|
||||
fileBufferNbytes = 0;
|
||||
fileTbytes = 0;
|
||||
fileEOFRead = fileEOFSent = false;
|
||||
|
||||
maxfdp1 = MAX(fdin, gSockfd) + 1;
|
||||
|
||||
if (use_sidechannel && CUPS_SC_FD >= maxfdp1)
|
||||
maxfdp1 = CUPS_SC_FD + 1;
|
||||
|
||||
if (gStatusInterval != 0)
|
||||
{
|
||||
timeout.tv_usec = 0;
|
||||
@@ -607,9 +575,6 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in
|
||||
if (fileBufferNbytes == 0 && fileEOFRead == false)
|
||||
FD_SET(fdin, &readSet);
|
||||
|
||||
if (use_sidechannel)
|
||||
FD_SET(CUPS_SC_FD, &readSet);
|
||||
|
||||
/* Set the select timeout value based on the next status interval */
|
||||
if (gStatusInterval != 0)
|
||||
{
|
||||
@@ -634,13 +599,6 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in
|
||||
nextStatusTime = time(NULL) + gStatusInterval;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if we have a side-channel request ready...
|
||||
*/
|
||||
|
||||
if (use_sidechannel && FD_ISSET(CUPS_SC_FD, &readSet))
|
||||
sidechannel_request();
|
||||
|
||||
/* Was there an event on the input stream? */
|
||||
if (FD_ISSET(fdin, &readSet))
|
||||
{
|
||||
@@ -708,7 +666,7 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: <- %s\n", packet_name(TYPE_OF(userdata)));
|
||||
fprintf(stderr, "DEBUG: <- %s\n", PAPPacketStr(TYPE_OF(userdata)));
|
||||
|
||||
switch (TYPE_OF(userdata))
|
||||
{
|
||||
@@ -749,10 +707,10 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in
|
||||
break;
|
||||
|
||||
case AT_PAP_TYPE_DATA: /* Data packet */
|
||||
for (len=0, i=0; i < ATP_TRESP_MAX; i++)
|
||||
for (len=0, ind=0; ind < ATP_TRESP_MAX; ind++)
|
||||
{
|
||||
if (resp.bitmap & (1 << i))
|
||||
len += resp.resp[i].iov_len;
|
||||
if (resp.bitmap & (1 << ind))
|
||||
len += resp.resp[ind].iov_len;
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: <- PAP_DATA %d bytes %s\n", len, IS_PAP_EOF(userdata) ? "with EOF" : "");
|
||||
@@ -764,7 +722,7 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in
|
||||
char logstr[512];
|
||||
int logstrlen;
|
||||
|
||||
cupsBackChannelWrite(sockBuffer, len, 1.0);
|
||||
write(fdout, sockBuffer, len);
|
||||
|
||||
sockBuffer[len] = '\0'; /* We always reserve room for the nul so we can use strstr() below*/
|
||||
pLineBegin = sockBuffer;
|
||||
@@ -877,7 +835,7 @@ Exit:
|
||||
/*
|
||||
* Close the socket and return...
|
||||
*/
|
||||
papClose();
|
||||
papClose(false);
|
||||
|
||||
return err;
|
||||
}
|
||||
@@ -896,35 +854,37 @@ Exit:
|
||||
*
|
||||
* @result A non-zero return value for errors
|
||||
*/
|
||||
static int papOpen(at_nbptuple_t* tuple, u_char* connID, int* fd,
|
||||
at_inet_t* sessionAddr, u_char* flowQuantum)
|
||||
static int papOpen(at_nbptuple_t* tuple, u_char* connID, int* fd, at_inet_t* sessionAddr, u_char* flowQuantum)
|
||||
{
|
||||
int result,
|
||||
open_result,
|
||||
userdata,
|
||||
atp_err;
|
||||
time_t tm,
|
||||
waitTime;
|
||||
char data[10],
|
||||
rdata[ATP_DATA_SIZE];
|
||||
u_char *puserdata;
|
||||
at_socket socketfd;
|
||||
openResult;
|
||||
long tm;
|
||||
char data[10], rdata[ATP_DATA_SIZE];
|
||||
int userdata;
|
||||
u_char *puserdata = (u_char *)&userdata;
|
||||
at_socket sock = 0;
|
||||
u_short waitTime;
|
||||
int status;
|
||||
at_resp_t resp;
|
||||
at_retry_t retry;
|
||||
|
||||
result = 0;
|
||||
socketfd = 0;
|
||||
puserdata = (u_char *)&userdata;
|
||||
if (tuple == NULL)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
fprintf(stderr, "INFO: Opening connection\n");
|
||||
|
||||
if ((*fd = atp_open(&socketfd)) < 0)
|
||||
errno = 0;
|
||||
result = 0;
|
||||
|
||||
*fd = atp_open(&sock);
|
||||
if (*fd < 0)
|
||||
return -1;
|
||||
|
||||
/*
|
||||
* Build the open connection request packet.
|
||||
/* Build the open connection request packet.
|
||||
*/
|
||||
|
||||
tm = time(NULL);
|
||||
srand(tm);
|
||||
|
||||
@@ -941,67 +901,64 @@ static int papOpen(at_nbptuple_t* tuple, u_char* connID, int* fd,
|
||||
resp.resp[0].iov_base = rdata;
|
||||
resp.resp[0].iov_len = sizeof(rdata);
|
||||
|
||||
data[0] = socketfd;
|
||||
data[0] = sock;
|
||||
data[1] = 8;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
waitTime = time(NULL) - tm;
|
||||
OSWriteBigInt16(&data[2], 0, (u_short)waitTime);
|
||||
waitTime = (u_short)(time(NULL) - tm);
|
||||
OSWriteBigInt16(&data[2], 0, waitTime);
|
||||
|
||||
fprintf(stderr, "DEBUG: -> %s\n", packet_name(AT_PAP_TYPE_OPEN_CONN));
|
||||
fprintf(stderr, "DEBUG: -> %s\n", PAPPacketStr(AT_PAP_TYPE_OPEN_CONN));
|
||||
|
||||
if ((atp_err = atp_sendreq(*fd, &tuple->enu_addr, data, 4, userdata, 1, 0,
|
||||
0, &resp, &retry, 0)) < 0)
|
||||
status = atp_sendreq(*fd, &tuple->enu_addr, data, 4, userdata, 1, 0, 0, &resp, &retry, 0);
|
||||
|
||||
if (status < 0)
|
||||
{
|
||||
statusUpdate("Destination unreachable", 23);
|
||||
result = EHOSTUNREACH;
|
||||
break;
|
||||
errno = EHOSTUNREACH;
|
||||
sleep(1);
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
puserdata = (u_char *)&resp.userdata[0];
|
||||
open_result = OSReadBigInt16(&rdata[2], 0);
|
||||
|
||||
fprintf(stderr, "DEBUG: <- %s, status %d\n", packet_name(puserdata[1]),
|
||||
open_result);
|
||||
|
||||
/*
|
||||
* Just for the sake of our sanity check the other fields in the packet
|
||||
*/
|
||||
|
||||
if (puserdata[1] != AT_PAP_TYPE_OPEN_CONN_REPLY ||
|
||||
(open_result == 0 && (puserdata[0] & 0xff) != *connID))
|
||||
else
|
||||
{
|
||||
result = EINVAL;
|
||||
break;
|
||||
puserdata = (u_char *)&resp.userdata[0];
|
||||
openResult = OSReadBigInt16(&rdata[2], 0);
|
||||
|
||||
fprintf(stderr, "DEBUG: <- %s, status %d\n", PAPPacketStr(puserdata[1]), openResult);
|
||||
|
||||
/* Just for the sake of our sanity check the other fields in the packet
|
||||
*/
|
||||
if (puserdata[1] != AT_PAP_TYPE_OPEN_CONN_REPLY ||
|
||||
(openResult == 0 && (puserdata[0] & 0xff) != *connID))
|
||||
{
|
||||
result = EINVAL;
|
||||
errno = EINVAL;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
statusUpdate(&rdata[5], rdata[4] & 0xff);
|
||||
|
||||
if (openResult == 0)
|
||||
break; /* Connection established okay, exit from the loop */
|
||||
}
|
||||
|
||||
statusUpdate(&rdata[5], rdata[4] & 0xff);
|
||||
|
||||
/*
|
||||
* if the connection established okay exit from the loop
|
||||
*/
|
||||
|
||||
if (open_result == 0)
|
||||
break;
|
||||
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
if (result == 0)
|
||||
{
|
||||
/* Update the session address
|
||||
*/
|
||||
sessionAddr->net = tuple->enu_addr.net;
|
||||
sessionAddr->node = tuple->enu_addr.node;
|
||||
sessionAddr->socket = rdata[0];
|
||||
*flowQuantum = rdata[1];
|
||||
}
|
||||
else
|
||||
/* Update the session address
|
||||
*/
|
||||
sessionAddr->net = tuple->enu_addr.net;
|
||||
sessionAddr->node = tuple->enu_addr.node;
|
||||
sessionAddr->socket = rdata[0];
|
||||
*flowQuantum = rdata[1];
|
||||
|
||||
Exit:
|
||||
if (result != 0)
|
||||
{
|
||||
atp_close(*fd);
|
||||
*fd = 0;
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -1013,9 +970,12 @@ static int papOpen(at_nbptuple_t* tuple, u_char* connID, int* fd,
|
||||
* @abstract End a PAP session by canceling outstanding send-data & tickle
|
||||
* transactions and sending a PAP close request.
|
||||
*
|
||||
* @param abort If we're aborting then send the close request
|
||||
* with 0 retries (not yet implemented)
|
||||
*
|
||||
* @result A non-zero return value for errors
|
||||
*/
|
||||
static int papClose()
|
||||
static int papClose(int abortflag)
|
||||
{
|
||||
int fd;
|
||||
u_short tmpID;
|
||||
@@ -1058,7 +1018,7 @@ static int papClose()
|
||||
if (gWaitEOF == false)
|
||||
sleep(2);
|
||||
|
||||
fprintf(stderr, "DEBUG: -> %s\n", packet_name(AT_PAP_TYPE_CLOSE_CONN));
|
||||
fprintf(stderr, "DEBUG: -> %s\n", PAPPacketStr(AT_PAP_TYPE_CLOSE_CONN));
|
||||
|
||||
puserdata[0] = gConnID;
|
||||
puserdata[1] = AT_PAP_TYPE_CLOSE_CONN;
|
||||
@@ -1098,7 +1058,7 @@ static int papClose()
|
||||
static int papWrite(int sockfd, at_inet_t* dest, u_short tid, u_char connID, u_char flowQuantum, char* data, int len, int eof)
|
||||
{
|
||||
int result;
|
||||
int i;
|
||||
int ind;
|
||||
u_char* puserdata;
|
||||
at_resp_t resp;
|
||||
|
||||
@@ -1116,26 +1076,26 @@ static int papWrite(int sockfd, at_inet_t* dest, u_short tid, u_char connID, u_c
|
||||
* response packets to reply to an incoming
|
||||
* PAP 'SENDDATA' request
|
||||
*/
|
||||
for (i = 0; i < flowQuantum; i++)
|
||||
for (ind = 0; ind < flowQuantum; ind++)
|
||||
{
|
||||
resp.userdata[i] = 0;
|
||||
puserdata = (u_char *)&resp.userdata[i];
|
||||
resp.userdata[ind] = 0;
|
||||
puserdata = (u_char *)&resp.userdata[ind];
|
||||
|
||||
puserdata[PAP_CONNID] = connID;
|
||||
puserdata[PAP_TYPE] = AT_PAP_TYPE_DATA;
|
||||
puserdata[PAP_EOF] = eof ? 1 : 0;
|
||||
|
||||
resp.resp[i].iov_base = (caddr_t)data;
|
||||
resp.resp[ind].iov_base = (caddr_t)data;
|
||||
|
||||
if (data)
|
||||
data += AT_PAP_DATA_SIZE;
|
||||
|
||||
resp.resp[i].iov_len = MIN((int)len, (int)AT_PAP_DATA_SIZE);
|
||||
len -= resp.resp[i].iov_len;
|
||||
resp.resp[ind].iov_len = MIN((int)len, (int)AT_PAP_DATA_SIZE);
|
||||
len -= resp.resp[ind].iov_len;
|
||||
if (len == 0)
|
||||
break;
|
||||
}
|
||||
resp.bitmap = (1 << (i + 1)) - 1;
|
||||
resp.bitmap = (1 << (ind + 1)) - 1;
|
||||
|
||||
/*
|
||||
* Write out the data as a PAP 'DATA' response
|
||||
@@ -1208,7 +1168,7 @@ static int papSendRequest(int sockfd, at_inet_t* dest, u_char connID, int functi
|
||||
at_resp_t resp;
|
||||
static u_short pap_send_count = 0;
|
||||
|
||||
fprintf(stderr, "DEBUG: -> %s\n", packet_name(function));
|
||||
fprintf(stderr, "DEBUG: -> %s\n", PAPPacketStr(function));
|
||||
|
||||
puserdata[0] = connID;
|
||||
puserdata[1] = function;
|
||||
@@ -1266,50 +1226,6 @@ int papCancelRequest(int sockfd, u_short tid)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'sidechannel_request()' - Handle side-channel requests.
|
||||
*/
|
||||
|
||||
static void
|
||||
sidechannel_request()
|
||||
{
|
||||
cups_sc_command_t command; /* Request command */
|
||||
cups_sc_status_t status; /* Request/response status */
|
||||
char data[2048]; /* Request/response data */
|
||||
int datalen; /* Request/response data size */
|
||||
|
||||
datalen = sizeof(data);
|
||||
|
||||
if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0))
|
||||
{
|
||||
fputs(_("WARNING: Failed to read side-channel request!\n"), stderr);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (command)
|
||||
{
|
||||
case CUPS_SC_CMD_GET_BIDI: /* Is the connection bidirectional? */
|
||||
data[0] = 1;
|
||||
cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, data, 1, 1.0);
|
||||
break;
|
||||
|
||||
case CUPS_SC_CMD_GET_STATE: /* Return device state */
|
||||
data[0] = CUPS_SC_STATE_ONLINE;
|
||||
cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, data, 1, 1.0);
|
||||
break;
|
||||
|
||||
case CUPS_SC_CMD_DRAIN_OUTPUT: /* Drain all pending output */
|
||||
case CUPS_SC_CMD_SOFT_RESET: /* Do a soft reset */
|
||||
case CUPS_SC_CMD_GET_DEVICE_ID: /* Return IEEE-1284 device ID */
|
||||
default:
|
||||
cupsSideChannelWrite(command, CUPS_SC_STATUS_NOT_IMPLEMENTED,
|
||||
NULL, 0, 1.0);
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
/*!
|
||||
* @function statusUpdate
|
||||
@@ -1358,26 +1274,24 @@ void statusUpdate(char* status, u_char statusLen)
|
||||
*/
|
||||
static int parseUri(const char* argv0, char* name, char* type, char* zone)
|
||||
{
|
||||
char method[255], /* Method in URI */
|
||||
char scheme[255], /* Scheme in URI */
|
||||
hostname[1024], /* Hostname */
|
||||
username[255], /* Username info (not used) */
|
||||
resource[1024], /* Resource info (device and options) */
|
||||
*resourcePtr,
|
||||
*typePtr,
|
||||
*options, /* Pointer to options */
|
||||
*optionName, /* Name of option */
|
||||
*value, /* Value of option */
|
||||
sep; /* Separator character */
|
||||
optionName[255], /* Name of option */
|
||||
value[255], /* Value of option */
|
||||
*ptr; /* Pointer into name or value */
|
||||
int port; /* Port number (not used) */
|
||||
int statusInterval; /* */
|
||||
|
||||
/*
|
||||
* Extract the device name and options from the URI...
|
||||
*/
|
||||
method[0] = username[0] = hostname[0] = resource[0] = '\0';
|
||||
port = 0;
|
||||
|
||||
httpSeparateURI(HTTP_URI_CODING_NONE, argv0, method, sizeof(method),
|
||||
httpSeparateURI(HTTP_URI_CODING_NONE, argv0, scheme, sizeof(scheme),
|
||||
username, sizeof(username),
|
||||
hostname, sizeof(hostname), &port,
|
||||
resource, sizeof(resource));
|
||||
@@ -1395,54 +1309,53 @@ static int parseUri(const char* argv0, char* name, char* type, char* zone)
|
||||
|
||||
while (*options != '\0')
|
||||
{
|
||||
/*
|
||||
/*
|
||||
* Get the name...
|
||||
*/
|
||||
for (ptr = optionName; *options && *options != '=' && *options != '+'; )
|
||||
*ptr++ = *options++;
|
||||
|
||||
optionName = options;
|
||||
*ptr = '\0';
|
||||
value[0] = '\0';
|
||||
|
||||
while (*options && *options != '=' && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
if ((sep = *options) != '\0')
|
||||
*options++ = '\0';
|
||||
|
||||
if (sep == '=')
|
||||
if (*options == '=')
|
||||
{
|
||||
/*
|
||||
/*
|
||||
* Get the value...
|
||||
*/
|
||||
*/
|
||||
|
||||
options ++;
|
||||
|
||||
for (ptr = value; *options && *options != '+';)
|
||||
*ptr++ = *options++;
|
||||
|
||||
value = options;
|
||||
|
||||
while (*options && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
if (*options)
|
||||
*options++ = '\0';
|
||||
*ptr = '\0';
|
||||
|
||||
if (*options == '+')
|
||||
options ++;
|
||||
}
|
||||
else if (*options == '+')
|
||||
{
|
||||
options ++;
|
||||
}
|
||||
else
|
||||
value = (char *)"";
|
||||
|
||||
/*
|
||||
/*
|
||||
* Process the option...
|
||||
*/
|
||||
|
||||
if (!strcasecmp(optionName, "waiteof"))
|
||||
if (strcasecmp(optionName, "waiteof") == 0)
|
||||
{
|
||||
/*
|
||||
* Wait for the end of the print file?
|
||||
/*
|
||||
* Set the banner...
|
||||
*/
|
||||
|
||||
if (!strcasecmp(value, "on") ||
|
||||
!strcasecmp(value, "yes") ||
|
||||
!strcasecmp(value, "true"))
|
||||
if (strcasecmp(value, "on") == 0 ||
|
||||
strcasecmp(value, "yes") == 0 ||
|
||||
strcasecmp(value, "true") == 0)
|
||||
{
|
||||
gWaitEOF = true;
|
||||
}
|
||||
else if (!strcasecmp(value, "off") ||
|
||||
!strcasecmp(value, "no") ||
|
||||
!strcasecmp(value, "false"))
|
||||
else if (strcasecmp(value, "off") == 0 ||
|
||||
strcasecmp(value, "no") == 0 ||
|
||||
strcasecmp(value, "false") == 0)
|
||||
{
|
||||
gWaitEOF = false;
|
||||
}
|
||||
@@ -1451,17 +1364,13 @@ static int parseUri(const char* argv0, char* name, char* type, char* zone)
|
||||
fprintf(stderr, "WARNING: Boolean expected for waiteof option \"%s\"\n", value);
|
||||
}
|
||||
}
|
||||
else if (!strcasecmp(optionName, "status"))
|
||||
else if (strcasecmp(optionName, "status") == 0)
|
||||
{
|
||||
/*
|
||||
* Set status reporting interval...
|
||||
*/
|
||||
|
||||
statusInterval = atoi(value);
|
||||
if (value[0] < '0' || value[0] > '9' || statusInterval < 0)
|
||||
if (value[0] < '0' || value[0] > '9' ||
|
||||
statusInterval < 0)
|
||||
{
|
||||
fprintf(stderr, "WARNING: number expected for status option \"%s\"\n",
|
||||
value);
|
||||
fprintf(stderr, "WARNING: number expected for status option \"%s\"\n", value);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1476,24 +1385,20 @@ static int parseUri(const char* argv0, char* name, char* type, char* zone)
|
||||
if (*resourcePtr == '/')
|
||||
resourcePtr++;
|
||||
|
||||
/* If the resource has a slash we assume the slash seperates the AppleTalk object
|
||||
* name from the AppleTalk type. If the slash is not present we assume the AppleTalk
|
||||
* type is LaserWriter.
|
||||
*/
|
||||
/* If the resource has a slash we assume the slash seperates the AppleTalk object
|
||||
* name from the AppleTalk type. If the slash is not present we assume the AppleTalk
|
||||
* type is LaserWriter.
|
||||
*/
|
||||
typePtr = strchr(resourcePtr, '/');
|
||||
if (typePtr != NULL) {
|
||||
*typePtr++ = '\0';
|
||||
} else {
|
||||
typePtr = "LaserWriter";
|
||||
}
|
||||
|
||||
typePtr = strchr(resourcePtr, '/');
|
||||
if (typePtr != NULL)
|
||||
{
|
||||
*typePtr++ = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
typePtr = "LaserWriter";
|
||||
}
|
||||
|
||||
removePercentEscapes(hostname, zone, NBP_NVE_STR_SIZE + 1);
|
||||
removePercentEscapes(resourcePtr, name, NBP_NVE_STR_SIZE + 1);
|
||||
removePercentEscapes(typePtr, type, NBP_NVE_STR_SIZE + 1);
|
||||
removePercentEscapes(hostname, zone, NBP_NVE_STR_SIZE + 1);
|
||||
removePercentEscapes(resourcePtr, name, NBP_NVE_STR_SIZE + 1);
|
||||
removePercentEscapes(typePtr, type, NBP_NVE_STR_SIZE + 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1622,31 +1527,6 @@ static int okayToUseAppleTalk()
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* @function packet_name
|
||||
* @abstract Returns packet name string.
|
||||
*
|
||||
* @result A string
|
||||
*/
|
||||
static const char *packet_name(u_char x)
|
||||
{
|
||||
switch (x)
|
||||
{
|
||||
case AT_PAP_TYPE_OPEN_CONN: return "PAP_OPEN_CONN";
|
||||
case AT_PAP_TYPE_OPEN_CONN_REPLY: return "PAP_OPEN_CONN_REPLY";
|
||||
case AT_PAP_TYPE_SEND_DATA: return "PAP_SEND_DATA";
|
||||
case AT_PAP_TYPE_DATA: return "PAP_DATA";
|
||||
case AT_PAP_TYPE_TICKLE: return "PAP_TICKLE";
|
||||
case AT_PAP_TYPE_CLOSE_CONN: return "PAP_CLOSE_CONN";
|
||||
case AT_PAP_TYPE_CLOSE_CONN_REPLY: return "PAP_CLOSE_CONN_REPLY";
|
||||
case AT_PAP_TYPE_SEND_STATUS: return "PAP_SEND_STATUS";
|
||||
case AT_PAP_TYPE_SEND_STS_REPLY: return "PAP_SEND_STS_REPLY";
|
||||
case AT_PAP_TYPE_READ_LW: return "PAP_READ_LW";
|
||||
}
|
||||
return "<Unknown>";
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* @function connectTimeout
|
||||
* @abstract Returns the connect timeout preference value.
|
||||
@@ -1682,7 +1562,7 @@ static void signalHandler(int sigraised)
|
||||
{
|
||||
fprintf(stderr, "ERROR: There was a timeout error while sending data to the printer\n");
|
||||
|
||||
papClose();
|
||||
papClose(true);
|
||||
|
||||
_exit(1);
|
||||
}
|
||||
|
||||
+31
-120
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* Parallel port backend for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
@@ -18,7 +27,6 @@
|
||||
*
|
||||
* main() - Send a file to the specified parallel port.
|
||||
* list_devices() - List all parallel devices.
|
||||
* side_cb() - Handle side-channel requests...
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -58,8 +66,7 @@
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static void list_devices(void);
|
||||
static void side_cb(int print_fd, int device_fd, int use_bc);
|
||||
void list_devices(void);
|
||||
|
||||
|
||||
/*
|
||||
@@ -81,8 +88,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
*options; /* Pointer to options */
|
||||
int port; /* Port number (not used) */
|
||||
int print_fd, /* Print file */
|
||||
device_fd, /* Parallel device */
|
||||
use_bc; /* Read back-channel data? */
|
||||
device_fd; /* Parallel device */
|
||||
int copies; /* Number of copies to print */
|
||||
size_t tbytes; /* Total number of bytes written */
|
||||
struct termios opts; /* Parallel port options */
|
||||
@@ -122,9 +128,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
fputs("Usage: parallel job-id user title copies options [file]\n", stderr);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -184,26 +188,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
do
|
||||
{
|
||||
#if defined(__linux) || defined(__FreeBSD__)
|
||||
/*
|
||||
* The Linux and FreeBSD parallel port drivers currently are broken WRT
|
||||
* select() and bidirection I/O...
|
||||
*/
|
||||
|
||||
device_fd = open(resource, O_WRONLY | O_EXCL);
|
||||
use_bc = 0;
|
||||
|
||||
#else
|
||||
if ((device_fd = open(resource, O_RDWR | O_EXCL)) < 0)
|
||||
{
|
||||
device_fd = open(resource, O_WRONLY | O_EXCL);
|
||||
use_bc = 0;
|
||||
}
|
||||
else
|
||||
use_bc = 1;
|
||||
#endif /* __linux || __FreeBSD__ */
|
||||
|
||||
if (device_fd == -1)
|
||||
if ((device_fd = open(resource, O_WRONLY | O_EXCL)) == -1)
|
||||
{
|
||||
if (getenv("CLASS") != NULL)
|
||||
{
|
||||
@@ -214,9 +199,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
fputs("INFO: Unable to open parallel port, queuing on next printer "
|
||||
"in class...\n", stderr);
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -229,22 +213,21 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if (errno == EBUSY)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 30 seconds...\n"));
|
||||
fputs("INFO: Parallel port busy; will retry in 30 seconds...\n",
|
||||
stderr);
|
||||
sleep(30);
|
||||
}
|
||||
else if (errno == ENXIO || errno == EIO || errno == ENOENT)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer not connected; will retry in 30 "
|
||||
"seconds...\n"));
|
||||
fputs("INFO: Printer not connected; will retry in 30 seconds...\n",
|
||||
stderr);
|
||||
sleep(30);
|
||||
}
|
||||
else
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
fprintf(stderr,
|
||||
"ERROR: Unable to open parallel port device file \"%s\": %s\n",
|
||||
resource, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
@@ -281,16 +264,11 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
lseek(print_fd, 0, SEEK_SET);
|
||||
}
|
||||
|
||||
tbytes = backendRunLoop(print_fd, device_fd, use_bc, side_cb);
|
||||
tbytes = backendRunLoop(print_fd, device_fd, 1);
|
||||
|
||||
if (print_fd != 0 && tbytes >= 0)
|
||||
_cupsLangPrintf(stderr,
|
||||
#ifdef HAVE_LONG_LONG
|
||||
_("INFO: Sent print file, %lld bytes...\n"),
|
||||
#else
|
||||
_("INFO: Sent print file, %ld bytes...\n"),
|
||||
#endif /* HAVE_LONG_LONG */
|
||||
CUPS_LLCAST tbytes);
|
||||
fprintf(stderr, "INFO: Sent print file, " CUPS_LLFMT " bytes...\n",
|
||||
CUPS_LLCAST tbytes);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -310,7 +288,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* 'list_devices()' - List all parallel devices.
|
||||
*/
|
||||
|
||||
static void
|
||||
void
|
||||
list_devices(void)
|
||||
{
|
||||
#if defined(__hpux) || defined(__sgi) || defined(__sun)
|
||||
@@ -599,73 +577,6 @@ list_devices(void)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'side_cb()' - Handle side-channel requests...
|
||||
*/
|
||||
|
||||
static void
|
||||
side_cb(int print_fd, /* I - Print file */
|
||||
int device_fd, /* I - Device file */
|
||||
int use_bc) /* I - Using back-channel? */
|
||||
{
|
||||
cups_sc_command_t command; /* Request command */
|
||||
cups_sc_status_t status; /* Request/response status */
|
||||
char data[2048]; /* Request/response data */
|
||||
int datalen; /* Request/response data size */
|
||||
|
||||
|
||||
datalen = sizeof(data);
|
||||
|
||||
if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0))
|
||||
{
|
||||
_cupsLangPuts(stderr, _("WARNING: Failed to read side-channel request!\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
switch (command)
|
||||
{
|
||||
case CUPS_SC_CMD_DRAIN_OUTPUT :
|
||||
if (backendDrainOutput(print_fd, device_fd))
|
||||
status = CUPS_SC_STATUS_IO_ERROR;
|
||||
else if (tcdrain(device_fd))
|
||||
status = CUPS_SC_STATUS_IO_ERROR;
|
||||
else
|
||||
status = CUPS_SC_STATUS_OK;
|
||||
|
||||
datalen = 0;
|
||||
break;
|
||||
|
||||
case CUPS_SC_CMD_GET_BIDI :
|
||||
data[0] = use_bc;
|
||||
datalen = 1;
|
||||
break;
|
||||
|
||||
case CUPS_SC_CMD_GET_DEVICE_ID :
|
||||
memset(data, 0, sizeof(data));
|
||||
|
||||
if (backendGetDeviceID(device_fd, data, sizeof(data) - 1,
|
||||
NULL, 0, NULL, NULL, 0))
|
||||
{
|
||||
status = CUPS_SC_STATUS_NOT_IMPLEMENTED;
|
||||
datalen = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
status = CUPS_SC_STATUS_OK;
|
||||
datalen = strlen(data);
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
status = CUPS_SC_STATUS_NOT_IMPLEMENTED;
|
||||
datalen = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
cupsSideChannelWrite(command, status, data, datalen, 1.0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
|
||||
+33
-149
@@ -1,23 +1,31 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Common run loop APIs for the Common UNIX Printing System (CUPS).
|
||||
* Common run loop API for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 2006 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* backendDrainOutput() - Drain pending print data to the device.
|
||||
* backendRunLoop() - Read and write print and back-channel data.
|
||||
* backendRunLoop() - Read and write print and back-channel data.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -32,119 +40,14 @@
|
||||
#endif /* __hpux */
|
||||
|
||||
|
||||
/*
|
||||
* 'backendDrainOutput()' - Drain pending print data to the device.
|
||||
*/
|
||||
|
||||
int /* O - 0 on success, -1 on error */
|
||||
backendDrainOutput(int print_fd, /* I - Print file descriptor */
|
||||
int device_fd) /* I - Device file descriptor */
|
||||
{
|
||||
int nfds; /* Maximum file descriptor value + 1 */
|
||||
fd_set input; /* Input set for reading */
|
||||
ssize_t print_bytes, /* Print bytes read */
|
||||
bytes; /* Bytes written */
|
||||
char print_buffer[8192], /* Print data buffer */
|
||||
*print_ptr; /* Pointer into print data buffer */
|
||||
struct timeval timeout; /* Timeout for read... */
|
||||
|
||||
|
||||
fprintf(stderr, "DEBUG: backendDrainOutput(print_fd=%d, device_fd=%d)\n",
|
||||
print_fd, device_fd);
|
||||
|
||||
/*
|
||||
* Figure out the maximum file descriptor value to use with select()...
|
||||
*/
|
||||
|
||||
nfds = (print_fd > device_fd ? print_fd : device_fd) + 1;
|
||||
|
||||
/*
|
||||
* Now loop until we are out of data from print_fd...
|
||||
*/
|
||||
|
||||
for (;;)
|
||||
{
|
||||
/*
|
||||
* Use select() to determine whether we have data to copy around...
|
||||
*/
|
||||
|
||||
FD_ZERO(&input);
|
||||
FD_SET(print_fd, &input);
|
||||
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_usec = 0;
|
||||
|
||||
if (select(nfds, &input, NULL, NULL, &timeout) < 0)
|
||||
return (-1);
|
||||
|
||||
if (!FD_ISSET(print_fd, &input))
|
||||
return (0);
|
||||
|
||||
if ((print_bytes = read(print_fd, print_buffer,
|
||||
sizeof(print_buffer))) < 0)
|
||||
{
|
||||
/*
|
||||
* Read error - bail if we don't see EAGAIN or EINTR...
|
||||
*/
|
||||
|
||||
if (errno != EAGAIN || errno != EINTR)
|
||||
{
|
||||
perror("ERROR: Unable to read print data");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
print_bytes = 0;
|
||||
}
|
||||
else if (print_bytes == 0)
|
||||
{
|
||||
/*
|
||||
* End of file, return...
|
||||
*/
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: Read %d bytes of print data...\n",
|
||||
(int)print_bytes);
|
||||
|
||||
for (print_ptr = print_buffer; print_bytes > 0;)
|
||||
{
|
||||
if ((bytes = write(device_fd, print_ptr, print_bytes)) < 0)
|
||||
{
|
||||
/*
|
||||
* Write error - bail if we don't see an error we can retry...
|
||||
*/
|
||||
|
||||
if (errno != ENOSPC && errno != ENXIO && errno != EAGAIN &&
|
||||
errno != EINTR && errno != ENOTTY)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to write print data: %s\n"),
|
||||
strerror(errno));
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Wrote %d bytes of print data...\n", (int)bytes);
|
||||
|
||||
print_bytes -= bytes;
|
||||
print_ptr += bytes;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'backendRunLoop()' - Read and write print and back-channel data.
|
||||
*/
|
||||
|
||||
ssize_t /* O - Total bytes on success, -1 on error */
|
||||
backendRunLoop(
|
||||
int print_fd, /* I - Print file descriptor */
|
||||
int device_fd, /* I - Device file descriptor */
|
||||
int use_bc, /* I - Use back-channel? */
|
||||
void (*side_cb)(int, int, int)) /* I - Side-channel callback */
|
||||
backendRunLoop(int print_fd, /* I - Print file descriptor */
|
||||
int device_fd, /* I - Device file descriptor */
|
||||
int use_bc) /* I - Use back-channel? */
|
||||
{
|
||||
int nfds; /* Maximum file descriptor value + 1 */
|
||||
fd_set input, /* Input set for reading */
|
||||
@@ -163,10 +66,8 @@ backendRunLoop(
|
||||
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
|
||||
|
||||
|
||||
fprintf(stderr,
|
||||
"DEBUG: backendRunLoop(print_fd=%d, device_fd=%d, use_bc=%d, "
|
||||
"side_cb=%p)\n",
|
||||
print_fd, device_fd, use_bc, side_cb);
|
||||
fprintf(stderr, "DEBUG: backendRunLoop(print_fd=%d, device_fd=%d, use_bc=%d)\n",
|
||||
print_fd, device_fd, use_bc);
|
||||
|
||||
/*
|
||||
* If we are printing data from a print driver on stdin, ignore SIGTERM
|
||||
@@ -200,8 +101,7 @@ backendRunLoop(
|
||||
* Now loop until we are out of data from print_fd...
|
||||
*/
|
||||
|
||||
for (print_bytes = 0, print_ptr = print_buffer, offline = -1,
|
||||
paperout = -1, total_bytes = 0;;)
|
||||
for (print_bytes = 0, print_ptr = print_buffer, offline = 0, paperout = 0, total_bytes = 0;;)
|
||||
{
|
||||
/*
|
||||
* Use select() to determine whether we have data to copy around...
|
||||
@@ -212,14 +112,12 @@ backendRunLoop(
|
||||
FD_SET(print_fd, &input);
|
||||
if (use_bc)
|
||||
FD_SET(device_fd, &input);
|
||||
if (side_cb)
|
||||
FD_SET(CUPS_SC_FD, &input);
|
||||
|
||||
FD_ZERO(&output);
|
||||
if (print_bytes || !use_bc)
|
||||
FD_SET(device_fd, &output);
|
||||
|
||||
if (use_bc || side_cb)
|
||||
if (use_bc)
|
||||
{
|
||||
if (select(nfds, &input, &output, NULL, NULL) < 0)
|
||||
{
|
||||
@@ -227,31 +125,18 @@ backendRunLoop(
|
||||
* Pause printing to clear any pending errors...
|
||||
*/
|
||||
|
||||
if (errno == ENXIO && offline != 1)
|
||||
if (errno == ENXIO && !offline)
|
||||
{
|
||||
fputs("STATE: +offline-error\n", stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Printer is currently off-line.\n"));
|
||||
fputs("INFO: Printer is currently off-line.\n", stderr);
|
||||
offline = 1;
|
||||
}
|
||||
else if (errno == EINTR && total_bytes == 0)
|
||||
{
|
||||
fputs("DEBUG: Received an interrupt before any bytes were "
|
||||
"written, aborting!\n", stderr);
|
||||
return (0);
|
||||
}
|
||||
|
||||
sleep(1);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if we have a side-channel request ready...
|
||||
*/
|
||||
|
||||
if (side_cb && FD_ISSET(CUPS_SC_FD, &input))
|
||||
(*side_cb)(print_fd, device_fd, use_bc);
|
||||
|
||||
/*
|
||||
* Check if we have back-channel data ready...
|
||||
*/
|
||||
@@ -318,26 +203,25 @@ backendRunLoop(
|
||||
|
||||
if (errno == ENOSPC)
|
||||
{
|
||||
if (paperout != 1)
|
||||
if (!paperout)
|
||||
{
|
||||
fputs("STATE: +media-empty-error\n", stderr);
|
||||
_cupsLangPuts(stderr, _("ERROR: Out of paper!\n"));
|
||||
fputs("ERROR: Out of paper!\n", stderr);
|
||||
fputs("STATUS: +media-tray-empty-error\n", stderr);
|
||||
paperout = 1;
|
||||
}
|
||||
}
|
||||
else if (errno == ENXIO)
|
||||
{
|
||||
if (offline != 1)
|
||||
if (!offline)
|
||||
{
|
||||
fputs("STATE: +offline-error\n", stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Printer is currently off-line.\n"));
|
||||
fputs("INFO: Printer is currently off-line.\n", stderr);
|
||||
offline = 1;
|
||||
}
|
||||
}
|
||||
else if (errno != EAGAIN && errno != EINTR && errno != ENOTTY)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to write print data: %s\n"),
|
||||
strerror(errno));
|
||||
perror("ERROR: Unable to write print data");
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@@ -345,14 +229,14 @@ backendRunLoop(
|
||||
{
|
||||
if (paperout)
|
||||
{
|
||||
fputs("STATE: -media-empty-error\n", stderr);
|
||||
fputs("STATUS: -media-tray-empty-error\n", stderr);
|
||||
paperout = 0;
|
||||
}
|
||||
|
||||
if (offline)
|
||||
{
|
||||
fputs("STATE: -offline-error\n", stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Printer is now on-line.\n"));
|
||||
fputs("INFO: Printer is now on-line.\n", stderr);
|
||||
offline = 0;
|
||||
}
|
||||
|
||||
|
||||
+11
-16
@@ -3,7 +3,6 @@
|
||||
*
|
||||
* IRIX SCSI printer support for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2003-2005 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
@@ -96,8 +95,7 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
|
||||
if (strncmp(resource, "/dev/scsi/", 10) != 0)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Bad SCSI device file \"%s\"!\n"),
|
||||
resource);
|
||||
fprintf(stderr, "ERROR: Bad SCSI device file \"%s\"!\n", resource);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
@@ -120,9 +118,8 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
fputs("INFO: Unable to open SCSI device, queuing on next printer in class...\n",
|
||||
stderr);
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -135,15 +132,14 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
|
||||
if (errno != EAGAIN && errno != EBUSY)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
fprintf(stderr, "ERROR: Unable to open SCSI device \"%s\" - %s\n",
|
||||
resource, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
else
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 30 seconds...\n"));
|
||||
fprintf(stderr, "INFO: SCSI device \"%s\" busy; retrying...\n",
|
||||
resource);
|
||||
sleep(30);
|
||||
}
|
||||
}
|
||||
@@ -205,9 +201,8 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
if (ioctl(scsi_fd, DS_ENTER, &scsi_req) < 0 ||
|
||||
scsi_req.ds_status != 0)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: SCSI command timed out (%d); "
|
||||
"retrying...\n"), scsi_req.ds_status);
|
||||
fprintf(stderr, "WARNING: SCSI command timed out (%d); retrying...\n",
|
||||
scsi_req.ds_status);
|
||||
sleep(try + 1);
|
||||
}
|
||||
else
|
||||
@@ -215,8 +210,8 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
|
||||
if (try >= 10)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to send print data (%d)\n"),
|
||||
scsi_req.ds_status);
|
||||
fprintf(stderr, "ERROR: Unable to send print data (%d)\n",
|
||||
scsi_req.ds_status);
|
||||
close(scsi_fd);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
+11
-17
@@ -3,7 +3,6 @@
|
||||
*
|
||||
* Linux SCSI printer support for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2003-2005 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
@@ -56,7 +55,6 @@
|
||||
*/
|
||||
|
||||
#include <scsi/sg.h>
|
||||
#include <cups/i18n.h>
|
||||
|
||||
|
||||
/*
|
||||
@@ -110,8 +108,7 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
|
||||
if (strncmp(resource, "/dev/sg", 7) != 0)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Bad SCSI device file \"%s\"!\n"),
|
||||
resource);
|
||||
fprintf(stderr, "ERROR: Bad SCSI device file \"%s\"!\n", resource);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
@@ -134,9 +131,8 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
fputs("INFO: Unable to open SCSI device, queuing on next printer in class...\n",
|
||||
stderr);
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -149,15 +145,14 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
|
||||
if (errno != EAGAIN && errno != EBUSY)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
fprintf(stderr, "ERROR: Unable to open SCSI device \"%s\" - %s\n",
|
||||
resource, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
else
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 30 seconds...\n"));
|
||||
fprintf(stderr, "INFO: SCSI device \"%s\" busy; retrying...\n",
|
||||
resource);
|
||||
sleep(30);
|
||||
}
|
||||
}
|
||||
@@ -223,9 +218,8 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
if (ioctl(scsi_fd, SG_IO, &scsi_req) < 0 ||
|
||||
scsi_req.status != 0)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: SCSI command timed out (%d); "
|
||||
"retrying...\n"), scsi_req.status);
|
||||
fprintf(stderr, "WARNING: SCSI command timed out (%d); retrying...\n",
|
||||
scsi_req.status);
|
||||
sleep(try + 1);
|
||||
}
|
||||
else
|
||||
@@ -233,8 +227,8 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
|
||||
if (try >= 10)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to send print data (%d)\n"),
|
||||
scsi_req.status);
|
||||
fprintf(stderr, "ERROR: Unable to send print data (%d)\n",
|
||||
scsi_req.status);
|
||||
close(scsi_fd);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
+1
-6
@@ -3,7 +3,6 @@
|
||||
*
|
||||
* SCSI printer backend for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2003-2006 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
@@ -56,12 +55,10 @@
|
||||
|
||||
#include <cups/backend.h>
|
||||
#include <cups/cups.h>
|
||||
#include <cups/i18n.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <cups/string.h>
|
||||
#include <cups/i18n.h>
|
||||
#include <signal.h>
|
||||
|
||||
#ifdef WIN32
|
||||
@@ -153,9 +150,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
fputs("Usage: scsi:/dev/file job-id user title copies options [file]\n", stderr);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
|
||||
+39
-107
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* Serial port backend for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
@@ -18,7 +27,6 @@
|
||||
*
|
||||
* main() - Send a file to the printer or server.
|
||||
* list_devices() - List all serial devices.
|
||||
* side_cb() - Handle side-channel requests...
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -83,8 +91,7 @@
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static void list_devices(void);
|
||||
static void side_cb(int print_fd, int device_fd, int use_bc);
|
||||
void list_devices(void);
|
||||
|
||||
|
||||
/*
|
||||
@@ -104,9 +111,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
username[255], /* Username info (not used) */
|
||||
resource[1024], /* Resource info (device and options) */
|
||||
*options, /* Pointer to options */
|
||||
*name, /* Name of option */
|
||||
*value, /* Value of option */
|
||||
sep; /* Option separator */
|
||||
name[255], /* Name of option */
|
||||
value[255], /* Value of option */
|
||||
*ptr; /* Pointer into name or value */
|
||||
int port; /* Port number (not used) */
|
||||
int copies; /* Number of copies to print */
|
||||
int print_fd, /* Print file */
|
||||
@@ -161,9 +168,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
fputs("Usage: serial job-id user title copies options [file]\n", stderr);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -235,9 +240,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
fputs("INFO: Unable to open serial port, queuing on next printer in class...\n",
|
||||
stderr);
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -250,15 +254,13 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if (errno == EBUSY)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 30 seconds...\n"));
|
||||
fputs("INFO: Serial port busy; will retry in 30 seconds...\n", stderr);
|
||||
sleep(30);
|
||||
}
|
||||
else
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
fprintf(stderr, "ERROR: Unable to open serial port device file \"%s\": %s\n",
|
||||
resource, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
@@ -289,30 +291,29 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Get the name...
|
||||
*/
|
||||
|
||||
name = options;
|
||||
for (ptr = name; *options && *options != '=';)
|
||||
if (ptr < (name + sizeof(name) - 1))
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
|
||||
while (*options && *options != '=' && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
if ((sep = *options) != '\0')
|
||||
*options++ = '\0';
|
||||
|
||||
if (sep == '=')
|
||||
if (*options == '=')
|
||||
{
|
||||
/*
|
||||
* Get the value...
|
||||
*/
|
||||
|
||||
value = options;
|
||||
options ++;
|
||||
|
||||
while (*options && *options != '+' && *options != '&')
|
||||
for (ptr = value; *options && *options != '+' && *options != '&';)
|
||||
if (ptr < (value + sizeof(value) - 1))
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
|
||||
if (*options == '+' || *options == '&')
|
||||
options ++;
|
||||
|
||||
if (*options)
|
||||
*options++ = '\0';
|
||||
}
|
||||
else
|
||||
value = (char *)"";
|
||||
value[0] = '\0';
|
||||
|
||||
/*
|
||||
* Process the option...
|
||||
@@ -375,8 +376,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
break;
|
||||
# endif /* B230400 */
|
||||
default :
|
||||
_cupsLangPrintf(stderr, _("WARNING: Unsupported baud rate %s!\n"),
|
||||
value);
|
||||
fprintf(stderr, "WARNING: Unsupported baud rate %s!\n", value);
|
||||
break;
|
||||
}
|
||||
#endif /* B19200 == 19200 */
|
||||
@@ -556,7 +556,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
if (!print_bytes)
|
||||
FD_SET(print_fd, &input);
|
||||
FD_SET(device_fd, &input);
|
||||
FD_SET(CUPS_SC_FD, &input);
|
||||
|
||||
FD_ZERO(&output);
|
||||
if (print_bytes)
|
||||
@@ -565,13 +564,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
if (select(nfds, &input, &output, NULL, NULL) < 0)
|
||||
continue; /* Ignore errors here */
|
||||
|
||||
/*
|
||||
* Check if we have a side-channel request ready...
|
||||
*/
|
||||
|
||||
if (FD_ISSET(CUPS_SC_FD, &input))
|
||||
side_cb(print_fd, device_fd, 1);
|
||||
|
||||
/*
|
||||
* Check if we have back-channel data ready...
|
||||
*/
|
||||
@@ -720,7 +712,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* 'list_devices()' - List all serial devices.
|
||||
*/
|
||||
|
||||
static void
|
||||
void
|
||||
list_devices(void)
|
||||
{
|
||||
#if defined(__hpux) || defined(__sgi) || defined(__sun) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
|
||||
@@ -786,14 +778,6 @@ list_devices(void)
|
||||
printf("serial serial:%s?baud=230400 \"Unknown\" \"USB Serial Port #%d\"\n",
|
||||
device, i + 1);
|
||||
}
|
||||
|
||||
sprintf(device, "/dev/ttyUSB%d", i);
|
||||
if ((fd = open(device, O_WRONLY | O_NOCTTY | O_NDELAY)) >= 0)
|
||||
{
|
||||
close(fd);
|
||||
printf("serial serial:%s?baud=230400 \"Unknown\" \"USB Serial Port #%d\"\n",
|
||||
device, i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 64; i ++)
|
||||
@@ -1233,58 +1217,6 @@ list_devices(void)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'side_cb()' - Handle side-channel requests...
|
||||
*/
|
||||
|
||||
static void
|
||||
side_cb(int print_fd, /* I - Print file */
|
||||
int device_fd, /* I - Device file */
|
||||
int use_bc) /* I - Using back-channel? */
|
||||
{
|
||||
cups_sc_command_t command; /* Request command */
|
||||
cups_sc_status_t status; /* Request/response status */
|
||||
char data[2048]; /* Request/response data */
|
||||
int datalen; /* Request/response data size */
|
||||
|
||||
|
||||
datalen = sizeof(data);
|
||||
|
||||
if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0))
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("WARNING: Failed to read side-channel request!\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
switch (command)
|
||||
{
|
||||
case CUPS_SC_CMD_DRAIN_OUTPUT :
|
||||
if (backendDrainOutput(print_fd, device_fd))
|
||||
status = CUPS_SC_STATUS_IO_ERROR;
|
||||
else if (tcdrain(device_fd))
|
||||
status = CUPS_SC_STATUS_IO_ERROR;
|
||||
else
|
||||
status = CUPS_SC_STATUS_OK;
|
||||
|
||||
datalen = 0;
|
||||
break;
|
||||
|
||||
case CUPS_SC_CMD_GET_BIDI :
|
||||
data[0] = use_bc;
|
||||
datalen = 1;
|
||||
break;
|
||||
|
||||
default :
|
||||
status = CUPS_SC_STATUS_NOT_IMPLEMENTED;
|
||||
datalen = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
cupsSideChannelWrite(command, status, data, datalen, 1.0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
|
||||
+384
-181
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* SNMP discovery backend for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 2006 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
@@ -19,7 +28,6 @@
|
||||
* main() - Discover printers via SNMP.
|
||||
* add_array() - Add a string to an array.
|
||||
* add_cache() - Add a cached device...
|
||||
* add_device_uri() - Add a device URI to the cache.
|
||||
* alarm_handler() - Handle alarm signals...
|
||||
* asn1_decode_snmp() - Decode a SNMP packet.
|
||||
* asn1_debug() - Decode an ASN1-encoded message.
|
||||
@@ -44,6 +52,7 @@
|
||||
* packed integer value.
|
||||
* compare_cache() - Compare two cache entries.
|
||||
* debug_printf() - Display some debugging information.
|
||||
* do_request() - Do a non-blocking IPP request.
|
||||
* fix_make_model() - Fix common problems in the make-and-model
|
||||
* string.
|
||||
* free_array() - Free an array of strings.
|
||||
@@ -73,15 +82,13 @@
|
||||
#include "backend-private.h"
|
||||
#include <cups/array.h>
|
||||
#include <cups/file.h>
|
||||
#include <regex.h>
|
||||
|
||||
|
||||
/*
|
||||
* This backend implements SNMP printer discovery. It uses a broadcast-
|
||||
* based approach to get SNMP response packets from potential printers,
|
||||
* tries a mDNS lookup (Mac OS X only at present), a URI lookup based on
|
||||
* the device description string, and finally a probe of port 9100
|
||||
* (AppSocket) and 515 (LPD).
|
||||
* based approach to get SNMP response packets from potential printers
|
||||
* and then interrogates each responder by trying to connect on port
|
||||
* 631, 9100, and 515.
|
||||
*
|
||||
* The current focus is on printers with internal network cards, although
|
||||
* the code also works with many external print servers as well. Future
|
||||
@@ -97,10 +104,8 @@
|
||||
* Address @IF(name)
|
||||
* Community name
|
||||
* DebugLevel N
|
||||
* DeviceURI "regex pattern" uri
|
||||
* HostNameLookups on
|
||||
* HostNameLookups off
|
||||
* MaxRunTime N
|
||||
*
|
||||
* The default is to use:
|
||||
*
|
||||
@@ -108,7 +113,6 @@
|
||||
* Community public
|
||||
* DebugLevel 0
|
||||
* HostNameLookups off
|
||||
* MaxRunTime 10
|
||||
*
|
||||
* This backend is known to work with the following network printers and
|
||||
* print servers:
|
||||
@@ -158,12 +162,6 @@
|
||||
* Types...
|
||||
*/
|
||||
|
||||
typedef struct device_uri_s /**** DeviceURI values ****/
|
||||
{
|
||||
regex_t re; /* Regular expression to match */
|
||||
cups_array_t *uris; /* URIs */
|
||||
} device_uri_t;
|
||||
|
||||
typedef struct snmp_cache_s /**** SNMP scan cache ****/
|
||||
{
|
||||
http_addr_t address; /* Address of device */
|
||||
@@ -211,7 +209,6 @@ static char *add_array(cups_array_t *a, const char *s);
|
||||
static void add_cache(http_addr_t *addr, const char *addrname,
|
||||
const char *uri, const char *id,
|
||||
const char *make_and_model);
|
||||
static device_uri_t *add_device_uri(char *value);
|
||||
static void alarm_handler(int sig);
|
||||
static int asn1_decode_snmp(unsigned char *buffer, size_t len,
|
||||
snmp_packet_t *packet);
|
||||
@@ -249,6 +246,8 @@ static int asn1_size_oid(const int *oid);
|
||||
static int asn1_size_packed(int integer);
|
||||
static int compare_cache(snmp_cache_t *a, snmp_cache_t *b);
|
||||
static void debug_printf(const char *format, ...);
|
||||
static ipp_t *do_request(http_t *http, ipp_t *request,
|
||||
const char *resource);
|
||||
static void fix_make_model(char *make_model,
|
||||
const char *old_make_model,
|
||||
int make_model_size);
|
||||
@@ -282,13 +281,12 @@ static cups_array_t *Addresses = NULL;
|
||||
static cups_array_t *Communities = NULL;
|
||||
static cups_array_t *Devices = NULL;
|
||||
static int DebugLevel = 0;
|
||||
static int DeviceDescOID[] = { 1, 3, 6, 1, 2, 1, 25, 3,
|
||||
2, 1, 3, 1, 0 };
|
||||
static unsigned DeviceDescRequest;
|
||||
static int DeviceTypeOID[] = { 1, 3, 6, 1, 2, 1, 25, 3,
|
||||
2, 1, 2, 1, 0 };
|
||||
static int DeviceDescOID[] = { 1, 3, 6, 1, 2, 1, 25, 3,
|
||||
2, 1, 3, 1, 0 };
|
||||
static unsigned DeviceTypeRequest;
|
||||
static cups_array_t *DeviceURIs = NULL;
|
||||
static unsigned DeviceDescRequest;
|
||||
static int HostNameLookups = 0;
|
||||
static int MaxRunTime = 10;
|
||||
static struct timeval StartTime;
|
||||
@@ -314,7 +312,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if (argc > 2)
|
||||
{
|
||||
fputs(_("Usage: snmp [host-or-ip-address]\n"), stderr);
|
||||
fputs("Usage: snmp [host-or-ip-address]\n", stderr);
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -435,96 +433,6 @@ add_cache(http_addr_t *addr, /* I - Device IP address */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'add_device_uri()' - Add a device URI to the cache.
|
||||
*
|
||||
* The value string is modified (chopped up) as needed.
|
||||
*/
|
||||
|
||||
static device_uri_t * /* O - Device URI */
|
||||
add_device_uri(char *value) /* I - Value from snmp.conf */
|
||||
{
|
||||
device_uri_t *device_uri; /* Device URI */
|
||||
char *start; /* Start of value */
|
||||
|
||||
|
||||
/*
|
||||
* Allocate memory as needed...
|
||||
*/
|
||||
|
||||
if (!DeviceURIs)
|
||||
DeviceURIs = cupsArrayNew(NULL, NULL);
|
||||
|
||||
if (!DeviceURIs)
|
||||
return (NULL);
|
||||
|
||||
if ((device_uri = calloc(1, sizeof(device_uri_t))) == NULL)
|
||||
return (NULL);
|
||||
|
||||
if ((device_uri->uris = cupsArrayNew(NULL, NULL)) == NULL)
|
||||
{
|
||||
free(device_uri);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Scan the value string for the regular expression and URI(s)...
|
||||
*/
|
||||
|
||||
value ++; /* Skip leading " */
|
||||
|
||||
for (start = value; *value && *value != '\"'; value ++)
|
||||
if (*value == '\\' && value[1])
|
||||
_cups_strcpy(value, value + 1);
|
||||
|
||||
if (!*value)
|
||||
{
|
||||
fputs("ERROR: Missing end quote for DeviceURI!\n", stderr);
|
||||
|
||||
cupsArrayDelete(device_uri->uris);
|
||||
free(device_uri);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
*value++ = '\0';
|
||||
|
||||
if (regcomp(&(device_uri->re), start, REG_EXTENDED | REG_ICASE))
|
||||
{
|
||||
fputs("ERROR: Bad regular expression for DeviceURI!\n", stderr);
|
||||
|
||||
cupsArrayDelete(device_uri->uris);
|
||||
free(device_uri);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
while (*value)
|
||||
{
|
||||
while (isspace(*value & 255))
|
||||
value ++;
|
||||
|
||||
if (!*value)
|
||||
break;
|
||||
|
||||
for (start = value; *value && !isspace(*value & 255); value ++);
|
||||
|
||||
if (*value)
|
||||
*value++ = '\0';
|
||||
|
||||
cupsArrayAdd(device_uri->uris, strdup(start));
|
||||
}
|
||||
|
||||
/*
|
||||
* Add the device URI to the list and return it...
|
||||
*/
|
||||
|
||||
cupsArrayAdd(DeviceURIs, device_uri);
|
||||
|
||||
return (device_uri);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'alarm_handler()' - Handle alarm signals...
|
||||
*/
|
||||
@@ -1218,7 +1126,7 @@ asn1_set_packed(unsigned char **buffer, /* IO - Pointer in buffer */
|
||||
{
|
||||
if (integer > 0xfffffff)
|
||||
{
|
||||
**buffer = (integer >> 28) & 0x7f;
|
||||
**buffer = (integer >> 14) & 0x7f;
|
||||
(*buffer) ++;
|
||||
}
|
||||
|
||||
@@ -1351,6 +1259,173 @@ debug_printf(const char *format, /* I - Printf-style format string */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'do_request()' - Do a non-blocking IPP request.
|
||||
*/
|
||||
|
||||
static ipp_t * /* O - Response data or NULL */
|
||||
do_request(http_t *http, /* I - HTTP connection to server */
|
||||
ipp_t *request, /* I - IPP request */
|
||||
const char *resource) /* I - HTTP resource for POST */
|
||||
{
|
||||
ipp_t *response; /* IPP response data */
|
||||
http_status_t status; /* Status of HTTP request */
|
||||
ipp_state_t state; /* State of IPP processing */
|
||||
|
||||
|
||||
/*
|
||||
* Setup the HTTP variables needed...
|
||||
*/
|
||||
|
||||
httpClearFields(http);
|
||||
httpSetLength(http, ippLength(request));
|
||||
httpSetField(http, HTTP_FIELD_CONTENT_TYPE, "application/ipp");
|
||||
|
||||
/*
|
||||
* Do the POST request...
|
||||
*/
|
||||
|
||||
debug_printf("DEBUG: %.3f POST %s...\n", run_time(), resource);
|
||||
|
||||
if (httpPost(http, resource))
|
||||
{
|
||||
if (httpReconnect(http))
|
||||
{
|
||||
_cupsSetError(IPP_DEVICE_ERROR, "Unable to reconnect");
|
||||
return (NULL);
|
||||
}
|
||||
else if (httpPost(http, resource))
|
||||
{
|
||||
_cupsSetError(IPP_GONE, "Unable to POST");
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Send the IPP data...
|
||||
*/
|
||||
|
||||
request->state = IPP_IDLE;
|
||||
status = HTTP_CONTINUE;
|
||||
|
||||
while ((state = ippWrite(http, request)) != IPP_DATA)
|
||||
if (state == IPP_ERROR)
|
||||
{
|
||||
status = HTTP_ERROR;
|
||||
break;
|
||||
}
|
||||
else if (httpCheck(http))
|
||||
{
|
||||
if ((status = httpUpdate(http)) != HTTP_CONTINUE)
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the server's return status...
|
||||
*/
|
||||
|
||||
debug_printf("DEBUG: %.3f Getting response...\n", run_time());
|
||||
|
||||
while (status == HTTP_CONTINUE)
|
||||
if (httpWait(http, 1000))
|
||||
status = httpUpdate(http);
|
||||
else
|
||||
{
|
||||
status = HTTP_ERROR;
|
||||
http->error = ETIMEDOUT;
|
||||
}
|
||||
|
||||
if (status != HTTP_OK)
|
||||
{
|
||||
/*
|
||||
* Flush any error message...
|
||||
*/
|
||||
|
||||
httpFlush(http);
|
||||
response = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Read the response...
|
||||
*/
|
||||
|
||||
response = ippNew();
|
||||
|
||||
while ((state = ippRead(http, response)) != IPP_DATA)
|
||||
if (state == IPP_ERROR)
|
||||
{
|
||||
/*
|
||||
* Delete the response...
|
||||
*/
|
||||
|
||||
ippDelete(response);
|
||||
response = NULL;
|
||||
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, strerror(errno));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Delete the original request and return the response...
|
||||
*/
|
||||
|
||||
ippDelete(request);
|
||||
|
||||
if (response)
|
||||
{
|
||||
ipp_attribute_t *attr; /* status-message attribute */
|
||||
|
||||
|
||||
attr = ippFindAttribute(response, "status-message", IPP_TAG_TEXT);
|
||||
|
||||
_cupsSetError(response->request.status.status_code,
|
||||
attr ? attr->values[0].string.text :
|
||||
ippErrorString(response->request.status.status_code));
|
||||
}
|
||||
else if (status != HTTP_OK)
|
||||
{
|
||||
switch (status)
|
||||
{
|
||||
case HTTP_NOT_FOUND :
|
||||
_cupsSetError(IPP_NOT_FOUND, httpStatus(status));
|
||||
break;
|
||||
|
||||
case HTTP_UNAUTHORIZED :
|
||||
_cupsSetError(IPP_NOT_AUTHORIZED, httpStatus(status));
|
||||
break;
|
||||
|
||||
case HTTP_FORBIDDEN :
|
||||
_cupsSetError(IPP_FORBIDDEN, httpStatus(status));
|
||||
break;
|
||||
|
||||
case HTTP_BAD_REQUEST :
|
||||
_cupsSetError(IPP_BAD_REQUEST, httpStatus(status));
|
||||
break;
|
||||
|
||||
case HTTP_REQUEST_TOO_LARGE :
|
||||
_cupsSetError(IPP_REQUEST_VALUE, httpStatus(status));
|
||||
break;
|
||||
|
||||
case HTTP_NOT_IMPLEMENTED :
|
||||
_cupsSetError(IPP_OPERATION_NOT_SUPPORTED, httpStatus(status));
|
||||
break;
|
||||
|
||||
case HTTP_NOT_SUPPORTED :
|
||||
_cupsSetError(IPP_VERSION_NOT_SUPPORTED, httpStatus(status));
|
||||
break;
|
||||
|
||||
default :
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, httpStatus(status));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (response);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'fix_make_model()' - Fix common problems in the make-and-model string.
|
||||
*/
|
||||
@@ -1396,8 +1471,6 @@ fix_make_model(
|
||||
}
|
||||
else if (!strncasecmp(old_make_model, "deskjet", 7))
|
||||
snprintf(make_model, make_model_size, "HP DeskJet%s", old_make_model + 7);
|
||||
else if (!strncasecmp(old_make_model, "officejet", 9))
|
||||
snprintf(make_model, make_model_size, "HP OfficeJet%s", old_make_model + 9);
|
||||
else if (!strncasecmp(old_make_model, "stylus_pro_", 11))
|
||||
snprintf(make_model, make_model_size, "EPSON Stylus Pro %s",
|
||||
old_make_model + 11);
|
||||
@@ -1643,67 +1716,214 @@ password_cb(const char *prompt) /* I - Prompt message */
|
||||
static void
|
||||
probe_device(snmp_cache_t *device) /* I - Device */
|
||||
{
|
||||
char uri[1024], /* Full device URI */
|
||||
*uriptr, /* Pointer into URI */
|
||||
*format; /* Format string for device */
|
||||
device_uri_t *device_uri; /* Current DeviceURI match */
|
||||
int i, j; /* Looping vars */
|
||||
http_t *http; /* HTTP connection for IPP */
|
||||
char uri[1024]; /* Full device URI */
|
||||
|
||||
|
||||
/*
|
||||
* Try connecting via IPP first...
|
||||
*/
|
||||
|
||||
debug_printf("DEBUG: %.3f Probing %s...\n", run_time(), device->addrname);
|
||||
|
||||
#ifdef __APPLE__
|
||||
/*
|
||||
* TODO: Try an mDNS query first, and then fallback on direct probes...
|
||||
*/
|
||||
|
||||
if (!try_connect(&(device->address), device->addrname, 5353))
|
||||
if (device->make_and_model &&
|
||||
(!strncasecmp(device->make_and_model, "Epson", 5) ||
|
||||
!strncasecmp(device->make_and_model, "Kyocera", 7) ||
|
||||
!strncasecmp(device->make_and_model, "Lexmark", 7) ||
|
||||
!strncasecmp(device->make_and_model, "Tektronix", 9) ||
|
||||
!strncasecmp(device->make_and_model, "Xerox", 5)))
|
||||
{
|
||||
debug_printf("DEBUG: %s supports mDNS, not reporting!\n", device->addrname);
|
||||
return;
|
||||
/*
|
||||
* Epson, Kyocera, Lexmark, Tektronix, and Xerox printers often lock up on
|
||||
* IPP probes, so exclude them from the IPP connection test...
|
||||
*/
|
||||
|
||||
http = NULL;
|
||||
}
|
||||
#endif /* __APPLE__ */
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Otherwise, try connecting for up to 1 second...
|
||||
*/
|
||||
|
||||
/*
|
||||
* Lookup the device in the match table...
|
||||
*/
|
||||
alarm(1);
|
||||
http = httpConnect(device->addrname, 631);
|
||||
alarm(0);
|
||||
}
|
||||
|
||||
for (device_uri = (device_uri_t *)cupsArrayFirst(DeviceURIs);
|
||||
device_uri;
|
||||
device_uri = (device_uri_t *)cupsArrayNext(DeviceURIs))
|
||||
if (!regexec(&(device_uri->re), device->make_and_model, 0, NULL, 0))
|
||||
if (http);
|
||||
{
|
||||
/*
|
||||
* IPP is supported...
|
||||
*/
|
||||
|
||||
ipp_t *request, /* IPP request */
|
||||
*response; /* IPP response */
|
||||
ipp_attribute_t *model, /* printer-make-and-model attribute */
|
||||
*info, /* printer-info attribute */
|
||||
*supported; /* printer-uri-supported attribute */
|
||||
char make_model[256],/* Make and model string to use */
|
||||
temp[256]; /* Temporary make/model string */
|
||||
int num_uris; /* Number of good URIs */
|
||||
static const char * const resources[] =
|
||||
{ /* Common resource paths for IPP */
|
||||
"/ipp",
|
||||
"/ipp/port2",
|
||||
"/ipp/port3",
|
||||
"/EPSON_IPP_Printer",
|
||||
"/LPT1",
|
||||
"/LPT2",
|
||||
"/COM1",
|
||||
"/"
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Use non-blocking IO...
|
||||
*/
|
||||
|
||||
httpBlocking(http, 0);
|
||||
|
||||
/*
|
||||
* Loop through a list of common resources that covers 99% of the
|
||||
* IPP-capable printers on the market today...
|
||||
*/
|
||||
|
||||
for (i = 0, num_uris = 0;
|
||||
i < (int)(sizeof(resources) / sizeof(resources[0]));
|
||||
i ++)
|
||||
{
|
||||
/*
|
||||
* Found a match, add the URIs...
|
||||
* Stop early if we are out of time...
|
||||
*/
|
||||
|
||||
for (format = (char *)cupsArrayFirst(device_uri->uris);
|
||||
format;
|
||||
format = (char *)cupsArrayNext(device_uri->uris))
|
||||
if (MaxRunTime > 0 && run_time() >= MaxRunTime)
|
||||
break;
|
||||
|
||||
/*
|
||||
* Don't look past /ipp if we have found a working URI...
|
||||
*/
|
||||
|
||||
if (num_uris > 0 && strncmp(resources[i], "/ipp", 4))
|
||||
break;
|
||||
|
||||
httpAssembleURI(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
|
||||
device->addrname, 631, resources[i]);
|
||||
|
||||
request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, uri);
|
||||
|
||||
response = do_request(http, request, resources[i]);
|
||||
|
||||
debug_printf("DEBUG: %.3f %s %s (%s)\n", run_time(), uri,
|
||||
ippErrorString(cupsLastError()), cupsLastErrorString());
|
||||
|
||||
if (response && response->request.status.status_code == IPP_OK)
|
||||
{
|
||||
for (uriptr = uri; *format && uriptr < (uri + sizeof(uri) - 1);)
|
||||
if (*format == '%' && format[1] == 's')
|
||||
model = ippFindAttribute(response, "printer-make-and-model",
|
||||
IPP_TAG_TEXT);
|
||||
info = ippFindAttribute(response, "printer-info", IPP_TAG_TEXT);
|
||||
supported = ippFindAttribute(response, "printer-uri-supported",
|
||||
IPP_TAG_URI);
|
||||
|
||||
if (!supported)
|
||||
{
|
||||
fprintf(stderr, "ERROR: Missing printer-uri-supported from %s!\n",
|
||||
device->addrname);
|
||||
|
||||
httpClose(http);
|
||||
return;
|
||||
}
|
||||
|
||||
debug_printf("DEBUG: printer-info=\"%s\"\n",
|
||||
info ? info->values[0].string.text : "(null)");
|
||||
debug_printf("DEBUG: printer-make-and-model=\"%s\"\n",
|
||||
model ? model->values[0].string.text : "(null)");
|
||||
|
||||
/*
|
||||
* Don't advertise this port if the printer actually only supports
|
||||
* a more generic version...
|
||||
*/
|
||||
|
||||
if (!strncmp(resources[i], "/ipp/", 5))
|
||||
{
|
||||
for (j = 0; j < supported->num_values; j ++)
|
||||
if (strstr(supported->values[j].string.text, "/ipp/"))
|
||||
break;
|
||||
|
||||
if (j >= supported->num_values)
|
||||
{
|
||||
/*
|
||||
* Insert hostname/address...
|
||||
*/
|
||||
|
||||
strlcpy(uriptr, device->addrname, sizeof(uri) - (uriptr - uri));
|
||||
uriptr += strlen(uriptr);
|
||||
format += 2;
|
||||
ippDelete(response);
|
||||
break;
|
||||
}
|
||||
else
|
||||
*uriptr++ = *format++;
|
||||
}
|
||||
|
||||
*uriptr = '\0';
|
||||
/*
|
||||
* Don't use the printer-info attribute if it does not contain the
|
||||
* IEEE-1284 device ID data...
|
||||
*/
|
||||
|
||||
update_cache(device, uri, NULL, NULL);
|
||||
if (info &&
|
||||
(!strchr(info->values[0].string.text, ':') ||
|
||||
!strchr(info->values[0].string.text, ';')))
|
||||
info = NULL;
|
||||
|
||||
/*
|
||||
* Don't use the printer-make-and-model if it contains a generic
|
||||
* string like "Ricoh IPP Printer"...
|
||||
*/
|
||||
|
||||
if (model && strstr(model->values[0].string.text, "IPP Printer"))
|
||||
model = NULL;
|
||||
|
||||
/*
|
||||
* If we don't have a printer-make-and-model string from the printer
|
||||
* but do have the 1284 device ID string, generate a make-and-model
|
||||
* string from the device ID info...
|
||||
*/
|
||||
|
||||
if (model)
|
||||
strlcpy(temp, model->values[0].string.text, sizeof(temp));
|
||||
else if (info)
|
||||
backendGetMakeModel(info->values[0].string.text, temp, sizeof(temp));
|
||||
else
|
||||
temp[0] = '\0';
|
||||
|
||||
fix_make_model(make_model, temp, sizeof(make_model));
|
||||
|
||||
/*
|
||||
* Update the current device or add a new printer to the cache...
|
||||
*/
|
||||
|
||||
if (num_uris == 0)
|
||||
update_cache(device, uri,
|
||||
info ? info->values[0].string.text : NULL,
|
||||
make_model[0] ? make_model : NULL);
|
||||
else
|
||||
add_cache(&(device->address), device->addrname, uri,
|
||||
info ? info->values[0].string.text : NULL,
|
||||
make_model[0] ? make_model : NULL);
|
||||
|
||||
num_uris ++;
|
||||
}
|
||||
|
||||
return;
|
||||
ippDelete(response);
|
||||
|
||||
if (num_uris > 0 && cupsLastError() != IPP_OK)
|
||||
break;
|
||||
}
|
||||
|
||||
httpClose(http);
|
||||
|
||||
if (num_uris > 0)
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Then try the standard ports...
|
||||
* OK, now try the standard ports...
|
||||
*/
|
||||
|
||||
if (!try_connect(&(device->address), device->addrname, 9100))
|
||||
@@ -1787,15 +2007,6 @@ read_snmp_conf(const char *address) /* I - Single address to probe */
|
||||
add_array(Communities, value);
|
||||
else if (!strcasecmp(line, "DebugLevel"))
|
||||
DebugLevel = atoi(value);
|
||||
else if (!strcasecmp(line, "DeviceURI"))
|
||||
{
|
||||
if (*value != '\"')
|
||||
fprintf(stderr,
|
||||
"ERROR: Missing double quote for regular expression on "
|
||||
"line %d of %s!\n", linenum, filename);
|
||||
else
|
||||
add_device_uri(value);
|
||||
}
|
||||
else if (!strcasecmp(line, "HostNameLookups"))
|
||||
HostNameLookups = !strcasecmp(value, "on") ||
|
||||
!strcasecmp(value, "yes") ||
|
||||
@@ -1817,14 +2028,8 @@ read_snmp_conf(const char *address) /* I - Single address to probe */
|
||||
|
||||
if (cupsArrayCount(Addresses) == 0)
|
||||
{
|
||||
/*
|
||||
* If we have no addresses, exit immediately...
|
||||
*/
|
||||
|
||||
fprintf(stderr,
|
||||
"DEBUG: No address specified and no Address line in %s...\n",
|
||||
filename);
|
||||
exit(0);
|
||||
fputs("INFO: Using default SNMP Address @LOCAL\n", stderr);
|
||||
add_array(Addresses, "@LOCAL");
|
||||
}
|
||||
|
||||
if (cupsArrayCount(Communities) == 0)
|
||||
@@ -1880,8 +2085,8 @@ read_snmp_response(int fd) /* I - SNMP socket file descriptor */
|
||||
|
||||
if (asn1_decode_snmp(buffer, bytes, &packet))
|
||||
{
|
||||
fprintf(stderr, "ERROR: Bad SNMP packet from %s: %s\n",
|
||||
addrname, packet.error);
|
||||
fprintf(stderr, "ERROR: Bad SNMP packet from %s: %s\n", addrname,
|
||||
packet.error);
|
||||
|
||||
asn1_debug(buffer, bytes, 0);
|
||||
hex_debug(buffer, bytes);
|
||||
@@ -2156,8 +2361,7 @@ send_snmp_query(
|
||||
|
||||
if (bytes < 0)
|
||||
{
|
||||
fprintf(stderr, "ERROR: Unable to send SNMP query: %s\n",
|
||||
packet.error);
|
||||
fprintf(stderr, "ERROR: Unable to send SNMP query: %s\n", packet.error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2198,8 +2402,7 @@ try_connect(http_addr_t *addr, /* I - Socket address */
|
||||
|
||||
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
|
||||
{
|
||||
fprintf(stderr, "ERROR: Unable to create socket: %s\n",
|
||||
strerror(errno));
|
||||
fprintf(stderr, "ERROR: Unable to create socket: %s\n", strerror(errno));
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
||||
+84
-234
@@ -3,22 +3,29 @@
|
||||
*
|
||||
* AppSocket backend for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Send a file to the printer or server.
|
||||
* side_cb() - Handle side-channel requests...
|
||||
* wait_bc() - Wait for back-channel data...
|
||||
* main() - Send a file to the printer or server.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -43,14 +50,6 @@
|
||||
#endif /* WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static void side_cb(int print_fd, int device_fd, int use_bc);
|
||||
static int wait_bc(int device_fd, int secs);
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Send a file to the printer or server.
|
||||
*
|
||||
@@ -68,24 +67,22 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
username[255], /* Username info (not used) */
|
||||
resource[1024], /* Resource info (not used) */
|
||||
*options, /* Pointer to options */
|
||||
*name, /* Name of option */
|
||||
*value, /* Value of option */
|
||||
sep; /* Option separator */
|
||||
name[255], /* Name of option */
|
||||
value[255], /* Value of option */
|
||||
*ptr; /* Pointer into name or value */
|
||||
int print_fd; /* Print file */
|
||||
int copies; /* Number of copies to print */
|
||||
time_t start_time; /* Time of first connect */
|
||||
int recoverable; /* Recoverable error shown? */
|
||||
int contimeout; /* Connection timeout */
|
||||
int waiteof; /* Wait for end-of-file? */
|
||||
int port; /* Port number */
|
||||
char portname[255]; /* Port name */
|
||||
int delay; /* Delay for retries... */
|
||||
int device_fd; /* AppSocket */
|
||||
int error; /* Error code (if any) */
|
||||
http_addrlist_t *addrlist, /* Address list */
|
||||
*addr; /* Connected address */
|
||||
char addrname[256]; /* Address name */
|
||||
http_addrlist_t *addrlist; /* Address list */
|
||||
ssize_t tbytes; /* Total number of bytes written */
|
||||
struct timeval timeout; /* Timeout for select() */
|
||||
fd_set input; /* Input set for select() */
|
||||
ssize_t bc_bytes; /* Number of back-channel bytes read */
|
||||
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
struct sigaction action; /* Actions for POSIX signals */
|
||||
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
|
||||
@@ -122,9 +119,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
fprintf(stderr, "Usage: %s job-id user title copies options [file]\n",
|
||||
argv[0]);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -169,8 +165,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Get options, if any...
|
||||
*/
|
||||
|
||||
waiteof = 1;
|
||||
contimeout = 7 * 24 * 60 * 60;
|
||||
waiteof = 1;
|
||||
|
||||
if ((options = strchr(resource, '?')) != NULL)
|
||||
{
|
||||
@@ -191,30 +186,29 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Get the name...
|
||||
*/
|
||||
|
||||
name = options;
|
||||
for (ptr = name; *options && *options != '=';)
|
||||
if (ptr < (name + sizeof(name) - 1))
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
|
||||
while (*options && *options != '=' && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
if ((sep = *options) != '\0')
|
||||
*options++ = '\0';
|
||||
|
||||
if (sep == '=')
|
||||
if (*options == '=')
|
||||
{
|
||||
/*
|
||||
* Get the value...
|
||||
*/
|
||||
|
||||
value = options;
|
||||
options ++;
|
||||
|
||||
while (*options && *options != '+' && *options != '&')
|
||||
for (ptr = value; *options && *options != '+' && *options != '&';)
|
||||
if (ptr < (value + sizeof(value) - 1))
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
|
||||
if (*options == '+' || *options == '&')
|
||||
options ++;
|
||||
|
||||
if (*options)
|
||||
*options++ = '\0';
|
||||
}
|
||||
else
|
||||
value = (char *)"";
|
||||
value[0] = '\0';
|
||||
|
||||
/*
|
||||
* Process the option...
|
||||
@@ -229,15 +223,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
waiteof = !value[0] || !strcasecmp(value, "on") ||
|
||||
!strcasecmp(value, "yes") || !strcasecmp(value, "true");
|
||||
}
|
||||
else if (!strcasecmp(name, "contimeout"))
|
||||
{
|
||||
/*
|
||||
* Set the connection timeout...
|
||||
*/
|
||||
|
||||
if (atoi(value) > 0)
|
||||
contimeout = atoi(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -245,27 +230,22 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Then try to connect to the remote host...
|
||||
*/
|
||||
|
||||
recoverable = 0;
|
||||
start_time = time(NULL);
|
||||
|
||||
sprintf(portname, "%d", port);
|
||||
|
||||
if ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, portname)) == NULL)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"),
|
||||
hostname);
|
||||
fprintf(stderr, "ERROR: Unable to locate printer \'%s\'!\n", hostname);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
_cupsLangPrintf(stderr,
|
||||
_("INFO: Attempting to connect to host %s on port %d\n"),
|
||||
hostname, port);
|
||||
fprintf(stderr, "INFO: Attempting to connect to host %s on port %d\n",
|
||||
hostname, port);
|
||||
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
|
||||
for (delay = 5;;)
|
||||
{
|
||||
if ((addr = httpAddrConnect(addrlist, &device_fd)) == NULL)
|
||||
if (!httpAddrConnect(addrlist, &device_fd))
|
||||
{
|
||||
error = errno;
|
||||
device_fd = -1;
|
||||
@@ -279,9 +259,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
fprintf(stderr, "INFO: Unable to connect to \"%s\", queuing on next printer in class...\n",
|
||||
hostname);
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -295,19 +274,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
if (error == ECONNREFUSED || error == EHOSTDOWN ||
|
||||
error == EHOSTUNREACH)
|
||||
{
|
||||
if (contimeout && (time(NULL) - start_time) > contimeout)
|
||||
{
|
||||
_cupsLangPuts(stderr, _("ERROR: Printer not responding!\n"));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
recoverable = 1;
|
||||
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: recoverable: Network host \'%s\' is busy; "
|
||||
"will retry in %d seconds...\n"),
|
||||
hostname, delay);
|
||||
|
||||
fprintf(stderr,
|
||||
"INFO: Network host \'%s\' is busy; will retry in %d seconds...\n",
|
||||
hostname, delay);
|
||||
sleep(delay);
|
||||
|
||||
if (delay < 30)
|
||||
@@ -315,13 +284,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else
|
||||
{
|
||||
recoverable = 1;
|
||||
|
||||
_cupsLangPrintf(stderr, "DEBUG: Connection error: %s\n",
|
||||
strerror(errno));
|
||||
_cupsLangPuts(stderr,
|
||||
_("ERROR: recoverable: Unable to connect to printer; "
|
||||
"will retry in 30 seconds...\n"));
|
||||
perror("ERROR: Unable to connect to printer (retrying in 30 seconds)");
|
||||
sleep(30);
|
||||
}
|
||||
}
|
||||
@@ -329,32 +292,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
break;
|
||||
}
|
||||
|
||||
if (recoverable)
|
||||
{
|
||||
/*
|
||||
* If we've shown a recoverable error make sure the printer proxies
|
||||
* have a chance to see the recovered message. Not pretty but
|
||||
* necessary for now...
|
||||
*/
|
||||
|
||||
fputs("INFO: recovered: \n", stderr);
|
||||
sleep(5);
|
||||
}
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
_cupsLangPrintf(stderr, _("INFO: Connected to %s...\n"), hostname);
|
||||
|
||||
#ifdef AF_INET6
|
||||
if (addr->addr.addr.sa_family == AF_INET6)
|
||||
fprintf(stderr, "DEBUG: Connected to [%s]:%d (IPv6)...\n",
|
||||
httpAddrString(&addr->addr, addrname, sizeof(addrname)),
|
||||
ntohs(addr->addr.ipv6.sin6_port));
|
||||
else
|
||||
#endif /* AF_INET6 */
|
||||
if (addr->addr.addr.sa_family == AF_INET)
|
||||
fprintf(stderr, "DEBUG: Connected to %s:%d (IPv4)...\n",
|
||||
httpAddrString(&addr->addr, addrname, sizeof(addrname)),
|
||||
ntohs(addr->addr.ipv4.sin_port));
|
||||
|
||||
/*
|
||||
* Print everything...
|
||||
@@ -372,36 +310,54 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
lseek(print_fd, 0, SEEK_SET);
|
||||
}
|
||||
|
||||
tbytes = backendRunLoop(print_fd, device_fd, 1, side_cb);
|
||||
tbytes = backendRunLoop(print_fd, device_fd, 1);
|
||||
|
||||
if (print_fd != 0 && tbytes >= 0)
|
||||
_cupsLangPrintf(stderr,
|
||||
#ifdef HAVE_LONG_LONG
|
||||
_("INFO: Sent print file, %lld bytes...\n"),
|
||||
#else
|
||||
_("INFO: Sent print file, %ld bytes...\n"),
|
||||
#endif /* HAVE_LONG_LONG */
|
||||
CUPS_LLCAST tbytes);
|
||||
fprintf(stderr, "INFO: Sent print file, " CUPS_LLFMT " bytes...\n",
|
||||
CUPS_LLCAST tbytes);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get any pending back-channel data...
|
||||
*/
|
||||
|
||||
while (wait_bc(device_fd, 5) > 0);
|
||||
|
||||
if (waiteof)
|
||||
{
|
||||
/*
|
||||
* Shutdown the socket and wait for the other end to finish...
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Print file sent, waiting for printer to finish...\n"));
|
||||
fputs("INFO: Print file sent, waiting for printer to finish...\n", stderr);
|
||||
|
||||
shutdown(device_fd, 1);
|
||||
|
||||
while (wait_bc(device_fd, 90) > 0);
|
||||
for (;;)
|
||||
{
|
||||
/*
|
||||
* Wait a maximum of 90 seconds for backchannel data or a closed
|
||||
* connection...
|
||||
*/
|
||||
|
||||
timeout.tv_sec = 90;
|
||||
timeout.tv_usec = 0;
|
||||
|
||||
FD_ZERO(&input);
|
||||
FD_SET(device_fd, &input);
|
||||
|
||||
if (select(device_fd + 1, &input, NULL, NULL, &timeout) > 0)
|
||||
{
|
||||
/*
|
||||
* Grab the data coming back and spit it out to stderr...
|
||||
*/
|
||||
|
||||
if ((bc_bytes = read(device_fd, resource, sizeof(resource))) > 0)
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
|
||||
(int)bc_bytes);
|
||||
cupsBackChannelWrite(resource, bc_bytes, 1.0);
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -420,118 +376,12 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
close(print_fd);
|
||||
|
||||
if (tbytes >= 0)
|
||||
_cupsLangPuts(stderr, _("INFO: Ready to print.\n"));
|
||||
fputs("INFO: Ready to print.\n", stderr);
|
||||
|
||||
return (tbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'side_cb()' - Handle side-channel requests...
|
||||
*/
|
||||
|
||||
static void
|
||||
side_cb(int print_fd, /* I - Print file */
|
||||
int device_fd, /* I - Device file */
|
||||
int use_bc) /* I - Using back-channel? */
|
||||
{
|
||||
cups_sc_command_t command; /* Request command */
|
||||
cups_sc_status_t status; /* Request/response status */
|
||||
char data[2048]; /* Request/response data */
|
||||
int datalen; /* Request/response data size */
|
||||
const char *device_id; /* 1284DEVICEID env var */
|
||||
|
||||
|
||||
datalen = sizeof(data);
|
||||
|
||||
if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0))
|
||||
{
|
||||
_cupsLangPuts(stderr, _("WARNING: Failed to read side-channel request!\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
switch (command)
|
||||
{
|
||||
case CUPS_SC_CMD_DRAIN_OUTPUT :
|
||||
/*
|
||||
* Our sockets disable the Nagle algorithm and data is sent immediately.
|
||||
*/
|
||||
|
||||
if (backendDrainOutput(print_fd, device_fd))
|
||||
status = CUPS_SC_STATUS_IO_ERROR;
|
||||
else
|
||||
status = CUPS_SC_STATUS_OK;
|
||||
|
||||
datalen = 0;
|
||||
break;
|
||||
|
||||
case CUPS_SC_CMD_GET_BIDI :
|
||||
data[0] = use_bc;
|
||||
datalen = 1;
|
||||
break;
|
||||
|
||||
case CUPS_SC_CMD_GET_DEVICE_ID :
|
||||
if ((device_id = getenv("1284DEVICEID")) != NULL)
|
||||
{
|
||||
strlcpy(data, device_id, sizeof(data));
|
||||
datalen = (int)strlen(data);
|
||||
break;
|
||||
}
|
||||
|
||||
default :
|
||||
status = CUPS_SC_STATUS_NOT_IMPLEMENTED;
|
||||
datalen = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
cupsSideChannelWrite(command, status, data, datalen, 1.0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'wait_bc()' - Wait for back-channel data...
|
||||
*/
|
||||
|
||||
static int /* O - # bytes read or -1 on error */
|
||||
wait_bc(int device_fd, /* I - Socket */
|
||||
int secs) /* I - Seconds to wait */
|
||||
{
|
||||
struct timeval timeout; /* Timeout for select() */
|
||||
fd_set input; /* Input set for select() */
|
||||
ssize_t bytes; /* Number of back-channel bytes read */
|
||||
char buffer[1024]; /* Back-channel buffer */
|
||||
|
||||
|
||||
/*
|
||||
* Wait up to "secs" seconds for backchannel data...
|
||||
*/
|
||||
|
||||
timeout.tv_sec = secs;
|
||||
timeout.tv_usec = 0;
|
||||
|
||||
FD_ZERO(&input);
|
||||
FD_SET(device_fd, &input);
|
||||
|
||||
if (select(device_fd + 1, &input, NULL, NULL, &timeout) > 0)
|
||||
{
|
||||
/*
|
||||
* Grab the data coming back and spit it out to stderr...
|
||||
*/
|
||||
|
||||
if ((bytes = read(device_fd, buffer, sizeof(buffer))) > 0)
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
|
||||
(int)bytes);
|
||||
cupsBackChannelWrite(buffer, bytes, 1.0);
|
||||
}
|
||||
|
||||
return (bytes);
|
||||
}
|
||||
else
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
|
||||
+13
-5
@@ -4,20 +4,28 @@
|
||||
* IEEE-1284 support functions test program for the Common UNIX Printing
|
||||
* System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Test the device-ID functions.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+575
-1239
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+38
-128
@@ -5,14 +5,23 @@
|
||||
*
|
||||
* This file is included from "usb.c" when compiled on UNIX/Linux.
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
@@ -21,7 +30,6 @@
|
||||
* print_device() - Print a file to a USB device.
|
||||
* list_devices() - List all USB devices.
|
||||
* open_device() - Open a USB device...
|
||||
* side_cb() - Handle side-channel requests...
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -36,8 +44,7 @@
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static int open_device(const char *uri, int *use_bc);
|
||||
static void side_cb(int print_fd, int device_fd, int use_bc);
|
||||
int open_device(const char *uri, int *use_bc);
|
||||
|
||||
|
||||
/*
|
||||
@@ -48,7 +55,7 @@ int /* O - Exit status */
|
||||
print_device(const char *uri, /* I - Device URI */
|
||||
const char *hostname, /* I - Hostname/manufacturer */
|
||||
const char *resource, /* I - Resource/modelname */
|
||||
char *options, /* I - Device options/serial number */
|
||||
const char *options, /* I - Device options/serial number */
|
||||
int print_fd, /* I - File descriptor to print */
|
||||
int copies, /* I - Copies to print */
|
||||
int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
@@ -71,28 +78,14 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
do
|
||||
{
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
|
||||
/*
|
||||
* *BSD's ulpt driver currently does not support the
|
||||
* back-channel, incorrectly returns data ready on a select(),
|
||||
* and locks up on read()...
|
||||
* Disable backchannel data when printing to Canon or Minolta USB
|
||||
* printers - apparently these printers will return the IEEE-1284
|
||||
* device ID over and over and over when they get a read request...
|
||||
*/
|
||||
|
||||
use_bc = 0;
|
||||
|
||||
#else
|
||||
/*
|
||||
* Disable backchannel data when printing to Brother, Canon, or
|
||||
* Minolta USB printers - apparently these printers will return
|
||||
* the IEEE-1284 device ID over and over and over when they get
|
||||
* a read request...
|
||||
*/
|
||||
|
||||
use_bc = strcasecmp(hostname, "Brother") &&
|
||||
strcasecmp(hostname, "Canon") &&
|
||||
strcasecmp(hostname, "Konica Minolta") &&
|
||||
strcasecmp(hostname, "Minolta");
|
||||
#endif /* __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__ */
|
||||
use_bc = strcasecmp(hostname, "Canon") != 0 ||
|
||||
strstr(hostname, "Minolta") != NULL;
|
||||
|
||||
if ((device_fd = open_device(uri, &use_bc)) == -1)
|
||||
{
|
||||
@@ -105,9 +98,8 @@ print_device(const char *uri, /* I - Device URI */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
fputs("INFO: Unable to open USB device, queuing on next printer in class...\n",
|
||||
stderr);
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -120,23 +112,19 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (errno == EBUSY)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 10 seconds...\n"));
|
||||
sleep(10);
|
||||
fputs("INFO: USB port busy; will retry in 30 seconds...\n", stderr);
|
||||
sleep(30);
|
||||
}
|
||||
else if (errno == ENXIO || errno == EIO || errno == ENOENT ||
|
||||
errno == ENODEV)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer not connected; will retry in 30 "
|
||||
"seconds...\n"));
|
||||
fputs("INFO: Printer not connected; will retry in 30 seconds...\n", stderr);
|
||||
sleep(30);
|
||||
}
|
||||
else
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
fprintf(stderr, "ERROR: Unable to open USB device \"%s\": %s\n",
|
||||
uri, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
@@ -173,16 +161,11 @@ print_device(const char *uri, /* I - Device URI */
|
||||
lseek(print_fd, 0, SEEK_SET);
|
||||
}
|
||||
|
||||
tbytes = backendRunLoop(print_fd, device_fd, use_bc, side_cb);
|
||||
tbytes = backendRunLoop(print_fd, device_fd, use_bc);
|
||||
|
||||
if (print_fd != 0 && tbytes >= 0)
|
||||
_cupsLangPrintf(stderr,
|
||||
#ifdef HAVE_LONG_LONG
|
||||
_("INFO: Sent print file, %lld bytes...\n"),
|
||||
#else
|
||||
_("INFO: Sent print file, %ld bytes...\n"),
|
||||
#endif /* HAVE_LONG_LONG */
|
||||
CUPS_LLCAST tbytes);
|
||||
fprintf(stderr, "INFO: Sent print file, " CUPS_LLFMT " bytes...\n",
|
||||
CUPS_LLCAST tbytes);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -304,7 +287,7 @@ list_devices(void)
|
||||
* 'open_device()' - Open a USB device...
|
||||
*/
|
||||
|
||||
static int /* O - File descriptor or -1 on error */
|
||||
int /* O - File descriptor or -1 on error */
|
||||
open_device(const char *uri, /* I - Device URI */
|
||||
int *use_bc) /* O - Set to 0 for unidirectional */
|
||||
{
|
||||
@@ -394,8 +377,7 @@ open_device(const char *uri, /* I - Device URI */
|
||||
* Yes, return this file descriptor...
|
||||
*/
|
||||
|
||||
fprintf(stderr, "DEBUG: Printer using device file \"%s\"...\n",
|
||||
device);
|
||||
fprintf(stderr, "DEBUG: Printer using device file \"%s\"...\n", device);
|
||||
|
||||
return (fd);
|
||||
}
|
||||
@@ -415,8 +397,8 @@ open_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (busy)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 5 seconds...\n"));
|
||||
fputs("INFO: USB printer is busy; will retry in 5 seconds...\n",
|
||||
stderr);
|
||||
sleep(5);
|
||||
}
|
||||
}
|
||||
@@ -508,8 +490,8 @@ open_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (busy)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer is busy; will retry in 5 seconds...\n"));
|
||||
fputs("INFO: USB printer is busy; will retry in 5 seconds...\n",
|
||||
stderr);
|
||||
sleep(5);
|
||||
}
|
||||
}
|
||||
@@ -525,12 +507,7 @@ open_device(const char *uri, /* I - Device URI */
|
||||
}
|
||||
#else
|
||||
{
|
||||
if (use_bc)
|
||||
fd = open(uri + 4, O_RDWR | O_EXCL);
|
||||
else
|
||||
fd = -1;
|
||||
|
||||
if (fd < 0)
|
||||
if ((fd = open(uri + 4, O_RDWR | O_EXCL)) < 0)
|
||||
{
|
||||
fd = open(uri + 4, O_WRONLY | O_EXCL);
|
||||
*use_bc = 0;
|
||||
@@ -547,73 +524,6 @@ open_device(const char *uri, /* I - Device URI */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'side_cb()' - Handle side-channel requests...
|
||||
*/
|
||||
|
||||
static void
|
||||
side_cb(int print_fd, /* I - Print file */
|
||||
int device_fd, /* I - Device file */
|
||||
int use_bc) /* I - Using back-channel? */
|
||||
{
|
||||
cups_sc_command_t command; /* Request command */
|
||||
cups_sc_status_t status; /* Request/response status */
|
||||
char data[2048]; /* Request/response data */
|
||||
int datalen; /* Request/response data size */
|
||||
|
||||
|
||||
datalen = sizeof(data);
|
||||
|
||||
if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0))
|
||||
{
|
||||
_cupsLangPuts(stderr, _("WARNING: Failed to read side-channel request!\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
switch (command)
|
||||
{
|
||||
case CUPS_SC_CMD_DRAIN_OUTPUT :
|
||||
if (backendDrainOutput(print_fd, device_fd))
|
||||
status = CUPS_SC_STATUS_IO_ERROR;
|
||||
else if (tcdrain(device_fd))
|
||||
status = CUPS_SC_STATUS_IO_ERROR;
|
||||
else
|
||||
status = CUPS_SC_STATUS_OK;
|
||||
|
||||
datalen = 0;
|
||||
break;
|
||||
|
||||
case CUPS_SC_CMD_GET_BIDI :
|
||||
data[0] = use_bc;
|
||||
datalen = 1;
|
||||
break;
|
||||
|
||||
case CUPS_SC_CMD_GET_DEVICE_ID :
|
||||
memset(data, 0, sizeof(data));
|
||||
|
||||
if (backendGetDeviceID(device_fd, data, sizeof(data) - 1,
|
||||
NULL, 0, NULL, NULL, 0))
|
||||
{
|
||||
status = CUPS_SC_STATUS_NOT_IMPLEMENTED;
|
||||
datalen = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
status = CUPS_SC_STATUS_OK;
|
||||
datalen = strlen(data);
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
status = CUPS_SC_STATUS_NOT_IMPLEMENTED;
|
||||
datalen = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
cupsSideChannelWrite(command, status, data, datalen, 1.0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
|
||||
+20
-16
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* USB port backend for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
@@ -36,7 +45,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <cups/string.h>
|
||||
#include <cups/i18n.h>
|
||||
#include <signal.h>
|
||||
|
||||
#ifdef WIN32
|
||||
@@ -54,7 +62,7 @@
|
||||
|
||||
void list_devices(void);
|
||||
int print_device(const char *uri, const char *hostname,
|
||||
const char *resource, char *options,
|
||||
const char *resource, const char *options,
|
||||
int print_fd, int copies, int argc, char *argv[]);
|
||||
|
||||
|
||||
@@ -99,7 +107,7 @@ int /* O - Exit status */
|
||||
print_device(const char *uri, /* I - Device URI */
|
||||
const char *hostname, /* I - Hostname/manufacturer */
|
||||
const char *resource, /* I - Resource/modelname */
|
||||
char *options, /* I - Device options/serial number */
|
||||
const char *options, /* I - Device options/serial number */
|
||||
int print_fd, /* I - File descriptor to print */
|
||||
int copies, /* I - Copies to print */
|
||||
int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
@@ -184,9 +192,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
fputs("Usage: usb job-id user title copies options [file]\n", stderr);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -201,9 +207,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
hostname, sizeof(hostname), &port,
|
||||
resource, sizeof(resource)) < HTTP_URI_OK)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("ERROR: No device URI found in argv[0] or in DEVICE_URI "
|
||||
"environment variable!\n"));
|
||||
fputs("ERROR: No device URI found in argv[0] or in DEVICE_URI environment variable!\n", stderr);
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -239,8 +243,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if ((print_fd = open(argv[6], O_RDONLY)) < 0)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to open print file %s - %s\n"),
|
||||
argv[6], strerror(errno));
|
||||
fprintf(stderr, "ERROR: unable to open print file %s - %s\n",
|
||||
argv[6], strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
|
||||
+16
-13
@@ -1,13 +1,16 @@
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
lpc.o: lpc.c ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h \
|
||||
../cups/array.h ../cups/file.h ../cups/language.h ../cups/i18n.h \
|
||||
../cups/transcode.h ../cups/debug.h ../cups/string.h ../config.h
|
||||
lpq.o: lpq.c ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/i18n.h ../cups/transcode.h ../cups/debug.h
|
||||
lpr.o: lpr.c ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/i18n.h ../cups/transcode.h
|
||||
lprm.o: lprm.c ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h \
|
||||
../cups/array.h ../cups/file.h ../cups/language.h ../cups/i18n.h \
|
||||
../cups/transcode.h ../cups/string.h ../config.h
|
||||
# DO NOT DELETE
|
||||
|
||||
lpc.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
|
||||
lpc.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
lpc.o: ../cups/i18n.h ../cups/transcode.h ../cups/debug.h ../cups/string.h
|
||||
lpc.o: ../config.h
|
||||
lpq.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h
|
||||
lpq.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
|
||||
lpq.o: ../cups/file.h ../cups/language.h ../cups/i18n.h ../cups/transcode.h
|
||||
lpq.o: ../cups/debug.h
|
||||
lpr.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h
|
||||
lpr.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
|
||||
lpr.o: ../cups/file.h ../cups/language.h ../cups/i18n.h ../cups/transcode.h
|
||||
lprm.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
|
||||
lprm.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
lprm.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
|
||||
+14
-11
@@ -3,14 +3,23 @@
|
||||
#
|
||||
# Berkeley commands makefile for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
# Copyright 2007 by Apple Inc.
|
||||
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# property of Easy Software Products and are protected by Federal
|
||||
# copyright law. Distribution and use rights are outlined in the file
|
||||
# "LICENSE.txt" which should have been included with this file. If this
|
||||
# file is missing or damaged please contact Easy Software Products
|
||||
# at:
|
||||
#
|
||||
# Attn: CUPS Licensing Information
|
||||
# Easy Software Products
|
||||
# 44141 Airport View Drive, Suite 204
|
||||
# Hollywood, Maryland 20636 USA
|
||||
#
|
||||
# Voice: (301) 373-9600
|
||||
# EMail: cups-info@cups.org
|
||||
# WWW: http://www.cups.org
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
@@ -53,12 +62,6 @@ install: all
|
||||
$(INSTALL_BIN) lprm $(BINDIR)
|
||||
$(INSTALL_DIR) -m 755 $(SBINDIR)
|
||||
$(INSTALL_BIN) lpc $(SBINDIR)
|
||||
if test "x$(SYMROOT)" != "x"; then \
|
||||
$(INSTALL_DIR) $(SYMROOT); \
|
||||
for file in $(TARGETS); do \
|
||||
cp $$file $(SYMROOT); \
|
||||
done \
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
|
||||
+81
-23
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* "lpc" command for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE.txt" which should have been included with this file. If this
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
@@ -228,8 +237,10 @@ show_status(http_t *http, /* I - HTTP connection to server */
|
||||
const char *dests) /* I - Destinations */
|
||||
{
|
||||
ipp_t *request, /* IPP Request */
|
||||
*response; /* IPP Response */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
*response, /* IPP Response */
|
||||
*jobs; /* IPP Get Jobs response */
|
||||
ipp_attribute_t *attr, /* Current attribute */
|
||||
*jattr; /* Current job attribute */
|
||||
cups_lang_t *language; /* Default language */
|
||||
char *printer, /* Printer name */
|
||||
*device, /* Device URI */
|
||||
@@ -240,13 +251,14 @@ show_status(http_t *http, /* I - HTTP connection to server */
|
||||
const char *dptr, /* Pointer into destination list */
|
||||
*ptr; /* Pointer into printer name */
|
||||
int match; /* Non-zero if this job matches */
|
||||
char printer_uri[HTTP_MAX_URI];
|
||||
/* Printer URI */
|
||||
static const char *requested[] = /* Requested attributes */
|
||||
{
|
||||
"device-uri",
|
||||
"printer-is-accepting-jobs",
|
||||
"printer-name",
|
||||
"device-uri",
|
||||
"printer-state",
|
||||
"queued-job-count"
|
||||
"printer-is-accepting-jobs"
|
||||
};
|
||||
|
||||
|
||||
@@ -317,21 +329,21 @@ show_status(http_t *http, /* I - HTTP connection to server */
|
||||
|
||||
while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER)
|
||||
{
|
||||
if (!strcmp(attr->name, "printer-name") &&
|
||||
attr->value_tag == IPP_TAG_NAME)
|
||||
printer = attr->values[0].string.text;
|
||||
|
||||
if (!strcmp(attr->name, "device-uri") &&
|
||||
attr->value_tag == IPP_TAG_URI)
|
||||
device = attr->values[0].string.text;
|
||||
else if (!strcmp(attr->name, "printer-is-accepting-jobs") &&
|
||||
attr->value_tag == IPP_TAG_BOOLEAN)
|
||||
accepting = attr->values[0].boolean;
|
||||
else if (!strcmp(attr->name, "printer-name") &&
|
||||
attr->value_tag == IPP_TAG_NAME)
|
||||
printer = attr->values[0].string.text;
|
||||
else if (!strcmp(attr->name, "printer-state") &&
|
||||
attr->value_tag == IPP_TAG_ENUM)
|
||||
|
||||
if (!strcmp(attr->name, "printer-state") &&
|
||||
attr->value_tag == IPP_TAG_ENUM)
|
||||
pstate = (ipp_pstate_t)attr->values[0].integer;
|
||||
else if (!strcmp(attr->name, "queued-job-count") &&
|
||||
attr->value_tag == IPP_TAG_INTEGER)
|
||||
jobcount = attr->values[0].integer;
|
||||
|
||||
if (!strcmp(attr->name, "printer-is-accepting-jobs") &&
|
||||
attr->value_tag == IPP_TAG_BOOLEAN)
|
||||
accepting = attr->values[0].boolean;
|
||||
|
||||
attr = attr->next;
|
||||
}
|
||||
@@ -383,8 +395,7 @@ show_status(http_t *http, /* I - HTTP connection to server */
|
||||
*ptr != '\0' && *dptr != '\0' && *ptr == *dptr;
|
||||
ptr ++, dptr ++);
|
||||
|
||||
if (*ptr == '\0' && (*dptr == '\0' || *dptr == ',' ||
|
||||
isspace(*dptr & 255)))
|
||||
if (*ptr == '\0' && (*dptr == '\0' || *dptr == ',' || isspace(*dptr & 255)))
|
||||
{
|
||||
match = 1;
|
||||
break;
|
||||
@@ -410,6 +421,53 @@ show_status(http_t *http, /* I - HTTP connection to server */
|
||||
|
||||
if (match)
|
||||
{
|
||||
/*
|
||||
* Build an IPP_GET_JOBS request, which requires the following
|
||||
* attributes:
|
||||
*
|
||||
* attributes-charset
|
||||
* attributes-natural-language
|
||||
* printer-uri
|
||||
* limit
|
||||
*/
|
||||
|
||||
request = ippNew();
|
||||
|
||||
request->request.op.operation_id = IPP_GET_JOBS;
|
||||
request->request.op.request_id = 1;
|
||||
|
||||
language = cupsLangDefault();
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
|
||||
"attributes-charset", NULL,
|
||||
cupsLangEncoding(language));
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
|
||||
"attributes-natural-language", NULL,
|
||||
language->language);
|
||||
|
||||
httpAssembleURIf(HTTP_URI_CODING_ALL, printer_uri, sizeof(printer_uri),
|
||||
"ipp", NULL, "localhost", 631, "/printers/%s",
|
||||
printer);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
|
||||
"printer-uri", NULL, printer_uri);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
||||
"requested-attributes", NULL, "job-id");
|
||||
|
||||
if ((jobs = cupsDoRequest(http, request, "/")) != NULL)
|
||||
{
|
||||
/*
|
||||
* Grab the number of jobs for the printer.
|
||||
*/
|
||||
|
||||
for (jattr = jobs->attrs; jattr != NULL; jattr = jattr->next)
|
||||
if (jattr->name && !strcmp(jattr->name, "job-id"))
|
||||
jobcount ++;
|
||||
|
||||
ippDelete(jobs);
|
||||
}
|
||||
|
||||
/*
|
||||
* Display it...
|
||||
*/
|
||||
|
||||
+14
-5
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* "lpq" command for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE.txt" which should have been included with this file. If this
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
|
||||
+16
-7
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* "lpr" command for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE.txt" which should have been included with this file. If this
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
@@ -223,7 +232,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
snprintf(email, sizeof(email), "mailto:%s@%s", cupsUser(),
|
||||
httpGetHostname(NULL, buffer, sizeof(buffer)));
|
||||
num_options = cupsAddOption("notify-recipient-uri", email,
|
||||
num_options = cupsAddOption("notify-recipient", email,
|
||||
num_options, &options);
|
||||
}
|
||||
break;
|
||||
|
||||
+14
-5
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* "lprm" command for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE.txt" which should have been included with this file. If this
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
|
||||
+57
-56
@@ -1,56 +1,57 @@
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
help-index.o: help-index.c cgi-private.h cgi.h ../cups/cups.h \
|
||||
../cups/ipp.h ../cups/http.h ../cups/ppd.h ../cups/array.h \
|
||||
../cups/file.h ../cups/language.h ../cups/array.h help-index.h \
|
||||
../cups/debug.h ../cups/i18n.h ../cups/transcode.h ../cups/string.h \
|
||||
../config.h ../cups/dir.h
|
||||
html.o: html.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
ipp-var.o: ipp-var.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
search.o: search.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
template.o: template.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
var.o: var.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
admin.o: admin.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h \
|
||||
../cups/adminutil.h ../cups/cups.h ../cups/file.h
|
||||
classes.o: classes.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
help.o: help.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
jobs.o: jobs.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
printers.o: printers.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/array.h help-index.h ../cups/debug.h \
|
||||
../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
testcgi.o: testcgi.c cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \
|
||||
../cups/array.h help-index.h
|
||||
testhi.o: testhi.c cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h \
|
||||
../cups/array.h help-index.h
|
||||
testtemplate.o: testtemplate.c cgi.h ../cups/cups.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h \
|
||||
../cups/language.h ../cups/array.h help-index.h
|
||||
# DO NOT DELETE
|
||||
|
||||
help-index.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
help-index.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
help-index.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
|
||||
help-index.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
help-index.o: ../cups/dir.h
|
||||
html.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
html.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
html.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
|
||||
html.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
ipp-var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
ipp-var.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
ipp-var.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
|
||||
ipp-var.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
search.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
search.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
search.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
|
||||
search.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
template.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
template.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
template.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
|
||||
template.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
var.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
var.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
|
||||
var.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
admin.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
admin.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
admin.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
|
||||
admin.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
admin.o: ../cups/adminutil.h ../cups/cups.h ../cups/file.h
|
||||
classes.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
classes.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
classes.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
|
||||
classes.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
help.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
help.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
help.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
|
||||
help.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
jobs.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
jobs.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
jobs.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
|
||||
jobs.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
printers.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
printers.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
printers.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
|
||||
printers.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
testcgi.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
|
||||
testcgi.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
testcgi.o: ../cups/array.h help-index.h
|
||||
testhi.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
|
||||
testhi.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
testhi.o: ../cups/array.h help-index.h
|
||||
testtemplate.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
testtemplate.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
testtemplate.o: ../cups/language.h ../cups/array.h help-index.h
|
||||
|
||||
+17
-14
@@ -3,14 +3,23 @@
|
||||
#
|
||||
# CGI makefile for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
# Copyright 2007 by Apple Inc.
|
||||
# Copyright 1997-2006 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# property of Easy Software Products and are protected by Federal
|
||||
# copyright law. Distribution and use rights are outlined in the file
|
||||
# "LICENSE.txt" which should have been included with this file. If this
|
||||
# file is missing or damaged please contact Easy Software Products
|
||||
# at:
|
||||
#
|
||||
# Attn: CUPS Licensing Information
|
||||
# Easy Software Products
|
||||
# 44141 Airport View Drive, Suite 204
|
||||
# Hollywood, Maryland 20636 USA
|
||||
#
|
||||
# Voice: (301) 373-9600
|
||||
# EMail: cups-info@cups.org
|
||||
# WWW: http://www.cups.org
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
@@ -54,12 +63,6 @@ install: all
|
||||
for file in $(CGIS); do \
|
||||
$(INSTALL_BIN) $$file $(SERVERBIN)/cgi-bin; \
|
||||
done
|
||||
if test "x$(SYMROOT)" != "x"; then \
|
||||
$(INSTALL_DIR) $(SYMROOT); \
|
||||
for file in $(TARGETS); do \
|
||||
cp $$file $(SYMROOT); \
|
||||
done \
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
@@ -136,7 +139,7 @@ printers.cgi: printers.o ../Makedefs ../cups/$(LIBCUPS) libcgi.a
|
||||
testcgi: testcgi.o ../Makedefs libcgi.a ../cups/libcups.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testcgi.o libcgi.a ../cups/libcups.a \
|
||||
$(COMMONLIBS) $(SSLLIBS) $(LIBZ) $(LIBGSSAPI)
|
||||
$(COMMONLIBS) $(SSLLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
@@ -146,7 +149,7 @@ testcgi: testcgi.o ../Makedefs libcgi.a ../cups/libcups.a
|
||||
testhi: testhi.o ../Makedefs libcgi.a ../cups/libcups.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testhi.o libcgi.a ../cups/libcups.a \
|
||||
$(COMMONLIBS) $(SSLLIBS) $(LIBZ) $(LIBGSSAPI)
|
||||
$(COMMONLIBS) $(SSLLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
@@ -156,7 +159,7 @@ testhi: testhi.o ../Makedefs libcgi.a ../cups/libcups.a
|
||||
testtemplate: testtemplate.o ../Makedefs libcgi.a ../cups/libcups.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testtemplate.o libcgi.a ../cups/libcups.a \
|
||||
$(COMMONLIBS) $(SSLLIBS) $(LIBZ) $(LIBGSSAPI)
|
||||
$(COMMONLIBS) $(SSLLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
|
||||
+1434
-1895
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+15
-6
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* Private CGI definitions for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
* Copyright 1997-2005 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE.txt" which should have been included with this file. If this
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+14
-5
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* CGI support library definitions.
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE.txt" which should have been included with this file. If this
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_CGI_H_
|
||||
|
||||
+14
-5
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* Class status CGI for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE.txt" which should have been included with this file. If this
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
|
||||
+75
-423
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* On-line help index routines for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE.txt" which should have been included with this file. If this
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
@@ -19,16 +28,13 @@
|
||||
* helpLoadIndex() - Load a help index from disk.
|
||||
* helpSaveIndex() - Save a help index to disk.
|
||||
* helpSearchIndex() - Search an index.
|
||||
* help_add_word() - Add a word to a node.
|
||||
* help_compile_search() - Convert a search string into a regular expression.
|
||||
* help_delete_node() - Free all memory used by a node.
|
||||
* help_delete_word() - Free all memory used by a word.
|
||||
* help_load_directory() - Load a directory of files into an index.
|
||||
* help_load_file() - Load a HTML files into an index.
|
||||
* help_new_node() - Create a new node and add it to an index.
|
||||
* help_sort_nodes_by_name() - Sort nodes by section, filename, and anchor.
|
||||
* help_sort_nodes_by_score() - Sort nodes by score and text.
|
||||
* help_sort_words() - Sort words alphabetically.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -39,118 +45,11 @@
|
||||
#include <cups/dir.h>
|
||||
|
||||
|
||||
/*
|
||||
* List of common English words that should not be indexed...
|
||||
*/
|
||||
|
||||
static char help_common_words[][6] =
|
||||
{
|
||||
"about",
|
||||
"all",
|
||||
"an",
|
||||
"and",
|
||||
"are",
|
||||
"as",
|
||||
"at",
|
||||
"be",
|
||||
"been",
|
||||
"but",
|
||||
"by",
|
||||
"call",
|
||||
"can",
|
||||
"come",
|
||||
"could",
|
||||
"day",
|
||||
"did",
|
||||
"do",
|
||||
"down",
|
||||
"each",
|
||||
"find",
|
||||
"first",
|
||||
"for",
|
||||
"from",
|
||||
"go",
|
||||
"had",
|
||||
"has",
|
||||
"have",
|
||||
"he",
|
||||
"her",
|
||||
"him",
|
||||
"his",
|
||||
"hot",
|
||||
"how",
|
||||
"if",
|
||||
"in",
|
||||
"is",
|
||||
"it",
|
||||
"know",
|
||||
"like",
|
||||
"long",
|
||||
"look",
|
||||
"make",
|
||||
"many",
|
||||
"may",
|
||||
"more",
|
||||
"most",
|
||||
"my",
|
||||
"no",
|
||||
"now",
|
||||
"of",
|
||||
"on",
|
||||
"one",
|
||||
"or",
|
||||
"other",
|
||||
"out",
|
||||
"over",
|
||||
"said",
|
||||
"see",
|
||||
"she",
|
||||
"side",
|
||||
"so",
|
||||
"some",
|
||||
"sound",
|
||||
"than",
|
||||
"that",
|
||||
"the",
|
||||
"their",
|
||||
"them",
|
||||
"then",
|
||||
"there",
|
||||
"these",
|
||||
"they",
|
||||
"thing",
|
||||
"this",
|
||||
"time",
|
||||
"to",
|
||||
"two",
|
||||
"up",
|
||||
"use",
|
||||
"was",
|
||||
"water",
|
||||
"way",
|
||||
"we",
|
||||
"were",
|
||||
"what",
|
||||
"when",
|
||||
"which",
|
||||
"who",
|
||||
"will",
|
||||
"with",
|
||||
"word",
|
||||
"would",
|
||||
"write",
|
||||
"you",
|
||||
"your"
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static help_word_t *help_add_word(help_node_t *n, const char *text);
|
||||
static void help_delete_node(help_node_t *n);
|
||||
static void help_delete_word(help_word_t *w);
|
||||
static int help_load_directory(help_index_t *hi,
|
||||
const char *directory,
|
||||
const char *relative);
|
||||
@@ -164,7 +63,6 @@ static help_node_t *help_new_node(const char *filename, const char *anchor,
|
||||
size_t length);
|
||||
static int help_sort_by_name(help_node_t *p1, help_node_t *p2);
|
||||
static int help_sort_by_score(help_node_t *p1, help_node_t *p2);
|
||||
static int help_sort_words(help_word_t *w1, help_word_t *w2);
|
||||
|
||||
|
||||
/*
|
||||
@@ -186,6 +84,9 @@ helpDeleteIndex(help_index_t *hi) /* I - Help index */
|
||||
node;
|
||||
node = (help_node_t *)cupsArrayNext(hi->nodes))
|
||||
{
|
||||
cupsArrayRemove(hi->nodes, node);
|
||||
cupsArrayRemove(hi->sorted, node);
|
||||
|
||||
if (!hi->search)
|
||||
help_delete_node(node);
|
||||
}
|
||||
@@ -256,7 +157,6 @@ helpLoadIndex(const char *hifile, /* I - Index filename */
|
||||
size_t length; /* Length in bytes */
|
||||
int update; /* Update? */
|
||||
help_node_t *node; /* Current node */
|
||||
help_word_t *word; /* Current word */
|
||||
|
||||
|
||||
DEBUG_printf(("helpLoadIndex(hifile=\"%s\", directory=\"%s\")\n",
|
||||
@@ -292,14 +192,12 @@ helpLoadIndex(const char *hifile, /* I - Index filename */
|
||||
|
||||
cupsFileLock(fp, 1);
|
||||
|
||||
if (cupsFileGets(fp, line, sizeof(line)) && !strcmp(line, "HELPV2"))
|
||||
if (cupsFileGets(fp, line, sizeof(line)) && !strcmp(line, "HELPV1"))
|
||||
{
|
||||
/*
|
||||
* Got a valid header line, now read the data lines...
|
||||
*/
|
||||
|
||||
node = NULL;
|
||||
|
||||
while (cupsFileGets(fp, line, sizeof(line)))
|
||||
{
|
||||
/*
|
||||
@@ -307,80 +205,41 @@ helpLoadIndex(const char *hifile, /* I - Index filename */
|
||||
*
|
||||
* filename mtime offset length "section" "text"
|
||||
* filename#anchor offset length "text"
|
||||
* SP count word
|
||||
*/
|
||||
|
||||
if (line[0] == ' ')
|
||||
filename = line;
|
||||
|
||||
if ((ptr = strchr(line, ' ')) == NULL)
|
||||
break;
|
||||
|
||||
while (isspace(*ptr & 255))
|
||||
*ptr++ = '\0';
|
||||
|
||||
if ((anchor = strrchr(filename, '#')) != NULL)
|
||||
{
|
||||
/*
|
||||
* Read a word in the current node...
|
||||
*/
|
||||
|
||||
if (!node || (ptr = strrchr(line, ' ')) == NULL)
|
||||
continue;
|
||||
|
||||
if ((word = help_add_word(node, ptr + 1)) != NULL)
|
||||
word->count = atoi(line + 1);
|
||||
}
|
||||
*anchor++ = '\0';
|
||||
mtime = 0;
|
||||
}
|
||||
else
|
||||
mtime = strtol(ptr, &ptr, 10);
|
||||
|
||||
offset = strtoll(ptr, &ptr, 10);
|
||||
length = strtoll(ptr, &ptr, 10);
|
||||
|
||||
while (isspace(*ptr & 255))
|
||||
ptr ++;
|
||||
|
||||
if (!anchor)
|
||||
{
|
||||
/*
|
||||
* Add a node...
|
||||
* Get section...
|
||||
*/
|
||||
|
||||
filename = line;
|
||||
|
||||
if ((ptr = strchr(line, ' ')) == NULL)
|
||||
break;
|
||||
|
||||
while (isspace(*ptr & 255))
|
||||
*ptr++ = '\0';
|
||||
|
||||
if ((anchor = strrchr(filename, '#')) != NULL)
|
||||
{
|
||||
*anchor++ = '\0';
|
||||
mtime = 0;
|
||||
}
|
||||
else
|
||||
mtime = strtol(ptr, &ptr, 10);
|
||||
|
||||
offset = strtoll(ptr, &ptr, 10);
|
||||
length = strtoll(ptr, &ptr, 10);
|
||||
|
||||
while (isspace(*ptr & 255))
|
||||
ptr ++;
|
||||
|
||||
if (!anchor)
|
||||
{
|
||||
/*
|
||||
* Get section...
|
||||
*/
|
||||
|
||||
if (*ptr != '\"')
|
||||
break;
|
||||
|
||||
ptr ++;
|
||||
sectptr = ptr;
|
||||
|
||||
while (*ptr && *ptr != '\"')
|
||||
ptr ++;
|
||||
|
||||
if (*ptr != '\"')
|
||||
break;
|
||||
|
||||
*ptr++ = '\0';
|
||||
|
||||
strlcpy(section, sectptr, sizeof(section));
|
||||
|
||||
while (isspace(*ptr & 255))
|
||||
ptr ++;
|
||||
}
|
||||
|
||||
if (*ptr != '\"')
|
||||
break;
|
||||
|
||||
ptr ++;
|
||||
text = ptr;
|
||||
sectptr = ptr;
|
||||
|
||||
while (*ptr && *ptr != '\"')
|
||||
ptr ++;
|
||||
@@ -390,14 +249,33 @@ helpLoadIndex(const char *hifile, /* I - Index filename */
|
||||
|
||||
*ptr++ = '\0';
|
||||
|
||||
if ((node = help_new_node(filename, anchor, section, text,
|
||||
mtime, offset, length)) == NULL)
|
||||
break;
|
||||
strlcpy(section, sectptr, sizeof(section));
|
||||
|
||||
node->score = -1;
|
||||
|
||||
cupsArrayAdd(hi->nodes, node);
|
||||
while (isspace(*ptr & 255))
|
||||
ptr ++;
|
||||
}
|
||||
|
||||
if (*ptr != '\"')
|
||||
break;
|
||||
|
||||
ptr ++;
|
||||
text = ptr;
|
||||
|
||||
while (*ptr && *ptr != '\"')
|
||||
ptr ++;
|
||||
|
||||
if (*ptr != '\"')
|
||||
break;
|
||||
|
||||
*ptr++ = '\0';
|
||||
|
||||
if ((node = help_new_node(filename, anchor, section, text,
|
||||
mtime, offset, length)) == NULL)
|
||||
break;
|
||||
|
||||
node->score = -1;
|
||||
|
||||
cupsArrayAdd(hi->nodes, node);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -461,7 +339,6 @@ helpSaveIndex(help_index_t *hi, /* I - Index */
|
||||
{
|
||||
cups_file_t *fp; /* Index file */
|
||||
help_node_t *node; /* Current node */
|
||||
help_word_t *word; /* Current word */
|
||||
|
||||
|
||||
DEBUG_printf(("helpSaveIndex(hi=%p, hifile=\"%s\")\n", hi, hifile));
|
||||
@@ -479,7 +356,7 @@ helpSaveIndex(help_index_t *hi, /* I - Index */
|
||||
|
||||
cupsFileLock(fp, 1);
|
||||
|
||||
cupsFilePuts(fp, "HELPV2\n");
|
||||
cupsFilePuts(fp, "HELPV1\n");
|
||||
|
||||
for (node = (help_node_t *)cupsArrayFirst(hi->nodes);
|
||||
node;
|
||||
@@ -505,16 +382,6 @@ helpSaveIndex(help_index_t *hi, /* I - Index */
|
||||
node->section ? node->section : "", node->text) < 0)
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Then write the words associated with the node...
|
||||
*/
|
||||
|
||||
for (word = (help_word_t *)cupsArrayFirst(node->words);
|
||||
word;
|
||||
word = (help_word_t *)cupsArrayNext(node->words))
|
||||
if (cupsFilePrintf(fp, " %d %s\n", word->count, word->text) < 0)
|
||||
break;
|
||||
}
|
||||
|
||||
cupsFileFlush(fp);
|
||||
@@ -540,7 +407,6 @@ helpSearchIndex(help_index_t *hi, /* I - Index */
|
||||
{
|
||||
help_index_t *search; /* Search index */
|
||||
help_node_t *node; /* Current node */
|
||||
help_word_t *word; /* Current word */
|
||||
void *sc; /* Search context */
|
||||
int matches; /* Number of matches */
|
||||
|
||||
@@ -621,27 +487,16 @@ helpSearchIndex(help_index_t *hi, /* I - Index */
|
||||
continue;
|
||||
else if (filename && strcmp(node->filename, filename))
|
||||
continue;
|
||||
else
|
||||
else if ((matches = cgiDoSearch(sc, node->text)) > 0)
|
||||
{
|
||||
matches = cgiDoSearch(sc, node->text);
|
||||
/*
|
||||
* Found a match, add the node to the search index...
|
||||
*/
|
||||
|
||||
for (word = (help_word_t *)cupsArrayFirst(node->words);
|
||||
word;
|
||||
word = (help_word_t *)cupsArrayNext(node->words))
|
||||
if (cgiDoSearch(sc, word->text) > 0)
|
||||
matches += word->count;
|
||||
node->score = matches;
|
||||
|
||||
if (matches > 0)
|
||||
{
|
||||
/*
|
||||
* Found a match, add the node to the search index...
|
||||
*/
|
||||
|
||||
node->score = matches;
|
||||
|
||||
cupsArrayAdd(search->nodes, node);
|
||||
cupsArrayAdd(search->sorted, node);
|
||||
}
|
||||
cupsArrayAdd(search->nodes, node);
|
||||
cupsArrayAdd(search->sorted, node);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -658,61 +513,6 @@ helpSearchIndex(help_index_t *hi, /* I - Index */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'help_add_word()' - Add a word to a node.
|
||||
*/
|
||||
|
||||
static help_word_t * /* O - New word */
|
||||
help_add_word(help_node_t *n, /* I - Node */
|
||||
const char *text) /* I - Word text */
|
||||
{
|
||||
help_word_t *w, /* New word */
|
||||
key; /* Search key */
|
||||
|
||||
|
||||
DEBUG_printf(("help_add_word(n=%p, text=\"%s\")\n", n, text));
|
||||
|
||||
/*
|
||||
* Create the words array as needed...
|
||||
*/
|
||||
|
||||
if (!n->words)
|
||||
n->words = cupsArrayNew((cups_array_func_t)help_sort_words, NULL);
|
||||
|
||||
/*
|
||||
* See if the word is already added...
|
||||
*/
|
||||
|
||||
key.text = (char *)text;
|
||||
|
||||
if ((w = (help_word_t *)cupsArrayFind(n->words, &key)) == NULL)
|
||||
{
|
||||
/*
|
||||
* Create a new word...
|
||||
*/
|
||||
|
||||
if ((w = calloc(1, sizeof(help_word_t))) == NULL)
|
||||
return (NULL);
|
||||
|
||||
if ((w->text = strdup(text)) == NULL)
|
||||
{
|
||||
free(w);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
cupsArrayAdd(n->words, w);
|
||||
}
|
||||
|
||||
/*
|
||||
* Bump the counter for this word and return it...
|
||||
*/
|
||||
|
||||
w->count ++;
|
||||
|
||||
return (w);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'help_delete_node()' - Free all memory used by a node.
|
||||
*/
|
||||
@@ -720,9 +520,6 @@ help_add_word(help_node_t *n, /* I - Node */
|
||||
static void
|
||||
help_delete_node(help_node_t *n) /* I - Node */
|
||||
{
|
||||
help_word_t *w; /* Current word */
|
||||
|
||||
|
||||
DEBUG_printf(("help_delete_node(n=%p)\n", n));
|
||||
|
||||
if (!n)
|
||||
@@ -740,36 +537,10 @@ help_delete_node(help_node_t *n) /* I - Node */
|
||||
if (n->text)
|
||||
free(n->text);
|
||||
|
||||
for (w = (help_word_t *)cupsArrayFirst(n->words);
|
||||
w;
|
||||
w = (help_word_t *)cupsArrayNext(n->words))
|
||||
help_delete_word(w);
|
||||
|
||||
cupsArrayDelete(n->words);
|
||||
|
||||
free(n);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'help_delete_word()' - Free all memory used by a word.
|
||||
*/
|
||||
|
||||
static void
|
||||
help_delete_word(help_word_t *w) /* I - Word */
|
||||
{
|
||||
DEBUG_printf(("help_delete_word(w=%p)\n", w));
|
||||
|
||||
if (!w)
|
||||
return;
|
||||
|
||||
if (w->text)
|
||||
free(w->text);
|
||||
|
||||
free(w);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'help_load_directory()' - Load a directory of files into an index.
|
||||
*/
|
||||
@@ -890,15 +661,12 @@ help_load_file(
|
||||
cups_file_t *fp; /* HTML file */
|
||||
help_node_t *node; /* Current node */
|
||||
char line[1024], /* Line from file */
|
||||
temp[1024], /* Temporary word */
|
||||
section[1024], /* Section */
|
||||
*ptr, /* Pointer into line */
|
||||
*anchor, /* Anchor name */
|
||||
*text; /* Text for anchor */
|
||||
off_t offset; /* File offset */
|
||||
char quote; /* Quote character */
|
||||
help_word_t *word; /* Current word */
|
||||
int wordlen; /* Length of word */
|
||||
|
||||
|
||||
DEBUG_printf(("help_load_file(hi=%p, filename=\"%s\", relative=\"%s\", mtime=%ld)\n",
|
||||
@@ -1050,17 +818,6 @@ help_load_file(
|
||||
if (node->text)
|
||||
free(node->text);
|
||||
|
||||
if (node->words)
|
||||
{
|
||||
for (word = (help_word_t *)cupsArrayFirst(node->words);
|
||||
word;
|
||||
word = (help_word_t *)cupsArrayNext(node->words))
|
||||
help_delete_word(word);
|
||||
|
||||
cupsArrayDelete(node->words);
|
||||
node->words = NULL;
|
||||
}
|
||||
|
||||
node->section = section[0] ? strdup(section) : NULL;
|
||||
node->text = strdup(text);
|
||||
node->mtime = mtime;
|
||||
@@ -1104,99 +861,9 @@ help_load_file(
|
||||
*/
|
||||
|
||||
cupsArrayAdd(hi->nodes, node);
|
||||
|
||||
if (!anchor)
|
||||
node = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
if (node)
|
||||
{
|
||||
/*
|
||||
* Scan this line for words...
|
||||
*/
|
||||
|
||||
for (ptr = line; *ptr; ptr ++)
|
||||
{
|
||||
/*
|
||||
* Skip HTML stuff...
|
||||
*/
|
||||
|
||||
if (*ptr == '<')
|
||||
{
|
||||
if (!strncmp(ptr, "<!--", 4))
|
||||
{
|
||||
/*
|
||||
* Skip HTML comment...
|
||||
*/
|
||||
|
||||
if ((text = strstr(ptr + 4, "-->")) == NULL)
|
||||
ptr += strlen(ptr) - 1;
|
||||
else
|
||||
ptr = text + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Skip HTML element...
|
||||
*/
|
||||
|
||||
for (ptr ++; *ptr && *ptr != '>'; ptr ++)
|
||||
{
|
||||
if (*ptr == '\"' || *ptr == '\'')
|
||||
{
|
||||
for (quote = *ptr++; *ptr && *ptr != quote; ptr ++);
|
||||
|
||||
if (!*ptr)
|
||||
ptr --;
|
||||
}
|
||||
}
|
||||
|
||||
if (!*ptr)
|
||||
ptr --;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
else if (*ptr == '&')
|
||||
{
|
||||
/*
|
||||
* Skip HTML entity...
|
||||
*/
|
||||
|
||||
for (ptr ++; *ptr && *ptr != ';'; ptr ++);
|
||||
|
||||
if (!*ptr)
|
||||
ptr --;
|
||||
|
||||
continue;
|
||||
}
|
||||
else if (!isalnum(*ptr & 255))
|
||||
continue;
|
||||
|
||||
/*
|
||||
* Found the start of a word, search until we find the end...
|
||||
*/
|
||||
|
||||
for (text = ptr, ptr ++; *ptr && isalnum(*ptr & 255); ptr ++);
|
||||
|
||||
wordlen = ptr - text;
|
||||
|
||||
memcpy(temp, text, wordlen);
|
||||
temp[wordlen] = '\0';
|
||||
|
||||
ptr --;
|
||||
|
||||
if (wordlen > 1 && !bsearch(temp, help_common_words,
|
||||
(sizeof(help_common_words) /
|
||||
sizeof(help_common_words[0])),
|
||||
sizeof(help_common_words[0]),
|
||||
(int (*)(const void *, const void *))
|
||||
strcasecmp))
|
||||
help_add_word(node, temp);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the offset of the next line...
|
||||
*/
|
||||
@@ -1311,21 +978,6 @@ help_sort_by_score(help_node_t *n1, /* I - First node */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'help_sort_words()' - Sort words alphabetically.
|
||||
*/
|
||||
|
||||
static int /* O - Difference */
|
||||
help_sort_words(help_word_t *w1, /* I - Second word */
|
||||
help_word_t *w2) /* I - Second word */
|
||||
{
|
||||
DEBUG_printf(("help_sort_words(w1=%p(\"%s\"), w2=%p(\"%s\"))\n",
|
||||
w1, w1->text, w2, w2->text));
|
||||
|
||||
return (strcasecmp(w1->text, w2->text));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
|
||||
+17
-15
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* On-line help index definitions for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE.txt" which should have been included with this file. If this
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_HELP_INDEX_H_
|
||||
@@ -27,26 +36,19 @@
|
||||
* Data structures...
|
||||
*/
|
||||
|
||||
typedef struct help_word_s /**** Help word structure... ****/
|
||||
{
|
||||
int count; /* Number of occurrences */
|
||||
char *text; /* Word text */
|
||||
} help_word_t;
|
||||
|
||||
typedef struct help_node_s /**** Help node structure... ****/
|
||||
typedef struct /**** Help node structure... ****/
|
||||
{
|
||||
char *filename; /* Filename, relative to help dir */
|
||||
char *section; /* Section name (NULL if none) */
|
||||
char *anchor; /* Anchor name (NULL if none) */
|
||||
char *text; /* Text in anchor */
|
||||
cups_array_t *words; /* Words after this node */
|
||||
time_t mtime; /* Last modification time */
|
||||
off_t offset; /* Offset in file */
|
||||
size_t length; /* Length in bytes */
|
||||
int score; /* Search score */
|
||||
} help_node_t;
|
||||
|
||||
typedef struct help_index_s /**** Help index structure ****/
|
||||
typedef struct /**** Help index structure ****/
|
||||
{
|
||||
int search; /* 1 = search index, 0 = normal */
|
||||
cups_array_t *nodes; /* Nodes sorted by filename */
|
||||
|
||||
+14
-6
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* On-line help CGI for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE.txt" which should have been included with this file. If this
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
@@ -151,7 +160,6 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
cgiSetVariable("HELPFILE", helpfile);
|
||||
cgiSetVariable("HELPTITLE", n->text);
|
||||
cgiSetVariable("TOPIC", n->section);
|
||||
|
||||
/*
|
||||
* Send a standard page header...
|
||||
|
||||
+14
-5
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* HTML support functions for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE.txt" which should have been included with this file. If this
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
|
||||
+16
-145
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* CGI <-> IPP variable routines for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE.txt" which should have been included with this file. If this
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
@@ -819,144 +828,6 @@ cgiSetIPPObjectVars(
|
||||
cgiSetArray("job_printer_name", element, valptr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Localize event names in "notify_events" variable...
|
||||
*/
|
||||
|
||||
if (!strcmp(name, "notify_events"))
|
||||
{
|
||||
size_t remaining; /* Remaining bytes in buffer */
|
||||
|
||||
|
||||
value[0] = '\0';
|
||||
valptr = value;
|
||||
|
||||
for (i = 0; i < attr->num_values; i ++)
|
||||
{
|
||||
if (valptr >= (value + sizeof(value) - 3))
|
||||
break;
|
||||
|
||||
if (i)
|
||||
{
|
||||
*valptr++ = ',';
|
||||
*valptr++ = ' ';
|
||||
}
|
||||
|
||||
remaining = sizeof(value) - (valptr - value);
|
||||
|
||||
if (!strcmp(attr->values[i].string.text, "printer-stopped"))
|
||||
strlcpy(valptr, _("Printer Stopped"), remaining);
|
||||
else if (!strcmp(attr->values[i].string.text, "printer-added"))
|
||||
strlcpy(valptr, _("Printer Added"), remaining);
|
||||
else if (!strcmp(attr->values[i].string.text, "printer-modified"))
|
||||
strlcpy(valptr, _("Printer Modified"), remaining);
|
||||
else if (!strcmp(attr->values[i].string.text, "printer-deleted"))
|
||||
strlcpy(valptr, _("Printer Deleted"), remaining);
|
||||
else if (!strcmp(attr->values[i].string.text, "job-created"))
|
||||
strlcpy(valptr, _("Job Created"), remaining);
|
||||
else if (!strcmp(attr->values[i].string.text, "job-completed"))
|
||||
strlcpy(valptr, _("Job Completed"), remaining);
|
||||
else if (!strcmp(attr->values[i].string.text, "job-stopped"))
|
||||
strlcpy(valptr, _("Job Stopped"), remaining);
|
||||
else if (!strcmp(attr->values[i].string.text, "job-config-changed"))
|
||||
strlcpy(valptr, _("Job Options Changed"), remaining);
|
||||
else if (!strcmp(attr->values[i].string.text, "server-restarted"))
|
||||
strlcpy(valptr, _("Server Restarted"), remaining);
|
||||
else if (!strcmp(attr->values[i].string.text, "server-started"))
|
||||
strlcpy(valptr, _("Server Started"), remaining);
|
||||
else if (!strcmp(attr->values[i].string.text, "server-stopped"))
|
||||
strlcpy(valptr, _("Server Stopped"), remaining);
|
||||
else if (!strcmp(attr->values[i].string.text, "server-audit"))
|
||||
strlcpy(valptr, _("Server Security Auditing"), remaining);
|
||||
else
|
||||
strlcpy(valptr, attr->values[i].string.text, remaining);
|
||||
|
||||
valptr += strlen(valptr);
|
||||
}
|
||||
|
||||
cgiSetArray("notify_events", element, value);
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Add "notify_printer_name" variable if we have a "notify_printer_uri"
|
||||
* attribute...
|
||||
*/
|
||||
|
||||
if (!strcmp(name, "notify_printer_uri"))
|
||||
{
|
||||
if ((valptr = strrchr(attr->values[0].string.text, '/')) == NULL)
|
||||
valptr = "unknown";
|
||||
else
|
||||
valptr ++;
|
||||
|
||||
cgiSetArray("notify_printer_name", element, valptr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Add "notify_recipient_name" variable if we have a "notify_recipient_uri"
|
||||
* attribute, and rewrite recipient URI...
|
||||
*/
|
||||
|
||||
if (!strcmp(name, "notify_recipient_uri"))
|
||||
{
|
||||
char uri[1024], /* New URI */
|
||||
scheme[32], /* Scheme portion of URI */
|
||||
userpass[256], /* Username/password portion of URI */
|
||||
host[1024], /* Hostname portion of URI */
|
||||
resource[1024], /* Resource portion of URI */
|
||||
*options; /* Options in URI */
|
||||
int port; /* Port number */
|
||||
|
||||
|
||||
httpSeparateURI(HTTP_URI_CODING_ALL, attr->values[0].string.text,
|
||||
scheme, sizeof(scheme), userpass, sizeof(userpass),
|
||||
host, sizeof(host), &port, resource, sizeof(resource));
|
||||
|
||||
if (!strcmp(scheme, "rss"))
|
||||
{
|
||||
/*
|
||||
* RSS notification...
|
||||
*/
|
||||
|
||||
if ((options = strchr(resource, '?')) != NULL)
|
||||
*options = '\0';
|
||||
|
||||
if (host[0])
|
||||
{
|
||||
/*
|
||||
* Link to remote feed...
|
||||
*/
|
||||
|
||||
httpAssembleURI(HTTP_URI_CODING_ALL, uri, sizeof(uri), "http",
|
||||
userpass, host, port, resource);
|
||||
strlcpy(name, uri, sizeof(name));
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Link to local feed...
|
||||
*/
|
||||
|
||||
snprintf(uri, sizeof(uri), "/rss%s", resource);
|
||||
strlcpy(name, resource + 1, sizeof(name));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Other...
|
||||
*/
|
||||
|
||||
strlcpy(uri, attr->values[0].string.text, sizeof(uri));
|
||||
strlcpy(name, resource, sizeof(name));
|
||||
}
|
||||
|
||||
cgiSetArray("notify_recipient_uri", element, uri);
|
||||
cgiSetArray("notify_recipient_name", element, name);
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Add "admin_uri" variable if we have a "printer_uri_supported"
|
||||
* attribute...
|
||||
@@ -1043,7 +914,7 @@ cgiSetIPPObjectVars(
|
||||
|
||||
snprintf(valptr, sizeof(value) - (valptr - value),
|
||||
"<A HREF=\"%s\">%s</A>", url,
|
||||
strrchr(attr->values[i].string.text, '/') + 1);
|
||||
strrchr(url, '/') + 1);
|
||||
}
|
||||
else
|
||||
cgiRewriteURL(attr->values[i].string.text, valptr,
|
||||
|
||||
+14
-19
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* Job status CGI for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE.txt" which should have been included with this file. If this
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
@@ -172,20 +181,6 @@ do_job_op(http_t *http, /* I - HTTP connection */
|
||||
|
||||
ippDelete(cupsDoRequest(http, request, "/jobs"));
|
||||
|
||||
if (cupsLastError() <= IPP_OK_CONFLICT && getenv("HTTP_REFERER"))
|
||||
{
|
||||
/*
|
||||
* Redirect successful updates back to the parent page...
|
||||
*/
|
||||
|
||||
char url[1024]; /* Encoded URL */
|
||||
|
||||
|
||||
strcpy(url, "5;URL=");
|
||||
cgiFormEncode(url + 6, getenv("HTTP_REFERER"), sizeof(url) - 6);
|
||||
cgiSetVariable("refresh_page", url);
|
||||
}
|
||||
|
||||
cgiStartHTML(cgiText(_("Jobs")));
|
||||
|
||||
if (cupsLastError() > IPP_OK_CONFLICT)
|
||||
|
||||
+14
-5
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* Printer status CGI for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE.txt" which should have been included with this file. If this
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
|
||||
+14
-5
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* Search routines for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE.txt" which should have been included with this file. If this
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
|
||||
+50
-43
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* CGI template function.
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE.txt" which should have been included with this file. If this
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
@@ -50,7 +59,7 @@ cgiCopyTemplateFile(FILE *out, /* I - Output file */
|
||||
FILE *in; /* Input file */
|
||||
|
||||
|
||||
fprintf(stderr, "DEBUG2: cgiCopyTemplateFile(out=%p, tmpl=\"%s\")\n", out,
|
||||
fprintf(stderr, "DEBUG: cgiCopyTemplateFile(out=%p, tmpl=\"%s\")\n", out,
|
||||
tmpl ? tmpl : "(null)");
|
||||
|
||||
/*
|
||||
@@ -85,34 +94,37 @@ cgiCopyTemplateFile(FILE *out, /* I - Output file */
|
||||
void
|
||||
cgiCopyTemplateLang(const char *tmpl) /* I - Base filename */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
char filename[1024], /* Filename */
|
||||
locale[16], /* Locale name */
|
||||
*locptr; /* Pointer into locale name */
|
||||
locale[16]; /* Locale name */
|
||||
const char *directory, /* Directory for templates */
|
||||
*lang; /* Language */
|
||||
FILE *in; /* Input file */
|
||||
|
||||
|
||||
fprintf(stderr, "DEBUG2: cgiCopyTemplateLang(tmpl=\"%s\")\n",
|
||||
fprintf(stderr, "DEBUG: cgiCopyTemplateLang(tmpl=\"%s\")\n",
|
||||
tmpl ? tmpl : "(null)");
|
||||
|
||||
/*
|
||||
* Convert the language to a locale name...
|
||||
*/
|
||||
|
||||
locale[0] = '\0';
|
||||
|
||||
if ((lang = getenv("LANG")) != NULL)
|
||||
{
|
||||
locale[0] = '/';
|
||||
strlcpy(locale + 1, lang, sizeof(locale) - 1);
|
||||
for (i = 0; lang[i] && i < 15; i ++)
|
||||
if (isalnum(lang[i] & 255) || lang[i] == '_')
|
||||
locale[i] = tolower(lang[i]);
|
||||
else if (lang[i] == '-')
|
||||
locale[i] = '_';
|
||||
else
|
||||
break;
|
||||
|
||||
if ((locptr = strchr(locale, '.')) != NULL)
|
||||
*locptr = '\0'; /* Strip charset */
|
||||
locale[i] = '\0';
|
||||
}
|
||||
else
|
||||
locale[0] = '\0';
|
||||
|
||||
fprintf(stderr, "DEBUG: lang=\"%s\", locale=\"%s\"...\n",
|
||||
lang ? lang : "(null)", locale);
|
||||
fprintf(stderr, "DEBUG: locale=\"%s\"...\n", locale);
|
||||
|
||||
/*
|
||||
* See if we have a template file for this language...
|
||||
@@ -120,26 +132,23 @@ cgiCopyTemplateLang(const char *tmpl) /* I - Base filename */
|
||||
|
||||
directory = cgiGetTemplateDir();
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s%s/%s", directory, locale, tmpl);
|
||||
if ((in = fopen(filename, "r")) == NULL)
|
||||
snprintf(filename, sizeof(filename), "%s/%s/%s", directory, locale, tmpl);
|
||||
if (access(filename, 0))
|
||||
{
|
||||
locale[3] = '\0';
|
||||
locale[2] = '\0';
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s%s/%s", directory, locale, tmpl);
|
||||
if ((in = fopen(filename, "r")) == NULL)
|
||||
{
|
||||
snprintf(filename, sizeof(filename), "%s/%s/%s", directory, locale, tmpl);
|
||||
if (access(filename, 0))
|
||||
snprintf(filename, sizeof(filename), "%s/%s", directory, tmpl);
|
||||
in = fopen(filename, "r");
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG2: Template file is \"%s\"...\n", filename);
|
||||
fprintf(stderr, "DEBUG: Template file is \"%s\"...\n", filename);
|
||||
|
||||
/*
|
||||
* Open the template file...
|
||||
*/
|
||||
|
||||
if (!in)
|
||||
if ((in = fopen(filename, "r")) == NULL)
|
||||
{
|
||||
fprintf(stderr, "ERROR: Unable to open template file \"%s\" - %s\n",
|
||||
filename, strerror(errno));
|
||||
@@ -231,7 +240,7 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
int uriencode; /* Encode as URI */
|
||||
|
||||
|
||||
fprintf(stderr, "DEBUG2: %*sStarting at file position %ld...\n", indent, "",
|
||||
fprintf(stderr, "DEBUG: %*sStarting at file position %ld...\n", indent, "",
|
||||
ftell(in));
|
||||
|
||||
/*
|
||||
@@ -263,7 +272,7 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
|
||||
if (s == name && isspace(ch & 255))
|
||||
{
|
||||
fprintf(stderr, "DEBUG2: %*sLone { at %ld...\n", indent, "", ftell(in));
|
||||
fprintf(stderr, "DEBUG: %*sLone { at %ld...\n", indent, "", ftell(in));
|
||||
|
||||
if (out)
|
||||
{
|
||||
@@ -275,7 +284,7 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
}
|
||||
|
||||
if (ch == '}')
|
||||
fprintf(stderr, "DEBUG2: %*s\"{%s}\" at %ld...\n", indent, "", name,
|
||||
fprintf(stderr, "DEBUG: %*s\"{%s}\" at %ld...\n", indent, "", name,
|
||||
ftell(in));
|
||||
|
||||
/*
|
||||
@@ -339,7 +348,7 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
|
||||
pos = ftell(in);
|
||||
|
||||
fprintf(stderr, "DEBUG2: %*sLooping on \"%s\" at %ld, count=%d...\n",
|
||||
fprintf(stderr, "DEBUG: %*sLooping on \"%s\" at %ld, count=%d...\n",
|
||||
indent, "", name + 1, pos, count);
|
||||
|
||||
if (count > 0)
|
||||
@@ -355,7 +364,7 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
else
|
||||
cgi_copy(NULL, in, 0, '}', indent + 2);
|
||||
|
||||
fprintf(stderr, "DEBUG2: %*sFinished looping on \"%s\"...\n", indent,
|
||||
fprintf(stderr, "DEBUG: %*sFinished looping on \"%s\"...\n", indent,
|
||||
"", name + 1);
|
||||
|
||||
continue;
|
||||
@@ -400,8 +409,6 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
{
|
||||
if (uriencode)
|
||||
cgi_puturi(outptr, out);
|
||||
else if (!strcasecmp(name, "?cupsdconf_default"))
|
||||
fputs(outptr, stdout);
|
||||
else
|
||||
cgi_puts(outptr, out);
|
||||
}
|
||||
@@ -493,7 +500,7 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
if (ch != '?')
|
||||
{
|
||||
fprintf(stderr,
|
||||
"DEBUG2: %*sBad terminator '%c' at file position %ld...\n",
|
||||
"DEBUG: %*sBad terminator '%c' at file position %ld...\n",
|
||||
indent, "", ch, ftell(in));
|
||||
return;
|
||||
}
|
||||
@@ -523,7 +530,7 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
}
|
||||
|
||||
fprintf(stderr,
|
||||
"DEBUG2: %*sStarting \"{%s%c%s\" at %ld, result=%d...\n",
|
||||
"DEBUG: %*sStarting \"{%s%c%s\" at %ld, result=%d...\n",
|
||||
indent, "", name, op, compare, ftell(in), result);
|
||||
|
||||
if (result)
|
||||
@@ -532,10 +539,10 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
* Comparison true; output first part and ignore second...
|
||||
*/
|
||||
|
||||
fprintf(stderr, "DEBUG2: %*sOutput first part...\n", indent, "");
|
||||
fprintf(stderr, "DEBUG: %*sOutput first part...\n", indent, "");
|
||||
cgi_copy(out, in, element, ':', indent + 2);
|
||||
|
||||
fprintf(stderr, "DEBUG2: %*sSkip second part...\n", indent, "");
|
||||
fprintf(stderr, "DEBUG: %*sSkip second part...\n", indent, "");
|
||||
cgi_copy(NULL, in, element, '}', indent + 2);
|
||||
}
|
||||
else
|
||||
@@ -544,14 +551,14 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
* Comparison false; ignore first part and output second...
|
||||
*/
|
||||
|
||||
fprintf(stderr, "DEBUG2: %*sSkip first part...\n", indent, "");
|
||||
fprintf(stderr, "DEBUG: %*sSkip first part...\n", indent, "");
|
||||
cgi_copy(NULL, in, element, ':', indent + 2);
|
||||
|
||||
fprintf(stderr, "DEBUG2: %*sOutput second part...\n", indent, "");
|
||||
fprintf(stderr, "DEBUG: %*sOutput second part...\n", indent, "");
|
||||
cgi_copy(out, in, element, '}', indent + 2);
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG2: %*sFinished \"{%s%c%s\", out=%p...\n", indent, "",
|
||||
fprintf(stderr, "DEBUG: %*sFinished \"{%s%c%s\", out=%p...\n", indent, "",
|
||||
name, op, compare, out);
|
||||
}
|
||||
else if (ch == '\\') /* Quoted char */
|
||||
@@ -565,11 +572,11 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
putc(ch, out);
|
||||
|
||||
if (ch == EOF)
|
||||
fprintf(stderr, "DEBUG2: %*sReturning at file position %ld on EOF...\n",
|
||||
fprintf(stderr, "DEBUG: %*sReturning at file position %ld on EOF...\n",
|
||||
indent, "", ftell(in));
|
||||
else
|
||||
fprintf(stderr,
|
||||
"DEBUG2: %*sReturning at file position %ld on character '%c'...\n",
|
||||
"DEBUG: %*sReturning at file position %ld on character '%c'...\n",
|
||||
indent, "", ftell(in), ch);
|
||||
|
||||
if (ch == EOF && term)
|
||||
|
||||
+14
-5
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* CGI test program for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2005 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE.txt" which should have been included with this file. If this
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
|
||||
+17
-12
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* Help index test program for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright 1997-2005 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE.txt" which should have been included with this file. If this
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
@@ -96,15 +105,11 @@ list_nodes(const char *title, /* I - Title string */
|
||||
for (i = 1, node = (help_node_t *)cupsArrayFirst(nodes);
|
||||
node;
|
||||
i ++, node = (help_node_t *)cupsArrayNext(nodes))
|
||||
{
|
||||
if (node->anchor)
|
||||
printf(" %d: %s#%s \"%s\"", i, node->filename, node->anchor,
|
||||
printf(" %d: %s#%s \"%s\"\n", i, node->filename, node->anchor,
|
||||
node->text);
|
||||
else
|
||||
printf(" %d: %s \"%s\"", i, node->filename, node->text);
|
||||
|
||||
printf(" (%d words)\n", cupsArrayCount(node->words));
|
||||
}
|
||||
printf(" %d: %s \"%s\"\n", i, node->filename, node->text);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -12,15 +12,13 @@ up to 1024 bytes in length.</P>
|
||||
|
||||
<H1><A NAME="FIRST">This is the First Anchor</A></H1>
|
||||
|
||||
<P>This is some text for the <em>first</em> anchor.</P>
|
||||
<P>This is some text for the first anchor.</P>
|
||||
|
||||
|
||||
<H1><A NAME="2ND">This is the Second Anchor</A></H1>
|
||||
|
||||
<P>This is some text for the first anchor.</P>
|
||||
|
||||
<P>John asked Mary to the dance.</P>
|
||||
|
||||
|
||||
<H1><A NAME="THIRD">This is the Third Anchor</A></H1>
|
||||
|
||||
|
||||
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* CGI template test program for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE.txt" which should have been included with this file. If this
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
|
||||
+14
-5
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* CGI form variable and array functions.
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2005 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE.txt" which should have been included with this file. If this
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
|
||||
+15
-6
@@ -3,14 +3,23 @@
|
||||
#
|
||||
# Configuration file makefile for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
# Copyright 2007 by Apple Inc.
|
||||
# Copyright 1993-2006 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# property of Easy Software Products and are protected by Federal
|
||||
# copyright law. Distribution and use rights are outlined in the file
|
||||
# "LICENSE.txt" which should have been included with this file. If this
|
||||
# file is missing or damaged please contact Easy Software Products
|
||||
# at:
|
||||
#
|
||||
# Attn: CUPS Licensing Information
|
||||
# Easy Software Products
|
||||
# 44141 Airport View Drive, Suite 204
|
||||
# Hollywood, Maryland 20636 USA
|
||||
#
|
||||
# Voice: (301) 373-9600
|
||||
# EMail: cups-info@cups.org
|
||||
# WWW: http://www.cups.org
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
@@ -19,7 +28,7 @@ include ../Makedefs
|
||||
# Config files...
|
||||
#
|
||||
|
||||
KEEP = cupsd.conf snmp.conf
|
||||
KEEP = cupsd.conf
|
||||
REPLACE = mime.convs mime.types
|
||||
|
||||
|
||||
|
||||
+7
-15
@@ -12,7 +12,6 @@ LogLevel info
|
||||
|
||||
# Administrator user group...
|
||||
SystemGroup @CUPS_SYSTEM_GROUPS@
|
||||
@CUPS_SYSTEM_AUTHKEY@
|
||||
|
||||
# Only listen for connections from the local machine.
|
||||
Listen localhost:@DEFAULT_IPP_PORT@
|
||||
@@ -21,7 +20,7 @@ Listen localhost:@DEFAULT_IPP_PORT@
|
||||
# Show shared printers on the local network.
|
||||
Browsing On
|
||||
BrowseOrder allow,deny
|
||||
BrowseAllow all
|
||||
BrowseAllow @LOCAL
|
||||
|
||||
# Default authentication type, when authentication is required...
|
||||
DefaultAuthType Basic
|
||||
@@ -41,7 +40,7 @@ DefaultAuthType Basic
|
||||
|
||||
# Restrict access to configuration files...
|
||||
<Location /admin/conf>
|
||||
AuthType Default
|
||||
AuthType Basic
|
||||
Require user @SYSTEM
|
||||
Order allow,deny
|
||||
Allow localhost
|
||||
@@ -49,29 +48,22 @@ DefaultAuthType Basic
|
||||
|
||||
# Set the default printer/job policies...
|
||||
<Policy default>
|
||||
# Job-related operations must be done by the owner or an administrator...
|
||||
# Job-related operations must be done by the owner or an adminstrator...
|
||||
<Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job>
|
||||
Require user @OWNER @SYSTEM
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
# All administration operations require an administrator to authenticate...
|
||||
<Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
|
||||
AuthType Default
|
||||
# All administration operations require an adminstrator to authenticate...
|
||||
<Limit Pause-Printer Resume-Printer Set-Printer-Attributes Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Add-Printer CUPS-Delete-Printer CUPS-Add-Class CUPS-Delete-Class CUPS-Accept-Jobs CUPS-Reject-Jobs CUPS-Set-Default>
|
||||
AuthType Basic
|
||||
Require user @SYSTEM
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
# All printer operations require a printer operator to authenticate...
|
||||
<Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs>
|
||||
AuthType Default
|
||||
Require user @CUPS_DEFAULT_PRINTADMIN_AUTH@
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
# Only the owner or an administrator can cancel or authenticate a job...
|
||||
<Limit Cancel-Job CUPS-Authenticate-Job>
|
||||
Require user @OWNER @CUPS_DEFAULT_PRINTADMIN_AUTH@
|
||||
Require user @OWNER @SYSTEM
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
|
||||
@@ -1,20 +1,25 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# DO NOT EDIT THIS FILE, AS IT IS OVERWRITTEN WHEN YOU INSTALL NEW
|
||||
# VERSIONS OF CUPS. Instead, create a "local.convs" file that
|
||||
# reflects your local configuration changes.
|
||||
# "$Id: mime.convs 5402 2006-04-14 19:21:03Z mike $"
|
||||
#
|
||||
# MIME converts file for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
# Copyright 2007 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products.
|
||||
# Copyright 1997-2005 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# property of Easy Software Products and are protected by Federal
|
||||
# copyright law. Distribution and use rights are outlined in the file
|
||||
# "LICENSE.txt" which should have been included with this file. If this
|
||||
# file is missing or damaged please contact Easy Software Products
|
||||
# at:
|
||||
#
|
||||
# Attn: CUPS Licensing Information
|
||||
# Easy Software Products
|
||||
# 44141 Airport View Drive, Suite 204
|
||||
# Hollywood, Maryland 20636 USA
|
||||
#
|
||||
# Voice: (301) 373-9600
|
||||
# EMail: cups-info@cups.org
|
||||
# WWW: http://www.cups.org
|
||||
#
|
||||
|
||||
########################################################################
|
||||
@@ -95,8 +100,8 @@ image/x-xpixmap application/vnd.cups-raster 100 imagetoraster
|
||||
#image/x-xwindowdump application/vnd.cups-raster 100 imagetoraster
|
||||
image/x-sun-raster application/vnd.cups-raster 100 imagetoraster
|
||||
|
||||
# pstoraster is part of GPL Ghostscript...
|
||||
application/vnd.cups-postscript application/vnd.cups-raster 100 pstoraster
|
||||
# pstoraster is now part of ESP Ghostscript...
|
||||
#application/vnd.cups-postscript application/vnd.cups-raster 100 pstoraster
|
||||
|
||||
########################################################################
|
||||
#
|
||||
@@ -106,8 +111,8 @@ application/vnd.cups-postscript application/vnd.cups-raster 100 pstoraster
|
||||
# without the -oraw option.
|
||||
#
|
||||
|
||||
@DEFAULT_RAW_PRINTING@application/octet-stream application/vnd.cups-raw 0 -
|
||||
#application/octet-stream application/vnd.cups-raw 0 -
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
# End of "$Id: mime.convs 5402 2006-04-14 19:21:03Z mike $".
|
||||
#
|
||||
+27
-31
@@ -1,20 +1,25 @@
|
||||
#
|
||||
# "$Id: mime.types 6649 2007-07-11 21:46:42Z mike $"
|
||||
# "$Id: mime.types 6003 2006-10-02 16:26:04Z mike $"
|
||||
#
|
||||
# MIME types file for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
# DO NOT EDIT THIS FILE, AS IT IS OVERWRITTEN WHEN YOU INSTALL NEW
|
||||
# VERSIONS OF CUPS. Instead, create a "local.types" file that
|
||||
# reflects your local configuration changes.
|
||||
#
|
||||
# Copyright 2007 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products.
|
||||
# Copyright 1997-2005 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# property of Easy Software Products and are protected by Federal
|
||||
# copyright law. Distribution and use rights are outlined in the file
|
||||
# "LICENSE.txt" which should have been included with this file. If this
|
||||
# file is missing or damaged please contact Easy Software Products
|
||||
# at:
|
||||
#
|
||||
# Attn: CUPS Licensing Information
|
||||
# Easy Software Products
|
||||
# 44141 Airport View Drive, Suite 204
|
||||
# Hollywood, Maryland 20636 USA
|
||||
#
|
||||
# Voice: (301) 373-9600
|
||||
# EMail: cups-info@cups.org
|
||||
# WWW: http://www.cups.org
|
||||
#
|
||||
|
||||
########################################################################
|
||||
@@ -69,20 +74,20 @@
|
||||
application/pdf pdf string(0,%PDF)
|
||||
application/postscript ai eps ps string(0,%!) string(0,<04>%!) \
|
||||
contains(0,128,<1B>%-12345X) + \
|
||||
(contains(0,4096,"LANGUAGE=POSTSCRIPT") \
|
||||
contains(0,4096,"LANGUAGE = Postscript") \
|
||||
contains(0,4096,"LANGUAGE = PostScript") \
|
||||
contains(0,4096,"LANGUAGE = POSTSCRIPT") \
|
||||
(contains(0,4096,<0a>%!) + \
|
||||
!contains(0,4096,"ENTER LANGUAGE")))
|
||||
application/vnd.hp-HPGL hpgl \
|
||||
(contains(0,1024,"LANGUAGE=POSTSCRIPT") \
|
||||
contains(0,1024,"LANGUAGE = Postscript") \
|
||||
contains(0,1024,"LANGUAGE = PostScript") \
|
||||
contains(0,1024,"LANGUAGE = POSTSCRIPT") \
|
||||
(contains(0,1024,<0a>%!) + \
|
||||
!contains(0,1024,"ENTER LANGUAGE")))
|
||||
application/vnd.hp-HPGL hpgl string(0,<1B>&)\
|
||||
string(0,<1B>E<1B>%0B) \
|
||||
string(0,<1B>%-1B) string(0,<201B>)\
|
||||
string(0,BP;) string(0,IN;) string(0,DF;) \
|
||||
string(0,BPINPS;) \
|
||||
(contains(0,128,<1B>%-12345X) + \
|
||||
(contains(0,4096,"LANGUAGE=HPGL") \
|
||||
contains(0,4096,"LANGUAGE = HPGL")))
|
||||
(contains(0,1024,"LANGUAGE=HPGL") \
|
||||
contains(0,1024,"LANGUAGE = HPGL")))
|
||||
|
||||
########################################################################
|
||||
#
|
||||
@@ -96,7 +101,7 @@ image/jpeg jpeg jpg jpe string(0,<FFD8FF>) &&\
|
||||
char(3,0xe4) char(3,0xe5) char(3,0xe6) char(3,0xe7)\
|
||||
char(3,0xe8) char(3,0xe9) char(3,0xea) char(3,0xeb)\
|
||||
char(3,0xec) char(3,0xed) char(3,0xee) char(3,0xef))
|
||||
image/tiff tiff tif string(0,MM<002A>) string(0,II<2A00>)
|
||||
image/tiff tiff tif string(0,MM) string(0,II)
|
||||
image/x-photocd pcd string(2048,PCD_IPI)
|
||||
image/x-portable-anymap pnm
|
||||
image/x-portable-bitmap pbm string(0,P1) string(0,P4)
|
||||
@@ -135,15 +140,6 @@ text/html html htm printable(0,1024) +\
|
||||
text/plain txt printable(0,1024)
|
||||
text/css css
|
||||
|
||||
|
||||
########################################################################
|
||||
#
|
||||
# RSS feed type...
|
||||
#
|
||||
|
||||
application/rss+xml rss
|
||||
|
||||
|
||||
########################################################################
|
||||
#
|
||||
# CUPS-specific types...
|
||||
@@ -171,5 +167,5 @@ application/vnd.cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) \
|
||||
application/octet-stream
|
||||
|
||||
#
|
||||
# End of "$Id: mime.types 6649 2007-07-11 21:46:42Z mike $".
|
||||
# End of "$Id: mime.types 6003 2006-10-02 16:26:04Z mike $".
|
||||
#
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# Sample SNMP configuration file for CUPS. See "man smnp.conf" for a
|
||||
# complete description of this file.
|
||||
#
|
||||
|
||||
@CUPS_SNMP_ADDRESS@
|
||||
@CUPS_SNMP_COMMUNITY@
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
@@ -1,140 +0,0 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
dnl
|
||||
dnl 32/64-bit library support stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl Setup support for separate 32/64-bit library generation...
|
||||
AC_ARG_ENABLE(32bit, [ --enable-32bit generate 32-bit libraries on 32/64-bit systems, default=no])
|
||||
|
||||
INSTALL32=""
|
||||
LIB32CUPS=""
|
||||
LIB32CUPSIMAGE=""
|
||||
LIB32DIR=""
|
||||
UNINSTALL32=""
|
||||
|
||||
AC_SUBST(INSTALL32)
|
||||
AC_SUBST(LIB32CUPS)
|
||||
AC_SUBST(LIB32CUPSIMAGE)
|
||||
AC_SUBST(LIB32DIR)
|
||||
AC_SUBST(UNINSTALL32)
|
||||
|
||||
AC_ARG_ENABLE(64bit, [ --enable-64bit generate 64-bit libraries on 32/64-bit systems, default=no])
|
||||
|
||||
INSTALL64=""
|
||||
LIB64CUPS=""
|
||||
LIB64CUPSIMAGE=""
|
||||
LIB64DIR=""
|
||||
UNINSTALL64=""
|
||||
|
||||
AC_SUBST(INSTALL64)
|
||||
AC_SUBST(LIB64CUPS)
|
||||
AC_SUBST(LIB64CUPSIMAGE)
|
||||
AC_SUBST(LIB64DIR)
|
||||
AC_SUBST(UNINSTALL64)
|
||||
|
||||
case "$uname" in
|
||||
HP-UX*)
|
||||
if test "x$enable_32bit" = xyes; then
|
||||
# Build 32-bit libraries, 64-bit base...
|
||||
INSTALL32="install32bit"
|
||||
LIB32CUPS="32bit/libcups.so.2"
|
||||
LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
|
||||
LIB32DIR="$exec_prefix/lib"
|
||||
if test -d /usr/lib/hpux32; then
|
||||
LIB32DIR="${LIB32DIR}/hpux32"
|
||||
fi
|
||||
UNINSTALL32="uninstall32bit"
|
||||
fi
|
||||
|
||||
if test "x$enable_64bit" = xyes; then
|
||||
# Build 64-bit libraries, 32-bit base...
|
||||
INSTALL64="install64bit"
|
||||
LIB64CUPS="64bit/libcups.so.2"
|
||||
LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
|
||||
LIB64DIR="$exec_prefix/lib"
|
||||
if test -d /usr/lib/hpux64; then
|
||||
LIB64DIR="${LIB64DIR}/hpux64"
|
||||
fi
|
||||
UNINSTALL64="uninstall64bit"
|
||||
fi
|
||||
;;
|
||||
|
||||
IRIX)
|
||||
if test "x$enable_32bit" = xyes; then
|
||||
INSTALL32="install32bit"
|
||||
LIB32CUPS="32bit/libcups.so.2"
|
||||
LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
|
||||
LIB32DIR="$prefix/lib32"
|
||||
UNINSTALL32="uninstall32bit"
|
||||
fi
|
||||
|
||||
if test "x$enable_64bit" = xyes; then
|
||||
# Build 64-bit libraries, 32-bit base...
|
||||
INSTALL64="install64bit"
|
||||
LIB64CUPS="64bit/libcups.so.2"
|
||||
LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
|
||||
LIB64DIR="$prefix/lib64"
|
||||
UNINSTALL64="uninstall64bit"
|
||||
fi
|
||||
;;
|
||||
|
||||
Linux*)
|
||||
if test "x$enable_32bit" = xyes; then
|
||||
# Build 32-bit libraries, 64-bit base...
|
||||
INSTALL32="install32bit"
|
||||
LIB32CUPS="32bit/libcups.so.2"
|
||||
LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
|
||||
LIB32DIR="$exec_prefix/lib"
|
||||
if test -d /usr/lib32; then
|
||||
LIB32DIR="${LIB32DIR}32"
|
||||
fi
|
||||
UNINSTALL32="uninstall32bit"
|
||||
fi
|
||||
|
||||
if test "x$enable_64bit" = xyes; then
|
||||
# Build 64-bit libraries, 32-bit base...
|
||||
INSTALL64="install64bit"
|
||||
LIB64CUPS="64bit/libcups.so.2"
|
||||
LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
|
||||
LIB64DIR="$exec_prefix/lib"
|
||||
if test -d /usr/lib64; then
|
||||
LIB64DIR="${LIB64DIR}64"
|
||||
fi
|
||||
UNINSTALL64="uninstall64bit"
|
||||
fi
|
||||
;;
|
||||
|
||||
SunOS*)
|
||||
if test "x$enable_32bit" = xyes; then
|
||||
# Build 32-bit libraries, 64-bit base...
|
||||
INSTALL32="install32bit"
|
||||
LIB32CUPS="32bit/libcups.so.2"
|
||||
LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
|
||||
LIB32DIR="$exec_prefix/lib/32"
|
||||
UNINSTALL32="uninstall32bit"
|
||||
fi
|
||||
|
||||
if test "x$enable_64bit" = xyes; then
|
||||
# Build 64-bit libraries, 32-bit base...
|
||||
INSTALL64="install64bit"
|
||||
LIB64CUPS="64bit/libcups.so.2"
|
||||
LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
|
||||
LIB64DIR="$exec_prefix/lib/64"
|
||||
UNINSTALL64="uninstall64bit"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl
|
||||
dnl End of "$Id$".
|
||||
dnl
|
||||
@@ -1,30 +1,39 @@
|
||||
dnl
|
||||
dnl "$Id: cups-common.m4 6965 2007-09-17 21:34:07Z mike $"
|
||||
dnl "$Id: cups-common.m4 6032 2006-10-12 19:19:47Z mike $"
|
||||
dnl
|
||||
dnl Common configuration stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl property of Easy Software Products and are protected by Federal
|
||||
dnl copyright law. Distribution and use rights are outlined in the file
|
||||
dnl "LICENSE.txt" which should have been included with this file. If this
|
||||
dnl file is missing or damaged please contact Easy Software Products
|
||||
dnl at:
|
||||
dnl
|
||||
dnl Attn: CUPS Licensing Information
|
||||
dnl Easy Software Products
|
||||
dnl 44141 Airport View Drive, Suite 204
|
||||
dnl Hollywood, Maryland 20636 USA
|
||||
dnl
|
||||
dnl Voice: (301) 373-9600
|
||||
dnl EMail: cups-info@cups.org
|
||||
dnl WWW: http://www.cups.org
|
||||
dnl
|
||||
|
||||
dnl We need at least autoconf 2.60...
|
||||
AC_PREREQ(2.60)
|
||||
dnl We need at least autoconf 2.50...
|
||||
AC_PREREQ(2.50)
|
||||
|
||||
dnl Set the name of the config header file...
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl Versio number information...
|
||||
CUPS_VERSION="1.3.2"
|
||||
CUPS_VERSION="1.2.5"
|
||||
CUPS_REVISION=""
|
||||
#if test -z "$CUPS_REVISION" -a -d .svn; then
|
||||
# CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
|
||||
#fi
|
||||
if test -z "$CUPS_REVISION" -a -d .svn; then
|
||||
CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
|
||||
fi
|
||||
|
||||
AC_SUBST(CUPS_VERSION)
|
||||
AC_SUBST(CUPS_REVISION)
|
||||
@@ -123,8 +132,6 @@ AC_CHECK_HEADER(strings.h,AC_DEFINE(HAVE_STRINGS_H))
|
||||
AC_CHECK_HEADER(bstring.h,AC_DEFINE(HAVE_BSTRING_H))
|
||||
AC_CHECK_HEADER(usersec.h,AC_DEFINE(HAVE_USERSEC_H))
|
||||
AC_CHECK_HEADER(sys/ioctl.h,AC_DEFINE(HAVE_SYS_IOCTL_H))
|
||||
AC_CHECK_HEADER(sys/param.h,AC_DEFINE(HAVE_SYS_PARAM_H))
|
||||
AC_CHECK_HEADER(sys/ucred.h,AC_DEFINE(HAVE_SYS_UCRED_H))
|
||||
AC_CHECK_HEADER(scsi/sg.h,AC_DEFINE(HAVE_SCSI_SG_H))
|
||||
|
||||
dnl Checks for string functions.
|
||||
@@ -158,7 +165,8 @@ esac
|
||||
AC_CHECK_FUNCS(sigaction)
|
||||
|
||||
dnl Checks for wait functions.
|
||||
AC_CHECK_FUNCS(waitpid wait3)
|
||||
AC_CHECK_FUNCS(waitpid)
|
||||
AC_CHECK_FUNCS(wait3)
|
||||
|
||||
dnl See if the tm structure has the tm_gmtoff member...
|
||||
AC_MSG_CHECKING(for tm_gmtoff member in tm structure)
|
||||
@@ -168,9 +176,6 @@ AC_TRY_COMPILE([#include <time.h>],[struct tm t;
|
||||
AC_DEFINE(HAVE_TM_GMTOFF),
|
||||
AC_MSG_RESULT(no))
|
||||
|
||||
dnl See if we have the removefile(3) function for securely removing files
|
||||
AC_CHECK_FUNCS(removefile)
|
||||
|
||||
dnl Flags for "ar" command...
|
||||
case $uname in
|
||||
Darwin* | *BSD*)
|
||||
@@ -187,22 +192,13 @@ dnl Extra platform-specific libraries...
|
||||
BACKLIBS=""
|
||||
CUPSDLIBS=""
|
||||
DBUSDIR=""
|
||||
CUPS_DEFAULT_PRINTADMIN_AUTH="@SYSTEM"
|
||||
CUPS_SYSTEM_AUTHKEY=""
|
||||
|
||||
AC_ARG_ENABLE(dbus, [ --enable-dbus enable DBUS support, default=auto])
|
||||
|
||||
FONTS="fonts"
|
||||
AC_SUBST(FONTS)
|
||||
LEGACY_BACKENDS="parallel scsi"
|
||||
AC_SUBST(LEGACY_BACKENDS)
|
||||
|
||||
case $uname in
|
||||
Darwin*)
|
||||
FONTS=""
|
||||
LEGACY_BACKENDS=""
|
||||
BACKLIBS="-framework IOKit"
|
||||
CUPSDLIBS="-sectorder __TEXT __text cupsd.order -e start -framework IOKit -framework SystemConfiguration"
|
||||
CUPSDLIBS="-framework IOKit -framework SystemConfiguration"
|
||||
LIBS="-framework CoreFoundation $LIBS"
|
||||
|
||||
dnl Check for CFLocaleCreateCanonicalLocaleIdentifierFromString...
|
||||
@@ -219,24 +215,13 @@ case $uname in
|
||||
AC_CHECK_HEADER(CoreFoundation/CFPriv.h,AC_DEFINE(HAVE_CFPRIV_H))
|
||||
AC_CHECK_HEADER(CoreFoundation/CFBundlePriv.h,AC_DEFINE(HAVE_CFBUNDLEPRIV_H))
|
||||
|
||||
dnl Check for the new membership functions in MacOSX 10.4...
|
||||
dnl Check for the new membership functions in MacOSX 10.4 (Tiger)...
|
||||
AC_CHECK_HEADER(membership.h,AC_DEFINE(HAVE_MEMBERSHIP_H))
|
||||
AC_CHECK_HEADER(membershipPriv.h,AC_DEFINE(HAVE_MEMBERSHIPPRIV_H))
|
||||
AC_CHECK_FUNCS(mbr_uid_to_uuid)
|
||||
|
||||
dnl Need <dlfcn.h> header...
|
||||
AC_CHECK_HEADER(dlfcn.h,AC_DEFINE(HAVE_DLFCN_H))
|
||||
|
||||
dnl Check for notify_post support
|
||||
AC_CHECK_HEADER(notify.h,AC_DEFINE(HAVE_NOTIFY_H))
|
||||
AC_CHECK_FUNCS(notify_post)
|
||||
|
||||
dnl Check for Authorization Services support
|
||||
AC_CHECK_HEADER(Security/Authorization.h, [
|
||||
AC_DEFINE(HAVE_AUTHORIZATION_H)
|
||||
CUPS_DEFAULT_PRINTADMIN_AUTH="@AUTHKEY(system.print.admin) @admin @lpadmin"
|
||||
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.preferences"])
|
||||
AC_CHECK_HEADER(Security/SecBasePriv.h,AC_DEFINE(HAVE_SECBASEPRIV_H))
|
||||
;;
|
||||
|
||||
Linux*)
|
||||
@@ -250,8 +235,7 @@ case $uname in
|
||||
AC_DEFINE(HAVE_DBUS)
|
||||
CFLAGS="$CFLAGS `$PKGCONFIG --cflags dbus-1` -DDBUS_API_SUBJECT_TO_CHANGE"
|
||||
CUPSDLIBS="`$PKGCONFIG --libs dbus-1`"
|
||||
AC_ARG_WITH(dbusdir, [ --with-dbusdir set DBUS configuration directory ], dbusdir="$withval", dbusdir="/etc/dbus-1")
|
||||
DBUSDIR="$dbusdir"
|
||||
DBUSDIR="/etc/dbus-1/system.d"
|
||||
AC_CHECK_LIB(dbus-1,
|
||||
dbus_message_iter_init_append,
|
||||
AC_DEFINE(HAVE_DBUS_MESSAGE_ITER_INIT_APPEND))
|
||||
@@ -263,10 +247,6 @@ case $uname in
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(CUPS_DEFAULT_PRINTADMIN_AUTH)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTADMIN_AUTH, "$CUPS_DEFAULT_PRINTADMIN_AUTH")
|
||||
AC_SUBST(CUPS_SYSTEM_AUTHKEY)
|
||||
|
||||
dnl See if we have POSIX ACL support...
|
||||
SAVELIBS="$LIBS"
|
||||
LIBS=""
|
||||
@@ -287,5 +267,5 @@ AC_SUBST(DEFAULT_IPP_PORT)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-common.m4 6965 2007-09-17 21:34:07Z mike $".
|
||||
dnl End of "$Id: cups-common.m4 6032 2006-10-12 19:19:47Z mike $".
|
||||
dnl
|
||||
|
||||
+102
-119
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-compiler.m4 6976 2007-09-18 20:39:31Z mike $"
|
||||
dnl "$Id: cups-compiler.m4 6049 2006-10-20 15:07:21Z mike $"
|
||||
dnl
|
||||
dnl Compiler stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl property of Easy Software Products and are protected by Federal
|
||||
dnl copyright law. Distribution and use rights are outlined in the file
|
||||
dnl "LICENSE.txt" which should have been included with this file. If this
|
||||
dnl file is missing or damaged please contact Easy Software Products
|
||||
dnl at:
|
||||
dnl
|
||||
dnl Attn: CUPS Licensing Information
|
||||
dnl Easy Software Products
|
||||
dnl 44141 Airport View Drive, Suite 204
|
||||
dnl Hollywood, Maryland 20636 USA
|
||||
dnl
|
||||
dnl Voice: (301) 373-9600
|
||||
dnl EMail: cups-info@cups.org
|
||||
dnl WWW: http://www.cups.org
|
||||
dnl
|
||||
|
||||
dnl Clear the debugging and non-shared library options unless the user asks
|
||||
@@ -30,38 +39,52 @@ AC_ARG_WITH(archflags, [ --with-archflags="flags"
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
ARCHFLAGS=""
|
||||
LDARCHFLAGS=""
|
||||
else
|
||||
ARCHFLAGS="$with_archflags"
|
||||
if test "$uname" = Darwin; then
|
||||
# Only link 32-bit programs - 64-bit is for the shared
|
||||
# libraries...
|
||||
LDARCHFLAGS="`echo $ARCHFLAGS | sed -e '1,$s/-arch x86_64//' -e '1,$s/-arch ppc64//'`"
|
||||
else
|
||||
LDARCHFLAGS="$ARCHFLAGS"
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(ARCHFLAGS)
|
||||
AC_SUBST(LDARCHFLAGS)
|
||||
|
||||
dnl Setup support for separate 32/64-bit library generation...
|
||||
AC_ARG_ENABLE(32bit, [ --enable-32bit generate 32-bit libraries on 32/64-bit systems, default=no])
|
||||
AC_ARG_WITH(arch32flags, [ --with-arch32flags="flags"
|
||||
specifies 32-bit architecture flags])
|
||||
ARCH32FLAGS=""
|
||||
AC_SUBST(ARCH32FLAGS)
|
||||
|
||||
ARCH32FLAGS=""
|
||||
INSTALL32=""
|
||||
LIB32CUPS=""
|
||||
LIB32CUPSIMAGE=""
|
||||
LIB32DIR=""
|
||||
UNINSTALL32=""
|
||||
|
||||
AC_SUBST(ARCH32FLAGS)
|
||||
AC_SUBST(INSTALL32)
|
||||
AC_SUBST(LIB32CUPS)
|
||||
AC_SUBST(LIB32CUPSIMAGE)
|
||||
AC_SUBST(LIB32DIR)
|
||||
AC_SUBST(UNINSTALL32)
|
||||
|
||||
AC_ARG_ENABLE(64bit, [ --enable-64bit generate 64-bit libraries on 32/64-bit systems, default=no])
|
||||
AC_ARG_WITH(arch64flags, [ --with-arch64flags="flags"
|
||||
specifies 64-bit architecture flags])
|
||||
|
||||
ARCH64FLAGS=""
|
||||
INSTALL64=""
|
||||
LIB64CUPS=""
|
||||
LIB64CUPSIMAGE=""
|
||||
LIB64DIR=""
|
||||
UNINSTALL64=""
|
||||
|
||||
AC_SUBST(ARCH64FLAGS)
|
||||
AC_SUBST(INSTALL64)
|
||||
AC_SUBST(LIB64CUPS)
|
||||
AC_SUBST(LIB64CUPSIMAGE)
|
||||
AC_SUBST(LIB64DIR)
|
||||
AC_SUBST(UNINSTALL64)
|
||||
|
||||
dnl Position-Independent Executable support on Linux...
|
||||
dnl Position-Independent Executable support on Linux and *BSD...
|
||||
AC_ARG_ENABLE(pie, [ --enable-pie use GCC -fPIE option, default=no])
|
||||
|
||||
dnl Read-only data/program support on Linux...
|
||||
AC_ARG_ENABLE(relro, [ --enable-relro use GCC relro option, default=no])
|
||||
|
||||
dnl Update compiler options...
|
||||
CXXLIBS=""
|
||||
AC_SUBST(CXXLIBS)
|
||||
@@ -69,24 +92,6 @@ AC_SUBST(CXXLIBS)
|
||||
PIEFLAGS=""
|
||||
AC_SUBST(PIEFLAGS)
|
||||
|
||||
RELROFLAGS=""
|
||||
AC_SUBST(RELROFLAGS)
|
||||
|
||||
LIBCUPSORDER="libcups.order"
|
||||
AC_ARG_WITH(libcupsorder, [ --with-libcupsorder libcups secorder file, default=libcups.order],
|
||||
if test -f "$withval"; then
|
||||
LIBCUPSORDER="$withval"
|
||||
fi)
|
||||
AC_SUBST(LIBCUPSORDER)
|
||||
|
||||
LIBCUPSIMAGEORDER="libcupsimage.order"
|
||||
AC_ARG_WITH(libcupsimageorder, [ --with-libcupsimagesorder
|
||||
libcupsimage secorder file, default=libcupsimage.order],
|
||||
if test -f "$withval"; then
|
||||
LIBCUPSIMAGEORDER="$withval"
|
||||
fi)
|
||||
AC_SUBST(LIBCUPSIMAGEORDER)
|
||||
|
||||
if test -n "$GCC"; then
|
||||
# Add GCC-specific compiler options...
|
||||
if test -z "$OPTIM"; then
|
||||
@@ -107,10 +112,6 @@ if test -n "$GCC"; then
|
||||
if test x$enable_pie = xyes; then
|
||||
PIEFLAGS="-pie -fPIE"
|
||||
fi
|
||||
|
||||
if test x$enable_relro = xyes; then
|
||||
RELROFLAGS="-Wl,-z,relro"
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
@@ -128,42 +129,6 @@ if test -n "$GCC"; then
|
||||
fi
|
||||
|
||||
case "$uname" in
|
||||
HP-UX*)
|
||||
if test "x$enable_32bit" = xyes; then
|
||||
# Build 32-bit libraries, 64-bit base...
|
||||
if test -z "$with_arch32flags"; then
|
||||
ARCH32FLAGS="-milp32"
|
||||
else
|
||||
ARCH32FLAGS="$with_arch32flags"
|
||||
fi
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch64flags"; then
|
||||
ARCHFLAGS="-mlp64"
|
||||
else
|
||||
ARCHFLAGS="$with_arch64flags"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$enable_64bit" = xyes; then
|
||||
# Build 64-bit libraries, 32-bit base...
|
||||
if test -z "$with_arch64flags"; then
|
||||
ARCH64FLAGS="-mlp64"
|
||||
else
|
||||
ARCH64FLAGS="$with_arch64flags"
|
||||
fi
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch32flags"; then
|
||||
ARCHFLAGS="-milp32"
|
||||
else
|
||||
ARCHFLAGS="$with_arch32flags"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
IRIX)
|
||||
if test "x$enable_32bit" = xyes; then
|
||||
# Build 32-bit libraries, 64-bit base...
|
||||
@@ -172,6 +137,11 @@ if test -n "$GCC"; then
|
||||
else
|
||||
ARCH32FLAGS="$with_arch32flags"
|
||||
fi
|
||||
INSTALL32="install32bit"
|
||||
LIB32CUPS="32bit/libcups.so.2"
|
||||
LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
|
||||
LIB32DIR="$prefix/lib32"
|
||||
UNINSTALL32="uninstall32bit"
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch64flags"; then
|
||||
@@ -189,6 +159,11 @@ if test -n "$GCC"; then
|
||||
else
|
||||
ARCH64FLAGS="$with_arch64flags"
|
||||
fi
|
||||
INSTALL64="install64bit"
|
||||
LIB64CUPS="64bit/libcups.so.2"
|
||||
LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
|
||||
LIB64DIR="$prefix/lib64"
|
||||
UNINSTALL64="uninstall64bit"
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch32flags"; then
|
||||
@@ -208,6 +183,14 @@ if test -n "$GCC"; then
|
||||
else
|
||||
ARCH32FLAGS="$with_arch32flags"
|
||||
fi
|
||||
INSTALL32="install32bit"
|
||||
LIB32CUPS="32bit/libcups.so.2"
|
||||
LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
|
||||
LIB32DIR="$exec_prefix/lib"
|
||||
if test -d /usr/lib32; then
|
||||
LIB32DIR="${LIB32DIR}32"
|
||||
fi
|
||||
UNINSTALL32="uninstall32bit"
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch64flags"; then
|
||||
@@ -225,6 +208,14 @@ if test -n "$GCC"; then
|
||||
else
|
||||
ARCH64FLAGS="$with_arch64flags"
|
||||
fi
|
||||
INSTALL64="install64bit"
|
||||
LIB64CUPS="64bit/libcups.so.2"
|
||||
LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
|
||||
LIB64DIR="$exec_prefix/lib"
|
||||
if test -d /usr/lib64; then
|
||||
LIB64DIR="${LIB64DIR}64"
|
||||
fi
|
||||
UNINSTALL64="uninstall64bit"
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch32flags"; then
|
||||
@@ -244,6 +235,11 @@ if test -n "$GCC"; then
|
||||
else
|
||||
ARCH32FLAGS="$with_arch32flags"
|
||||
fi
|
||||
INSTALL32="install32bit"
|
||||
LIB32CUPS="32bit/libcups.so.2"
|
||||
LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
|
||||
LIB32DIR="$exec_prefix/lib/32"
|
||||
UNINSTALL32="uninstall32bit"
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch64flags"; then
|
||||
@@ -261,6 +257,11 @@ if test -n "$GCC"; then
|
||||
else
|
||||
ARCH64FLAGS="$with_arch64flags"
|
||||
fi
|
||||
INSTALL64="install64bit"
|
||||
LIB64CUPS="64bit/libcups.so.2"
|
||||
LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
|
||||
LIB64DIR="$exec_prefix/lib/64"
|
||||
UNINSTALL64="uninstall64bit"
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch32flags"; then
|
||||
@@ -301,40 +302,6 @@ else
|
||||
if test $PICFLAG = 1; then
|
||||
OPTIM="+z $OPTIM"
|
||||
fi
|
||||
|
||||
if test "x$enable_32bit" = xyes; then
|
||||
# Build 32-bit libraries, 64-bit base...
|
||||
if test -z "$with_arch32flags"; then
|
||||
ARCH32FLAGS="+DD32"
|
||||
else
|
||||
ARCH32FLAGS="$with_arch32flags"
|
||||
fi
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch64flags"; then
|
||||
ARCHFLAGS="+DD64"
|
||||
else
|
||||
ARCHFLAGS="$with_arch64flags"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$enable_64bit" = xyes; then
|
||||
# Build 64-bit libraries, 32-bit base...
|
||||
if test -z "$with_arch64flags"; then
|
||||
ARCH64FLAGS="+DD64"
|
||||
else
|
||||
ARCH64FLAGS="$with_arch64flags"
|
||||
fi
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch32flags"; then
|
||||
ARCHFLAGS="+DD32"
|
||||
else
|
||||
ARCHFLAGS="$with_arch32flags"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
IRIX)
|
||||
if test -z "$OPTIM"; then
|
||||
@@ -356,6 +323,11 @@ else
|
||||
else
|
||||
ARCH32FLAGS="$with_arch32flags"
|
||||
fi
|
||||
INSTALL32="install32bit"
|
||||
LIB32CUPS="32bit/libcups.so.2"
|
||||
LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
|
||||
LIB32DIR="$prefix/lib32"
|
||||
UNINSTALL32="uninstall32bit"
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch64flags"; then
|
||||
@@ -373,6 +345,11 @@ else
|
||||
else
|
||||
ARCH64FLAGS="$with_arch64flags"
|
||||
fi
|
||||
INSTALL64="install64bit"
|
||||
LIB64CUPS="64bit/libcups.so.2"
|
||||
LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
|
||||
LIB64DIR="$prefix/lib64"
|
||||
UNINSTALL64="uninstall64bit"
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch32flags"; then
|
||||
@@ -411,6 +388,11 @@ else
|
||||
# Compiling on a Solaris system, build 64-bit
|
||||
# binaries with separate 32-bit libraries...
|
||||
ARCH32FLAGS="-xarch=generic"
|
||||
INSTALL32="install32bit"
|
||||
LIB32CUPS="32bit/libcups.so.2"
|
||||
LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
|
||||
LIB32DIR="$exec_prefix/lib/32"
|
||||
UNINSTALL32="uninstall32bit"
|
||||
|
||||
if test "x$with_optim" = x; then
|
||||
# Suppress all of Sun's questionable
|
||||
@@ -430,6 +412,11 @@ else
|
||||
if test "x$enable_64bit" = xyes; then
|
||||
# Build 64-bit libraries...
|
||||
ARCH64FLAGS="-xarch=generic64"
|
||||
INSTALL64="install64bit"
|
||||
LIB64CUPS="64bit/libcups.so.2"
|
||||
LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
|
||||
LIB64DIR="$exec_prefix/lib/64"
|
||||
UNINSTALL64="uninstall64bit"
|
||||
fi
|
||||
|
||||
if test "x$with_optim" = x; then
|
||||
@@ -484,10 +471,6 @@ case $uname in
|
||||
# HP-UX 11.00 (at least) needs this definition to get the
|
||||
# u_short type used by the IP headers...
|
||||
OPTIM="$OPTIM -D_INCLUDE_HPUX_SOURCE"
|
||||
|
||||
# HP-UX 11.23 (at least) needs this definition to get the
|
||||
# IPv6 header to work...
|
||||
OPTIM="$OPTIM -D_HPUX_SOURCE"
|
||||
;;
|
||||
|
||||
OSF*)
|
||||
@@ -498,5 +481,5 @@ case $uname in
|
||||
esac
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-compiler.m4 6976 2007-09-18 20:39:31Z mike $".
|
||||
dnl End of "$Id: cups-compiler.m4 6049 2006-10-20 15:07:21Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,28 +1,34 @@
|
||||
dnl
|
||||
dnl "$Id: cups-defaults.m4 6754 2007-08-01 19:00:07Z mike $"
|
||||
dnl "$Id: cups-defaults.m4 6003 2006-10-02 16:26:04Z mike $"
|
||||
dnl
|
||||
dnl Default cupsd configuration settings for the Common UNIX Printing System
|
||||
dnl (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
dnl Copyright 2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl property of Easy Software Products and are protected by Federal
|
||||
dnl copyright law. Distribution and use rights are outlined in the file
|
||||
dnl "LICENSE.txt" which should have been included with this file. If this
|
||||
dnl file is missing or damaged please contact Easy Software Products
|
||||
dnl at:
|
||||
dnl
|
||||
dnl Attn: CUPS Licensing Information
|
||||
dnl Easy Software Products
|
||||
dnl 44141 Airport View Drive, Suite 204
|
||||
dnl Hollywood, Maryland 20636 USA
|
||||
dnl
|
||||
dnl Voice: (301) 373-9600
|
||||
dnl EMail: cups-info@cups.org
|
||||
dnl WWW: http://www.cups.org
|
||||
dnl
|
||||
|
||||
dnl Default languages...
|
||||
LANGUAGES="`ls -1 locale/*.po | sed -e '1,$s/locale\/cups_//' -e '1,$s/\.po//' | tr '\n' ' '`"
|
||||
|
||||
AC_ARG_WITH(languages, [ --with-languages set installed languages, default=all ],[
|
||||
case "$withval" in
|
||||
none | no) LANGUAGES="" ;;
|
||||
all) ;;
|
||||
*) LANGUAGES="$withval" ;;
|
||||
esac])
|
||||
dnl Default langugages...
|
||||
AC_ARG_WITH(languages, [ --with-languages set installed languages, default="de es ja pl sv" ],
|
||||
if test "x$withval" != xno; then
|
||||
LANGUAGES="$withval"
|
||||
fi,
|
||||
LANGUAGES="de es et ja pl sv")
|
||||
AC_SUBST(LANGUAGES)
|
||||
|
||||
dnl Default ConfigFilePerm
|
||||
@@ -56,46 +62,16 @@ AC_SUBST(CUPS_BROWSING)
|
||||
|
||||
dnl Default BrowseLocalProtocols
|
||||
AC_ARG_WITH(local_protocols, [ --with-local-protocols set default BrowseLocalProtocols, default="CUPS"],
|
||||
default_local_protocols="$withval",
|
||||
default_local_protocols="default")
|
||||
|
||||
if test x$with_local_protocols != xno; then
|
||||
if test "x$default_local_protocols" = "xdefault"; then
|
||||
if test "x$DNSSDLIBS" != "x"; then
|
||||
CUPS_BROWSE_LOCAL_PROTOCOLS="CUPS dnssd"
|
||||
else
|
||||
CUPS_BROWSE_LOCAL_PROTOCOLS="CUPS"
|
||||
fi
|
||||
else
|
||||
CUPS_BROWSE_LOCAL_PROTOCOLS="$default_local_protocols"
|
||||
fi
|
||||
else
|
||||
CUPS_BROWSE_LOCAL_PROTOCOLS=""
|
||||
fi
|
||||
|
||||
CUPS_BROWSE_LOCAL_PROTOCOLS="$withval",
|
||||
CUPS_BROWSE_LOCAL_PROTOCOLS="CUPS")
|
||||
AC_SUBST(CUPS_BROWSE_LOCAL_PROTOCOLS)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS,
|
||||
"$CUPS_BROWSE_LOCAL_PROTOCOLS")
|
||||
|
||||
dnl Default BrowseRemoteProtocols
|
||||
AC_ARG_WITH(remote_protocols, [ --with-remote-protocols set default BrowseRemoteProtocols, default="CUPS"],
|
||||
default_remote_protocols="$withval",
|
||||
default_remote_protocols="default")
|
||||
|
||||
if test x$with_remote_protocols != xno; then
|
||||
if test "x$default_remote_protocols" = "xdefault"; then
|
||||
if test "$uname" = "Darwin" -a $uversion -ge 90; then
|
||||
CUPS_BROWSE_REMOTE_PROTOCOLS=""
|
||||
else
|
||||
CUPS_BROWSE_REMOTE_PROTOCOLS="CUPS"
|
||||
fi
|
||||
else
|
||||
CUPS_BROWSE_REMOTE_PROTOCOLS="$default_remote_protocols"
|
||||
fi
|
||||
else
|
||||
CUPS_BROWSE_REMOTE_PROTOCOLS=""
|
||||
fi
|
||||
|
||||
CUPS_BROWSE_REMOTE_PROTOCOLS="$withval",
|
||||
CUPS_BROWSE_REMOTE_PROTOCOLS="CUPS")
|
||||
AC_SUBST(CUPS_BROWSE_REMOTE_PROTOCOLS)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSE_REMOTE_PROTOCOLS,
|
||||
"$CUPS_BROWSE_REMOTE_PROTOCOLS")
|
||||
@@ -136,11 +112,11 @@ fi
|
||||
AC_SUBST(CUPS_IMPLICIT_CLASSES)
|
||||
|
||||
dnl Default UseNetworkDefault
|
||||
AC_ARG_ENABLE(use_network_default, [ --enable-use-network-default
|
||||
AC_ARG_ENABLE(network_default, [ --enable-use-network-default
|
||||
enable UseNetworkDefault by default, default=auto])
|
||||
if test "x$enable_use_network_default" != xno; then
|
||||
if test "x$enable_network_default" != xno; then
|
||||
AC_MSG_CHECKING(whether to use network default printers)
|
||||
if test "x$enable_use_network_default" = xyes -o $uname != Darwin; then
|
||||
if test "x$enable_network_default" = xyes -o $uname != Darwin; then
|
||||
CUPS_USE_NETWORK_DEFAULT="Yes"
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USE_NETWORK_DEFAULT, 1)
|
||||
AC_MSG_RESULT(yes)
|
||||
@@ -159,14 +135,7 @@ dnl Determine the correct username and group for this OS...
|
||||
AC_ARG_WITH(cups_user, [ --with-cups-user set default user for CUPS],
|
||||
CUPS_USER="$withval",
|
||||
AC_MSG_CHECKING(for default print user)
|
||||
if test x$uname = xDarwin; then
|
||||
if test x`id -u _lp 2>/dev/null` = x; then
|
||||
CUPS_USER="lp";
|
||||
else
|
||||
CUPS_USER="_lp";
|
||||
fi
|
||||
AC_MSG_RESULT($CUPS_USER)
|
||||
elif test -f /etc/passwd; then
|
||||
if test -f /etc/passwd; then
|
||||
CUPS_USER=""
|
||||
for user in lp lpd guest daemon nobody; do
|
||||
if test "`grep \^${user}: /etc/passwd`" != ""; then
|
||||
@@ -188,15 +157,8 @@ AC_ARG_WITH(cups_user, [ --with-cups-user set default user for CUPS],
|
||||
AC_ARG_WITH(cups_group, [ --with-cups-group set default group for CUPS],
|
||||
CUPS_GROUP="$withval",
|
||||
AC_MSG_CHECKING(for default print group)
|
||||
if test x$uname = xDarwin; then
|
||||
if test x`id -g _lp 2>/dev/null` = x; then
|
||||
CUPS_GROUP="lp";
|
||||
else
|
||||
CUPS_GROUP="_lp";
|
||||
fi
|
||||
AC_MSG_RESULT($CUPS_GROUP)
|
||||
elif test -f /etc/group; then
|
||||
GROUP_LIST="_lp lp nobody"
|
||||
if test -f /etc/group; then
|
||||
GROUP_LIST="lp nobody"
|
||||
CUPS_GROUP=""
|
||||
for group in $GROUP_LIST; do
|
||||
if test "`grep \^${group}: /etc/group`" != ""; then
|
||||
@@ -218,34 +180,34 @@ AC_ARG_WITH(cups_group, [ --with-cups-group set default group for CUPS],
|
||||
AC_ARG_WITH(system_groups, [ --with-system-groups set default system groups for CUPS],
|
||||
CUPS_SYSTEM_GROUPS="$withval",
|
||||
if test x$uname = xDarwin; then
|
||||
CUPS_SYSTEM_GROUPS="admin"
|
||||
GROUP_LIST="admin"
|
||||
else
|
||||
AC_MSG_CHECKING(for default system groups)
|
||||
if test -f /etc/group; then
|
||||
CUPS_SYSTEM_GROUPS=""
|
||||
GROUP_LIST="lpadmin sys system root"
|
||||
for group in $GROUP_LIST; do
|
||||
if test "`grep \^${group}: /etc/group`" != ""; then
|
||||
if test "x$CUPS_SYSTEM_GROUPS" = x; then
|
||||
CUPS_SYSTEM_GROUPS="$group"
|
||||
else
|
||||
CUPS_SYSTEM_GROUPS="$CUPS_SYSTEM_GROUPS $group"
|
||||
fi
|
||||
GROUP_LIST="lpadmin sys system root"
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for default system groups)
|
||||
if test -f /etc/group; then
|
||||
CUPS_SYSTEM_GROUPS=""
|
||||
for group in $GROUP_LIST; do
|
||||
if test "`grep \^${group}: /etc/group`" != ""; then
|
||||
if test "x$CUPS_SYSTEM_GROUPS" = x; then
|
||||
CUPS_SYSTEM_GROUPS="$group"
|
||||
else
|
||||
CUPS_SYSTEM_GROUPS="$CUPS_SYSTEM_GROUPS $group"
|
||||
fi
|
||||
done
|
||||
|
||||
if test "x$CUPS_SYSTEM_GROUPS" = x; then
|
||||
CUPS_SYSTEM_GROUPS="$GROUP_LIST"
|
||||
AC_MSG_RESULT(no groups found, using "$CUPS_SYSTEM_GROUPS")
|
||||
else
|
||||
AC_MSG_RESULT("$CUPS_SYSTEM_GROUPS")
|
||||
fi
|
||||
else
|
||||
CUPS_SYSTEM_GROUPS="$GROUP_LIST"
|
||||
AC_MSG_RESULT(no group file, using "$CUPS_SYSTEM_GROUPS")
|
||||
fi
|
||||
fi)
|
||||
done
|
||||
|
||||
if test "x$CUPS_SYSTEM_GROUPS" = x; then
|
||||
CUPS_SYSTEM_GROUPS="$GROUP_LIST"
|
||||
AC_MSG_RESULT(no groups found, using "$CUPS_SYSTEM_GROUPS")
|
||||
else
|
||||
AC_MSG_RESULT("$CUPS_SYSTEM_GROUPS")
|
||||
fi
|
||||
else
|
||||
CUPS_SYSTEM_GROUPS="$GROUP_LIST"
|
||||
AC_MSG_RESULT(no group file, using "$CUPS_SYSTEM_GROUPS")
|
||||
fi)
|
||||
|
||||
CUPS_PRIMARY_SYSTEM_GROUP="`echo $CUPS_SYSTEM_GROUPS | awk '{print $1}'`"
|
||||
|
||||
@@ -289,54 +251,6 @@ fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTCAP, "$CUPS_DEFAULT_PRINTCAP")
|
||||
|
||||
dnl Default MaxCopies value...
|
||||
AC_ARG_WITH(max-copies, [ --with-max-copies set max copies value, default=100 ],
|
||||
CUPS_MAX_COPIES="$withval",
|
||||
if test "x$uname" = xDarwin; then
|
||||
CUPS_MAX_COPIES="999"
|
||||
else
|
||||
CUPS_MAX_COPIES="100"
|
||||
fi)
|
||||
|
||||
AC_SUBST(CUPS_MAX_COPIES)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_MAX_COPIES, $CUPS_MAX_COPIES)
|
||||
|
||||
dnl Default raw printing state
|
||||
AC_ARG_ENABLE(raw_printing, [ --enable-raw-printing enable raw printing by default, default=auto])
|
||||
if test "x$enable_raw_printing" != xno; then
|
||||
AC_MSG_CHECKING(whether to enable raw printing)
|
||||
if test "x$enable_raw_printing" = xyes -o $uname = Darwin; then
|
||||
DEFAULT_RAW_PRINTING=""
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
DEFAULT_RAW_PRINTING="#"
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
else
|
||||
DEFAULT_RAW_PRINTING="#"
|
||||
fi
|
||||
AC_SUBST(DEFAULT_RAW_PRINTING)
|
||||
|
||||
dnl Default SNMP options...
|
||||
AC_ARG_WITH(snmp-address, [ --with-snmp-address set SNMP query address, default=auto ],
|
||||
if test "x$withval" = x; then
|
||||
CUPS_SNMP_ADDRESS=""
|
||||
else
|
||||
CUPS_SNMP_ADDRESS="Address $withval"
|
||||
fi,
|
||||
if test "x$uname" = xDarwin; then
|
||||
CUPS_SNMP_ADDRESS=""
|
||||
else
|
||||
CUPS_SNMP_ADDRESS="Address @LOCAL"
|
||||
fi)
|
||||
|
||||
AC_ARG_WITH(snmp-community, [ --with-snmp-community set SNMP community, default=public ],
|
||||
CUPS_SNMP_COMMUNITY="Community $withval",
|
||||
CUPS_SNMP_COMMUNITY="Community public")
|
||||
|
||||
AC_SUBST(CUPS_SNMP_ADDRESS)
|
||||
AC_SUBST(CUPS_SNMP_COMMUNITY)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-defaults.m4 6754 2007-08-01 19:00:07Z mike $".
|
||||
dnl End of "$Id: cups-defaults.m4 6003 2006-10-02 16:26:04Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-directories.m4 6976 2007-09-18 20:39:31Z mike $"
|
||||
dnl "$Id: cups-directories.m4 5905 2006-08-29 20:48:59Z mike $"
|
||||
dnl
|
||||
dnl Directory stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl property of Easy Software Products and are protected by Federal
|
||||
dnl copyright law. Distribution and use rights are outlined in the file
|
||||
dnl "LICENSE.txt" which should have been included with this file. If this
|
||||
dnl file is missing or damaged please contact Easy Software Products
|
||||
dnl at:
|
||||
dnl
|
||||
dnl Attn: CUPS Licensing Information
|
||||
dnl Easy Software Products
|
||||
dnl 44141 Airport View Drive, Suite 204
|
||||
dnl Hollywood, Maryland 20636 USA
|
||||
dnl
|
||||
dnl Voice: (301) 373-9600
|
||||
dnl EMail: cups-info@cups.org
|
||||
dnl WWW: http://www.cups.org
|
||||
dnl
|
||||
|
||||
AC_PREFIX_DEFAULT(/)
|
||||
@@ -99,45 +108,39 @@ if test "$sysconfdir" = "\${prefix}/etc"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Fix "libdir" variable...
|
||||
dnl Fix "libdir" variable for IRIX 6.x...
|
||||
if test "$libdir" = "\${exec_prefix}/lib"; then
|
||||
case "$uname" in
|
||||
IRIX*)
|
||||
libdir="$exec_prefix/lib32"
|
||||
;;
|
||||
Linux*)
|
||||
if test -d /usr/lib64; then
|
||||
libdir="$exec_prefix/lib64"
|
||||
fi
|
||||
;;
|
||||
HP-UX*)
|
||||
if test -d /usr/lib/hpux32; then
|
||||
libdir="$exec_prefix/lib/hpux32"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if test "$uname" = "IRIX"; then
|
||||
libdir="$exec_prefix/lib32"
|
||||
else
|
||||
if test "$uname" = Linux -a -d /usr/lib64; then
|
||||
libdir="$exec_prefix/lib64"
|
||||
else
|
||||
libdir="$exec_prefix/lib"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Setup init.d locations...
|
||||
AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
|
||||
AC_ARG_WITH(rclevels, [ --with-rclevels set run levels for rc scripts],rclevels="$withval",rclevels="2 3 5")
|
||||
AC_ARG_WITH(rcstart, [ --with-rcstart set start number for rc scripts],rcstart="$withval",rcstart="99")
|
||||
AC_ARG_WITH(rcstop, [ --with-rcstop set stop number for rc scripts],rcstop="$withval",rcstop="00")
|
||||
|
||||
INITDIR=""
|
||||
INITDDIR=""
|
||||
RCLEVELS="$rclevels"
|
||||
RCSTART="$rcstart"
|
||||
RCSTOP="$rcstop"
|
||||
|
||||
if test x$rcdir = x; then
|
||||
case "$uname" in
|
||||
AIX*)
|
||||
INITDIR="/etc/rc.d"
|
||||
FreeBSD* | OpenBSD* | MirBsD* | ekkoBSD*)
|
||||
# FreeBSD and OpenBSD
|
||||
INITDIR=""
|
||||
INITDDIR=""
|
||||
;;
|
||||
|
||||
NetBSD*)
|
||||
# NetBSD
|
||||
INITDIR=""
|
||||
INITDDIR="/etc/rc.d"
|
||||
;;
|
||||
|
||||
Darwin*)
|
||||
# Darwin and MacOS X...
|
||||
INITDIR=""
|
||||
if test -x /sbin/launchd; then
|
||||
INITDDIR="/System/Library/LaunchDaemons"
|
||||
else
|
||||
@@ -145,80 +148,53 @@ if test x$rcdir = x; then
|
||||
fi
|
||||
;;
|
||||
|
||||
FreeBSD* | OpenBSD* | MirBSD* | ekkoBSD*)
|
||||
# FreeBSD and OpenBSD
|
||||
;;
|
||||
|
||||
HP-UX*)
|
||||
INITDIR="/sbin"
|
||||
RCLEVELS="2"
|
||||
RCSTART="380"
|
||||
RCSTOP="620"
|
||||
;;
|
||||
|
||||
IRIX*)
|
||||
# IRIX
|
||||
INITDIR="/etc"
|
||||
RCSTART="60"
|
||||
RCSTOP="25"
|
||||
;;
|
||||
|
||||
Linux | GNU)
|
||||
# Linux/HURD seems to choose an init.d directory at random...
|
||||
if test -d /sbin/init.d; then
|
||||
# SuSE
|
||||
INITDIR="/sbin/init.d"
|
||||
INITDDIR=".."
|
||||
else
|
||||
if test -d /etc/init.d; then
|
||||
# Others
|
||||
INITDIR="/etc"
|
||||
INITDDIR="../init.d"
|
||||
else
|
||||
# RedHat
|
||||
INITDIR="/etc/rc.d"
|
||||
INITDDIR="../init.d"
|
||||
fi
|
||||
fi
|
||||
RCSTART="81"
|
||||
RCSTOP="36"
|
||||
;;
|
||||
|
||||
NetBSD*)
|
||||
# NetBSD
|
||||
INITDDIR="/etc/rc.d"
|
||||
;;
|
||||
|
||||
OSF1*)
|
||||
OSF1* | HP-UX*)
|
||||
INITDIR="/sbin"
|
||||
INITDDIR="../init.d"
|
||||
;;
|
||||
|
||||
SunOS*)
|
||||
# Solaris
|
||||
INITDIR="/etc"
|
||||
RCSTART="81"
|
||||
AIX*)
|
||||
INITDIR="/etc/rc.d"
|
||||
INITDDIR=".."
|
||||
;;
|
||||
|
||||
*)
|
||||
INITDIR="/etc"
|
||||
INITDDIR="../init.d"
|
||||
;;
|
||||
|
||||
esac
|
||||
else
|
||||
if test "x$rclevels" = x; then
|
||||
INITDDIR="$rcdir"
|
||||
else
|
||||
INITDIR="$rcdir"
|
||||
fi
|
||||
INITDIR=""
|
||||
INITDDIR="$rcdir"
|
||||
fi
|
||||
|
||||
AC_SUBST(INITDIR)
|
||||
AC_SUBST(INITDDIR)
|
||||
AC_SUBST(RCLEVELS)
|
||||
AC_SUBST(RCSTART)
|
||||
AC_SUBST(RCSTOP)
|
||||
|
||||
dnl Xinetd support...
|
||||
AC_ARG_WITH(xinetd, [ --with-xinetd set path for xinetd config files],XINETD="$withval",XINETD="")
|
||||
XINETD=""
|
||||
|
||||
if test "x$XINETD" = x -a ! -x /sbin/launchd; then
|
||||
if test ! -x /sbin/launchd; then
|
||||
for dir in /private/etc/xinetd.d /etc/xinetd.d /usr/local/etc/xinetd.d; do
|
||||
if test -d $dir; then
|
||||
XINETD="$dir"
|
||||
@@ -250,28 +226,6 @@ CUPS_DATADIR="$datadir/cups"
|
||||
AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups")
|
||||
AC_SUBST(CUPS_DATADIR)
|
||||
|
||||
# Icon directory
|
||||
AC_ARG_WITH(icondir, [ --with-icondir set path for application icons],icondir="$withval",icondir="")
|
||||
|
||||
if test "x$icondir" = x -a -d /usr/share/icons; then
|
||||
ICONDIR="/usr/share/icons"
|
||||
else
|
||||
ICONDIR="$icondir"
|
||||
fi
|
||||
|
||||
AC_SUBST(ICONDIR)
|
||||
|
||||
# Menu directory
|
||||
AC_ARG_WITH(menudir, [ --with-menudir set path for application menus],menudir="$withval",menudir="")
|
||||
|
||||
if test "x$menudir" = x -a -d /usr/share/applications; then
|
||||
MENUDIR="/usr/share/applications"
|
||||
else
|
||||
MENUDIR="$menudir"
|
||||
fi
|
||||
|
||||
AC_SUBST(MENUDIR)
|
||||
|
||||
# Documentation files
|
||||
AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
|
||||
|
||||
@@ -297,26 +251,21 @@ fi
|
||||
AC_SUBST(CUPS_FONTPATH)
|
||||
AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
|
||||
|
||||
# Locale data (initial assignment allows us not to require autoconf 2.60)
|
||||
localedir="${localedir:=}"
|
||||
if test "$localedir" = "\${datarootdir}/locale" -o "$localedir" = ""; then
|
||||
case "$uname" in
|
||||
Linux | GNU | *BSD* | Darwin*)
|
||||
CUPS_LOCALEDIR="$datadir/locale"
|
||||
;;
|
||||
# Locale data
|
||||
case "$uname" in
|
||||
Linux | GNU | *BSD* | Darwin*)
|
||||
CUPS_LOCALEDIR="$datadir/locale"
|
||||
;;
|
||||
|
||||
OSF1* | AIX*)
|
||||
CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg"
|
||||
;;
|
||||
OSF1* | AIX*)
|
||||
CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg"
|
||||
;;
|
||||
|
||||
*)
|
||||
# This is the standard System V location...
|
||||
CUPS_LOCALEDIR="$exec_prefix/lib/locale"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
CUPS_LOCALEDIR="$localedir"
|
||||
fi
|
||||
*)
|
||||
# This is the standard System V location...
|
||||
CUPS_LOCALEDIR="$exec_prefix/lib/locale"
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR")
|
||||
AC_SUBST(CUPS_LOCALEDIR)
|
||||
@@ -367,5 +316,5 @@ AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$localstatedir/run/cups")
|
||||
AC_SUBST(CUPS_STATEDIR)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-directories.m4 6976 2007-09-18 20:39:31Z mike $".
|
||||
dnl End of "$Id: cups-directories.m4 5905 2006-08-29 20:48:59Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
dnl
|
||||
dnl DNS Service Discovery (aka Bonjour) stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl http://www.dns-sd.org
|
||||
dnl http://www.multicastdns.org/
|
||||
dnl http://developer.apple.com/networking/bonjour/
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(dnssd, [ --enable-dnssd turn on DNS Service Discovery support, default=yes])
|
||||
AC_ARG_WITH(dnssd-libs, [ --with-dnssd-libs set directory for DNS Service Discovery library],
|
||||
LDFLAGS="-L$withval $LDFLAGS"
|
||||
DSOFLAGS="-L$withval $DSOFLAGS",)
|
||||
AC_ARG_WITH(dnssd-includes, [ --with-dnssd-includes set directory for DNS Service Discovery includes],
|
||||
CFLAGS="-I$withval $CFLAGS"
|
||||
CXXFLAGS="-I$withval $CXXFLAGS"
|
||||
CPPFLAGS="-I$withval $CPPFLAGS",)
|
||||
|
||||
DNSSDLIBS=""
|
||||
|
||||
if test x$enable_dnssd != xno; then
|
||||
AC_CHECK_HEADER(dns_sd.h, [
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
# Darwin and MacOS X...
|
||||
DNSSDLIBS="-framework CoreFoundation -framework SystemConfiguration"
|
||||
AC_DEFINE(HAVE_DNSSD)
|
||||
AC_DEFINE(HAVE_COREFOUNDATION)
|
||||
AC_DEFINE(HAVE_SYSTEMCONFIGURATION)
|
||||
;;
|
||||
*)
|
||||
# All others...
|
||||
AC_CHECK_LIB(dns_sd,DNSServiceProcessResult,
|
||||
AC_DEFINE(HAVE_DNSSD)
|
||||
DNSSDLIBS="-ldns_sd")
|
||||
;;
|
||||
esac
|
||||
])
|
||||
fi
|
||||
|
||||
AC_SUBST(DNSSDLIBS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id$".
|
||||
dnl
|
||||
@@ -1,111 +0,0 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
dnl
|
||||
dnl GSSAPI/Kerberos library detection.
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 2006-2007 by Easy Software Products.
|
||||
dnl
|
||||
dnl This file contains Kerberos support code, copyright 2006 by
|
||||
dnl Jelmer Vernooij.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(gssapi, [ --enable-gssapi turn on GSSAPI support, default=yes])
|
||||
|
||||
LIBGSSAPI=""
|
||||
|
||||
if test x$enable_gssapi != xno; then
|
||||
AC_PATH_PROG(KRB5CONFIG, krb5-config)
|
||||
if test "x$KRB5CONFIG" != x; then
|
||||
if test "x$uname" = "xDarwin"; then
|
||||
# Mac OS X weak-links to the Kerberos framework...
|
||||
LIBGSSAPI="-weak_framework Kerberos"
|
||||
else
|
||||
CFLAGS="`$KRB5CONFIG --cflags gssapi` $CFLAGS"
|
||||
CPPFLAGS="`$KRB5CONFIG --cflags gssapi` $CPPFLAGS"
|
||||
LIBGSSAPI="`$KRB5CONFIG --libs gssapi`"
|
||||
fi
|
||||
AC_DEFINE(HAVE_GSSAPI, 1, [Whether GSSAPI is available])
|
||||
else
|
||||
# Check for vendor-specific implementations...
|
||||
case "$uname" in
|
||||
HP-UX*)
|
||||
AC_CHECK_LIB(gss, gss_display_status,
|
||||
AC_DEFINE(HAVE_GSSAPI, 1, [Whether GSSAPI is available])
|
||||
LIBGSSAPI="-lgss -lgssapi_krb5")
|
||||
;;
|
||||
SunOS*)
|
||||
AC_CHECK_LIB(gss, gss_display_status,
|
||||
AC_DEFINE(HAVE_GSSAPI, 1, [Whether GSSAPI is available])
|
||||
LIBGSSAPI="-lgss")
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if test "x$LIBGSSAPI" != x; then
|
||||
AC_CHECK_HEADER(krb5.h, AC_DEFINE(HAVE_KRB5_H))
|
||||
AC_CHECK_HEADER(gssapi.h, AC_DEFINE(HAVE_GSSAPI_H))
|
||||
AC_CHECK_HEADER(gssapi/gssapi.h, AC_DEFINE(HAVE_GSSAPI_GSSAPI_H))
|
||||
AC_CHECK_HEADER(gssapi/gssapi_generic.h, AC_DEFINE(HAVE_GSSAPI_GSSAPI_GENERIC_H))
|
||||
AC_CHECK_HEADER(gssapi/gssapi_krb5.h, AC_DEFINE(HAVE_GSSAPI_GSSAPI_KRB5_H))
|
||||
|
||||
SAVELIBS="$LIBS"
|
||||
LIBS="$LIBS $LIBGSSAPI"
|
||||
|
||||
AC_CHECK_FUNC(gsskrb5_register_acceptor_identity,
|
||||
AC_DEFINE(HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY))
|
||||
AC_CHECK_FUNC(krb5_cc_new_unique, AC_DEFINE(HAVE_KRB5_CC_NEW_UNIQUE))
|
||||
|
||||
AC_MSG_CHECKING(for GSS_C_NT_HOSTBASED_SERVICE)
|
||||
if test $ac_cv_header_gssapi_gssapi_h = yes; then
|
||||
AC_TRY_COMPILE([ #include <gssapi/gssapi.h> ],
|
||||
[ gss_OID foo = GSS_C_NT_HOSTBASED_SERVICE; ],
|
||||
AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE)
|
||||
AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT(no))
|
||||
else
|
||||
AC_TRY_COMPILE([ #include <gssapi.h> ],
|
||||
[ gss_OID foo = GSS_C_NT_HOSTBASED_SERVICE; ],
|
||||
AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE)
|
||||
AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT(no))
|
||||
fi
|
||||
|
||||
LIBS="$SAVELIBS"
|
||||
|
||||
AC_MSG_CHECKING(for Heimdal Kerberos)
|
||||
AC_TRY_COMPILE([ #include <krb5.h> ],
|
||||
[ char *tmp = heimdal_version; ],
|
||||
AC_DEFINE(HAVE_HEIMDAL)
|
||||
AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT(no))
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Default GSS service name...
|
||||
AC_ARG_WITH(gssservicename, [ --with-gssservicename set default gss service name],
|
||||
default_gssservicename="$withval",
|
||||
default_gssservicename="default")
|
||||
|
||||
if test x$default_gssservicename != xno; then
|
||||
if test "x$default_gssservicename" = "xdefault"; then
|
||||
CUPS_DEFAULT_GSSSERVICENAME="ipp"
|
||||
else
|
||||
CUPS_DEFAULT_GSSSERVICENAME="$default_gssservicename"
|
||||
fi
|
||||
else
|
||||
CUPS_DEFAULT_GSSSERVICENAME=""
|
||||
fi
|
||||
|
||||
AC_SUBST(LIBGSSAPI)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_GSSSERVICENAME, "$CUPS_DEFAULT_GSSSERVICENAME")
|
||||
|
||||
dnl
|
||||
dnl End of "$Id$".
|
||||
dnl
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-image.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-image.m4 5580 2006-05-23 19:30:23Z mike $"
|
||||
dnl
|
||||
dnl Image library/filter stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl property of Easy Software Products and are protected by Federal
|
||||
dnl copyright law. Distribution and use rights are outlined in the file
|
||||
dnl "LICENSE.txt" which should have been included with this file. If this
|
||||
dnl file is missing or damaged please contact Easy Software Products
|
||||
dnl at:
|
||||
dnl
|
||||
dnl Attn: CUPS Licensing Information
|
||||
dnl Easy Software Products
|
||||
dnl 44141 Airport View Drive, Suite 204
|
||||
dnl Hollywood, Maryland 20636 USA
|
||||
dnl
|
||||
dnl Voice: (301) 373-9600
|
||||
dnl EMail: cups-info@cups.org
|
||||
dnl WWW: http://www.cups.org
|
||||
dnl
|
||||
|
||||
dnl See if we want the image filters included at all...
|
||||
@@ -105,5 +114,5 @@ AC_SUBST(EXPORT_LIBZ)
|
||||
AC_CHECK_HEADER(stdlib.h,AC_DEFINE(HAVE_STDLIB_H))
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-image.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-image.m4 5580 2006-05-23 19:30:23Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-largefile.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-largefile.m4 4732 2005-09-30 23:23:25Z mike $"
|
||||
dnl
|
||||
dnl Large file support stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl property of Easy Software Products and are protected by Federal
|
||||
dnl copyright law. Distribution and use rights are outlined in the file
|
||||
dnl "LICENSE.txt" which should have been included with this file. If this
|
||||
dnl file is missing or damaged please contact Easy Software Products
|
||||
dnl at:
|
||||
dnl
|
||||
dnl Attn: CUPS Licensing Information
|
||||
dnl Easy Software Products
|
||||
dnl 44141 Airport View Drive, Suite 204
|
||||
dnl Hollywood, Maryland 20636 USA
|
||||
dnl
|
||||
dnl Voice: (301) 373-9600
|
||||
dnl EMail: cups-info@cups.org
|
||||
dnl WWW: http://www.cups.org
|
||||
dnl
|
||||
|
||||
dnl Check for largefile support...
|
||||
@@ -21,11 +30,11 @@ LARGEFILE=""
|
||||
if test x$enable_largefile != xno; then
|
||||
LARGEFILE="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
|
||||
|
||||
if test x$ac_cv_sys_large_files = x1; then
|
||||
if test $ac_cv_sys_large_files = 1; then
|
||||
LARGEFILE="$LARGEFILE -D_LARGE_FILES"
|
||||
fi
|
||||
|
||||
if test x$ac_cv_sys_file_offset_bits = x64; then
|
||||
if test $ac_cv_sys_file_offset_bits = 64; then
|
||||
LARGEFILE="$LARGEFILE -D_FILE_OFFSET_BITS=64"
|
||||
fi
|
||||
fi
|
||||
@@ -48,5 +57,5 @@ fi
|
||||
AC_CHECK_FUNC(strtoll, AC_DEFINE(HAVE_STRTOLL))
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-largefile.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-largefile.m4 4732 2005-09-30 23:23:25Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-launchd.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-launchd.m4 5466 2006-04-26 19:52:27Z mike $"
|
||||
dnl
|
||||
dnl launchd stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl property of Easy Software Products and are protected by Federal
|
||||
dnl copyright law. Distribution and use rights are outlined in the file
|
||||
dnl "LICENSE.txt" which should have been included with this file. If this
|
||||
dnl file is missing or damaged please contact Easy Software Products
|
||||
dnl at:
|
||||
dnl
|
||||
dnl Attn: CUPS Licensing Information
|
||||
dnl Easy Software Products
|
||||
dnl 44141 Airport View Drive, Suite 204
|
||||
dnl Hollywood, Maryland 20636 USA
|
||||
dnl
|
||||
dnl Voice: (301) 373-9600
|
||||
dnl EMail: cups-info@cups.org
|
||||
dnl WWW: http://www.cups.org
|
||||
dnl
|
||||
|
||||
|
||||
@@ -40,5 +49,5 @@ AC_SUBST(DEFAULT_LAUNCHD_CONF)
|
||||
AC_SUBST(LAUNCHDLIBS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-launchd.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-launchd.m4 5466 2006-04-26 19:52:27Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-ldap.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-ldap.m4 5564 2006-05-22 00:59:11Z mike $"
|
||||
dnl
|
||||
dnl LDAP configuration stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 2003-2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl property of Easy Software Products and are protected by Federal
|
||||
dnl copyright law. Distribution and use rights are outlined in the file
|
||||
dnl "LICENSE.txt" which should have been included with this file. If this
|
||||
dnl file is missing or damaged please contact Easy Software Products
|
||||
dnl at:
|
||||
dnl
|
||||
dnl Attn: CUPS Licensing Information
|
||||
dnl Easy Software Products
|
||||
dnl 44141 Airport View Drive, Suite 204
|
||||
dnl Hollywood, Maryland 20636 USA
|
||||
dnl
|
||||
dnl Voice: (301) 373-9600
|
||||
dnl EMail: cups-info@cups.org
|
||||
dnl WWW: http://www.cups.org/
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(ldap, [ --enable-ldap turn on LDAP support, default=yes])
|
||||
@@ -37,5 +46,5 @@ AC_SUBST(LIBLDAP)
|
||||
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-ldap.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-ldap.m4 5564 2006-05-22 00:59:11Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-libtool.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-libtool.m4 5466 2006-04-26 19:52:27Z mike $"
|
||||
dnl
|
||||
dnl Libtool stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl property of Easy Software Products and are protected by Federal
|
||||
dnl copyright law. Distribution and use rights are outlined in the file
|
||||
dnl "LICENSE.txt" which should have been included with this file. If this
|
||||
dnl file is missing or damaged please contact Easy Software Products
|
||||
dnl at:
|
||||
dnl
|
||||
dnl Attn: CUPS Licensing Information
|
||||
dnl Easy Software Products
|
||||
dnl 44141 Airport View Drive, Suite 204
|
||||
dnl Hollywood, Maryland 20636 USA
|
||||
dnl
|
||||
dnl Voice: (301) 373-9600
|
||||
dnl EMail: cups-info@cups.org
|
||||
dnl WWW: http://www.cups.org
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(libtool_unsupported, [ --enable-libtool-unsupported=LIBTOOL_PATH
|
||||
@@ -36,5 +45,5 @@ if test x$LIBTOOL != x; then
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-libtool.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-libtool.m4 5466 2006-04-26 19:52:27Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-manpages.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-manpages.m4 5799 2006-08-03 00:54:38Z mike $"
|
||||
dnl
|
||||
dnl Manpage stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl property of Easy Software Products and are protected by Federal
|
||||
dnl copyright law. Distribution and use rights are outlined in the file
|
||||
dnl "LICENSE.txt" which should have been included with this file. If this
|
||||
dnl file is missing or damaged please contact Easy Software Products
|
||||
dnl at:
|
||||
dnl
|
||||
dnl Attn: CUPS Licensing Information
|
||||
dnl Easy Software Products
|
||||
dnl 44141 Airport View Drive, Suite 204
|
||||
dnl Hollywood, Maryland 20636 USA
|
||||
dnl
|
||||
dnl Voice: (301) 373-9600
|
||||
dnl EMail: cups-info@cups.org
|
||||
dnl WWW: http://www.cups.org
|
||||
dnl
|
||||
|
||||
dnl Fix "mandir" variable...
|
||||
@@ -100,5 +109,5 @@ AC_SUBST(MAN8EXT)
|
||||
AC_SUBST(MAN8DIR)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-manpages.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-manpages.m4 5799 2006-08-03 00:54:38Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-network.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-network.m4 6049 2006-10-20 15:07:21Z mike $"
|
||||
dnl
|
||||
dnl Networking stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl property of Easy Software Products and are protected by Federal
|
||||
dnl copyright law. Distribution and use rights are outlined in the file
|
||||
dnl "LICENSE.txt" which should have been included with this file. If this
|
||||
dnl file is missing or damaged please contact Easy Software Products
|
||||
dnl at:
|
||||
dnl
|
||||
dnl Attn: CUPS Licensing Information
|
||||
dnl Easy Software Products
|
||||
dnl 44141 Airport View Drive, Suite 204
|
||||
dnl Hollywood, Maryland 20636 USA
|
||||
dnl
|
||||
dnl Voice: (301) 373-9600
|
||||
dnl EMail: cups-info@cups.org
|
||||
dnl WWW: http://www.cups.org
|
||||
dnl
|
||||
|
||||
AC_SEARCH_LIBS(socket, socket)
|
||||
@@ -42,7 +51,7 @@ else
|
||||
maxfiles=4096
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(maxfiles, [ --with-maxfiles=N set maximum number of file descriptors for scheduler ],
|
||||
AC_ARG_WITH(maxfiles, [ --with-maxfiles=N set maximum number of file descriptors for scheduler (deprecated) ],
|
||||
maxfiles=$withval)
|
||||
|
||||
AC_DEFINE_UNQUOTED(CUPS_MAX_FDS, $maxfiles)
|
||||
@@ -80,9 +89,6 @@ fi
|
||||
AC_SUBST(CUPS_DEFAULT_DOMAINSOCKET)
|
||||
AC_SUBST(CUPS_LISTEN_DOMAINSOCKET)
|
||||
|
||||
AC_CHECK_HEADERS(AppleTalk/at_proto.h,AC_DEFINE(HAVE_APPLETALK_AT_PROTO_H),,
|
||||
[#include <netat/appletalk.h>])
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-network.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-network.m4 6049 2006-10-20 15:07:21Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,22 +1,30 @@
|
||||
dnl
|
||||
dnl "$Id: cups-opsys.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-opsys.m4 5466 2006-04-26 19:52:27Z mike $"
|
||||
dnl
|
||||
dnl Operating system stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl property of Easy Software Products and are protected by Federal
|
||||
dnl copyright law. Distribution and use rights are outlined in the file
|
||||
dnl "LICENSE.txt" which should have been included with this file. If this
|
||||
dnl file is missing or damaged please contact Easy Software Products
|
||||
dnl at:
|
||||
dnl
|
||||
dnl Attn: CUPS Licensing Information
|
||||
dnl Easy Software Products
|
||||
dnl 44141 Airport View Drive, Suite 204
|
||||
dnl Hollywood, Maryland 20636 USA
|
||||
dnl
|
||||
dnl Voice: (301) 373-9600
|
||||
dnl EMail: cups-info@cups.org
|
||||
dnl WWW: http://www.cups.org
|
||||
dnl
|
||||
|
||||
dnl Get the operating system, version number, and architecture...
|
||||
dnl Get the operating system and version number...
|
||||
uname=`uname`
|
||||
uversion=`uname -r | sed -e '1,$s/^[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\).*/\1\2/'`
|
||||
uarch=`uname -m`
|
||||
|
||||
case "$uname" in
|
||||
GNU* | GNU/*)
|
||||
@@ -31,5 +39,5 @@ case "$uname" in
|
||||
esac
|
||||
|
||||
dnl
|
||||
dnl "$Id: cups-opsys.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-opsys.m4 5466 2006-04-26 19:52:27Z mike $"
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-pam.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-pam.m4 5466 2006-04-26 19:52:27Z mike $"
|
||||
dnl
|
||||
dnl PAM stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl property of Easy Software Products and are protected by Federal
|
||||
dnl copyright law. Distribution and use rights are outlined in the file
|
||||
dnl "LICENSE.txt" which should have been included with this file. If this
|
||||
dnl file is missing or damaged please contact Easy Software Products
|
||||
dnl at:
|
||||
dnl
|
||||
dnl Attn: CUPS Licensing Information
|
||||
dnl Easy Software Products
|
||||
dnl 44141 Airport View Drive, Suite 204
|
||||
dnl Hollywood, Maryland 20636 USA
|
||||
dnl
|
||||
dnl Voice: (301) 373-9600
|
||||
dnl EMail: cups-info@cups.org
|
||||
dnl WWW: http://www.cups.org
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(pam, [ --enable-pam turn on PAM support, default=yes])
|
||||
@@ -85,5 +94,5 @@ AC_SUBST(PAMLIBS)
|
||||
AC_SUBST(PAMMOD)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-pam.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-pam.m4 5466 2006-04-26 19:52:27Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -3,14 +3,23 @@ dnl "$Id: cups-pam.m4 5466 2006-04-26 19:52:27Z mike $"
|
||||
dnl
|
||||
dnl PAP (AppleTalk) stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl property of Easy Software Products and are protected by Federal
|
||||
dnl copyright law. Distribution and use rights are outlined in the file
|
||||
dnl "LICENSE.txt" which should have been included with this file. If this
|
||||
dnl file is missing or damaged please contact Easy Software Products
|
||||
dnl at:
|
||||
dnl
|
||||
dnl Attn: CUPS Licensing Information
|
||||
dnl Easy Software Products
|
||||
dnl 44141 Airport View Drive, Suite 204
|
||||
dnl Hollywood, Maryland 20636 USA
|
||||
dnl
|
||||
dnl Voice: (301) 373-9600
|
||||
dnl EMail: cups-info@cups.org
|
||||
dnl WWW: http://www.cups.org
|
||||
dnl
|
||||
|
||||
# Currently the PAP backend is only supported on MacOS X with the AppleTalk
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-pdf.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-pdf.m4 5466 2006-04-26 19:52:27Z mike $"
|
||||
dnl
|
||||
dnl PDF filter configuration stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl property of Easy Software Products and are protected by Federal
|
||||
dnl copyright law. Distribution and use rights are outlined in the file
|
||||
dnl "LICENSE.txt" which should have been included with this file. If this
|
||||
dnl file is missing or damaged please contact Easy Software Products
|
||||
dnl at:
|
||||
dnl
|
||||
dnl Attn: CUPS Licensing Information
|
||||
dnl Easy Software Products
|
||||
dnl 44141 Airport View Drive, Suite 204
|
||||
dnl Hollywood, Maryland 20636 USA
|
||||
dnl
|
||||
dnl Voice: (301) 373-9600
|
||||
dnl EMail: cups-info@cups.org
|
||||
dnl WWW: http://www.cups.org
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(pdftops, [ --enable-pdftops build pdftops filter, default=auto ])
|
||||
@@ -30,5 +39,5 @@ fi
|
||||
AC_SUBST(PDFTOPS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-pdf.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-pdf.m4 5466 2006-04-26 19:52:27Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
dnl
|
||||
dnl Select/poll stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_CHECK_FUNC(poll, AC_DEFINE(HAVE_POLL))
|
||||
AC_CHECK_FUNC(epoll_create, AC_DEFINE(HAVE_EPOLL))
|
||||
AC_CHECK_FUNC(kqueue, AC_DEFINE(HAVE_KQUEUE))
|
||||
|
||||
dnl
|
||||
dnl End of "$Id$".
|
||||
dnl
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-scripting.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-scripting.m4 5466 2006-04-26 19:52:27Z mike $"
|
||||
dnl
|
||||
dnl Scripting configuration stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl property of Easy Software Products and are protected by Federal
|
||||
dnl copyright law. Distribution and use rights are outlined in the file
|
||||
dnl "LICENSE.txt" which should have been included with this file. If this
|
||||
dnl file is missing or damaged please contact Easy Software Products
|
||||
dnl at:
|
||||
dnl
|
||||
dnl Attn: CUPS Licensing Information
|
||||
dnl Easy Software Products
|
||||
dnl 44141 Airport View Drive, Suite 204
|
||||
dnl Hollywood, Maryland 20636 USA
|
||||
dnl
|
||||
dnl Voice: (301) 373-9600
|
||||
dnl EMail: cups-info@cups.org
|
||||
dnl WWW: http://www.cups.org
|
||||
dnl
|
||||
|
||||
dnl Do we have Java?
|
||||
@@ -91,5 +100,5 @@ if test "x$CUPS_PYTHON" != x; then
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-scripting.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-scripting.m4 5466 2006-04-26 19:52:27Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-sharedlibs.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-sharedlibs.m4 5582 2006-05-24 01:00:35Z mike $"
|
||||
dnl
|
||||
dnl Shared library support for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl property of Easy Software Products and are protected by Federal
|
||||
dnl copyright law. Distribution and use rights are outlined in the file
|
||||
dnl "LICENSE.txt" which should have been included with this file. If this
|
||||
dnl file is missing or damaged please contact Easy Software Products
|
||||
dnl at:
|
||||
dnl
|
||||
dnl Attn: CUPS Licensing Information
|
||||
dnl Easy Software Products
|
||||
dnl 44141 Airport View Drive, Suite 204
|
||||
dnl Hollywood, Maryland 20636 USA
|
||||
dnl
|
||||
dnl Voice: (301) 373-9600
|
||||
dnl EMail: cups-info@cups.org
|
||||
dnl WWW: http://www.cups.org
|
||||
dnl
|
||||
|
||||
PICFLAG=1
|
||||
@@ -27,20 +36,10 @@ if test x$enable_shared != xno; then
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-h,\`basename \$@\` -G \$(OPTIM)"
|
||||
;;
|
||||
HP-UX*)
|
||||
case "$uarch" in
|
||||
ia64)
|
||||
LIBCUPS="libcups.so.2"
|
||||
LIBCUPSIMAGE="libcupsimage.so.2"
|
||||
DSO="\$(CC)"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-b,-z,+h,\`basename \$@\`"
|
||||
;;
|
||||
*)
|
||||
LIBCUPS="libcups.sl.2"
|
||||
LIBCUPSIMAGE="libcupsimage.sl.2"
|
||||
DSO="\$(LD)"
|
||||
DSOFLAGS="$DSOFLAGS -b -z +h \`basename \$@\`"
|
||||
;;
|
||||
esac
|
||||
LIBCUPS="libcups.sl.2"
|
||||
LIBCUPSIMAGE="libcupsimage.sl.2"
|
||||
DSO="\$(LD)"
|
||||
DSOFLAGS="$DSOFLAGS -b -z +h \`basename \$@\`"
|
||||
;;
|
||||
IRIX)
|
||||
LIBCUPS="libcups.so.2"
|
||||
@@ -127,18 +126,9 @@ if test "$DSO" != ":"; then
|
||||
case $uname in
|
||||
HP-UX*)
|
||||
# HP-UX needs the path, even for /usr/lib...
|
||||
case "$uarch" in
|
||||
ia64)
|
||||
DSOFLAGS="-Wl,+s,+b,$libdir $DSOFLAGS"
|
||||
DSO32FLAGS="-Wl,+s,+b,$LIB32DIR $DSO32FLAGS"
|
||||
DSO64FLAGS="-Wl,+s,+b,$LIB64DIR $DSO64FLAGS"
|
||||
;;
|
||||
*)
|
||||
DSOFLAGS="+s +b $libdir $DSOFLAGS"
|
||||
DSO32FLAGS="+s +b $LIB32DIR $DSO32FLAGS"
|
||||
DSO64FLAGS="+s +b $LIB64DIR $DSO64FLAGS"
|
||||
;;
|
||||
esac
|
||||
DSOFLAGS="+s +b $libdir $DSOFLAGS"
|
||||
DSO32FLAGS="+s +b $LIB32DIR $DSO32FLAGS"
|
||||
DSO64FLAGS="+s +b $LIB64DIR $DSO64FLAGS"
|
||||
LDFLAGS="$LDFLAGS -Wl,+s,+b,$libdir"
|
||||
EXPORT_LDFLAGS="-Wl,+s,+b,$libdir"
|
||||
;;
|
||||
@@ -183,5 +173,5 @@ AC_SUBST(IMGLIBS)
|
||||
AC_SUBST(EXPORT_LDFLAGS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-sharedlibs.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-sharedlibs.m4 5582 2006-05-24 01:00:35Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-slp.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-slp.m4 5466 2006-04-26 19:52:27Z mike $"
|
||||
dnl
|
||||
dnl OpenSLP configuration stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl property of Easy Software Products and are protected by Federal
|
||||
dnl copyright law. Distribution and use rights are outlined in the file
|
||||
dnl "LICENSE.txt" which should have been included with this file. If this
|
||||
dnl file is missing or damaged please contact Easy Software Products
|
||||
dnl at:
|
||||
dnl
|
||||
dnl Attn: CUPS Licensing Information
|
||||
dnl Easy Software Products
|
||||
dnl 44141 Airport View Drive, Suite 204
|
||||
dnl Hollywood, Maryland 20636 USA
|
||||
dnl
|
||||
dnl Voice: (301) 373-9600
|
||||
dnl EMail: cups-info@cups.org
|
||||
dnl WWW: http://www.cups.org
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(slp, [ --enable-slp turn on SLP support, default=yes])
|
||||
@@ -35,5 +44,5 @@ AC_SUBST(LIBSLP)
|
||||
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-slp.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-slp.m4 5466 2006-04-26 19:52:27Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-ssl.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-ssl.m4 5630 2006-06-05 18:42:53Z mike $"
|
||||
dnl
|
||||
dnl OpenSSL/GNUTLS stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl property of Easy Software Products and are protected by Federal
|
||||
dnl copyright law. Distribution and use rights are outlined in the file
|
||||
dnl "LICENSE.txt" which should have been included with this file. If this
|
||||
dnl file is missing or damaged please contact Easy Software Products
|
||||
dnl at:
|
||||
dnl
|
||||
dnl Attn: CUPS Licensing Information
|
||||
dnl Easy Software Products
|
||||
dnl 44141 Airport View Drive, Suite 204
|
||||
dnl Hollywood, Maryland 20636 USA
|
||||
dnl
|
||||
dnl Voice: (301) 373-9600
|
||||
dnl EMail: cups-info@cups.org
|
||||
dnl WWW: http://www.cups.org
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(ssl, [ --enable-ssl turn on SSL/TLS support, default=yes])
|
||||
@@ -33,33 +42,15 @@ if test x$enable_ssl != xno; then
|
||||
dnl Look for CDSA...
|
||||
if test "x${SSLLIBS}" = "x" -a "x${enable_cdsassl}" != "xno"; then
|
||||
if test $uname = Darwin; then
|
||||
AC_CHECK_HEADER(Security/SecureTransport.h, [
|
||||
SSLLIBS="-framework CoreFoundation -framework Security"
|
||||
# MacOS X doesn't (yet) come with pre-installed encryption
|
||||
# certificates for CUPS, so don't enable encryption on
|
||||
# /admin just yet...
|
||||
#ENCRYPTION_REQUIRED=" Encryption Required"
|
||||
AC_DEFINE(HAVE_SSL)
|
||||
AC_DEFINE(HAVE_CDSASSL)
|
||||
|
||||
dnl Check for the various security headers...
|
||||
AC_CHECK_HEADER(Security/SecPolicy.h,
|
||||
AC_DEFINE(HAVE_SECPOLICY_H))
|
||||
AC_CHECK_HEADER(Security/SecPolicyPriv.h,
|
||||
AC_DEFINE(HAVE_SECPOLICYPRIV_H))
|
||||
AC_CHECK_HEADER(Security/SecBasePriv.h,
|
||||
AC_DEFINE(HAVE_SECBASEPRIV_H))
|
||||
AC_CHECK_HEADER(Security/SecIdentitySearchPriv.h,
|
||||
AC_DEFINE(HAVE_SECIDENTITYSEARCHPRIV_H))
|
||||
|
||||
dnl Check for SecIdentitySearchCreateWithPolicy...
|
||||
AC_MSG_CHECKING(for SecIdentitySearchCreateWithPolicy)
|
||||
if test $uversion -ge 80; then
|
||||
AC_DEFINE(HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY)
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi])
|
||||
AC_CHECK_HEADER(Security/SecureTransport.h,
|
||||
[SSLLIBS="-framework CoreFoundation -framework Security"
|
||||
# MacOS X doesn't (yet) come with pre-installed encryption
|
||||
# certificates for CUPS, so don't enable encryption on
|
||||
# /admin just yet...
|
||||
#ENCRYPTION_REQUIRED=" Encryption Required"
|
||||
AC_CHECK_HEADER(Security/SecBasePriv.h,AC_DEFINE(HAVE_SECBASEPRIV_H))
|
||||
AC_DEFINE(HAVE_SSL)
|
||||
AC_DEFINE(HAVE_CDSASSL)])
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -124,5 +115,5 @@ AC_SUBST(EXPORT_SSLLIBS)
|
||||
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-ssl.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-ssl.m4 5630 2006-06-05 18:42:53Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
dnl
|
||||
dnl "$Id: cups-threads.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-threads.m4 6012 2006-10-03 22:35:12Z mike $"
|
||||
dnl
|
||||
dnl Threading stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl property of Easy Software Products and are protected by Federal
|
||||
dnl copyright law. Distribution and use rights are outlined in the file
|
||||
dnl "LICENSE.txt" which should have been included with this file. If this
|
||||
dnl file is missing or damaged please contact Easy Software Products
|
||||
dnl at:
|
||||
dnl
|
||||
dnl Attn: CUPS Licensing Information
|
||||
dnl Easy Software Products
|
||||
dnl 44141 Airport View Drive, Suite 204
|
||||
dnl Hollywood, Maryland 20636 USA
|
||||
dnl
|
||||
dnl Voice: (301) 373-9600
|
||||
dnl EMail: cups-info@cups.org
|
||||
dnl WWW: http://www.cups.org
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(threads, [ --enable-threads enable multi-threading support])
|
||||
@@ -36,10 +45,10 @@ if test "x$enable_threads" != xno; then
|
||||
if test $have_pthread = yes; then
|
||||
PTHREAD_FLAGS="-D_THREAD_SAFE -D_REENTRANT"
|
||||
|
||||
# Solaris requires -D_POSIX_PTHREAD_SEMANTICS to
|
||||
# Solaris requires _POSIX_PTHREAD_SEMANTICS to
|
||||
# be POSIX-compliant... :(
|
||||
if test $uname = SunOS; then
|
||||
PTHREAD_FLAGS="$PTHREAD_FLAGS -D_POSIX_PTHREAD_SEMANTICS"
|
||||
PTHREAD_FLAGS="$PTHREAD_FLAGS _POSIX_PTHREAD_SEMANTICS"
|
||||
fi
|
||||
break
|
||||
fi
|
||||
@@ -50,5 +59,5 @@ fi
|
||||
AC_SUBST(PTHREAD_FLAGS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-threads.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-threads.m4 6012 2006-10-03 22:35:12Z mike $".
|
||||
dnl
|
||||
|
||||
+16
-109
@@ -3,14 +3,23 @@
|
||||
*
|
||||
* Configuration file for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE.txt" which should have been included with this file. If this
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_CONFIG_H_
|
||||
@@ -31,7 +40,6 @@
|
||||
#define CUPS_DEFAULT_USER "lp"
|
||||
#define CUPS_DEFAULT_GROUP "sys"
|
||||
#define CUPS_DEFAULT_SYSTEM_GROUPS "sys root system"
|
||||
#define CUPS_DEFAULT_PRINTADMIN_AUTH "@SYSTEM"
|
||||
|
||||
|
||||
/*
|
||||
@@ -69,13 +77,6 @@
|
||||
#define CUPS_DEFAULT_PRINTCAP "/etc/printcap"
|
||||
|
||||
|
||||
/*
|
||||
* Default MaxCopies value...
|
||||
*/
|
||||
|
||||
#define CUPS_DEFAULT_MAX_COPIES 100
|
||||
|
||||
|
||||
/*
|
||||
* Maximum number of file descriptors to support.
|
||||
*/
|
||||
@@ -267,21 +268,10 @@
|
||||
|
||||
|
||||
/*
|
||||
* What Security framework headers do we have?
|
||||
* Do we have <Security/SecBasePriv.h>?
|
||||
*/
|
||||
|
||||
#undef HAVE_AUTHORIZATION_H
|
||||
#undef HAVE_SECPOLICY_H
|
||||
#undef HAVE_SECPOLICYPRIV_H
|
||||
#undef HAVE_SECBASEPRIV_H
|
||||
#undef HAVE_SECIDENTITYSEARCHPRIV_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the SecIdentitySearchCreateWithPolicy function?
|
||||
*/
|
||||
|
||||
#undef HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY
|
||||
|
||||
|
||||
/*
|
||||
@@ -306,21 +296,6 @@
|
||||
#undef HAVE_LIBPAPER
|
||||
|
||||
|
||||
/*
|
||||
* Do we have DNS Service Discovery (aka Bonjour)?
|
||||
*/
|
||||
|
||||
#undef HAVE_DNSSD
|
||||
|
||||
|
||||
/*
|
||||
* Do we have Darwin's CoreFoundation and SystemConfiguration frameworks?
|
||||
*/
|
||||
|
||||
#undef HAVE_COREFOUNDATION
|
||||
#undef HAVE_SYSTEMCONFIGURATION
|
||||
|
||||
|
||||
/*
|
||||
* Do we have <sys/ioctl.h>?
|
||||
*/
|
||||
@@ -445,19 +420,11 @@
|
||||
#undef HAVE_CFBUNDLEPRIV_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have CFLocaleCreateCanonicalLocaleIdentifierFromString()?
|
||||
*/
|
||||
|
||||
#undef HAVE_CF_LOCALE_ID
|
||||
|
||||
|
||||
/*
|
||||
* Do we have MacOSX 10.4's mbr_XXX functions()?
|
||||
*/
|
||||
|
||||
#undef HAVE_MEMBERSHIP_H
|
||||
#undef HAVE_MEMBERSHIPPRIV_H
|
||||
#undef HAVE_MBR_UID_TO_UUID
|
||||
|
||||
|
||||
@@ -484,66 +451,6 @@
|
||||
#undef HAVE_APPLETALK_AT_PROTO_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the GSSAPI support library (for Kerberos support)?
|
||||
*/
|
||||
|
||||
#undef HAVE_GSSAPI
|
||||
#undef HAVE_GSSAPI_H
|
||||
#undef HAVE_GSSAPI_GSSAPI_H
|
||||
#undef HAVE_GSSAPI_GSSAPI_GENERIC_H
|
||||
#undef HAVE_GSSAPI_GSSAPI_KRB5_H
|
||||
#undef HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY
|
||||
#undef HAVE_GSS_C_NT_HOSTBASED_SERVICE
|
||||
#undef HAVE_KRB5_CC_NEW_UNIQUE
|
||||
#undef HAVE_KRB5_H
|
||||
#undef HAVE_HEIMDAL
|
||||
|
||||
|
||||
/*
|
||||
* Default GSS service name...
|
||||
*/
|
||||
|
||||
#define CUPS_DEFAULT_GSSSERVICENAME ""
|
||||
|
||||
|
||||
/*
|
||||
* Select/poll interfaces...
|
||||
*/
|
||||
|
||||
#undef HAVE_POLL
|
||||
#undef HAVE_EPOLL
|
||||
#undef HAVE_KQUEUE
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the <dlfcn.h> header?
|
||||
*/
|
||||
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have <sys/param.h>?
|
||||
*/
|
||||
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have <sys/ucred.h>?
|
||||
*/
|
||||
|
||||
#undef HAVE_SYS_UCRED_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have removefile()?
|
||||
*/
|
||||
|
||||
#undef HAVE_REMOVEFILE
|
||||
|
||||
|
||||
#endif /* !_CUPS_CONFIG_H_ */
|
||||
|
||||
/*
|
||||
|
||||
+23
-15
@@ -3,14 +3,23 @@ dnl "$Id$"
|
||||
dnl
|
||||
dnl Configuration script for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl property of Easy Software Products and are protected by Federal
|
||||
dnl copyright law. Distribution and use rights are outlined in the file
|
||||
dnl "LICENSE.txt" which should have been included with this file. If this
|
||||
dnl file is missing or damaged please contact Easy Software Products
|
||||
dnl at:
|
||||
dnl
|
||||
dnl Attn: CUPS Licensing Information
|
||||
dnl Easy Software Products
|
||||
dnl 44141 Airport View Drive, Suite 204
|
||||
dnl Hollywood, Maryland 20636 USA
|
||||
dnl
|
||||
dnl Voice: (301) 373-9600
|
||||
dnl EMail: cups-info@cups.org
|
||||
dnl WWW: http://www.cups.org
|
||||
dnl
|
||||
|
||||
AC_INIT(cups/cups.h)
|
||||
@@ -20,22 +29,18 @@ sinclude(config-scripts/cups-common.m4)
|
||||
sinclude(config-scripts/cups-directories.m4)
|
||||
sinclude(config-scripts/cups-manpages.m4)
|
||||
|
||||
sinclude(config-scripts/cups-3264.m4)
|
||||
sinclude(config-scripts/cups-sharedlibs.m4)
|
||||
sinclude(config-scripts/cups-libtool.m4)
|
||||
sinclude(config-scripts/cups-compiler.m4)
|
||||
|
||||
sinclude(config-scripts/cups-image.m4)
|
||||
sinclude(config-scripts/cups-network.m4)
|
||||
sinclude(config-scripts/cups-poll.m4)
|
||||
sinclude(config-scripts/cups-slp.m4)
|
||||
sinclude(config-scripts/cups-gssapi.m4)
|
||||
sinclude(config-scripts/cups-ldap.m4)
|
||||
sinclude(config-scripts/cups-ssl.m4)
|
||||
sinclude(config-scripts/cups-pam.m4)
|
||||
sinclude(config-scripts/cups-threads.m4)
|
||||
sinclude(config-scripts/cups-largefile.m4)
|
||||
sinclude(config-scripts/cups-dnssd.m4)
|
||||
sinclude(config-scripts/cups-launchd.m4)
|
||||
sinclude(config-scripts/cups-defaults.m4)
|
||||
sinclude(config-scripts/cups-pap.m4)
|
||||
@@ -53,6 +58,10 @@ if test "x$LANGUAGES" != x; then
|
||||
LANGFILES="$LANGFILES doc/$lang/index.html"
|
||||
fi
|
||||
|
||||
if test -f templates/$lang/edit-config.tmpl.in; then
|
||||
LANGFILES="$LANGFILES templates/$lang/edit-config.tmpl"
|
||||
fi
|
||||
|
||||
if test -f templates/$lang/header.tmpl.in; then
|
||||
LANGFILES="$LANGFILES templates/$lang/header.tmpl"
|
||||
fi
|
||||
@@ -63,13 +72,12 @@ AC_SUBST(INSTALL_LANGUAGES)
|
||||
AC_SUBST(UNINSTALL_LANGUAGES)
|
||||
|
||||
AC_OUTPUT(Makedefs packaging/cups.list init/cups.sh init/cups-lpd cups-config
|
||||
conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf
|
||||
doc/index.html doc/help/ref-cupsd-conf.html doc/help/standard.html
|
||||
init/org.cups.cups-lpd.plist
|
||||
man/client.conf.man man/cups-deviced.man man/cups-driverd.man
|
||||
conf/cupsd.conf conf/pam.std doc/index.html
|
||||
doc/help/standard.html man/client.conf.man
|
||||
man/cups-deviced.man man/cups-driverd.man
|
||||
man/cups-lpd.man man/cupsaddsmb.man man/cupsd.man
|
||||
man/cupsd.conf.man man/lpoptions.man
|
||||
templates/header.tmpl
|
||||
templates/edit-config.tmpl templates/header.tmpl
|
||||
$LANGFILES)
|
||||
|
||||
chmod +x cups-config
|
||||
|
||||
+16
-7
@@ -4,18 +4,27 @@
|
||||
#
|
||||
# CUPS configuration utility.
|
||||
#
|
||||
# Copyright 2007 by Apple Inc.
|
||||
# Copyright 2001-2006 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# property of Easy Software Products and are protected by Federal
|
||||
# copyright law. Distribution and use rights are outlined in the file
|
||||
# "LICENSE.txt" which should have been included with this file. If this
|
||||
# file is missing or damaged please contact Easy Software Products
|
||||
# at:
|
||||
#
|
||||
# Attn: CUPS Licensing Information
|
||||
# Easy Software Products
|
||||
# 44141 Airport View Drive, Suite 204
|
||||
# Hollywood, Maryland 20636 USA
|
||||
#
|
||||
# Voice: (301) 373-9600
|
||||
# EMail: cups-info@cups.org
|
||||
# WWW: http://www.cups.org
|
||||
#
|
||||
|
||||
VERSION="@CUPS_VERSION@"
|
||||
APIVERSION="1.3"
|
||||
APIVERSION="1.2"
|
||||
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
@@ -34,7 +43,7 @@ INSTALLSTATIC=@INSTALLSTATIC@
|
||||
# flags for C++ compiler:
|
||||
CFLAGS=""
|
||||
LDFLAGS="@EXPORT_LDFLAGS@"
|
||||
LIBS="@LIBGSSAPI@ @EXPORT_SSLLIBS@ @EXPORT_LIBZ@ @LIBS@"
|
||||
LIBS="@EXPORT_SSLLIBS@ @EXPORT_LIBZ@ @LIBS@"
|
||||
IMGLIBS="@EXPORT_LIBTIFF@ @EXPORT_LIBJPEG@ @EXPORT_LIBPNG@"
|
||||
|
||||
# Check for local invocation...
|
||||
|
||||
+294
-324
@@ -1,324 +1,294 @@
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
adminutil.o: adminutil.c adminutil.h cups.h ipp.h http.h string.h \
|
||||
../config.h ppd.h array.h file.h language.h globals.h string.h \
|
||||
http-private.h md5.h ipp-private.h i18n.h transcode.h debug.h
|
||||
array.o: array.c array.h string.h ../config.h string.h debug.h
|
||||
attr.o: attr.c ppd.h array.h file.h debug.h string.h ../config.h string.h
|
||||
auth.o: auth.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h debug.h
|
||||
backchannel.o: backchannel.c cups.h ipp.h http.h string.h ../config.h \
|
||||
ppd.h array.h file.h language.h
|
||||
backend.o: backend.c backend.h string.h ../config.h string.h
|
||||
custom.o: custom.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h debug.h
|
||||
dest.o: dest.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h
|
||||
dir.o: dir.c dir.h string.h ../config.h string.h debug.h
|
||||
emit.o: emit.c ppd.h array.h file.h string.h ../config.h string.h debug.h
|
||||
encode.o: encode.c cups.h ipp.h http.h string.h ../config.h ppd.h array.h \
|
||||
file.h language.h ipp-private.h string.h debug.h
|
||||
file.o: file.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
getifaddrs.o: getifaddrs.c http-private.h ../config.h http.h string.h \
|
||||
md5.h ipp-private.h ipp.h
|
||||
getputfile.o: getputfile.c http-private.h ../config.h http.h string.h \
|
||||
md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
string.h debug.h
|
||||
globals.o: globals.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
http.o: http.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
http-addr.o: http-addr.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
http-addrlist.o: http-addrlist.c http-private.h ../config.h http.h \
|
||||
string.h md5.h ipp-private.h ipp.h globals.h string.h cups.h ppd.h \
|
||||
array.h file.h language.h i18n.h transcode.h debug.h
|
||||
http-support.o: http-support.c debug.h globals.h string.h ../config.h \
|
||||
string.h http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h \
|
||||
array.h file.h language.h i18n.h transcode.h
|
||||
ipp.o: ipp.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
ipp-support.o: ipp-support.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
langprintf.o: langprintf.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h
|
||||
language.o: language.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
localize.o: localize.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
mark.o: mark.c cups.h ipp.h http.h string.h ../config.h ppd.h array.h \
|
||||
file.h language.h string.h debug.h
|
||||
md5.o: md5.c md5.h string.h ../config.h string.h
|
||||
md5passwd.o: md5passwd.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h string.h
|
||||
notify.o: notify.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h
|
||||
options.o: options.c cups.h ipp.h http.h string.h ../config.h ppd.h \
|
||||
array.h file.h language.h string.h debug.h
|
||||
page.o: page.c ppd.h array.h file.h string.h ../config.h string.h
|
||||
ppd.o: ppd.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h debug.h
|
||||
request.o: request.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
sidechannel.o: sidechannel.c sidechannel.h string.h ../config.h string.h
|
||||
snprintf.o: snprintf.c string.h ../config.h string.h
|
||||
string.o: string.c array.h debug.h string.h ../config.h string.h
|
||||
tempfile.o: tempfile.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
transcode.o: transcode.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
usersys.o: usersys.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
util.o: util.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h debug.h
|
||||
testadmin.o: testadmin.c adminutil.h cups.h ipp.h http.h string.h \
|
||||
../config.h ppd.h array.h file.h language.h string.h
|
||||
testarray.o: testarray.c ../cups/string.h ../config.h string.h array.h \
|
||||
dir.h debug.h
|
||||
testcups.o: testcups.c cups.h ipp.h http.h string.h ../config.h ppd.h \
|
||||
array.h file.h language.h
|
||||
testfile.o: testfile.c string.h ../config.h string.h file.h debug.h
|
||||
testhttp.o: testhttp.c http.h string.h ../config.h string.h
|
||||
testi18n.o: testi18n.c i18n.h transcode.h language.h array.h string.h \
|
||||
../config.h string.h
|
||||
testipp.o: testipp.c ../cups/string.h ../config.h string.h ipp-private.h \
|
||||
ipp.h http.h
|
||||
testlang.o: testlang.c i18n.h transcode.h language.h array.h string.h \
|
||||
../config.h string.h
|
||||
testppd.o: testppd.c ../cups/string.h ../config.h string.h ppd.h array.h \
|
||||
file.h
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
adminutil.32.o: adminutil.c adminutil.c adminutil.h cups.h ipp.h http.h string.h \
|
||||
../config.h ppd.h array.h file.h language.h globals.h string.h \
|
||||
http-private.h md5.h ipp-private.h i18n.h transcode.h debug.h
|
||||
array.32.o: array.c array.c array.h string.h ../config.h string.h debug.h
|
||||
attr.32.o: attr.c attr.c ppd.h array.h file.h debug.h string.h ../config.h string.h
|
||||
auth.32.o: auth.c auth.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h debug.h
|
||||
backchannel.32.o: backchannel.c backchannel.c cups.h ipp.h http.h string.h ../config.h \
|
||||
ppd.h array.h file.h language.h
|
||||
backend.32.o: backend.c backend.c backend.h string.h ../config.h string.h
|
||||
custom.32.o: custom.c custom.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h debug.h
|
||||
dest.32.o: dest.c dest.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h
|
||||
dir.32.o: dir.c dir.c dir.h string.h ../config.h string.h debug.h
|
||||
emit.32.o: emit.c emit.c ppd.h array.h file.h string.h ../config.h string.h debug.h
|
||||
encode.32.o: encode.c encode.c cups.h ipp.h http.h string.h ../config.h ppd.h array.h \
|
||||
file.h language.h ipp-private.h string.h debug.h
|
||||
file.32.o: file.c file.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
getifaddrs.32.o: getifaddrs.c getifaddrs.c http-private.h ../config.h http.h string.h \
|
||||
md5.h ipp-private.h ipp.h
|
||||
getputfile.32.o: getputfile.c getputfile.c http-private.h ../config.h http.h string.h \
|
||||
md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
string.h debug.h
|
||||
globals.32.o: globals.c globals.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
http.32.o: http.c http.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
http-addr.32.o: http-addr.c http-addr.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
http-addrlist.32.o: http-addrlist.c http-addrlist.c http-private.h ../config.h http.h \
|
||||
string.h md5.h ipp-private.h ipp.h globals.h string.h cups.h ppd.h \
|
||||
array.h file.h language.h i18n.h transcode.h debug.h
|
||||
http-support.32.o: http-support.c http-support.c debug.h globals.h string.h ../config.h \
|
||||
string.h http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h \
|
||||
array.h file.h language.h i18n.h transcode.h
|
||||
ipp.32.o: ipp.c ipp.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
ipp-support.32.o: ipp-support.c ipp-support.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
langprintf.32.o: langprintf.c langprintf.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h
|
||||
language.32.o: language.c language.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
localize.32.o: localize.c localize.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
mark.32.o: mark.c mark.c cups.h ipp.h http.h string.h ../config.h ppd.h array.h \
|
||||
file.h language.h string.h debug.h
|
||||
md5.32.o: md5.c md5.c md5.h string.h ../config.h string.h
|
||||
md5passwd.32.o: md5passwd.c md5passwd.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h string.h
|
||||
notify.32.o: notify.c notify.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h
|
||||
options.32.o: options.c options.c cups.h ipp.h http.h string.h ../config.h ppd.h \
|
||||
array.h file.h language.h string.h debug.h
|
||||
page.32.o: page.c page.c ppd.h array.h file.h string.h ../config.h string.h
|
||||
ppd.32.o: ppd.c ppd.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h debug.h
|
||||
request.32.o: request.c request.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
sidechannel.32.o: sidechannel.c sidechannel.c sidechannel.h string.h ../config.h string.h
|
||||
snprintf.32.o: snprintf.c snprintf.c string.h ../config.h string.h
|
||||
string.32.o: string.c string.c array.h debug.h string.h ../config.h string.h
|
||||
tempfile.32.o: tempfile.c tempfile.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
transcode.32.o: transcode.c transcode.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
usersys.32.o: usersys.c usersys.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
util.32.o: util.c util.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h debug.h
|
||||
testadmin.32.o: testadmin.c testadmin.c adminutil.h cups.h ipp.h http.h string.h \
|
||||
../config.h ppd.h array.h file.h language.h string.h
|
||||
testarray.32.o: testarray.c testarray.c ../cups/string.h ../config.h string.h array.h \
|
||||
dir.h debug.h
|
||||
testcups.32.o: testcups.c testcups.c cups.h ipp.h http.h string.h ../config.h ppd.h \
|
||||
array.h file.h language.h
|
||||
testfile.32.o: testfile.c testfile.c string.h ../config.h string.h file.h debug.h
|
||||
testhttp.32.o: testhttp.c testhttp.c http.h string.h ../config.h string.h
|
||||
testi18n.32.o: testi18n.c testi18n.c i18n.h transcode.h language.h array.h string.h \
|
||||
../config.h string.h
|
||||
testipp.32.o: testipp.c testipp.c ../cups/string.h ../config.h string.h ipp-private.h \
|
||||
ipp.h http.h
|
||||
testlang.32.o: testlang.c testlang.c i18n.h transcode.h language.h array.h string.h \
|
||||
../config.h string.h
|
||||
testppd.32.o: testppd.c testppd.c ../cups/string.h ../config.h string.h ppd.h array.h \
|
||||
file.h
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
adminutil.64.o: adminutil.c adminutil.c adminutil.h cups.h ipp.h http.h string.h \
|
||||
../config.h ppd.h array.h file.h language.h globals.h string.h \
|
||||
http-private.h md5.h ipp-private.h i18n.h transcode.h debug.h
|
||||
array.64.o: array.c array.c array.h string.h ../config.h string.h debug.h
|
||||
attr.64.o: attr.c attr.c ppd.h array.h file.h debug.h string.h ../config.h string.h
|
||||
auth.64.o: auth.c auth.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h debug.h
|
||||
backchannel.64.o: backchannel.c backchannel.c cups.h ipp.h http.h string.h ../config.h \
|
||||
ppd.h array.h file.h language.h
|
||||
backend.64.o: backend.c backend.c backend.h string.h ../config.h string.h
|
||||
custom.64.o: custom.c custom.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h debug.h
|
||||
dest.64.o: dest.c dest.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h
|
||||
dir.64.o: dir.c dir.c dir.h string.h ../config.h string.h debug.h
|
||||
emit.64.o: emit.c emit.c ppd.h array.h file.h string.h ../config.h string.h debug.h
|
||||
encode.64.o: encode.c encode.c cups.h ipp.h http.h string.h ../config.h ppd.h array.h \
|
||||
file.h language.h ipp-private.h string.h debug.h
|
||||
file.64.o: file.c file.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
getifaddrs.64.o: getifaddrs.c getifaddrs.c http-private.h ../config.h http.h string.h \
|
||||
md5.h ipp-private.h ipp.h
|
||||
getputfile.64.o: getputfile.c getputfile.c http-private.h ../config.h http.h string.h \
|
||||
md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
string.h debug.h
|
||||
globals.64.o: globals.c globals.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
http.64.o: http.c http.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
http-addr.64.o: http-addr.c http-addr.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
http-addrlist.64.o: http-addrlist.c http-addrlist.c http-private.h ../config.h http.h \
|
||||
string.h md5.h ipp-private.h ipp.h globals.h string.h cups.h ppd.h \
|
||||
array.h file.h language.h i18n.h transcode.h debug.h
|
||||
http-support.64.o: http-support.c http-support.c debug.h globals.h string.h ../config.h \
|
||||
string.h http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h \
|
||||
array.h file.h language.h i18n.h transcode.h
|
||||
ipp.64.o: ipp.c ipp.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
ipp-support.64.o: ipp-support.c ipp-support.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
langprintf.64.o: langprintf.c langprintf.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h
|
||||
language.64.o: language.c language.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
localize.64.o: localize.c localize.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
mark.64.o: mark.c mark.c cups.h ipp.h http.h string.h ../config.h ppd.h array.h \
|
||||
file.h language.h string.h debug.h
|
||||
md5.64.o: md5.c md5.c md5.h string.h ../config.h string.h
|
||||
md5passwd.64.o: md5passwd.c md5passwd.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h string.h
|
||||
notify.64.o: notify.c notify.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h
|
||||
options.64.o: options.c options.c cups.h ipp.h http.h string.h ../config.h ppd.h \
|
||||
array.h file.h language.h string.h debug.h
|
||||
page.64.o: page.c page.c ppd.h array.h file.h string.h ../config.h string.h
|
||||
ppd.64.o: ppd.c ppd.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h debug.h
|
||||
request.64.o: request.c request.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
sidechannel.64.o: sidechannel.c sidechannel.c sidechannel.h string.h ../config.h string.h
|
||||
snprintf.64.o: snprintf.c snprintf.c string.h ../config.h string.h
|
||||
string.64.o: string.c string.c array.h debug.h string.h ../config.h string.h
|
||||
tempfile.64.o: tempfile.c tempfile.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
transcode.64.o: transcode.c transcode.c globals.h string.h ../config.h string.h \
|
||||
http-private.h http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h \
|
||||
file.h language.h i18n.h transcode.h debug.h
|
||||
usersys.64.o: usersys.c usersys.c http-private.h ../config.h http.h string.h md5.h \
|
||||
ipp-private.h ipp.h globals.h string.h cups.h ppd.h array.h file.h \
|
||||
language.h i18n.h transcode.h debug.h
|
||||
util.64.o: util.c util.c globals.h string.h ../config.h string.h http-private.h \
|
||||
http.h md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h \
|
||||
i18n.h transcode.h debug.h
|
||||
testadmin.64.o: testadmin.c testadmin.c adminutil.h cups.h ipp.h http.h string.h \
|
||||
../config.h ppd.h array.h file.h language.h string.h
|
||||
testarray.64.o: testarray.c testarray.c ../cups/string.h ../config.h string.h array.h \
|
||||
dir.h debug.h
|
||||
testcups.64.o: testcups.c testcups.c cups.h ipp.h http.h string.h ../config.h ppd.h \
|
||||
array.h file.h language.h
|
||||
testfile.64.o: testfile.c testfile.c string.h ../config.h string.h file.h debug.h
|
||||
testhttp.64.o: testhttp.c testhttp.c http.h string.h ../config.h string.h
|
||||
testi18n.64.o: testi18n.c testi18n.c i18n.h transcode.h language.h array.h string.h \
|
||||
../config.h string.h
|
||||
testipp.64.o: testipp.c testipp.c ../cups/string.h ../config.h string.h ipp-private.h \
|
||||
ipp.h http.h
|
||||
testlang.64.o: testlang.c testlang.c i18n.h transcode.h language.h array.h string.h \
|
||||
../config.h string.h
|
||||
testppd.64.o: testppd.c testppd.c ../cups/string.h ../config.h string.h ppd.h array.h \
|
||||
file.h
|
||||
# DO NOT DELETE
|
||||
|
||||
adminutil.o: adminutil.h cups.h ipp.h http.h md5.h ppd.h array.h file.h
|
||||
adminutil.o: language.h globals.h string.h ../config.h http-private.h
|
||||
adminutil.o: ipp-private.h i18n.h transcode.h debug.h
|
||||
array.o: array.h string.h ../config.h debug.h
|
||||
attr.o: ppd.h array.h file.h debug.h string.h ../config.h
|
||||
auth.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
auth.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
auth.o: transcode.h debug.h
|
||||
backchannel.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
|
||||
backend.o: backend.h string.h ../config.h
|
||||
custom.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
custom.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
custom.o: transcode.h debug.h
|
||||
dest.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
dest.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
dest.o: transcode.h
|
||||
dir.o: dir.h string.h ../config.h debug.h
|
||||
emit.o: ppd.h array.h file.h string.h ../config.h debug.h
|
||||
encode.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
|
||||
encode.o: ipp-private.h string.h ../config.h debug.h
|
||||
file.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
|
||||
file.o: string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
|
||||
file.o: debug.h
|
||||
getifaddrs.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
getputfile.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
|
||||
getputfile.o: string.h ../config.h debug.h
|
||||
globals.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
globals.o: globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
globals.o: transcode.h debug.h
|
||||
http.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
|
||||
http.o: string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
|
||||
http.o: debug.h
|
||||
http-addr.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
http-addr.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
http-addr.o: i18n.h transcode.h debug.h
|
||||
http-addrlist.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
http-addrlist.o: globals.h string.h cups.h ppd.h array.h file.h language.h
|
||||
http-addrlist.o: i18n.h transcode.h debug.h
|
||||
http-support.o: debug.h globals.h string.h ../config.h http-private.h http.h
|
||||
http-support.o: md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h
|
||||
http-support.o: language.h i18n.h transcode.h
|
||||
ipp.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
|
||||
ipp.o: string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
|
||||
ipp.o: debug.h
|
||||
ipp-support.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
ipp-support.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
ipp-support.o: i18n.h transcode.h debug.h
|
||||
langprintf.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
langprintf.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
langprintf.o: i18n.h transcode.h
|
||||
language.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
language.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
language.o: transcode.h debug.h
|
||||
localize.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
localize.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
localize.o: transcode.h debug.h
|
||||
mark.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h string.h
|
||||
mark.o: ../config.h debug.h
|
||||
md5.o: md5.h string.h ../config.h
|
||||
md5passwd.o: http.h md5.h string.h ../config.h
|
||||
notify.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
notify.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
notify.o: transcode.h
|
||||
options.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h string.h
|
||||
options.o: ../config.h debug.h
|
||||
page.o: ppd.h array.h file.h string.h ../config.h
|
||||
ppd.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
ppd.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
ppd.o: transcode.h debug.h
|
||||
request.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
request.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
request.o: transcode.h debug.h
|
||||
snprintf.o: string.h ../config.h
|
||||
string.o: array.h debug.h string.h ../config.h
|
||||
tempfile.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
tempfile.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
tempfile.o: transcode.h debug.h
|
||||
transcode.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
transcode.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
transcode.o: i18n.h transcode.h debug.h
|
||||
usersys.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
usersys.o: globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
usersys.o: transcode.h debug.h
|
||||
util.o: globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
util.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
util.o: transcode.h debug.h
|
||||
testadmin.o: adminutil.h cups.h ipp.h http.h md5.h ppd.h array.h file.h
|
||||
testadmin.o: language.h string.h ../config.h
|
||||
testarray.o: ../cups/string.h ../config.h string.h array.h dir.h debug.h
|
||||
testfile.o: string.h ../config.h file.h debug.h
|
||||
testhttp.o: http.h md5.h string.h ../config.h
|
||||
testi18n.o: i18n.h transcode.h language.h array.h string.h ../config.h
|
||||
testipp.o: ../cups/string.h ../config.h string.h ipp-private.h ipp.h http.h
|
||||
testipp.o: md5.h
|
||||
testlang.o: i18n.h transcode.h language.h array.h
|
||||
testppd.o: ../cups/string.h ../config.h string.h ppd.h array.h file.h
|
||||
# DO NOT DELETE
|
||||
|
||||
adminutil.32.o: adminutil.c adminutil.h cups.h ipp.h http.h md5.h ppd.h array.h file.h
|
||||
adminutil.32.o: adminutil.c language.h globals.h string.h ../config.h http-private.h
|
||||
adminutil.32.o: adminutil.c ipp-private.h i18n.h transcode.h debug.h
|
||||
array.32.o: array.c array.h string.h ../config.h debug.h
|
||||
attr.32.o: attr.c ppd.h array.h file.h debug.h string.h ../config.h
|
||||
auth.32.o: auth.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
auth.32.o: auth.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
auth.32.o: auth.c transcode.h debug.h
|
||||
backchannel.32.o: backchannel.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
|
||||
backend.32.o: backend.c backend.h string.h ../config.h
|
||||
custom.32.o: custom.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
custom.32.o: custom.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
custom.32.o: custom.c transcode.h debug.h
|
||||
dest.32.o: dest.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
dest.32.o: dest.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
dest.32.o: dest.c transcode.h
|
||||
dir.32.o: dir.c dir.h string.h ../config.h debug.h
|
||||
emit.32.o: emit.c ppd.h array.h file.h string.h ../config.h debug.h
|
||||
encode.32.o: encode.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
|
||||
encode.32.o: encode.c ipp-private.h string.h ../config.h debug.h
|
||||
file.32.o: file.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
|
||||
file.32.o: file.c string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
|
||||
file.32.o: file.c debug.h
|
||||
getifaddrs.32.o: getifaddrs.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
getputfile.32.o: getputfile.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
|
||||
getputfile.32.o: getputfile.c string.h ../config.h debug.h
|
||||
globals.32.o: globals.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
globals.32.o: globals.c globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
globals.32.o: globals.c transcode.h debug.h
|
||||
http.32.o: http.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
|
||||
http.32.o: http.c string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
|
||||
http.32.o: http.c debug.h
|
||||
http-addr.32.o: http-addr.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
http-addr.32.o: http-addr.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
http-addr.32.o: http-addr.c i18n.h transcode.h debug.h
|
||||
http-addrlist.32.o: http-addrlist.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
http-addrlist.32.o: http-addrlist.c globals.h string.h cups.h ppd.h array.h file.h language.h
|
||||
http-addrlist.32.o: http-addrlist.c i18n.h transcode.h debug.h
|
||||
http-support.32.o: http-support.c debug.h globals.h string.h ../config.h http-private.h http.h
|
||||
http-support.32.o: http-support.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h
|
||||
http-support.32.o: http-support.c language.h i18n.h transcode.h
|
||||
ipp.32.o: ipp.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
|
||||
ipp.32.o: ipp.c string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
|
||||
ipp.32.o: ipp.c debug.h
|
||||
ipp-support.32.o: ipp-support.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
ipp-support.32.o: ipp-support.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
ipp-support.32.o: ipp-support.c i18n.h transcode.h debug.h
|
||||
langprintf.32.o: langprintf.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
langprintf.32.o: langprintf.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
langprintf.32.o: langprintf.c i18n.h transcode.h
|
||||
language.32.o: language.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
language.32.o: language.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
language.32.o: language.c transcode.h debug.h
|
||||
localize.32.o: localize.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
localize.32.o: localize.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
localize.32.o: localize.c transcode.h debug.h
|
||||
mark.32.o: mark.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h string.h
|
||||
mark.32.o: mark.c ../config.h debug.h
|
||||
md5.32.o: md5.c md5.h string.h ../config.h
|
||||
md5passwd.32.o: md5passwd.c http.h md5.h string.h ../config.h
|
||||
notify.32.o: notify.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
notify.32.o: notify.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
notify.32.o: notify.c transcode.h
|
||||
options.32.o: options.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h string.h
|
||||
options.32.o: options.c ../config.h debug.h
|
||||
page.32.o: page.c ppd.h array.h file.h string.h ../config.h
|
||||
ppd.32.o: ppd.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
ppd.32.o: ppd.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
ppd.32.o: ppd.c transcode.h debug.h
|
||||
request.32.o: request.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
request.32.o: request.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
request.32.o: request.c transcode.h debug.h
|
||||
snprintf.32.o: snprintf.c string.h ../config.h
|
||||
string.32.o: string.c array.h debug.h string.h ../config.h
|
||||
tempfile.32.o: tempfile.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
tempfile.32.o: tempfile.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
tempfile.32.o: tempfile.c transcode.h debug.h
|
||||
transcode.32.o: transcode.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
transcode.32.o: transcode.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
transcode.32.o: transcode.c i18n.h transcode.h debug.h
|
||||
usersys.32.o: usersys.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
usersys.32.o: usersys.c globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
usersys.32.o: usersys.c transcode.h debug.h
|
||||
util.32.o: util.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
util.32.o: util.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
util.32.o: util.c transcode.h debug.h
|
||||
testadmin.32.o: testadmin.c adminutil.h cups.h ipp.h http.h md5.h ppd.h array.h file.h
|
||||
testadmin.32.o: testadmin.c language.h string.h ../config.h
|
||||
testarray.32.o: testarray.c ../cups/string.h ../config.h string.h array.h dir.h debug.h
|
||||
testfile.32.o: testfile.c string.h ../config.h file.h debug.h
|
||||
testhttp.32.o: testhttp.c http.h md5.h string.h ../config.h
|
||||
testi18n.32.o: testi18n.c i18n.h transcode.h language.h array.h string.h ../config.h
|
||||
testipp.32.o: testipp.c ../cups/string.h ../config.h string.h ipp-private.h ipp.h http.h
|
||||
testipp.32.o: testipp.c md5.h
|
||||
testlang.32.o: testlang.c i18n.h transcode.h language.h array.h
|
||||
testppd.32.o: testppd.c ../cups/string.h ../config.h string.h ppd.h array.h file.h
|
||||
# DO NOT DELETE
|
||||
|
||||
adminutil.64.o: adminutil.c adminutil.h cups.h ipp.h http.h md5.h ppd.h array.h file.h
|
||||
adminutil.64.o: adminutil.c language.h globals.h string.h ../config.h http-private.h
|
||||
adminutil.64.o: adminutil.c ipp-private.h i18n.h transcode.h debug.h
|
||||
array.64.o: array.c array.h string.h ../config.h debug.h
|
||||
attr.64.o: attr.c ppd.h array.h file.h debug.h string.h ../config.h
|
||||
auth.64.o: auth.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
auth.64.o: auth.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
auth.64.o: auth.c transcode.h debug.h
|
||||
backchannel.64.o: backchannel.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
|
||||
backend.64.o: backend.c backend.h string.h ../config.h
|
||||
custom.64.o: custom.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
custom.64.o: custom.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
custom.64.o: custom.c transcode.h debug.h
|
||||
dest.64.o: dest.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
dest.64.o: dest.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
dest.64.o: dest.c transcode.h
|
||||
dir.64.o: dir.c dir.h string.h ../config.h debug.h
|
||||
emit.64.o: emit.c ppd.h array.h file.h string.h ../config.h debug.h
|
||||
encode.64.o: encode.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
|
||||
encode.64.o: encode.c ipp-private.h string.h ../config.h debug.h
|
||||
file.64.o: file.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
|
||||
file.64.o: file.c string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
|
||||
file.64.o: file.c debug.h
|
||||
getifaddrs.64.o: getifaddrs.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
getputfile.64.o: getputfile.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
|
||||
getputfile.64.o: getputfile.c string.h ../config.h debug.h
|
||||
globals.64.o: globals.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
globals.64.o: globals.c globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
globals.64.o: globals.c transcode.h debug.h
|
||||
http.64.o: http.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
|
||||
http.64.o: http.c string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
|
||||
http.64.o: http.c debug.h
|
||||
http-addr.64.o: http-addr.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
http-addr.64.o: http-addr.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
http-addr.64.o: http-addr.c i18n.h transcode.h debug.h
|
||||
http-addrlist.64.o: http-addrlist.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
http-addrlist.64.o: http-addrlist.c globals.h string.h cups.h ppd.h array.h file.h language.h
|
||||
http-addrlist.64.o: http-addrlist.c i18n.h transcode.h debug.h
|
||||
http-support.64.o: http-support.c debug.h globals.h string.h ../config.h http-private.h http.h
|
||||
http-support.64.o: http-support.c md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h
|
||||
http-support.64.o: http-support.c language.h i18n.h transcode.h
|
||||
ipp.64.o: ipp.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
|
||||
ipp.64.o: ipp.c string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
|
||||
ipp.64.o: ipp.c debug.h
|
||||
ipp-support.64.o: ipp-support.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
ipp-support.64.o: ipp-support.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
ipp-support.64.o: ipp-support.c i18n.h transcode.h debug.h
|
||||
langprintf.64.o: langprintf.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
langprintf.64.o: langprintf.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
langprintf.64.o: langprintf.c i18n.h transcode.h
|
||||
language.64.o: language.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
language.64.o: language.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
language.64.o: language.c transcode.h debug.h
|
||||
localize.64.o: localize.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
localize.64.o: localize.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
localize.64.o: localize.c transcode.h debug.h
|
||||
mark.64.o: mark.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h string.h
|
||||
mark.64.o: mark.c ../config.h debug.h
|
||||
md5.64.o: md5.c md5.h string.h ../config.h
|
||||
md5passwd.64.o: md5passwd.c http.h md5.h string.h ../config.h
|
||||
notify.64.o: notify.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
notify.64.o: notify.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
notify.64.o: notify.c transcode.h
|
||||
options.64.o: options.c cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h string.h
|
||||
options.64.o: options.c ../config.h debug.h
|
||||
page.64.o: page.c ppd.h array.h file.h string.h ../config.h
|
||||
ppd.64.o: ppd.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
ppd.64.o: ppd.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
ppd.64.o: ppd.c transcode.h debug.h
|
||||
request.64.o: request.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
request.64.o: request.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
request.64.o: request.c transcode.h debug.h
|
||||
snprintf.64.o: snprintf.c string.h ../config.h
|
||||
string.64.o: string.c array.h debug.h string.h ../config.h
|
||||
tempfile.64.o: tempfile.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
tempfile.64.o: tempfile.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
tempfile.64.o: tempfile.c transcode.h debug.h
|
||||
transcode.64.o: transcode.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
transcode.64.o: transcode.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
|
||||
transcode.64.o: transcode.c i18n.h transcode.h debug.h
|
||||
usersys.64.o: usersys.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
|
||||
usersys.64.o: usersys.c globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
usersys.64.o: usersys.c transcode.h debug.h
|
||||
util.64.o: util.c globals.h string.h ../config.h http-private.h http.h md5.h
|
||||
util.64.o: util.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
|
||||
util.64.o: util.c transcode.h debug.h
|
||||
testadmin.64.o: testadmin.c adminutil.h cups.h ipp.h http.h md5.h ppd.h array.h file.h
|
||||
testadmin.64.o: testadmin.c language.h string.h ../config.h
|
||||
testarray.64.o: testarray.c ../cups/string.h ../config.h string.h array.h dir.h debug.h
|
||||
testfile.64.o: testfile.c string.h ../config.h file.h debug.h
|
||||
testhttp.64.o: testhttp.c http.h md5.h string.h ../config.h
|
||||
testi18n.64.o: testi18n.c i18n.h transcode.h language.h array.h string.h ../config.h
|
||||
testipp.64.o: testipp.c ../cups/string.h ../config.h string.h ipp-private.h ipp.h http.h
|
||||
testipp.64.o: testipp.c md5.h
|
||||
testlang.64.o: testlang.c i18n.h transcode.h language.h array.h
|
||||
testppd.64.o: testppd.c ../cups/string.h ../config.h string.h ppd.h array.h file.h
|
||||
|
||||
+33
-45
@@ -3,14 +3,23 @@
|
||||
#
|
||||
# API library Makefile for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
# Copyright 2007 by Apple Inc.
|
||||
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# property of Easy Software Products and are protected by Federal
|
||||
# copyright law. Distribution and use rights are outlined in the file
|
||||
# "LICENSE.txt" which should have been included with this file. If this
|
||||
# file is missing or damaged please contact Easy Software Products
|
||||
# at:
|
||||
#
|
||||
# Attn: CUPS Licensing Information
|
||||
# Easy Software Products
|
||||
# 44141 Airport View Drive, Suite 204
|
||||
# Hollywood, Maryland 20636 USA
|
||||
#
|
||||
# Voice: (301) 373-9600
|
||||
# EMail: cups-info@cups.org
|
||||
# WWW: http://www.cups.org
|
||||
#
|
||||
# This file is subject to the Apple OS-Developed Software exception.
|
||||
#
|
||||
@@ -54,7 +63,6 @@ LIBOBJS = \
|
||||
page.o \
|
||||
ppd.o \
|
||||
request.o \
|
||||
sidechannel.o \
|
||||
snprintf.o \
|
||||
string.o \
|
||||
tempfile.o \
|
||||
@@ -69,7 +77,6 @@ OBJS = \
|
||||
$(LIB64OBJS) \
|
||||
testadmin.o \
|
||||
testarray.o \
|
||||
testcups.o \
|
||||
testfile.o \
|
||||
testhttp.o \
|
||||
testi18n.o \
|
||||
@@ -94,8 +101,8 @@ HEADERS = \
|
||||
i18n.h \
|
||||
ipp.h \
|
||||
language.h \
|
||||
md5.h \
|
||||
ppd.h \
|
||||
sidechannel.h \
|
||||
transcode.h
|
||||
|
||||
|
||||
@@ -110,7 +117,6 @@ TARGETS = \
|
||||
libcups.a \
|
||||
testadmin \
|
||||
testarray \
|
||||
testcups \
|
||||
testfile \
|
||||
testhttp \
|
||||
testi18n \
|
||||
@@ -166,12 +172,6 @@ install: all installhdrs $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
|
||||
$(RM) $(LIBDIR)/libcups.dylib; \
|
||||
$(LN) $(LIBCUPS) $(LIBDIR)/libcups.dylib; \
|
||||
fi
|
||||
if test "x$(SYMROOT)" != "x"; then \
|
||||
$(INSTALL_DIR) $(SYMROOT); \
|
||||
for file in $(TARGETS); do \
|
||||
cp $$file $(SYMROOT); \
|
||||
done \
|
||||
fi
|
||||
|
||||
installstatic:
|
||||
$(INSTALL_DIR) -m 755 $(LIBDIR)
|
||||
@@ -231,7 +231,7 @@ uninstall64bit:
|
||||
|
||||
libcups.so.2 libcups.sl.2: $(LIBOBJS)
|
||||
echo Linking $@...
|
||||
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(RM) `basename $@ .2`
|
||||
$(LN) $@ `basename $@ .2`
|
||||
|
||||
@@ -243,7 +243,7 @@ libcups.so.2 libcups.sl.2: $(LIBOBJS)
|
||||
32bit/libcups.so.2: $(LIB32OBJS)
|
||||
echo Linking 32-bit $@...
|
||||
-mkdir 32bit
|
||||
$(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(RM) 32bit/libcups.so
|
||||
$(LN) libcups.so.2 32bit/libcups.so
|
||||
|
||||
@@ -255,7 +255,7 @@ libcups.so.2 libcups.sl.2: $(LIBOBJS)
|
||||
64bit/libcups.so.2: $(LIB64OBJS)
|
||||
echo Linking 64-bit $@...
|
||||
-mkdir 64bit
|
||||
$(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(RM) 64bit/libcups.so
|
||||
$(LN) libcups.so.2 64bit/libcups.so
|
||||
|
||||
@@ -264,15 +264,13 @@ libcups.so.2 libcups.sl.2: $(LIBOBJS)
|
||||
# libcups.2.dylib
|
||||
#
|
||||
|
||||
libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
|
||||
libcups.2.dylib: $(LIBOBJS)
|
||||
echo Linking $@...
|
||||
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
|
||||
-install_name $(libdir)/$@ \
|
||||
-current_version 2.8.0 \
|
||||
-current_version 2.7.0 \
|
||||
-compatibility_version 2.0.0 \
|
||||
-exported_symbols_list libcups.exp \
|
||||
-sectorder __TEXT __text $(LIBCUPSORDER) \
|
||||
$(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(RM) libcups.dylib
|
||||
$(LN) $@ libcups.dylib
|
||||
|
||||
@@ -283,7 +281,7 @@ libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
|
||||
|
||||
libcups_s.a: $(LIBOBJS) libcups_s.exp
|
||||
echo Creating $@...
|
||||
$(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) -lm
|
||||
$(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) -lm
|
||||
$(RM) $@
|
||||
$(AR) $(ARFLAGS) $@ libcups_s.o
|
||||
|
||||
@@ -295,7 +293,7 @@ libcups_s.a: $(LIBOBJS) libcups_s.exp
|
||||
libcups.la: $(LIBOBJS)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
|
||||
-version-info 2:8 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
-version-info 2:7 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
@@ -340,7 +338,7 @@ php_cups_wrap.c: cups.h
|
||||
testadmin: testadmin.o libcups.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testadmin.o libcups.a \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
@@ -350,17 +348,7 @@ testadmin: testadmin.o libcups.a
|
||||
testarray: testarray.o libcups.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testarray.o libcups.a \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
# testcups (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testcups: testcups.o libcups.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testcups.o libcups.a \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
@@ -370,7 +358,7 @@ testcups: testcups.o libcups.a
|
||||
testfile: testfile.o libcups.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testfile.o libcups.a \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
@@ -380,7 +368,7 @@ testfile: testfile.o libcups.a
|
||||
testhttp: testhttp.o libcups.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testhttp.o libcups.a \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
@@ -390,7 +378,7 @@ testhttp: testhttp.o libcups.a
|
||||
testipp: testipp.o libcups.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testipp.o libcups.a \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
@@ -400,7 +388,7 @@ testipp: testipp.o libcups.a
|
||||
testi18n: testi18n.o libcups.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testi18n.o libcups.a \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
@@ -410,7 +398,7 @@ testi18n: testi18n.o libcups.a
|
||||
testlang: testlang.o libcups.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testlang.o libcups.a \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
@@ -420,7 +408,7 @@ testlang: testlang.o libcups.a
|
||||
testppd: testppd.o libcups.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testppd.o libcups.a \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
@@ -434,7 +422,7 @@ apihelp:
|
||||
array.h array.c >../doc/help/api-array.html
|
||||
mxmldoc --section "Programming" --title "CUPS API" \
|
||||
--intro api-cups.shtml \
|
||||
cups.h dest.c getputfile.c language.c notify.c \
|
||||
cups.h dest.c getputfile.c language.c \
|
||||
options.c tempfile.c usersys.c \
|
||||
util.c >../doc/help/api-cups.html
|
||||
mxmldoc --section "Programming" --title "File and Directory APIs" \
|
||||
@@ -451,7 +439,7 @@ apihelp:
|
||||
request.c >../doc/help/api-httpipp.html
|
||||
mxmldoc --section "Programming" --title "Filter and Backend APIs" \
|
||||
--intro api-filter.shtml \
|
||||
backchannel.c sidechannel.c sidechannel.h >../doc/help/api-filter.html
|
||||
backchannel.c >../doc/help/api-filter.html
|
||||
|
||||
|
||||
#
|
||||
|
||||
+119
-500
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+21
-13
@@ -7,14 +7,23 @@
|
||||
* MANY OF THE FUNCTIONS IN THIS HEADER ARE PRIVATE AND SUBJECT TO
|
||||
* CHANGE AT ANY TIME. USE AT YOUR OWN RISK.
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2001-2007 by Easy Software Products.
|
||||
* Copyright 2001-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE.txt" which should have been included with this file. If this
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636 USA
|
||||
*
|
||||
* Voice: (301) 373-9600
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
@@ -44,7 +53,6 @@ extern "C" {
|
||||
|
||||
# define CUPS_SERVER_DEBUG_LOGGING "_debug_logging"
|
||||
# define CUPS_SERVER_REMOTE_ADMIN "_remote_admin"
|
||||
# define CUPS_SERVER_REMOTE_ANY "_remote_any"
|
||||
# define CUPS_SERVER_REMOTE_PRINTERS "_remote_printers"
|
||||
# define CUPS_SERVER_SHARE_PRINTERS "_share_printers"
|
||||
# define CUPS_SERVER_USER_CANCEL_ANY "_user_cancel_any"
|
||||
@@ -62,12 +70,12 @@ extern int cupsAdminExportSamba(const char *dest, const char *ppd,
|
||||
extern char *cupsAdminCreateWindowsPPD(http_t *http, const char *dest,
|
||||
char *buffer, int bufsize);
|
||||
|
||||
extern int cupsAdminGetServerSettings(http_t *http,
|
||||
int *num_settings,
|
||||
cups_option_t **settings);
|
||||
extern int cupsAdminSetServerSettings(http_t *http,
|
||||
int num_settings,
|
||||
cups_option_t *settings);
|
||||
extern int _cupsAdminGetServerSettings(http_t *http,
|
||||
int *num_settings,
|
||||
cups_option_t **settings);
|
||||
extern int _cupsAdminSetServerSettings(http_t *http,
|
||||
int num_settings,
|
||||
cups_option_t *settings);
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
|
||||
+16
-7
@@ -1,16 +1,25 @@
|
||||
<!--
|
||||
"$Id: api-array.shtml 6649 2007-07-11 21:46:42Z mike $"
|
||||
"$Id: api-array.shtml 5138 2006-02-21 10:49:06Z mike $"
|
||||
|
||||
Array API introduction for the Common UNIX Printing System (CUPS).
|
||||
|
||||
Copyright 2007 by Apple Inc.
|
||||
Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
Copyright 1997-2006 by Easy Software Products.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
property of Apple Inc. and are protected by Federal copyright
|
||||
law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
which should have been included with this file. If this file is
|
||||
file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
property of Easy Software Products and are protected by Federal
|
||||
copyright law. Distribution and use rights are outlined in the file
|
||||
"LICENSE.txt" which should have been included with this file. If this
|
||||
file is missing or damaged please contact Easy Software Products
|
||||
at:
|
||||
|
||||
Attn: CUPS Licensing Information
|
||||
Easy Software Products
|
||||
44141 Airport View Drive, Suite 204
|
||||
Hollywood, Maryland 20636 USA
|
||||
|
||||
Voice: (301) 373-9600
|
||||
EMail: cups-info@cups.org
|
||||
WWW: http://www.cups.org
|
||||
-->
|
||||
|
||||
<h2 class='title'>Introduction</h2>
|
||||
|
||||
+16
-7
@@ -1,16 +1,25 @@
|
||||
<!--
|
||||
"$Id: api-cups.shtml 6649 2007-07-11 21:46:42Z mike $"
|
||||
"$Id: api-cups.shtml 5138 2006-02-21 10:49:06Z mike $"
|
||||
|
||||
CUPS API introduction for the Common UNIX Printing System (CUPS).
|
||||
|
||||
Copyright 2007 by Apple Inc.
|
||||
Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
Copyright 1997-2006 by Easy Software Products.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
property of Apple Inc. and are protected by Federal copyright
|
||||
law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
which should have been included with this file. If this file is
|
||||
file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
property of Easy Software Products and are protected by Federal
|
||||
copyright law. Distribution and use rights are outlined in the file
|
||||
"LICENSE.txt" which should have been included with this file. If this
|
||||
file is missing or damaged please contact Easy Software Products
|
||||
at:
|
||||
|
||||
Attn: CUPS Licensing Information
|
||||
Easy Software Products
|
||||
44141 Airport View Drive, Suite 204
|
||||
Hollywood, Maryland 20636 USA
|
||||
|
||||
Voice: (301) 373-9600
|
||||
EMail: cups-info@cups.org
|
||||
WWW: http://www.cups.org
|
||||
-->
|
||||
|
||||
<h2 class='title'>Introduction</h2>
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
<!--
|
||||
"$Id: api-filedir.shtml 6649 2007-07-11 21:46:42Z mike $"
|
||||
"$Id: api-filedir.shtml 5138 2006-02-21 10:49:06Z mike $"
|
||||
|
||||
File and directory API introduction for the Common UNIX Printing System (CUPS).
|
||||
|
||||
Copyright 2007 by Apple Inc.
|
||||
Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
Copyright 1997-2005 by Easy Software Products.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
property of Apple Inc. and are protected by Federal copyright
|
||||
law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
which should have been included with this file. If this file is
|
||||
file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
property of Easy Software Products and are protected by Federal
|
||||
copyright law. Distribution and use rights are outlined in the file
|
||||
"LICENSE.txt" which should have been included with this file. If this
|
||||
file is missing or damaged please contact Easy Software Products
|
||||
at:
|
||||
|
||||
Attn: CUPS Licensing Information
|
||||
Easy Software Products
|
||||
44141 Airport View Drive, Suite 204
|
||||
Hollywood, Maryland 20636 USA
|
||||
|
||||
Voice: (301) 373-9600
|
||||
EMail: cups-info@cups.org
|
||||
WWW: http://www.cups.org
|
||||
-->
|
||||
|
||||
<h2 class='title'>Introduction</h2>
|
||||
|
||||
+17
-179
@@ -1,16 +1,25 @@
|
||||
<!--
|
||||
"$Id: api-filter.shtml 6649 2007-07-11 21:46:42Z mike $"
|
||||
"$Id: api-filter.shtml 5138 2006-02-21 10:49:06Z mike $"
|
||||
|
||||
Filter and backend API introduction for the Common UNIX Printing System (CUPS).
|
||||
|
||||
Copyright 2007 by Apple Inc.
|
||||
Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
Copyright 1997-2006 by Easy Software Products.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
property of Apple Inc. and are protected by Federal copyright
|
||||
law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
which should have been included with this file. If this file is
|
||||
file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
property of Easy Software Products and are protected by Federal
|
||||
copyright law. Distribution and use rights are outlined in the file
|
||||
"LICENSE.txt" which should have been included with this file. If this
|
||||
file is missing or damaged please contact Easy Software Products
|
||||
at:
|
||||
|
||||
Attn: CUPS Licensing Information
|
||||
Easy Software Products
|
||||
44141 Airport View Drive, Suite 204
|
||||
Hollywood, Maryland 20636 USA
|
||||
|
||||
Voice: (301) 373-9600
|
||||
EMail: cups-info@cups.org
|
||||
WWW: http://www.cups.org
|
||||
-->
|
||||
|
||||
<h2 class='title'>Introduction</h2>
|
||||
@@ -26,9 +35,6 @@ used when writing backends, filters, and port monitors.</p>
|
||||
use the <tt>CUPS_BACKEND_</tt> constants and
|
||||
<tt>cupsBackChannel</tt> functions, respectively.</p>
|
||||
|
||||
<p>The <var><cups/sidechannel.h></var> header file must be
|
||||
included to use the <tt>CUPS_SC_</tt> constants and <tt>cupsSideChannel</tt> functions.</p>
|
||||
|
||||
<p>Programs using these functions must be linked to the CUPS
|
||||
library: <var>libcups.a</var>, <var>libcups.so.2</var>,
|
||||
<var>libcups.2.dylib</var>, <var>libcups_s.a</var>, or
|
||||
@@ -40,174 +46,6 @@ library:</p>
|
||||
<kbd>gcc -o myprogram myprogram.c -lcups</kbd>
|
||||
</pre>
|
||||
|
||||
|
||||
<h2 class='title'>Compatibility</h2>
|
||||
|
||||
<p>The <tt>cupsBackChannel</tt> functions require CUPS 1.2 or higher. The <tt>cupsSideChannel</tt> functions require CUPS 1.3 or higher.</p>
|
||||
|
||||
|
||||
<h2 class='title'>Using the cupsBackChannel APIs</h2>
|
||||
|
||||
<p>The <tt>cupsBackChannel</tt> APIs allow your filters, drivers, and port monitors to read data back from a printer and your backends to send data from a printer to the filters, drivers, and port monitors associated with the current job. Back-channel data is normally sent by the printer in response to a command sent from your program to the printer via <tt>stdout</tt>.</p>
|
||||
|
||||
<p>The <tt>cupsBackChannelRead()</tt> function reads data from the printer via the backend. You provide a timeout in seconds along with a buffer pointer and the size of that buffer. It returns the number of bytes or -1 if there was an error. The following code example shows how to poll for back-channel data in your program:</p>
|
||||
|
||||
<pre class='command'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
char buffer[8192];
|
||||
ssize_t bytes;
|
||||
|
||||
/* Use a timeout of 0.0 seconds to poll for back-channel data */
|
||||
bytes = cupsBackChannelRead(buffer, sizeof(buffer), 0.0);
|
||||
</pre>
|
||||
|
||||
<p>If you are writing a backend, the <tt>cupsBackChannelWrite()</tt> function sends any back-channel data you have received from the printer to upstream filters in the print filter chain. We recommend using a timeout of 1.0 seconds:</p>
|
||||
|
||||
<pre class='command'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
char buffer[8192];
|
||||
ssize_t bytes;
|
||||
|
||||
/* Use a timeout of 1.0 seconds to give filters a chance to read */
|
||||
cupsBackChannelWrite(buffer, bytes, 1.0);
|
||||
</pre>
|
||||
|
||||
|
||||
<h2 class='title'>Using the cupsSideChannel APIs</h2>
|
||||
|
||||
<p>The <tt>cupsSideChannel</tt> APIs allow your filters, drivers, port monitors, and backend to send and receive the following out-of-band commands:</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li><tt>CUPS_SC_CMD_SOFT_RESET</tt> - Do a soft reset</li>
|
||||
<li><tt>CUPS_SC_CMD_DRAIN_OUTPUT</tt> - Drain all pending output</li>
|
||||
<li><tt>CUPS_SC_CMD_GET_BIDI</tt> - Return bidirectional capabilities</li>
|
||||
<li><tt>CUPS_SC_CMD_GET_DEVICE_ID</tt> - Return the IEEE-1284 device ID</li>
|
||||
<li><tt>CUPS_SC_CMD_GET_STATE</tt> - Return the device state</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h3>Sending Commands from a Filter, Driver, or Port Monitor</h3>
|
||||
|
||||
<p>The <tt>cupsSideChannelDoRequest()</tt> function is used by filters, drivers, and port monitors to send a command to the backend and read back a response:</p>
|
||||
|
||||
<pre class='command'>
|
||||
cups_sc_status_t cupsSideChannelDoRequest(cups_sc_command_t command,
|
||||
char *data, int *datalen,
|
||||
double timeout);
|
||||
</pre>
|
||||
|
||||
<p>The <tt>CUPS_SC_CMD_SOFT_RESET</tt> and <tt>CUPS_SC_CMD_DRAIN_OUTPUT</tt> commands do not return any data values, while the others return one or more bytes. The <tt>timeout</tt> parameter allows your program to poll or wait for the command to complete - use a timeout of 30 seconds for <tt>CUPS_SC_CMD_SOFT_RESET</tt> and <tt>CUPS_SC_CMD_DRAIN_OUTPUT</tt> and a timeout of 1 second for all other commands.</p>
|
||||
|
||||
<p><tt>CUPS_SC_CMD_GET_BIDI</tt> returns a single <tt>char</tt> value that tells you whether the backend supports bidirectional communications:</p>
|
||||
|
||||
<pre class='command'>
|
||||
#include <cups/sidechannel.h>
|
||||
|
||||
char data;
|
||||
int datalen;
|
||||
cups_sc_bidi_t bidi;
|
||||
cups_sc_status_t status;
|
||||
|
||||
/* Tell cupsSideChannelDoRequest() how big our buffer is... */
|
||||
datalen = 1;
|
||||
|
||||
/* Get the bidirectional capabilities, waiting for up to 1 second */
|
||||
status = cupsSideChannelDoRequest(CUPS_SC_CMD_GET_BIDI, &data, &datalen, 1.0);
|
||||
|
||||
/* Use the returned value if OK was returned and the length is still 1 */
|
||||
if (status == CUPS_SC_STATUS_OK && datalen == 1)
|
||||
bidi = (cups_sc_bidi_t)data;
|
||||
else
|
||||
bidi = CUPS_SC_BIDI_NOT_SUPPORTED;
|
||||
</pre>
|
||||
|
||||
<p><tt>CUPS_SC_CMD_GET_DEVICE_ID</tt> returns a string of characters containing the IEEE-1284 device ID for the connected printer:</p>
|
||||
|
||||
<pre class='command'>
|
||||
#include <cups/sidechannel.h>
|
||||
|
||||
char data[2049];
|
||||
int datalen;
|
||||
cups_sc_status_t status;
|
||||
|
||||
/* Tell cupsSideChannelDoRequest() how big our buffer is, less 1 byte for nul-termination... */
|
||||
datalen = sizeof(data) - 1;
|
||||
|
||||
/* Get the IEEE-1284 device ID, waiting for up to 1 second */
|
||||
status = cupsSideChannelDoRequest(CUPS_SC_CMD_GET_DEVICE_ID, data, &datalen, 1.0);
|
||||
|
||||
/* Use the returned value if OK was returned and the length is non-zero */
|
||||
if (status == CUPS_SC_STATUS_OK && datalen > 0)
|
||||
data[datalen] = '\0';
|
||||
else
|
||||
data[0] = '\0';
|
||||
</pre>
|
||||
|
||||
<p><tt>CUPS_SC_CMD_GET_STATE</tt> returns a single <tt>char</tt> value that tells you the current device state:</p>
|
||||
|
||||
<pre class='command'>
|
||||
#include <cups/sidechannel.h>
|
||||
|
||||
char data;
|
||||
int datalen;
|
||||
cups_sc_state_t state;
|
||||
cups_sc_status_t status;
|
||||
|
||||
/* Tell cupsSideChannelDoRequest() how big our buffer is... */
|
||||
datalen = 1;
|
||||
|
||||
/* Get the bidirectional capabilities, waiting for up to 1 second */
|
||||
status = cupsSideChannelDoRequest(CUPS_SC_CMD_GET_STATE, &data, &datalen, 1.0);
|
||||
|
||||
/* Use the returned value if OK was returned and the length is still 1 */
|
||||
if (status == CUPS_SC_STATUS_OK && datalen == 1)
|
||||
state = (cups_sc_state_t)data;
|
||||
else
|
||||
state = CUPS_SC_STATE_OFFLINE;
|
||||
</pre>
|
||||
|
||||
|
||||
<h3>Handling Commands in your Backend</h3>
|
||||
|
||||
<p>The <tt>cupsSideChannelRead()</tt> function is used by backends to read a command from a filter, driver, or port monitor:</p>
|
||||
|
||||
<pre class='command'>
|
||||
int cupsSideChannelRead(cups_sc_command_t &command,
|
||||
cups_sc_status_t &status,
|
||||
char *data, int *datalen, double timeout);
|
||||
</pre>
|
||||
|
||||
<p>Backends can either poll for commands using a <tt>timeout</tt> of 0.0, wait indefinitely for commands using a <tt>timeout</tt> of -1.0 (probably in a separate thread for that purpose), or use <tt>select()</tt> or <tt>poll()</tt> on the <tt>CUPS_SC_FD</tt> file descriptor (4) to handle input and output on several file descriptors at the same time. Backends can pass <tt>NULL</tt> for the <tt>data</tt> and <tt>datalen</tt> parameters, since none of the commands sent by upstream filters contain any data at this time.</p>
|
||||
|
||||
<p>Once a command is processed, the backend uses the <tt>cupsSideChannelWrite()</tt> function to send its response:</p>
|
||||
|
||||
<pre class='command'>
|
||||
#include <cups/sidechannel.h>
|
||||
|
||||
cups_sc_command_t command;
|
||||
cups_sc_status_t status;
|
||||
|
||||
/* Poll for a command... */
|
||||
if (!cupsSideChannelRead(&command, &status, NULL, NULL, 0.0))
|
||||
{
|
||||
char data[2048];
|
||||
int datalen;
|
||||
|
||||
switch (command)
|
||||
{
|
||||
... handle supported commands, file data/datalen/status with values as needed ...
|
||||
|
||||
default :
|
||||
status = CUPS_SC_STATUS_NOT_IMPLEMENTED;
|
||||
datalen = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Send a response... */
|
||||
cupsSideChannelWrite(command, status, data, datalen, 1.0);
|
||||
}
|
||||
</pre>
|
||||
<p>All of these functions require CUPS 1.2 or higher.</p>
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
<!--
|
||||
"$Id: api-httpipp.shtml 6649 2007-07-11 21:46:42Z mike $"
|
||||
"$Id: api-httpipp.shtml 5138 2006-02-21 10:49:06Z mike $"
|
||||
|
||||
HTTP and IPP API introduction for the Common UNIX Printing System (CUPS).
|
||||
|
||||
Copyright 2007 by Apple Inc.
|
||||
Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
Copyright 1997-2006 by Easy Software Products.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
property of Apple Inc. and are protected by Federal copyright
|
||||
law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
which should have been included with this file. If this file is
|
||||
file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
property of Easy Software Products and are protected by Federal
|
||||
copyright law. Distribution and use rights are outlined in the file
|
||||
"LICENSE.txt" which should have been included with this file. If this
|
||||
file is missing or damaged please contact Easy Software Products
|
||||
at:
|
||||
|
||||
Attn: CUPS Licensing Information
|
||||
Easy Software Products
|
||||
44141 Airport View Drive, Suite 204
|
||||
Hollywood, Maryland 20636 USA
|
||||
|
||||
Voice: (301) 373-9600
|
||||
EMail: cups-info@cups.org
|
||||
WWW: http://www.cups.org
|
||||
-->
|
||||
|
||||
<h2 class='title'>Introduction</h2>
|
||||
|
||||
Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais
Referência em uma Nova Issue
Bloquear um usuário