Comparar commits

..

1 Commits

Autor SHA1 Mensagem Data
msweet c8bbf4a9b9 Import cups.org releases
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/tags/release-1.3.10@4306 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-05-10 18:56:23 +00:00
2067 arquivos alterados com 183324 adições e 151623 exclusões
+1261
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+822 -338
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+40 -30
Ver Arquivo
@@ -1,37 +1,47 @@
CREDITS.txt - 02/23/2006
CREDITS.txt - 2008-06-16
------------------------
Few projects are completed by one person, and CUPS is no exception. We'd
like to thank the following individuals for their contributions:
Nathaniel Barbour - Lots of testing and feedback.
N. Becker - setsid().
Jean-Eric Cuendet - GhostScript filters for CUPS.
Van Dang - HTTP and IPP policeman.
L. Peter Deutsch - MD5 code.
Dr. ZP Han - setgid()/setuid().
Guy Harris - *BSD shared libraries and lots of other fixes.
Bjoern Jacke - I18N stuff.
Wang Jian - CUPS RPM corrections.
Roderick Johnstone - Beta tester of the millenium.
Till Kamppeter - Bug fixes, beta testing, evangelism.
Kenshi Muto - Japanese localization, patches, and testing.
Kiko - Bug fixes.
Sergey V. Kovalyov - ESP Print Pro and CUPS beta tester.
Mark Lawrence - Microsoft interoperability testing.
Jeff Licquia - Bug fixes, beta testing, evangelism.
Jason McMullan - Original CUPS RPM distributions.
Wes Morgan - *BSD fixes.
Ulrich Oldendorf - German locale.
Giulio Orsero - Bug fixes and testing.
Kurt Pfeifle - Bug fixes, beta testing, evangelism.
Gilles QUERRET - French man pages.
Petter Reinholdtsen - HP-UX compiler stuff.
Stuart Stevens - HP JetDirect IPP information.
Andrea Suatoni - IRIX desktop integration and testing.
Tomohiro Kato - Japanese localization.
Tim Waugh - Lots of patches, testing, and Linux integration.
Yugami - LDAP browsing support.
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.
Dr. ZP Han - setgid()/setuid().
Guy Harris - *BSD shared libraries and lots of other
fixes.
Bjoern Jacke - I18N stuff.
Wang Jian - CUPS RPM corrections.
Roderick Johnstone - Beta tester of the millenium.
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.
Mark Lawrence - Microsoft interoperability testing.
Jeff Licquia - Bug fixes, beta testing, evangelism.
Jason McMullan - Original CUPS RPM distributions.
Wes Morgan - *BSD fixes.
Daniel Nylander - Swedish localization.
Giulio Orsero - Bug fixes and testing.
Michal Osowiecki - Polish localization.
Citra Paska - Indonesian 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.
Stuart Stevens - HP JetDirect IPP information.
Andrea Suatoni - IRIX desktop integration and testing.
Teppo Turlianen - Finnish 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
"mike@easysw.com".
"msweet@apple.com".
+14 -7
Ver Arquivo
@@ -1,4 +1,4 @@
INSTALL - CUPS v1.2b2 - 2006-03-09
INSTALL - CUPS v1.3.9 - 2008-10-09
----------------------------------
This file describes how to compile and install CUPS from source
@@ -6,8 +6,10 @@ 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, YOU WILL ALSO ****
**** NEED TO INSTALL ESP GHOSTSCRIPT AFTER YOU INSTALL CUPS ****
**** 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. ****
BEFORE YOU BEGIN
@@ -20,7 +22,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.
FreeBSD users should use GNU make (gmake).
BSD 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
@@ -29,17 +31,22 @@ BEFORE YOU BEGIN
compile and run without these, however you'll miss out on
many of the features provided by CUPS.
Kerberos support requires MIT Kerberos 1.6.3 or later or
Heimdal Kerberos, along with the corresponding GSSAPI
pieces.
Also, please note that CUPS no longer includes the
Ghostscript- based pstoraster filter. You *must* download
ESP Ghostscript separately from the CUPS web site if you want
to print PostScript files to non-PostScript printers.
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.
COMPILING FROM SUBVERSION
The CUPS Subversion repository doesn't hold a copy of the
pre-built configure script. You'll need to run the GNU
autoconf software (2.52 or higher) before compiling the
autoconf software (2.60 or higher) before compiling the
software from Subversion:
autoconf -f
+76 -67
Ver Arquivo
@@ -1,28 +1,25 @@
Common UNIX Printing System License Agreement
CUPS License Agreement
Copyright 1997-2006 by Easy Software Products
44141 AIRPORT VIEW DR STE 204
HOLLYWOOD, MARYLAND 20636 USA
Copyright 2007-2009 by Apple Inc.
1 Infinite Loop
Cupertino, CA 95014 USA
Voice: +1.301.373.9600
Email: cups-info@cups.org
WWW: http://www.cups.org
WWW: http://www.cups.org/
INTRODUCTION
The Common UNIX Printing System(tm), ("CUPS(tm)"), is provided
under the GNU General Public License ("GPL") and GNU Library
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.
CUPS(tm) is provided under the GNU General Public License ("GPL")
and GNU Library 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 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.
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.
For those not familiar with the GNU GPL, the license basically
allows you to:
@@ -32,28 +29,25 @@ 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 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.
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.
The GNU LGPL relaxes the "link-to" restriction, allowing you to
develop applications that use the CUPS API library under other
licenses and/or conditions as appropriate for your application.
develop applications that use the CUPS and CUPS Imaging libraries
under other licenses and/or conditions as appropriate for your
application, driver, or filter.
LICENSE EXCEPTIONS
In addition, as the copyright holder of CUPS, Easy Software
Products grants the following special exceptions:
In addition, as the copyright holder of CUPS, Apple Inc. grants
the following special exceptions:
1. Apple Operating System Development License Exception;
@@ -96,49 +90,64 @@ Products grants the following special exceptions:
2. OpenSSL Toolkit License Exception;
a. Easy Software Products explicitly allows the
compilation and distribution of the CUPS software
with the OpenSSL Toolkit.
a. Apple Inc. 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
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/
CUPS and the CUPS logo (the "CUPS Marks") are trademarks of Apple
Inc. Apple grants you a non-exclusive and non-transferable right
to use the CUPS Marks in any direct port or binary distribution
incorporating CUPS software and in any promotional material
therefor. You agree that your products will meet the highest
levels of quality and integrity for similar goods, not be unlawful,
and be developed, manufactured, and distributed in compliance with
this license. You will not interfere with Apple's rights in the
CUPS Marks, and all use of the CUPS Marks shall inure to the
benefit of Apple. This license does not apply to use of the CUPS
Marks in a derivative products, which requires prior written
permission from Apple Inc.
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
+61 -31
Ver Arquivo
@@ -3,23 +3,14 @@
#
# Common makefile definitions for the Common UNIX Printing System (CUPS).
#
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
# Copyright 2007-2008 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# 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
# 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/".
#
#
@@ -73,6 +64,14 @@ CUPS_PRIMARY_SYSTEM_GROUP = @CUPS_PRIMARY_SYSTEM_GROUP@
CUPS_CONFIG_FILE_PERM = @CUPS_CONFIG_FILE_PERM@
CUPS_LOG_FILE_PERM = @CUPS_LOG_FILE_PERM@
#
# Languages to install...
#
LANGUAGES = @LANGUAGES@
INSTALL_LANGUAGES = @INSTALL_LANGUAGES@
UNINSTALL_LANGUAGES = @UNINSTALL_LANGUAGES@
#
# Libraries...
#
@@ -85,6 +84,7 @@ LIBMALLOC = @LIBMALLOC@
LIBPAPER = @LIBPAPER@
LIBPNG = @LIBPNG@
LIBSLP = @LIBSLP@
LIBGSSAPI = @LIBGSSAPI@
LIBTIFF = @LIBTIFF@
LIBZ = @LIBZ@
@@ -97,47 +97,67 @@ INSTALLSTATIC = @INSTALLSTATIC@
#
# Program options...
#
# OPTIM defines the common compiler optimization/debugging options.
# OPTIONS defines other compile-time options (currently only -dDEBUG for
# extra debug info)
# ARCHFLAGS Defines the default architecture build options.
# 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
# when compiling separate 32/64-bit libraries.
# OPTIM Defines the common compiler optimization/debugging options
# for all architectures.
# OPTIONS Defines other compile-time options (currently only -DDEBUG
# for extra debug info)
#
ALL_CFLAGS = -I.. -D_CUPS_SOURCE $(CFLAGS) $(SSLFLAGS) \
@LARGEFILE@ @PTHREAD_FLAGS@ $(OPTIONS)
ALL_CXXFLAGS = -I.. -D_CUPS_SOURCE $(CXXFLAGS) $(SSLFLAGS) \
@LARGEFILE@ @PTHREAD_FLAGS@ $(OPTIONS)
ARCHFLAGS = @ARCHFLAGS@
ARFLAGS = @ARFLAGS@
BACKLIBS = @BACKLIBS@
CFLAGS = -I.. $(RC_CFLAGS) $(SSLFLAGS) @CPPFLAGS@ @CFLAGS@ \
@LARGEFILE@ @PTHREAD_FLAGS@ $(OPTIONS)
CFLAGS = @CPPFLAGS@ @CFLAGS@
COMMONLIBS = @LIBS@
CUPSDLIBS = @CUPSDLIBS@
CXXFLAGS = -I.. $(RC_CFLAGS) $(SSLFLAGS) @CPPFLAGS@ @CXXFLAGS@ \
@LARGEFILE@ @PTHREAD_FLAGS@ $(OPTIONS)
CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@
CXXLIBS = @CXXLIBS@
DSOFLAGS = @DSOFLAGS@
DSOLIBS = @DSOLIBS@ $(COMMONLIBS)
IMGLIBS = @IMGLIBS@ -lm
LDFLAGS = -L../cups -L../filter $(RC_CFLAGS) @LDFLAGS@ $(OPTIM)
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@
LINKCUPS = @LINKCUPS@ $(SSLLIBS)
LINKCUPSIMAGE = @LINKCUPSIMAGE@
LIBS = $(LINKCUPS) $(COMMONLIBS)
OPTIM = @OPTIM@
OPTIONS =
PAMLIBS = @PAMLIBS@
PAP = @PAP@
PDFTOPS = @PDFTOPS@
PHPDIR = @PHPDIR@
SSLFLAGS = @SSLFLAGS@
SSLLIBS = @SSLLIBS@
LAUNCHDLIBS = @LAUNCHDLIBS@
#
# Separate 32/64-bit library support...
#
C32FLAGS = @C32FLAGS@
ARCH32FLAGS = @ARCH32FLAGS@
DSO32FLAGS = @DSO32FLAGS@
INSTALL32 = @INSTALL32@
LIB32CUPS = @LIB32CUPS@
LIB32CUPSIMAGE = @LIB32CUPSIMAGE@
LIB32DIR = $(BUILDROOT)@LIB32DIR@
UNINSTALL32 = @UNINSTALL32@
C64FLAGS = @C64FLAGS@
ARCH64FLAGS = @ARCH64FLAGS@
DSO64FLAGS = @DSO64FLAGS@
INSTALL64 = @INSTALL64@
LIB64CUPS = @LIB64CUPS@
LIB64CUPSIMAGE = @LIB64CUPSIMAGE@
@@ -152,12 +172,16 @@ UNINSTALL64 = @UNINSTALL64@
# We have to define these first because autoconf uses ${prefix}
# and ${exec_prefix} for most of the other directories...
#
# The "datarootdir" variable may not get defined if you are using
# a version of autoconf prior to 2.60.
#
# This is immediately followed by definition in ALL CAPS for the
# needed directories...
#
bindir = @bindir@
datadir = @datadir@
datarootdir = @datarootdir@
exec_prefix = @exec_prefix@
includedir = @includedir@
infodir = @infodir@
@@ -180,6 +204,7 @@ BINDIR = $(BUILDROOT)@bindir@
CACHEDIR = $(BUILDROOT)@CUPS_CACHEDIR@
DATADIR = $(BUILDROOT)@CUPS_DATADIR@
DOCDIR = $(BUILDROOT)@CUPS_DOCROOT@
ICONDIR = @ICONDIR@
INCLUDEDIR = $(BUILDROOT)$(includedir)
INITDIR = @INITDIR@
INITDDIR = @INITDDIR@
@@ -187,12 +212,17 @@ 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@
SERVERROOT = $(BUILDROOT)@CUPS_SERVERROOT@
STATEDIR = $(BUILDROOT)@CUPS_STATEDIR@
XINETD = @XINETD@
MAN1EXT = @MAN1EXT@
MAN5EXT = @MAN5EXT@
@@ -216,19 +246,19 @@ DBUSDIR = @DBUSDIR@
.c.o:
echo Compiling $<...
$(CC) $(OPTIM) $(CFLAGS) -c $<
$(CC) $(ARCHFLAGS) $(OPTIM) $(ALL_CFLAGS) -c $<
.c.32.o:
echo Compiling 32-bit $<...
$(CC) $(C32FLAGS) $(OPTIM) $(CFLAGS) -c -o $@ $<
$(CC) $(ARCH32FLAGS) $(OPTIM) $(ALL_CFLAGS) -c -o $@ $<
.c.64.o:
echo Compiling 64-bit $<...
$(CC) $(C64FLAGS) $(OPTIM) $(CFLAGS) -c -o $@ $<
$(CC) $(ARCH64FLAGS) $(OPTIM) $(ALL_CFLAGS) -c -o $@ $<
.cxx.o:
echo Compiling $<...
$(CXX) $(OPTIM) $(CXXFLAGS) -c $<
$(CXX) $(ARCHFLAGS) $(OPTIM) $(ALL_CXXFLAGS) -c $<
.man.1 .man.1m .man.5 .man.7 .man.8:
echo Linking $<...
+142 -39
Ver Arquivo
@@ -3,23 +3,14 @@
#
# Top-level Makefile for the Common UNIX Printing System (CUPS).
#
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
# Copyright 2007-2009 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# 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
# 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/".
#
include Makedefs
@@ -29,9 +20,9 @@ include Makedefs
#
DIRS = cups backend berkeley cgi-bin filter locale man monitor \
notifier pdftops scheduler systemv test \
notifier scheduler systemv test \
$(PHPDIR) \
conf data doc fonts ppd templates
conf data doc $(FONTS) ppd templates
#
@@ -40,6 +31,10 @@ DIRS = cups backend berkeley cgi-bin filter locale man monitor \
all:
chmod +x cups-config
echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
echo Using LDFLAGS="$(LDFLAGS)"
echo Using LIBS="$(LIBS)"
for dir in $(DIRS); do\
echo Making all in $$dir... ;\
(cd $$dir ; $(MAKE) $(MFLAGS)) || exit 1;\
@@ -57,6 +52,27 @@ clean:
done
#
# Remove all non-distribution files...
#
distclean: clean
$(RM) Makedefs config.h config.log config.status
$(RM) cups-config
$(RM) conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf
$(RM) doc/help/ref-cupsd-conf.html doc/help/standard.html doc/index.html
$(RM) init/cups.sh init/cups-lpd init/org.cups.cups-lpd.plist
$(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) doc/*/index.html
-$(RM) templates/*/header.tmpl
-$(RM) -r autom4te*.cache
#
# Make dependencies
#
@@ -68,6 +84,25 @@ depend:
done
#
# Run the clang.llvm.org static code analysis tool on the C sources.
#
.PHONY: clang
clang:
$(RM) -r clang
scan-build -k -o `pwd`/clang $(MAKE) $(MFLAGS) \
CC=ccc-analyzer CXX=ccc-analyzer clean all
#
# Generate a ctags file...
#
ctags:
ctags -R .
#
# Install object and target files...
#
@@ -80,36 +115,73 @@ install: installhdrs
echo Installing cups-config script...
$(INSTALL_DIR) -m 755 $(BINDIR)
$(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config
echo Installing startup script...
if test "x$(INITDIR)" != "x"; then \
if test "x$(INITDIR)" != x; then \
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; \
$(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; \
$(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc0.d/K$(RCSTOP)cups; \
fi
if test "x$(INITDIR)" = "x" -a "x$(INITDDIR)" != "x"; then \
if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
$(INSTALL_DIR) $(BUILDROOT)$(INITDDIR); \
if test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \
echo Installing StartupItems files...; \
$(INSTALL_SCRIPT) init/PrintingServices $(BUILDROOT)$(INITDDIR)/PrintingServices; \
$(INSTALL_DATA) init/StartupParameters.plist $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
$(INSTALL_DIR) $(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; \
fi \
fi
if test "x$(DBUSDIR)" != "x"; then \
if test "x$(DBUSDIR)" != x; then \
echo Installing cups.conf in $(DBUSDIR)...;\
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(DBUSDIR); \
$(INSTALL_DATA) packaging/cups-dbus.conf $(BUILDROOT)$(DBUSDIR)/cups.conf; \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(DBUSDIR)/system.d; \
$(INSTALL_DATA) packaging/cups-dbus.conf $(BUILDROOT)$(DBUSDIR)/system.d/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 \
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; \
fi
@@ -138,7 +210,7 @@ uninstall:
$(RM) $(BINDIR)/cups-config
-$(RMDIR) $(BINDIR)
echo Uninstalling startup script...
if test "x$(INITDIR)" != "x"; then \
if test "x$(INITDIR)" != x; then \
$(RM) $(BUILDROOT)$(INITDIR)/init.d/cups; \
$(RMDIR) $(BUILDROOT)$(INITDIR)/init.d; \
$(RM) $(BUILDROOT)$(INITDIR)/rc0.d/K00cups; \
@@ -150,46 +222,77 @@ uninstall:
$(RM) $(BUILDROOT)$(INITDIR)/rc5.d/S99cups; \
$(RMDIR) $(BUILDROOT)$(INITDIR)/rc5.d; \
fi
if test "x$(INITDIR)" = "x" -a "x$(INITDDIR)" != "x"; then \
if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
if test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \
$(RM) $(BUILDROOT)$(INITDDIR)/PrintingServices; \
$(RM) $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \
$(RM) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \
$(RMDIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
$(RM) $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \
$(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cupsd.plist; \
$(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cups-lpd.plist; \
$(RMDIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \
else \
$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
fi \
$(RMDIR) $(BUILDROOT)$(INITDDIR); \
fi
if test "x$(DBUSDIR)" != "x"; then \
if test "x$(DBUSDIR)" != x; then \
echo Uninstalling cups.conf in $(DBUSDIR)...;\
$(RM) $(BUILDROOT)$(DBUSDIR)/cups.conf; \
$(RMDIR) $(BUILDROOT)$(DBUSDIR); \
fi
$(RM) $(BUILDROOT)/etc/xinetd.d/cups-lpd
$(RM) $(BUILDROOT)/usr/share/applications/cups.desktop
$(RM) $(BUILDROOT)/usr/share/icons/hicolor/16x16/apps/cups.png
$(RM) $(BUILDROOT)/usr/share/icons/hicolor/32x32/apps/cups.png
$(RM) $(BUILDROOT)/usr/share/icons/hicolor/64x64/apps/cups.png
$(RM) $(BUILDROOT)/usr/share/icons/hicolor/128x128/apps/cups.png
#
# Run the test suite...
#
check test: all
test: all
echo Running CUPS test suite...
cd test; ./run-stp-tests.sh
check: all
echo Running CUPS test suite with defaults...
cd test; ./run-stp-tests.sh 1 0 n
#
# Make software distributions using EPM (http://www.easysw.com/epm/)...
#
EPMFLAGS = -v
EPMFLAGS = -v --output-dir dist $(EPMARCH)
aix bsd deb depot inst osx pkg rpm setld slackware swinstall tardist:
aix bsd deb depot inst pkg setld slackware swinstall tardist:
epm $(EPMFLAGS) -f $@ cups packaging/cups.list
epm:
epm $(EPMFLAGS) cups packaging/cups.list
epm $(EPMFLAGS) -s packaging/installer.gif cups packaging/cups.list
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
$(MAKE) $(MFLAGS) epm
case `uname` in \
*BSD*) $(MAKE) $(MFLAGS) bsd;; \
Darwin*) $(MAKE) $(MFLAGS) osx;; \
IRIX*) $(MAKE) $(MFLAGS) tardist;; \
Linux*) $(MAKE) $(MFLAGS) rpm;; \
SunOS*) $(MAKE) $(MFLAGS) pkg;; \
esac
#
+17 -48
Ver Arquivo
@@ -1,4 +1,4 @@
README - CUPS v1.2b2 - 2006-03-09
README - CUPS v1.3.9 - 2008-10-09
---------------------------------
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 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.
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.
CUPS uses the Internet Printing Protocol ("IPP") as the basis
for managing print jobs and queues. The Line Printer Daemon
@@ -22,22 +22,14 @@ INTRODUCTION
to support real-world printing under UNIX.
CUPS includes an image file RIP that supports printing of
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, and OKIDATA 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/
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.
CUPS is licensed under the GNU General Public License and GNU
Library General Public License. Please contact Easy Software
Products for commercial support and "binary distribution"
rights.
Library General Public License versions 2.
READING THE DOCUMENTATION
@@ -60,19 +52,13 @@ 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.2 includes a web-based administration tool that allows
CUPS 1.3 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:
@@ -101,6 +87,7 @@ 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
@@ -111,6 +98,7 @@ SETTING UP PRINTER QUEUES FROM THE COMMAND-LINE
HP LaserJet Series laserjet.ppd
OKIDATA 9-Pin Series okidata9.ppd
OKIDATA 24-Pin Series okidat24.ppd
Zebra CPCL Label Printer zebracpl.ppd
Zebra EPL1 Label Printer zebraep1.ppd
Zebra EPL2 Label Printer zebraep2.ppd
Zebra ZPL Label Printer zebra.ppd
@@ -131,10 +119,7 @@ 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. For fully-functional commercial printer drivers
check out our ESP Print Pro software at:
http://www.easysw.com/printpro/
or CUPS.
PRINTING FILES
@@ -168,9 +153,8 @@ PRINTING FILES
LEGAL STUFF
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.
CUPS is Copyright 2007-2009 by Apple Inc. CUPS and the CUPS
logo are trademarks of Apple Inc.
The MD5 Digest code is Copyright 1999 Aladdin Enterprises.
@@ -187,18 +171,3 @@ 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.
+33 -18
Ver Arquivo
@@ -1,29 +1,44 @@
# DO NOT DELETE
# DO NOT DELETE THIS LINE -- make depend depends on it.
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
ipp.o: ../cups/language.h ../cups/i18n.h ../cups/transcode.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
parallel.o: ../cups/backend.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
parallel.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
parallel.o: ../cups/language.h ../cups/string.h ../config.h ieee1284.c
parallel.o: ../cups/debug.h
lpd.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h
pap.o: ../config.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h
pap.o: ../cups/array.h ../cups/file.h ../cups/language.h ../cups/backend.h
pap.o: ../cups/sidechannel.h ../cups/i18n.h ../cups/transcode.h
parallel.o: backend-private.h ../cups/backend.h ../cups/sidechannel.h
parallel.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h
parallel.o: ../cups/array.h ../cups/file.h ../cups/language.h ../cups/debug.h
parallel.o: ../cups/i18n.h ../cups/transcode.h ../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: ../cups/backend.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
serial.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
serial.o: ../cups/language.h ../cups/string.h ../config.h
socket.o: ../cups/backend.h ../cups/http-private.h ../config.h ../cups/http.h
socket.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/cups.h
scsi.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
scsi.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
serial.o: backend-private.h ../cups/backend.h ../cups/sidechannel.h
serial.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h
serial.o: ../cups/array.h ../cups/file.h ../cups/language.h ../cups/debug.h
serial.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../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/sidechannel.h ../cups/cups.h ../cups/ppd.h
snmp.o: ../cups/array.h ../cups/file.h ../cups/language.h ../cups/debug.h
snmp.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../cups/array.h
snmp.o: ../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/sidechannel.h ../cups/cups.h
socket.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
socket.o: ../cups/string.h
test1284.o: ../cups/string.h ../config.h ieee1284.c ../cups/debug.h
socket.o: ../cups/debug.h ../cups/i18n.h ../cups/transcode.h ../cups/string.h
test1284.o: ../cups/string.h ../config.h ieee1284.c backend-private.h
test1284.o: ../cups/backend.h ../cups/sidechannel.h ../cups/cups.h
test1284.o: ../cups/ipp.h ../cups/http.h ../cups/ppd.h ../cups/array.h
test1284.o: ../cups/file.h ../cups/language.h ../cups/debug.h ../cups/i18n.h
test1284.o: ../cups/transcode.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
usb.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
usb.o: ../cups/string.h ../config.h ../cups/i18n.h ../cups/transcode.h
+56 -29
Ver Arquivo
@@ -3,23 +3,14 @@
#
# Backend makefile for the Common UNIX Printing System (CUPS).
#
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
# Copyright 2007 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# 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
# 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/".
#
# This file is subject to the Apple OS-Developed Software exception.
#
@@ -27,10 +18,11 @@
include ../Makedefs
RBACKENDS = ipp lpd
UBACKENDS = parallel scsi serial socket usb
TARGETS = betest test1284 $(RBACKENDS) $(UBACKENDS)
OBJS = betest.o ipp.o lpd.o parallel.o scsi.o \
serial.o socket.o test1284.o usb.o
UBACKENDS = $(PAP) $(LEGACY_BACKENDS) 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 \
serial.o snmp.o socket.o test1284.o usb.o
#
@@ -45,7 +37,7 @@ all: $(TARGETS)
#
clean:
$(RM) $(OBJS) $(TARGETS) http
$(RM) $(OBJS) $(TARGETS) $(LIBOBJS) http
#
@@ -70,6 +62,12 @@ 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
#
@@ -104,6 +102,17 @@ test1284: test1284.o ../cups/libcups.a
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
#
# libbackend.a
#
libbackend.a: $(LIBOBJS)
echo Archiving $@...
$(RM) $@
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
$(RANLIB) $@
#
# ieee1394
#
@@ -136,13 +145,22 @@ lpd: lpd.o ../cups/$(LIBCUPS)
$(CC) $(LDFLAGS) -o lpd lpd.o $(LIBS)
#
# pap
#
pap: pap.o ../cups/$(LIBCUPS)
echo Linking $@...
$(CC) $(LDFLAGS) -o pap pap.o $(BACKLIBS) $(LIBS) -framework AppleTalk
#
# parallel
#
parallel: parallel.o ../cups/$(LIBCUPS)
parallel: parallel.o ../cups/$(LIBCUPS) libbackend.a
echo Linking $@...
$(CC) $(LDFLAGS) -o parallel parallel.o $(LIBS)
$(CC) $(LDFLAGS) -o parallel parallel.o libbackend.a $(LIBS)
#
@@ -160,28 +178,37 @@ scsi.o: scsi.c scsi-irix.c scsi-linux.c
# serial
#
serial: serial.o ../cups/$(LIBCUPS)
serial: serial.o ../cups/$(LIBCUPS) libbackend.a
echo Linking $@...
$(CC) $(LDFLAGS) -o serial serial.o $(BACKLIBS) $(LIBS)
$(CC) $(LDFLAGS) -o serial serial.o libbackend.a $(BACKLIBS) $(LIBS)
#
# snmp
#
snmp: snmp.o ../cups/$(LIBCUPS) libbackend.a
echo Linking $@...
$(CC) $(LDFLAGS) -o snmp snmp.o libbackend.a $(LIBS)
#
# socket
#
socket: socket.o ../cups/$(LIBCUPS)
socket: socket.o ../cups/$(LIBCUPS) libbackend.a
echo Linking $@...
$(CC) $(LDFLAGS) -o socket socket.o $(LIBS)
$(CC) $(LDFLAGS) -o socket socket.o libbackend.a $(LIBS)
#
# usb
#
usb: usb.o ../cups/$(LIBCUPS)
usb: usb.o ../cups/$(LIBCUPS) libbackend.a
echo Linking $@...
$(CC) $(LDFLAGS) -o usb usb.o $(BACKLIBS) $(LIBS)
usb.o: usb.c usb-darwin.c usb-unix.c ieee1284.c
$(CC) $(LDFLAGS) -o usb usb.o libbackend.a $(BACKLIBS) $(LIBS)
usb.o: usb.c usb-darwin.c usb-unix.c
#
+69
Ver Arquivo
@@ -0,0 +1,69 @@
/*
* "$Id$"
*
* 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.
*
* 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"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*/
#ifndef _CUPS_BACKEND_PRIVATE_H_
# define _CUPS_BACKEND_PRIVATE_H_
/*
* Include necessary headers.
*/
# 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>
# include <signal.h>
/*
* C++ magic...
*/
# ifdef __cplusplus
extern "C" {
# endif /* __cplusplus */
/*
* 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));
# ifdef __cplusplus
}
# endif /* __cplusplus */
#endif /* !_CUPS_BACKEND_PRIVATE_H_ */
/*
* End of "$Id$".
*/
+4 -13
Ver Arquivo
@@ -3,23 +3,14 @@
*
* 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 Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" 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
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
+426 -176
Ver Arquivo
@@ -3,42 +3,39 @@
*
* IEEE-1284 support functions for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" 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
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* get_device_id() - Get the IEEE-1284 device ID string and corresponding
* URI.
* backendGetDeviceID() - Get the IEEE-1284 device ID string and
* corresponding URI.
* backendGetMakeModel() - Get the make and model string from the device ID.
*/
/*
* Include necessary headers.
*/
#include <cups/debug.h>
#include "backend-private.h"
#ifdef __linux
# include <sys/ioctl.h>
# include <linux/lp.h>
# define IOCNR_GET_DEVICE_ID 1
# define LPIOC_GET_DEVICE_ID(len) _IOC(_IOC_READ, 'P', IOCNR_GET_DEVICE_ID, len)
# include <linux/parport.h>
# include <linux/ppdev.h>
# include <unistd.h>
# include <fcntl.h>
#endif /* __linux */
#ifdef __sun
@@ -52,12 +49,12 @@
/*
* 'get_device_id()' - Get the IEEE-1284 device ID string and
* corresponding URI.
* 'backendGetDeviceID()' - Get the IEEE-1284 device ID string and
* corresponding URI.
*/
int /* O - 0 on success, -1 on failure */
get_device_id(
backendGetDeviceID(
int fd, /* I - File descriptor */
char *device_id, /* O - 1284 device ID */
int device_id_size, /* I - Size of buffer */
@@ -67,20 +64,26 @@ get_device_id(
char *uri, /* O - Device URI */
int uri_size) /* I - Size of buffer */
{
#ifdef __APPLE__ /* This function is a no-op */
return (-1);
#else /* Get the device ID from the specified file descriptor... */
char *attr, /* 1284 attribute */
*delim, /* 1284 delimiter */
*uriptr, /* Pointer into URI */
*mfg, /* Manufacturer string */
*mdl, /* Model string */
manufacturer[256], /* Manufacturer string */
serial_number[1024]; /* Serial number string */
#ifdef __linux
int manulen; /* Length of manufacturer string */
# ifdef __linux
int length; /* Length of device ID info */
#endif /* __linux */
#if defined(__sun) && defined(ECPPIOC_GETDEVID)
int got_id = 0;
# endif /* __linux */
# if defined(__sun) && defined(ECPPIOC_GETDEVID)
struct ecpp_device_id did; /* Device ID buffer */
#endif /* __sun && ECPPIOC_GETDEVID */
# endif /* __sun && ECPPIOC_GETDEVID */
DEBUG_printf(("get_device_id(fd=%d, device_id=%p, device_id_size=%d, "
DEBUG_printf(("backendGetDeviceID(fd=%d, device_id=%p, device_id_size=%d, "
"make_model=%p, make_model_size=%d, scheme=\"%s\", "
"uri=%p, uri_size=%d)\n", fd, device_id, device_id_size,
make_model, make_model_size, scheme ? scheme : "(null)",
@@ -90,90 +93,322 @@ get_device_id(
* Range check input...
*/
if (fd < 0 ||
!device_id || device_id_size < 32 ||
!make_model || make_model_size < 32)
if (!device_id || device_id_size < 32)
{
DEBUG_puts("get_device_id: Bad args!");
DEBUG_puts("backendGetDeviceID: Bad args!");
return (-1);
}
*device_id = '\0';
*make_model = '\0';
if (make_model)
*make_model = '\0';
if (uri)
*uri = '\0';
/*
* Get the device ID string...
*/
#ifdef __linux
if (!ioctl(fd, LPIOC_GET_DEVICE_ID(device_id_size), device_id))
if (fd >= 0)
{
/*
* Extract the length of the device ID string from the first two
* bytes. The 1284 spec says the length is stored MSB first...
* Get the device ID string...
*/
length = (((unsigned)device_id[0] & 255) << 8) +
((unsigned)device_id[1] & 255);
*device_id = '\0';
# ifdef __linux
if (ioctl(fd, LPIOC_GET_DEVICE_ID(device_id_size), device_id))
{
/*
* 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...
* Linux has to implement things differently for every device it seems.
* Since the standard parallel port driver does not provide a simple
* ioctl() to get the 1284 device ID, we have to open the "raw" parallel
* device corresponding to this port and do some negotiation trickery
* to get the current device ID.
*/
if (length > (device_id_size - 2))
length = (((unsigned)device_id[1] & 255) << 8) +
((unsigned)device_id[0] & 255);
if (uri && !strncmp(uri, "parallel:/dev/", 14))
{
char devparport[16]; /* /dev/parportN */
int devparportfd, /* File descriptor for raw device */
mode; /* Port mode */
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.
*/
/*
* Since the Linux parallel backend only supports 4 parallel port
* devices, just grab the trailing digit and use it to construct a
* /dev/parportN filename...
*/
memmove(device_id, device_id + 2, length);
device_id[length] = '\0';
snprintf(devparport, sizeof(devparport), "/dev/parport%s",
uri + strlen(uri) - 1);
if ((devparportfd = open(devparport, O_RDWR | O_NOCTTY)) != -1)
{
/*
* Claim the device...
*/
if (!ioctl(devparportfd, PPCLAIM))
{
fcntl(devparportfd, F_SETFL, fcntl(devparportfd, F_GETFL) | O_NONBLOCK);
mode = IEEE1284_MODE_COMPAT;
if (!ioctl(devparportfd, PPNEGOT, &mode))
{
/*
* Put the device into Device ID mode...
*/
mode = IEEE1284_MODE_NIBBLE | IEEE1284_DEVICEID;
if (!ioctl(devparportfd, PPNEGOT, &mode))
{
/*
* Read the 1284 device ID...
*/
if ((length = read(devparportfd, device_id,
device_id_size - 1)) >= 2)
{
device_id[length] = '\0';
got_id = 1;
}
}
}
/*
* Release the device...
*/
ioctl(devparportfd, PPRELEASE);
}
close(devparportfd);
}
}
}
# ifdef DEBUG
else
printf("get_device_id: ioctl failed - %s\n", strerror(errno));
# endif /* DEBUG */
#endif /* __linux */
got_id = 1;
#if defined(__sun) && defined(ECPPIOC_GETDEVID)
did.mode = ECPP_CENTRONICS;
did.len = device_id_size - 1;
did.rlen = 0;
did.addr = device_id;
if (got_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, ECPPIOC_GETDEVID, &did))
{
/*
* Nul-terminate the device ID text.
*/
length = (((unsigned)device_id[0] & 255) << 8) +
((unsigned)device_id[1] & 255);
if (did.rlen < (device_id_size - 1))
device_id[did.rlen] = '\0';
/*
* 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 = device_id_size - 2;
/*
* 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';
}
# ifdef DEBUG
else
device_id[device_id_size - 1] = '\0';
}
# ifdef DEBUG
else
printf("get_device_id: ioctl failed - %s\n", strerror(errno));
# endif /* DEBUG */
#endif /* __sun && ECPPIOC_GETDEVID */
printf("backendGetDeviceID: ioctl failed - %s\n", strerror(errno));
# endif /* DEBUG */
# endif /* __linux */
DEBUG_printf(("get_device_id: device_id=\"%s\"\n", device_id));
# if defined(__sun) && defined(ECPPIOC_GETDEVID)
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 (did.rlen < (device_id_size - 1))
device_id[did.rlen] = '\0';
else
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));
if (scheme && uri)
*uri = '\0';
if (!*device_id)
return (-1);
/*
* Get the make and model...
*/
if (make_model)
backendGetMakeModel(device_id, make_model, make_model_size);
/*
* Then generate a device URI...
*/
if (scheme && uri && uri_size > 32)
{
/*
* Look for the serial number field...
*/
if ((attr = strstr(device_id, "SERN:")) != NULL)
attr += 5;
else if ((attr = strstr(device_id, "SERIALNUMBER:")) != NULL)
attr += 13;
else if ((attr = strstr(device_id, ";SN:")) != NULL)
attr += 4;
if (attr)
{
strlcpy(serial_number, attr, sizeof(serial_number));
if ((delim = strchr(serial_number, ';')) != NULL)
*delim = '\0';
}
else
serial_number[0] = '\0';
/*
* Generate the device URI from the manufacturer, make_model, and
* serial number strings.
*/
snprintf(uri, uri_size, "%s://", scheme);
if ((attr = strstr(device_id, "MANUFACTURER:")) != NULL)
attr += 13;
else if ((attr = strstr(device_id, "Manufacturer:")) != NULL)
attr += 13;
else if ((attr = strstr(device_id, "MFG:")) != NULL)
attr += 4;
if (attr)
{
strlcpy(manufacturer, attr, sizeof(manufacturer));
if ((delim = strchr(manufacturer, ';')) != NULL)
*delim = '\0';
if (!strcasecmp(manufacturer, "Hewlett-Packard"))
strcpy(manufacturer, "HP");
else if (!strcasecmp(manufacturer, "Lexmark International"))
strcpy(manufacturer, "Lexmark");
}
else
{
strlcpy(manufacturer, make_model, sizeof(manufacturer));
if ((delim = strchr(manufacturer, ' ')) != NULL)
*delim = '\0';
}
manulen = strlen(manufacturer);
for (uriptr = uri + strlen(uri), delim = manufacturer;
*delim && uriptr < (uri + uri_size - 3);
delim ++)
if (*delim == ' ')
{
*uriptr++ = '%';
*uriptr++ = '2';
*uriptr++ = '0';
}
else
*uriptr++ = *delim;
*uriptr++ = '/';
if (!strncasecmp(make_model, manufacturer, manulen))
{
delim = make_model + manulen;
while (isspace(*delim & 255))
delim ++;
}
else
delim = make_model;
for (; *delim && uriptr < (uri + uri_size - 3); delim ++)
if (*delim == ' ')
{
*uriptr++ = '%';
*uriptr++ = '2';
*uriptr++ = '0';
}
else
*uriptr++ = *delim;
if (serial_number[0])
{
/*
* Add the serial number to the URI...
*/
strlcpy(uriptr, "?serial=", uri_size - (uriptr - uri));
strlcat(uriptr, serial_number, uri_size - (uriptr - uri));
}
else
*uriptr = '\0';
}
return (0);
#endif /* __APPLE__ */
}
/*
* 'backendGetMakeModel()' - Get the make and model string from the device ID.
*/
int /* O - 0 on success, -1 on failure */
backendGetMakeModel(
const char *device_id, /* O - 1284 device ID */
char *make_model, /* O - Make/model */
int make_model_size) /* I - Size of buffer */
{
char *attr, /* 1284 attribute */
*delim, /* 1284 delimiter */
*mfg, /* Manufacturer string */
*mdl; /* Model string */
DEBUG_printf(("backendGetMakeModel(device_id=\"%s\", "
"make_model=%p, make_model_size=%d)\n", device_id,
make_model, make_model_size));
/*
* Range check input...
*/
if (!device_id || !*device_id || !make_model || make_model_size < 32)
{
DEBUG_puts("backendGetMakeModel: Bad args!");
return (-1);
}
*make_model = '\0';
/*
* Look for the description field...
*/
@@ -224,20 +459,104 @@ get_device_id(
if ((mfg = strstr(device_id, "MANUFACTURER:")) != NULL)
mfg += 13;
else if ((mfg = strstr(device_id, "Manufacturer:")) != NULL)
mfg += 13;
else if ((mfg = strstr(device_id, "MFG:")) != NULL)
mfg += 4;
if ((mdl = strstr(device_id, "MODEL:")) != NULL)
mdl += 6;
else if ((mdl = strstr(device_id, "Model:")) != NULL)
mdl += 6;
else if ((mdl = strstr(device_id, "MDL:")) != NULL)
mdl += 4;
if (attr)
if (mdl)
{
/*
* Build a make-model string from the manufacturer and model attributes...
*/
if (mfg)
{
/*
* Skip leading whitespace...
*/
while (isspace(*mfg & 255))
mfg ++;
/*
* Map common bad names to the ones we use for driver selection...
*/
if (!strncasecmp(mfg, "Hewlett-Packard", 15))
strlcpy(make_model, "HP", make_model_size);
else if (!strncasecmp(mfg, "Lexmark International", 21))
strlcpy(make_model, "Lexmark", make_model_size);
else
{
/*
* Use the manufacturer that is supplied...
*/
strlcpy(make_model, mfg, make_model_size);
if ((delim = strchr(make_model, ';')) != NULL)
*delim = '\0';
/*
* But strip trailing whitespace...
*/
for (delim = make_model + strlen(make_model) - 1;
delim > make_model && *delim == ' ';
delim --)
*delim = '\0';
}
if (!strncasecmp(make_model, mdl, strlen(make_model)))
{
/*
* Just copy model string, since it has the manufacturer...
*/
strlcpy(make_model, mdl, make_model_size);
}
else
{
/*
* Concatenate the make and model...
*/
while (isspace(*mdl & 255))
mdl ++;
strlcat(make_model, " ", make_model_size);
strlcat(make_model, mdl, make_model_size);
}
}
else
{
/*
* Just copy model string, since it has the manufacturer...
*/
while (isspace(*mdl & 255))
mdl ++;
strlcpy(make_model, mdl, make_model_size);
}
}
else if (attr)
{
/*
* Use description...
*/
while (isspace(*attr & 255))
attr ++;
if (!strncasecmp(attr, "Hewlett-Packard hp ", 19))
{
/*
@@ -257,38 +576,6 @@ get_device_id(
strlcpy(make_model, attr, make_model_size);
}
}
else if (mfg && mdl)
{
/*
* Build a make-model string from the manufacturer and model attributes...
*/
if (!strncasecmp(mfg, "Hewlett-Packard", 15))
strlcpy(make_model, "HP", make_model_size);
else
strlcpy(make_model, mfg, make_model_size);
if ((delim = strchr(make_model, ';')) != NULL)
*delim = '\0';
if (!strncasecmp(make_model, mdl, strlen(make_model)))
{
/*
* Just copy model string, since it has the manufacturer...
*/
strlcpy(make_model, mdl, make_model_size);
}
else
{
/*
* Concatenate the make and model...
*/
strlcat(make_model, " ", make_model_size);
strlcat(make_model, mdl, make_model_size);
}
}
else
{
/*
@@ -298,73 +585,36 @@ get_device_id(
strlcpy(make_model, "Unknown", make_model_size);
}
/*
* Strip trailing data...
*/
if ((delim = strchr(make_model, ';')) != NULL)
*delim = '\0';
if (scheme && uri && uri_size > 32)
{
/*
* Look for the serial number field...
*/
for (delim = make_model + strlen(make_model) - 1;
delim > make_model && *delim == ' ';
delim --)
*delim = '\0';
if ((attr = strstr(device_id, "SERN:")) != NULL)
attr += 5;
else if ((attr = strstr(device_id, "SERIALNUMBER:")) != NULL)
attr += 13;
else if ((attr = strstr(device_id, ";SN:")) != NULL)
attr += 4;
/*
* Strip trailing whitespace...
*/
if (attr)
{
strlcpy(serial_number, attr, sizeof(serial_number));
if ((delim = strchr(serial_number, ';')) != NULL)
*delim = '\0';
}
for (delim = make_model + strlen(make_model) - 1; delim >= make_model; delim --)
if (isspace(*delim & 255))
*delim = '\0';
else
serial_number[0] = '\0';
break;
/*
* Generate the device URI from the make_model and serial number strings.
*/
/*
* Return...
*/
snprintf(uri, uri_size, "%s://", scheme);
for (uriptr = uri + strlen(uri), delim = make_model;
*delim && uriptr < (uri + uri_size - 1);
delim ++)
if (*delim == ' ')
{
delim ++;
*uriptr++ = '/';
break;
}
else
*uriptr++ = *delim;
for (; *delim && uriptr < (uri + uri_size - 3); delim ++)
if (*delim == ' ')
{
*uriptr++ = '%';
*uriptr++ = '2';
*uriptr++ = '0';
}
else
*uriptr++ = *delim;
*uriptr = '\0';
if (serial_number[0])
{
/*
* Add the serial number to the URI...
*/
strlcat(uri, "?serial=", uri_size);
strlcat(uri, serial_number, uri_size);
}
}
return (0);
if (make_model[0])
return (0);
else
return (-1);
}
+1
Ver Arquivo
@@ -3,6 +3,7 @@
*
* 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
+1
Ver Arquivo
@@ -3,6 +3,7 @@
*
* 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
+1
Ver Arquivo
@@ -3,6 +3,7 @@
*
* 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
+501 -247
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+270 -184
Ver Arquivo
@@ -3,23 +3,14 @@
*
* Line Printer Daemon backend for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
* Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" 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
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
@@ -41,6 +32,7 @@
#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>
@@ -73,6 +65,14 @@ 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,
const char *filename,
const char *user, const char *title, int copies,
int banner, int format, int order, int reserve,
int print_fd, int mode, 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,13 +125,15 @@ 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[255], /* Name of option */
value[255], /* Value of option */
*ptr, /* Pointer into name or value */
*name, /* Name of option */
*value, /* Value of option */
sep, /* Separator character */
*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 */
@@ -184,49 +186,12 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
else if (argc < 6 || argc > 7)
{
fprintf(stderr, "Usage: %s job-id user title copies options [file]\n",
argv[0]);
_cupsLangPrintf(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...
*/
@@ -236,6 +201,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
hostname, sizeof(hostname), &port,
resource, sizeof(resource));
if (!port)
port = 515; /* Default to port 515 */
if (!username[0])
{
/*
@@ -249,6 +217,7 @@ 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;
@@ -258,9 +227,16 @@ 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...
*/
{
CFPropertyListRef pvalue; /* Preference value */
SInt32 toval; /* Timeout value */
@@ -304,29 +280,30 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Get the name...
*/
for (ptr = name; *options && *options != '=';)
if (ptr < (name + sizeof(name) - 1))
*ptr++ = *options++;
*ptr = '\0';
name = options;
if (*options == '=')
while (*options && *options != '=' && *options != '+' && *options != '&')
options ++;
if ((sep = *options) != '\0')
*options++ = '\0';
if (sep == '=')
{
/*
* Get the value...
*/
options ++;
value = options;
for (ptr = value; *options && *options != '+' && *options != '&';)
if (ptr < (value + sizeof(value) - 1))
*ptr++ = *options++;
*ptr = '\0';
if (*options == '+' || *options == '&')
while (*options && *options != '+' && *options != '&')
options ++;
if (*options)
*options++ = '\0';
}
else
value[0] = '\0';
value = (char *)"";
/*
* Process the option...
@@ -350,7 +327,22 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (strchr("cdfglnoprtv", value[0]))
format = value[0];
else
fprintf(stderr, "ERROR: Unknown format character \"%c\"\n", value[0]);
_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);
}
else if (!strcasecmp(name, "order") && value[0])
{
@@ -363,7 +355,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
else if (!strcasecmp(value, "data,control"))
order = ORDER_DATA_CONTROL;
else
fprintf(stderr, "ERROR: Unknown file order \"%s\"\n", value);
_cupsLangPrintf(stderr, _("ERROR: Unknown file order \"%s\"\n"),
value);
}
else if (!strcasecmp(name, "reserve"))
{
@@ -410,7 +403,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
else if (!strcasecmp(name, "contimeout"))
{
/*
* Set the timeout...
* Set the connection timeout...
*/
if (atoi(value) > 0)
@@ -419,6 +412,62 @@ 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);
}
}
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...
*/
@@ -432,6 +481,8 @@ 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 = '_';
@@ -454,7 +505,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
copies = atoi(argv[4]);
}
status = lpd_queue(hostname, port, resource + 1, filename,
status = lpd_queue(hostname, port, resource + 1, fd, mode,
username, title, copies,
banner, format, order, reserve, manual_copies,
timeout, contimeout);
@@ -463,7 +514,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, filename,
status = lpd_queue(hostname, port, resource + 1, fd, mode,
username, title, 1,
banner, format, order, reserve, 1,
timeout, contimeout);
@@ -475,6 +526,9 @@ 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...
*/
@@ -532,14 +586,15 @@ lpd_command(int fd, /* I - Socket connection to LPD host */
* Read back the status from the command and return it...
*/
fprintf(stderr, "DEBUG: Reading command status...\n");
fputs("DEBUG: Reading command status...\n", stderr);
alarm(timeout);
if (recv(fd, &status, 1, 0) < 1)
{
fprintf(stderr, "WARNING: Remote host did not respond with command "
"status byte after %d seconds!\n", timeout);
_cupsLangPrintf(stderr,
_("WARNING: Remote host did not respond with command "
"status byte after %d seconds!\n"), timeout);
status = errno;
}
@@ -559,7 +614,8 @@ 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 */
const char *filename, /* I - File to print */
int print_fd, /* I - File to print */
int mode, /* I - Print mode */
const char *user, /* I - Requesting user */
const char *title, /* I - Job title */
int copies, /* I - Number of copies */
@@ -571,7 +627,6 @@ 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 */
@@ -581,16 +636,16 @@ 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[65536]; /* Output buffer */
char buffer[32768]; /* Output buffer */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
@@ -620,18 +675,16 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
if ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, portname)) == NULL)
{
fprintf(stderr, "ERROR: Unable to locate printer \'%s\'!\n",
hostname);
_cupsLangPrintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"),
hostname);
return (CUPS_BACKEND_STOP);
}
/*
* Remember when we starting trying to connect to the printer...
* Remember when we started trying to connect to the printer...
*/
#ifdef __APPLE__
recoverable = 0;
#endif /* __APPLE__ */
start_time = time(NULL);
/*
@@ -645,10 +698,12 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
*/
fputs("STATE: +connecting-to-device\n", stderr);
fprintf(stderr, "INFO: Attempting to connect to host %s for printer %s\n",
hostname, printer);
_cupsLangPrintf(stderr,
_("INFO: Attempting to connect to host %s for printer %s\n"),
hostname, printer);
for (lport = reserve == RESERVE_RFC1179 ? 732 : 1024, addr = addrlist;;
for (lport = reserve == RESERVE_RFC1179 ? 732 : 1024, addr = addrlist,
delay = 5;;
addr = addr->next)
{
/*
@@ -744,8 +799,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
* available printer in the class.
*/
fprintf(stderr, "INFO: Unable to connect to %s, queuing on next printer in class...\n",
hostname);
_cupsLangPuts(stderr,
_("INFO: Unable to contact printer, queuing on next "
"printer in class...\n"));
httpAddrFreeList(addrlist);
@@ -763,23 +819,20 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
{
if (contimeout && (time(NULL) - start_time) > contimeout)
{
fputs("ERROR: Printer not responding!\n", stderr);
_cupsLangPuts(stderr, _("ERROR: Printer not responding!\n"));
return (CUPS_BACKEND_FAILED);
}
#ifdef __APPLE__
recoverable = 1;
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);
_cupsLangPrintf(stderr,
_("WARNING: recoverable: Network host \'%s\' is busy; "
"will retry in %d seconds...\n"), hostname, delay);
sleep(delay);
if (delay < 30)
delay += 5;
}
else if (error == EADDRINUSE)
{
@@ -791,19 +844,16 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
}
else
{
#ifdef __APPLE__
recoverable = 1;
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);
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);
}
}
#ifdef __APPLE__
if (recoverable)
{
/*
@@ -815,35 +865,55 @@ 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);
fprintf(stderr, "INFO: Connected to %s...\n", hostname);
fprintf(stderr, "DEBUG: Connected on ports %d (local %d)...\n", port,
lport);
_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);
/*
* Next, open the print file and figure out its size...
*/
if (stat(filename, &filestats))
if (print_fd)
{
httpAddrFreeList(addrlist);
close(fd);
/*
* Use the size from the print file...
*/
perror("ERROR: unable to stat print file");
return (CUPS_BACKEND_FAILED);
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;
}
filestats.st_size *= manual_copies;
if ((fp = fopen(filename, "rb")) == NULL)
else
{
httpAddrFreeList(addrlist);
close(fd);
/*
* Use a "very large value" for the size so that the printer will
* keep printing until we close the connection...
*/
perror("ERROR: unable to open print file for reading");
return (CUPS_BACKEND_FAILED);
#ifdef _LARGEFILE_SOURCE
filestats.st_size = (size_t)(999999999999.0);
#else
filestats.st_size = 2147483647;
#endif /* _LARGEFILE_SOURCE */
}
/*
@@ -903,8 +973,8 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
return (CUPS_BACKEND_FAILED);
}
fprintf(stderr, "INFO: Sending control file (%u bytes)\n",
(unsigned)strlen(control));
_cupsLangPrintf(stderr, _("INFO: Sending control file (%u bytes)\n"),
(unsigned)strlen(control));
if (lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
{
@@ -917,8 +987,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
if (read(fd, &status, 1) < 1)
{
fprintf(stderr, "WARNING: Remote host did not respond with control "
"status byte after %d seconds!\n", timeout);
_cupsLangPrintf(stderr,
_("WARNING: Remote host did not respond with control "
"status byte after %d seconds!\n"), timeout);
status = errno;
}
@@ -926,10 +997,11 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
}
if (status != 0)
fprintf(stderr, "ERROR: Remote host did not accept control file (%d)\n",
status);
_cupsLangPrintf(stderr,
_("ERROR: Remote host did not accept control file "
"(%d)\n"), status);
else
fputs("INFO: Control file sent successfully\n", stderr);
_cupsLangPuts(stderr, _("INFO: Control file sent successfully\n"));
}
else
status = 0;
@@ -950,18 +1022,24 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
return (CUPS_BACKEND_FAILED);
}
fprintf(stderr, "INFO: Sending data file (" CUPS_LLFMT " bytes)\n",
CUPS_LLCAST filestats.st_size);
_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);
tbytes = 0;
for (copy = 0; copy < manual_copies; copy ++)
{
rewind(fp);
lseek(print_fd, 0, SEEK_SET);
while ((nbytes = fread(buffer, 1, sizeof(buffer), fp)) > 0)
while ((nbytes = read(print_fd, buffer, sizeof(buffer))) > 0)
{
fprintf(stderr, "INFO: Spooling LPR job, %.0f%% complete...\n",
100.0 * tbytes / filestats.st_size);
_cupsLangPrintf(stderr,
_("INFO: Spooling LPR job, %.0f%% complete...\n"),
100.0 * tbytes / filestats.st_size);
if (lpd_write(fd, buffer, nbytes) < nbytes)
{
@@ -973,39 +1051,46 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
}
}
if (tbytes < filestats.st_size)
status = errno;
else if (lpd_write(fd, "", 1) < 1)
if (mode == MODE_STANDARD)
{
perror("ERROR: Unable to send trailing nul to printer");
status = errno;
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);
}
}
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)
{
fprintf(stderr, "WARNING: Remote host did not respond with data "
"status byte after %d seconds!\n", timeout);
status = 0;
}
alarm(0);
}
status = 0;
if (status != 0)
fprintf(stderr, "ERROR: Remote host did not accept data file (%d)\n",
status);
_cupsLangPrintf(stderr,
_("ERROR: Remote host did not accept data file (%d)\n"),
status);
else
fputs("INFO: Data file sent successfully\n", stderr);
_cupsLangPuts(stderr, _("INFO: Data file sent successfully\n"));
}
if (status == 0 && order == ORDER_DATA_CONTROL)
@@ -1019,8 +1104,8 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
return (CUPS_BACKEND_FAILED);
}
fprintf(stderr, "INFO: Sending control file (%lu bytes)\n",
(unsigned long)strlen(control));
_cupsLangPrintf(stderr, _("INFO: Sending control file (%lu bytes)\n"),
(unsigned long)strlen(control));
if (lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
{
@@ -1033,8 +1118,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
if (read(fd, &status, 1) < 1)
{
fprintf(stderr, "WARNING: Remote host did not respond with control "
"status byte after %d seconds!\n", timeout);
_cupsLangPrintf(stderr,
_("WARNING: Remote host did not respond with control "
"status byte after %d seconds!\n"), timeout);
status = errno;
}
@@ -1042,10 +1128,11 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
}
if (status != 0)
fprintf(stderr, "ERROR: Remote host did not accept control file (%d)\n",
status);
_cupsLangPrintf(stderr,
_("ERROR: Remote host did not accept control file "
"(%d)\n"), status);
else
fputs("INFO: Control file sent successfully\n", stderr);
_cupsLangPuts(stderr, _("INFO: Control file sent successfully\n"));
}
/*
@@ -1053,7 +1140,6 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
*/
close(fd);
fclose(fp);
if (status == 0)
{
+1689
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+149 -215
Ver Arquivo
@@ -3,23 +3,14 @@
*
* Parallel port backend for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" 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
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
@@ -27,20 +18,14 @@
*
* main() - Send a file to the specified parallel port.
* list_devices() - List all parallel devices.
* side_cb() - Handle side-channel requests...
*/
/*
* Include necessary headers.
*/
#include <cups/backend.h>
#include <cups/cups.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <cups/string.h>
#include <signal.h>
#include "ieee1284.c"
#include "backend-private.h"
#ifdef __hpux
# include <sys/time.h>
@@ -73,7 +58,8 @@
* Local functions...
*/
void list_devices(void);
static void list_devices(void);
static void side_cb(int print_fd, int device_fd, int use_bc);
/*
@@ -94,25 +80,15 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
resource[1024], /* Resource info (device and options) */
*options; /* Pointer to options */
int port; /* Port number (not used) */
int fp; /* Print file */
int print_fd, /* Print file */
device_fd, /* Parallel device */
use_bc; /* Read back-channel data? */
int copies; /* Number of copies to print */
int fd; /* Parallel device */
int rbytes; /* Number of bytes read */
int wbytes; /* Number of bytes written */
size_t nbytes, /* Number of bytes read */
tbytes; /* Total number of bytes written */
char buffer[8192], /* Output buffer */
*bufptr; /* Pointer into buffer */
size_t tbytes; /* Total number of bytes written */
struct termios opts; /* Parallel port options */
fd_set input, /* Input set for select() */
output; /* Output set for select() */
int paperout; /* Paper out? */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
#ifdef __linux
unsigned int status; /* Port status (off-line, out-of-paper, etc.) */
#endif /* __linux */
/*
@@ -146,7 +122,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
else if (argc < 6 || argc > 7)
{
fputs("Usage: parallel job-id user title copies options [file]\n", stderr);
_cupsLangPrintf(stderr,
_("Usage: %s job-id user title copies options [file]\n"),
argv[0]);
return (CUPS_BACKEND_FAILED);
}
@@ -157,8 +135,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (argc == 6)
{
fp = 0;
copies = 1;
print_fd = 0;
copies = 1;
}
else
{
@@ -166,7 +144,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Try to open the print file...
*/
if ((fp = open(argv[6], O_RDONLY)) < 0)
if ((print_fd = open(argv[6], O_RDONLY)) < 0)
{
perror("ERROR: unable to open print file");
return (CUPS_BACKEND_FAILED);
@@ -206,7 +184,26 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
do
{
if ((fd = open(resource, O_WRONLY | O_EXCL)) == -1)
#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 (getenv("CLASS") != NULL)
{
@@ -217,8 +214,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* available printer in the class.
*/
fputs("INFO: Unable to open parallel port, queuing on next printer in class...\n",
stderr);
_cupsLangPuts(stderr,
_("INFO: Unable to contact printer, queuing on next "
"printer in class...\n"));
/*
* Sleep 5 seconds to keep the job from requeuing too rapidly...
@@ -231,23 +229,27 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (errno == EBUSY)
{
fputs("INFO: Parallel port busy; will retry in 30 seconds...\n", stderr);
_cupsLangPuts(stderr,
_("INFO: Printer busy; will retry in 30 seconds...\n"));
sleep(30);
}
else if (errno == ENXIO || errno == EIO || errno == ENOENT)
{
fputs("INFO: Printer not connected; will retry in 30 seconds...\n", stderr);
_cupsLangPuts(stderr,
_("INFO: Printer not connected; will retry in 30 "
"seconds...\n"));
sleep(30);
}
else
{
fprintf(stderr, "ERROR: Unable to open parallel port device file \"%s\": %s\n",
resource, strerror(errno));
_cupsLangPrintf(stderr,
_("ERROR: Unable to open device file \"%s\": %s\n"),
resource, strerror(errno));
return (CUPS_BACKEND_FAILED);
}
}
}
while (fd < 0);
while (device_fd < 0);
fputs("STATE: -connecting-to-device\n", stderr);
@@ -255,189 +257,52 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Set any options provided...
*/
tcgetattr(fd, &opts);
tcgetattr(device_fd, &opts);
opts.c_lflag &= ~(ICANON | ECHO | ISIG); /* Raw mode */
/**** No options supported yet ****/
tcsetattr(fd, TCSANOW, &opts);
/*
* Check printer status...
*/
paperout = 0;
#if defined(__linux) && defined(LP_POUTPA)
/*
* Show the printer status before we send the file...
*/
while (!ioctl(fd, LPGETSTATUS, &status))
{
fprintf(stderr, "DEBUG: LPGETSTATUS returned a port status of %02X...\n", status);
if (status & LP_POUTPA)
{
fputs("WARNING: Media tray empty!\n", stderr);
fputs("STATUS: +media-tray-empty-error\n", stderr);
paperout = 1;
}
if (!(status & LP_PERRORP))
fputs("WARNING: Printer fault!\n", stderr);
else if (!(status & LP_PSELECD))
fputs("WARNING: Printer off-line.\n", stderr);
else
break;
sleep(5);
}
#endif /* __linux && LP_POUTPA */
/*
* 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 */
}
tcsetattr(device_fd, TCSANOW, &opts);
/*
* Finally, send the print file...
*/
wbytes = 0;
tbytes = 0;
while (copies > 0)
while (copies > 0 && tbytes >= 0)
{
copies --;
if (fp != 0)
if (print_fd != 0)
{
fputs("PAGE: 1 1\n", stderr);
lseek(fp, 0, SEEK_SET);
lseek(print_fd, 0, SEEK_SET);
}
tbytes = 0;
while ((nbytes = read(fp, buffer, sizeof(buffer))) > 0)
{
/*
* Write the print data to the printer...
*/
tbytes = backendRunLoop(print_fd, device_fd, use_bc, side_cb);
tbytes += nbytes;
bufptr = buffer;
while (nbytes > 0)
{
/*
* See if we are ready to read or write...
*/
do
{
FD_ZERO(&input);
FD_SET(fd, &input);
FD_ZERO(&output);
FD_SET(fd, &output);
}
while (select(fd + 1, &input, &output, NULL, NULL) < 0);
if (FD_ISSET(fd, &input))
{
/*
* Read backchannel data...
*/
if ((rbytes = read(fd, resource, sizeof(resource))) > 0)
{
fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
rbytes);
cupsBackChannelWrite(resource, rbytes, 1.0);
}
}
if (FD_ISSET(fd, &output))
{
/*
* Write print data...
*/
if ((wbytes = write(fd, bufptr, nbytes)) < 0)
if (errno == ENOTTY)
wbytes = write(fd, bufptr, nbytes);
if (wbytes < 0)
{
/*
* Check for retryable errors...
*/
if (errno == ENOSPC)
{
paperout = 1;
fputs("ERROR: Out of paper!\n", stderr);
fputs("STATUS: +media-tray-empty-error\n", stderr);
}
else if (errno != EAGAIN && errno != EINTR)
{
perror("ERROR: Unable to send print file to printer");
break;
}
}
else
{
/*
* Update count and pointer...
*/
if (paperout)
{
fputs("STATUS: -media-tray-empty-error\n", stderr);
paperout = 0;
}
nbytes -= wbytes;
bufptr += wbytes;
}
}
}
if (wbytes < 0)
break;
if (argc > 6)
fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
(unsigned long)tbytes);
}
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);
}
/*
* Close the socket connection and input file and return...
*/
close(fd);
if (fp != 0)
close(fp);
close(device_fd);
return (wbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
if (print_fd != 0)
close(print_fd);
return (tbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
}
@@ -445,7 +310,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* 'list_devices()' - List all parallel devices.
*/
void
static void
list_devices(void)
{
#if defined(__hpux) || defined(__sgi) || defined(__sun)
@@ -459,15 +324,14 @@ list_devices(void)
char device[255], /* Device filename */
basedevice[255], /* Base device filename for ports */
device_id[1024], /* Device ID string */
make_model[1024]; /* Make and model */
make_model[1024], /* Make and model */
uri[1024]; /* Device URI */
if (!access("/dev/parallel/", 0))
strcpy(basedevice, "/dev/parallel/");
else if (!access("/dev/printers/", 0))
strcpy(basedevice, "/dev/printers/");
else if (!access("/dev/par0", 0))
strcpy(basedevice, "/dev/par");
else
strcpy(basedevice, "/dev/lp");
@@ -487,13 +351,15 @@ list_devices(void)
* Now grab the IEEE 1284 device ID string...
*/
if (!get_device_id(fd, device_id, sizeof(device_id),
make_model, sizeof(make_model),
NULL, NULL, 0))
printf("direct parallel:%s \"%s\" \"%s LPT #%d\" \"%s\"\n", device,
snprintf(uri, sizeof(uri), "parallel:%s", device);
if (!backendGetDeviceID(fd, device_id, sizeof(device_id),
make_model, sizeof(make_model),
NULL, uri, sizeof(uri)))
printf("direct %s \"%s\" \"%s LPT #%d\" \"%s\"\n", uri,
make_model, make_model, i + 1, device_id);
else
printf("direct parallel:%s \"Unknown\" \"LPT #%d\"\n", device, i + 1);
printf("direct %s \"Unknown\" \"LPT #%d\"\n", uri, i + 1);
close(fd);
}
@@ -736,6 +602,74 @@ 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 :
status = CUPS_SC_STATUS_OK;
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$".
*/
+392
Ver Arquivo
@@ -0,0 +1,392 @@
/*
* "$Id$"
*
* Common run loop APIs for the Common UNIX Printing System (CUPS).
*
* Copyright 2007-2008 by Apple Inc.
* Copyright 2006-2007 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"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "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.
*/
/*
* Include necessary headers.
*/
#include "backend-private.h"
#ifdef __hpux
# include <sys/time.h>
#else
# include <sys/select.h>
#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 */
{
int nfds; /* Maximum file descriptor value + 1 */
fd_set input, /* Input set for reading */
output; /* Output set for writing */
ssize_t print_bytes, /* Print bytes read */
bc_bytes, /* Backchannel bytes read */
total_bytes, /* Total bytes written */
bytes; /* Bytes written */
int paperout; /* "Paper out" status */
int offline; /* "Off-line" status */
char print_buffer[8192], /* Print data buffer */
*print_ptr, /* Pointer into print data buffer */
bc_buffer[1024]; /* Back-channel data buffer */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#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);
/*
* If we are printing data from a print driver on stdin, ignore SIGTERM
* so that the driver can finish out any page data, e.g. to eject the
* current page. We only do this for stdin printing as otherwise there
* is no way to cancel a raw print job...
*/
if (!print_fd)
{
#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 */
}
/*
* 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 (print_bytes = 0, print_ptr = print_buffer, offline = -1,
paperout = -1, total_bytes = 0;;)
{
/*
* Use select() to determine whether we have data to copy around...
*/
FD_ZERO(&input);
if (!print_bytes)
FD_SET(print_fd, &input);
if (use_bc)
FD_SET(device_fd, &input);
if (!print_bytes && side_cb)
FD_SET(CUPS_SC_FD, &input);
FD_ZERO(&output);
if (print_bytes || (!use_bc && !side_cb))
FD_SET(device_fd, &output);
if (use_bc || side_cb)
{
if (select(nfds, &input, &output, NULL, NULL) < 0)
{
/*
* Pause printing to clear any pending errors...
*/
if (errno == ENXIO && offline != 1)
{
fputs("STATE: +offline-error\n", stderr);
_cupsLangPuts(stderr, _("INFO: Printer is currently off-line.\n"));
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))
{
/*
* Do the side-channel request, then start back over in the select
* loop since it may have read from print_fd...
*/
(*side_cb)(print_fd, device_fd, use_bc);
continue;
}
/*
* Check if we have back-channel data ready...
*/
if (FD_ISSET(device_fd, &input))
{
if ((bc_bytes = read(device_fd, bc_buffer, sizeof(bc_buffer))) > 0)
{
fprintf(stderr,
"DEBUG: Received " CUPS_LLFMT " bytes of back-channel data!\n",
CUPS_LLCAST bc_bytes);
cupsBackChannelWrite(bc_buffer, bc_bytes, 1.0);
}
else if (bc_bytes < 0 && errno != EAGAIN && errno != EINTR)
{
fprintf(stderr, "DEBUG: Error reading back-channel data: %s\n",
strerror(errno));
use_bc = 0;
}
}
/*
* Check if we have print data ready...
*/
if (FD_ISSET(print_fd, &input))
{
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, break out of the loop...
*/
break;
}
print_ptr = print_buffer;
fprintf(stderr, "DEBUG: Read %d bytes of print data...\n",
(int)print_bytes);
}
/*
* Check if the device is ready to receive data and we have data to
* send...
*/
if (print_bytes && FD_ISSET(device_fd, &output))
{
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)
{
if (paperout != 1)
{
fputs("STATE: +media-empty-error\n", stderr);
_cupsLangPuts(stderr, _("ERROR: Out of paper!\n"));
paperout = 1;
}
}
else if (errno == ENXIO)
{
if (offline != 1)
{
fputs("STATE: +offline-error\n", stderr);
_cupsLangPuts(stderr, _("INFO: Printer is currently off-line.\n"));
offline = 1;
}
}
else if (errno != EAGAIN && errno != EINTR && errno != ENOTTY)
{
fprintf(stderr, _("ERROR: Unable to write print data: %s\n"),
strerror(errno));
return (-1);
}
}
else
{
if (paperout)
{
fputs("STATE: -media-empty-error\n", stderr);
paperout = 0;
}
if (offline)
{
fputs("STATE: -offline-error\n", stderr);
_cupsLangPuts(stderr, _("INFO: Printer is now on-line.\n"));
offline = 0;
}
fprintf(stderr, "DEBUG: Wrote %d bytes of print data...\n", (int)bytes);
print_bytes -= bytes;
print_ptr += bytes;
total_bytes += bytes;
}
}
}
/*
* Return with success...
*/
return (total_bytes);
}
/*
* End of "$Id$".
*/
+16 -11
Ver Arquivo
@@ -3,6 +3,7 @@
*
* 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
@@ -95,7 +96,8 @@ print_device(const char *resource, /* I - SCSI device */
if (strncmp(resource, "/dev/scsi/", 10) != 0)
{
fprintf(stderr, "ERROR: Bad SCSI device file \"%s\"!\n", resource);
_cupsLangPrintf(stderr, _("ERROR: Bad SCSI device file \"%s\"!\n"),
resource);
return (CUPS_BACKEND_STOP);
}
@@ -118,8 +120,9 @@ print_device(const char *resource, /* I - SCSI device */
* available printer in the class.
*/
fputs("INFO: Unable to open SCSI device, queuing on next printer in class...\n",
stderr);
_cupsLangPuts(stderr,
_("INFO: Unable to contact printer, queuing on next "
"printer in class...\n"));
/*
* Sleep 5 seconds to keep the job from requeuing too rapidly...
@@ -132,14 +135,15 @@ print_device(const char *resource, /* I - SCSI device */
if (errno != EAGAIN && errno != EBUSY)
{
fprintf(stderr, "ERROR: Unable to open SCSI device \"%s\" - %s\n",
resource, strerror(errno));
_cupsLangPrintf(stderr,
_("ERROR: Unable to open device file \"%s\": %s\n"),
resource, strerror(errno));
return (CUPS_BACKEND_FAILED);
}
else
{
fprintf(stderr, "INFO: SCSI device \"%s\" busy; retrying...\n",
resource);
_cupsLangPuts(stderr,
_("INFO: Printer busy; will retry in 30 seconds...\n"));
sleep(30);
}
}
@@ -201,8 +205,9 @@ print_device(const char *resource, /* I - SCSI device */
if (ioctl(scsi_fd, DS_ENTER, &scsi_req) < 0 ||
scsi_req.ds_status != 0)
{
fprintf(stderr, "WARNING: SCSI command timed out (%d); retrying...\n",
scsi_req.ds_status);
_cupsLangPrintf(stderr,
_("WARNING: SCSI command timed out (%d); "
"retrying...\n"), scsi_req.ds_status);
sleep(try + 1);
}
else
@@ -210,8 +215,8 @@ print_device(const char *resource, /* I - SCSI device */
if (try >= 10)
{
fprintf(stderr, "ERROR: Unable to send print data (%d)\n",
scsi_req.ds_status);
_cupsLangPrintf(stderr, _("ERROR: Unable to send print data (%d)\n"),
scsi_req.ds_status);
close(scsi_fd);
return (CUPS_BACKEND_FAILED);
}
+17 -11
Ver Arquivo
@@ -3,6 +3,7 @@
*
* 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
@@ -55,6 +56,7 @@
*/
#include <scsi/sg.h>
#include <cups/i18n.h>
/*
@@ -108,7 +110,8 @@ print_device(const char *resource, /* I - SCSI device */
if (strncmp(resource, "/dev/sg", 7) != 0)
{
fprintf(stderr, "ERROR: Bad SCSI device file \"%s\"!\n", resource);
_cupsLangPrintf(stderr, _("ERROR: Bad SCSI device file \"%s\"!\n"),
resource);
return (CUPS_BACKEND_STOP);
}
@@ -131,8 +134,9 @@ print_device(const char *resource, /* I - SCSI device */
* available printer in the class.
*/
fputs("INFO: Unable to open SCSI device, queuing on next printer in class...\n",
stderr);
_cupsLangPuts(stderr,
_("INFO: Unable to contact printer, queuing on next "
"printer in class...\n"));
/*
* Sleep 5 seconds to keep the job from requeuing too rapidly...
@@ -145,14 +149,15 @@ print_device(const char *resource, /* I - SCSI device */
if (errno != EAGAIN && errno != EBUSY)
{
fprintf(stderr, "ERROR: Unable to open SCSI device \"%s\" - %s\n",
resource, strerror(errno));
_cupsLangPrintf(stderr,
_("ERROR: Unable to open device file \"%s\": %s\n"),
resource, strerror(errno));
return (CUPS_BACKEND_FAILED);
}
else
{
fprintf(stderr, "INFO: SCSI device \"%s\" busy; retrying...\n",
resource);
_cupsLangPuts(stderr,
_("INFO: Printer busy; will retry in 30 seconds...\n"));
sleep(30);
}
}
@@ -218,8 +223,9 @@ print_device(const char *resource, /* I - SCSI device */
if (ioctl(scsi_fd, SG_IO, &scsi_req) < 0 ||
scsi_req.status != 0)
{
fprintf(stderr, "WARNING: SCSI command timed out (%d); retrying...\n",
scsi_req.status);
_cupsLangPrintf(stderr,
_("WARNING: SCSI command timed out (%d); "
"retrying...\n"), scsi_req.status);
sleep(try + 1);
}
else
@@ -227,8 +233,8 @@ print_device(const char *resource, /* I - SCSI device */
if (try >= 10)
{
fprintf(stderr, "ERROR: Unable to send print data (%d)\n",
scsi_req.status);
_cupsLangPrintf(stderr, _("ERROR: Unable to send print data (%d)\n"),
scsi_req.status);
close(scsi_fd);
return (CUPS_BACKEND_FAILED);
}
+8 -3
Ver Arquivo
@@ -3,6 +3,7 @@
*
* 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
@@ -55,10 +56,12 @@
#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
@@ -80,7 +83,7 @@ void list_devices(void);
int print_device(const char *resource, int fd, int copies);
#ifdef __linux__
#if defined(__linux__) && defined(HAVE_SCSI_SG_H)
# include "scsi-linux.c"
#elif defined(__sgi)
# include "scsi-irix.c"
@@ -90,7 +93,7 @@ int print_device(const char *resource, int fd, int copies);
*/
void list_devices(void) {}
int print_device(const char *resource, int fd, int copies) { return (CUPS_BACKEND_FAILED); }
#endif /* __linux */
#endif /* __linux && HAVE_SCSI_SG_H */
/*
@@ -150,7 +153,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
else if (argc < 6 || argc > 7)
{
fputs("Usage: scsi:/dev/file job-id user title copies options [file]\n", stderr);
_cupsLangPrintf(stderr,
_("Usage: %s job-id user title copies options [file]\n"),
argv[0]);
return (CUPS_BACKEND_FAILED);
}
+348 -186
Ver Arquivo
@@ -3,23 +3,14 @@
*
* Serial port backend for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" 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
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
@@ -27,19 +18,14 @@
*
* main() - Send a file to the printer or server.
* list_devices() - List all serial devices.
* side_cb() - Handle side-channel requests...
*/
/*
* Include necessary headers.
*/
#include <cups/backend.h>
#include <cups/cups.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <cups/string.h>
#include <signal.h>
#include "backend-private.h"
#ifdef __hpux
# include <sys/modem.h>
@@ -87,12 +73,18 @@
# include <IOKit/IOBSD.h>
#endif /* __APPLE__ */
#if defined(__linux) && defined(TIOCGSERIAL)
# include <linux/serial.h>
# include <linux/ioctl.h>
#endif /* __linux && TIOCGSERIAL */
/*
* Local functions...
*/
void list_devices(void);
static void list_devices(void);
static void side_cb(int print_fd, int device_fd, int use_bc);
/*
@@ -112,25 +104,27 @@ 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[255], /* Name of option */
value[255], /* Value of option */
*ptr; /* Pointer into name or value */
*name, /* Name of option */
*value, /* Value of option */
sep; /* Option separator */
int port; /* Port number (not used) */
int fp; /* Print file */
int copies; /* Number of copies to print */
int fd; /* Parallel device */
int rbytes; /* Number of bytes read */
int wbytes; /* Number of bytes written */
size_t nbytes, /* Number of bytes read */
tbytes; /* Total number of bytes written */
int print_fd, /* Print file */
device_fd; /* Serial device */
int nfds; /* Maximum file descriptor value + 1 */
fd_set input, /* Input set for reading */
output; /* Output set for writing */
ssize_t print_bytes, /* Print bytes read */
bc_bytes, /* Backchannel bytes read */
total_bytes, /* Total bytes written */
bytes; /* Bytes written */
int dtrdsr; /* Do dtr/dsr flow control? */
int bufsize; /* Size of output buffer for writes */
char buffer[8192], /* Output buffer */
*bufptr; /* Pointer into buffer */
int print_size; /* Size of output buffer for writes */
char print_buffer[8192], /* Print data buffer */
*print_ptr, /* Pointer into print data buffer */
bc_buffer[1024]; /* Back-channel data buffer */
struct termios opts; /* Serial port options */
struct termios origopts; /* Original port options */
fd_set input, /* Input set for select() */
output; /* Output set for select() */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
@@ -167,7 +161,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
else if (argc < 6 || argc > 7)
{
fputs("Usage: serial job-id user title copies options [file]\n", stderr);
_cupsLangPrintf(stderr,
_("Usage: %s job-id user title copies options [file]\n"),
argv[0]);
return (CUPS_BACKEND_FAILED);
}
@@ -178,8 +174,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (argc == 6)
{
fp = 0;
copies = 1;
print_fd = 0;
copies = 1;
}
else
{
@@ -187,7 +183,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Try to open the print file...
*/
if ((fp = open(argv[6], O_RDONLY)) < 0)
if ((print_fd = open(argv[6], O_RDONLY)) < 0)
{
perror("ERROR: unable to open print file");
return (CUPS_BACKEND_FAILED);
@@ -227,7 +223,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
do
{
if ((fd = open(resource, O_WRONLY | O_NOCTTY | O_EXCL | O_NDELAY)) == -1)
if ((device_fd = open(resource, O_RDWR | O_NOCTTY | O_EXCL |
O_NDELAY)) == -1)
{
if (getenv("CLASS") != NULL)
{
@@ -238,8 +235,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* available printer in the class.
*/
fputs("INFO: Unable to open serial port, queuing on next printer in class...\n",
stderr);
_cupsLangPuts(stderr,
_("INFO: Unable to contact printer, queuing on next "
"printer in class...\n"));
/*
* Sleep 5 seconds to keep the job from requeuing too rapidly...
@@ -252,18 +250,20 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (errno == EBUSY)
{
fputs("INFO: Serial port busy; will retry in 30 seconds...\n", stderr);
_cupsLangPuts(stderr,
_("INFO: Printer busy; will retry in 30 seconds...\n"));
sleep(30);
}
else
{
fprintf(stderr, "ERROR: Unable to open serial port device file \"%s\": %s\n",
resource, strerror(errno));
_cupsLangPrintf(stderr,
_("ERROR: Unable to open device file \"%s\": %s\n"),
resource, strerror(errno));
return (CUPS_BACKEND_FAILED);
}
}
}
while (fd < 0);
while (device_fd < 0);
fputs("STATE: -connecting-to-device\n", stderr);
@@ -271,45 +271,48 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Set any options provided...
*/
tcgetattr(fd, &origopts);
tcgetattr(fd, &opts);
tcgetattr(device_fd, &origopts);
tcgetattr(device_fd, &opts);
opts.c_lflag &= ~(ICANON | ECHO | ISIG); /* Raw mode */
opts.c_oflag &= ~OPOST; /* Don't post-process */
opts.c_lflag &= ~(ICANON | ECHO | ISIG);
/* Raw mode */
opts.c_oflag &= ~OPOST; /* Don't post-process */
bufsize = 96; /* 9600 baud / 10 bits/char / 10Hz */
dtrdsr = 0; /* No dtr/dsr flow control */
print_size = 96; /* 9600 baud / 10 bits/char / 10Hz */
dtrdsr = 0; /* No dtr/dsr flow control */
if (options != NULL)
if (options)
{
while (*options)
{
/*
* Get the name...
*/
for (ptr = name; *options && *options != '=';)
if (ptr < (name + sizeof(name) - 1))
*ptr++ = *options++;
*ptr = '\0';
name = options;
if (*options == '=')
while (*options && *options != '=' && *options != '+' && *options != '&')
options ++;
if ((sep = *options) != '\0')
*options++ = '\0';
if (sep == '=')
{
/*
* Get the value...
*/
options ++;
value = options;
for (ptr = value; *options && *options != '+' && *options != '&';)
if (ptr < (value + sizeof(value) - 1))
*ptr++ = *options++;
*ptr = '\0';
if (*options == '+')
while (*options && *options != '+' && *options != '&')
options ++;
if (*options)
*options++ = '\0';
}
else
value[0] = '\0';
value = (char *)"";
/*
* Process the option...
@@ -321,7 +324,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Set the baud rate...
*/
bufsize = atoi(value) / 100;
print_size = atoi(value) / 100;
#if B19200 == 19200
cfsetispeed(&opts, atoi(value));
@@ -372,7 +375,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
break;
# endif /* B230400 */
default :
fprintf(stderr, "WARNING: Unsupported baud rate %s!\n", value);
_cupsLangPrintf(stderr, _("WARNING: Unsupported baud rate %s!\n"),
value);
break;
}
#endif /* B19200 == 19200 */
@@ -483,9 +487,10 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
}
}
}
tcsetattr(fd, TCSANOW, &opts);
fcntl(fd, F_SETFL, 0);
tcsetattr(device_fd, TCSANOW, &opts);
fcntl(device_fd, F_SETFL, 0);
/*
* Now that we are "connected" to the port, ignore SIGTERM so that we
@@ -494,7 +499,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* stdin (otherwise you can't cancel raw jobs...)
*/
if (argc < 7)
if (print_fd != 0)
{
#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
sigset(SIGTERM, SIG_IGN);
@@ -510,133 +515,198 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
/*
* Finally, send the print file...
* Figure out the maximum file descriptor value to use with select()...
*/
if (bufsize > sizeof(buffer))
bufsize = sizeof(buffer);
nfds = (print_fd > device_fd ? print_fd : device_fd) + 1;
wbytes = 0;
/*
* Finally, send the print file. Ordinarily we would just use the
* backendRunLoop() function, however since we need to use smaller
* writes and may need to do DSR/DTR flow control, we duplicate much
* of the code here instead...
*/
if (print_size > sizeof(print_buffer))
print_size = sizeof(print_buffer);
total_bytes = 0;
while (copies > 0)
{
copies --;
if (fp != 0)
if (print_fd != 0)
{
fputs("PAGE: 1 1\n", stderr);
lseek(fp, 0, SEEK_SET);
lseek(print_fd, 0, SEEK_SET);
}
if (dtrdsr)
/*
* Now loop until we are out of data from print_fd...
*/
for (print_bytes = 0, print_ptr = print_buffer;;)
{
/*
* Check the port and sleep until DSR is set...
* Use select() to determine whether we have data to copy around...
*/
int status;
FD_ZERO(&input);
if (!print_bytes)
FD_SET(print_fd, &input);
FD_SET(device_fd, &input);
if (!print_bytes)
FD_SET(CUPS_SC_FD, &input);
FD_ZERO(&output);
if (print_bytes)
FD_SET(device_fd, &output);
if (!ioctl(fd, TIOCMGET, &status))
if (!(status & TIOCM_DSR))
{
/*
* Wait for DSR to go high...
*/
if (select(nfds, &input, &output, NULL, NULL) < 0)
continue; /* Ignore errors here */
fputs("DEBUG: DSR is low; waiting for device...\n", stderr);
do
{
sleep(1);
if (ioctl(fd, TIOCMGET, &status))
break;
}
while (!(status & TIOCM_DSR));
fputs("DEBUG: DSR is high; writing to device...\n", stderr);
}
}
tbytes = 0;
while ((nbytes = read(fp, buffer, bufsize)) > 0)
{
/*
* Write the print data to the printer...
* Check if we have a side-channel request ready...
*/
tbytes += nbytes;
bufptr = buffer;
while (nbytes > 0)
if (FD_ISSET(CUPS_SC_FD, &input))
{
/*
* See if we are ready to read or write...
* Do the side-channel request, then start back over in the select
* loop since it may have read from print_fd...
*/
do
side_cb(print_fd, device_fd, 1);
continue;
}
/*
* Check if we have back-channel data ready...
*/
if (FD_ISSET(device_fd, &input))
{
if ((bc_bytes = read(device_fd, bc_buffer, sizeof(bc_buffer))) > 0)
{
FD_ZERO(&input);
FD_SET(fd, &input);
FD_ZERO(&output);
FD_SET(fd, &output);
}
while (select(fd + 1, &input, &output, NULL, NULL) < 0);
if (FD_ISSET(fd, &input))
{
/*
* Read backchannel data...
*/
if ((rbytes = read(fd, resource, sizeof(resource))) > 0)
{
fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
rbytes);
cupsBackChannelWrite(resource, rbytes, 1.0);
}
}
if (FD_ISSET(fd, &output))
{
/*
* Write print data...
*/
if ((wbytes = write(fd, bufptr, nbytes)) < 0)
if (errno == ENOTTY)
wbytes = write(fd, bufptr, nbytes);
if (wbytes < 0)
{
/*
* Check for retryable errors...
*/
if (errno != EAGAIN && errno != EINTR)
{
perror("ERROR: Unable to send print file to printer");
break;
}
}
else
{
/*
* Update count and pointer...
*/
nbytes -= wbytes;
bufptr += wbytes;
}
fprintf(stderr,
"DEBUG: Received " CUPS_LLFMT " bytes of back-channel data!\n",
CUPS_LLCAST bc_bytes);
cupsBackChannelWrite(bc_buffer, bc_bytes, 1.0);
}
}
if (wbytes < 0)
break;
/*
* Check if we have print data ready...
*/
if (argc > 6)
fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
(unsigned long)tbytes);
if (FD_ISSET(print_fd, &input))
{
if ((print_bytes = read(print_fd, print_buffer, print_size)) < 0)
{
/*
* Read error - bail if we don't see EAGAIN or EINTR...
*/
if (errno != EAGAIN || errno != EINTR)
{
perror("ERROR: Unable to read print data");
tcsetattr(device_fd, TCSADRAIN, &origopts);
close(device_fd);
if (print_fd != 0)
close(print_fd);
return (CUPS_BACKEND_FAILED);
}
print_bytes = 0;
}
else if (print_bytes == 0)
{
/*
* End of file, break out of the loop...
*/
break;
}
print_ptr = print_buffer;
}
/*
* Check if the device is ready to receive data and we have data to
* send...
*/
if (print_bytes && FD_ISSET(device_fd, &output))
{
if (dtrdsr)
{
/*
* Check the port and sleep until DSR is set...
*/
int status;
if (!ioctl(device_fd, TIOCMGET, &status))
if (!(status & TIOCM_DSR))
{
/*
* Wait for DSR to go high...
*/
fputs("DEBUG: DSR is low; waiting for device...\n", stderr);
do
{
/*
* Poll every 100ms...
*/
usleep(100000);
if (ioctl(device_fd, TIOCMGET, &status))
break;
}
while (!(status & TIOCM_DSR));
fputs("DEBUG: DSR is high; writing to device...\n", stderr);
}
}
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 != EAGAIN && errno != EINTR && errno != ENOTTY)
{
perror("ERROR: Unable to write print data");
tcsetattr(device_fd, TCSADRAIN, &origopts);
close(device_fd);
if (print_fd != 0)
close(print_fd);
return (CUPS_BACKEND_FAILED);
}
}
else
{
fprintf(stderr, "DEBUG: Wrote %d bytes...\n", (int)bytes);
print_bytes -= bytes;
print_ptr += bytes;
total_bytes += bytes;
}
}
}
}
@@ -644,13 +714,14 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Close the serial port and input file and return...
*/
tcsetattr(fd, TCSADRAIN, &origopts);
tcsetattr(device_fd, TCSADRAIN, &origopts);
close(fd);
if (fp != 0)
close(fp);
close(device_fd);
return (wbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
if (print_fd != 0)
close(print_fd);
return (total_bytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
}
@@ -658,26 +729,53 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* 'list_devices()' - List all serial devices.
*/
void
static void
list_devices(void)
{
#if defined(__hpux) || defined(__sgi) || defined(__sun) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
static char *funky_hex = "0123456789abcdefghijklmnopqrstuvwxyz";
/* Funky hex numbering used for some devices */
/* Funky hex numbering used for some *
* devices */
#endif /* __hpux || __sgi || __sun || __FreeBSD__ || __OpenBSD__ */
#if defined(__linux) || defined(linux) || defined(__linux__)
int i, j; /* Looping vars */
int fd; /* File descriptor */
char device[255]; /* Device filename */
#ifdef __linux
int i, j; /* Looping vars */
int fd; /* File descriptor */
char device[255]; /* Device filename */
# ifdef TIOCGSERIAL
struct serial_struct serinfo; /* serial port info */
# endif /* TIOCGSERIAL */
for (i = 0; i < 100; i ++)
{
sprintf(device, "/dev/ttyS%d", i);
if ((fd = open(device, O_WRONLY | O_NOCTTY | O_NDELAY)) >= 0)
{
# ifdef TIOCGSERIAL
/*
* See if this port exists...
*/
serinfo.reserved_char[0] = 0;
if (!ioctl(fd, TIOCGSERIAL, &serinfo))
{
if (serinfo.type == PORT_UNKNOWN)
{
/*
* Nope...
*/
close(fd);
continue;
}
}
# endif /* TIOCGSERIAL */
close(fd);
# if defined(_ARCH_PPC) || defined(powerpc) || defined(__powerpc)
printf("serial serial:%s?baud=230400 \"Unknown\" \"Serial Port #%d\"\n",
device, i + 1);
@@ -697,6 +795,14 @@ 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 ++)
@@ -824,13 +930,13 @@ list_devices(void)
{
sprintf(device, "/dev/cua/%c", 'a' + i);
if (access(device, 0) == 0)
#ifdef B115200
# ifdef B115200
printf("serial serial:%s?baud=115200 \"Unknown\" \"Serial Port #%d\"\n",
device, i + 1);
#else
# else
printf("serial serial:%s?baud=38400 \"Unknown\" \"Serial Port #%d\"\n",
device, i + 1);
#endif /* B115200 */
# endif /* B115200 */
}
/*
@@ -1063,7 +1169,6 @@ list_devices(void)
CFMutableDictionaryRef classesToMatch;
io_object_t serialService;
printf("serial serial \"Unknown\" \"Serial Printer (serial)\"\n");
kernResult = IOMasterPort(MACH_PORT_NULL, &masterPort);
if (KERN_SUCCESS != kernResult)
@@ -1117,8 +1222,8 @@ list_devices(void)
CFRelease(bsdPathAsCFString);
if (result)
printf("serial serial:%s?baud=115200 \"Unknown\" \"%s\"\n", bsdPath,
serialName);
printf("serial serial:%s?baud=115200 \"Unknown\" \"%s\"\n",
bsdPath, serialName);
}
}
}
@@ -1126,13 +1231,70 @@ list_devices(void)
IOObjectRelease(serialService);
}
IOObjectRelease(serialPortIterator); /* Release the iterator. */
/*
* Release the iterator.
*/
IOObjectRelease(serialPortIterator);
}
}
#endif
}
/*
* '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 :
status = CUPS_SC_STATUS_OK;
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$".
*/
+2276
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+172
Ver Arquivo
@@ -0,0 +1,172 @@
snmp.txt - 2006-04-19
---------------------
This file lists the "interesting" bits from the command:
snmpwalk -v 1 -c public HOST .1
for many network print servers and internal cards. It is mainly here
for SNMP documentation and development purposes.
AXIS 5600
SNMPv2-MIB::sysDescr.0 = STRING: HP ETHERNET MULTI-ENVIRONMENT,ROM J.sp.00,JETDIRECT EX,JD28,EEPROM 6.16.5
SNMPv2-MIB::sysName.0 = STRING:
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceType.2 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceType.3 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: Hewlett-Packard hp LaserJet 3380
HOST-RESOURCES-MIB::hrDeviceDescr.2 = STRING: Axis AXIS 5600
HOST-RESOURCES-MIB::hrDeviceDescr.3 = STRING: Axis AXIS 5600
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrDeviceID.2 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrDeviceID.3 = OID: SNMPv2-SMI::zeroDotZero
SNMPv2-SMI::enterprises.11.2.4.3.10.8.0 = STRING: "AXIS433AE8"
SNMPv2-SMI::enterprises.368.2.3.2.601.0 = INTEGER: 9100
SNMPv2-SMI::enterprises.368.2.3.2.602.0 = INTEGER: 9101
SNMPv2-SMI::enterprises.368.2.3.2.603.0 = INTEGER: 9102
SNMPv2-SMI::enterprises.368.2.3.10.901.0 = STRING: "AXIS433AE8"
AXIS OfficeBasic
SNMPv2-MIB::sysDescr.0 = STRING: AXIS OfficeBasic Parallel Network Print Server V6.43 Sep 4 2003
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: EPSON Stylus Photo 870
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::zeroDotZero
DLink DP-301P+
SNMPv2-MIB::sysDescr.0 = STRING: D-Link DP-301P+ Print Server
Genicom ML280
SNMPv2-MIB::sysDescr.0 = STRING: GENICOM microLaser 280
SNMPv2-MIB::sysName.0 = STRING: PRQ_004F75
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: MANUFACTURER:GENICOM;MODEL:microLaser 280;
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::enterprises.3369.1.1.2.4
EPSON Type-B Network Card
SNMPv2-MIB::sysDescr.0 = STRING: EPSON Type-B 10Base-T/100Base-TX Print Server
SNMPv2-MIB::sysName.0 = STRING: StylusPro7600-BB87A8
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: EPSON Stylus Pro 7600
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::enterprises.1248.1.2.1.22.69.109.117.108.97.116.101.83.116.121.108.117.115.32.80.114.111.32.55.54.48.48
SNMPv2-SMI::enterprises.11.2.3.9.1.1.7.0 = STRING: "MFG:EPSON;CMD:ESCPL2,BDC;MDL:Stylus Pro 7600;CLS:PRINTER;DES:EPSON Stylus Pro 7600;"
SNMPv2-SMI::enterprises.1248.1.2.2.1.1.1.1.1 = STRING: "MFG:EPSON;CMD:ESCPL2,BDC;MDL:Stylus Pro 7600;CLS:PRINTER;DES:EPSON Stylus Pro 7600;"
EPSON Wireless 802.11b Print Server
SNMPv2-MIB::sysDescr.0 = STRING: EPSON Wireless LAN Print Interface compatible with an HP JETDIRECT EX
SNMPv2-MIB::sysName.0 = STRING: EAI_0F550B
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING:
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::zeroDotZero
HP JetDirect EX3plus
SNMPv2-MIB::sysDescr.0 = STRING: HP ETHERNET MULTI-ENVIRONMENT,ROM D.04.03,JETDIRECT EX,JD26,EEPROM D.05.22
SNMPv2-MIB::sysName.0 = STRING: NPID1EC0F
HP LJ4000
SNMPv2-MIB::sysDescr.0 = STRING: HP ETHERNET MULTI-ENVIRONMENT,ROM G.05.34,JETDIRECT,JD30,EEPROM G.08.32
SNMPv2-MIB::sysName.0 = STRING:
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: HP LaserJet 4000 Series
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::enterprises.11.2.3.9.1.2.5
HP CLJ4550
SNMPv2-MIB::sysDescr.0 = STRING: HP ETHERNET MULTI-ENVIRONMENT,ROM L.20.07,JETDIRECT,JD84,EEPROM L.21.22,CIDATE 07/06/2001
SNMPv2-MIB::sysName.0 = STRING: NPI02FDE7
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: HP Color LaserJet 4550
HOST-RESOURCES-MIB::hrDeviceDescr.2 = STRING: Hewlett-Packard Dynamic RAM Disk
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::enterprises.11.2.3.9.1.2.14
Lexmark C522
SNMPv2-MIB::sysDescr.0 = STRING: Lexmark C522 version NS.NP.N212 kernel 2.6.6 All-N-1
SNMPv2-MIB::sysName.0 = STRING: ET0004000D0CCA
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceType.2 = OID: HOST-RESOURCES-TYPES::hrDeviceNonVolatileMemory
HOST-RESOURCES-MIB::hrDeviceType.3 = OID: HOST-RESOURCES-TYPES::hrDeviceProcessor
HOST-RESOURCES-MIB::hrDeviceType.4 = OID: HOST-RESOURCES-TYPES::hrDeviceSerialPort
HOST-RESOURCES-MIB::hrDeviceType.5 = OID: HOST-RESOURCES-TYPES::hrDeviceNetwork
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: Lexmark C522 9421TTV LS.FA.P129
HOST-RESOURCES-MIB::hrDeviceDescr.2 = STRING: Nonvolatile RAM
HOST-RESOURCES-MIB::hrDeviceDescr.3 = STRING: IBM 750 Rev CXr
HOST-RESOURCES-MIB::hrDeviceDescr.4 = STRING: USB Interface
HOST-RESOURCES-MIB::hrDeviceDescr.5 = STRING: Network Interface
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrDeviceID.2 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrDeviceID.3 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrDeviceID.4 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrDeviceID.5 = OID: SNMPv2-SMI::enterprises.641.1
SNMPv2-SMI::enterprises.641.2.1.2.1.2.1 = STRING: "Lexmark C522"
SNMPv2-SMI::enterprises.641.2.1.2.1.3.1 = STRING: "MANUFACTURER:Lexmark International;COMMAND SET:;MODEL:Lexmark C522"
Linksys EPSX3
SNMPv2-MIB::sysDescr.0 = STRING: ETHERNET MULTI-ENVIRONMENT.ROM, JETDIRECT EX, EEPROM 6016
NetGear PS113
SNMPv2-MIB::sysDescr.0 = STRING: A SNMP proxy agent.
Okidata C7200
SNMPv2-MIB::sysDescr.0 = STRING: OkiLAN 6200e
SNMPv2-MIB::sysName.0 = STRING: OKI7009715
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceType.2 = OID: HOST-RESOURCES-TYPES::hrDeviceNonVolat
ileMemory
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: C7200
HOST-RESOURCES-MIB::hrDeviceDescr.2 = STRING: FLASH0
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::enterprises.2001.1.1.1.1
HOST-RESOURCES-MIB::hrDeviceID.2 = OID: SNMPv2-SMI::zeroDotZero
SNMPv2-SMI::mib-2.43.14.1.1.3.1.1 = STRING: "IEEE 1284"
SNMPv2-SMI::mib-2.43.14.1.1.3.1.2 = STRING: "EtherTalk Phase 2"
SNMPv2-SMI::mib-2.43.14.1.1.3.1.3 = STRING: "LPD"
SNMPv2-SMI::mib-2.43.14.1.1.3.1.4 = STRING: "Netware Rprinter"
SNMPv2-SMI::mib-2.43.14.1.1.3.1.5 = STRING: "Netware Bindery or NDS Pserver"
SNMPv2-SMI::mib-2.43.14.1.1.3.1.6 = STRING: "Raw TCP Port 9100"
SNMPv2-SMI::mib-2.43.14.1.1.3.1.7 = STRING: "FTP"
SNMPv2-SMI::mib-2.43.14.1.1.3.1.8 = STRING: "DLC/LLC"
SNMPv2-SMI::enterprises.2001.1.1.1.1.1.3530.0 = STRING: "C7200"
Xerox N2025
SNMPv2-MIB::sysDescr.0 = STRING: Xerox DocuPrint N2025 Network Laser Printer - 2.12-02
SNMPv2-MIB::sysName.0 = STRING:
HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
HOST-RESOURCES-MIB::hrDeviceType.2 = OID: HOST-RESOURCES-TYPES::hrDeviceParallelPort
HOST-RESOURCES-MIB::hrDeviceType.3 = OID: HOST-RESOURCES-TYPES::hrDeviceNetwork
HOST-RESOURCES-MIB::hrDeviceType.6 = OID: HOST-RESOURCES-TYPES::hrDeviceProcessor
HOST-RESOURCES-MIB::hrDeviceType.7 = OID: HOST-RESOURCES-TYPES::hrDeviceOther
HOST-RESOURCES-MIB::hrDeviceType.9 = OID: HOST-RESOURCES-TYPES::hrDeviceVolatileMemory
HOST-RESOURCES-MIB::hrDeviceType.10 = OID: HOST-RESOURCES-TYPES::hrDeviceNonVolatileMemory
HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: Xerox DocuPrint N2025 Network Laser Printer - 2.12-02
HOST-RESOURCES-MIB::hrDeviceDescr.2 = STRING: IEEE 1284 port
HOST-RESOURCES-MIB::hrDeviceDescr.3 = STRING: Ethernet port
HOST-RESOURCES-MIB::hrDeviceDescr.6 = STRING: Motorola Power PC
HOST-RESOURCES-MIB::hrDeviceDescr.7 = STRING: USB Port
HOST-RESOURCES-MIB::hrDeviceDescr.9 = STRING: RAM Memory
HOST-RESOURCES-MIB::hrDeviceDescr.10 = STRING: ROM Memory
HOST-RESOURCES-MIB::hrDeviceID.1 = OID: SNMPv2-SMI::enterprises.253.8.62.1.3.2.17.1
+300 -253
Ver Arquivo
@@ -3,46 +3,33 @@
*
* AppSocket backend for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" 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
* file is missing or damaged, see the license at "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.
* main() - Send a file to the printer or server.
* side_cb() - Handle side-channel requests...
* wait_bc() - Wait for back-channel data...
*/
/*
* Include necessary headers.
*/
#include <cups/backend.h>
#include <cups/http-private.h>
#include <cups/cups.h>
#include <stdio.h>
#include <stdlib.h>
#include "backend-private.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 <winsock.h>
@@ -56,6 +43,14 @@
#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.
*
@@ -73,27 +68,26 @@ 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[255], /* Name of option */
value[255], /* Value of option */
*ptr; /* Pointer into name or value */
int fp; /* Print file */
*name, /* Name of option */
*value, /* Value of option */
sep; /* Option separator */
int print_fd; /* Print file */
int copies; /* Number of copies to print */
time_t start_time, /* Time of first connect */
current_time, /* Current time */
wait_time; /* Time to wait before shutting down socket */
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 fd; /* AppSocket */
int device_fd; /* AppSocket */
int error; /* Error code (if any) */
http_addrlist_t *addrlist; /* Address list */
int rbytes; /* Number of bytes read */
int wbytes; /* Number of bytes written */
int nbytes; /* Number of bytes read */
size_t tbytes; /* Total number of bytes written */
char buffer[8192], /* Output buffer */
*bufptr; /* Pointer into buffer */
struct timeval timeout; /* Timeout for select() */
fd_set input, /* Input set for select() */
output; /* Output set for select() */
http_addrlist_t *addrlist, /* Address list */
*addr; /* Connected address */
char addrname[256]; /* Address name */
ssize_t tbytes; /* Total number of bytes written */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
@@ -130,8 +124,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
else if (argc < 6 || argc > 7)
{
fprintf(stderr, "Usage: %s job-id user title copies options [file]\n",
argv[0]);
_cupsLangPrintf(stderr,
_("Usage: %s job-id user title copies options [file]\n"),
argv[0]);
return (CUPS_BACKEND_FAILED);
}
@@ -142,8 +137,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (argc == 6)
{
fp = 0;
copies = 1;
print_fd = 0;
copies = 1;
}
else
{
@@ -151,7 +146,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Try to open the print file...
*/
if ((fp = open(argv[6], O_RDONLY)) < 0)
if ((print_fd = open(argv[6], O_RDONLY)) < 0)
{
perror("ERROR: unable to open print file");
return (CUPS_BACKEND_FAILED);
@@ -176,7 +171,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Get options, if any...
*/
waiteof = 1;
waiteof = 1;
contimeout = 7 * 24 * 60 * 60;
if ((options = strchr(resource, '?')) != NULL)
{
@@ -197,29 +193,30 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Get the name...
*/
for (ptr = name; *options && *options != '=';)
if (ptr < (name + sizeof(name) - 1))
*ptr++ = *options++;
*ptr = '\0';
name = options;
if (*options == '=')
while (*options && *options != '=' && *options != '+' && *options != '&')
options ++;
if ((sep = *options) != '\0')
*options++ = '\0';
if (sep == '=')
{
/*
* Get the value...
*/
options ++;
value = options;
for (ptr = value; *options && *options != '+' && *options != '&';)
if (ptr < (value + sizeof(value) - 1))
*ptr++ = *options++;
*ptr = '\0';
if (*options == '+' || *options == '&')
while (*options && *options != '+' && *options != '&')
options ++;
if (*options)
*options++ = '\0';
}
else
value[0] = '\0';
value = (char *)"";
/*
* Process the option...
@@ -234,6 +231,15 @@ 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);
}
}
}
@@ -241,253 +247,294 @@ 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)
{
fprintf(stderr, "ERROR: Unable to locate printer \'%s\'!\n", hostname);
_cupsLangPrintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"),
hostname);
return (CUPS_BACKEND_STOP);
}
fprintf(stderr, "INFO: Attempting to connect to host %s on port %d\n",
hostname, port);
_cupsLangPrintf(stderr,
_("INFO: Attempting to connect to host %s on port %d\n"),
hostname, port);
wbytes = 0;
fputs("STATE: +connecting-to-device\n", stderr);
while (copies > 0)
for (delay = 5;;)
{
fputs("STATE: +connecting-to-device\n", stderr);
for (delay = 5;;)
if ((addr = httpAddrConnect(addrlist, &device_fd)) == NULL)
{
if (!httpAddrConnect(addrlist, &fd))
error = errno;
device_fd = -1;
if (getenv("CLASS") != NULL)
{
error = errno;
fd = -1;
/*
* If the CLASS environment variable is set, the job was submitted
* to a class and not to a specific queue. In this case, we want
* to abort immediately so that the job can be requeued on the next
* available printer in the class.
*/
if (getenv("CLASS") != NULL)
_cupsLangPuts(stderr,
_("INFO: Unable to contact printer, queuing on next "
"printer in class...\n"));
/*
* Sleep 5 seconds to keep the job from requeuing too rapidly...
*/
sleep(5);
return (CUPS_BACKEND_FAILED);
}
if (error == ECONNREFUSED || error == EHOSTDOWN ||
error == EHOSTUNREACH)
{
if (contimeout && (time(NULL) - start_time) > contimeout)
{
/*
* If the CLASS environment variable is set, the job was submitted
* to a class and not to a specific queue. In this case, we want
* to abort immediately so that the job can be requeued on the next
* available printer in the class.
*/
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...
*/
sleep(5);
return (CUPS_BACKEND_FAILED);
_cupsLangPuts(stderr, _("ERROR: Printer not responding!\n"));
return (CUPS_BACKEND_FAILED);
}
if (error == ECONNREFUSED || error == EHOSTDOWN ||
error == EHOSTUNREACH)
{
fprintf(stderr, "INFO: Network host \'%s\' is busy; will retry in %d seconds...\n",
hostname, delay);
sleep(delay);
recoverable = 1;
if (delay < 30)
delay += 5;
}
else
{
perror("ERROR: Unable to connect to printer (retrying in 30 seconds)");
sleep(30);
}
_cupsLangPrintf(stderr,
_("WARNING: recoverable: Network host \'%s\' is busy; "
"will retry in %d seconds...\n"),
hostname, delay);
sleep(delay);
if (delay < 30)
delay += 5;
}
else
break;
{
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"));
sleep(30);
}
}
else
break;
}
fputs("STATE: -connecting-to-device\n", stderr);
if (recoverable)
{
/*
* 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 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...
*/
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));
fputs("INFO: recovered: \n", stderr);
sleep(5);
}
sigemptyset(&action.sa_mask);
action.sa_handler = SIG_IGN;
sigaction(SIGTERM, &action, NULL);
#else
signal(SIGTERM, SIG_IGN);
#endif /* HAVE_SIGSET */
}
fputs("STATE: -connecting-to-device\n", stderr);
_cupsLangPrintf(stderr, _("INFO: Connected to %s...\n"), hostname);
/*
* Finally, send the print file...
*/
#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...
*/
tbytes = 0;
while (copies > 0 && tbytes >= 0)
{
copies --;
if (fp != 0)
if (print_fd != 0)
{
fputs("PAGE: 1 1\n", stderr);
lseek(fp, 0, SEEK_SET);
lseek(print_fd, 0, SEEK_SET);
}
fputs("INFO: Connected to host, sending print job...\n", stderr);
tbytes = backendRunLoop(print_fd, device_fd, 1, side_cb);
tbytes = 0;
while ((nbytes = read(fp, buffer, sizeof(buffer))) > 0)
{
/*
* Write the print data to the printer...
*/
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);
}
tbytes += nbytes;
bufptr = buffer;
/*
* Wait up to 5 seconds to get any pending back-channel data...
*/
while (nbytes > 0)
{
/*
* See if we are ready to read or write...
*/
do
{
FD_ZERO(&input);
FD_SET(fd, &input);
FD_ZERO(&output);
FD_SET(fd, &output);
}
while (select(fd + 1, &input, &output, NULL, NULL) < 0);
if (FD_ISSET(fd, &input))
{
/*
* Read backchannel data...
*/
if ((rbytes = recv(fd, resource, sizeof(resource), 0)) > 0)
{
fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
rbytes);
cupsBackChannelWrite(resource, rbytes, 1.0);
}
}
if (FD_ISSET(fd, &output))
{
/*
* Write print data...
*/
if ((wbytes = send(fd, bufptr, nbytes, 0)) < 0)
{
/*
* Check for retryable errors...
*/
if (errno != EAGAIN && errno != EINTR)
{
perror("ERROR: Unable to send print file to printer");
break;
}
}
else
{
/*
* Update count and pointer...
*/
nbytes -= wbytes;
bufptr += wbytes;
}
}
}
if (wbytes < 0)
break;
if (argc > 6)
fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
(unsigned long)tbytes);
}
if (waiteof)
{
/*
* Shutdown the socket and wait for the other end to finish...
*/
fputs("INFO: Print file sent, waiting for printer to finish...\n", stderr);
shutdown(fd, 1);
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(fd, &input);
#ifdef __hpux
if (select(fd + 1, (int *)&input, NULL, NULL, &timeout) > 0)
#else
if (select(fd + 1, &input, NULL, NULL, &timeout) > 0)
#endif /* __hpux */
{
/*
* Grab the data coming back and spit it out to stderr...
*/
if ((rbytes = recv(fd, resource, sizeof(resource), 0)) > 0)
{
fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
rbytes);
cupsBackChannelWrite(resource, rbytes, 1.0);
}
else
break;
}
else
break;
}
}
wait_time = time(NULL) + 5;
while (wait_time >= time(&current_time))
if (wait_bc(device_fd, wait_time - current_time) <= 0)
break;
if (waiteof)
{
/*
* Close the socket connection...
* Shutdown the socket and wait for the other end to finish...
*/
close(fd);
_cupsLangPuts(stderr,
_("INFO: Print file sent, waiting for printer to finish...\n"));
shutdown(device_fd, 1);
while (wait_bc(device_fd, 90) > 0);
}
/*
* Close the socket connection...
*/
close(device_fd);
httpAddrFreeList(addrlist);
/*
* Close the input file and return...
*/
if (fp != 0)
close(fp);
if (print_fd != 0)
close(print_fd);
if (wbytes >= 0)
fputs("INFO: Ready to print.\n", stderr);
if (tbytes >= 0)
_cupsLangPuts(stderr, _("INFO: Ready to print.\n"));
return (wbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
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 :
status = CUPS_SC_STATUS_OK;
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);
}
+8 -15
Ver Arquivo
@@ -4,28 +4,20 @@
* 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 Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" 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
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* main() - Test the device-ID functions.
*/
/*
@@ -41,6 +33,7 @@
# include <unistd.h>
# include <fcntl.h>
#endif /* WIN32 */
#define DEBUG
#include "ieee1284.c"
@@ -76,8 +69,8 @@ main(int argc, /* I - Number of command-line args */
printf("%s:\n", argv[i]);
get_device_id(fd, device_id, sizeof(device_id), make_model,
sizeof(make_model), "test", uri, sizeof(uri));
backendGetDeviceID(fd, device_id, sizeof(device_id), make_model,
sizeof(make_model), "test", uri, sizeof(uri));
printf(" device_id=\"%s\"\n", device_id);
printf(" make_model=\"%s\"\n", make_model);
+1913 -1785
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+342 -336
Ver Arquivo
@@ -5,30 +5,23 @@
*
* This file is included from "usb.c" when compiled on UNIX/Linux.
*
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" 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
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* main() - Send a file to the specified USB port.
* 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...
*/
/*
@@ -43,7 +36,8 @@
* Local functions...
*/
int open_device(const char *uri);
static int open_device(const char *uri, int *use_bc);
static void side_cb(int print_fd, int device_fd, int use_bc);
/*
@@ -54,30 +48,21 @@ int /* O - Exit status */
print_device(const char *uri, /* I - Device URI */
const char *hostname, /* I - Hostname/manufacturer */
const char *resource, /* I - Resource/modelname */
const char *options, /* I - Device options/serial number */
int fp, /* I - File descriptor to print */
int copies) /* I - Copies to print */
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) */
char *argv[]) /* I - Command-line arguments */
{
int fd; /* USB device */
int rbytes; /* Number of bytes read */
int wbytes; /* Number of bytes written */
size_t nbytes, /* Number of bytes read */
tbytes; /* Total number of bytes written */
char buffer[8192], /* Output buffer */
*bufptr, /* Pointer into buffer */
backbuf[1024]; /* Backchannel buffer */
int use_bc; /* Use backchannel path? */
int device_fd; /* USB device */
size_t tbytes; /* Total number of bytes written */
struct termios opts; /* Parallel port options */
fd_set input, /* Input set for select() */
output; /* Output set for select() */
int paperout; /* Paper out? */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
#ifdef __linux
unsigned int status; /* Port status (off-line, out-of-paper, etc.) */
#endif /* __linux */
(void)argc;
(void)argv;
/*
* Open the USB port device...
*/
@@ -86,7 +71,38 @@ print_device(const char *uri, /* I - Device URI */
do
{
if ((fd = open_device(uri)) == -1)
#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()...
*/
use_bc = 0;
#elif defined(__sun)
/*
* CUPS STR #3028: Solaris' usbprn driver apparently does not support
* select() or poll(), so we can't support backchannel...
*/
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") &&
strncasecmp(hostname, "Konica", 6) &&
strncasecmp(hostname, "Minolta", 7);
#endif /* __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__ */
if ((device_fd = open_device(uri, &use_bc)) == -1)
{
if (getenv("CLASS") != NULL)
{
@@ -97,8 +113,9 @@ print_device(const char *uri, /* I - Device URI */
* available printer in the class.
*/
fputs("INFO: Unable to open USB device, queuing on next printer in class...\n",
stderr);
_cupsLangPuts(stderr,
_("INFO: Unable to contact printer, queuing on next "
"printer in class...\n"));
/*
* Sleep 5 seconds to keep the job from requeuing too rapidly...
@@ -111,23 +128,28 @@ print_device(const char *uri, /* I - Device URI */
if (errno == EBUSY)
{
fputs("INFO: USB port busy; will retry in 30 seconds...\n", stderr);
sleep(30);
_cupsLangPuts(stderr,
_("INFO: Printer busy; will retry in 10 seconds...\n"));
sleep(10);
}
else if (errno == ENXIO || errno == EIO || errno == ENOENT || errno == ENODEV)
else if (errno == ENXIO || errno == EIO || errno == ENOENT ||
errno == ENODEV)
{
fputs("INFO: Printer not connected; will retry in 30 seconds...\n", stderr);
_cupsLangPuts(stderr,
_("INFO: Printer not connected; will retry in 30 "
"seconds...\n"));
sleep(30);
}
else
{
fprintf(stderr, "ERROR: Unable to open USB device \"%s\": %s\n",
uri, strerror(errno));
_cupsLangPrintf(stderr,
_("ERROR: Unable to open device file \"%s\": %s\n"),
resource, strerror(errno));
return (CUPS_BACKEND_FAILED);
}
}
}
while (fd < 0);
while (device_fd < 0);
fputs("STATE: -connecting-to-device\n", stderr);
@@ -135,187 +157,59 @@ print_device(const char *uri, /* I - Device URI */
* Set any options provided...
*/
tcgetattr(fd, &opts);
tcgetattr(device_fd, &opts);
opts.c_lflag &= ~(ICANON | ECHO | ISIG); /* Raw mode */
/**** No options supported yet ****/
tcsetattr(fd, TCSANOW, &opts);
/*
* Check printer status...
*/
paperout = 0;
#if defined(__linux) && defined(LP_POUTPA)
/*
* Show the printer status before we send the file...
*/
while (!ioctl(fd, LPGETSTATUS, &status))
{
fprintf(stderr, "DEBUG: LPGETSTATUS returned a port status of %02X...\n", status);
if (status & LP_POUTPA)
{
fputs("WARNING: Media tray empty!\n", stderr);
fputs("STATUS: +media-tray-empty-error\n", stderr);
paperout = 1;
}
if (!(status & LP_PERRORP))
fputs("WARNING: Printer fault!\n", stderr);
else if (!(status & LP_PSELECD))
fputs("WARNING: Printer off-line.\n", stderr);
else
break;
sleep(5);
}
#endif /* __linux && LP_POUTPA */
/*
* 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 (!fp)
{
#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 */
}
tcsetattr(device_fd, TCSANOW, &opts);
/*
* Finally, send the print file...
*/
wbytes = 0;
tbytes = 0;
while (copies > 0)
while (copies > 0 && tbytes >= 0)
{
copies --;
if (fp != 0)
if (print_fd != 0)
{
fputs("PAGE: 1 1\n", stderr);
lseek(fp, 0, SEEK_SET);
lseek(print_fd, 0, SEEK_SET);
}
tbytes = 0;
while ((nbytes = read(fp, buffer, sizeof(buffer))) > 0)
{
/*
* Write the print data to the printer...
*/
#ifdef __sun
/*
* CUPS STR #3028: Solaris' usbprn driver apparently does not support
* select() or poll(), so we can't support the sidechannel either...
*/
tbytes += nbytes;
bufptr = buffer;
tbytes = backendRunLoop(print_fd, device_fd, use_bc, NULL);
while (nbytes > 0)
{
/*
* See if we are ready to read or write...
*/
#else
tbytes = backendRunLoop(print_fd, device_fd, use_bc, side_cb);
#endif /* __sun */
do
{
FD_ZERO(&input);
FD_SET(fd, &input);
FD_ZERO(&output);
FD_SET(fd, &output);
}
while (select(fd + 1, &input, &output, NULL, NULL) < 0);
if (FD_ISSET(fd, &input))
{
/*
* Read backchannel data...
*/
if ((rbytes = read(fd, backbuf, sizeof(backbuf))) > 0)
{
fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
rbytes);
cupsBackChannelWrite(backbuf, rbytes, 1.0);
}
}
if (FD_ISSET(fd, &output))
{
/*
* Write print data...
*/
if ((wbytes = write(fd, bufptr, nbytes)) < 0)
if (errno == ENOTTY)
wbytes = write(fd, bufptr, nbytes);
if (wbytes < 0)
{
/*
* Check for retryable errors...
*/
if (errno == ENOSPC)
{
paperout = 1;
fputs("ERROR: Out of paper!\n", stderr);
fputs("STATUS: +media-tray-empty-error\n", stderr);
}
else if (errno != EAGAIN && errno != EINTR)
{
perror("ERROR: Unable to send print file to printer");
break;
}
}
else
{
/*
* Update count and pointer...
*/
if (paperout)
{
fputs("STATUS: -media-tray-empty-error\n", stderr);
paperout = 0;
}
nbytes -= wbytes;
bufptr += wbytes;
}
}
}
if (wbytes < 0)
break;
if (fp)
fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
(unsigned long)tbytes);
}
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);
}
/*
* Close the USB port and return...
*/
close(fd);
close(device_fd);
return (wbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
return (tbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
}
@@ -327,44 +221,52 @@ void
list_devices(void)
{
#ifdef __linux
int i; /* Looping var */
int fd; /* File descriptor */
char format[255], /* Format for device filename */
device[255], /* Device filename */
device_id[1024], /* Device ID string */
device_uri[1024], /* Device URI string */
make_model[1024]; /* Make and model */
int i; /* Looping var */
int fd; /* File descriptor */
char device[255], /* Device filename */
device_id[1024], /* Device ID string */
device_uri[1024], /* Device URI string */
make_model[1024]; /* Make and model */
/*
* First figure out which USB printer filename to use...
*/
if (!access("/dev/usblp0", 0))
strcpy(format, "/dev/usblp%d");
else if (!access("/dev/usb/usblp0", 0))
strcpy(format, "/dev/usb/usblp%d");
else
strcpy(format, "/dev/usb/lp%d");
/*
* Then open each USB device...
* Try to open each USB device...
*/
for (i = 0; i < 16; i ++)
{
sprintf(device, format, i);
/*
* Linux has a long history of changing the standard filenames used
* for USB printer devices. We get the honor of trying them all...
*/
if ((fd = open(device, O_RDWR | O_EXCL)) >= 0)
sprintf(device, "/dev/usblp%d", i);
if ((fd = open(device, O_RDWR | O_EXCL)) < 0)
{
if (!get_device_id(fd, device_id, sizeof(device_id),
make_model, sizeof(make_model),
"usb", device_uri, sizeof(device_uri)))
printf("direct %s \"%s\" \"%s USB #%d\" \"%s\"\n", device_uri,
make_model, make_model, i + 1, device_id);
if (errno != ENOENT)
continue;
close(fd);
sprintf(device, "/dev/usb/lp%d", i);
if ((fd = open(device, O_RDWR | O_EXCL)) < 0)
{
if (errno != ENOENT)
continue;
sprintf(device, "/dev/usb/usblp%d", i);
if ((fd = open(device, O_RDWR | O_EXCL)) < 0)
continue;
}
}
if (!backendGetDeviceID(fd, device_id, sizeof(device_id),
make_model, sizeof(make_model),
"usb", device_uri, sizeof(device_uri)))
printf("direct %s \"%s\" \"%s USB #%d\" \"%s\"\n", device_uri,
make_model, make_model, i + 1, device_id);
close(fd);
}
#elif defined(__sgi)
#elif defined(__sun) && defined(ECPPIOC_GETDEVID)
@@ -384,11 +286,11 @@ list_devices(void)
{
sprintf(device, "/dev/usb/printer%d", i);
if ((fd = open(device, O_RDWR | O_EXCL)) >= 0)
if ((fd = open(device, O_WRONLY | O_EXCL)) >= 0)
{
if (!get_device_id(fd, device_id, sizeof(device_id),
make_model, sizeof(make_model),
"usb", device_uri, sizeof(device_uri)))
if (!backendGetDeviceID(fd, device_id, sizeof(device_id),
make_model, sizeof(make_model),
"usb", device_uri, sizeof(device_uri)))
printf("direct %s \"%s\" \"%s USB #%d\" \"%s\"\n", device_uri,
make_model, make_model, i + 1, device_id);
@@ -420,9 +322,13 @@ list_devices(void)
* 'open_device()' - Open a USB device...
*/
int /* O - File descriptor or -1 on error */
open_device(const char *uri) /* I - Device URI */
static 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 */
{
int fd; /* File descriptor */
/*
* The generic implementation just treats the URI as a device filename...
* Specific operating systems may also support using the device serial
@@ -431,7 +337,14 @@ open_device(const char *uri) /* I - Device URI */
if (!strncmp(uri, "usb:/dev/", 9))
#ifdef __linux
return (-1); /* Do not allow direct devices anymore */
{
/*
* Do not allow direct devices anymore...
*/
errno = ENODEV;
return (-1);
}
else if (!strncmp(uri, "usb://", 6))
{
/*
@@ -440,40 +353,45 @@ open_device(const char *uri) /* I - Device URI */
int i; /* Looping var */
int busy; /* Are any ports busy? */
int fd; /* File descriptor */
char format[255], /* Format for device filename */
device[255], /* Device filename */
char device[255], /* Device filename */
device_id[1024], /* Device ID string */
make_model[1024], /* Make and model */
device_uri[1024]; /* Device URI string */
/*
* First figure out which USB printer filename to use...
* Find the correct USB device...
*/
if (!access("/dev/usblp0", 0))
strcpy(format, "/dev/usblp%d");
else if (!access("/dev/usb/usblp0", 0))
strcpy(format, "/dev/usb/usblp%d");
else
strcpy(format, "/dev/usb/lp%d");
/*
* Then find the correct USB device...
*/
do
for (;;)
{
for (busy = 0, i = 0; i < 16; i ++)
{
sprintf(device, format, i);
/*
* Linux has a long history of changing the standard filenames used
* for USB printer devices. We get the honor of trying them all...
*/
if ((fd = open(device, O_RDWR | O_EXCL)) >= 0)
sprintf(device, "/dev/usblp%d", i);
if ((fd = open(device, O_RDWR | O_EXCL)) < 0 && errno == ENOENT)
{
get_device_id(fd, device_id, sizeof(device_id),
make_model, sizeof(make_model),
"usb", device_uri, sizeof(device_uri));
sprintf(device, "/dev/usb/lp%d", i);
if ((fd = open(device, O_RDWR | O_EXCL)) < 0 && errno == ENOENT)
{
sprintf(device, "/dev/usb/usblp%d", i);
if ((fd = open(device, O_RDWR | O_EXCL)) < 0 && errno == ENOENT)
continue;
}
}
if (fd >= 0)
{
backendGetDeviceID(fd, device_id, sizeof(device_id),
make_model, sizeof(make_model),
"usb", device_uri, sizeof(device_uri));
}
else
{
@@ -494,7 +412,91 @@ 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);
}
/*
* This wasn't the one...
*/
if (fd >= 0)
close(fd);
}
/*
* If we get here and at least one of the printer ports showed up
* as "busy", then sleep for a bit and retry...
*/
if (busy)
_cupsLangPuts(stderr,
_("INFO: Printer busy; will retry in 5 seconds...\n"));
sleep(5);
}
}
#elif defined(__sun) && defined(ECPPIOC_GETDEVID)
{
/*
* Do not allow direct devices anymore...
*/
errno = ENODEV;
return (-1);
}
else if (!strncmp(uri, "usb://", 6))
{
/*
* For Solaris, try looking up the device serial number or model...
*/
int i; /* Looping var */
int busy; /* Are any ports busy? */
char device[255], /* Device filename */
device_id[1024], /* Device ID string */
make_model[1024], /* Make and model */
device_uri[1024]; /* Device URI string */
/*
* Find the correct USB device...
*/
do
{
for (i = 0, busy = 0; i < 8; i ++)
{
sprintf(device, "/dev/usb/printer%d", i);
if ((fd = open(device, O_WRONLY | O_EXCL)) >= 0)
backendGetDeviceID(fd, device_id, sizeof(device_id),
make_model, sizeof(make_model),
"usb", device_uri, sizeof(device_uri));
else
{
/*
* If the open failed because it was busy, flag it so we retry
* as needed...
*/
if (errno == EBUSY)
busy = 1;
device_uri[0] = '\0';
}
if (!strcmp(uri, device_uri))
{
/*
* Yes, return this file descriptor...
*/
fputs("DEBUG: Setting use_bc to 0!\n", stderr);
*use_bc = 0;
return (fd);
}
@@ -514,85 +516,8 @@ open_device(const char *uri) /* I - Device URI */
if (busy)
{
fputs("INFO: USB printer is busy; will retry in 5 seconds...\n",
stderr);
sleep(5);
}
}
while (busy);
/*
* Couldn't find the printer, return "no such device or address"...
*/
errno = ENODEV;
return (-1);
}
#elif defined(__sun) && defined(ECPPIOC_GETDEVID)
return (-1); /* Do not allow direct devices anymore */
else if (!strncmp(uri, "usb://", 6))
{
/*
* For Solaris, try looking up the device serial number or model...
*/
int i; /* Looping var */
int busy; /* Are any ports busy? */
int fd; /* File descriptor */
char device[255], /* Device filename */
device_id[1024], /* Device ID string */
make_model[1024], /* Make and model */
device_uri[1024]; /* Device URI string */
/*
* Find the correct USB device...
*/
do
{
for (i = 0, busy = 0; i < 8; i ++)
{
sprintf(device, "/dev/usb/printer%d", i);
if ((fd = open(device, O_RDWR | O_EXCL)) >= 0)
get_device_id(fd, device_id, sizeof(device_id),
make_model, sizeof(make_model),
"usb", device_uri, sizeof(device_uri));
else
{
/*
* If the open failed because it was busy, flag it so we retry
* as needed...
*/
if (errno == EBUSY)
busy = 1;
device_uri[0] = '\0';
}
if (!strcmp(uri, device_uri))
return (fd); /* Yes, return this file descriptor... */
/*
* This wasn't the one...
*/
if (fd >= 0)
close(fd);
}
/*
* If we get here and at least one of the printer ports showed up
* as "busy", then sleep for a bit and retry...
*/
if (busy)
{
fputs("INFO: USB printer is busy; will retry in 5 seconds...\n",
stderr);
_cupsLangPuts(stderr,
_("INFO: Printer is busy; will retry in 5 seconds...\n"));
sleep(5);
}
}
@@ -607,7 +532,20 @@ open_device(const char *uri) /* I - Device URI */
return (-1);
}
#else
return (open(uri + 4, O_RDWR | O_EXCL));
{
if (*use_bc)
fd = open(uri + 4, O_RDWR | O_EXCL);
else
fd = -1;
if (fd < 0)
{
fd = open(uri + 4, O_WRONLY | O_EXCL);
*use_bc = 0;
}
return (fd);
}
#endif /* __linux */
else
{
@@ -617,6 +555,74 @@ 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 :
status = CUPS_SC_STATUS_OK;
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$".
*/
+32 -31
Ver Arquivo
@@ -3,23 +3,14 @@
*
* USB port backend for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" 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
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
@@ -45,6 +36,7 @@
#include <stdlib.h>
#include <errno.h>
#include <cups/string.h>
#include <cups/i18n.h>
#include <signal.h>
#ifdef WIN32
@@ -62,8 +54,8 @@
void list_devices(void);
int print_device(const char *uri, const char *hostname,
const char *resource, const char *options,
int fp, int copies);
const char *resource, char *options,
int print_fd, int copies, int argc, char *argv[]);
/*
@@ -107,9 +99,11 @@ int /* O - Exit status */
print_device(const char *uri, /* I - Device URI */
const char *hostname, /* I - Hostname/manufacturer */
const char *resource, /* I - Resource/modelname */
const char *options, /* I - Device options/serial number */
int fp, /* I - File descriptor to print */
int copies) /* I - Copies to print */
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) */
char *argv[]) /* I - Command-line arguments */
{
/*
* Can't print, so just reference the arguments to eliminate compiler
@@ -122,8 +116,10 @@ print_device(const char *uri, /* I - Device URI */
(void)hostname;
(void)resource;
(void)options;
(void)fp;
(void)print_fd;
(void)copies;
(void)argc;
(void)argv;
return (CUPS_BACKEND_FAILED);
}
@@ -142,7 +138,7 @@ int /* O - Exit status */
main(int argc, /* I - Number of command-line arguments (6 or 7) */
char *argv[]) /* I - Command-line arguments */
{
int fp; /* Print file */
int print_fd; /* Print file */
int copies; /* Number of copies to print */
int status; /* Exit status */
int port; /* Port number (not used) */
@@ -188,7 +184,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
else if (argc < 6 || argc > 7)
{
fputs("Usage: usb job-id user title copies options [file]\n", stderr);
_cupsLangPrintf(stderr,
_("Usage: %s job-id user title copies options [file]\n"),
argv[0]);
return (CUPS_BACKEND_FAILED);
}
@@ -203,7 +201,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
hostname, sizeof(hostname), &port,
resource, sizeof(resource)) < HTTP_URI_OK)
{
fputs("ERROR: No device URI found in argv[0] or in DEVICE_URI environment variable!\n", stderr);
_cupsLangPuts(stderr,
_("ERROR: No device URI found in argv[0] or in DEVICE_URI "
"environment variable!\n"));
return (1);
}
@@ -228,8 +228,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (argc == 6)
{
fp = 0;
copies = 1;
print_fd = 0;
copies = 1;
}
else
{
@@ -237,10 +237,10 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Try to open the print file...
*/
if ((fp = open(argv[6], O_RDONLY)) < 0)
if ((print_fd = open(argv[6], O_RDONLY)) < 0)
{
fprintf(stderr, "ERROR: unable to open print file %s - %s\n",
argv[6], strerror(errno));
_cupsLangPrintf(stderr, _("ERROR: Unable to open print file %s - %s\n"),
argv[6], strerror(errno));
return (CUPS_BACKEND_FAILED);
}
@@ -251,14 +251,15 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Finally, send the print file...
*/
status = print_device(uri, hostname, resource, options, fp, copies);
status = print_device(uri, hostname, resource, options, print_fd, copies,
argc, argv);
/*
* Close the input file and return...
*/
if (fp != 0)
close(fp);
if (print_fd != 0)
close(print_fd);
return (status);
}
+11 -11
Ver Arquivo
@@ -1,14 +1,14 @@
# DO NOT DELETE
# DO NOT DELETE THIS LINE -- make depend depends on it.
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/debug.h ../cups/string.h ../config.h
lpc.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h
lpc.o: ../cups/array.h ../cups/file.h ../cups/language.h ../cups/i18n.h
lpc.o: ../cups/transcode.h ../cups/debug.h ../cups/string.h ../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/debug.h
lpq.o: ../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h
lpq.o: ../cups/language.h ../cups/i18n.h ../cups/transcode.h ../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
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/string.h ../config.h
lpr.o: ../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h
lpr.o: ../cups/language.h ../cups/i18n.h ../cups/transcode.h
lprm.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h
lprm.o: ../cups/array.h ../cups/file.h ../cups/language.h ../cups/i18n.h
lprm.o: ../cups/transcode.h ../cups/string.h ../config.h
+11 -14
Ver Arquivo
@@ -3,23 +3,14 @@
#
# 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 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
# 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/".
#
include ../Makedefs
@@ -62,6 +53,12 @@ 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
#
+26 -94
Ver Arquivo
@@ -3,23 +3,14 @@
*
* "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 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
* 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/".
*
* Contents:
*
@@ -65,6 +56,8 @@ main(int argc, /* I - Number of command-line arguments */
*params; /* Pointer to parameters */
_cupsSetLocale(argv);
/*
* Connect to the scheduler...
*/
@@ -235,11 +228,8 @@ show_status(http_t *http, /* I - HTTP connection to server */
const char *dests) /* I - Destinations */
{
ipp_t *request, /* IPP Request */
*response, /* IPP Response */
*jobs; /* IPP Get Jobs response */
ipp_attribute_t *attr, /* Current attribute */
*jattr; /* Current job attribute */
cups_lang_t *language; /* Default language */
*response; /* IPP Response */
ipp_attribute_t *attr; /* Current attribute */
char *printer, /* Printer name */
*device, /* Device URI */
*delimiter; /* Char search result */
@@ -249,14 +239,13 @@ 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 */
{
"printer-name",
"device-uri",
"printer-is-accepting-jobs",
"printer-name",
"printer-state",
"printer-is-accepting-jobs"
"queued-job-count"
};
@@ -273,18 +262,7 @@ show_status(http_t *http, /* I - HTTP connection to server */
* attributes-natural-language
*/
request = ippNew();
request->request.op.operation_id = CUPS_GET_PRINTERS;
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);
request = ippNewRequest(CUPS_GET_PRINTERS);
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"requested-attributes", sizeof(requested) / sizeof(requested[0]),
@@ -327,21 +305,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;
if (!strcmp(attr->name, "printer-state") &&
attr->value_tag == IPP_TAG_ENUM)
pstate = (ipp_pstate_t)attr->values[0].integer;
if (!strcmp(attr->name, "printer-is-accepting-jobs") &&
attr->value_tag == IPP_TAG_BOOLEAN)
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)
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;
attr = attr->next;
}
@@ -393,7 +371,8 @@ 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;
@@ -419,53 +398,6 @@ 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...
*/
+56 -41
Ver Arquivo
@@ -3,23 +3,14 @@
*
* "lpq" command for the Common UNIX Printing System (CUPS).
*
* Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* 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
* 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/".
*
* Contents:
*
@@ -49,6 +40,7 @@
* Local functions...
*/
static http_t *connect_server(const char *, http_t *);
static int show_jobs(const char *, http_t *, const char *,
const char *, const int, const int);
static void show_printer(const char *, http_t *, const char *);
@@ -75,36 +67,23 @@ main(int argc, /* I - Number of command-line arguments */
longstatus; /* Show file details */
int num_dests; /* Number of destinations */
cups_dest_t *dests; /* Destinations */
cups_lang_t *language; /* Language */
#ifdef HAVE_SSL
http_encryption_t encryption; /* Encryption? */
#endif /* HAVE_SSL */
language = cupsLangDefault();
/*
* Connect to the scheduler...
*/
if ((http = httpConnectEncrypt(cupsServer(), ippPort(),
cupsEncryption())) == NULL)
{
_cupsLangPrintf(stderr, _("%s: Unable to contact server!\n"), argv[0]);
return (1);
}
_cupsSetLocale(argv);
/*
* Check for command-line options...
*/
http = NULL;
dest = NULL;
user = NULL;
id = 0;
interval = 0;
longstatus = 0;
all = 0;
num_dests = cupsGetDests(&dests);
num_dests = 0;
dests = NULL;
for (i = 1; i < argc; i ++)
if (argv[i][0] == '+')
@@ -115,10 +94,10 @@ main(int argc, /* I - Number of command-line arguments */
{
case 'E' : /* Encrypt */
#ifdef HAVE_SSL
encryption = HTTP_ENCRYPT_REQUIRED;
cupsSetEncryption(HTTP_ENCRYPT_REQUIRED);
if (http)
httpEncryption(http, encryption);
httpEncryption(http, HTTP_ENCRYPT_REQUIRED);
#else
_cupsLangPrintf(stderr,
_("%s: Sorry, no encryption support compiled in!\n"),
@@ -166,6 +145,11 @@ main(int argc, /* I - Number of command-line arguments */
if ((instance = strchr(dest, '/')) != NULL)
*instance++ = '\0';
http = connect_server(argv[0], http);
if (num_dests == 0)
num_dests = cupsGetDests2(http, &dests);
if (cupsGetDest(dest, instance, num_dests, dests) == NULL)
{
if (instance)
@@ -186,8 +170,11 @@ main(int argc, /* I - Number of command-line arguments */
break;
case 'h' : /* Connect to host */
if (http != NULL)
if (http)
{
httpClose(http);
http = NULL;
}
if (argv[i][2] != '\0')
cupsSetServer(argv[i] + 2);
@@ -225,8 +212,13 @@ main(int argc, /* I - Number of command-line arguments */
else
user = argv[i];
http = connect_server(argv[0], http);
if (dest == NULL && !all)
{
if (num_dests == 0)
num_dests = cupsGetDests2(http, &dests);
for (i = 0; i < num_dests; i ++)
if (dests[i].is_default)
dest = dests[i].name;
@@ -294,6 +286,30 @@ main(int argc, /* I - Number of command-line arguments */
}
/*
* 'connect_server()' - Connect to the server as necessary...
*/
static http_t * /* O - New HTTP connection */
connect_server(const char *command, /* I - Command name */
http_t *http) /* I - Current HTTP connection */
{
if (!http)
{
http = httpConnectEncrypt(cupsServer(), ippPort(),
cupsEncryption());
if (http == NULL)
{
_cupsLangPrintf(stderr, _("%s: Unable to connect to server\n"), command);
exit(1);
}
}
return (http);
}
/*
* 'show_jobs()' - Show jobs.
*/
@@ -356,17 +372,13 @@ show_jobs(const char *command, /* I - Command name */
request = ippNewRequest(id ? IPP_GET_JOB_ATTRIBUTES : IPP_GET_JOBS);
if (dest == NULL)
if (id)
{
if (id)
sprintf(resource, "ipp://localhost/jobs/%d", id);
else
strcpy(resource, "ipp://localhost/jobs");
snprintf(resource, sizeof(resource), "ipp://localhost/jobs/%d", id);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "job-uri",
NULL, resource);
}
else
else if (dest)
{
httpAssembleURIf(HTTP_URI_CODING_ALL, resource, sizeof(resource), "ipp",
NULL, "localhost", 0, "/printers/%s", dest);
@@ -374,6 +386,9 @@ show_jobs(const char *command, /* I - Command name */
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, resource);
}
else
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, "ipp://localhost/");
if (user)
{
+11 -22
Ver Arquivo
@@ -3,23 +3,14 @@
*
* "lpr" command for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products.
* Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* 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
* 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/".
*
* Contents:
*
@@ -87,13 +78,14 @@ main(int argc, /* I - Number of command-line arguments */
ssize_t bytes; /* Bytes copied */
off_t filesize; /* Size of temp file */
int temp; /* Temporary file descriptor */
cups_lang_t *language; /* Language information */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Signal action */
struct sigaction oldaction; /* Old signal action */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
_cupsSetLocale(argv);
deletefile = 0;
printer = NULL;
num_dests = 0;
@@ -102,7 +94,6 @@ main(int argc, /* I - Number of command-line arguments */
options = NULL;
num_files = 0;
title = NULL;
language = cupsLangDefault();
for (i = 1; i < argc; i ++)
if (argv[i][0] == '-')
@@ -209,11 +200,11 @@ main(int argc, /* I - Number of command-line arguments */
break;
case 'l' : /* Literal/raw */
num_options = cupsAddOption("raw", "", num_options, &options);
num_options = cupsAddOption("raw", "true", num_options, &options);
break;
case 'p' : /* Prettyprint */
num_options = cupsAddOption("prettyprint", "", num_options,
num_options = cupsAddOption("prettyprint", "true", num_options,
&options);
break;
@@ -232,7 +223,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", email,
num_options = cupsAddOption("notify-recipient-uri", email,
num_options, &options);
}
break;
@@ -429,8 +420,6 @@ main(int argc, /* I - Number of command-line arguments */
}
else
{
num_files = 1;
#ifndef WIN32
# if defined(HAVE_SIGSET)
sigset(SIGHUP, sighandler);
+29 -27
Ver Arquivo
@@ -3,23 +3,14 @@
*
* "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 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
* 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/".
*
* Contents:
*
@@ -55,12 +46,14 @@ main(int argc, /* I - Number of command-line arguments */
ipp_t *request; /* IPP request */
ipp_t *response; /* IPP response */
ipp_op_t op; /* Operation */
cups_lang_t *language; /* Language */
int num_dests; /* Number of destinations */
cups_dest_t *dests; /* Destinations */
cups_dest_t *dests, /* Destinations */
*defdest; /* Default destination */
http_encryption_t encryption; /* Encryption? */
_cupsSetLocale(argv);
/*
* Setup to cancel individual print jobs...
*/
@@ -71,12 +64,6 @@ main(int argc, /* I - Number of command-line arguments */
response = NULL;
http = NULL;
encryption = cupsEncryption();
language = cupsLangDefault();
num_dests = cupsGetDests(&dests);
for (i = 0; i < num_dests; i ++)
if (dests[i].is_default)
dest = dests[i].name;
/*
* Open a connection to the server...
@@ -85,10 +72,13 @@ main(int argc, /* I - Number of command-line arguments */
if ((http = httpConnectEncrypt(cupsServer(), ippPort(), encryption)) == NULL)
{
_cupsLangPuts(stderr, _("lprm: Unable to contact server!\n"));
cupsFreeDests(num_dests, dests);
return (1);
}
num_dests = cupsGetDests2(http, &dests);
defdest = cupsGetDest(NULL, NULL, num_dests, dests);
dest = defdest ? defdest->name : NULL;
/*
* Process command-line arguments...
*/
@@ -102,6 +92,7 @@ main(int argc, /* I - Number of command-line arguments */
encryption = HTTP_ENCRYPT_REQUIRED;
httpEncryption(http, encryption);
cupsSetEncryption(encryption);
#else
_cupsLangPrintf(stderr,
_("%s: Sorry, no encryption support compiled in!\n"),
@@ -152,9 +143,6 @@ main(int argc, /* I - Number of command-line arguments */
break;
case 'h' : /* Connect to host */
if (http != NULL)
httpClose(http);
if (argv[i][2] != '\0')
cupsSetServer(argv[i] + 2);
else
@@ -172,6 +160,20 @@ main(int argc, /* I - Number of command-line arguments */
else
cupsSetServer(argv[i]);
}
httpClose(http);
cupsFreeDests(num_dests, dests);
if ((http = httpConnectEncrypt(cupsServer(), ippPort(),
encryption)) == NULL)
{
_cupsLangPuts(stderr, _("lprm: Unable to contact server!\n"));
return (1);
}
num_dests = cupsGetDests2(http, &dests);
defdest = cupsGetDest(NULL, NULL, num_dests, dests);
dest = defdest ? defdest->name : NULL;
break;
default :
@@ -262,7 +264,7 @@ main(int argc, /* I - Number of command-line arguments */
}
/*
* If nothing has been cancelled yet, cancel the current job on the specified
* If nothing has been canceled yet, cancel the current job on the specified
* (or default) printer...
*/
+42 -41
Ver Arquivo
@@ -1,55 +1,56 @@
# DO NOT DELETE
# DO NOT DELETE THIS LINE -- make depend depends on it.
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/string.h ../config.h ../cups/dir.h
help-index.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
help-index.o: ../cups/array.h help-index.h ../cups/debug.h ../cups/i18n.h
help-index.o: ../cups/transcode.h ../cups/string.h ../config.h ../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/string.h ../config.h
html.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
html.o: ../cups/array.h help-index.h ../cups/debug.h ../cups/i18n.h
html.o: ../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/string.h ../config.h
ipp-var.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
ipp-var.o: ../cups/array.h help-index.h ../cups/debug.h ../cups/i18n.h
ipp-var.o: ../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/string.h ../config.h
search.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
search.o: ../cups/array.h help-index.h ../cups/debug.h ../cups/i18n.h
search.o: ../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/string.h ../config.h
template.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
template.o: ../cups/array.h help-index.h ../cups/debug.h ../cups/i18n.h
template.o: ../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/string.h ../config.h
var.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
var.o: ../cups/array.h help-index.h ../cups/debug.h ../cups/i18n.h
var.o: ../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/string.h ../config.h ../cups/file.h
admin.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
admin.o: ../cups/array.h help-index.h ../cups/debug.h ../cups/i18n.h
admin.o: ../cups/transcode.h ../cups/string.h ../config.h ../cups/adminutil.h
admin.o: ../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/string.h ../config.h
classes.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
classes.o: ../cups/array.h help-index.h ../cups/debug.h ../cups/i18n.h
classes.o: ../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/string.h ../config.h
help.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
help.o: ../cups/array.h help-index.h ../cups/debug.h ../cups/i18n.h
help.o: ../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/string.h ../config.h
jobs.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
jobs.o: ../cups/array.h help-index.h ../cups/debug.h ../cups/i18n.h
jobs.o: ../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/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
printers.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
printers.o: ../cups/array.h help-index.h ../cups/debug.h ../cups/i18n.h
printers.o: ../cups/transcode.h ../cups/string.h ../config.h
testcgi.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h
testcgi.o: ../cups/array.h ../cups/file.h ../cups/language.h ../cups/array.h
testcgi.o: help-index.h
testhi.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h
testhi.o: ../cups/array.h ../cups/file.h ../cups/language.h ../cups/array.h
testhi.o: 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/ppd.h ../cups/array.h ../cups/file.h
testtemplate.o: ../cups/language.h ../cups/array.h help-index.h
+14 -17
Ver Arquivo
@@ -3,23 +3,14 @@
#
# 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 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
# 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/".
#
include ../Makedefs
@@ -63,6 +54,12 @@ 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
#
@@ -139,7 +136,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)
$(COMMONLIBS) $(SSLLIBS) $(LIBZ) $(LIBGSSAPI)
#
@@ -149,7 +146,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)
$(COMMONLIBS) $(SSLLIBS) $(LIBZ) $(LIBGSSAPI)
#
@@ -159,7 +156,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)
$(COMMONLIBS) $(SSLLIBS) $(LIBZ) $(LIBGSSAPI)
#
+1204 -612
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+6 -15
Ver Arquivo
@@ -3,23 +3,14 @@
*
* Private CGI definitions for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2005 by Easy Software Products.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* 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
* 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/".
*/
/*
+5 -14
Ver Arquivo
@@ -3,23 +3,14 @@
*
* 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 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
* 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/".
*/
#ifndef _CUPS_CGI_H_
+11 -20
Ver Arquivo
@@ -3,23 +3,14 @@
*
* 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 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
* 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/".
*
* Contents:
*
@@ -95,8 +86,7 @@ main(int argc, /* I - Number of command-line arguments */
* See who is logged in...
*/
if ((user = getenv("REMOTE_USER")) == NULL)
user = "guest";
user = getenv("REMOTE_USER");
/*
* Connect to the HTTP server...
@@ -187,7 +177,7 @@ main(int argc, /* I - Number of command-line arguments */
void
show_all_classes(http_t *http, /* I - Connection to server */
const char *user) /* I - Username */
const char *user) /* I - Username */
{
int i; /* Looping var */
ipp_t *request, /* IPP request */
@@ -221,8 +211,9 @@ show_all_classes(http_t *http, /* I - Connection to server */
request = ippNewRequest(CUPS_GET_CLASSES);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, user);
if (user)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, user);
cgiGetAttributes(request, "classes.tmpl");
@@ -419,7 +410,7 @@ show_class(http_t *http, /* I - Connection to server */
*/
cgiFormEncode(uri, pclass, sizeof(uri));
snprintf(refresh, sizeof(refresh), "10;/classes/%s", uri);
snprintf(refresh, sizeof(refresh), "10;URL=/classes/%s", uri);
cgiSetVariable("refresh_page", refresh);
}
+426 -78
Ver Arquivo
@@ -3,23 +3,14 @@
*
* On-line help index routines for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* 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
* 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/".
*
* Contents:
*
@@ -28,13 +19,16 @@
* 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.
*/
/*
@@ -45,11 +39,118 @@
#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);
@@ -63,6 +164,7 @@ 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);
/*
@@ -84,9 +186,6 @@ 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);
}
@@ -157,6 +256,7 @@ 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",
@@ -192,12 +292,14 @@ helpLoadIndex(const char *hifile, /* I - Index filename */
cupsFileLock(fp, 1);
if (cupsFileGets(fp, line, sizeof(line)) && !strcmp(line, "HELPV1"))
if (cupsFileGets(fp, line, sizeof(line)) && !strcmp(line, "HELPV2"))
{
/*
* Got a valid header line, now read the data lines...
*/
node = NULL;
while (cupsFileGets(fp, line, sizeof(line)))
{
/*
@@ -205,41 +307,80 @@ helpLoadIndex(const char *hifile, /* I - Index filename */
*
* filename mtime offset length "section" "text"
* filename#anchor offset length "text"
* SP count word
*/
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)
if (line[0] == ' ')
{
/*
* Get section...
* 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);
}
else
{
/*
* Add a node...
*/
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 ++;
sectptr = ptr;
text = ptr;
while (*ptr && *ptr != '\"')
ptr ++;
@@ -249,33 +390,14 @@ helpLoadIndex(const char *hifile, /* I - Index filename */
*ptr++ = '\0';
strlcpy(section, sectptr, sizeof(section));
if ((node = help_new_node(filename, anchor, section, text,
mtime, offset, length)) == NULL)
break;
while (isspace(*ptr & 255))
ptr ++;
node->score = -1;
cupsArrayAdd(hi->nodes, node);
}
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);
}
}
@@ -339,6 +461,7 @@ 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));
@@ -356,7 +479,7 @@ helpSaveIndex(help_index_t *hi, /* I - Index */
cupsFileLock(fp, 1);
cupsFilePuts(fp, "HELPV1\n");
cupsFilePuts(fp, "HELPV2\n");
for (node = (help_node_t *)cupsArrayFirst(hi->nodes);
node;
@@ -382,6 +505,16 @@ 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);
@@ -407,6 +540,7 @@ 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 */
@@ -487,16 +621,27 @@ helpSearchIndex(help_index_t *hi, /* I - Index */
continue;
else if (filename && strcmp(node->filename, filename))
continue;
else if ((matches = cgiDoSearch(sc, node->text)) > 0)
else
{
/*
* Found a match, add the node to the search index...
*/
matches = cgiDoSearch(sc, node->text);
node->score = matches;
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;
cupsArrayAdd(search->nodes, node);
cupsArrayAdd(search->sorted, node);
if (matches > 0)
{
/*
* Found a match, add the node to the search index...
*/
node->score = matches;
cupsArrayAdd(search->nodes, node);
cupsArrayAdd(search->sorted, node);
}
}
/*
@@ -513,6 +658,61 @@ 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.
*/
@@ -520,6 +720,9 @@ helpSearchIndex(help_index_t *hi, /* I - Index */
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)
@@ -537,10 +740,36 @@ 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.
*/
@@ -661,12 +890,15 @@ 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",
@@ -818,6 +1050,17 @@ 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;
@@ -842,7 +1085,7 @@ help_load_file(
if (isspace(*ptr & 255))
{
while (isspace(*ptr & 255))
*ptr ++;
ptr ++;
*text++ = ' ';
}
@@ -861,9 +1104,99 @@ 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...
*/
@@ -978,6 +1311,21 @@ 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$".
*/
+15 -17
Ver Arquivo
@@ -3,23 +3,14 @@
*
* On-line help index definitions for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* 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
* 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/".
*/
#ifndef _CUPS_HELP_INDEX_H_
@@ -36,19 +27,26 @@
* Data structures...
*/
typedef struct /**** Help node structure... ****/
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... ****/
{
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 structure ****/
typedef struct help_index_s /**** Help index structure ****/
{
int search; /* 1 = search index, 0 = normal */
cups_array_t *nodes; /* Nodes sorted by filename */
+8 -15
Ver Arquivo
@@ -3,23 +3,14 @@
*
* 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 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
* 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/".
*
* Contents:
*
@@ -160,6 +151,7 @@ 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...
@@ -187,7 +179,8 @@ main(int argc, /* I - Number of command-line arguments */
topic = cgiGetVariable("TOPIC");
si = helpSearchIndex(hi, query, topic, helpfile);
fprintf(stderr, "DEBUG: query=\"%s\", topic=\"%s\"\n", query, topic);
fprintf(stderr, "DEBUG: query=\"%s\", topic=\"%s\"\n",
query ? query : "(null)", topic ? topic : "(null)");
if (si)
{
+7 -15
Ver Arquivo
@@ -3,23 +3,14 @@
*
* 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 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
* 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/".
*
* Contents:
*
@@ -175,7 +166,8 @@ cgi_null_passwd(const char *prompt) /* I - Prompt string (unused) */
{
(void)prompt;
fprintf(stderr, "DEBUG: cgi_null_passwd(prompt=\"%s\") called!\n", prompt);
fprintf(stderr, "DEBUG: cgi_null_passwd(prompt=\"%s\") called!\n",
prompt ? prompt : "(null)");
return (NULL);
}
+184 -37
Ver Arquivo
@@ -3,23 +3,14 @@
*
* CGI <-> IPP variable routines for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products.
* Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* 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
* 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/".
*
* Contents:
*
@@ -110,6 +101,7 @@ cgiGetAttributes(ipp_t *request, /* I - IPP request */
*/
num_attrs = 0;
attrs[0] = NULL; /* Eliminate compiler warning */
while ((ch = getc(in)) != EOF)
if (ch == '\\')
@@ -166,6 +158,8 @@ cgiGetAttributes(ipp_t *request, /* I - IPP request */
for (i = 0; i < num_attrs; i ++)
free(attrs[i]);
}
fclose(in);
}
@@ -480,10 +474,16 @@ cgiMoveJobs(http_t *http, /* I - Connection to server */
if (cupsLastError() <= IPP_OK_CONFLICT)
{
cgiRewriteURL(job_printer_uri, resource, sizeof(resource), NULL);
cgiFormEncode(uri, resource, sizeof(uri));
snprintf(refresh, sizeof(refresh), "2;%s", uri);
cgiSetVariable("refresh_page", refresh);
const char *path = strstr(job_printer_uri, "/printers/");
if (!path)
path = strstr(job_printer_uri, "/classes/");
if (path)
{
cgiFormEncode(uri, path, sizeof(uri));
snprintf(refresh, sizeof(refresh), "2;URL=%s", uri);
cgiSetVariable("refresh_page", refresh);
}
}
if (job_id)
@@ -531,8 +531,7 @@ cgiPrintTestPage(http_t *http, /* I - Connection to server */
* See who is logged in...
*/
if ((user = getenv("REMOTE_USER")) == NULL)
user = "guest";
user = getenv("REMOTE_USER");
/*
* Locate the test page file...
@@ -570,8 +569,9 @@ cgiPrintTestPage(http_t *http, /* I - Connection to server */
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, uri);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, user);
if (user)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, user);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name",
NULL, "Test Page");
@@ -598,9 +598,14 @@ cgiPrintTestPage(http_t *http, /* I - Connection to server */
*/
cgiFormEncode(uri, resource, sizeof(uri));
snprintf(refresh, sizeof(refresh), "2;%s", uri);
snprintf(refresh, sizeof(refresh), "2;URL=%s", uri);
cgiSetVariable("refresh_page", refresh);
}
else if (cupsLastError() == IPP_NOT_AUTHORIZED)
{
puts("Status: 401\n");
exit(0);
}
cgiStartHTML(cgiText(_("Print Test Page")));
@@ -627,7 +632,7 @@ cgiRewriteURL(const char *uri, /* I - Current URI */
int urlsize, /* I - Size of URL buffer */
const char *newresource) /* I - Replacement resource */
{
char method[HTTP_MAX_URI],
char scheme[HTTP_MAX_URI],
userpass[HTTP_MAX_URI],
hostname[HTTP_MAX_URI],
rawresource[HTTP_MAX_URI],
@@ -674,13 +679,13 @@ cgiRewriteURL(const char *uri, /* I - Current URI */
* Convert the URI to a URL...
*/
httpSeparateURI(HTTP_URI_CODING_ALL, uri, method, sizeof(method), userpass,
httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme), userpass,
sizeof(userpass), hostname, sizeof(hostname), &port,
rawresource, sizeof(rawresource));
if (!strcmp(method, "ipp") ||
!strcmp(method, "http") ||
!strcmp(method, "https"))
if (!strcmp(scheme, "ipp") ||
!strcmp(scheme, "http") ||
!strcmp(scheme, "https"))
{
if (newresource)
{
@@ -719,7 +724,9 @@ cgiRewriteURL(const char *uri, /* I - Current URI */
* Map local access to a local URI...
*/
if (!strcasecmp(hostname, "localhost") ||
if (!strcasecmp(hostname, "127.0.0.1") ||
!strcasecmp(hostname, "[::1]") ||
!strcasecmp(hostname, "localhost") ||
!strncasecmp(hostname, "localhost.", 10) ||
!strcasecmp(hostname, server) ||
!strcasecmp(hostname, servername))
@@ -774,7 +781,7 @@ cgiSetIPPObjectVars(
fprintf(stderr, "DEBUG2: cgiSetIPPObjectVars(obj=%p, prefix=\"%s\", "
"element=%d)\n",
obj, prefix, element);
obj, prefix ? prefix : "(null)", element);
/*
* Set common CGI template variables...
@@ -827,6 +834,144 @@ 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...
@@ -913,7 +1058,7 @@ cgiSetIPPObjectVars(
snprintf(valptr, sizeof(value) - (valptr - value),
"<A HREF=\"%s\">%s</A>", url,
strrchr(url, '/') + 1);
strrchr(attr->values[i].string.text, '/') + 1);
}
else
cgiRewriteURL(attr->values[i].string.text, valptr,
@@ -977,7 +1122,9 @@ cgiSetIPPVars(ipp_t *response, /* I - Response data to be copied... */
fprintf(stderr, "DEBUG2: cgiSetIPPVars(response=%p, filter_name=\"%s\", "
"filter_value=\"%s\", prefix=\"%s\", parent_el=%d)\n",
response, filter_name, filter_value, prefix, parent_el);
response, filter_name ? filter_name : "(null)",
filter_value ? filter_value : "(null)",
prefix ? prefix : "(null)", parent_el);
/*
* Set common CGI template variables...
@@ -1035,9 +1182,9 @@ cgiSetIPPVars(ipp_t *response, /* I - Response data to be copied... */
attr = cgiSetIPPObjectVars(attr, prefix, element);
}
fprintf(stderr, "DEBUG2: Returing %d from cgiSetIPPVars()...\n", element + 1);
fprintf(stderr, "DEBUG2: Returing %d from cgiSetIPPVars()...\n", element);
return (element + 1);
return (element);
}
@@ -1099,8 +1246,8 @@ cgiShowJobs(http_t *http, /* I - Connection to server */
NULL, url);
}
else
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "job-uri", NULL,
"ipp://localhost/jobs");
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL,
"ipp://localhost/");
if ((which_jobs = cgiGetVariable("which_jobs")) != NULL)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "which-jobs",
+24 -14
Ver Arquivo
@@ -3,23 +3,14 @@
*
* Job status CGI for the Common UNIX Printing System (CUPS).
*
* Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* 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
* 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/".
*
* Contents:
*
@@ -181,6 +172,25 @@ 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);
}
else if (cupsLastError() == IPP_NOT_AUTHORIZED)
{
puts("Status: 401\n");
exit(0);
}
cgiStartHTML(cgiText(_("Jobs")));
if (cupsLastError() > IPP_OK_CONFLICT)
+18 -22
Ver Arquivo
@@ -3,23 +3,14 @@
*
* Printer status CGI for the Common UNIX Printing System (CUPS).
*
* Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* 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
* 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/".
*
* Contents:
*
@@ -98,8 +89,7 @@ main(int argc, /* I - Number of command-line arguments */
* See who is logged in...
*/
if ((user = getenv("REMOTE_USER")) == NULL)
user = "guest";
user = getenv("REMOTE_USER");
/*
* Connect to the HTTP server...
@@ -287,9 +277,14 @@ print_command(http_t *http, /* I - Connection to server */
*/
cgiFormEncode(uri, resource, sizeof(uri));
snprintf(refresh, sizeof(refresh), "2;%s", uri);
snprintf(refresh, sizeof(refresh), "2;URL=%s", uri);
cgiSetVariable("refresh_page", refresh);
}
else if (cupsLastError() == IPP_NOT_AUTHORIZED)
{
puts("Status: 401\n");
exit(0);
}
cgiStartHTML(cgiText(_("Printer Maintenance")));
@@ -331,7 +326,7 @@ show_all_printers(http_t *http, /* I - Connection to server */
fprintf(stderr, "DEBUG: show_all_printers(http=%p, user=\"%s\")\n",
http, user);
http, user ? user : "(null)");
/*
* Show the standard header...
@@ -357,8 +352,9 @@ show_all_printers(http_t *http, /* I - Connection to server */
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM,
"printer-type-mask", CUPS_PRINTER_CLASS);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, user);
if (user)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, user);
cgiGetAttributes(request, "printers.tmpl");
@@ -543,7 +539,7 @@ show_printer(http_t *http, /* I - Connection to server */
fprintf(stderr, "DEBUG: show_printer(http=%p, printer=\"%s\")\n",
http, printer);
http, printer ? printer : "(null)");
/*
* Build an IPP_GET_PRINTER_ATTRIBUTES request, which requires the following
@@ -594,7 +590,7 @@ show_printer(http_t *http, /* I - Connection to server */
*/
cgiFormEncode(uri, printer, sizeof(uri));
snprintf(refresh, sizeof(refresh), "10;/printers/%s", uri);
snprintf(refresh, sizeof(refresh), "10;URL=/printers/%s", uri);
cgiSetVariable("refresh_page", refresh);
}
+25 -19
Ver Arquivo
@@ -3,23 +3,14 @@
*
* Search routines for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2005 by Easy Software Products.
* Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* 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
* 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/".
*
* Contents:
*
@@ -62,7 +53,8 @@ cgiCompileSearch(const char *query) /* I - Query string */
* Allocate a regular expression storage structure...
*/
re = (regex_t *)calloc(1, sizeof(regex_t));
if ((re = (regex_t *)calloc(1, sizeof(regex_t))) == NULL)
return (NULL);
/*
* Allocate a buffer to hold the regular expression string, starting
@@ -74,7 +66,11 @@ cgiCompileSearch(const char *query) /* I - Query string */
if (slen < 1024)
slen = 1024;
s = (char *)malloc(slen);
if ((s = (char *)malloc(slen)) == NULL)
{
free(re);
return (NULL);
}
/*
* Copy the query string to the regular expression, handling basic
@@ -171,7 +167,9 @@ cgiCompileSearch(const char *query) /* I - Query string */
* string + RE overhead...
*/
wlen = (sptr - s) + 4 * wlen + 2 * strlen(prefix) + 4;
wlen = (sptr - s) + 2 * 4 * wlen + 2 * strlen(prefix) + 11;
if (lword)
wlen += strlen(lword);
if (wlen > slen)
{
@@ -225,6 +223,8 @@ cgiCompileSearch(const char *query) /* I - Query string */
*sptr++ = *qptr++;
}
*sptr = '\0';
/*
* For "word1 AND word2", add reciprocal "word2 AND word1"...
*/
@@ -234,7 +234,13 @@ cgiCompileSearch(const char *query) /* I - Query string */
char *lword2; /* New "last word" */
lword2 = strdup(sword);
if ((lword2 = strdup(sword)) == NULL)
{
free(lword);
free(s);
free(re);
return (NULL);
}
strcpy(sptr, ".*|.*");
sptr += 5;
+85 -53
Ver Arquivo
@@ -3,23 +3,14 @@
*
* CGI template function.
*
* Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* 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
* 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/".
*
* Contents:
*
@@ -44,6 +35,7 @@
static void cgi_copy(FILE *out, FILE *in, int element, char term,
int indent);
static void cgi_puts(const char *s, FILE *out);
static void cgi_puturi(const char *s, FILE *out);
/*
@@ -58,8 +50,15 @@ cgiCopyTemplateFile(FILE *out, /* I - Output file */
FILE *in; /* Input file */
fprintf(stderr, "DEBUG: cgiCopyTemplateFile(out=%p, tmpl=\"%s\")\n", out,
tmpl);
fprintf(stderr, "DEBUG2: cgiCopyTemplateFile(out=%p, tmpl=\"%s\")\n", out,
tmpl ? tmpl : "(null)");
/*
* Range check input...
*/
if (!tmpl || !out)
return;
/*
* Open the template file...
@@ -68,7 +67,7 @@ cgiCopyTemplateFile(FILE *out, /* I - Output file */
if ((in = fopen(tmpl, "r")) == NULL)
{
fprintf(stderr, "ERROR: Unable to open template file \"%s\" - %s\n",
tmpl, strerror(errno));
tmpl ? tmpl : "(null)", strerror(errno));
return;
}
@@ -93,36 +92,34 @@ 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 */
locale[16], /* Locale name */
*locptr; /* Pointer into locale name */
const char *directory, /* Directory for templates */
*lang; /* Language */
FILE *in; /* Input file */
fprintf(stderr, "DEBUG: cgiCopyTemplateLang(tmpl=\"%s\")\n", tmpl);
fprintf(stderr, "DEBUG2: cgiCopyTemplateLang(tmpl=\"%s\")\n",
tmpl ? tmpl : "(null)");
/*
* Convert the language to a locale name...
*/
locale[0] = '\0';
if ((lang = getenv("LANG")) != NULL)
{
for (i = 0; lang[i] && i < 15; i ++)
if (isalnum(lang[i] & 255))
locale[i] = tolower(lang[i]);
else if (lang[i] == '-')
locale[i] = '_';
else
break;
locale[0] = '/';
strlcpy(locale + 1, lang, sizeof(locale) - 1);
locale[i] = '\0';
if ((locptr = strchr(locale, '.')) != NULL)
*locptr = '\0'; /* Strip charset */
}
else
locale[0] = '\0';
fprintf(stderr, "DEBUG: locale=\"%s\"...\n", locale);
fprintf(stderr, "DEBUG: lang=\"%s\", locale=\"%s\"...\n",
lang ? lang : "(null)", locale);
/*
* See if we have a template file for this language...
@@ -130,23 +127,26 @@ cgiCopyTemplateLang(const char *tmpl) /* I - Base filename */
directory = cgiGetTemplateDir();
snprintf(filename, sizeof(filename), "%s/%s/%s", directory, locale, tmpl);
if (access(filename, 0))
snprintf(filename, sizeof(filename), "%s%s/%s", directory, locale, tmpl);
if ((in = fopen(filename, "r")) == NULL)
{
locale[2] = '\0';
locale[3] = '\0';
snprintf(filename, sizeof(filename), "%s/%s/%s", directory, locale, tmpl);
if (access(filename, 0))
snprintf(filename, sizeof(filename), "%s%s/%s", directory, locale, tmpl);
if ((in = fopen(filename, "r")) == NULL)
{
snprintf(filename, sizeof(filename), "%s/%s", directory, tmpl);
in = fopen(filename, "r");
}
}
fprintf(stderr, "DEBUG: Template file is \"%s\"...\n", filename);
fprintf(stderr, "DEBUG2: Template file is \"%s\"...\n", filename);
/*
* Open the template file...
*/
if ((in = fopen(filename, "r")) == NULL)
if (!in)
{
fprintf(stderr, "ERROR: Unable to open template file \"%s\" - %s\n",
filename, strerror(errno));
@@ -235,9 +235,10 @@ cgi_copy(FILE *out, /* I - Output file */
char outval[1024], /* Formatted output string */
compare[1024]; /* Comparison string */
int result; /* Result of comparison */
int uriencode; /* Encode as URI */
fprintf(stderr, "DEBUG: %*sStarting at file position %ld...\n", indent, "",
fprintf(stderr, "DEBUG2: %*sStarting at file position %ld...\n", indent, "",
ftell(in));
/*
@@ -253,9 +254,13 @@ cgi_copy(FILE *out, /* I - Output file */
* Get a variable name...
*/
uriencode = 0;
for (s = name; (ch = getc(in)) != EOF;)
if (strchr("}]<>=! \t\n", ch))
break;
else if (s == name && ch == '%')
uriencode = 1;
else if (s > name && ch == '?')
break;
else if (s < (name + sizeof(name) - 1))
@@ -265,7 +270,7 @@ cgi_copy(FILE *out, /* I - Output file */
if (s == name && isspace(ch & 255))
{
fprintf(stderr, "DEBUG: %*sLone { at %ld...\n", indent, "", ftell(in));
fprintf(stderr, "DEBUG2: %*sLone { at %ld...\n", indent, "", ftell(in));
if (out)
{
@@ -277,7 +282,7 @@ cgi_copy(FILE *out, /* I - Output file */
}
if (ch == '}')
fprintf(stderr, "DEBUG: %*s\"{%s}\" at %ld...\n", indent, "", name,
fprintf(stderr, "DEBUG2: %*s\"{%s}\" at %ld...\n", indent, "", name,
ftell(in));
/*
@@ -341,7 +346,7 @@ cgi_copy(FILE *out, /* I - Output file */
pos = ftell(in);
fprintf(stderr, "DEBUG: %*sLooping on \"%s\" at %ld, count=%d...\n",
fprintf(stderr, "DEBUG2: %*sLooping on \"%s\" at %ld, count=%d...\n",
indent, "", name + 1, pos, count);
if (count > 0)
@@ -357,7 +362,7 @@ cgi_copy(FILE *out, /* I - Output file */
else
cgi_copy(NULL, in, 0, '}', indent + 2);
fprintf(stderr, "DEBUG: %*sFinished looping on \"%s\"...\n", indent,
fprintf(stderr, "DEBUG2: %*sFinished looping on \"%s\"...\n", indent,
"", name + 1);
continue;
@@ -399,7 +404,14 @@ cgi_copy(FILE *out, /* I - Output file */
*/
if (out)
cgi_puts(outptr, out);
{
if (uriencode)
cgi_puturi(outptr, out);
else if (!strcasecmp(name, "?cupsdconf_default"))
fputs(outptr, stdout);
else
cgi_puts(outptr, out);
}
continue;
}
@@ -488,7 +500,7 @@ cgi_copy(FILE *out, /* I - Output file */
if (ch != '?')
{
fprintf(stderr,
"DEBUG: %*sBad terminator '%c' at file position %ld...\n",
"DEBUG2: %*sBad terminator '%c' at file position %ld...\n",
indent, "", ch, ftell(in));
return;
}
@@ -518,7 +530,7 @@ cgi_copy(FILE *out, /* I - Output file */
}
fprintf(stderr,
"DEBUG: %*sStarting \"{%s%c%s\" at %ld, result=%d...\n",
"DEBUG2: %*sStarting \"{%s%c%s\" at %ld, result=%d...\n",
indent, "", name, op, compare, ftell(in), result);
if (result)
@@ -527,10 +539,10 @@ cgi_copy(FILE *out, /* I - Output file */
* Comparison true; output first part and ignore second...
*/
fprintf(stderr, "DEBUG: %*sOutput first part...\n", indent, "");
fprintf(stderr, "DEBUG2: %*sOutput first part...\n", indent, "");
cgi_copy(out, in, element, ':', indent + 2);
fprintf(stderr, "DEBUG: %*sSkip second part...\n", indent, "");
fprintf(stderr, "DEBUG2: %*sSkip second part...\n", indent, "");
cgi_copy(NULL, in, element, '}', indent + 2);
}
else
@@ -539,14 +551,14 @@ cgi_copy(FILE *out, /* I - Output file */
* Comparison false; ignore first part and output second...
*/
fprintf(stderr, "DEBUG: %*sSkip first part...\n", indent, "");
fprintf(stderr, "DEBUG2: %*sSkip first part...\n", indent, "");
cgi_copy(NULL, in, element, ':', indent + 2);
fprintf(stderr, "DEBUG: %*sOutput second part...\n", indent, "");
fprintf(stderr, "DEBUG2: %*sOutput second part...\n", indent, "");
cgi_copy(out, in, element, '}', indent + 2);
}
fprintf(stderr, "DEBUG: %*sFinished \"{%s%c%s\", out=%p...\n", indent, "",
fprintf(stderr, "DEBUG2: %*sFinished \"{%s%c%s\", out=%p...\n", indent, "",
name, op, compare, out);
}
else if (ch == '\\') /* Quoted char */
@@ -560,11 +572,11 @@ cgi_copy(FILE *out, /* I - Output file */
putc(ch, out);
if (ch == EOF)
fprintf(stderr, "DEBUG: %*sReturning at file position %ld on EOF...\n",
fprintf(stderr, "DEBUG2: %*sReturning at file position %ld on EOF...\n",
indent, "", ftell(in));
else
fprintf(stderr,
"DEBUG: %*sReturning at file position %ld on character '%c'...\n",
"DEBUG2: %*sReturning at file position %ld on character '%c'...\n",
indent, "", ftell(in), ch);
if (ch == EOF && term)
@@ -637,6 +649,26 @@ cgi_puts(const char *s, /* I - String to output */
}
/*
* 'cgi_puturi()' - Put a URI string to the output file, quoting as needed...
*/
static void
cgi_puturi(const char *s, /* I - String to output */
FILE *out) /* I - Output file */
{
while (*s)
{
if (strchr("%&+ <>#=", *s) || *s & 128)
fprintf(out, "%%%02X", *s & 255);
else
putc(*s, out);
s ++;
}
}
/*
* End of "$Id$".
*/
+5 -14
Ver Arquivo
@@ -3,23 +3,14 @@
*
* 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 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
* 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/".
*
* Contents:
*
+12 -17
Ver Arquivo
@@ -3,23 +3,14 @@
*
* Help index test program for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2005 by Easy Software Products.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* 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
* 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/".
*
* Contents:
*
@@ -105,11 +96,15 @@ 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\"\n", i, node->filename, node->anchor,
printf(" %d: %s#%s \"%s\"", i, node->filename, node->anchor,
node->text);
else
printf(" %d: %s \"%s\"\n", i, node->filename, node->text);
printf(" %d: %s \"%s\"", i, node->filename, node->text);
printf(" (%d words)\n", cupsArrayCount(node->words));
}
}
+3 -1
Ver Arquivo
@@ -12,13 +12,15 @@ 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 first anchor.</P>
<P>This&nbsp;is some text for the <em>first</em> 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>
+5 -14
Ver Arquivo
@@ -3,23 +3,14 @@
*
* 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 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
* 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/".
*
* Contents:
*
+50 -26
Ver Arquivo
@@ -3,23 +3,14 @@
*
* CGI form variable and array functions.
*
* Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2005 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* 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
* 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/".
*
* Contents:
*
@@ -239,6 +230,12 @@ cgiInitialize(void)
cupsSetPasswordCB(cgi_passwd);
/*
* Set the locale so that times, etc. are formatted properly...
*/
setlocale(LC_ALL, "");
#ifdef DEBUG
/*
* Disable output buffering to find bugs...
@@ -325,9 +322,15 @@ cgiSetArray(const char *name, /* I - Name of variable */
{
if (element >= var->avalues)
{
const char **temp; /* Temporary pointer */
temp = (const char **)realloc((void *)(var->values),
sizeof(char *) * (element + 16));
if (!temp)
return;
var->avalues = element + 16;
var->values = (const char **)realloc((void *)(var->values),
sizeof(char *) * var->avalues);
var->values = temp;
}
if (element >= var->nvalues)
@@ -365,9 +368,15 @@ cgiSetSize(const char *name, /* I - Name of variable */
if (size >= var->avalues)
{
const char **temp; /* Temporary pointer */
temp = (const char **)realloc((void *)(var->values),
sizeof(char *) * (size + 16));
if (!temp)
return;
var->avalues = size + 16;
var->values = (const char **)realloc((void *)(var->values),
sizeof(char *) * var->avalues);
var->values = temp;
}
if (size > var->nvalues)
@@ -429,7 +438,7 @@ cgi_add_variable(const char *name, /* I - Variable name */
int element, /* I - Array element number */
const char *value) /* I - Variable value */
{
_cgi_var_t *var; /* New variable */
_cgi_var_t *var; /* New variable */
if (name == NULL || value == NULL || element < 0 || element > 100000)
@@ -441,19 +450,29 @@ cgi_add_variable(const char *name, /* I - Variable name */
if (form_count >= form_alloc)
{
if (form_alloc == 0)
form_vars = malloc(sizeof(_cgi_var_t) * 16);
else
form_vars = realloc(form_vars, (form_alloc + 16) * sizeof(_cgi_var_t));
_cgi_var_t *temp_vars; /* Temporary form pointer */
if (form_alloc == 0)
temp_vars = malloc(sizeof(_cgi_var_t) * 16);
else
temp_vars = realloc(form_vars, (form_alloc + 16) * sizeof(_cgi_var_t));
if (!temp_vars)
return;
form_vars = temp_vars;
form_alloc += 16;
}
var = form_vars + form_count;
var = form_vars + form_count;
if ((var->values = calloc(element + 1, sizeof(char *))) == NULL)
return;
var->name = strdup(name);
var->nvalues = element + 1;
var->avalues = element + 1;
var->values = calloc(element + 1, sizeof(char *));
var->values[element] = strdup(value);
form_count ++;
@@ -787,11 +806,15 @@ cgi_initialize_post(void)
for (tbytes = 0; tbytes < length; tbytes += nbytes)
if ((nbytes = read(0, data + tbytes, length - tbytes)) < 0)
{
if (errno != EAGAIN)
{
free(data);
return (0);
}
else
nbytes = 0;
}
data[length] = '\0';
@@ -943,7 +966,8 @@ cgi_passwd(const char *prompt) /* I - Prompt (not used) */
{
(void)prompt;
fprintf(stderr, "DEBUG: cgi_passwd(prompt=\"%s\") called!\n", prompt);
fprintf(stderr, "DEBUG: cgi_passwd(prompt=\"%s\") called!\n",
prompt ? prompt : "(null)");
/*
* Send a 401 (unauthorized) status to the server, so it can notify
+7 -18
Ver Arquivo
@@ -3,23 +3,14 @@
#
# 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 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
# 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/".
#
include ../Makedefs
@@ -28,7 +19,7 @@ include ../Makedefs
# Config files...
#
KEEP = cupsd.conf
KEEP = cupsd.conf snmp.conf
REPLACE = mime.convs mime.types
@@ -58,7 +49,6 @@ depend:
#
install: all
$(INSTALL_DIR) -m 755 $(SERVERROOT)
for file in $(KEEP); do \
if test -r $(SERVERROOT)/$$file ; then \
$(INSTALL_CONFIG) $$file $(SERVERROOT)/$$file.N ; \
@@ -74,8 +64,7 @@ install: all
if test -r $(SERVERROOT)/$$file ; then \
$(MV) $(SERVERROOT)/$$file $(SERVERROOT)/$$file.O ; \
fi ; \
$(INSTALL_CONFIG) $$file $(SERVERROOT) ; \
chgrp $(CUPS_GROUP) $(SERVERROOT)/$$file || true; \
$(INSTALL_DATA) $$file $(SERVERROOT) ; \
done
-if test x$(PAMDIR) != x; then \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(PAMDIR); \
+16 -10
Ver Arquivo
@@ -12,6 +12,7 @@ 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@
@@ -20,7 +21,7 @@ Listen localhost:@DEFAULT_IPP_PORT@
# Show shared printers on the local network.
Browsing On
BrowseOrder allow,deny
BrowseAllow @LOCAL
BrowseAllow all
# Default authentication type, when authentication is required...
DefaultAuthType Basic
@@ -28,41 +29,46 @@ DefaultAuthType Basic
# Restrict access to the server...
<Location />
Order allow,deny
Allow localhost
</Location>
# Restrict access to the admin pages...
<Location /admin>
@ENCRYPTION_REQUIRED@
Order allow,deny
Allow localhost
</Location>
# Restrict access to configuration files...
<Location /admin/conf>
AuthType Basic
AuthType Default
Require user @SYSTEM
Order allow,deny
Allow localhost
</Location>
# Set the default printer/job policies...
<Policy default>
# Job-related operations must be done by the owner or an adminstrator...
# Job-related operations must be done by the owner or an administrator...
<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 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
# 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
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 @SYSTEM
Require user @OWNER @CUPS_DEFAULT_PRINTADMIN_AUTH@
Order deny,allow
</Limit>
+17 -23
Ver Arquivo
@@ -1,25 +1,20 @@
#
# "$Id: mime.convs 4559 2005-08-04 18:40:13Z mike $"
# "$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.
#
# MIME converts file for the Common UNIX Printing System (CUPS).
#
# Copyright 1997-2005 by Easy Software Products.
# Copyright 2007 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
# 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
# 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/".
#
########################################################################
@@ -100,20 +95,19 @@ 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 now part of ESP Ghostscript...
#application/vnd.cups-postscript application/vnd.cups-raster 100 pstoraster
# pstoraster is part of GPL Ghostscript...
application/vnd.cups-postscript application/vnd.cups-raster 100 pstoraster
########################################################################
#
# Raw filter...
#
# Uncomment the following filter and the application/octet-stream type
# in mime.types to allow printing of arbitrary files without the -oraw
# option.
# Uncomment the following filter to allow printing of arbitrary files
# without the -oraw option.
#
#application/octet-stream application/vnd.cups-raw 0 -
@DEFAULT_RAW_PRINTING@application/octet-stream application/vnd.cups-raw 0 -
#
# End of "$Id: mime.convs 4559 2005-08-04 18:40:13Z mike $".
# End of "$Id$".
#
+37 -31
Ver Arquivo
@@ -1,25 +1,20 @@
#
# "$Id: mime.types 4590 2005-08-24 19:25:49Z mike $"
# "$Id: mime.types 6649 2007-07-11 21:46:42Z mike $"
#
# MIME types file for the Common UNIX Printing System (CUPS).
#
# Copyright 1997-2005 by Easy Software Products.
# 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.
#
# These coded instructions, statements, and computer programs are the
# 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
# 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/".
#
########################################################################
@@ -74,18 +69,20 @@
application/pdf pdf string(0,%PDF)
application/postscript ai eps ps string(0,%!) string(0,<04>%!) \
contains(0,128,<1B>%-12345X) + \
(contains(0,1024,"LANGUAGE=POSTSCRIPT") \
contains(0,1024,"LANGUAGE = Postscript") \
contains(0,1024,"LANGUAGE = PostScript") \
contains(0,1024,"LANGUAGE = POSTSCRIPT"))
application/vnd.hp-HPGL hpgl string(0,<1B>&)\
(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 \
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,1024,"LANGUAGE=HPGL") \
contains(0,1024,"LANGUAGE = HPGL")))
(contains(0,4096,"LANGUAGE=HPGL") \
contains(0,4096,"LANGUAGE = HPGL")))
########################################################################
#
@@ -99,7 +96,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) string(0,II)
image/tiff tiff tif string(0,MM<002A>) string(0,II<2A00>)
image/x-photocd pcd string(2048,PCD_IPI)
image/x-portable-anymap pnm
image/x-portable-bitmap pbm string(0,P1) string(0,P4)
@@ -138,6 +135,15 @@ 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...
@@ -145,25 +151,25 @@ text/css css
application/vnd.cups-command string(0,'#CUPS-COMMAND')
application/vnd.cups-form string(0,"<CUPSFORM>")
application/vnd.cups-pdf
application/vnd.cups-postscript
application/vnd.cups-ppd ppd string(0,"*PPD-Adobe:")
application/vnd.cups-raster string(0,"RaSt") string(0,"tSaR")
application/vnd.cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) \
string(0,<1B>@) \
(contains(0,128,<1B>%-12345X) + \
(contains(0,1024,"LANGUAGE=PCL") \
contains(0,1024,"LANGUAGE = PCL")))
(contains(0,4096,"LANGUAGE=PCL") \
contains(0,4096,"LANGUAGE = PCL")))
########################################################################
#
# Raw print file support...
#
# Uncomment the following type and the application/octet-stream
# filter line in mime.convs to allow raw file printing without the
# -oraw option.
# Comment the following type to prevent raw file printing.
#
#application/octet-stream
application/octet-stream
#
# End of "$Id: mime.types 4590 2005-08-24 19:25:49Z mike $".
# End of "$Id: mime.types 6649 2007-07-11 21:46:42Z mike $".
#
+13
Ver Arquivo
@@ -0,0 +1,13 @@
#
# "$Id$"
#
# Sample SNMP configuration file for CUPS. See "man cups-smnp.conf" for a
# complete description of this file.
#
@CUPS_SNMP_ADDRESS@
@CUPS_SNMP_COMMUNITY@
#
# End of "$Id$".
#
+140
Ver Arquivo
@@ -0,0 +1,140 @@
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
+122 -92
Ver Arquivo
@@ -1,39 +1,27 @@
dnl
dnl "$Id: cups-common.m4 5229 2006-03-05 16:48:12Z mike $"
dnl "$Id: cups-common.m4 8317 2009-02-02 22:03:58Z mike $"
dnl
dnl Common configuration stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
dnl Copyright 2007-2008 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
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 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 We need at least autoconf 2.50...
AC_PREREQ(2.50)
dnl We need at least autoconf 2.60...
AC_PREREQ(2.60)
dnl Set the name of the config header file...
AC_CONFIG_HEADER(config.h)
dnl Versio number information...
CUPS_VERSION="1.2svn"
dnl Version number information...
CUPS_VERSION="1.3.10"
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
AC_SUBST(CUPS_VERSION)
AC_SUBST(CUPS_REVISION)
@@ -63,7 +51,7 @@ AC_PATH_PROG(LD,ld)
AC_PATH_PROG(LN,ln)
AC_PATH_PROG(MV,mv)
AC_PATH_PROG(RM,rm)
AC_PATH_PROG(RM,rmdir)
AC_PATH_PROG(RMDIR,rmdir)
AC_PATH_PROG(SED,sed)
AC_PATH_PROG(STRIP,strip)
@@ -79,9 +67,10 @@ fi
dnl Static library option...
INSTALLSTATIC=""
AC_ARG_ENABLE(install_static, [ --enable-static install static libraries, default=no])
AC_ARG_ENABLE(static, [ --enable-static install static libraries, default=no])
if test x$enable_install_static = xyes; then
if test x$enable_static = xyes; then
echo Installing static libraries...
INSTALLSTATIC="installstatic"
fi
@@ -131,6 +120,9 @@ 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.
AC_CHECK_FUNCS(strdup strcasecmp strncasecmp strlcat strlcpy)
@@ -163,8 +155,7 @@ esac
AC_CHECK_FUNCS(sigaction)
dnl Checks for wait functions.
AC_CHECK_FUNCS(waitpid)
AC_CHECK_FUNCS(wait3)
AC_CHECK_FUNCS(waitpid wait3)
dnl See if the tm structure has the tm_gmtoff member...
AC_MSG_CHECKING(for tm_gmtoff member in tm structure)
@@ -174,6 +165,9 @@ 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*)
@@ -186,63 +180,11 @@ esac
AC_SUBST(ARFLAGS)
dnl Extra platform-specific libraries...
dnl Prep libraries specifically for cupsd and backends...
BACKLIBS=""
CUPSDLIBS=""
DBUSDIR=""
AC_ARG_ENABLE(dbus, [ --enable-dbus enable DBUS support, default=auto])
case $uname in
Darwin*)
BACKLIBS="-framework IOKit"
CUPSDLIBS="-framework IOKit -framework SystemConfiguration"
LIBS="-framework CoreFoundation $LIBS"
dnl Check for CFLocaleCreateCanonicalLocaleIdentifierFromString...
AC_MSG_CHECKING(for CFLocaleCreateCanonicalLocaleIdentifierFromString)
if test "$uname" = "Darwin" -a $uversion -ge 70; then
AC_DEFINE(HAVE_CF_LOCALE_ID)
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
dnl Check for framework headers...
AC_CHECK_HEADER(CoreFoundation/CoreFoundation.h,AC_DEFINE(HAVE_COREFOUNDATION_H))
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 (Tiger)...
AC_CHECK_HEADER(membership.h,AC_DEFINE(HAVE_MEMBERSHIP_H))
AC_CHECK_FUNCS(mbr_uid_to_uuid)
dnl Check for notify_post support
AC_CHECK_HEADER(notify.h,AC_DEFINE(HAVE_NOTIFY_H))
AC_CHECK_FUNCS(notify_post)
;;
Linux*)
dnl Check for DBUS support
if test "x$enable_dbus" != xno; then
AC_PATH_PROG(PKGCONFIG, pkg-config)
if test "x$PKGCONFIG" != x; then
AC_MSG_CHECKING(for DBUS)
if $PKGCONFIG --exists dbus-1; then
AC_MSG_RESULT(yes)
AC_CHECK_LIB(dbus-1,
dbus_message_iter_init_append,
AC_DEFINE(HAVE_DBUS)
CFLAGS="$CFLAGS `$PKGCONFIG --cflags dbus-1` -DDBUS_API_SUBJECT_TO_CHANGE"
CUPSDLIBS="`$PKGCONFIG --libs dbus-1`"
DBUSDIR="/etc/dbus-1/system.d")
else
AC_MSG_RESULT(no)
fi
fi
fi
;;
esac
AC_SUBST(BACKLIBS)
AC_SUBST(CUPSDLIBS)
dnl See if we have POSIX ACL support...
SAVELIBS="$LIBS"
@@ -251,18 +193,106 @@ AC_SEARCH_LIBS(acl_init, acl, AC_DEFINE(HAVE_ACL_INIT))
CUPSDLIBS="$CUPSDLIBS $LIBS"
LIBS="$SAVELIBS"
AC_SUBST(BACKLIBS)
AC_SUBST(CUPSDLIBS)
dnl Check for DBUS support
if test -d /etc/dbus-1; then
DBUSDIR="/etc/dbus-1"
else
DBUSDIR=""
fi
AC_ARG_ENABLE(dbus, [ --enable-dbus enable DBUS support, default=auto])
AC_ARG_WITH(dbusdir, [ --with-dbusdir set DBUS configuration directory ],
DBUSDIR="$withval")
if test "x$enable_dbus" != xno; then
AC_PATH_PROG(PKGCONFIG, pkg-config)
if test "x$PKGCONFIG" != x; then
AC_MSG_CHECKING(for DBUS)
if $PKGCONFIG --exists dbus-1; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_DBUS)
CFLAGS="$CFLAGS `$PKGCONFIG --cflags dbus-1` -DDBUS_API_SUBJECT_TO_CHANGE"
CUPSDLIBS="$CUPSDLIBS `$PKGCONFIG --libs dbus-1`"
AC_CHECK_LIB(dbus-1,
dbus_message_iter_init_append,
AC_DEFINE(HAVE_DBUS_MESSAGE_ITER_INIT_APPEND),,
`$PKGCONFIG --libs dbus-1`)
else
AC_MSG_RESULT(no)
DBUSDIR=""
fi
fi
fi
AC_SUBST(DBUSDIR)
dnl New default port definition for IPP...
AC_ARG_WITH(ipp-port, [ --with-ipp-port set default port number for IPP ],
DEFAULT_IPP_PORT="$withval",
DEFAULT_IPP_PORT="631")
dnl Extra platform-specific libraries...
CUPS_DEFAULT_PRINTADMIN_AUTH="@SYSTEM"
CUPS_SYSTEM_AUTHKEY=""
FONTS="fonts"
LEGACY_BACKENDS="parallel scsi"
AC_SUBST(DEFAULT_IPP_PORT)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
case $uname in
Darwin*)
FONTS=""
LEGACY_BACKENDS=""
BACKLIBS="$BACKLIBS -framework IOKit"
CUPSDLIBS="$CUPSDLIBS -sectorder __TEXT __text cupsd.order -e start -framework IOKit -framework SystemConfiguration"
LIBS="-framework CoreFoundation $LIBS"
dnl Check for framework headers...
AC_CHECK_HEADER(CoreFoundation/CoreFoundation.h,AC_DEFINE(HAVE_COREFOUNDATION_H))
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...
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_ARG_WITH(adminkey, [ --with-adminkey set the default SystemAuthKey value],
default_adminkey="$withval",
default_adminkey="default")
AC_ARG_WITH(operkey, [ --with-operkey set the default operator @AUTHKEY value],
default_operkey="$withval",
default_operkey="default")
AC_CHECK_HEADER(Security/Authorization.h, [
AC_DEFINE(HAVE_AUTHORIZATION_H)
if test "x$default_adminkey" != xdefault; then
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey $default_adminkey"
elif grep -q system.print.admin /etc/authorization; then
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.print.admin"
else
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.preferences"
fi
if test "x$default_operkey" != xdefault; then
CUPS_DEFAULT_PRINTADMIN_AUTH="@AUTHKEY($default_operkey) @admin @lpadmin"
elif grep -q system.print.operator /etc/authorization; then
CUPS_DEFAULT_PRINTADMIN_AUTH="@AUTHKEY(system.print.operator) @admin @lpadmin"
else
CUPS_DEFAULT_PRINTADMIN_AUTH="@AUTHKEY(system.print.admin) @admin @lpadmin"
fi])
AC_CHECK_HEADER(Security/SecBasePriv.h,AC_DEFINE(HAVE_SECBASEPRIV_H))
;;
esac
AC_SUBST(CUPS_DEFAULT_PRINTADMIN_AUTH)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTADMIN_AUTH, "$CUPS_DEFAULT_PRINTADMIN_AUTH")
AC_SUBST(CUPS_SYSTEM_AUTHKEY)
AC_SUBST(FONTS)
AC_SUBST(LEGACY_BACKENDS)
dnl
dnl End of "$Id: cups-common.m4 5229 2006-03-05 16:48:12Z mike $".
dnl End of "$Id: cups-common.m4 8317 2009-02-02 22:03:58Z mike $".
dnl
+378 -166
Ver Arquivo
@@ -1,25 +1,16 @@
dnl
dnl "$Id: cups-compiler.m4 5274 2006-03-10 20:57:09Z mike $"
dnl "$Id: cups-compiler.m4 7648 2008-06-16 17:41:11Z mike $"
dnl
dnl Compiler stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
dnl Copyright 2007-2008 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
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 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 Clear the debugging and non-shared library options unless the user asks
@@ -28,53 +19,76 @@ OPTIM=""
AC_SUBST(OPTIM)
AC_ARG_WITH(optim, [ --with-optim="flags" set optimization flags ])
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging, default=no],
[if test x$enable_debug = xyes; then
OPTIM="-g"
fi])
dnl Setup general architecture flags...
AC_ARG_WITH(archflags, [ --with-archflags="flags"
set default architecture 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)
C32FLAGS=""
INSTALL32=""
LIB32CUPS=""
LIB32CUPSIMAGE=""
LIB32DIR=""
UNINSTALL32=""
AC_ARG_WITH(arch64flags, [ --with-arch64flags="flags"
specifies 64-bit architecture flags])
ARCH64FLAGS=""
AC_SUBST(ARCH64FLAGS)
AC_SUBST(C32FLAGS)
AC_SUBST(INSTALL32)
AC_SUBST(LIB32CUPS)
AC_SUBST(LIB32CUPSIMAGE)
AC_SUBST(LIB32DIR)
AC_SUBST(UNINSTALL32)
dnl Position-Independent Executable support on Linux...
AC_ARG_ENABLE(pie, [ --enable-pie use GCC -fPIE option, default=no])
AC_ARG_ENABLE(64bit, [ --enable-64bit generate 64-bit libraries on 32/64-bit systems, default=no])
C64FLAGS=""
INSTALL64=""
LIB64CUPS=""
LIB64CUPSIMAGE=""
LIB64DIR=""
UNINSTALL64=""
AC_SUBST(C64FLAGS)
AC_SUBST(INSTALL64)
AC_SUBST(LIB64CUPS)
AC_SUBST(LIB64CUPSIMAGE)
AC_SUBST(LIB64DIR)
AC_SUBST(UNINSTALL64)
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)
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
if test "x$with_optim" = x; then
# Default to optimize-for-size and debug
@@ -84,102 +98,213 @@ if test -n "$GCC"; then
fi
fi
# Generate position-independent code as needed...
if test $PICFLAG = 1 -a $uname != AIX; then
OPTIM="-fPIC $OPTIM"
fi
case $uname in
Darwin*)
if test "x$with_optim" = x; then
if test "x`uname -m`" = xi386; then
# Build universal binaries for OSX on Intel...
OPTIM="-arch i386 -arch ppc $OPTIM"
DSOFLAGS="-arch i386 -arch ppc $DSOFLAGS"
fi
fi
;;
# The -fstack-protector option is available with some versions of
# GCC and adds "stack canaries" which detect when the return address
# has been overwritten, preventing many types of exploit attacks.
AC_MSG_CHECKING(if GCC supports -fstack-protector)
OLDCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fstack-protector"
AC_TRY_COMPILE(,,
OPTIM="$OPTIM -fstack-protector"
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
CFLAGS="$OLDCFLAGS"
Linux*)
if test x$enable_pie = xyes; then
OPTIM="$OPTIM -fpie"
LDFLAGS="$LDFLAGS -pie"
fi
;;
esac
# The -pie option is available with some versions of GCC and adds
# randomization of addresses, which avoids another class of exploits
# that depend on a fixed address for common functions.
if test x$enable_pie = xyes; then
AC_MSG_CHECKING(if GCC supports -pie)
OLDCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -pie -fPIE"
AC_TRY_COMPILE(,,
PIEFLAGS="-pie -fPIE"
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no, ignoring --enable-pie))
CFLAGS="$OLDCFLAGS"
fi
if test "x$with_optim" = x; then
# Add useful warning options for tracking down problems...
OPTIM="-Wall -Wno-format-y2k $OPTIM"
# Additional warning options for alpha testing...
OPTIM="-Wshadow -Wunused $OPTIM"
# Additional warning options for development testing...
if test -d .svn; then
OPTIM="-Wshadow -Wunused $OPTIM"
fi
fi
case "$uname" in
IRIX)
Darwin*)
# -D_FORTIFY_SOURCE=2 adds additional object size
# checking, basically wrapping all string functions
# with buffer-limited ones. Not strictly needed for
# CUPS since we already use buffer-limited calls, but
# this will catch any additions that are broken.
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
if test x$enable_pie = xyes; then
# GCC 4 on Mac OS X needs -Wl,-pie as well
LDFLAGS="$LDFLAGS -Wl,-pie"
fi
;;
HP-UX*)
if test "x$enable_32bit" = xyes; then
# Compiling on an IRIX system, build 32-bit
# libraries...
C32FLAGS="-n32 -mips3"
INSTALL32="install32bit"
LIB32CUPS="libcups.32.so.2"
LIB32CUPSIMAGE="libcupsimage.32.so.2"
LIB32DIR="$prefix/lib32"
UNINSTALL32="uninstall32bit"
# 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
# Compiling on an IRIX system, build 64-bit
# libraries...
C64FLAGS="-64 -mips4"
INSTALL64="install64bit"
LIB64CUPS="libcups.64.so.2"
LIB64CUPSIMAGE="libcupsimage.64.so.2"
LIB64DIR="$prefix/lib64"
UNINSTALL64="uninstall64bit"
# 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...
if test -z "$with_arch32flags"; then
ARCH32FLAGS="-n32 -mips3"
else
ARCH32FLAGS="$with_arch32flags"
fi
if test -z "$with_archflags"; then
if test -z "$with_arch64flags"; then
ARCHFLAGS="-64 -mips4"
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="-64 -mips4"
else
ARCH64FLAGS="$with_arch64flags"
fi
if test -z "$with_archflags"; then
if test -z "$with_arch32flags"; then
ARCHFLAGS="-n32 -mips3"
else
ARCHFLAGS="$with_arch32flags"
fi
fi
fi
;;
Linux*)
# The -z relro option is provided by the Linux linker command to
# make relocatable data read-only.
if test x$enable_relro = xyes; then
RELROFLAGS="-Wl,-z,relro"
fi
if test "x$enable_32bit" = xyes; then
# Compiling on an 64-bit x86 system, build 32-bit
# libraries...
C32FLAGS="-m32"
INSTALL32="install32bit"
LIB32CUPS="libcups.32.so.2"
LIB32CUPSIMAGE="libcupsimage.32.so.2"
LIB32DIR="$exec_prefix/lib"
if test -d /usr/lib32; then
LIB32DIR="${LIB32DIR}32"
# Build 32-bit libraries, 64-bit base...
if test -z "$with_arch32flags"; then
ARCH32FLAGS="-m32"
else
ARCH32FLAGS="$with_arch32flags"
fi
if test -z "$with_archflags"; then
if test -z "$with_arch64flags"; then
ARCHFLAGS="-m64"
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="-m64"
else
ARCH64FLAGS="$with_arch64flags"
fi
if test -z "$with_archflags"; then
if test -z "$with_arch32flags"; then
ARCHFLAGS="-m32"
else
ARCHFLAGS="$with_arch32flags"
fi
fi
UNINSTALL32="uninstall32bit"
fi
;;
SunOS*)
if test "x$enable_32bit" = xyes; then
# Compiling on a Solaris system, build 32-bit
# libraries...
C32FLAGS="-m32"
INSTALL32="install32bit"
LIB32CUPS="libcups.32.so.2"
LIB32CUPSIMAGE="libcupsimage.32.so.2"
LIB32DIR="$exec_prefix/lib/32"
UNINSTALL32="uninstall32bit"
# Build 32-bit libraries, 64-bit base...
if test -z "$with_arch32flags"; then
ARCH32FLAGS="-m32"
else
ARCH32FLAGS="$with_arch32flags"
fi
if test -z "$with_archflags"; then
if test -z "$with_arch64flags"; then
ARCHFLAGS="-m64"
else
ARCHFLAGS="$with_arch64flags"
fi
fi
fi
if test "x$enable_64bit" = xyes; then
# Compiling on a Solaris system, build 64-bit
# libraries...
C64FLAGS="-m64"
INSTALL64="install64bit"
LIB64CUPS="libcups.64.so.2"
LIB64CUPSIMAGE="libcupsimage.64.so.2"
LIB64DIR="$exec_prefix/lib/64"
UNINSTALL64="uninstall64bit"
# Build 64-bit libraries, 32-bit base...
if test -z "$with_arch64flags"; then
ARCH64FLAGS="-m64"
else
ARCH64FLAGS="$with_arch64flags"
fi
if test -z "$with_archflags"; then
if test -z "$with_arch32flags"; then
ARCHFLAGS="-m32"
else
ARCHFLAGS="$with_arch32flags"
fi
fi
fi
;;
esac
else
# Add vendor-specific compiler options...
case $uname in
AIX*)
if test -z "$OPTIM"; then
@@ -200,14 +325,47 @@ else
fi
CFLAGS="-Ae $CFLAGS"
if test "x$with_optim" = x; then
OPTIM="+DAportable $OPTIM"
fi
# Warning 336 is "empty translation unit"
# Warning 829 is passing constant string as char *
CXXFLAGS="+W336,829 $CXXFLAGS"
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
@@ -223,67 +381,102 @@ else
fi
if test "x$enable_32bit" = xyes; then
# Compiling on an IRIX system, build 32-bit
# libraries...
C32FLAGS="-n32 -mips3"
INSTALL32="install32bit"
LIB32CUPS="libcups.32.so.2"
LIB32CUPSIMAGE="libcupsimage.32.so.2"
LIB32DIR="$exec_prefix/lib32"
UNINSTALL32="uninstall32bit"
# Build 32-bit libraries, 64-bit base...
if test -z "$with_arch32flags"; then
ARCH32FLAGS="-n32 -mips3"
else
ARCH32FLAGS="$with_arch32flags"
fi
if test -z "$with_archflags"; then
if test -z "$with_arch64flags"; then
ARCHFLAGS="-64 -mips4"
else
ARCHFLAGS="$with_arch64flags"
fi
fi
fi
if test "x$enable_64bit" = xyes; then
# Compiling on an IRIX system, build 64-bit
# libraries...
C64FLAGS="-64 -mips4"
INSTALL64="install64bit"
LIB64CUPS="libcups.64.so.2"
LIB64CUPSIMAGE="libcupsimage.64.so.2"
LIB64DIR="$exec_prefix/lib64"
UNINSTALL64="uninstall64bit"
# Build 64-bit libraries, 32-bit base...
if test -z "$with_arch64flags"; then
ARCH64FLAGS="-64 -mips4"
else
ARCH64FLAGS="$with_arch64flags"
fi
if test -z "$with_archflags"; then
if test -z "$with_arch32flags"; then
ARCHFLAGS="-n32 -mips3"
else
ARCHFLAGS="$with_arch32flags"
fi
fi
fi
;;
OSF*)
# Tru64 UNIX aka Digital UNIX aka OSF/1
if test -z "$OPTIM"; then
if test "x$with_optim" = x; then
OPTIM="-O"
else
OPTIM="$with_optim"
fi
fi
;;
SunOS*)
# Solaris
if test -z "$OPTIM"; then
if test "x$with_optim" = x; then
OPTIM="-xO4"
OPTIM="-xO2"
else
OPTIM="$with_optim $OPTIM"
fi
fi
if test "x$with_optim" = x; then
# Specify "generic" SPARC output and suppress
# all of Sun's questionable warning messages...
OPTIM="-w $OPTIM -xarch=generic"
fi
if test $PICFLAG = 1; then
OPTIM="-KPIC $OPTIM"
fi
if test "x$enable_32bit" = xyes; then
# Compiling on a Solaris system, build 32-bit
# libraries...
C32FLAGS="-xarch=v8"
INSTALL32="install32bit"
LIB32CUPS="libcups.32.so.2"
LIB32CUPSIMAGE="libcupsimage.32.so.2"
LIB32DIR="$exec_prefix/lib/32"
UNINSTALL32="uninstall32bit"
fi
if test "x$enable_64bit" = xyes; then
# Compiling on a Solaris system, build 64-bit
# libraries...
C64FLAGS="-xarch=v9 -xcode=pic32"
INSTALL64="install64bit"
LIB64CUPS="libcups.64.so.2"
LIB64CUPSIMAGE="libcupsimage.64.so.2"
LIB64DIR="$exec_prefix/lib/64"
UNINSTALL64="uninstall64bit"
# binaries with separate 32-bit libraries...
ARCH32FLAGS="-xarch=generic"
if test "x$with_optim" = x; then
# Suppress all of Sun's questionable
# warning messages, and default to
# 64-bit compiles of everything else...
OPTIM="-w $OPTIM"
fi
if test -z "$with_archflags"; then
if test -z "$with_arch64flags"; then
ARCHFLAGS="-xarch=generic64"
else
ARCHFLAGS="$with_arch64flags"
fi
fi
else
if test "x$enable_64bit" = xyes; then
# Build 64-bit libraries...
ARCH64FLAGS="-xarch=generic64"
fi
if test "x$with_optim" = x; then
# Suppress all of Sun's questionable
# warning messages, and default to
# 32-bit compiles of everything else...
OPTIM="-w $OPTIM"
fi
if test -z "$with_archflags"; then
if test -z "$with_arch32flags"; then
ARCHFLAGS="-xarch=generic"
else
ARCHFLAGS="$with_arch32flags"
fi
fi
fi
;;
UNIX_SVR*)
@@ -306,22 +499,41 @@ else
# cups-support@cups.org...
echo "Building CUPS with default compiler optimizations; contact"
echo "cups-bugs@cups.org with uname and compiler options needed"
echo "for your platform, or set the CFLAGS and CXXFLAGS"
echo "environment variable before running configure."
echo "for your platform, or set the CFLAGS, CXXFLAGS, and LDFLAGS"
echo "environment variables before running configure."
;;
esac
fi
if test $uname = HP-UX; then
# HP-UX 10.20 (at least) needs this definition to get the
# h_errno global...
OPTIM="$OPTIM -D_XOPEN_SOURCE_EXTENDED"
# Add general compiler options per platform...
case $uname in
HP-UX*)
# HP-UX 10.20 (at least) needs this definition to get the
# h_errno global...
OPTIM="$OPTIM -D_XOPEN_SOURCE_EXTENDED"
# 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"
fi
# 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"
;;
Linux*)
# glibc 2.8 and higher breaks peer credentials unless you
# define _GNU_SOURCE...
OPTIM="$OPTIM -D_GNU_SOURCE"
;;
OSF*)
# Tru64 UNIX aka Digital UNIX aka OSF/1 need to be told
# to be POSIX-compliant...
OPTIM="$OPTIM -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_OSF_SOURCE"
;;
esac
dnl
dnl End of "$Id: cups-compiler.m4 5274 2006-03-10 20:57:09Z mike $".
dnl End of "$Id: cups-compiler.m4 7648 2008-06-16 17:41:11Z mike $".
dnl
+197 -62
Ver Arquivo
@@ -1,30 +1,32 @@
dnl
dnl "$Id$"
dnl "$Id: cups-defaults.m4 7448 2008-04-14 18:10:27Z mike $"
dnl
dnl Default cupsd configuration settings for the Common UNIX Printing System
dnl (CUPS).
dnl
dnl Copyright 2006 by Easy Software Products, all rights reserved.
dnl Copyright 2007-2008 by Apple Inc.
dnl Copyright 2006-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
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 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 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])
AC_SUBST(LANGUAGES)
dnl Default ConfigFilePerm
AC_ARG_WITH(config_perm, [ --with-config-file-perm set default ConfigFilePerm value, default=0640],
AC_ARG_WITH(config_file_perm, [ --with-config-file-perm set default ConfigFilePerm value, default=0640],
CUPS_CONFIG_FILE_PERM="$withval",
if test "x$uname" = xDarwin; then
CUPS_CONFIG_FILE_PERM="644"
@@ -35,7 +37,7 @@ AC_SUBST(CUPS_CONFIG_FILE_PERM)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_CONFIG_FILE_PERM, 0$CUPS_CONFIG_FILE_PERM)
dnl Default LogFilePerm
AC_ARG_WITH(log_perm, [ --with-log-file-perm set default LogFilePerm value, default=0644],
AC_ARG_WITH(log_file_perm, [ --with-log-file-perm set default LogFilePerm value, default=0644],
CUPS_LOG_FILE_PERM="$withval",
CUPS_LOG_FILE_PERM="644")
AC_SUBST(CUPS_LOG_FILE_PERM)
@@ -53,17 +55,47 @@ fi
AC_SUBST(CUPS_BROWSING)
dnl Default BrowseLocalProtocols
AC_ARG_WITH(browse_local, [ --with-local-protocols set default BrowseLocalProtocols, default="CUPS"],
CUPS_BROWSE_LOCAL_PROTOCOLS="$withval",
CUPS_BROWSE_LOCAL_PROTOCOLS="CUPS")
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
AC_SUBST(CUPS_BROWSE_LOCAL_PROTOCOLS)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS,
"$CUPS_BROWSE_LOCAL_PROTOCOLS")
dnl Default BrowseRemoteProtocols
AC_ARG_WITH(browse_remote, [ --with-remote-protocols set default BrowseRemoteProtocols, default="CUPS"],
CUPS_BROWSE_REMOTE_PROTOCOLS="$withval",
CUPS_BROWSE_REMOTE_PROTOCOLS="CUPS")
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
AC_SUBST(CUPS_BROWSE_REMOTE_PROTOCOLS)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSE_REMOTE_PROTOCOLS,
"$CUPS_BROWSE_REMOTE_PROTOCOLS")
@@ -104,22 +136,37 @@ fi
AC_SUBST(CUPS_IMPLICIT_CLASSES)
dnl Default UseNetworkDefault
AC_ARG_ENABLE(network_default, [ --enable-use-network-default
enable UseNetworkDefault by default, default=yes])
if test "x$enable_network_default" = xno; then
AC_ARG_ENABLE(use_network_default, [ --enable-use-network-default
enable UseNetworkDefault by default, default=auto])
if test "x$enable_use_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
CUPS_USE_NETWORK_DEFAULT="Yes"
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USE_NETWORK_DEFAULT, 1)
AC_MSG_RESULT(yes)
else
CUPS_USE_NETWORK_DEFAULT="No"
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USE_NETWORK_DEFAULT, 0)
AC_MSG_RESULT(no)
fi
else
CUPS_USE_NETWORK_DEFAULT="No"
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USE_NETWORK_DEFAULT, 0)
else
CUPS_USE_NETWORK_DEFAULT="Yes"
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USE_NETWORK_DEFAULT, 1)
fi
AC_SUBST(CUPS_USE_NETWORK_DEFAULT)
dnl Determine the correct username and group for this OS...
AC_ARG_WITH(cups-user, [ --with-cups-user set default user for CUPS],
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 -f /etc/passwd; then
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
CUPS_USER=""
for user in lp lpd guest daemon nobody; do
if test "`grep \^${user}: /etc/passwd`" != ""; then
@@ -138,16 +185,18 @@ AC_ARG_WITH(cups-user, [ --with-cups-user set default user for CUPS],
AC_MSG_RESULT(no password file, using "$CUPS_USER")
fi)
AC_ARG_WITH(cups-group, [ --with-cups-group set default group 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 -f /etc/group; then
if test x$uname = xDarwin; then
GROUP_LIST="nobody"
if test x$uname = xDarwin; then
if test x`id -g _lp 2>/dev/null` = x; then
CUPS_GROUP="lp";
else
GROUP_LIST="lp nobody"
CUPS_GROUP="_lp";
fi
AC_MSG_RESULT($CUPS_GROUP)
elif test -f /etc/group; then
GROUP_LIST="_lp lp nobody"
CUPS_GROUP=""
for group in $GROUP_LIST; do
if test "`grep \^${group}: /etc/group`" != ""; then
@@ -166,38 +215,38 @@ AC_ARG_WITH(cups-group, [ --with-cups-group set default group for CUPS],
AC_MSG_RESULT(no group file, using "$CUPS_GROUP")
fi)
AC_ARG_WITH(system-groups, [ --with-system-groups set default system groups 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
GROUP_LIST="admin"
CUPS_SYSTEM_GROUPS="admin"
else
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"
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
fi
fi
done
done
if test "x$CUPS_SYSTEM_GROUPS" = x; then
CUPS_SYSTEM_GROUPS="$GROUP_LIST"
AC_MSG_RESULT(no groups found, using "$CUPS_SYSTEM_GROUPS")
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
AC_MSG_RESULT("$CUPS_SYSTEM_GROUPS")
CUPS_SYSTEM_GROUPS="$GROUP_LIST"
AC_MSG_RESULT(no group file, using "$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}'`"
AC_SUBST(CUPS_USER)
@@ -209,7 +258,93 @@ AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USER, "$CUPS_USER")
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_GROUP, "$CUPS_GROUP")
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SYSTEM_GROUPS, "$CUPS_SYSTEM_GROUPS")
dnl Default printcap file...
AC_ARG_WITH(printcap, [ --with-printcap set default printcap file],
default_printcap="$withval",
default_printcap="default")
if test x$default_printcap != xno; then
if test "x$default_printcap" = "xdefault"; then
case $uname in
Darwin*)
if test $uversion -ge 90; then
CUPS_DEFAULT_PRINTCAP=""
else
CUPS_DEFAULT_PRINTCAP="/etc/printcap"
fi
;;
SunOS*)
CUPS_DEFAULT_PRINTCAP="/etc/printers.conf"
;;
*)
CUPS_DEFAULT_PRINTCAP="/etc/printcap"
;;
esac
else
CUPS_DEFAULT_PRINTCAP="$default_printcap"
fi
else
CUPS_DEFAULT_PRINTCAP=""
fi
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTCAP, "$CUPS_DEFAULT_PRINTCAP")
dnl Default MaxCopies value...
AC_ARG_WITH(max-copies, [ --with-max-copies set default max copies value, default=auto ],
CUPS_MAX_COPIES="$withval",
if test "x$uname" = xDarwin; then
CUPS_MAX_COPIES="9999"
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 New default port definition for IPP...
AC_ARG_WITH(ipp-port, [ --with-ipp-port set default port number for IPP ],
DEFAULT_IPP_PORT="$withval",
DEFAULT_IPP_PORT="631")
AC_SUBST(DEFAULT_IPP_PORT)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
dnl
dnl End of "$Id$".
dnl End of "$Id: cups-defaults.m4 7448 2008-04-14 18:10:27Z mike $".
dnl
+147 -67
Ver Arquivo
@@ -1,25 +1,16 @@
dnl
dnl "$Id: cups-directories.m4 5269 2006-03-10 03:33:00Z mike $"
dnl "$Id: cups-directories.m4 8077 2008-10-23 15:40:14Z mike $"
dnl
dnl Directory stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
dnl Copyright 2007 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
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 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_PREFIX_DEFAULT(/)
@@ -57,6 +48,15 @@ if test "$sharedstatedir" = "\${prefix}/com" -a "$prefix" = "/"; then
sharedstatedir="/usr/com"
fi
dnl Fix "datarootdir" variable if it hasn't been specified...
if test "$datarootdir" = "\${prefix}/share"; then
if test "$prefix" = "/"; then
datarootdir="/usr/share"
else
datarootdir="$prefix/share"
fi
fi
dnl Fix "datadir" variable if it hasn't been specified...
if test "$datadir" = "\${prefix}/share"; then
if test "$prefix" = "/"; then
@@ -64,6 +64,8 @@ if test "$datadir" = "\${prefix}/share"; then
else
datadir="$prefix/share"
fi
elif test "$datadir" = "\${datarootdir}"; then
datadir="$datarootdir"
fi
dnl Fix "includedir" variable if it hasn't been specified...
@@ -97,42 +99,68 @@ if test "$sysconfdir" = "\${prefix}/etc"; then
fi
fi
dnl Fix "libdir" variable for IRIX 6.x...
dnl Fix "libdir" variable...
if test "$libdir" = "\${exec_prefix}/lib"; then
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
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
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
FreeBSD* | OpenBSD*)
# FreeBSD and OpenBSD
INITDIR=""
INITDDIR=""
;;
NetBSD*)
# NetBSD
INITDIR=""
INITDDIR="/etc/rc.d"
AIX*)
INITDIR="/etc/rc.d"
;;
Darwin*)
# Darwin and MacOS X...
INITDIR=""
AC_CHECK_PROG(INITDDIR, launchd,
"/System/Library/LaunchDaemons",
"/System/Library/StartupItems/PrintingServices")
if test -x /sbin/launchd; then
INITDDIR="/System/Library/LaunchDaemons"
else
INITDDIR="/System/Library/StartupItems/PrintingServices"
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)
@@ -140,43 +168,68 @@ if test x$rcdir = x; then
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"
;;
OSF1* | HP-UX*)
NetBSD*)
# NetBSD
INITDDIR="/etc/rc.d"
;;
OSF1*)
INITDIR="/sbin"
INITDDIR="../init.d"
;;
AIX*)
INITDIR="/etc/rc.d"
INITDDIR=".."
SunOS*)
# Solaris
INITDIR="/etc"
RCSTART="81"
;;
*)
INITDIR="/etc"
INITDDIR="../init.d"
;;
esac
else
INITDIR=""
INITDDIR="$rcdir"
elif test "x$rcdir" != xno; then
if test "x$rclevels" = x; then
INITDDIR="$rcdir"
else
INITDIR="$rcdir"
fi
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="")
if test "x$XINETD" = x -a ! -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"
break
fi
done
elif test "x$XINETD" = xno; then
XINETD=""
fi
AC_SUBST(XINETD)
dnl Setup default locations...
# Cache data...
@@ -184,7 +237,7 @@ AC_ARG_WITH(cachedir, [ --with-cachedir set path for cache files],cache
if test x$cachedir = x; then
if test "x$uname" = xDarwin; then
CUPS_CACHEDIR="$localstatedir/tmp/cups"
CUPS_CACHEDIR="$localstatedir/spool/cups/cache"
else
CUPS_CACHEDIR="$localstatedir/cache/cups"
fi
@@ -199,6 +252,28 @@ 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="")
@@ -224,21 +299,26 @@ fi
AC_SUBST(CUPS_FONTPATH)
AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
# Locale data
case "$uname" in
Linux | GNU | *BSD* | Darwin*)
CUPS_LOCALEDIR="$datadir/locale"
;;
# 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"
;;
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
*)
# This is the standard System V location...
CUPS_LOCALEDIR="$exec_prefix/lib/locale"
;;
esac
else
CUPS_LOCALEDIR="$localedir"
fi
AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR")
AC_SUBST(CUPS_LOCALEDIR)
@@ -289,5 +369,5 @@ AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$localstatedir/run/cups")
AC_SUBST(CUPS_STATEDIR)
dnl
dnl End of "$Id: cups-directories.m4 5269 2006-03-10 03:33:00Z mike $".
dnl End of "$Id: cups-directories.m4 8077 2008-10-23 15:40:14Z mike $".
dnl
+54
Ver Arquivo
@@ -0,0 +1,54 @@
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
+123
Ver Arquivo
@@ -0,0 +1,123 @@
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
case "$uname" in
Darwin)
# Mac OS X weak-links to the Kerberos framework...
LIBGSSAPI="-weak_framework Kerberos"
;;
SunOS*)
# Solaris has a non-standard krb5-config, don't use it!
AC_CHECK_LIB(gss, gss_display_status,
AC_DEFINE(HAVE_GSSAPI, 1, [Whether GSSAPI is available])
CFLAGS="`$KRB5CONFIG --cflags` $CFLAGS"
CPPFLAGS="`$KRB5CONFIG --cflags` $CPPFLAGS"
LIBGSSAPI="-lgss `$KRB5CONFIG --libs`")
;;
*)
# Other platforms just ask for GSSAPI
CFLAGS="`$KRB5CONFIG --cflags gssapi` $CFLAGS"
CPPFLAGS="`$KRB5CONFIG --cflags gssapi` $CPPFLAGS"
LIBGSSAPI="`$KRB5CONFIG --libs gssapi`"
;;
esac
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
+37 -26
Ver Arquivo
@@ -1,30 +1,33 @@
dnl
dnl "$Id: cups-image.m4 4644 2005-09-15 18:43:06Z mike $"
dnl "$Id: cups-image.m4 6649 2007-07-11 21:46:42Z mike $"
dnl
dnl Image library stuff for the Common UNIX Printing System (CUPS).
dnl Image library/filter stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
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 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 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 Save the current libraries since we don't want the image libraries
dnl included with every program...
SAVELIBS="$LIBS"
dnl See if we want the image filters included at all...
AC_ARG_ENABLE(image, [ --enable-image turn on image filters, default=auto])
IMGFILTERS=""
if test "x$enable_image" != xno; then
AC_MSG_CHECKING(whether to build image filters)
if test "x$enable_image" = xyes -o $uname != Darwin; then
IMGFILTERS="imagetops imagetoraster"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
fi
AC_SUBST(IMGFILTERS)
dnl Check for image libraries...
AC_ARG_ENABLE(jpeg, [ --enable-jpeg turn on JPEG support, default=yes])
@@ -41,6 +44,14 @@ AC_SUBST(LIBPNG)
AC_SUBST(LIBTIFF)
AC_SUBST(LIBZ)
dnl Image libraries use math library functions...
AC_SEARCH_LIBS(pow, m)
dnl Save the current libraries since we don't want the image libraries
dnl included with every program...
SAVELIBS="$LIBS"
dnl JPEG library...
if test x$enable_jpeg != xno; then
AC_CHECK_HEADER(jpeglib.h,
AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
@@ -51,24 +62,24 @@ else
AC_MSG_NOTICE([JPEG support disabled with --disable-jpeg.])
fi
dnl ZLIB library...
AC_CHECK_HEADER(zlib.h,
AC_CHECK_LIB(z, gzgets,
AC_DEFINE(HAVE_LIBZ)
LIBZ="-lz"
LIBS="$LIBS -lz"))
dnl PNG library uses math library functions...
AC_CHECK_LIB(m, pow)
dnl PNG library...
if test x$enable_png != xno; then
AC_CHECK_HEADER(png.h,
AC_CHECK_LIB(png, png_set_tRNS_to_alpha,
AC_CHECK_LIB(png, png_create_read_struct,
AC_DEFINE(HAVE_LIBPNG)
LIBPNG="-lpng -lm"))
LIBPNG="-lpng"))
else
AC_MSG_NOTICE([PNG support disabled with --disable-png.])
fi
dnl TIFF library...
if test x$enable_tiff != xno; then
AC_CHECK_HEADER(tiff.h,
AC_CHECK_LIB(tiff, TIFFReadScanline,
@@ -94,5 +105,5 @@ AC_SUBST(EXPORT_LIBZ)
AC_CHECK_HEADER(stdlib.h,AC_DEFINE(HAVE_STDLIB_H))
dnl
dnl End of "$Id: cups-image.m4 4644 2005-09-15 18:43:06Z mike $".
dnl End of "$Id: cups-image.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+9 -18
Ver Arquivo
@@ -1,25 +1,16 @@
dnl
dnl "$Id: cups-largefile.m4 4732 2005-09-30 23:23:25Z mike $"
dnl "$Id: cups-largefile.m4 6649 2007-07-11 21:46:42Z 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 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 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 Check for largefile support...
@@ -30,11 +21,11 @@ LARGEFILE=""
if test x$enable_largefile != xno; then
LARGEFILE="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
if test $ac_cv_sys_large_files = 1; then
if test x$ac_cv_sys_large_files = x1; then
LARGEFILE="$LARGEFILE -D_LARGE_FILES"
fi
if test $ac_cv_sys_file_offset_bits = 64; then
if test x$ac_cv_sys_file_offset_bits = x64; then
LARGEFILE="$LARGEFILE -D_FILE_OFFSET_BITS=64"
fi
fi
@@ -57,5 +48,5 @@ fi
AC_CHECK_FUNC(strtoll, AC_DEFINE(HAVE_STRTOLL))
dnl
dnl End of "$Id: cups-largefile.m4 4732 2005-09-30 23:23:25Z mike $".
dnl End of "$Id: cups-largefile.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+7 -16
Ver Arquivo
@@ -1,25 +1,16 @@
dnl
dnl "$Id$"
dnl "$Id: cups-launchd.m4 6649 2007-07-11 21:46:42Z 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 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 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
@@ -49,5 +40,5 @@ AC_SUBST(DEFAULT_LAUNCHD_CONF)
AC_SUBST(LAUNCHDLIBS)
dnl
dnl End of "$Id$".
dnl End of "$Id: cups-launchd.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+8 -17
Ver Arquivo
@@ -1,25 +1,16 @@
dnl
dnl "$Id$"
dnl "$Id: cups-ldap.m4 6649 2007-07-11 21:46:42Z 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 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 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(ldap, [ --enable-ldap turn on LDAP support, default=yes])
@@ -36,7 +27,7 @@ LIBLDAP=""
if test x$enable_ldap != xno; then
AC_CHECK_HEADER(ldap.h,
AC_CHECK_LIB(ldap, ldap_value_free,
AC_CHECK_LIB(ldap, ldap_initialize,
AC_DEFINE(HAVE_LDAP)
AC_DEFINE(HAVE_OPENLDAP)
LIBLDAP="-lldap"))
@@ -46,5 +37,5 @@ AC_SUBST(LIBLDAP)
dnl
dnl End of "$Id$".
dnl End of "$Id: cups-ldap.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+7 -16
Ver Arquivo
@@ -1,25 +1,16 @@
dnl
dnl "$Id: cups-libtool.m4 4494 2005-02-18 02:18:11Z mike $"
dnl "$Id: cups-libtool.m4 6649 2007-07-11 21:46:42Z 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 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 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(libtool_unsupported, [ --enable-libtool-unsupported=LIBTOOL_PATH
@@ -45,5 +36,5 @@ if test x$LIBTOOL != x; then
fi
dnl
dnl End of "$Id: cups-libtool.m4 4494 2005-02-18 02:18:11Z mike $".
dnl End of "$Id: cups-libtool.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+16 -27
Ver Arquivo
@@ -1,28 +1,25 @@
dnl
dnl "$Id: cups-manpages.m4 5099 2006-02-13 02:46:10Z mike $"
dnl "$Id: cups-manpages.m4 8231 2009-01-12 19:17:21Z mike $"
dnl
dnl Manpage stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
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 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 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 Fix "mandir" variable...
if test "$mandir" = "\${datarootdir}/man" -a "$prefix" = "/"; then
# New GNU "standards" break previous ones, so make sure we use
# the right default location for the operating system...
mandir="\${prefix}/man"
fi
if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/"; then
case "$uname" in
Darwin* | Linux | GNU | *BSD* | AIX*)
@@ -54,14 +51,6 @@ AC_SUBST(PMANDIR)
dnl Setup manpage extensions...
case "$uname" in
*BSD* | Darwin*)
# *BSD
MAN1EXT=1
MAN5EXT=5
MAN7EXT=7
MAN8EXT=8
MAN8DIR=8
;;
IRIX*)
# SGI IRIX
MAN1EXT=1
@@ -78,8 +67,8 @@ case "$uname" in
MAN8EXT=1m
MAN8DIR=1m
;;
Linux* | GNU*)
# Linux and GNU Hurd
Linux* | GNU* | Darwin*)
# Linux, GNU Hurd, and Mac OS X
MAN1EXT=1.gz
MAN5EXT=5.gz
MAN7EXT=7.gz
@@ -103,5 +92,5 @@ AC_SUBST(MAN8EXT)
AC_SUBST(MAN8DIR)
dnl
dnl End of "$Id: cups-manpages.m4 5099 2006-02-13 02:46:10Z mike $".
dnl End of "$Id: cups-manpages.m4 8231 2009-01-12 19:17:21Z mike $".
dnl
+21 -36
Ver Arquivo
@@ -1,56 +1,38 @@
dnl
dnl "$Id: cups-network.m4 4873 2005-12-07 01:46:54Z mike $"
dnl "$Id: cups-network.m4 7919 2008-09-09 22:03:27Z mike $"
dnl
dnl Networking stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 2007-2008 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 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 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_HEADER(resolv.h,AC_DEFINE(HAVE_RESOLV_H))
AC_SEARCH_LIBS(socket, socket)
AC_SEARCH_LIBS(gethostbyaddr, nsl)
AC_SEARCH_LIBS(getaddrinfo, nsl, AC_DEFINE(HAVE_GETADDRINFO))
AC_SEARCH_LIBS(getifaddrs, nsl, AC_DEFINE(HAVE_GETIFADDRS))
AC_SEARCH_LIBS(getnameinfo, nsl, AC_DEFINE(HAVE_GETNAMEINFO))
AC_SEARCH_LIBS(hstrerror, nsl socket resolv, AC_DEFINE(HAVE_HSTRERROR))
AC_SEARCH_LIBS(rresvport_af, nsl, AC_DEFINE(HAVE_RRESVPORT_AF))
AC_SEARCH_LIBS(__res_init, resolv bind, AC_DEFINE(HAVE_RES_INIT),
AC_SEARCH_LIBS(res_9_init, resolv bind, AC_DEFINE(HAVE_RES_INIT),
AC_SEARCH_LIBS(res_init, resolv bind, AC_DEFINE(HAVE_RES_INIT))))
# Tru64 5.1b leaks file descriptors with these functions; disable until
# we can come up with a test for this...
if test "$uname" != "OSF1"; then
AC_SEARCH_LIBS(getaddrinfo, nsl, AC_DEFINE(HAVE_GETADDRINFO))
AC_SEARCH_LIBS(getnameinfo, nsl, AC_DEFINE(HAVE_GETNAMEINFO))
fi
AC_CHECK_MEMBER(struct sockaddr.sa_len,,, [#include <sys/socket.h>])
AC_CHECK_HEADER(sys/sockio.h, AC_DEFINE(HAVE_SYS_SOCKIO_H))
if test "$uname" = "SunOS"; then
case "$uversion" in
55* | 56*)
maxfiles=1024
;;
*)
maxfiles=4096
;;
esac
else
maxfiles=4096
fi
AC_ARG_WITH(maxfiles, [ --with-maxfiles=N set maximum number of file descriptors for scheduler ],
maxfiles=$withval)
AC_DEFINE_UNQUOTED(CUPS_MAX_FDS, $maxfiles)
CUPS_DEFAULT_DOMAINSOCKET=""
dnl Domain socket support...
@@ -84,6 +66,9 @@ 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 4873 2005-12-07 01:46:54Z mike $".
dnl End of "$Id: cups-network.m4 7919 2008-09-09 22:03:27Z mike $".
dnl
+9 -17
Ver Arquivo
@@ -1,30 +1,22 @@
dnl
dnl "$Id: cups-opsys.m4 5075 2006-02-05 01:00:29Z mike $"
dnl "$Id: cups-opsys.m4 6649 2007-07-11 21:46:42Z 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 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 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 Get the operating system and version number...
dnl Get the operating system, version number, and architecture...
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/*)
@@ -39,5 +31,5 @@ case "$uname" in
esac
dnl
dnl "$Id: cups-opsys.m4 5075 2006-02-05 01:00:29Z mike $"
dnl "$Id: cups-opsys.m4 6649 2007-07-11 21:46:42Z mike $"
dnl
+7 -16
Ver Arquivo
@@ -1,25 +1,16 @@
dnl
dnl "$Id: cups-pam.m4 4913 2006-01-11 01:42:04Z mike $"
dnl "$Id: cups-pam.m4 6649 2007-07-11 21:46:42Z 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 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 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(pam, [ --enable-pam turn on PAM support, default=yes])
@@ -94,5 +85,5 @@ AC_SUBST(PAMLIBS)
AC_SUBST(PAMMOD)
dnl
dnl End of "$Id: cups-pam.m4 4913 2006-01-11 01:42:04Z mike $".
dnl End of "$Id: cups-pam.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+31
Ver Arquivo
@@ -0,0 +1,31 @@
dnl
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-2008 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
# Currently the PAP backend is only supported on MacOS X with the AppleTalk
# SDK installed...
AC_ARG_ENABLE(pap, [ --enable-pap build with AppleTalk support, default=auto])
PAP=""
AC_SUBST(PAP)
if test x$enable_pap != xno -a $uname = Darwin; then
AC_CHECK_HEADER(netat/appletalk.h,[
PAP="pap"
AC_CHECK_HEADER(AppleTalk/at_proto.h)])
fi
dnl
dnl End of "$Id: cups-pam.m4 5466 2006-04-26 19:52:27Z mike $".
dnl
+73
Ver Arquivo
@@ -0,0 +1,73 @@
dnl
dnl "$Id: cups-pdf.m4 8429 2009-03-12 21:34:21Z mike $"
dnl
dnl PDF filter configuration stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 2007-2009 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_ARG_ENABLE(pdftops, [ --enable-pdftops build pdftops filter, default=auto ])
AC_ARG_WITH(pdftops, [ --with-pdftops set pdftops filter (gs,pdftops,none), default=pdftops ])
if test "x$enable_pdftops" = xno -a "x$with_pdftops" = x; then
with_pdftops=no
fi
PDFTOPS=""
CUPS_PDFTOPS=""
CUPS_GHOSTSCRIPT=""
case "x$with_pdftops" in
x) # Default/auto
if test $uname != Darwin; then
AC_PATH_PROG(CUPS_PDFTOPS, pdftops)
if test "x$CUPS_PDFTOPS" != x; then
AC_DEFINE(HAVE_PDFTOPS)
PDFTOPS="pdftops"
else
AC_PATH_PROG(CUPS_GHOSTSCRIPT, gs)
if test "x$CUPS_GHOSTSCRIPT" != x; then
AC_DEFINE(HAVE_GHOSTSCRIPT)
PDFTOPS="pdftops"
fi
fi
fi
;;
xgs)
AC_PATH_PROG(CUPS_GHOSTSCRIPT, gs)
if test "x$CUPS_GHOSTSCRIPT" != x; then
AC_DEFINE(HAVE_GHOSTSCRIPT)
PDFTOPS="pdftops"
else
AC_MSG_ERROR(Unable to find gs program!)
exit 1
fi
;;
xpdftops)
AC_PATH_PROG(CUPS_PDFTOPS, pdftops)
if test "x$CUPS_PDFTOPS" != x; then
AC_DEFINE(HAVE_PDFTOPS)
PDFTOPS="pdftops"
else
AC_MSG_ERROR(Unable to find pdftops program!)
exit 1
fi
;;
esac
AC_DEFINE_UNQUOTED(CUPS_PDFTOPS, "$CUPS_PDFTOPS")
AC_DEFINE_UNQUOTED(CUPS_GHOSTSCRIPT, "$CUPS_GHOSTSCRIPT")
AC_SUBST(PDFTOPS)
dnl
dnl End of "$Id: cups-pdf.m4 8429 2009-03-12 21:34:21Z mike $".
dnl
+22
Ver Arquivo
@@ -0,0 +1,22 @@
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
+7 -16
Ver Arquivo
@@ -1,25 +1,16 @@
dnl
dnl "$Id: cups-scripting.m4 5176 2006-02-25 18:14:10Z mike $"
dnl "$Id: cups-scripting.m4 6649 2007-07-11 21:46:42Z 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 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 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 Do we have Java?
@@ -100,5 +91,5 @@ if test "x$CUPS_PYTHON" != x; then
fi
dnl
dnl End of "$Id: cups-scripting.m4 5176 2006-02-25 18:14:10Z mike $".
dnl End of "$Id: cups-scripting.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+80 -49
Ver Arquivo
@@ -1,25 +1,16 @@
dnl
dnl "$Id: cups-sharedlibs.m4 5112 2006-02-16 04:41:59Z mike $"
dnl "$Id: cups-sharedlibs.m4 6649 2007-07-11 21:46:42Z 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 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 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
PICFLAG=1
@@ -33,31 +24,41 @@ if test x$enable_shared != xno; then
LIBCUPS="libcups.so.2"
LIBCUPSIMAGE="libcupsimage.so.2"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-h,\$@ -G \$(OPTIM)"
DSOFLAGS="$DSOFLAGS -Wl,-h,\`basename \$@\` -G \$(OPTIM)"
;;
HP-UX*)
LIBCUPS="libcups.sl.2"
LIBCUPSIMAGE="libcupsimage.sl.2"
DSO="\$(LD)"
DSOFLAGS="$DSOFLAGS -b -z +h \$@"
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
;;
IRIX)
LIBCUPS="libcups.so.2"
LIBCUPSIMAGE="libcupsimage.so.2"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-rpath,\$(libdir),-set_version,sgi2.6,-soname,\$@ -shared \$(OPTIM)"
DSOFLAGS="$DSOFLAGS -set_version,sgi2.6,-soname,\`basename \$@\` -shared \$(OPTIM)"
;;
OSF1* | Linux | GNU | *BSD*)
LIBCUPS="libcups.so.2"
LIBCUPSIMAGE="libcupsimage.so.2"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\$@ -shared \$(OPTIM)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
;;
Darwin*)
LIBCUPS="libcups.2.dylib"
LIBCUPSIMAGE="libcupsimage.2.dylib"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS \$(RC_CFLAGS) -dynamiclib -single_module -lc"
DSOFLAGS="$DSOFLAGS -dynamiclib -single_module -lc"
;;
AIX*)
LIBCUPS="libcups_s.a"
@@ -71,7 +72,7 @@ if test x$enable_shared != xno; then
LIBCUPS="libcups.so.2"
LIBCUPSIMAGE="libcupsimage.so.2"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\$@ -shared \$(OPTIM)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
;;
esac
else
@@ -81,8 +82,15 @@ else
DSO=":"
fi
# 32-bit and 64-bit libraries need variations of the standard
# DSOFLAGS...
DSO32FLAGS="$DSOFLAGS"
DSO64FLAGS="$DSOFLAGS"
AC_SUBST(DSO)
AC_SUBST(DSOFLAGS)
AC_SUBST(DSO32FLAGS)
AC_SUBST(DSO64FLAGS)
AC_SUBST(LIBCUPS)
AC_SUBST(LIBCUPSIMAGE)
@@ -110,41 +118,64 @@ if test "$DSO" != ":"; then
# rather than to the executables. This makes things smaller if you
# are using any static libraries, and it also allows us to distribute
# a single DSO rather than a bunch...
DSOLIBS="\$(LIBPNG) \$(LIBTIFF) \$(LIBJPEG) \$(LIBZ)"
DSOLIBS="\$(LIBTIFF) \$(LIBPNG) \$(LIBJPEG) \$(LIBZ)"
IMGLIBS=""
# The *BSD, HP-UX, and Solaris run-time linkers need help when
# deciding where to find a DSO. Add linker options to tell them
# where to find the DSO (usually in /usr/lib... duh!)
# Tell the run-time linkers where to find a DSO. Some platforms
# need this option, even when the library is installed in a
# standard location...
case $uname in
HP-UX*)
# HP-UX
DSOFLAGS="+s +b $libdir $DSOFLAGS"
# 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
LDFLAGS="$LDFLAGS -Wl,+s,+b,$libdir"
EXPORT_LDFLAGS="-Wl,+s,+b,$libdir"
;;
;;
SunOS*)
# Solaris
DSOFLAGS="-R$libdir $DSOFLAGS"
LDFLAGS="$LDFLAGS -R$libdir"
EXPORT_LDFLAGS="-R$libdir"
;;
# Solaris...
if test $exec_prefix != /usr; then
DSOFLAGS="-R$libdir $DSOFLAGS"
DSO32FLAGS="-R$LIB32DIR $DSO32FLAGS"
DSO64FLAGS="-R$LIB64DIR $DSO64FLAGS"
LDFLAGS="$LDFLAGS -R$libdir"
EXPORT_LDFLAGS="-R$libdir"
fi
;;
*BSD*)
# *BSD
DSOFLAGS="-Wl,-R$libdir $DSOFLAGS"
LDFLAGS="$LDFLAGS -Wl,-R$libdir"
EXPORT_LDFLAGS="-Wl,-R$libdir"
;;
Linux | GNU)
# Linux and HURD
DSOFLAGS="-Wl,-rpath,$libdir $DSOFLAGS"
LDFLAGS="$LDFLAGS -Wl,-rpath,$libdir"
EXPORT_LDFLAGS="-Wl,-rpath,$libdir"
;;
# *BSD...
if test $exec_prefix != /usr; then
DSOFLAGS="-Wl,-R$libdir $DSOFLAGS"
DSO32FLAGS="-Wl,-R$LIB32DIR $DSO32FLAGS"
DSO64FLAGS="-Wl,-R$LIB64DIR $DSO64FLAGS"
LDFLAGS="$LDFLAGS -Wl,-R$libdir"
EXPORT_LDFLAGS="-Wl,-R$libdir"
fi
;;
IRIX | Linux | GNU)
# IRIX, Linux, and HURD...
if test $exec_prefix != /usr; then
DSOFLAGS="-Wl,-rpath,$libdir $DSOFLAGS"
DSO32FLAGS="-Wl,-rpath,$LIB32DIR $DSO32FLAGS"
DSO64FLAGS="-Wl,-rpath,$LIB64DIR $DSO64FLAGS"
LDFLAGS="$LDFLAGS -Wl,-rpath,$libdir"
EXPORT_LDFLAGS="-Wl,-rpath,$libdir"
fi
;;
esac
else
DSOLIBS=""
IMGLIBS="\$(LIBPNG) \$(LIBTIFF) \$(LIBJPEG) \$(LIBZ)"
IMGLIBS="\$(LIBTIFF) \$(LIBPNG) \$(LIBJPEG) \$(LIBZ)"
fi
AC_SUBST(DSOLIBS)
@@ -152,5 +183,5 @@ AC_SUBST(IMGLIBS)
AC_SUBST(EXPORT_LDFLAGS)
dnl
dnl End of "$Id: cups-sharedlibs.m4 5112 2006-02-16 04:41:59Z mike $".
dnl End of "$Id: cups-sharedlibs.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+7 -16
Ver Arquivo
@@ -1,25 +1,16 @@
dnl
dnl "$Id: cups-openslp.m4 4494 2005-02-18 02:18:11Z mike $"
dnl "$Id: cups-slp.m4 6649 2007-07-11 21:46:42Z 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 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 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(slp, [ --enable-slp turn on SLP support, default=yes])
@@ -44,5 +35,5 @@ AC_SUBST(LIBSLP)
dnl
dnl End of "$Id: cups-openslp.m4 4494 2005-02-18 02:18:11Z mike $".
dnl End of "$Id: cups-slp.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+51 -32
Ver Arquivo
@@ -1,25 +1,16 @@
dnl
dnl "$Id: cups-ssl.m4 5264 2006-03-10 01:10:36Z mike $"
dnl "$Id: cups-ssl.m4 6649 2007-07-11 21:46:42Z mike $"
dnl
dnl OpenSSL/GNUTLS stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
dnl Copyright 2007 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
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 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(ssl, [ --enable-ssl turn on SSL/TLS support, default=yes])
@@ -36,31 +27,52 @@ AC_ARG_WITH(openssl-includes, [ --with-openssl-includes set directory for OpenS
SSLFLAGS=""
SSLLIBS=""
ENCRYPTION_REQUIRED=""
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"
AC_DEFINE(HAVE_SSL)
AC_DEFINE(HAVE_CDSASSL)])
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])
fi
fi
dnl Then look for GNU TLS...
if test "x${SSLLIBS}" = "x" -a "x${enable_gnutls}" != "xno"; then
AC_CHECK_HEADER(gnutls/gnutls.h,
dnl Save the current libraries so the crypto stuff isn't always
dnl included...
SAVELIBS="$LIBS"
AC_CHECK_LIB(gnutls, gnutls_x509_crt_set_dn_by_oid,
[SSLLIBS="-lgnutls"
AC_DEFINE(HAVE_SSL)
AC_DEFINE(HAVE_GNUTLS)])
LIBS="$SAVELIBS")
AC_PATH_PROG(LIBGNUTLSCONFIG,libgnutls-config)
if test "x$LIBGNUTLSCONFIG" != x; then
SSLLIBS=`$LIBGNUTLSCONFIG --libs`
SSLFLAGS=`$LIBGNUTLSCONFIG --cflags`
ENCRYPTION_REQUIRED=" Encryption Required"
AC_DEFINE(HAVE_SSL)
AC_DEFINE(HAVE_GNUTLS)
fi
fi
dnl Check for the OpenSSL library last...
@@ -84,6 +96,7 @@ if test x$enable_ssl != xno; then
AC_CHECK_LIB(ssl,SSL_new,
[SSLFLAGS="-DOPENSSL_DISABLE_OLD_DES_SUPPORT"
SSLLIBS="-lssl $libcrypto"
ENCRYPTION_REQUIRED=" Encryption Required"
AC_DEFINE(HAVE_SSL)
AC_DEFINE(HAVE_LIBSSL)],,
$libcrypto)
@@ -97,13 +110,19 @@ if test x$enable_ssl != xno; then
fi
fi
if test "x$SSLLIBS" != x; then
AC_MSG_RESULT([ Using SSLLIBS="$SSLLIBS"])
AC_MSG_RESULT([ Using SSLFLAGS="$SSLFLAGS"])
fi
AC_SUBST(SSLFLAGS)
AC_SUBST(SSLLIBS)
AC_SUBST(ENCRYPTION_REQUIRED)
EXPORT_SSLLIBS="$SSLLIBS"
AC_SUBST(EXPORT_SSLLIBS)
dnl
dnl End of "$Id: cups-ssl.m4 5264 2006-03-10 01:10:36Z mike $".
dnl End of "$Id: cups-ssl.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+13 -16
Ver Arquivo
@@ -1,25 +1,16 @@
dnl
dnl "$Id$"
dnl "$Id: cups-threads.m4 6649 2007-07-11 21:46:42Z 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 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 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(threads, [ --enable-threads enable multi-threading support])
@@ -44,6 +35,12 @@ 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
# be POSIX-compliant... :(
if test $uname = SunOS; then
PTHREAD_FLAGS="$PTHREAD_FLAGS -D_POSIX_PTHREAD_SEMANTICS"
fi
break
fi
done
@@ -53,5 +50,5 @@ fi
AC_SUBST(PTHREAD_FLAGS)
dnl
dnl End of "$Id$".
dnl End of "$Id: cups-threads.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+155 -17
Ver Arquivo
@@ -3,23 +3,14 @@
*
* Configuration file for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products.
* Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* 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
* 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/".
*/
#ifndef _CUPS_CONFIG_H_
@@ -40,6 +31,7 @@
#define CUPS_DEFAULT_USER "lp"
#define CUPS_DEFAULT_GROUP "sys"
#define CUPS_DEFAULT_SYSTEM_GROUPS "sys root system"
#define CUPS_DEFAULT_PRINTADMIN_AUTH "@SYSTEM"
/*
@@ -71,10 +63,17 @@
/*
* Maximum number of file descriptors to support.
* Default printcap file...
*/
#define CUPS_MAX_FDS 4096
#define CUPS_DEFAULT_PRINTCAP "/etc/printcap"
/*
* Default MaxCopies value...
*/
#define CUPS_DEFAULT_MAX_COPIES 100
/*
@@ -140,6 +139,13 @@
#undef HAVE_CRYPT_H
/*
* Do we have <scsi/sg.h>?
*/
#undef HAVE_SCSI_SG_H
/*
* Use <string.h>, <strings.h>, and/or <bstring.h>?
*/
@@ -253,6 +259,24 @@
#undef HAVE_SSL
/*
* What Security framework headers do we have?
*/
#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
/*
* Do we have the SLP library?
*/
@@ -275,6 +299,21 @@
#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>?
*/
@@ -332,6 +371,20 @@
#undef HAVE_HSTRERROR
/*
* Do we have res_init()?
*/
#undef HAVE_RES_INIT
/*
* Do we have <resolv.h>
*/
#undef HAVE_RESOLV_H
/*
* Do we have the <sys/sockio.h> header file?
*/
@@ -382,6 +435,22 @@
#define CUPS_PYTHON "/usr/bin/python"
/*
* Location of the poppler/Xpdf pdftops program...
*/
#undef HAVE_PDFTOPS
#define CUPS_PDFTOPS "/usr/bin/pdftops"
/*
* Location of the Ghostscript gs program...
*/
#undef HAVE_GHOSTSCRIPT
#define CUPS_GHOSTSCRIPT "/usr/bin/gs"
/*
* Do we have Darwin's CoreFoundation and SystemConfiguration frameworks?
*/
@@ -404,6 +473,7 @@
*/
#undef HAVE_MEMBERSHIP_H
#undef HAVE_MEMBERSHIPPRIV_H
#undef HAVE_MBR_UID_TO_UUID
@@ -420,6 +490,74 @@
*/
#undef HAVE_DBUS
#undef HAVE_DBUS_MESSAGE_ITER_INIT_APPEND
/*
* Do we have the AppleTalk/at_proto.h header?
*/
#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_ */
+42 -27
Ver Arquivo
@@ -3,59 +3,74 @@ dnl "$Id$"
dnl
dnl Configuration script for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
dnl Copyright 2007 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
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 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_INIT(cups/cups.h)
sinclude(config-scripts/cups-opsys.m4)
sinclude(config-scripts/cups-common.m4)
sinclude(config-scripts/cups-defaults.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)
MAKEDEFS="../Makedefs"
AC_SUBST(MAKEDEFS)
sinclude(config-scripts/cups-defaults.m4)
sinclude(config-scripts/cups-pap.m4)
sinclude(config-scripts/cups-pdf.m4)
sinclude(config-scripts/cups-scripting.m4)
AC_OUTPUT(Makedefs packaging/cups.list init/cups.sh cups-config
conf/cupsd.conf conf/pam.std doc/index.html doc/ja/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/edit-config.tmpl templates/header.tmpl
templates/ja/header.tmpl)
INSTALL_LANGUAGES=""
UNINSTALL_LANGUAGES=""
LANGFILES=""
if test "x$LANGUAGES" != x; then
INSTALL_LANGUAGES="install-languages"
UNINSTALL_LANGUAGES="uninstall-languages"
for lang in $LANGUAGES; do
if test -f doc/$lang/index.html.in; then
LANGFILES="$LANGFILES doc/$lang/index.html"
fi
if test -f templates/$lang/header.tmpl.in; then
LANGFILES="$LANGFILES templates/$lang/header.tmpl"
fi
done
fi
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
man/cups-lpd.man man/cupsaddsmb.man man/cupsd.man
man/cupsd.conf.man man/lpoptions.man
templates/header.tmpl
$LANGFILES)
chmod +x cups-config
+31 -24
Ver Arquivo
@@ -4,33 +4,26 @@
#
# 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 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
# 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/".
#
VERSION="@CUPS_VERSION@"
APIVERSION="1.2"
APIVERSION="1.3"
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
includedir=@includedir@
libdir=@libdir@
imagelibdir=@libdir@
datarootdir=@datadir@
datadir=@datadir@
sysconfdir=@sysconfdir@
cups_datadir=@CUPS_DATADIR@
@@ -41,16 +34,30 @@ INSTALLSTATIC=@INSTALLSTATIC@
# flags for C++ compiler:
CFLAGS=""
LDFLAGS="@EXPORT_LDFLAGS@"
LIBS="@EXPORT_SSLLIBS@ @LIBS@"
IMGLIBS="@EXPORT_LIBTIFF@ @EXPORT_LIBJPEG@ @EXPORT_LIBPNG@ @EXPORT_LIBZ@"
LIBS="@LIBGSSAPI@ @EXPORT_SSLLIBS@ @EXPORT_LIBZ@ @LIBS@"
IMGLIBS="@EXPORT_LIBTIFF@ @EXPORT_LIBJPEG@ @EXPORT_LIBPNG@"
if test $includedir != /usr/include; then
CFLAGS="$CFLAGS -I$includedir"
# Check for local invocation...
selfdir=`dirname $0`
if test -f "$selfdir/cups/cups.h"; then
CFLAGS="-I$selfdir"
LDFLAGS="-L$selfdir/cups -L$selfdir/filter $LDFLAGS"
libdir="$selfdir/cups"
imagelibdir="$selfdir/filter"
if test ! -f "$selfdir/cups/raster.h"; then
ln -s ../filter/raster.h "$selfdir/cups"
fi
else
if test $includedir != /usr/include; then
CFLAGS="$CFLAGS -I$includedir"
fi
if test $libdir != /usr/lib -a $libdir != /usr/lib32 -a $libdir != /usr/lib64; then
LDFLAGS="$LDFLAGS -L$libdir"
fi
fi
if test $libdir != /usr/lib -a $libdir != /usr/lib32; then
LDFLAGS="$LDFLAGS -L$libdir"
fi
usage ()
{
@@ -100,13 +107,13 @@ while test $# -gt 0; do
if test $image = no; then
echo -lcups $LIBS
else
echo -lcupsimage $IMGLIBS -lcups $LIBS
echo -lcupsimage -lcups $IMGLIBS $LIBS
fi
else
if test $image = no; then
echo $libdir/libcups.a $LIBS
else
echo $libdir/libcupsimage.a $IMGLIBS $libdir/libcups.a $LIBS
echo $imagelibdir/libcupsimage.a $libdir/libcups.a $IMGLIBS $LIBS
fi
fi
;;
+237 -189
Ver Arquivo
@@ -1,255 +1,303 @@
# 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 i18n.h normalize.h
adminutil.o: transcode.h debug.h
adminutil.o: adminutil.h cups.h ipp.h http.h ppd.h array.h file.h language.h
adminutil.o: globals.h string.h ../config.h http-private.h md5.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 cups.h ipp.h http.h md5.h ppd.h
auth.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.h
backchannel.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.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 ppd.h array.h file.h language.h
backend.o: backend.h string.h ../config.h
custom.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
custom.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.h
dest.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
dest.o: array.h file.h language.h i18n.h normalize.h transcode.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
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 string.h
file.o: ../cups/debug.h file.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
emit.o: ppd.h array.h file.h string.h ../config.h debug.h
encode.o: cups.h ipp.h http.h ppd.h array.h file.h language.h ipp-private.h
encode.o: 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: globals.h string.h ../config.h http-private.h http.h md5.h
getputfile.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
getputfile.o: i18n.h transcode.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: normalize.h transcode.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 normalize.h
http.o: transcode.h debug.h
http-addr.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
http-addr.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.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: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
http-addr.o: globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
http-addr.o: 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 normalize.h transcode.h debug.h
http-support.o: debug.h globals.h string.h ../config.h cups.h ipp.h http.h
http-support.o: md5.h ppd.h array.h file.h language.h i18n.h normalize.h
http-support.o: transcode.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 normalize.h
ipp.o: transcode.h debug.h
ipp-support.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
ipp-support.o: array.h file.h language.h i18n.h normalize.h transcode.h
ipp-support.o: debug.h
langprintf.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
langprintf.o: array.h file.h language.h i18n.h normalize.h transcode.h
language.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
language.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.h
localize.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
localize.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.h
mark.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h string.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 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
normalize.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
normalize.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.h
notify.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
notify.o: array.h file.h language.h i18n.h normalize.h transcode.h
options.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h string.h
md5passwd.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
md5passwd.o: string.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 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 cups.h ipp.h http.h md5.h ppd.h array.h
ppd.o: file.h language.h i18n.h normalize.h transcode.h debug.h
request.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
request.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.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
sidechannel.o: sidechannel.h string.h ../config.h
snprintf.o: string.h ../config.h
string.o: debug.h string.h ../config.h globals.h cups.h ipp.h http.h md5.h
string.o: ppd.h array.h file.h language.h i18n.h normalize.h transcode.h
tempfile.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
tempfile.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.h
transcode.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
transcode.o: array.h file.h language.h i18n.h normalize.h transcode.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: normalize.h transcode.h
util.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
util.o: array.h file.h language.h i18n.h normalize.h 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
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 ppd.h array.h file.h language.h
testadmin.o: string.h ../config.h
testarray.o: ../cups/string.h ../config.h string.h array.h dir.h debug.h
testcups.o: cups.h ipp.h http.h ppd.h array.h file.h language.h
testfile.o: string.h ../config.h file.h debug.h
testhttp.o: http.h md5.h string.h ../config.h
testi18n.o: language.h array.h string.h ../config.h transcode.h normalize.h
testipp.o: ../cups/string.h ../config.h string.h ipp.h http.h md5.h
testlang.o: i18n.h language.h array.h
testhttp.o: http.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
testlang.o: i18n.h transcode.h language.h array.h string.h ../config.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 i18n.h normalize.h
adminutil.32.o: adminutil.c transcode.h debug.h
adminutil.32.o: adminutil.c adminutil.h cups.h ipp.h http.h ppd.h array.h file.h language.h
adminutil.32.o: adminutil.c globals.h string.h ../config.h http-private.h md5.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 cups.h ipp.h http.h md5.h ppd.h
auth.32.o: auth.c array.h file.h language.h i18n.h normalize.h 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
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 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 cups.h ipp.h http.h md5.h ppd.h
custom.32.o: custom.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
dest.32.o: dest.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
dest.32.o: dest.c array.h file.h language.h i18n.h normalize.h transcode.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
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 string.h
file.32.o: file.c ../cups/debug.h file.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
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 ppd.h array.h file.h language.h ipp-private.h
encode.32.o: encode.c 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 globals.h string.h ../config.h http-private.h http.h md5.h
getputfile.32.o: getputfile.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
getputfile.32.o: getputfile.c i18n.h transcode.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 normalize.h transcode.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 normalize.h
http.32.o: http.c transcode.h debug.h
http-addr.32.o: http-addr.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
http-addr.32.o: http-addr.c array.h file.h language.h i18n.h normalize.h transcode.h debug.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 http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
http-addr.32.o: http-addr.c globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
http-addr.32.o: http-addr.c 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 normalize.h transcode.h debug.h
http-support.32.o: http-support.c debug.h globals.h string.h ../config.h cups.h ipp.h http.h
http-support.32.o: http-support.c md5.h ppd.h array.h file.h language.h i18n.h normalize.h
http-support.32.o: http-support.c transcode.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 normalize.h
ipp.32.o: ipp.c transcode.h debug.h
ipp-support.32.o: ipp-support.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
ipp-support.32.o: ipp-support.c array.h file.h language.h i18n.h normalize.h transcode.h
ipp-support.32.o: ipp-support.c debug.h
langprintf.32.o: langprintf.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
langprintf.32.o: langprintf.c array.h file.h language.h i18n.h normalize.h transcode.h
language.32.o: language.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
language.32.o: language.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
localize.32.o: localize.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
localize.32.o: localize.c array.h file.h language.h i18n.h normalize.h 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
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 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
normalize.32.o: normalize.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
normalize.32.o: normalize.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
notify.32.o: notify.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
notify.32.o: notify.c array.h file.h language.h i18n.h normalize.h 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
md5passwd.32.o: md5passwd.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
md5passwd.32.o: md5passwd.c string.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 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 cups.h ipp.h http.h md5.h ppd.h array.h
ppd.32.o: ppd.c file.h language.h i18n.h normalize.h transcode.h debug.h
request.32.o: request.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
request.32.o: request.c array.h file.h language.h i18n.h normalize.h transcode.h debug.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
sidechannel.32.o: sidechannel.c sidechannel.h string.h ../config.h
snprintf.32.o: snprintf.c string.h ../config.h
string.32.o: string.c debug.h string.h ../config.h globals.h cups.h ipp.h http.h md5.h
string.32.o: string.c ppd.h array.h file.h language.h i18n.h normalize.h transcode.h
tempfile.32.o: tempfile.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
tempfile.32.o: tempfile.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
transcode.32.o: transcode.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
transcode.32.o: transcode.c array.h file.h language.h i18n.h normalize.h transcode.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 normalize.h transcode.h
util.32.o: util.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
util.32.o: util.c array.h file.h language.h i18n.h normalize.h 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
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 ppd.h array.h file.h language.h
testadmin.32.o: testadmin.c string.h ../config.h
testarray.32.o: testarray.c ../cups/string.h ../config.h string.h array.h dir.h debug.h
testcups.32.o: testcups.c cups.h ipp.h http.h ppd.h array.h file.h language.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 language.h array.h string.h ../config.h transcode.h normalize.h
testipp.32.o: testipp.c ../cups/string.h ../config.h string.h ipp.h http.h md5.h
testlang.32.o: testlang.c i18n.h language.h array.h
testhttp.32.o: testhttp.c http.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
testlang.32.o: testlang.c i18n.h transcode.h language.h array.h string.h ../config.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 i18n.h normalize.h
adminutil.64.o: adminutil.c transcode.h debug.h
adminutil.64.o: adminutil.c adminutil.h cups.h ipp.h http.h ppd.h array.h file.h language.h
adminutil.64.o: adminutil.c globals.h string.h ../config.h http-private.h md5.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 cups.h ipp.h http.h md5.h ppd.h
auth.64.o: auth.c array.h file.h language.h i18n.h normalize.h 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
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 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 cups.h ipp.h http.h md5.h ppd.h
custom.64.o: custom.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
dest.64.o: dest.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
dest.64.o: dest.c array.h file.h language.h i18n.h normalize.h transcode.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
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 string.h
file.64.o: file.c ../cups/debug.h file.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
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 ppd.h array.h file.h language.h ipp-private.h
encode.64.o: encode.c 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 globals.h string.h ../config.h http-private.h http.h md5.h
getputfile.64.o: getputfile.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
getputfile.64.o: getputfile.c i18n.h transcode.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 normalize.h transcode.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 normalize.h
http.64.o: http.c transcode.h debug.h
http-addr.64.o: http-addr.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
http-addr.64.o: http-addr.c array.h file.h language.h i18n.h normalize.h transcode.h debug.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 http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
http-addr.64.o: http-addr.c globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
http-addr.64.o: http-addr.c 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 normalize.h transcode.h debug.h
http-support.64.o: http-support.c debug.h globals.h string.h ../config.h cups.h ipp.h http.h
http-support.64.o: http-support.c md5.h ppd.h array.h file.h language.h i18n.h normalize.h
http-support.64.o: http-support.c transcode.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 normalize.h
ipp.64.o: ipp.c transcode.h debug.h
ipp-support.64.o: ipp-support.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
ipp-support.64.o: ipp-support.c array.h file.h language.h i18n.h normalize.h transcode.h
ipp-support.64.o: ipp-support.c debug.h
langprintf.64.o: langprintf.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
langprintf.64.o: langprintf.c array.h file.h language.h i18n.h normalize.h transcode.h
language.64.o: language.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
language.64.o: language.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
localize.64.o: localize.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
localize.64.o: localize.c array.h file.h language.h i18n.h normalize.h 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
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 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
normalize.64.o: normalize.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
normalize.64.o: normalize.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
notify.64.o: notify.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
notify.64.o: notify.c array.h file.h language.h i18n.h normalize.h 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
md5passwd.64.o: md5passwd.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
md5passwd.64.o: md5passwd.c string.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 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 cups.h ipp.h http.h md5.h ppd.h array.h
ppd.64.o: ppd.c file.h language.h i18n.h normalize.h transcode.h debug.h
request.64.o: request.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
request.64.o: request.c array.h file.h language.h i18n.h normalize.h transcode.h debug.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
sidechannel.64.o: sidechannel.c sidechannel.h string.h ../config.h
snprintf.64.o: snprintf.c string.h ../config.h
string.64.o: string.c debug.h string.h ../config.h globals.h cups.h ipp.h http.h md5.h
string.64.o: string.c ppd.h array.h file.h language.h i18n.h normalize.h transcode.h
tempfile.64.o: tempfile.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
tempfile.64.o: tempfile.c array.h file.h language.h i18n.h normalize.h transcode.h debug.h
transcode.64.o: transcode.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
transcode.64.o: transcode.c array.h file.h language.h i18n.h normalize.h transcode.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 normalize.h transcode.h
util.64.o: util.c globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
util.64.o: util.c array.h file.h language.h i18n.h normalize.h 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
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 ppd.h array.h file.h language.h
testadmin.64.o: testadmin.c string.h ../config.h
testarray.64.o: testarray.c ../cups/string.h ../config.h string.h array.h dir.h debug.h
testcups.64.o: testcups.c cups.h ipp.h http.h ppd.h array.h file.h language.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 language.h array.h string.h ../config.h transcode.h normalize.h
testipp.64.o: testipp.c ../cups/string.h ../config.h string.h ipp.h http.h md5.h
testlang.64.o: testlang.c i18n.h language.h array.h
testhttp.64.o: testhttp.c http.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
testlang.64.o: testlang.c i18n.h transcode.h language.h array.h string.h ../config.h
testppd.64.o: testppd.c ../cups/string.h ../config.h string.h ppd.h array.h file.h
+71 -55
Ver Arquivo
@@ -3,23 +3,14 @@
#
# 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 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
# 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/".
#
# This file is subject to the Apple OS-Developed Software exception.
#
@@ -43,6 +34,7 @@ LIBOBJS = \
emit.o \
encode.o \
file.o \
getifaddrs.o \
getputfile.o \
globals.o \
http.o \
@@ -57,12 +49,12 @@ LIBOBJS = \
mark.o \
md5.o \
md5passwd.o \
normalize.o \
notify.o \
options.o \
page.o \
ppd.o \
request.o \
sidechannel.o \
snprintf.o \
string.o \
tempfile.o \
@@ -77,6 +69,7 @@ OBJS = \
$(LIB64OBJS) \
testadmin.o \
testarray.o \
testcups.o \
testfile.o \
testhttp.o \
testi18n.o \
@@ -93,16 +86,15 @@ OBJS = \
HEADERS = \
adminutil.h \
array.h \
backend.h \
cups.h \
dir.h \
file.h \
http.h \
i18n.h \
ipp.h \
language.h \
md5.h \
normalize.h \
ppd.h \
sidechannel.h \
transcode.h
@@ -117,6 +109,7 @@ TARGETS = \
libcups.a \
testadmin \
testarray \
testcups \
testfile \
testhttp \
testi18n \
@@ -138,7 +131,8 @@ all: $(TARGETS)
clean:
$(RM) $(OBJS) $(TARGETS)
$(RM) libcups.so libcups.sl libcups.dylib libcups.32.so libcups.64.so
$(RM) libcups.so libcups.sl libcups.dylib
$(RM) -r 32bit 64bit
#
@@ -150,8 +144,8 @@ depend:
makedepend -Y -I.. -fDependencies.tmp $(OBJS:.o=.c) >/dev/null 2>&1
$(RM) Dependencies
cp Dependencies.tmp Dependencies
sed -r -e '1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp >>Dependencies
sed -r -e '1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp >>Dependencies
sed -E -e '1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp >>Dependencies
sed -E -e '1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp >>Dependencies
$(RM) Dependencies.tmp
@@ -171,13 +165,17 @@ 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)
if test $(LIBCUPS) != "libcups.a"; then \
$(INSTALL_LIB) libcups.a $(LIBDIR); \
$(RANLIB) $(LIBDIR)/libcups.a; \
fi
$(INSTALL_LIB) libcups.a $(LIBDIR)
$(RANLIB) $(LIBDIR)/libcups.a
installhdrs:
$(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
@@ -187,13 +185,13 @@ installhdrs:
install32bit:
$(INSTALL_DIR) -m 755 $(LIB32DIR)
$(INSTALL_LIB) libcups.32.so.2 $(LIB32DIR)/libcups.so.2
$(LN) libcups.so $(LIB32DIR)/libcups.so.2
$(INSTALL_LIB) 32bit/libcups.so.2 $(LIB32DIR)/libcups.so.2
$(LN) libcups.so.2 $(LIB32DIR)/libcups.so
install64bit:
$(INSTALL_DIR) -m 755 $(LIB64DIR)
$(INSTALL_LIB) libcups.64.so.2 $(LIB64DIR)/libcups.so.2
$(LN) libcups.so $(LIB64DIR)/libcups.so.2
$(INSTALL_LIB) 64bit/libcups.so.2 $(LIB64DIR)/libcups.so.2
$(LN) libcups.so.2 $(LIB64DIR)/libcups.so
#
@@ -232,40 +230,48 @@ uninstall64bit:
libcups.so.2 libcups.sl.2: $(LIBOBJS)
echo Linking $@...
$(DSO) $(DSOFLAGS) -o $@ $(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(RM) `basename $@ .2`
$(LN) $@ `basename $@ .2`
#
# libcups.32.so.2
# 32bit/libcups.so.2
#
libcups.32.so.2: $(LIB32OBJS)
32bit/libcups.so.2: $(LIB32OBJS)
echo Linking 32-bit $@...
$(DSO) $(C32FLAGS) $(DSOFLAGS) -o $@ $(LIB32OBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
-mkdir 32bit
$(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(RM) 32bit/libcups.so
$(LN) libcups.so.2 32bit/libcups.so
#
# libcups.64.so.2
# 64bit/libcups.so.2
#
libcups.64.so.2: $(LIB64OBJS)
64bit/libcups.so.2: $(LIB64OBJS)
echo Linking 64-bit $@...
$(DSO) $(C64FLAGS) $(DSOFLAGS) -o $@ $(LIB64OBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
-mkdir 64bit
$(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(RM) 64bit/libcups.so
$(LN) libcups.so.2 64bit/libcups.so
#
# libcups.2.dylib
#
libcups.2.dylib: $(LIBOBJS)
libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
echo Linking $@...
$(DSO) $(DSOFLAGS) -o $@ \
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
-install_name $(libdir)/$@ \
-current_version 2.7.0 \
-current_version 2.8.0 \
-compatibility_version 2.0.0 \
$(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
-exported_symbols_list libcups.exp \
-sectorder __TEXT __text $(LIBCUPSORDER) \
$(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(RM) libcups.dylib
$(LN) $@ libcups.dylib
@@ -274,9 +280,9 @@ libcups.2.dylib: $(LIBOBJS)
# libcups_s.a
#
libcups_s.a: $(LIBOBJS)
libcups_s.a: $(LIBOBJS) libcups_s.exp
echo Creating $@...
$(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) -lm
$(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) -lm
$(RM) $@
$(AR) $(ARFLAGS) $@ libcups_s.o
@@ -287,8 +293,8 @@ libcups_s.a: $(LIBOBJS)
libcups.la: $(LIBOBJS)
echo Linking $@...
$(CC) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
-version-info 2:7 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
-version-info 2:8 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
#
@@ -333,7 +339,7 @@ php_cups_wrap.c: cups.h
testadmin: testadmin.o libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testadmin.o libcups.a \
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
#
@@ -343,7 +349,17 @@ testadmin: testadmin.o libcups.a
testarray: testarray.o libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testarray.o libcups.a \
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(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)
#
@@ -353,7 +369,7 @@ testarray: testarray.o libcups.a
testfile: testfile.o libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testfile.o libcups.a \
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
#
@@ -363,7 +379,7 @@ testfile: testfile.o libcups.a
testhttp: testhttp.o libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testhttp.o libcups.a \
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
#
@@ -373,7 +389,7 @@ testhttp: testhttp.o libcups.a
testipp: testipp.o libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testipp.o libcups.a \
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
#
@@ -383,7 +399,7 @@ testipp: testipp.o libcups.a
testi18n: testi18n.o libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testi18n.o libcups.a \
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
#
@@ -393,7 +409,7 @@ testi18n: testi18n.o libcups.a
testlang: testlang.o libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testlang.o libcups.a \
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
#
@@ -403,7 +419,7 @@ testlang: testlang.o libcups.a
testppd: testppd.o libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testppd.o libcups.a \
$(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
#
@@ -417,7 +433,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 \
cups.h dest.c getputfile.c language.c notify.c \
options.c tempfile.c usersys.c \
util.c >../doc/help/api-cups.html
mxmldoc --section "Programming" --title "File and Directory APIs" \
@@ -425,7 +441,7 @@ apihelp:
file.h file.c dir.h dir.c >../doc/help/api-filedir.html
mxmldoc --section "Programming" --title "PPD API" \
--intro api-ppd.shtml \
ppd.h attr.c emit.c mark.c page.c \
ppd.h attr.c custom.c emit.c localize.c mark.c page.c \
ppd.c >../doc/help/api-ppd.html
mxmldoc --section "Programming" --title "HTTP and IPP APIs" \
--intro api-httpipp.shtml \
@@ -434,7 +450,7 @@ apihelp:
request.c >../doc/help/api-httpipp.html
mxmldoc --section "Programming" --title "Filter and Backend APIs" \
--intro api-filter.shtml \
backchannel.c >../doc/help/api-filter.html
backchannel.c sidechannel.c sidechannel.h >../doc/help/api-filter.html
#
+573 -162
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+13 -21
Ver Arquivo
@@ -7,23 +7,14 @@
* MANY OF THE FUNCTIONS IN THIS HEADER ARE PRIVATE AND SUBJECT TO
* CHANGE AT ANY TIME. USE AT YOUR OWN RISK.
*
* Copyright 2001-2006 by Easy Software Products.
* Copyright 2007 by Apple Inc.
* Copyright 2001-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* 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
* 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/".
*
* This file is subject to the Apple OS-Developed Software exception.
*/
@@ -53,6 +44,7 @@ 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"
@@ -70,12 +62,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
+7 -16
Ver Arquivo
@@ -1,25 +1,16 @@
<!--
"$Id: api-array.shtml 5138 2006-02-21 10:49:06Z mike $"
"$Id: api-array.shtml 6649 2007-07-11 21:46:42Z mike $"
Array API introduction for the Common UNIX Printing System (CUPS).
Copyright 1997-2006 by Easy Software Products.
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 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
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/".
-->
<h2 class='title'>Introduction</h2>
+7 -16
Ver Arquivo
@@ -1,25 +1,16 @@
<!--
"$Id: api-cups.shtml 5138 2006-02-21 10:49:06Z mike $"
"$Id: api-cups.shtml 6649 2007-07-11 21:46:42Z mike $"
CUPS API introduction for the Common UNIX Printing System (CUPS).
Copyright 1997-2006 by Easy Software Products.
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 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
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/".
-->
<h2 class='title'>Introduction</h2>
+7 -16
Ver Arquivo
@@ -1,25 +1,16 @@
<!--
"$Id: api-filedir.shtml 5138 2006-02-21 10:49:06Z mike $"
"$Id: api-filedir.shtml 6649 2007-07-11 21:46:42Z mike $"
File and directory API introduction for the Common UNIX Printing System (CUPS).
Copyright 1997-2005 by Easy Software Products.
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 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
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/".
-->
<h2 class='title'>Introduction</h2>
+179 -17
Ver Arquivo
@@ -1,25 +1,16 @@
<!--
"$Id: api-filter.shtml 5138 2006-02-21 10:49:06Z mike $"
"$Id: api-filter.shtml 6649 2007-07-11 21:46:42Z mike $"
Filter and backend API introduction for the Common UNIX Printing System (CUPS).
Copyright 1997-2006 by Easy Software Products.
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 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
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/".
-->
<h2 class='title'>Introduction</h2>
@@ -35,6 +26,9 @@ 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>&lt;cups/sidechannel.h&gt;</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
@@ -46,6 +40,174 @@ library:</p>
<kbd>gcc -o myprogram myprogram.c -lcups</kbd>
</pre>
<h2 class='title'>Compatibility</h2>
<p>All of these functions require CUPS 1.2 or higher.</p>
<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 &lt;cups/cups.h&gt;
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 &lt;cups/cups.h&gt;
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 &lt;cups/sidechannel.h&gt;
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, &amp;data, &amp;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 &lt;cups/sidechannel.h&gt;
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, &amp;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 &lt;cups/sidechannel.h&gt;
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, &amp;data, &amp;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 &amp;command,
cups_sc_status_t &amp;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 &lt;cups/sidechannel.h&gt;
cups_sc_command_t command;
cups_sc_status_t status;
/* Poll for a command... */
if (!cupsSideChannelRead(&amp;command, &amp;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>
+7 -16
Ver Arquivo
@@ -1,25 +1,16 @@
<!--
"$Id: api-httpipp.shtml 5138 2006-02-21 10:49:06Z mike $"
"$Id: api-httpipp.shtml 6649 2007-07-11 21:46:42Z mike $"
HTTP and IPP API introduction for the Common UNIX Printing System (CUPS).
Copyright 1997-2006 by Easy Software Products.
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 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
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/".
-->
<h2 class='title'>Introduction</h2>
+7 -16
Ver Arquivo
@@ -1,25 +1,16 @@
<!--
"$Id: api-ppd.shtml 5138 2006-02-21 10:49:06Z mike $"
"$Id: api-ppd.shtml 6649 2007-07-11 21:46:42Z mike $"
PPD API introduction for the Common UNIX Printing System (CUPS).
Copyright 1997-2006 by Easy Software Products.
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 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
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/".
-->
<h2 class='title'>Introduction</h2>

Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais