Comparar commits

...

23 Commits

Autor SHA1 Mensagem Data
msweet 8406cae8ee Tag 1.6.3
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/tags/release-1.6.3@11132 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-07-11 21:12:54 +00:00
msweet a0236fe7e7 Fix dates and versions in readme files.
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.6@11131 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-07-11 21:12:49 +00:00
msweet dbdd609a3a Mirror fix from trunk.
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.6@11114 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-07-10 14:08:55 +00:00
msweet 4abfc4313c Ignore generated files.
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.6@11112 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-07-09 13:32:31 +00:00
msweet 1a1f974d33 Update localization files.
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.6@11104 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-07-08 11:38:52 +00:00
msweet bfa5c91233 <rdar://problem/14290628> cups.org: cupsGetNamedDest returns the wrong default printer, lpr/lpq/lp/lpstat use different defaults!
Same fix for 1.6.x.


git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.6@11103 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-07-08 11:30:28 +00:00
msweet fb70b28510 Fix up HTML, same as trunk.
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.6@11088 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-07-03 15:04:32 +00:00
msweet 925ecfb9d7 Mirror change from trunk.
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.6@11079 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-06-27 19:03:30 +00:00
msweet 520ae4afbb httpStatus(HTTP_ERROR) did not return a useful error message
(<rdar://problem/14217326>)



git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.6@11063 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-06-25 15:13:32 +00:00
msweet a6da1f6153 Mirror fix from trunk.
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.6@11061 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-06-25 15:03:34 +00:00
msweet 067101d02d Mirror fix from trunk.
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.6@11059 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-06-25 14:38:12 +00:00
msweet decb87a756 Mirror fix from trunk.
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.6@11054 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-06-25 01:43:22 +00:00
msweet b7f166da75 Fix svn:ignore and svn:keywords.
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.6@11026 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-06-07 01:12:52 +00:00
msweet cadff87b26 Mirror changes from trunk.
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.6@10993 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-05-25 01:37:11 +00:00
msweet 75c2a30654 Mirror fixes from trunk.
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.6@10979 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-05-13 17:39:19 +00:00
msweet f3745d0088 Move 1.6.x import directory to new 1.6 cups.org branch.
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.6@4302 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-05-10 17:13:29 +00:00
msweet fc56c4d886 Merge changes from CUPS 1.6svn-r10972.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current-1.6.x@4298 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-05-10 16:52:10 +00:00
msweet 292f831c7a Fix EOL style on test file.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current-1.6.x@4186 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-02-20 02:21:23 +00:00
msweet ae7176a7a9 Merge changes from CUPS 1.6.2-r10873.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current-1.6.x@4185 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-02-20 02:19:13 +00:00
msweet 422369925a Merge changes from CUPS 1.6.2-r10688.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current-1.6.x@4016 a1ca3aef-8c08-0410-bb20-df032aa958be
2012-11-09 03:27:21 +00:00
msweet 6474d57e69 Merge changes from CUPS 1.6.2-r10651.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current-1.6.x@3954 a1ca3aef-8c08-0410-bb20-df032aa958be
2012-10-17 16:42:37 +00:00
msweet 58acbe964e Fix EOL style for test file.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current-1.6.x@3953 a1ca3aef-8c08-0410-bb20-df032aa958be
2012-10-17 16:14:59 +00:00
msweet 2f89228ff3 Create CUPS 1.6.x import branch.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current-1.6.x@3867 a1ca3aef-8c08-0410-bb20-df032aa958be
2012-07-10 19:40:43 +00:00
691 arquivos alterados com 51429 adições e 3537 exclusões
+9
Ver Arquivo
@@ -3,6 +3,15 @@ CHANGES-1.5.txt
CHANGES IN CUPS V1.5.4
- Documentation updates (STR #4112, STR #4130, STR #4134)
- Fixes for libusb-based USB backend (STR #4128)
- The lpq command did not show the owner or title of jobs unless passed
a username on the command-line (STR #4135)
- Localized empty strings contained the message catalog metadata
(STR #4119)
- Fixed a crash in the libusb-based USB backend (STR #4099)
- The cups-lpd mini-daemon no longer handled jobs with multiple copies
(STR #4118)
- Multiple libusb backend fixes (STR #4098, STR #4100)
- The IPP backend no longer tries to get the job status for printers
that do not implement the required operation (STR #4083)
-128
Ver Arquivo
@@ -1,128 +0,0 @@
CHANGES-IPPTOOL.txt - 2012-02-28
--------------------------------
This file provides a list of changes to the ipptool binary distribution posted
on cups.org.
2012-02-28
- Changed behavior of WITH-VALUES "/regex/" to not require all values to
match.
- Added WITH-ALL-VALUES directive for EXPECT predicates that require all
values to match.
- Updated test files to use WITH-ALL-VALUES where necessary.
- Updated test files to use new ABNF for media names from PWG Media
Names 2.0.
2012-02-06
- Fixed the packaging of ipptool on Windows (removed unnecessary DLLs)
- Fixed an crash in ipptool when mixing DISPLAY with -I and a failed
request.
- Added a Print-Job test file.
- Added a "setdebug" batch file for Windows
- Added support for a CUPS_DISABLE_ASYNC_CONNECT environment variable.
2012-01-10
- Fixed an issue with the IPP/1.1 test file where the "waiting for job
completion" test did not work.
- The attribute groups out of order error was not shown for the
operation-attributes-tag group.
2011-12-02
- Fixed a truncated XML output bug that would happen for certain errors.
- Fixed the order-of-groups tests.
- Fixed "WITH-VALUE >N" for rangeOfInteger attributes.
- The Windows installer was missing the get-printer-attributes.test
file.
- The Linux binaries are now compiled for all LSB 4.x-compliant Linux
distributions.
- The Linux binaries no longer support SSL or TLS.
2011-10-05
- Fixed a crasher bug that showed up on Windows.
- The IPP/1.1 test would hang if the initial Print-Job test failed.
- Fixed a typo in the IPP/2.0 test.
2011-10-03
- Using OF-TYPE with the "no-value" or "unknown" out-of-band value tags
now works without special WITH-VALUE strings.
- ipptool now shows an error when an attribute appears more than once
within the same attribute group.
- ipptool did not display attributes as specified by the DISPLAY
directive when a test error failed.
- Fixed one spot where DEFINE-VALUE was still treated as an error when
the EXPECT test failed.
- uriScheme values were not displayed properly.
- Updated the IPP/1.1 tests to properly validate support for
job-hold-until-default and job-hold-until-supported when the Hold-Job
operation is supported.
- Updated the IPP/1.1 tests to properly check for the various standard
media sizes for the printing tests.
- Updated the IPP/1.1 tests to accept "no-value" for media-default an
orientation-requested-default.
- Updated the IPP/1.1 tests to accept "unknown" for job-state.
- Updated the IPP/1.1 tests to not perform the bogus URI printing tests
unless the "document-uri" variable is defined.
- Updated the IPP/2.0 tests to properly validate media-col
"media-xxx-supported" attributes.
- Updated the IPP/2.2 tests to properly validate media-ready and
media-col-ready.
2011-09-28
- Test output now includes a summary and overall score at the end.
- The MATCH-VALUE predicate now correctly deals with a failed EXPECT
condition.
- The IPP/1.1 test suite now looks for legacy media names and uses them
if the corresponding PWG standard names are not present.
- The IPP/1.1 test suite now tests the Print-Job+Release-Job when the
printer supports the job-hold-until attribute, Hold-Job operation, and
Release-Job operation.
2011-09-21
- Fixes for HTTP chunking, timeout, and encryption issues reported by
various users.
- Greatly improved IPP tests with added IPP/2.2 tests.
- New test documents - 1-page and 4-page mixed A4/Letter PDF/PS and a
couple JPEGs.
- New REPEAT directives to programmatically repeat tests as needed.
2011-08-16
- The Windows version no longer requires Visual Studio to be installed.
- The Windows version now supports SSL.
- Added "ipps" URI support.
- Added a new "-T" option.
- Added support for fractional seconds for the -i option and DELAY
directive.
- Added support for authentication.
- Added DEFINE-MATCH, DEFINE-NO-MATCH, DEFINE-VALUE, IF-NOT-DEFINED,
IGNORE-ERRORS, SKIP-IF-DEFINED, SKIP-IF-NOT-DEFINED,
SKIP-PREVIOUS-ERROR directives.
- WITH-VALUE now supports variable expansion.
- Updated the IPP/1.1 conformance test to skip the "my-jobs different
user" test if the printer URI contains a username.
- Updated the IPP conformance tests to validate media, media-default,
and media-supported values.
- No longer error out if a Printer returns a different version number in
the response when the request contains the version 0.0.
2010-10-16
- Initial release of standalone binary.
+157 -1
Ver Arquivo
@@ -1,6 +1,162 @@
CHANGES.txt - 1.6b1 - 2012-05-22
CHANGES.txt - 1.6.3 - 2013-07-11
--------------------------------
CHANGES IN CUPS V1.6.3
- The configure script now prefers Clang over GCC.
- Fixed a compile problem on AIX (STR #4307)
- The default IPP version did not always get set before creating a new
IPP request message (<rdar://problem/14401718>)
- The lp, lpq, lpr, and lpstat now display an error message advising the
use of the /version=1.1 ServerName option (<rdar://problem/14290628>)
- Added documentation about the /version=1.1 option to ServerName in
client.conf (<rdar://problem/14216262>)
- httpStatus(HTTP_ERROR) did not return a useful error message
(<rdar://problem/14217326>)
- The lp, lpq, lpr, and lpstat commands incorrectly ignored the default
printer set in the lpoptions file (<rdar://problem/14216472>)
- Fixed a URI encoding issue for hostnames containing the ` (backquote)
character (<rdar://problem/14243133>)
- Added support for RFC 6874's IPv6 link local address format in URIs
(<rdar://problem/13979453>)
- The USB backend could crash on libusb-based systems if USB was
disabled in the BIOS (<rdar://problem/13875729>)
- Fixed a rounding error in the PWG media size mapping code
(<rdar://problem/13493241>)
- Fixed several ipptool test files that used old STATUS names.
- Kerberos credentials could get truncated when printing to a shared
printer.
- Printing using "ipps" URIs was not encrypted.
- Insecure ICC profiles prevented installation of user profiles for a
printer on OS X.
- Added more USB quirks for the libusb-based backend (STR #4311,
<rdar://problem/13736470>)
- The Russian web interface templates were broken (STR #4310)
- The scheduler no longer tries to do Kerberos authentication over the
loopback interface.
- The IPP backend could fail to pause a job for authentication
(STR #4298)
- Fixed a regression on the handling of auth keys on OS X if the
cups-files.conf was not present or did not contain a SystemAuthKey
value.
- The scheduler incorrectly did a reverse lookup of the server address
when HostNameLookups was turned off (STR #4302)
- The scheduler incorrectly computed the final content type value when
null filters were present.
CHANGES IN CUPS V1.6.2
- Documentation fixes (STR #4229, STR #4239, STR #4234, STR #4248,
STR #4259)
- Security: All file, directory, user, and group settings are now stored
in a separate cups-files.conf configuration file that cannot be set
through the CUPS web interface or APIs (STR #4223)
- Added a Czech localization (STR #4201)
- Added a French localization (STR #4247)
- Added a Russian localization (STR #4228, STR #4285)
- Updated the Catalan localization (STR #4202)
- Local certificate authentication did not guard against an empty
certification file (STR #4293)
- The scheduler did not reject device URIs with spaces.
- Added USB quirk rule for Epson Stylus Photo 750 (STR #4286)
- The IPP backend could crash if the printer disconnects early
(STR #4284)
- cupsGetPPD did not work with statically-configured CUPS shared
queues (STR #4178)
- The scheduler did not support long MIME media types (STR #4270)
- The cupsfilter command did not set the CHARSET environment variable
for the text filters (STR #4273)
- The lp command did not show errors for unknown "--foo" (STR #4261)
- Bad IPP responses could crash ipptool (STR #4262)
- Updated USB quirk rules for Canon and Xerox printers (STR #4217,
STR #4263)
- Added USB blacklisting for printers that require a custom backend
(STR #4218)
- The PPD compiler did not correctly JCL options (STR #4115, STR #4203)
- The ipptool program now supports DEFINE-MATCH and DEFINE-NO-MATCH
predicates for STATUS directives.
- Fixed a problem with local Kerberos authentication (STR #4140)
- Coverity scan: fixed some minor issues (STR #4242)
- The scheduler did not remove color profiles after deleting a printer
(STR #4232, STR #4276)
- The CUPS library did not always detect a timed out connection to the
server which could cause temporary loss of printing from applications
(STR #4187)
- The ipptool program now supports variable substitution in OPERATION
and DELAY directives (STR #4175)
- The IPP backend now stops queues when the server configuration
prevents successful job submission (STR #4125)
- The XML output of ipptool contained empty dictionaries (STR #4136)
- The scheduler did not delete job control backup files (STR #4244)
- cupsGetPPD3 could return a local PPD instead of the correct remote
PPD.
- The scheduler incorrectly advertised auth-info-required for local
queues needing local authentication (STR #4205)
- CUPS 1.6 clients using the ServerName directive in client.conf did not
work with CUPS 1.3.x or older servers (STR #4231, STR #4291)
- The SNMP backend now tries to work around broken printers that use a
newline to separate key/value pairs.
- The IPP backend did not send a cancel request to printers when a job
was canceled and the printer did not support Create-Job.
- Fixed EPM packaging files (STR #4199)
- OpenBSD build fix (STR #4195, STR #4196, STR #4197)
- The scheduler could crash when using Avahi (STR #4183, STR #4192,
STR #4200, STR #4213)
- The IPP backend could get stuck in an endless loop on certain network
errors (STR #4194)
- 32-bit builds failed on Debian (STR #4133)
- The scheduler no longer accepts or sends job description attributes.
- The IPP backend now works around some conformance issues for broken
printers (STR #4190)
- cupsBackendReport() now filters out all control characters from the
reported 1284 device IDs (STR #4124)
- The scheduler no longer allows job-name values that are not valid
network Unicode strings (STR #4072)
- The web interface did not preserve the order of classes, jobs, or
printers (STR #4170)
- The network backends now support disabling of SNMP supply level
queries via the "snmp" URI option (STR #4106)
- The IPP backend did not specify the compression used (STR #4181)
- ipptool did not support octetString values.
- The scheduler did not recognize dnssd: or ipps: URIs as Bonjour shared
queues (STR #4158)
- Applications could not get the PPD file for statically-configured
Bonjour-shared print queues (STR #4159)
- The cupsd.conf file included obsolete browsing directives (STR #4157)
- Fixed a USB backend compatibility issue on systems using libusb
(STR #4155, STR #4191)
- Some Bonjour features were not available on systems with Avahi
(STR #4156)
- CUPS now includes the port number in the Host: header for HTTP
requests.
- Fixed REPEAT-MATCH for STATUS and EXPECT - was incorrectly erroring
out.
CHANGES IN CUPS V1.6.1
- Documentation fix (STR #4149)
- RPM packaging fixes (STR #4129, #4145)
- The Japanese and English web interface headers were swapped
(STR #4148)
CHANGES IN CUPS V1.6.0
- Document changes (STR #4131)
- Added new Catalan (STR #4107) and Spanish (STR #4137) localizations.
CHANGES IN CUPS V1.6rc1
- Added a new Japanese localization (STR #4122)
- The SNMP backend no longer exits if it is unable to obtain an IPv6
socket (STR #4109)
- The LPD backend incorrectly used "localhost" in the control file
instead of the current hostname.
CHANGES IN CUPS V1.6b1
- Documentation updates (STR #3927, STR #3980, STR #4010, STR #4068)
+6 -4
Ver Arquivo
@@ -1,4 +1,4 @@
CREDITS.txt - 2010-03-13
CREDITS.txt - 2012-07-16
------------------------
Few projects are completed by one person, and CUPS is no exception. We'd
@@ -17,7 +17,7 @@ like to thank the following individuals for their contributions:
Wang Jian - CUPS RPM corrections.
Roderick Johnstone - Beta tester of the millenium.
Till Kamppeter - Bug fixes, beta testing, evangelism.
Iaki Larraaga - Basque localization.
Iñaki Larrañaga - Basque localization.
Kenshi Muto - Japanese localization, patches, and
testing.
Tomohiro Kato - Japanese localization.
@@ -27,16 +27,18 @@ like to thank the following individuals for their contributions:
Mark Lawrence - Microsoft interoperability testing.
Jeff Licquia - Bug fixes, beta testing, evangelism.
Jason McMullan - Original CUPS RPM distributions.
Àngel Mompó - Catalan localization.
Wes Morgan - *BSD fixes.
Daniel Nylander - Swedish localization.
Niklas 'Nille' kerstršm - Swedish localization.
Niklas 'Nille' Åkerström - Swedish localization.
Naruiko Ogasawara - Japanese 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 Gonzlez Riopedre - Spanish localization.
Juan Pablo González Riopedre - Spanish localization.
Opher Shachar - Hebrew localization.
Stuart Stevens - HP JetDirect IPP information.
Andrea Suatoni - IRIX desktop integration and testing.
+11 -5
Ver Arquivo
@@ -1,14 +1,20 @@
INSTALL - CUPS v1.6.0 - 2012-05-23
INSTALL - CUPS v1.6.3 - 2013-07-11
----------------------------------
This file describes how to compile and install CUPS from source code. For more
information on CUPS see the file called "README.txt". A complete change log can
be found in "CHANGES.txt".
**** IF YOU HAVE A NON-POSTSCRIPT PRINTER AND ARE NOT ****
**** RUNNING OS X, YOU WILL ALSO NEED TO INSTALL GPL ****
**** GHOSTSCRIPT WITH THE "cups" DRIVER AFTER YOU INSTALL ****
**** CUPS. ****
*******************************************************************************
*******************************************************************************
**** ****
**** USING CUPS REQUIRES ADDITIONAL THIRD-PARTY SUPPORT SOFTWARE AND ****
**** PRINTER DRIVERS. THESE ARE TYPICALLY INCLUDED WITH YOUR OPERATING ****
**** SYSTEM DISTRIBUTION. APPLE DOES NOT ENDORSE OR SUPPORT THIRD-PARTY ****
**** SUPPORT SOFTWARE FOR CUPS. ****
**** ****
*******************************************************************************
*******************************************************************************
BEFORE YOU BEGIN
+5 -3
Ver Arquivo
@@ -3,7 +3,7 @@
#
# Top-level Makefile for CUPS.
#
# Copyright 2007-2012 by Apple Inc.
# Copyright 2007-2013 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
@@ -99,8 +99,10 @@ clean:
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) conf/cups-files.conf conf/cupsd.conf
$(RM) conf/mime.convs conf/pam.std conf/snmp.conf
$(RM) doc/help/ref-cups-files-conf.html doc/help/ref-cupsd-conf.html
$(RM) doc/help/standard.html doc/index.html
$(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
+5 -6
Ver Arquivo
@@ -1,14 +1,13 @@
README - CUPS v1.6.0 - 2012-05-23
----------------------------------
README - CUPS v1.6.3 - 2013-07-11
---------------------------------
Looking for compile instructions? Read the file "INSTALL.txt"
instead...
Looking for compile instructions? Read the file "INSTALL.txt" instead...
INTRODUCTION
CUPS is a standards-based, open source printing system developed by Apple
Inc. for Mac OS® X and other UNIX®-like operating systems. CUPS uses the
Inc. for OS® X and other UNIX®-like operating systems. CUPS uses the
Internet Printing Protocol ("IPP") and provides System V and Berkeley
command-line interfaces, a web interface, and a C API to manage printers and
print jobs. It supports printing to both local (parallel, serial, USB) and
@@ -150,7 +149,7 @@ PRINTING FILES
LEGAL STUFF
CUPS is Copyright 2007-2012 by Apple Inc. CUPS and the CUPS logo are
CUPS is Copyright 2007-2013 by Apple Inc. CUPS and the CUPS logo are
trademarks of Apple Inc.
The MD5 Digest code is Copyright 1999 Aladdin Enterprises.
+5 -3
Ver Arquivo
@@ -128,7 +128,7 @@ install-exec: $(INSTALLXPC)
$(RM) $(SERVERBIN)/backend/$$file; \
$(LN) ipp $(SERVERBIN)/backend/$$file; \
done
if test "x$(DNSSD_BACKEND)" != x; then \
if test "x$(DNSSD_BACKEND)" != x -a `uname` = Darwin; then \
$(RM) $(SERVERBIN)/backend/mdns; \
$(LN) $(DNSSD_BACKEND) $(SERVERBIN)/backend/mdns; \
fi
@@ -232,8 +232,10 @@ libbackend.a: $(LIBOBJS)
dnssd: dnssd.o ../cups/$(LIBCUPS) libbackend.a
echo Linking $@...
$(CC) $(LDFLAGS) -o dnssd dnssd.o libbackend.a $(LIBS)
$(RM) mdns
$(LN) dnssd mdns
if test `uname` = Darwin; then \
$(RM) mdns; \
$(LN) dnssd mdns; \
fi
#
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: dnssd.c 3833 2012-05-23 22:51:18Z msweet $"
*
* DNS-SD discovery backend for CUPS.
*
@@ -1276,5 +1276,5 @@ unquote(char *dst, /* I - Destination buffer */
/*
* End of "$Id$".
* End of "$Id: dnssd.c 3833 2012-05-23 22:51:18Z msweet $".
*/
+147 -34
Ver Arquivo
@@ -3,7 +3,7 @@
*
* IPP backend for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -86,6 +86,7 @@ static int child_pid = 0; /* Child process ID */
#endif /* HAVE_GSSAPI && HAVE_XPC */
static const char * const jattrs[] = /* Job attributes we want */
{
"job-id",
"job-impressions-completed",
"job-media-sheets-completed",
"job-name",
@@ -99,8 +100,6 @@ static char username[256] = "",
/* Username for device URI */
*password = NULL;
/* Password for device URI */
static int password_tries = 0;
/* Password tries */
static const char * const pattrs[] = /* Printer attributes we want */
{
"copies-supported",
@@ -165,11 +164,13 @@ static ipp_t *new_request(ipp_op_t op, int version, const char *uri,
const char *format, _ppd_cache_t *pc,
ipp_attribute_t *media_col_sup,
ipp_attribute_t *doc_handling_sup);
static const char *password_cb(const char *);
static const char *password_cb(const char *prompt, http_t *http,
const char *method, const char *resource,
int *user_data);
static void report_attr(ipp_attribute_t *attr);
static void report_printer_state(ipp_t *ipp);
#if defined(HAVE_GSSAPI) && defined(HAVE_XPC)
static int run_as_user(int argc, char *argv[], uid_t uid,
static int run_as_user(char *argv[], uid_t uid,
const char *device_uri, int fd);
#endif /* HAVE_GSSAPI && HAVE_XPC */
static void sigterm_handler(int sig);
@@ -202,7 +203,9 @@ main(int argc, /* I - Number of command-line args */
*name, /* Name of option */
*value, /* Value of option */
sep; /* Separator character */
int password_tries = 0; /* Password tries */
http_addrlist_t *addrlist; /* Address of printer */
int snmp_enabled = 1; /* Is SNMP enabled? */
int snmp_fd, /* SNMP socket */
start_count, /* Page count via SNMP at start */
page_count, /* Page count via SNMP */
@@ -348,7 +351,7 @@ main(int argc, /* I - Number of command-line args */
if (uid > 0)
{
if (argc == 6)
return (run_as_user(argc, argv, uid, device_uri, 0));
return (run_as_user(argv, uid, device_uri, 0));
else
{
int status = 0; /* Exit status */
@@ -357,7 +360,7 @@ main(int argc, /* I - Number of command-line args */
{
if ((fd = open(argv[i], O_RDONLY)) >= 0)
{
status = run_as_user(argc, argv, uid, device_uri, fd);
status = run_as_user(argv, uid, device_uri, fd);
close(fd);
}
else
@@ -404,7 +407,7 @@ main(int argc, /* I - Number of command-line args */
if (!port)
port = IPP_PORT; /* Default to port 631 */
if (!strcmp(scheme, "https"))
if (!strcmp(scheme, "https") || !strcmp(scheme, "ipps"))
cupsSetEncryption(HTTP_ENCRYPT_ALWAYS);
else
cupsSetEncryption(HTTP_ENCRYPT_IF_REQUESTED);
@@ -508,6 +511,16 @@ main(int argc, /* I - Number of command-line args */
value);
}
}
else if (!_cups_strcasecmp(name, "snmp"))
{
/*
* Enable/disable SNMP stuff...
*/
snmp_enabled = !value[0] || !_cups_strcasecmp(value, "on") ||
_cups_strcasecmp(value, "yes") ||
_cups_strcasecmp(value, "true");
}
else if (!_cups_strcasecmp(name, "version"))
{
if (!strcmp(value, "1.0"))
@@ -595,7 +608,7 @@ main(int argc, /* I - Number of command-line args */
* Set the authentication info, if any...
*/
cupsSetPasswordCB(password_cb);
cupsSetPasswordCB2((cups_password_cb2_t)password_cb, &password_tries);
if (username[0])
{
@@ -659,11 +672,14 @@ main(int argc, /* I - Number of command-line args */
* See if the printer supports SNMP...
*/
if ((snmp_fd = _cupsSNMPOpen(addrlist->addr.addr.sa_family)) >= 0)
{
if (snmp_enabled)
snmp_fd = _cupsSNMPOpen(addrlist->addr.addr.sa_family);
else
snmp_fd = -1;
if (snmp_fd >= 0)
have_supplies = !backendSNMPSupplies(snmp_fd, &(addrlist->addr),
&start_count, NULL);
}
else
have_supplies = start_count = 0;
@@ -932,6 +948,8 @@ main(int argc, /* I - Number of command-line args */
_cupsLangPrintFilter(stderr, "ERROR",
_("Unable to get printer status."));
sleep(10);
httpReconnect(http);
}
ippDelete(supported);
@@ -959,9 +977,15 @@ main(int argc, /* I - Number of command-line args */
if ((printer_state = ippFindAttribute(supported,
"printer-state-reasons",
IPP_TAG_KEYWORD)) != NULL && !busy)
IPP_TAG_KEYWORD)) == NULL)
{
update_reasons(NULL, "+cups-ipp-conformance-failure-report,"
"cups-ipp-missing-printer-state-reasons");
}
else if (!busy)
{
for (i = 0; i < printer_state->num_values; i ++)
{
if (!strcmp(printer_state->values[0].string.text,
"spool-area-full") ||
!strncmp(printer_state->values[0].string.text, "spool-area-full-",
@@ -970,10 +994,8 @@ main(int argc, /* I - Number of command-line args */
busy = 1;
break;
}
}
}
else
update_reasons(NULL, "+cups-ipp-conformance-failure-report,"
"cups-ipp-missing-printer-state-reasons");
if (busy)
{
@@ -1036,6 +1058,12 @@ main(int argc, /* I - Number of command-line args */
if ((operations_sup = ippFindAttribute(supported, "operations-supported",
IPP_TAG_ENUM)) != NULL)
{
fprintf(stderr, "DEBUG: operations-supported (%d values)\n",
operations_sup->num_values);
for (i = 0; i < operations_sup->num_values; i ++)
fprintf(stderr, "DEBUG: [%d] = %s\n", i,
ippOpString(operations_sup->values[i].integer));
for (i = 0; i < operations_sup->num_values; i ++)
if (operations_sup->values[i].integer == IPP_PRINT_JOB)
break;
@@ -1080,7 +1108,7 @@ main(int argc, /* I - Number of command-line args */
get_job_attrs = 1;
}
if (!send_document)
if (create_job && !send_document)
{
fputs("DEBUG: Printer supports Create-Job but not Send-Document.\n",
stderr);
@@ -1258,6 +1286,17 @@ main(int argc, /* I - Number of command-line args */
compatsize = fileinfo.st_size;
}
/*
* If the printer only claims to support IPP/1.0, or if the user specifically
* included version=1.0 in the URI, then do not try to use Create-Job or
* Send-Document. This is another dreaded compatibility hack, but
* unfortunately there are enough broken printers out there that we need
* this for now...
*/
if (version == 10)
create_job = send_document = 0;
/*
* Start monitoring the printer in the background...
*/
@@ -1474,10 +1513,9 @@ main(int argc, /* I - Number of command-line args */
goto cleanup;
}
}
else if (ipp_status == IPP_ERROR_JOB_CANCELED)
else if (ipp_status == IPP_ERROR_JOB_CANCELED ||
ipp_status == IPP_NOT_AUTHORIZED)
goto cleanup;
else if (ipp_status == IPP_NOT_AUTHORIZED)
continue;
else
{
/*
@@ -1578,6 +1616,10 @@ main(int argc, /* I - Number of command-line args */
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE,
"document-format", NULL, document_format);
if (compression)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"compression", NULL, compression);
fprintf(stderr, "DEBUG: Sending file %d using chunking...\n", i + 1);
http_status = cupsSendRequest(http, request, resource, 0);
if (http_status == HTTP_CONTINUE && request->state == IPP_DATA)
@@ -1653,15 +1695,72 @@ main(int argc, /* I - Number of command-line args */
else if (ipp_status == IPP_SERVICE_UNAVAILABLE ||
ipp_status == IPP_NOT_POSSIBLE ||
ipp_status == IPP_PRINTER_BUSY)
{
if (argc == 6)
{
/*
* Need to reprocess the entire job; if we have a job ID, cancel the
* job first...
*/
if (job_id > 0)
cancel_job(http, uri, job_id, resource, argv[2], version);
goto cleanup;
}
continue;
else if (ipp_status == IPP_REQUEST_VALUE)
}
else if (ipp_status == IPP_REQUEST_VALUE ||
ipp_status == IPP_ERROR_JOB_CANCELED ||
ipp_status == IPP_NOT_AUTHORIZED ||
ipp_status == IPP_INTERNAL_ERROR)
{
/*
* Print file is too large, abort this job...
* Print file is too large, job was canceled, we need new
* authentication data, or we had some sort of error...
*/
goto cleanup;
}
else if (ipp_status == IPP_UPGRADE_REQUIRED)
{
/*
* Server is configured incorrectly; the policy for Create-Job and
* Send-Document has to be the same (auth or no auth, encryption or
* no encryption). Force the queue to stop since printing will never
* work.
*/
fputs("DEBUG: The server or printer is configured incorrectly.\n",
stderr);
fputs("DEBUG: The policy for Create-Job and Send-Document must have the "
"same authentication and encryption requirements.\n", stderr);
ipp_status = IPP_INTERNAL_ERROR;
if (job_id > 0)
cancel_job(http, uri, job_id, resource, argv[2], version);
goto cleanup;
}
else if (ipp_status == IPP_NOT_FOUND)
{
/*
* Printer does not actually implement support for Create-Job/
* Send-Document, so log the conformance issue and stop the printer.
*/
fputs("DEBUG: This printer claims to support Create-Job and "
"Send-Document, but those operations failed.\n", stderr);
fputs("DEBUG: Add '?version=1.0' to the device URI to use legacy "
"compatibility mode.\n", stderr);
update_reasons(NULL, "+cups-ipp-conformance-failure-report,"
"cups-ipp-missing-send-document");
ipp_status = IPP_INTERNAL_ERROR; /* Force queue to stop */
goto cleanup;
}
else
copies_remaining --;
@@ -1798,6 +1897,9 @@ main(int argc, /* I - Number of command-line args */
ippDelete(response);
if (cupsLastError() <= IPP_OK_CONFLICT)
password_tries = 0;
/*
* Wait before polling again...
*/
@@ -1821,12 +1923,16 @@ main(int argc, /* I - Number of command-line args */
check_printer_state(http, uri, resource, argv[2], version);
if (cupsLastError() <= IPP_OK_CONFLICT)
password_tries = 0;
/*
* Collect the final page count as needed...
*/
if (have_supplies &&
!backendSNMPSupplies(snmp_fd, http->hostaddr, &page_count, NULL) &&
!backendSNMPSupplies(snmp_fd, &(http->addrlist->addr), &page_count,
NULL) &&
page_count > start_count)
fprintf(stderr, "PAGE: total %d\n", page_count - start_count);
@@ -1995,9 +2101,6 @@ check_printer_state(
fprintf(stderr, "DEBUG: Get-Printer-Attributes: %s (%s)\n",
ippErrorString(cupsLastError()), cupsLastErrorString());
if (cupsLastError() <= IPP_OK_CONFLICT)
password_tries = 0;
/*
* Return the printer-state value...
*/
@@ -2096,6 +2199,7 @@ monitor_printer(
const char *job_name; /* Job name */
ipp_jstate_t job_state; /* Job state */
const char *job_user; /* Job originating user name */
int password_tries = 0; /* Password tries */
/*
@@ -2107,7 +2211,7 @@ monitor_printer(
httpSetTimeout(http, 30.0, timeout_cb, NULL);
if (username[0])
cupsSetUser(username);
cupsSetPasswordCB(password_cb);
cupsSetPasswordCB2((cups_password_cb2_t)password_cb, &password_tries);
/*
* Loop until the job is canceled, aborted, or completed.
@@ -2131,6 +2235,8 @@ monitor_printer(
monitor->resource,
monitor->user,
monitor->version);
if (cupsLastError() <= IPP_OK_CONFLICT)
password_tries = 0;
/*
* Check the status of the job itself...
@@ -2599,12 +2705,20 @@ new_request(
*/
static const char * /* O - Password */
password_cb(const char *prompt) /* I - Prompt (not used) */
password_cb(const char *prompt, /* I - Prompt (not used) */
http_t *http, /* I - Connection */
const char *method, /* I - Request method (not used) */
const char *resource, /* I - Resource path (not used) */
int *password_tries) /* I - Password tries */
{
fprintf(stderr, "DEBUG: password_cb(prompt=\"%s\"), password=%p, "
"password_tries=%d\n", prompt, password, password_tries);
fprintf(stderr, "DEBUG: password_cb(prompt=\"%s\", http=%p, method=\"%s\", "
"resource=\"%s\", password_tries=%p(%d)), password=%p\n",
prompt, http, method, resource, password_tries, *password_tries,
password);
(void)prompt;
(void)method;
(void)resource;
/*
* Remember that we need to authenticate...
@@ -2612,9 +2726,9 @@ password_cb(const char *prompt) /* I - Prompt (not used) */
auth_info_required = "username,password";
if (password && *password && password_tries < 3)
if (password && *password && *password_tries < 3)
{
password_tries ++;
(*password_tries) ++;
return (password);
}
@@ -2839,8 +2953,7 @@ report_printer_state(ipp_t *ipp) /* I - IPP response */
*/
static int /* O - Exit status */
run_as_user(int argc, /* I - Number of command-line args */
char *argv[], /* I - Command-line arguments */
run_as_user(char *argv[], /* I - Command-line arguments */
uid_t uid, /* I - User ID */
const char *device_uri, /* I - Device URI */
int fd) /* I - File to print */
+22 -5
Ver Arquivo
@@ -126,6 +126,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
int port; /* Port number */
char portname[256]; /* Port name (string) */
http_addrlist_t *addrlist; /* List of addresses for printer */
int snmp_enabled = 1; /* Is SNMP enabled? */
int snmp_fd; /* SNMP socket */
int fd; /* Print file */
int status; /* Status of LPD job */
@@ -356,7 +357,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
*/
if (!value[0] || !_cups_strcasecmp(value, "on") ||
!_cups_strcasecmp(value, "yes") || !_cups_strcasecmp(value, "true") ||
!_cups_strcasecmp(value, "yes") ||
!_cups_strcasecmp(value, "true") ||
!_cups_strcasecmp(value, "rfc1179"))
reserve = RESERVE_RFC1179;
else if (!_cups_strcasecmp(value, "any"))
@@ -371,7 +373,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
*/
manual_copies = !value[0] || !_cups_strcasecmp(value, "on") ||
!_cups_strcasecmp(value, "yes") || !_cups_strcasecmp(value, "true");
!_cups_strcasecmp(value, "yes") ||
!_cups_strcasecmp(value, "true");
}
else if (!_cups_strcasecmp(name, "sanitize_title"))
{
@@ -380,7 +383,18 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
*/
sanitize_title = !value[0] || !_cups_strcasecmp(value, "on") ||
!_cups_strcasecmp(value, "yes") || !_cups_strcasecmp(value, "true");
!_cups_strcasecmp(value, "yes") ||
!_cups_strcasecmp(value, "true");
}
else if (!_cups_strcasecmp(name, "snmp"))
{
/*
* Enable/disable SNMP stuff...
*/
snmp_enabled = !value[0] || !_cups_strcasecmp(value, "on") ||
_cups_strcasecmp(value, "yes") ||
_cups_strcasecmp(value, "true");
}
else if (!_cups_strcasecmp(name, "timeout"))
{
@@ -428,7 +442,10 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
}
snmp_fd = _cupsSNMPOpen(addrlist->addr.addr.sa_family);
if (snmp_enabled)
snmp_fd = _cupsSNMPOpen(addrlist->addr.addr.sa_family);
else
snmp_fd = -1;
/*
* Wait for data from the filter...
@@ -936,7 +953,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
return (CUPS_BACKEND_FAILED);
}
if (orighost)
if (orighost && _cups_strcasecmp(orighost, "localhost"))
strlcpy(localhost, orighost, sizeof(localhost));
else
httpGetHostname(NULL, localhost, sizeof(localhost));
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: network.c 3755 2012-03-30 05:59:14Z msweet $"
*
* Common backend network APIs for CUPS.
*
@@ -322,5 +322,5 @@ backendNetworkSideCB(
/*
* End of "$Id$".
* End of "$Id: network.c 3755 2012-03-30 05:59:14Z msweet $".
*/
+5 -5
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
* "$Id: snmp-supplies.c 4298 2013-05-10 16:52:10Z msweet $"
*
* SNMP supplies functions for CUPS.
*
* Copyright 2008-2012 by Apple Inc.
* Copyright 2008-2013 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
@@ -163,7 +163,7 @@ static const int prtMarkerSuppliesSupplyUnit[] =
sizeof(prtMarkerSuppliesSupplyUnit[0]));
/* Offset to supply index */
static const backend_state_t const printer_states[] =
static const backend_state_t printer_states[] =
{
/* { CUPS_TC_lowPaper, "media-low-report" }, */
{ CUPS_TC_noPaper | CUPS_TC_inputTrayEmpty, "media-empty-warning" },
@@ -180,7 +180,7 @@ static const backend_state_t const printer_states[] =
{ CUPS_TC_outputFull, "output-area-full-warning" }
};
static const backend_state_t const supply_states[] =
static const backend_state_t supply_states[] =
{
{ CUPS_DEVELOPER_LOW, "developer-low-report" },
{ CUPS_DEVELOPER_EMPTY, "developer-empty-warning" },
@@ -1073,5 +1073,5 @@ utf16_to_utf8(
/*
* End of "$Id$".
* End of "$Id: snmp-supplies.c 4298 2013-05-10 16:52:10Z msweet $".
*/
+10 -2
Ver Arquivo
@@ -251,7 +251,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
#ifdef AF_INET6
if ((ipv6 = _cupsSNMPOpen(AF_INET6)) < 0)
return (1);
perror("DEBUG: Unable to create IPv6 socket");
#else
ipv6 = -1;
#endif /* AF_INET6 */
@@ -1025,6 +1025,11 @@ read_snmp_response(int fd) /* I - SNMP socket file descriptor */
* Description is the IEEE-1284 device ID...
*/
char *ptr; /* Pointer into device ID */
for (ptr = (char *)packet.object_value.string.bytes; *ptr; ptr ++)
if (*ptr == '\n')
*ptr = ';'; /* A lot of bad printers put a newline */
if (!device->id)
device->id = strdup((char *)packet.object_value.string.bytes);
@@ -1066,8 +1071,11 @@ read_snmp_response(int fd) /* I - SNMP socket file descriptor */
*/
char make_model[256]; /* Make and model */
char *ptr; /* Pointer into device ID */
for (ptr = (char *)packet.object_value.string.bytes; *ptr; ptr ++)
if (*ptr == '\n')
*ptr = ';'; /* A lot of bad printers put a newline */
if (device->id)
free(device->id);
+17 -3
Ver Arquivo
@@ -87,6 +87,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
http_addrlist_t *addrlist, /* Address list */
*addr; /* Connected address */
char addrname[256]; /* Address name */
int snmp_enabled = 1; /* Is SNMP enabled? */
int snmp_fd, /* SNMP socket */
start_count, /* Page count via SNMP at start */
page_count, /* Page count via SNMP */
@@ -246,6 +247,16 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
waiteof = !value[0] || !_cups_strcasecmp(value, "on") ||
!_cups_strcasecmp(value, "yes") || !_cups_strcasecmp(value, "true");
}
else if (!_cups_strcasecmp(name, "snmp"))
{
/*
* Enable/disable SNMP stuff...
*/
snmp_enabled = !value[0] || !_cups_strcasecmp(value, "on") ||
_cups_strcasecmp(value, "yes") ||
_cups_strcasecmp(value, "true");
}
else if (!_cups_strcasecmp(name, "contimeout"))
{
/*
@@ -286,11 +297,14 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* See if the printer supports SNMP...
*/
if ((snmp_fd = _cupsSNMPOpen(addrlist->addr.addr.sa_family)) >= 0)
{
if (snmp_enabled)
snmp_fd = _cupsSNMPOpen(addrlist->addr.addr.sa_family);
else
snmp_fd = -1;
if (snmp_fd >= 0)
have_supplies = !backendSNMPSupplies(snmp_fd, &(addrlist->addr),
&start_count, NULL);
}
else
have_supplies = start_count = 0;
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: testbackend.c 3755 2012-03-30 05:59:14Z msweet $"
*
* Backend test program for CUPS.
*
@@ -672,5 +672,5 @@ walk_cb(const char *oid, /* I - OID */
/*
* End of "$Id$".
* End of "$Id: testbackend.c 3755 2012-03-30 05:59:14Z msweet $".
*/
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: testsupplies.c 3247 2011-05-12 06:22:31Z msweet $"
*
* SNMP supplies test program for CUPS.
*
@@ -79,5 +79,5 @@ main(int argc, /* I - Number of command-line args */
/*
* End of "$Id$".
* End of "$Id: testsupplies.c 3247 2011-05-12 06:22:31Z msweet $".
*/
+451 -115
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id$"
* "$Id: usb-libusb.c 10979 2013-05-13 17:39:19Z msweet $"
*
* LIBUSB interface code for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 2007-2013 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
@@ -13,7 +13,7 @@
*
* Contents:
*
 * list_devices() - List the available printers.
* list_devices() - List the available printers.
* print_device() - Print a file to a USB device.
* close_device() - Close the connection to the USB printer.
* find_device() - Find or enumerate USB printers.
@@ -22,6 +22,9 @@
* make_device_uri() - Create a device URI for a USB printer.
* open_device() - Open a connection to the USB printer.
* print_cb() - Find a USB printer for printing.
* printer_class_soft_reset()' - Do the soft reset request specific to
* printers
* quirks() - Get the known quirks of a given printer model
* read_thread() - Thread to read the backchannel data on.
* sidechannel_thread() - Handle side-channel requests.
* soft_reset() - Send a soft reset to the device.
@@ -60,13 +63,15 @@ typedef struct usb_printer_s /**** USB Printer Data ****/
{
struct libusb_device *device; /* Device info */
int conf, /* Configuration */
origconf, /* Original configuration */
iface, /* Interface */
altset, /* Alternate setting */
write_endp, /* Write endpoint */
read_endp, /* Read endpoint */
read_endp, /* Read endpoint */
protocol, /* Protocol: 1 = Uni-di, 2 = Bi-di. */
usblp_attached; /* Is the "usblp" kernel module
attached? */
usblp_attached, /* "usblp" kernel module attached? */
reset_after_job; /* Set to 1 by print_device() */
unsigned int quirks; /* Quirks flags */
struct libusb_device_handle *handle; /* Open handle to device */
} usb_printer_t;
@@ -99,6 +104,137 @@ typedef struct usb_globals_s
int sidechannel_thread_done;
} usb_globals_t;
/*
* Quirks: various printer quirks are handled by this table & its flags.
*
* This is copied from the usblp kernel module. So we can easily copy and paste
* new quirks from the module.
*/
struct quirk_printer_struct {
int vendorId;
int productId;
unsigned int quirks;
};
#define USBLP_QUIRK_BIDIR 0x1 /* reports bidir but requires
unidirectional mode (no INs/reads) */
#define USBLP_QUIRK_USB_INIT 0x2 /* needs vendor USB init string */
#define USBLP_QUIRK_BAD_CLASS 0x4 /* descriptor uses vendor-specific
Class or SubClass */
#define USBLP_QUIRK_BLACKLIST 0x8 /* these printers do not conform to the USB print spec */
#define USBLP_QUIRK_RESET 0x4000 /* After printing do a reset
for clean-up */
#define USBLP_QUIRK_NO_REATTACH 0x8000 /* After printing we cannot re-attach
the usblp kernel module */
static const struct quirk_printer_struct quirk_printers[] = {
{ 0x03f0, 0x0004, USBLP_QUIRK_BIDIR }, /* HP DeskJet 895C */
{ 0x03f0, 0x0104, USBLP_QUIRK_BIDIR }, /* HP DeskJet 880C */
{ 0x03f0, 0x0204, USBLP_QUIRK_BIDIR }, /* HP DeskJet 815C */
{ 0x03f0, 0x0304, USBLP_QUIRK_BIDIR }, /* HP DeskJet 810C/812C */
{ 0x03f0, 0x0404, USBLP_QUIRK_BIDIR }, /* HP DeskJet 830C */
{ 0x03f0, 0x0504, USBLP_QUIRK_BIDIR }, /* HP DeskJet 885C */
{ 0x03f0, 0x0604, USBLP_QUIRK_BIDIR }, /* HP DeskJet 840C */
{ 0x03f0, 0x0804, USBLP_QUIRK_BIDIR }, /* HP DeskJet 816C */
{ 0x03f0, 0x1104, USBLP_QUIRK_BIDIR }, /* HP Deskjet 959C */
{ 0x0409, 0xefbe, USBLP_QUIRK_BIDIR }, /* NEC Picty900 (HP OEM) */
{ 0x0409, 0xbef4, USBLP_QUIRK_BIDIR }, /* NEC Picty760 (HP OEM) */
{ 0x0409, 0xf0be, USBLP_QUIRK_BIDIR }, /* NEC Picty920 (HP OEM) */
{ 0x0409, 0xf1be, USBLP_QUIRK_BIDIR }, /* NEC Picty800 (HP OEM) */
{ 0x043d, 0x00f3, USBLP_QUIRK_NO_REATTACH }, /* Lexmark International,
Inc. (e250d), https://bugs.launchpad.net/bugs/1084164 */
{ 0x0482, 0x0010, USBLP_QUIRK_BIDIR }, /* Kyocera Mita FS 820,
by zut <kernel@zut.de> */
{ 0x04a9, 0x1095, USBLP_QUIRK_BIDIR }, /* Canon, Inc. PIXMA iP6000D
Printer, https://bugs.launchpad.net/bugs/1160638 */
{ 0x04a9, 0x10a2, USBLP_QUIRK_BIDIR }, /* Canon, Inc. PIXMA iP4200
Printer, http://www.cups.org/str.php?L4155 */
{ 0x04a9, 0x10b6, USBLP_QUIRK_BIDIR }, /* Canon, Inc. PIXMA iP4300
Printer, https://bugs.launchpad.net/bugs/1032385 */
{ 0x04a9, 0x1721, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP210
https://bugzilla.redhat.com/show_bug.cgi?id=847923#c53 */
{ 0x04a9, 0x170c, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP500
Printer, https://bugs.launchpad.net/bugs/1032456 */
{ 0x04a9, 0x1717, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP510
Printer, https://bugs.launchpad.net/bugs/1050009 */
{ 0x04a9, 0x173d, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP550
Printer, http://www.cups.org/str.php?L4155 */
{ 0x04a9, 0x173e, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP560
Printer, http://www.cups.org/str.php?L4155 */
{ 0x04a9, 0x26a3, USBLP_QUIRK_NO_REATTACH }, /* Canon, Inc. MF4150
Printer, https://bugs.launchpad.net/bugs/1160638 */
{ 0x04f9, 0x001a, USBLP_QUIRK_NO_REATTACH }, /* Brother Industries, Ltd
HL-1430 Laser Printer,
https://bugs.launchpad.net/bugs/1038695 */
{ 0x04f9, 0x000d, USBLP_QUIRK_BIDIR |
USBLP_QUIRK_NO_REATTACH }, /* Brother Industries, Ltd
HL-1440 Laser Printer,
https://bugs.launchpad.net/bugs/1000253 */
{ 0x04f9, 0x000e, USBLP_QUIRK_BIDIR |
USBLP_QUIRK_NO_REATTACH }, /* Brother Industries, Ltd
HL-1450 Laser Printer,
https://bugs.launchpad.net/bugs/1000253 */
{ 0x06bc, 0x000b, USBLP_QUIRK_NO_REATTACH }, /* Oki Data Corp.
Okipage 14ex Printer,
https://bugs.launchpad.net/bugs/872483 */
{ 0x06bc, 0x01c7, USBLP_QUIRK_NO_REATTACH }, /* Oki Data Corp. B410d,
https://bugs.launchpad.net/bugs/872483 */
{ 0x04b8, 0x0001, USBLP_QUIRK_BIDIR |
USBLP_QUIRK_NO_REATTACH }, /* Seiko Epson Corp. Stylus Color 740 / Photo 750,
http://bugs.debian.org/697970 */
{ 0x04b8, 0x0005, USBLP_QUIRK_NO_REATTACH }, /* Seiko Epson Corp. Stylus Color 670,
https://bugs.launchpad.net/bugs/872483 */
{ 0x04b8, 0x0202, USBLP_QUIRK_BAD_CLASS }, /* Seiko Epson Receipt
Printer M129C */
{ 0x067b, 0x2305, USBLP_QUIRK_BIDIR |
USBLP_QUIRK_NO_REATTACH |
USBLP_QUIRK_RESET },
/* Prolific Technology, Inc. PL2305 Parallel Port
(USB -> Parallel adapter), https://bugs.launchpad.net/bugs/987485 */
{ 0x0924, 0x3ce9, USBLP_QUIRK_NO_REATTACH }, /* Xerox Phaser 3124
https://bugzilla.redhat.com/show_bug.cgi?id=867392 */
{ 0x0924, 0x4293, USBLP_QUIRK_NO_REATTACH }, /* Xerox WorkCentre 3210
https://bugs.launchpad.net/bugs/1102470 */
{ 0x1a86, 0x7584, USBLP_QUIRK_NO_REATTACH }, /* QinHeng Electronics
CH340S (USB -> Parallel adapter), https://bugs.launchpad.net/bugs/1000253 */
{ 0x04e8, 0x0000, USBLP_QUIRK_RESET }, /* All Samsung devices,
https://bugs.launchpad.net/bugs/1032456 */
{ 0x0a5f, 0x0000, USBLP_QUIRK_BIDIR }, /* All Zebra devices,
https://bugs.launchpad.net/bugs/1001028 */
/* Canon */
{ 0x04a9, 0x304a, USBLP_QUIRK_BLACKLIST }, /* Canon CP-10 */
{ 0x04a9, 0x3063, USBLP_QUIRK_BLACKLIST }, /* Canon CP-100 */
{ 0x04a9, 0x307c, USBLP_QUIRK_BLACKLIST }, /* Canon CP-200 */
{ 0x04a9, 0x307d, USBLP_QUIRK_BLACKLIST }, /* Canon CP-300 */
{ 0x04a9, 0x30bd, USBLP_QUIRK_BLACKLIST }, /* Canon CP-220 */
{ 0x04a9, 0x30be, USBLP_QUIRK_BLACKLIST }, /* Canon CP-330 */
{ 0x04a9, 0x30f6, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP400 */
{ 0x04a9, 0x310b, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP600 */
{ 0x04a9, 0x3127, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP710 */
{ 0x04a9, 0x3128, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP510 */
{ 0x04a9, 0x3141, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY ES1 */
{ 0x04a9, 0x3142, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP730 */
{ 0x04a9, 0x3143, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP720 */
{ 0x04a9, 0x3170, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP750 */
{ 0x04a9, 0x3171, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP740 */
{ 0x04a9, 0x3185, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY ES2 */
{ 0x04a9, 0x3186, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY ES20 */
{ 0x04a9, 0x31aa, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP770 */
{ 0x04a9, 0x31ab, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP760 */
{ 0x04a9, 0x31b0, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY ES30 */
{ 0x04a9, 0x31dd, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP780 */
{ 0x04a9, 0x31ee, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY ES40 */
{ 0x04a9, 0x3214, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP800 */
{ 0x04a9, 0x3255, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP900 */
{ 0x04a9, 0x3256, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP810 */
{ 0x04a9, 0x30F5, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP500 */
{ 0x04a9, 0x31AF, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY ES3 */
{ 0x04a9, 0x31DD, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP780 */
/* MISSING PIDs: CP520, CP530, CP790 */
{ 0, 0 }
};
/*
* Globals...
@@ -124,6 +260,8 @@ static char *make_device_uri(usb_printer_t *printer,
static int open_device(usb_printer_t *printer, int verbose);
static int print_cb(usb_printer_t *printer, const char *device_uri,
const char *device_id, const void *data);
static int printer_class_soft_reset(usb_printer_t *printer);
static unsigned int quirks(int vendor, int product);
static void *read_thread(void *reference);
static void *sidechannel_thread(void *reference);
static void soft_reset(void);
@@ -163,7 +301,8 @@ print_device(const char *uri, /* I - Device URI */
iostatus; /* Current IO status */
pthread_t read_thread_id, /* Read thread */
sidechannel_thread_id; /* Side-channel thread */
int have_sidechannel = 0; /* Was the side-channel thread started? */
int have_sidechannel = 0, /* Was the side-channel thread started? */
have_backchannel = 0; /* Do we have a back channel? */
struct stat sidechannel_info; /* Side-channel file descriptor info */
unsigned char print_buffer[8192], /* Print data buffer */
*print_ptr; /* Pointer into print data buffer */
@@ -172,6 +311,9 @@ print_device(const char *uri, /* I - Device URI */
struct timeval *timeout, /* Timeout pointer */
tv; /* Time value */
struct timespec cond_timeout; /* pthread condition timeout */
int num_opts; /* Number of options */
cups_option_t *opts; /* Options */
const char *val; /* Option value */
/*
@@ -187,6 +329,7 @@ print_device(const char *uri, /* I - Device URI */
* Connect to the printer...
*/
fprintf(stderr, "DEBUG: Printing on printer with URI: %s\n", uri);
while ((g.printer = find_device(print_cb, uri)) == NULL)
{
_cupsLangPrintFilter(stderr, "INFO",
@@ -196,6 +339,12 @@ print_device(const char *uri, /* I - Device URI */
g.print_fd = print_fd;
/*
* Some devices need a reset after finishing a job, these devices are
* marked with the USBLP_QUIRK_RESET quirk.
*/
g.printer->reset_after_job = (g.printer->quirks & USBLP_QUIRK_RESET ? 1 : 0);
/*
* 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
@@ -239,25 +388,62 @@ print_device(const char *uri, /* I - Device URI */
}
}
/*
* Debug mode: If option "usb-unidir" is given, always deactivate
* backchannel
*/
num_opts = cupsParseOptions(argv[5], 0, &opts);
val = cupsGetOption("usb-unidir", num_opts, opts);
if (val && strcasecmp(val, "no") && strcasecmp(val, "off") &&
strcasecmp(val, "false"))
{
g.printer->read_endp = -1;
fprintf(stderr, "DEBUG: Forced uni-directional communication "
"via \"usb-unidir\" option.\n");
}
/*
* Debug mode: If option "usb-no-reattach" is given, do not re-attach
* the usblp kernel module after the job has completed.
*/
val = cupsGetOption("usb-no-reattach", num_opts, opts);
if (val && strcasecmp(val, "no") && strcasecmp(val, "off") &&
strcasecmp(val, "false"))
{
g.printer->usblp_attached = 0;
fprintf(stderr, "DEBUG: Forced not re-attaching the usblp kernel module "
"after the job via \"usb-no-reattach\" option.\n");
}
/*
* Get the read thread going...
*/
g.read_thread_stop = 0;
g.read_thread_done = 0;
pthread_cond_init(&g.read_thread_cond, NULL);
pthread_mutex_init(&g.read_thread_mutex, NULL);
if (pthread_create(&read_thread_id, NULL, read_thread, NULL))
if (g.printer->read_endp != -1)
{
fprintf(stderr, "DEBUG: Fatal USB error.\n");
_cupsLangPrintFilter(stderr, "ERROR",
_("There was an unrecoverable USB error."));
fputs("DEBUG: Couldn't create read thread.\n", stderr);
close_device(g.printer);
return (CUPS_BACKEND_STOP);
have_backchannel = 1;
g.read_thread_stop = 0;
g.read_thread_done = 0;
pthread_cond_init(&g.read_thread_cond, NULL);
pthread_mutex_init(&g.read_thread_mutex, NULL);
if (pthread_create(&read_thread_id, NULL, read_thread, NULL))
{
fprintf(stderr, "DEBUG: Fatal USB error.\n");
_cupsLangPrintFilter(stderr, "ERROR",
_("There was an unrecoverable USB error."));
fputs("DEBUG: Couldn't create read thread.\n", stderr);
close_device(g.printer);
return (CUPS_BACKEND_STOP);
}
}
else
fprintf(stderr, "DEBUG: Uni-directional device/mode, back channel "
"deactivated.\n");
/*
* The main thread sends the print file...
@@ -515,38 +701,18 @@ print_device(const char *uri, /* I - Device URI */
* Signal the read thread to exit then wait 7 seconds for it to complete...
*/
g.read_thread_stop = 1;
pthread_mutex_lock(&g.read_thread_mutex);
if (!g.read_thread_done)
if (have_backchannel)
{
fputs("DEBUG: Waiting for read thread to exit...\n", stderr);
g.read_thread_stop = 1;
gettimeofday(&tv, NULL);
cond_timeout.tv_sec = tv.tv_sec + WAIT_EOF_DELAY;
cond_timeout.tv_nsec = tv.tv_usec * 1000;
while (!g.read_thread_done)
{
if (pthread_cond_timedwait(&g.read_thread_cond, &g.read_thread_mutex,
&cond_timeout) != 0)
break;
}
/*
* If it didn't exit abort the pending read and wait an additional second...
*/
pthread_mutex_lock(&g.read_thread_mutex);
if (!g.read_thread_done)
{
fputs("DEBUG: Read thread still active, aborting the pending read...\n",
stderr);
g.wait_eof = 0;
fputs("DEBUG: Waiting for read thread to exit...\n", stderr);
gettimeofday(&tv, NULL);
cond_timeout.tv_sec = tv.tv_sec + 1;
cond_timeout.tv_sec = tv.tv_sec + WAIT_EOF_DELAY;
cond_timeout.tv_nsec = tv.tv_usec * 1000;
while (!g.read_thread_done)
@@ -555,14 +721,35 @@ print_device(const char *uri, /* I - Device URI */
&cond_timeout) != 0)
break;
}
/*
* If it didn't exit abort the pending read and wait an additional
* second...
*/
if (!g.read_thread_done)
{
fputs("DEBUG: Read thread still active, aborting the pending read...\n",
stderr);
g.wait_eof = 0;
gettimeofday(&tv, NULL);
cond_timeout.tv_sec = tv.tv_sec + 1;
cond_timeout.tv_nsec = tv.tv_usec * 1000;
while (!g.read_thread_done)
{
if (pthread_cond_timedwait(&g.read_thread_cond, &g.read_thread_mutex,
&cond_timeout) != 0)
break;
}
}
}
pthread_mutex_unlock(&g.read_thread_mutex);
}
pthread_mutex_unlock(&g.read_thread_mutex);
if (print_fd)
close(print_fd);
/*
* Close the connection and input file and general clean up...
*/
@@ -600,31 +787,86 @@ close_device(usb_printer_t *printer) /* I - Printer */
* to the device...
*/
int number; /* Interface number */
int errcode; /* Return value of libusb function */
int number1, /* Interface number */
number2; /* Configuration number */
libusb_get_device_descriptor(printer->device, &devdesc);
libusb_get_config_descriptor(printer->device, printer->conf, &confptr);
number = confptr->interface[printer->iface].
altsetting[printer->altset].bInterfaceNumber;
libusb_release_interface(printer->handle, number);
if (number != 0)
libusb_release_interface(printer->handle, 0);
errcode =
libusb_get_config_descriptor(printer->device, printer->conf, &confptr);
if (errcode >= 0)
{
number1 = confptr->interface[printer->iface].
altsetting[printer->altset].bInterfaceNumber;
libusb_release_interface(printer->handle, number1);
number2 = confptr->bConfigurationValue;
libusb_free_config_descriptor(confptr);
/*
* If we have changed the configuration from one valid configuration
* to another, restore the old one
*/
if (printer->origconf > 0 && printer->origconf != number2)
{
fprintf(stderr, "DEBUG: Restoring USB device configuration: %d -> %d\n",
number2, printer->origconf);
if ((errcode = libusb_set_configuration(printer->handle,
printer->origconf)) < 0)
{
if (errcode != LIBUSB_ERROR_BUSY)
{
errcode =
libusb_get_device_descriptor (printer->device, &devdesc);
if (errcode < 0)
fprintf(stderr,
"DEBUG: Failed to set configuration %d\n",
printer->origconf);
else
fprintf(stderr,
"DEBUG: Failed to set configuration %d for %04x:%04x\n",
printer->origconf, devdesc.idVendor, devdesc.idProduct);
}
}
}
/*
* Re-attach "usblp" kernel module if it was attached before using this
* device
*/
if (printer->usblp_attached == 1)
if (libusb_attach_kernel_driver(printer->handle, number1) < 0)
{
errcode = libusb_get_device_descriptor (printer->device, &devdesc);
if (errcode < 0)
fprintf(stderr,
"DEBUG: Failed to re-attach \"usblp\" kernel module\n");
else
fprintf(stderr,
"DEBUG: Failed to re-attach \"usblp\" kernel module to "
"%04x:%04x\n", devdesc.idVendor, devdesc.idProduct);
}
}
else
fprintf(stderr,
"DEBUG: Failed to get configuration descriptor %d\n",
printer->conf);
/*
* Re-attach "usblp" kernel module if it was attached before using this
* device
* Reset the device to clean up after the job
*/
if (printer->usblp_attached == 1)
if (printer->reset_after_job == 1)
{
if (libusb_attach_kernel_driver(printer->handle, printer->iface) < 0)
if ((errcode = libusb_reset_device(printer->handle)) < 0)
fprintf(stderr,
"DEBUG: Failed to re-attach \"usblp\" kernel module to "
"%04x:%04x\n", devdesc.idVendor, devdesc.idProduct);
"DEBUG: Device reset failed, error code: %d\n",
errcode);
else
fprintf(stderr,
"DEBUG: Resetting printer.\n");
}
libusb_free_config_descriptor(confptr);
/*
* Close the interface and return...
*/
@@ -657,7 +899,8 @@ find_device(usb_cb_t cb, /* I - Callback function */
/* Pointer to current alternate setting */
const struct libusb_endpoint_descriptor *endpptr = NULL;
/* Pointer to current endpoint */
ssize_t numdevs, /* number of connected devices */
ssize_t err = 0, /* Error code */
numdevs, /* number of connected devices */
i = 0;
uint8_t conf, /* Current configuration */
iface, /* Current interface */
@@ -676,7 +919,14 @@ find_device(usb_cb_t cb, /* I - Callback function */
* Initialize libusb...
*/
libusb_init(NULL);
err = libusb_init(NULL);
if (err)
{
fprintf(stderr, "DEBUG: Unable to initialize USB access via libusb, "
"libusb error %i\n", err);
return (NULL);
}
numdevs = libusb_get_device_list(NULL, &list);
fprintf(stderr, "DEBUG: libusb_get_device_list=%d\n", (int)numdevs);
@@ -694,12 +944,22 @@ find_device(usb_cb_t cb, /* I - Callback function */
* a printer...
*/
libusb_get_device_descriptor(device, &devdesc);
if (libusb_get_device_descriptor(device, &devdesc) < 0)
continue;
if (!devdesc.bNumConfigurations || !devdesc.idVendor ||
!devdesc.idProduct)
continue;
printer.quirks = quirks(devdesc.idVendor, devdesc.idProduct);
/*
* Ignore blacklisted printers...
*/
if (printer.quirks & USBLP_QUIRK_BLACKLIST)
continue;
for (conf = 0; conf < devdesc.bNumConfigurations; conf ++)
{
if (libusb_get_config_descriptor(device, conf, &confptr) < 0)
@@ -724,13 +984,18 @@ find_device(usb_cb_t cb, /* I - Callback function */
* 1284.4 (packet mode) protocol as well.
*/
if (altptr->bInterfaceClass != LIBUSB_CLASS_PRINTER ||
altptr->bInterfaceSubClass != 1 ||
if (((altptr->bInterfaceClass != LIBUSB_CLASS_PRINTER ||
altptr->bInterfaceSubClass != 1) &&
((printer.quirks & USBLP_QUIRK_BAD_CLASS) == 0)) ||
(altptr->bInterfaceProtocol != 1 && /* Unidirectional */
altptr->bInterfaceProtocol != 2) || /* Bidirectional */
altptr->bInterfaceProtocol < protocol)
continue;
if (printer.quirks & USBLP_QUIRK_BAD_CLASS)
fprintf(stderr, "DEBUG: Printer does not report class 7 and/or "
"subclass 1 but works as a printer anyway\n");
read_endp = -1;
write_endp = -1;
@@ -755,7 +1020,10 @@ find_device(usb_cb_t cb, /* I - Callback function */
protocol = altptr->bInterfaceProtocol;
printer.altset = altset;
printer.write_endp = write_endp;
printer.read_endp = read_endp;
if (protocol > 1)
printer.read_endp = read_endp;
else
printer.read_endp = -1;
}
}
@@ -773,16 +1041,41 @@ find_device(usb_cb_t cb, /* I - Callback function */
make_device_uri(&printer, device_id, device_uri,
sizeof(device_uri));
fprintf(stderr, "DEBUG2: Printer found with device ID: %s "
"Device URI: %s\n",
device_id, device_uri);
if ((*cb)(&printer, device_uri, device_id, data))
{
printer.read_endp = confptr->interface[printer.iface].
altsetting[printer.altset].
endpoint[printer.read_endp].
bEndpointAddress;
fprintf(stderr, "DEBUG: Device protocol: %d\n",
printer.protocol);
if (printer.quirks & USBLP_QUIRK_BIDIR)
{
printer.read_endp = -1;
fprintf(stderr, "DEBUG: Printer reports bi-di support "
"but in reality works only uni-directionally\n");
}
if (printer.read_endp != -1)
{
printer.read_endp = confptr->interface[printer.iface].
altsetting[printer.altset].
endpoint[printer.read_endp].
bEndpointAddress;
}
else
fprintf(stderr, "DEBUG: Uni-directional USB communication "
"only!\n");
printer.write_endp = confptr->interface[printer.iface].
altsetting[printer.altset].
endpoint[printer.write_endp].
bEndpointAddress;
if (printer.quirks & USBLP_QUIRK_NO_REATTACH)
{
printer.usblp_attached = 0;
fprintf(stderr, "DEBUG: Printer does not like usblp "
"kernel module to be re-attached after job\n");
}
libusb_free_config_descriptor(confptr);
return (&printer);
}
@@ -803,7 +1096,8 @@ find_device(usb_cb_t cb, /* I - Callback function */
* Clean up ....
*/
libusb_free_device_list(list, 1);
if (numdevs >= 0)
libusb_free_device_list(list, 1);
libusb_exit(NULL);
return (NULL);
@@ -1086,15 +1380,20 @@ open_device(usb_printer_t *printer, /* I - Printer */
* Try opening the printer...
*/
if (libusb_open(printer->device, &printer->handle) < 0)
if ((errcode = libusb_open(printer->device, &printer->handle)) < 0)
{
fprintf(stderr, "DEBUG: Failed to open device, code: %d\n",
errcode);
return (-1);
}
printer->usblp_attached = 0;
printer->reset_after_job = 0;
if (verbose)
fputs("STATE: +connecting-to-device\n", stderr);
if ((errcode = libusb_get_device_descriptor (printer->device, &devdesc)) < 0)
if ((errcode = libusb_get_device_descriptor(printer->device, &devdesc)) < 0)
{
fprintf(stderr, "DEBUG: Failed to get device descriptor, code: %d\n",
errcode);
@@ -1142,12 +1441,22 @@ open_device(usb_printer_t *printer, /* I - Printer */
0, 0, (unsigned char *)&current, 1, 5000) < 0)
current = 0; /* Assume not configured */
libusb_get_device_descriptor(printer->device, &devdesc);
libusb_get_config_descriptor(printer->device, printer->conf, &confptr);
printer->origconf = current;
if ((errcode =
libusb_get_config_descriptor (printer->device, printer->conf, &confptr))
< 0)
{
fprintf(stderr, "DEBUG: Failed to get config descriptor for %04x:%04x\n",
devdesc.idVendor, devdesc.idProduct);
goto error;
}
number1 = confptr->bConfigurationValue;
if (number1 != current)
{
fprintf(stderr, "DEBUG: Switching USB device configuration: %d -> %d\n",
current, number1);
if ((errcode = libusb_set_configuration(printer->handle, number1)) < 0)
{
/*
@@ -1162,38 +1471,6 @@ open_device(usb_printer_t *printer, /* I - Printer */
}
}
/*
* Get the "usblp" kernel module out of the way. This backend only
* works without the module attached.
*/
errcode = libusb_kernel_driver_active(printer->handle, printer->iface);
if (errcode == 0)
printer->usblp_attached = 0;
else if (errcode == 1)
{
printer->usblp_attached = 1;
if ((errcode =
libusb_detach_kernel_driver(printer->handle, printer->iface)) < 0)
{
fprintf(stderr, "DEBUG: Failed to detach \"usblp\" module from %04x:%04x\n",
devdesc.idVendor, devdesc.idProduct);
goto error;
}
}
else
{
printer->usblp_attached = 0;
if (errcode != LIBUSB_ERROR_NOT_SUPPORTED)
{
fprintf(stderr,
"DEBUG: Failed to check whether %04x:%04x has the \"usblp\" "
"kernel module attached\n", devdesc.idVendor, devdesc.idProduct);
goto error;
}
}
/*
* Claim interfaces as needed...
*/
@@ -1358,6 +1635,65 @@ print_cb(usb_printer_t *printer, /* I - Printer */
}
/*
* 'printer_class_soft_reset()' - Do the soft reset request specific to printers
*
* This soft reset is specific to the printer device class and is much less
* invasive than the general USB reset libusb_reset_device(). Especially it
* does never happen that the USB addressing and configuration changes. What
* is actually done is that all buffers get flushed and the bulk IN and OUT
* pipes get reset to their default states. This clears all stall conditions.
* See http://cholla.mmto.org/computers/linux/usb/usbprint11.pdf
*/
static int /* O - 0 on success, < 0 on error */
printer_class_soft_reset(usb_printer_t *printer) /* I - Printer */
{
struct libusb_config_descriptor *confptr = NULL;
/* Pointer to current configuration */
int interface,
errcode;
if (libusb_get_config_descriptor(printer->device, printer->conf, &confptr)
< 0)
interface = printer->iface;
else
interface = confptr->interface[printer->iface].
altsetting[printer->altset].bInterfaceNumber;
libusb_free_config_descriptor(confptr);
if ((errcode = libusb_control_transfer(printer->handle,
LIBUSB_REQUEST_TYPE_CLASS |
LIBUSB_ENDPOINT_OUT |
LIBUSB_RECIPIENT_OTHER,
2, 0, interface, NULL, 0, 5000)) < 0)
errcode = libusb_control_transfer(printer->handle,
LIBUSB_REQUEST_TYPE_CLASS |
LIBUSB_ENDPOINT_OUT |
LIBUSB_RECIPIENT_INTERFACE,
2, 0, interface, NULL, 0, 5000);
return errcode;
}
/*
* 'quirks()' - Get the known quirks of a given printer model
*/
static unsigned int quirks(int vendor, int product)
{
int i;
for (i = 0; quirk_printers[i].vendorId; i++)
{
if (vendor == quirk_printers[i].vendorId &&
(quirk_printers[i].productId == 0x0000 ||
product == quirk_printers[i].productId))
return quirk_printers[i].quirks;
}
return 0;
}
/*
* 'read_thread()' - Thread to read the backchannel data on.
*/
@@ -1632,7 +1968,7 @@ static void soft_reset(void)
* Send the reset...
*/
libusb_reset_device (g.printer->handle);
printer_class_soft_reset(g.printer);
/*
* Release the I/O lock...
@@ -1646,6 +1982,6 @@ static void soft_reset(void)
/*
* End of "$Id$".
* End of "$Id: usb-libusb.c 10979 2013-05-13 17:39:19Z msweet $".
*/
+30 -25
Ver Arquivo
@@ -3,7 +3,7 @@
*
* "lpq" command for CUPS.
*
* Copyright 2007-2011 by Apple Inc.
* Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -60,8 +60,7 @@ main(int argc, /* I - Number of command-line arguments */
all, /* All printers */
interval, /* Reporting interval */
longstatus; /* Show file details */
int num_dests; /* Number of destinations */
cups_dest_t *dests; /* Destinations */
cups_dest_t *named_dest; /* Named destination */
_cupsSetLocale(argv);
@@ -77,8 +76,6 @@ main(int argc, /* I - Number of command-line arguments */
interval = 0;
longstatus = 0;
all = 0;
num_dests = 0;
dests = NULL;
for (i = 1; i < argc; i ++)
if (argv[i][0] == '+')
@@ -127,7 +124,6 @@ main(int argc, /* I - Number of command-line arguments */
if (i >= argc)
{
httpClose(http);
cupsFreeDests(num_dests, dests);
usage();
}
@@ -140,12 +136,14 @@ main(int argc, /* I - Number of command-line arguments */
http = connect_server(argv[0], http);
if (num_dests == 0)
num_dests = cupsGetDests2(http, &dests);
if (cupsGetDest(dest, instance, num_dests, dests) == NULL)
if ((named_dest = cupsGetNamedDest(http, dest, instance)) == NULL)
{
if (instance)
if (cupsLastError() == IPP_BAD_REQUEST ||
cupsLastError() == IPP_VERSION_NOT_SUPPORTED)
_cupsLangPrintf(stderr,
_("%s: Error - add '/version=1.1' to server "
"name."), argv[0]);
else if (instance)
_cupsLangPrintf(stderr,
_("%s: Error - unknown destination \"%s/%s\"."),
argv[0], dest, instance);
@@ -155,6 +153,8 @@ main(int argc, /* I - Number of command-line arguments */
return (1);
}
cupsFreeDests(1, named_dest);
break;
case 'a' : /* All printers */
@@ -192,7 +192,6 @@ main(int argc, /* I - Number of command-line arguments */
default :
httpClose(http);
cupsFreeDests(num_dests, dests);
usage();
break;
@@ -207,15 +206,17 @@ main(int argc, /* I - Number of command-line arguments */
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;
if (dest == NULL)
if ((named_dest = cupsGetNamedDest(http, NULL, NULL)) == NULL)
{
if (cupsLastError() == IPP_BAD_REQUEST ||
cupsLastError() == IPP_VERSION_NOT_SUPPORTED)
{
_cupsLangPrintf(stderr,
_("%s: Error - add '/version=1.1' to server name."),
argv[0]);
return (1);
}
val = NULL;
if ((dest = getenv("LPDEST")) == NULL)
@@ -231,7 +232,7 @@ main(int argc, /* I - Number of command-line arguments */
else
val = "LPDEST";
if (dest && !cupsGetDest(dest, NULL, num_dests, dests))
if (dest && val)
_cupsLangPrintf(stderr,
_("%s: Error - %s environment variable names "
"non-existent destination \"%s\"."), argv[0], val,
@@ -241,9 +242,10 @@ main(int argc, /* I - Number of command-line arguments */
_("%s: Error - no default destination available."),
argv[0]);
httpClose(http);
cupsFreeDests(num_dests, dests);
return (1);
}
dest = named_dest->name;
}
/*
@@ -270,7 +272,6 @@ main(int argc, /* I - Number of command-line arguments */
* Close the connection to the server and return...
*/
cupsFreeDests(num_dests, dests);
httpClose(http);
return (0);
@@ -371,6 +372,7 @@ show_jobs(const char *command, /* I - Command name */
* attributes-natural-language
* job-uri or printer-uri
* requested-attributes
* requesting-user-name
*/
request = ippNewRequest(id ? IPP_GET_JOB_ATTRIBUTES : IPP_GET_JOBS);
@@ -399,6 +401,9 @@ show_jobs(const char *command, /* I - Command name */
"requesting-user-name", NULL, user);
ippAddBoolean(request, IPP_TAG_OPERATION, "my-jobs", 1);
}
else
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, cupsUser());
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"requested-attributes",
@@ -447,8 +452,8 @@ show_jobs(const char *command, /* I - Command name */
jobpriority = 50;
#endif /* __osf__ */
jobstate = IPP_JOB_PENDING;
jobname = "untitled";
jobuser = NULL;
jobname = "unknown";
jobuser = "unknown";
jobdest = NULL;
jobcopies = 1;
+19 -1
Ver Arquivo
@@ -3,7 +3,7 @@
*
* "lpr" command for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -61,6 +61,7 @@ main(int argc, /* I - Number of command-line arguments */
for (i = 1; i < argc; i ++)
if (argv[i][0] == '-')
{
switch (ch = argv[i][1])
{
case 'E' : /* Encrypt */
@@ -226,6 +227,14 @@ main(int argc, /* I - Number of command-line arguments */
dest->options[j].value,
num_options, &options);
}
else if (cupsLastError() == IPP_BAD_REQUEST ||
cupsLastError() == IPP_VERSION_NOT_SUPPORTED)
{
_cupsLangPrintf(stderr,
_("%s: Error - add '/version=1.1' to server "
"name."), argv[0]);
return (1);
}
break;
case '#' : /* Number of copies */
@@ -275,6 +284,7 @@ main(int argc, /* I - Number of command-line arguments */
argv[i][1]);
return (1);
}
}
else if (num_files < 1000)
{
/*
@@ -320,6 +330,14 @@ main(int argc, /* I - Number of command-line arguments */
dest->options[j].value,
num_options, &options);
}
else if (cupsLastError() == IPP_BAD_REQUEST ||
cupsLastError() == IPP_VERSION_NOT_SUPPORTED)
{
_cupsLangPrintf(stderr,
_("%s: Error - add '/version=1.1' to server "
"name."), argv[0]);
return (1);
}
}
if (printer == NULL)
+1 -1
Ver Arquivo
@@ -380,7 +380,7 @@ show_all_classes(http_t *http, /* I - Connection to server */
sprintf(val, "%d", count);
cgiSetVariable("TOTAL", val);
if ((var = cgiGetVariable("ORDER")) != NULL)
if ((var = cgiGetVariable("ORDER")) != NULL && *var)
ascending = !_cups_strcasecmp(var, "asc");
else
ascending = 1;
+6 -5
Ver Arquivo
@@ -554,8 +554,8 @@ cgiPrintCommand(http_t *http, /* I - Connection to server */
ipp_t *request, /* Get-Job-Attributes request */
*response; /* Get-Job-Attributes response */
ipp_attribute_t *attr; /* Current job attribute */
static const char const *job_attrs[] =/* Job attributes we want */
{
static const char * const job_attrs[] =
{ /* Job attributes we want */
"job-state",
"job-printer-state-message"
};
@@ -1432,7 +1432,7 @@ cgiShowJobs(http_t *http, /* I - Connection to server */
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL,
"ipp://localhost/");
if ((which_jobs = cgiGetVariable("which_jobs")) != NULL)
if ((which_jobs = cgiGetVariable("which_jobs")) != NULL && *which_jobs)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "which-jobs",
NULL, which_jobs);
@@ -1480,10 +1480,11 @@ cgiShowJobs(http_t *http, /* I - Connection to server */
if (first < 0)
first = 0;
if ((var = cgiGetVariable("ORDER")) != NULL)
if ((var = cgiGetVariable("ORDER")) != NULL && *var)
ascending = !_cups_strcasecmp(var, "asc");
else
ascending = !which_jobs || !_cups_strcasecmp(which_jobs, "not-completed");
ascending = !which_jobs || !*which_jobs ||
!_cups_strcasecmp(which_jobs, "not-completed");
section = cgiGetVariable("SECTION");
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: makedocset.c 3833 2012-05-23 22:51:18Z msweet $"
*
* Xcode documentation set generator.
*
@@ -482,5 +482,5 @@ write_nodes(const char *path, /* I - File to write */
/*
* End of "$Id$".
* End of "$Id: makedocset.c 3833 2012-05-23 22:51:18Z msweet $".
*/
+1 -1
Ver Arquivo
@@ -397,7 +397,7 @@ show_all_printers(http_t *http, /* I - Connection to server */
sprintf(val, "%d", count);
cgiSetVariable("TOTAL", val);
if ((var = cgiGetVariable("ORDER")) != NULL)
if ((var = cgiGetVariable("ORDER")) != NULL && *var)
ascending = !_cups_strcasecmp(var, "asc");
else
ascending = 1;
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: websearch.c 1531 2009-05-22 21:50:50Z msweet $"
*
* Web search program for www.cups.org.
*
@@ -112,5 +112,5 @@ list_nodes(help_index_t *hi, /* I - Help index */
/*
* End of "$Id$".
* End of "$Id: websearch.c 1531 2009-05-22 21:50:50Z msweet $".
*/
+1 -1
Ver Arquivo
@@ -19,7 +19,7 @@ include ../Makedefs
# Config files...
#
KEEP = cupsd.conf snmp.conf
KEEP = cups-files.conf cupsd.conf snmp.conf
REPLACE = mime.convs mime.types
+98
Ver Arquivo
@@ -0,0 +1,98 @@
#
# "$Id: cups-files.conf.in 4185 2013-02-20 02:19:13Z msweet $"
#
# Sample file/directory/user/group configuration file for the CUPS scheduler.
# See "man cups-files.conf" for a complete description of this file.
#
# List of events that are considered fatal errors for the scheduler...
#FatalErrors @CUPS_FATAL_ERRORS@
# Default user and group for filters/backends/helper programs; this cannot be
# any user or group that resolves to ID 0 for security reasons...
#User @CUPS_USER@
#Group @CUPS_GROUP@
# Administrator user group, used to match @SYSTEM in cupsd.conf policy rules...
SystemGroup @CUPS_SYSTEM_GROUPS@
@CUPS_SYSTEM_AUTHKEY@
# User that is substituted for unauthenticated (remote) root accesses...
#RemoteRoot remroot
# Do we allow file: device URIs other than to /dev/null?
#FileDevice No
# Permissions for configuration and log files...
#ConfigFilePerm 0@CUPS_CONFIG_FILE_PERM@
#LogFilePerm 0@CUPS_LOG_FILE_PERM@
# Location of the file logging all access to the scheduler; may be the name
# "syslog". If not an absolute path, the value of ServerRoot is used as the
# root directory. Also see the "AccessLogLevel" directive in cupsd.conf.
AccessLog @CUPS_LOGDIR@/access_log
# Location of cache files used by the scheduler...
#CacheDir @CUPS_CACHEDIR@
# Location of data files used by the scheduler...
#DataDir @CUPS_DATADIR@
# Location of the static web content served by the scheduler...
#DocumentRoot @CUPS_DOCROOT@
# Location of the file logging all messages produced by the scheduler and any
# helper programs; may be the name "syslog". If not an absolute path, the value
# of ServerRoot is used as the root directory. Also see the "LogLevel"
# directive in cupsd.conf.
ErrorLog @CUPS_LOGDIR@/error_log
# Location of fonts used by older print filters...
#FontPath @CUPS_FONTPATH@
# Location of LPD configuration
#LPDConfigFile @CUPS_DEFAULT_LPD_CONFIG_FILE@
# Location of the file logging all pages printed by the scheduler and any
# helper programs; may be the name "syslog". If not an absolute path, the value
# of ServerRoot is used as the root directory. Also see the "PageLogFormat"
# directive in cupsd.conf.
PageLog @CUPS_LOGDIR@/page_log
# Location of the file listing all of the local printers...
#Printcap @CUPS_DEFAULT_PRINTCAP@
# Format of the Printcap file...
#PrintcapFormat bsd
#PrintcapFormat plist
#PrintcapFormat solaris
# Location of all spool files...
#RequestRoot @CUPS_REQUESTS@
# Location of helper programs...
#ServerBin @CUPS_SERVERBIN@
# SSL/TLS certificate for the scheduler...
#ServerCertificate @CUPS_SERVERCERT@
# SSL/TLS private key for the scheduler...
#ServerKey @CUPS_SERVERKEY@
# Location of other configuration files...
#ServerRoot @CUPS_SERVERROOT@
# Location of Samba configuration file...
#SMBConfigFile @CUPS_DEFAULT_SMB_CONFIG_FILE@
# Location of scheduler state files...
#StateDir @CUPS_STATEDIR@
# Location of scheduler/helper temporary files. This directory is emptied on
# scheduler startup and cannot be one of the standard (public) temporary
# directory locations for security reasons...
#TempDir @CUPS_REQUESTS@/tmp
#
# End of "$Id: cups-files.conf.in 4185 2013-02-20 02:19:13Z msweet $".
#
-6
Ver Arquivo
@@ -9,18 +9,12 @@
# for troubleshooting...
LogLevel @CUPS_LOG_LEVEL@
# Administrator user group...
SystemGroup @CUPS_SYSTEM_GROUPS@
@CUPS_SYSTEM_AUTHKEY@
# Only listen for connections from the local machine.
Listen localhost:@DEFAULT_IPP_PORT@
@CUPS_LISTEN_DOMAINSOCKET@
# Show shared printers on the local network.
Browsing On
BrowseOrder allow,deny
BrowseAllow all
BrowseLocalProtocols @CUPS_BROWSE_LOCAL_PROTOCOLS@
# Default authentication type, when authentication is required...
+15 -9
Ver Arquivo
@@ -3,7 +3,7 @@ dnl "$Id: cups-common.m4 8781 2009-08-28 17:34:54Z mike $"
dnl
dnl Common configuration stuff for CUPS.
dnl
dnl Copyright 2007-2012 by Apple Inc.
dnl Copyright 2007-2013 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
@@ -20,11 +20,11 @@ dnl Set the name of the config header file...
AC_CONFIG_HEADER(config.h)
dnl Version number information...
CUPS_VERSION="1.6svn"
CUPS_VERSION="1.6.3"
CUPS_REVISION=""
if test -z "$CUPS_REVISION" -a -d .svn; then
CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
fi
#if test -z "$CUPS_REVISION" -a -d .svn; then
# CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
#fi
CUPS_BUILD="cups-$CUPS_VERSION"
AC_ARG_WITH(cups_build, [ --with-cups-build set "cups-config --build" string ],
@@ -44,9 +44,9 @@ LDFLAGS="${LDFLAGS:=}"
dnl Checks for programs...
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CC(clang cc gcc)
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_CXX(clang++ c++ g++)
AC_PROG_RANLIB
AC_PATH_PROG(AR,ar)
AC_PATH_PROG(CHMOD,chmod)
@@ -130,6 +130,7 @@ AC_CHECK_HEADER(crypt.h,AC_DEFINE(HAVE_CRYPT_H))
AC_CHECK_HEADER(langinfo.h,AC_DEFINE(HAVE_LANGINFO_H))
AC_CHECK_HEADER(malloc.h,AC_DEFINE(HAVE_MALLOC_H))
AC_CHECK_HEADER(shadow.h,AC_DEFINE(HAVE_SHADOW_H))
AC_CHECK_HEADER(stdint.h,AC_DEFINE(HAVE_STDINT_H))
AC_CHECK_HEADER(string.h,AC_DEFINE(HAVE_STRING_H))
AC_CHECK_HEADER(strings.h,AC_DEFINE(HAVE_STRINGS_H))
AC_CHECK_HEADER(bstring.h,AC_DEFINE(HAVE_BSTRING_H))
@@ -336,6 +337,7 @@ AC_SUBST(DBUS_NOTIFIERLIBS)
dnl Extra platform-specific libraries...
CUPS_DEFAULT_PRINTOPERATOR_AUTH="@SYSTEM"
CUPS_DEFAULT_SYSTEM_AUTHKEY=""
CUPS_SYSTEM_AUTHKEY=""
INSTALLXPC=""
@@ -383,10 +385,13 @@ case $uname in
if test "x$default_adminkey" != xdefault; then
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey $default_adminkey"
CUPS_DEFAULT_SYSTEM_AUTHKEY="$default_adminkey"
elif grep -q system.print.operator /etc/authorization; then
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.print.admin"
CUPS_DEFAULT_SYSTEM_AUTHKEY="system.print.admin"
else
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.preferences"
CUPS_DEFAULT_SYSTEM_AUTHKEY="system.preferences"
fi
if test "x$default_operkey" != xdefault; then
@@ -402,8 +407,8 @@ case $uname in
if test $uversion -ge 100; then
AC_CHECK_HEADER(sandbox.h,AC_DEFINE(HAVE_SANDBOX_H))
fi
if test $uversion -ge 110; then
# Broken public headers in 10.7...
if test $uversion -ge 110 -a $uversion -lt 120; then
# Broken public headers in 10.7.x...
AC_MSG_CHECKING(for sandbox/private.h presence)
if test -f /usr/local/include/sandbox/private.h; then
AC_MSG_RESULT(yes)
@@ -424,6 +429,7 @@ esac
AC_SUBST(CUPS_DEFAULT_PRINTOPERATOR_AUTH)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTOPERATOR_AUTH, "$CUPS_DEFAULT_PRINTOPERATOR_AUTH")
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SYSTEM_AUTHKEY, "$CUPS_DEFAULT_SYSTEM_AUTHKEY")
AC_SUBST(CUPS_SYSTEM_AUTHKEY)
AC_SUBST(INSTALLXPC)
+2
Ver Arquivo
@@ -305,6 +305,7 @@ else
fi
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG_FILE, "$CUPS_DEFAULT_LPD_CONFIG_FILE")
AC_SUBST(CUPS_DEFAULT_LPD_CONFIG_FILE)
dnl Default SMB config file...
AC_ARG_WITH(smbconfigfile, [ --with-smbconfigfile set default SMBConfigFile URI],
@@ -326,6 +327,7 @@ else
fi
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG_FILE, "$CUPS_DEFAULT_SMB_CONFIG_FILE")
AC_SUBST(CUPS_DEFAULT_SMB_CONFIG_FILE)
dnl Default MaxCopies value...
AC_ARG_WITH(max-copies, [ --with-max-copies set default max copies value, default=9999 ],
+1 -1
Ver Arquivo
@@ -106,7 +106,7 @@ if test "$libdir" = "\${exec_prefix}/lib"; then
libdir="$exec_prefix/lib32"
;;
Linux*)
if test -d /usr/lib64; then
if test -d /usr/lib64 -a ! -d /usr/lib64/fakeroot; then
libdir="$exec_prefix/lib64"
fi
;;
+2 -11
Ver Arquivo
@@ -86,13 +86,6 @@ if test x$enable_gssapi != xno; then
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(for GSS/gssapi_krb5.h presence)
if test -f $gssdir/Headers/gssapi_krb5.h; then
AC_DEFINE(HAVE_GSSAPI_KRB5_H)
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(for GSS/gssapi_spi.h presence)
if test -f $gssdir/PrivateHeaders/gssapi_spi.h; then
AC_MSG_RESULT(yes)
@@ -105,16 +98,14 @@ if test x$enable_gssapi != xno; then
fi
else
AC_MSG_RESULT(no)
if test $uversion -ge 110; then
# Broken public headers in 10.7...
if test $uversion -ge 110 -a $uversion -lt 120; then
# Broken public headers in 10.7.x...
AC_MSG_ERROR(Run 'sudo mkdir -p $gssdir/PrivateHeaders' and 'sudo touch $gssdir/PrivateHeaders/gssapi_spi.h' to build CUPS.)
fi
fi
else
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_GENERIC_H))
AC_CHECK_HEADER(gssapi/gssapi_krb5.h, AC_DEFINE(HAVE_GSSAPI_KRB5_H))
fi
SAVELIBS="$LIBS"
+11 -6
Ver Arquivo
@@ -27,6 +27,8 @@ AC_ARG_WITH(openssl-includes, [ --with-openssl-includes set directory for OpenS
SSLFLAGS=""
SSLLIBS=""
have_ssl=0
CUPS_SERVERCERT=""
CUPS_SERVERKEY=""
if test x$enable_ssl != xno; then
dnl Look for CDSA...
@@ -36,6 +38,7 @@ if test x$enable_ssl != xno; then
have_ssl=1
AC_DEFINE(HAVE_SSL)
AC_DEFINE(HAVE_CDSASSL)
CUPS_SERVERCERT="/Library/Keychains/System.keychain"
dnl Check for the various security headers...
AC_CHECK_HEADER(Security/SecureTransportPriv.h,
@@ -56,12 +59,6 @@ if test x$enable_ssl != xno; then
AC_CHECK_HEADER(Security/SecIdentitySearchPriv.h,
AC_DEFINE(HAVE_SECIDENTITYSEARCHPRIV_H))
dnl Check for SSLSetProtocolVersionMax...
SAVELIBS="$LIBS"
LIBS="$LIBS -framework Security"
AC_CHECK_FUNC(SSLSetProtocolVersionMax)
LIBS="$SAVELIBS"
dnl Check for SecCertificateCopyData..
AC_MSG_CHECKING(for SecCertificateCopyData)
if test $uversion -ge 100; then
@@ -112,6 +109,9 @@ if test x$enable_ssl != xno; then
fi
if test $have_ssl = 1; then
CUPS_SERVERCERT="ssl/server.crt"
CUPS_SERVERKEY="ssl/server.key"
if $PKGCONFIG --exists gcrypt; then
SSLLIBS="$SSLLIBS `$PKGCONFIG --libs gcrypt`"
SSLFLAGS="$SSLFLAGS `$PKGCONFIG --cflags gcrypt`"
@@ -154,6 +154,9 @@ if test x$enable_ssl != xno; then
done
if test "x${SSLLIBS}" != "x"; then
CUPS_SERVERCERT="ssl/server.crt"
CUPS_SERVERKEY="ssl/server.key"
LIBS="$SAVELIBS $SSLLIBS"
AC_CHECK_FUNCS(SSL_set_tlsext_host_name)
fi
@@ -171,6 +174,8 @@ elif test x$enable_cdsa = xyes -o x$enable_gnutls = xyes -o x$enable_openssl = x
AC_MSG_ERROR([Unable to enable SSL support.])
fi
AC_SUBST(CUPS_SERVERCERT)
AC_SUBST(CUPS_SERVERKEY)
AC_SUBST(IPPALIASES)
AC_SUBST(SSLFLAGS)
AC_SUBST(SSLLIBS)
+8 -29
Ver Arquivo
@@ -32,6 +32,7 @@
#define CUPS_DEFAULT_GROUP "sys"
#define CUPS_DEFAULT_SYSTEM_GROUPS "sys root system"
#define CUPS_DEFAULT_PRINTOPERATOR_AUTH "@SYSTEM"
#define CUPS_DEFAULT_SYSTEM_AUTHKEY "system.print.admin"
/*
@@ -174,6 +175,13 @@
#undef HAVE_SCSI_SG_H
/*
* Use <stdint.h>?
*/
#undef HAVE_STDINT_H
/*
* Use <string.h>, <strings.h>, and/or <bstring.h>?
*/
@@ -345,13 +353,6 @@
#undef HAVE_SECPOLICYCREATESSL
/*
* Do we have the SSLSetProtocolVersionMax function?
*/
#undef HAVE_SSLSETPROTOCOLVERSIONMAX
/*
* Do we have the cssmErrorString function?
*/
@@ -359,25 +360,6 @@
#undef HAVE_CSSMERRORSTRING
/*
* Do we have the SLP library?
*/
#undef HAVE_LIBSLP
/*
* Do we have an LDAP library?
*/
#undef HAVE_LDAP
#undef HAVE_OPENLDAP
#undef HAVE_MOZILLA_LDAP
#undef HAVE_LDAP_SSL_H
#undef HAVE_LDAP_SSL
#undef HAVE_LDAP_REBIND_PROC
/*
* Do we have libpaper?
*/
@@ -601,11 +583,8 @@
#undef HAVE_GSS_GSSAPI_H
#undef HAVE_GSS_GSSAPI_SPI_H
#undef HAVE_GSSAPI
#undef HAVE_GSSAPI_GENERIC_H
#undef HAVE_GSSAPI_GSSAPI_H
#undef HAVE_GSSAPI_H
#undef HAVE_GSSAPI_KRB5_H
#undef HAVE_KRB5_H
/*
+4 -1
Ver Arquivo
@@ -3,7 +3,7 @@ dnl "$Id: configure.in 7833 2008-08-04 20:55:13Z mike $"
dnl
dnl Configuration script for CUPS.
dnl
dnl Copyright 2007-2012 by Apple Inc.
dnl Copyright 2007-2013 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
@@ -60,6 +60,7 @@ AC_SUBST(INSTALL_LANGUAGES)
AC_SUBST(UNINSTALL_LANGUAGES)
AC_OUTPUT(Makedefs
conf/cups-files.conf
conf/cupsd.conf
conf/mime.convs
conf/pam.std
@@ -67,12 +68,14 @@ AC_OUTPUT(Makedefs
cups-config
data/testprint
desktop/cups.desktop
doc/help/ref-cups-files-conf.html
doc/help/ref-cupsd-conf.html
doc/help/standard.html
doc/index.html
man/client.conf.man
man/cups-deviced.man
man/cups-driverd.man
man/cups-files.conf.man
man/cups-lpd.man
man/cups-snmp.man
man/cupsaddsmb.man
+12 -4
Ver Arquivo
@@ -192,6 +192,14 @@ depend:
$(CC) -MM $(ALL_CFLAGS) $(OBJS:.o=.c) >Dependencies
#
# Run oclint to check code coverage...
#
oclint:
oclint -o=oclint.html -html $(LIBOBJS:.o=.c) -- $(ALL_CFLAGS)
#
# Install all targets...
#
@@ -304,7 +312,7 @@ libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
echo Linking $@...
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
-install_name $(libdir)/$@ \
-current_version 2.9.0 \
-current_version 2.10.0 \
-compatibility_version 2.0.0 \
-exported_symbols_list t.exp \
$(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
@@ -333,7 +341,7 @@ libcups_s.a: $(LIBOBJS) libcups_s.exp
libcups.la: $(LIBOBJS)
echo Linking $@...
$(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) \
-rpath $(LIBDIR) -version-info 2:9 $(LIBGSSAPI) $(SSLLIBS) \
-rpath $(LIBDIR) -version-info 2:10 $(LIBGSSAPI) $(SSLLIBS) \
$(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
@@ -518,7 +526,7 @@ apihelp:
--css ../doc/cups-printable.css \
--header api-cups.header --intro api-cups.shtml \
api-cups.xml \
cups.h adminutil.c dest.c language.c notify.c \
cups.h adminutil.c dest*.c language.c notify.c \
options.c tempfile.c usersys.c \
util.c >../doc/help/api-cups.html
mxmldoc --tokens help/api-cups.html api-cups.xml >../doc/help/api-cups.tokens
@@ -573,7 +581,7 @@ framedhelp:
--section "Programming" --title "CUPS API" \
--css ../doc/cups-printable.css \
--header api-cups.header --intro api-cups.shtml \
cups.h adminutil.c dest.c language.c notify.c \
cups.h adminutil.c dest*.c language.c notify.c \
options.c tempfile.c usersys.c \
util.c
mxmldoc --framed api-filedir \
+2 -2
Ver Arquivo
@@ -65,7 +65,7 @@ static void write_option(cups_file_t *dstfp, int order,
/*
* 'cupsAdminCreateWindowsPPD()' - Create the Windows PPD file for a printer.
*
* @since CUPS 1.2/OS X 10.5@
* @deprecated@
*/
char * /* O - PPD file or NULL */
@@ -393,7 +393,7 @@ cupsAdminCreateWindowsPPD(
/*
* 'cupsAdminExportSamba()' - Export a printer to Samba.
*
* @since CUPS 1.2/OS X 10.5@
* @deprecated@
*/
int /* O - 1 on success, 0 on failure */
+8 -5
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Administration utility API definitions for CUPS.
*
* Copyright 2007-2011 by Apple Inc.
* Copyright 2007-2012 by Apple Inc.
* Copyright 2001-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -55,16 +55,19 @@ extern int cupsAdminExportSamba(const char *dest, const char *ppd,
const char *samba_server,
const char *samba_user,
const char *samba_password,
FILE *logfile) _CUPS_API_1_2;
FILE *logfile) _CUPS_DEPRECATED;
extern char *cupsAdminCreateWindowsPPD(http_t *http, const char *dest,
char *buffer, int bufsize) _CUPS_API_1_2;
char *buffer, int bufsize)
_CUPS_DEPRECATED;
extern int cupsAdminGetServerSettings(http_t *http,
int *num_settings,
cups_option_t **settings) _CUPS_API_1_3;
cups_option_t **settings)
_CUPS_API_1_3;
extern int cupsAdminSetServerSettings(http_t *http,
int num_settings,
cups_option_t *settings) _CUPS_API_1_3;
cups_option_t *settings)
_CUPS_API_1_3;
# ifdef __cplusplus
+4 -4
Ver Arquivo
@@ -3,7 +3,7 @@
API introduction for CUPS.
Copyright 2007-2011 by Apple Inc.
Copyright 2007-2013 by Apple Inc.
Copyright 1997-2006 by Easy Software Products, all rights reserved.
These coded instructions, statements, and computer programs are the
@@ -183,7 +183,7 @@ int num_options = 0;
<a href='#cups_option_t'>cups_option_t</a> *options = NULL;
<a href='#cups_dest_t'>cups_dest_t</a> *dest;
for (i = 0; i < dest->num_options; i ++)
for (i = 0; i &lt; dest->num_options; i ++)
num_options = <a href='#cupsAddOption'>cupsAddOption</a>(dest->options[i].name, dest->options[i].value,
num_options, &amp;options);
</pre>
@@ -235,7 +235,7 @@ job_id = <a href='#cupsPrintFiles'>cupsPrintFiles</a>(dest->name, 3, files, "Tes
<p>Finally, the <a href='#cupsCreateJob'><code>cupsCreateJob</code></a>
function creates a new job with no files in it. Files are added using the
<a href='#cupsStartDocument'><code>cupsStartDocument</code></a>,
<a href='#cupsStartDocument'><code>cupsStartDocument</code></a>,
<a href='api-httpipp.html#cupsWriteRequestData'><code>cupsWriteRequestData</code></a>,
and <a href='#cupsFinishDocument'><code>cupsFinishDocument</code></a> functions.
The following example creates a job with 10 text files for printing:</p>
@@ -299,7 +299,7 @@ int num_jobs;
<a href='#cups_job_t'>cups_job_t</a> *jobs;
int i;
ipp_jstate_t job_state = IPP_JOB_PENDING;
while (job_state &lt; IPP_JOB_STOPPED)
{
/* Get my jobs (1) with any state (-1) */
+3 -3
Ver Arquivo
@@ -3,7 +3,7 @@
Filter and backend programming introduction for CUPS.
Copyright 2007-2012 by Apple Inc.
Copyright 2007-2013 by Apple Inc.
Copyright 1997-2006 by Easy Software Products, all rights reserved.
These coded instructions, statements, and computer programs are the
@@ -488,7 +488,7 @@ from localizing the vendor-prefixed keyword in the PPD file - otherwise both
the generic and vendor-specific keyword will be shown in the user
interface.</p>
</blockquote></dd>
</blockquote>
<h4><a name="REPORTING_SUPPLIES">Reporting Supply Levels</a></h4>
@@ -613,7 +613,7 @@ datalen = sizeof(data) - 1;
status = <a href="#cupsSideChannelDoRequest">cupsSideChannelDoRequest</a>(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)
if (status == CUPS_SC_STATUS_OK &amp;&amp; datalen > 0)
data[datalen] = '\0';
else
data[0] = '\0';
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: array-private.h 3448 2011-10-04 06:53:26Z msweet $"
*
* Private array definitions for CUPS.
*
@@ -47,5 +47,5 @@ extern cups_array_t *_cupsArrayNewStrings(const char *s) _CUPS_API_1_5;
#endif /* !_CUPS_ARRAY_PRIVATE_H_ */
/*
* End of "$Id$".
* End of "$Id: array-private.h 3448 2011-10-04 06:53:26Z msweet $".
*/
+16 -11
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Authentication functions for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* This file contains Kerberos support code, copyright 2006 by
@@ -660,8 +660,7 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
int pid; /* Current process ID */
FILE *fp; /* Certificate file */
char trc[16], /* Try Root Certificate parameter */
filename[1024], /* Certificate filename */
certificate[33];/* Certificate string */
filename[1024]; /* Certificate filename */
_cups_globals_t *cg = _cupsGlobals(); /* Global data */
# if defined(HAVE_AUTHORIZATION_H)
OSStatus status; /* Status */
@@ -855,19 +854,25 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
* Read the certificate from the file...
*/
fgets(certificate, sizeof(certificate), fp);
char certificate[33], /* Certificate string */
*certptr; /* Pointer to certificate string */
certptr = fgets(certificate, sizeof(certificate), fp);
fclose(fp);
/*
* Set the authorization string and return...
*/
if (certptr)
{
/*
* Set the authorization string and return...
*/
httpSetAuthString(http, "Local", certificate);
httpSetAuthString(http, "Local", certificate);
DEBUG_printf(("8cups_local_auth: Returning authstring=\"%s\"",
http->authstring));
DEBUG_printf(("8cups_local_auth: Returning authstring=\"%s\"",
http->authstring));
return (0);
return (0);
}
}
return (1);
+1 -1
Ver Arquivo
@@ -136,7 +136,7 @@ quote_string(const char *s) /* I - String to write */
if (*s == '\\' || *s == '\"')
putchar('\\');
if (*s == '\n')
if (((*s & 255) < ' ' && *s != '\t') || *s == 0x7f)
putchar(' ');
else
putchar(*s);
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: conflicts.c 3794 2012-04-23 22:44:16Z msweet $"
*
* Option marking routines for CUPS.
*
@@ -1210,5 +1210,5 @@ ppd_test_constraints(
/*
* End of "$Id$".
* End of "$Id: conflicts.c 3794 2012-04-23 22:44:16Z msweet $".
*/
+3 -2
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Private definitions for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -158,7 +158,8 @@ typedef struct _cups_globals_s /**** CUPS global state data ****/
cups_server_cert_cb_t server_cert_cb; /* Server certificate callback */
void *server_cert_data;
/* Server certificate user data */
int any_root, /* Allow any root */
int server_version, /* Server IPP version */
any_root, /* Allow any root */
expired_certs, /* Allow expired certs */
expired_root; /* Allow expired root */
+3 -3
Ver Arquivo
@@ -3,7 +3,7 @@
*
* API definitions for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -52,10 +52,10 @@ extern "C" {
* Constants...
*/
# define CUPS_VERSION 1.0600
# define CUPS_VERSION 1.0603
# define CUPS_VERSION_MAJOR 1
# define CUPS_VERSION_MINOR 6
# define CUPS_VERSION_PATCH 0
# define CUPS_VERSION_PATCH 3
# define CUPS_BC_FD 3
/* Back-channel file descriptor for
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: debug.c 3643 2012-02-13 16:35:48Z msweet $"
*
* Debugging functions for CUPS.
*
@@ -654,5 +654,5 @@ _cups_debug_set(const char *logfile, /* I - Log file or NULL */
/*
* End of "$Id$".
* End of "$Id: debug.c 3643 2012-02-13 16:35:48Z msweet $".
*/
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: dest-job.c 3833 2012-05-23 22:51:18Z msweet $"
*
* Destination job support for CUPS.
*
@@ -354,5 +354,5 @@ cupsStartDestDocument(
/*
* End of "$Id$".
* End of "$Id: dest-job.c 3833 2012-05-23 22:51:18Z msweet $".
*/
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: dest-localization.c 3833 2012-05-23 22:51:18Z msweet $"
*
* Destination localization support for CUPS.
*
@@ -382,5 +382,5 @@ cups_scan_strings(char *buffer) /* I - Start of string */
/*
* End of "$Id$".
* End of "$Id: dest-localization.c 3833 2012-05-23 22:51:18Z msweet $".
*/
+19 -21
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: dest-options.c 4185 2013-02-20 02:19:13Z msweet $"
*
* Destination option/media support for CUPS.
*
@@ -269,13 +269,13 @@ cupsCheckDestSupported(
* Returns 1 if there is a conflict, 0 if there are no conflicts, and -1 if
* there was an unrecoverable error such as a resolver loop.
*
* If "num_conflicts" and "conflicts" are not NULL, they are set to contain the
* list of conflicting option/value pairs. Similarly, if "num_resolved" and
* "resolved" are not NULL they will be set to the list of changes needed to
* resolve the conflict.
* If "num_conflicts" and "conflicts" are not @code NULL@, they are set to
* contain the list of conflicting option/value pairs. Similarly, if
* "num_resolved" and "resolved" are not @code NULL@ they will be set to the
* list of changes needed to resolve the conflict.
*
* If cupsCopyDestConflicts returns 1 but "num_resolved" and "resolved" are set
* to 0 and NULL, respectively, then the conflict cannot be resolved.
* to 0 and @code NULL@, respectively, then the conflict cannot be resolved.
*
* @since CUPS 1.6/OS X 10.8@
*/
@@ -485,7 +485,7 @@ cupsCopyDestConflicts(
active = NULL;
}
if (tries >= 0)
if (tries >= 100)
{
DEBUG_puts("1cupsCopyDestConflicts: Unable to resolve after 100 tries.");
have_conflicts = -1;
@@ -716,14 +716,13 @@ cupsFreeDestInfo(cups_dinfo_t *dinfo) /* I - Destination information */
/*
* 'cupsGetDestMediaByName()' - Get media names, dimensions, and margins.
*
* The "media" string is a PWG media name, while "width" and "length" are the
* dimensions in hundredths of millimeters. "flags" provides some matching
* The "media" string is a PWG media name. "Flags" provides some matching
* guidance (multiple flags can be combined):
*
* CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer
* CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size
* CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing
* CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size
* CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer,
* CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size,
* CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing,
* CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and
* CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the
* size amongst the "ready" media.
*
@@ -782,14 +781,13 @@ cupsGetDestMediaByName(
/*
* 'cupsGetDestMediaBySize()' - Get media names, dimensions, and margins.
*
* The "media" string is a PWG media name, while "width" and "length" are the
* dimensions in hundredths of millimeters. "flags" provides some matching
* guidance (multiple flags can be combined):
* "Width" and "length" are the dimensions in hundredths of millimeters.
* "Flags" provides some matching guidance (multiple flags can be combined):
*
* CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer
* CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size
* CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing
* CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size
* CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer,
* CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size,
* CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing,
* CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and
* CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the
* size amongst the "ready" media.
*
@@ -1761,5 +1759,5 @@ cups_test_constraints(
/*
* End of "$Id$".
* End of "$Id: dest-options.c 4185 2013-02-20 02:19:13Z msweet $".
*/
+16 -29
Ver Arquivo
@@ -3,7 +3,7 @@
*
* User-defined destination (and option) support for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -1657,7 +1657,6 @@ int /* O - Number of destinations */
cupsGetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
cups_dest_t **dests) /* O - Destinations */
{
int i; /* Looping var */
int num_dests; /* Number of destinations */
cups_dest_t *dest; /* Destination pointer */
const char *home; /* HOME environment variable */
@@ -1780,21 +1779,16 @@ cupsGetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
* Have a default; see if it is real...
*/
dest = cupsGetDest(dest->name, NULL, num_reals, reals);
}
if (!cupsGetDest(dest->name, NULL, num_reals, reals))
{
/*
* Remove the non-real printer from the list, since we don't want jobs
* going to an unexpected printer... (<rdar://problem/14216472>)
*/
/*
* If dest is NULL, then no default (that exists) is set, so we
* need to set a default if one exists...
*/
if (dest == NULL && defprinter != NULL)
{
for (i = 0; i < num_dests; i ++)
(*dests)[i].is_default = 0;
if ((dest = cupsGetDest(name, instance, num_dests, *dests)) != NULL)
dest->is_default = 1;
num_dests = cupsRemoveDest(dest->name, dest->instance, num_dests,
dests);
}
}
/*
@@ -1909,18 +1903,7 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT
*/
if (!_cupsGetDests(http, op, name, &dest, 0, 0))
{
if (op == CUPS_GET_DEFAULT || (name && !set_as_default))
return (NULL);
/*
* The default printer from environment variables or from a
* configuration file does not exist. Find out the real default.
*/
if (!_cupsGetDests(http, CUPS_GET_DEFAULT, NULL, &dest, 0, 0))
return (NULL);
}
return (NULL);
if (instance)
dest->instance = _cupsStrAlloc(instance);
@@ -2449,7 +2432,7 @@ appleCopyNetwork(void)
* 'appleGetPaperSize()' - Get the default paper size.
*/
char * /* O - Default paper size */
static char * /* O - Default paper size */
appleGetPaperSize(char *name, /* I - Paper size name buffer */
int namesize) /* I - Size of buffer */
{
@@ -2679,8 +2662,10 @@ cups_dnssd_browse_cb(
AvahiLookupResultFlags flags, /* I - Flags */
void *context) /* I - Devices array */
{
#ifdef DEBUG
AvahiClient *client = avahi_service_browser_get_client(browser);
/* Client information */
#endif /* DEBUG */
_cups_dnssd_data_t *data = (_cups_dnssd_data_t *)context;
/* Enumeration data */
@@ -3064,8 +3049,10 @@ cups_dnssd_query_cb(
AvahiLookupResultFlags flags, /* I - Flags */
void *context) /* I - Enumeration data */
{
# ifdef DEBUG
AvahiClient *client = avahi_record_browser_get_client(browser);
/* Client information */
# endif /* DEBUG */
# endif /* HAVE_DNSSD */
_cups_dnssd_data_t *data = (_cups_dnssd_data_t *)context;
/* Enumeration data */
+13 -1
Ver Arquivo
@@ -71,13 +71,22 @@ static const _ipp_option_t ipp_options[] =
{ 0, "hue", IPP_TAG_INTEGER, IPP_TAG_JOB },
{ 0, "hue-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
{ 1, "include-schemes", IPP_TAG_NAME, IPP_TAG_OPERATION },
{ 0, "job-impressions", IPP_TAG_INTEGER, IPP_TAG_JOB },
{ 0, "job-id", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
{ 0, "job-impressions", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
{ 0, "job-impressions-completed", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
{ 0, "job-k-limit", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
{ 0, "job-k-octets", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
{ 0, "job-k-octets-completed",IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
{ 0, "job-media-sheets", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
{ 0, "job-media-sheets-completed", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
{ 0, "job-page-limit", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
{ 0, "job-priority", IPP_TAG_INTEGER, IPP_TAG_JOB },
{ 0, "job-quota-period", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
{ 1, "job-sheets", IPP_TAG_NAME, IPP_TAG_JOB },
{ 1, "job-sheets-default", IPP_TAG_NAME, IPP_TAG_PRINTER },
{ 0, "job-state", IPP_TAG_ENUM, IPP_TAG_ZERO }, /* never send as option */
{ 0, "job-state-message", IPP_TAG_TEXT, IPP_TAG_ZERO }, /* never send as option */
{ 0, "job-state-reasons", IPP_TAG_KEYWORD, IPP_TAG_ZERO }, /* never send as option */
{ 0, "job-uuid", IPP_TAG_URI, IPP_TAG_JOB },
{ 0, "landscape", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
{ 1, "marker-change-time", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
@@ -179,6 +188,9 @@ static const _ipp_option_t ipp_options[] =
{ 0, "sides", IPP_TAG_KEYWORD, IPP_TAG_JOB,
IPP_TAG_DOCUMENT },
{ 0, "sides-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
{ 0, "time-at-completed", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
{ 0, "time-at-creation", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
{ 0, "time-at-processing", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
{ 0, "wrap", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
{ 0, "wrap-default", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
{ 0, "x-dimension", IPP_TAG_INTEGER, IPP_TAG_JOB,
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: file-private.h 3275 2011-05-20 07:26:13Z msweet $"
*
* Private file definitions for CUPS.
*
@@ -133,5 +133,5 @@ extern void _cupsFileCheckFilter(void *context,
#endif /* !_CUPS_FILE_PRIVATE_H_ */
/*
* End of "$Id$".
* End of "$Id: file-private.h 3275 2011-05-20 07:26:13Z msweet $".
*/
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: getdevices.c 3794 2012-04-23 22:44:16Z msweet $"
*
* cupsGetDevices implementation for CUPS.
*
@@ -279,5 +279,5 @@ cupsGetDevices(
/*
* End of "$Id$".
* End of "$Id: getdevices.c 3794 2012-04-23 22:44:16Z msweet $".
*/
+6 -6
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Global variable access routines for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -210,11 +210,11 @@ cups_globals_alloc(void)
*/
memset(cg, 0, sizeof(_cups_globals_t));
cg->encryption = (http_encryption_t)-1;
cg->password_cb = (cups_password_cb2_t)_cupsGetPassword;
cg->any_root = 1;
cg->expired_certs = 1;
cg->expired_root = 1;
cg->encryption = (http_encryption_t)-1;
cg->password_cb = (cups_password_cb2_t)_cupsGetPassword;
cg->any_root = 1;
cg->expired_certs = 1;
cg->expired_root = 1;
/*
* Then set directories as appropriate...
+1 -1
Ver Arquivo
@@ -33,7 +33,7 @@
# include <poll.h>
#endif /* HAVE_POLL */
#ifndef WIN32
# include <sys/fcntl.h>
# include <fcntl.h>
#endif /* WIN32 */
-15
Ver Arquivo
@@ -44,29 +44,14 @@
# ifdef HAVE_GSSAPI
# ifdef HAVE_GSS_GSSAPI_H
# include <GSS/gssapi.h>
# ifdef HAVE_GSSAPI_GENERIC_H
# include <GSS/gssapi_generic.h>
# endif /* HAVE_GSSAPI_GENERIC_H */
# ifdef HAVE_GSSAPI_KRB5_H
# include <GSS/gssapi_krb5.h>
# endif /* HAVE_GSSAPI_KRB5_H */
# elif defined(HAVE_GSSAPI_GSSAPI_H)
# include <gssapi/gssapi.h>
# ifdef HAVE_GSSAPI_GENERIC_H
# include <gssapi/gssapi_generic.h>
# endif /* HAVE_GSSAPI_GENERIC_H */
# ifdef HAVE_GSSAPI_KRB5_H
# include <gssapi/gssapi_krb5.h>
# endif /* HAVE_GSSAPI_KRB5_H */
# elif defined(HAVE_GSSAPI_H)
# include <gssapi.h>
# endif /* HAVE_GSS_GSSAPI_H */
# ifndef HAVE_GSS_C_NT_HOSTBASED_SERVICE
# define GSS_C_NT_HOSTBASED_SERVICE gss_nt_service_name
# endif /* !HAVE_GSS_C_NT_HOSTBASED_SERVICE */
# ifdef HAVE_KRB5_H
# include <krb5.h>
# endif /* HAVE_KRB5_H */
# endif /* HAVE_GSSAPI */
# ifdef HAVE_AUTHORIZATION_H
+97 -20
Ver Arquivo
@@ -3,7 +3,7 @@
*
* HTTP support routines for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -82,6 +82,7 @@ typedef struct _http_uribuf_s /* URI buffer */
char *buffer; /* Pointer to buffer */
size_t bufsize; /* Size of buffer */
int options; /* Options passed to _httpResolveURI */
const char *resource; /* Resource from URI */
} _http_uribuf_t;
@@ -237,6 +238,9 @@ httpAssembleURI(
if (host)
{
const char *hostptr; /* Pointer into hostname */
int have_ipv6; /* Do we have an IPv6 address? */
if (username && *username)
{
/*
@@ -264,13 +268,23 @@ httpAssembleURI(
* too...
*/
if (host[0] != '[' && strchr(host, ':') && !strstr(host, "._tcp"))
for (hostptr = host,
have_ipv6 = strchr(host, ':') && !strstr(host, "._tcp");
*hostptr && have_ipv6;
hostptr ++)
if (*hostptr != ':' && !isxdigit(*hostptr & 255))
{
have_ipv6 = *hostptr == '%';
break;
}
if (have_ipv6)
{
/*
* We have a raw IPv6 address...
*/
if (strchr(host, '%'))
if (strchr(host, '%') && !(encoding & HTTP_URI_CODING_RFC6874))
{
/*
* We have a link-local address, add "[v1." prefix...
@@ -289,7 +303,7 @@ httpAssembleURI(
else
{
/*
* We have a normal address, add "[" prefix...
* We have a normal (or RFC 6874 link-local) address, add "[" prefix...
*/
if (ptr < end)
@@ -305,8 +319,23 @@ httpAssembleURI(
while (ptr < end && *host)
{
if (*host == '%')
{
*ptr++ = '+'; /* Convert zone separator */
{
/*
* Convert/encode zone separator
*/
if (encoding & HTTP_URI_CODING_RFC6874)
{
if (ptr >= (end - 2))
goto assemble_overflow;
*ptr++ = '%';
*ptr++ = '2';
*ptr++ = '5';
}
else
*ptr++ = '+';
host ++;
}
else
@@ -324,10 +353,12 @@ httpAssembleURI(
else
{
/*
* Otherwise, just copy the host string...
* Otherwise, just copy the host string (the extra chars are not in the
* "reg-name" ABNF rule; anything <= SP or >= DEL plus % gets automatically
* percent-encoded.
*/
ptr = http_copy_encode(ptr, host, end, ":/?#[]@\\\"", NULL,
ptr = http_copy_encode(ptr, host, end, "\"#/:<>?@[\\]^`{|}", NULL,
encoding & HTTP_URI_CODING_HOSTNAME);
if (!ptr)
@@ -1083,8 +1114,25 @@ httpSeparateURI(
*/
uri ++;
if (!strncmp(uri, "v1.", 3))
uri += 3; /* Skip IPvN leader... */
if (*uri == 'v')
{
/*
* Skip IPvFuture ("vXXXX.") prefix...
*/
uri ++;
while (isxdigit(*uri & 255))
uri ++;
if (*uri != '.')
{
*host = '\0';
return (HTTP_URI_BAD_HOSTNAME);
}
uri ++;
}
uri = http_copy_decode(host, uri, hostlen, "]",
decoding & HTTP_URI_CODING_HOSTNAME);
@@ -1117,6 +1165,14 @@ httpSeparateURI(
*ptr = '%';
break;
}
else if (*ptr == '%')
{
/*
* Stop at zone separator (RFC 6874)
*/
break;
}
else if (*ptr != ':' && *ptr != '.' && !isxdigit(*ptr & 255))
{
*host = '\0';
@@ -1132,12 +1188,13 @@ httpSeparateURI(
for (ptr = (char *)uri; *ptr; ptr ++)
if (strchr(":?/", *ptr))
break;
else if (!strchr("abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"0123456789"
"-._~"
"%"
"!$&'()*+,;=\\", *ptr))
else if (!strchr("abcdefghijklmnopqrstuvwxyz" /* unreserved */
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" /* unreserved */
"0123456789" /* unreserved */
"-._~" /* unreserved */
"%" /* pct-encoded */
"!$&'()*+,;=" /* sub-delims */
"\\", *ptr)) /* SMB domain */
{
*host = '\0';
return (HTTP_URI_BAD_HOSTNAME);
@@ -1230,8 +1287,9 @@ httpSeparateURI(
char *resptr = resource + strlen(resource);
uri = http_copy_decode(resptr, uri, resourcelen - (int)(resptr - resource),
NULL, decoding & HTTP_URI_CODING_QUERY);
uri = http_copy_decode(resptr, uri,
resourcelen - (int)(resptr - resource), NULL,
decoding & HTTP_URI_CODING_QUERY);
}
}
@@ -1268,6 +1326,9 @@ httpStatus(http_status_t status) /* I - HTTP status code */
switch (status)
{
case HTTP_ERROR :
s = strerror(errno);
break;
case HTTP_CONTINUE :
s = _("Continue");
break;
@@ -1523,6 +1584,7 @@ _httpResolveURI(
uribuf.buffer = resolved_uri;
uribuf.bufsize = resolved_size;
uribuf.options = options;
uribuf.resource = resource;
resolved_uri[0] = '\0';
@@ -1850,6 +1912,11 @@ http_copy_decode(char *dst, /* O - Destination buffer */
return (NULL);
}
}
else if ((*src & 255) <= 0x20 || (*src & 255) >= 0x7f)
{
*ptr = '\0';
return (NULL);
}
else
*ptr++ = *src;
}
@@ -2057,6 +2124,8 @@ http_resolve_cb(
error));
#endif /* DEBUG */
}
httpAddrFreeList(addrlist);
}
}
@@ -2064,8 +2133,14 @@ http_resolve_cb(
* Assemble the final device URI...
*/
httpAssembleURI(HTTP_URI_CODING_ALL, uribuf->buffer, uribuf->bufsize, scheme,
NULL, hostTarget, ntohs(port), resource);
if ((!strcmp(scheme, "ipp") || !strcmp(scheme, "ipps")) &&
!strcmp(uribuf->resource, "/cups"))
httpAssembleURIf(HTTP_URI_CODING_ALL, uribuf->buffer, uribuf->bufsize,
scheme, NULL, hostTarget, ntohs(port), "%s?snmp=false",
resource);
else
httpAssembleURI(HTTP_URI_CODING_ALL, uribuf->buffer, uribuf->bufsize,
scheme, NULL, hostTarget, ntohs(port), resource);
DEBUG_printf(("8http_resolve_cb: Resolved URI is \"%s\"...", uribuf->buffer));
}
@@ -2266,6 +2341,8 @@ http_resolve_cb(
error));
#endif /* DEBUG */
}
httpAddrFreeList(addrlist);
}
}
+55 -66
Ver Arquivo
@@ -3,7 +3,7 @@
*
* HTTP routines for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* This file contains Kerberos support code, copyright 2006 by
@@ -133,6 +133,7 @@
# include <signal.h>
# include <sys/time.h>
# include <sys/resource.h>
# include <sys/utsname.h>
#endif /* WIN32 */
#ifdef HAVE_POLL
# include <poll.h>
@@ -2991,8 +2992,11 @@ _httpWait(http_t *http, /* I - Connection to server */
pfd.fd = http->fd;
pfd.events = POLLIN;
while ((nfds = poll(&pfd, 1, msec)) < 0 &&
(errno == EINTR || errno == EAGAIN));
do
{
nfds = poll(&pfd, 1, msec);
}
while (nfds < 0 && (errno == EINTR || errno == EAGAIN));
#else
do
@@ -3643,7 +3647,39 @@ http_send(http_t *http, /* I - Connection to server */
*/
if (!http->fields[HTTP_FIELD_USER_AGENT][0])
httpSetField(http, HTTP_FIELD_USER_AGENT, CUPS_MINIMAL);
{
#ifdef WIN32
SYSTEM_INFO sysinfo; /* System information */
OSVERSIONEX version; /* OS version info */
version.dwOSVersionInfoSize = sizeof(OSVERSIONEX);
GetVersionInfoEx(&version);
GetNativeSystemInfo(&sysinfo);
snprintf(buf, sizeof(buf), CUPS_MINIMAL " (Windows %d.%d; %s) IPP/2.0",
version.major, version.minor,
sysinfo.wProcessorArchitecture
== PROCESSOR_ARCHITECTURE_AMD64 ? "amd64" :
sysinfo.wProcessorArchitecture
== PROCESSOR_ARCHITECTURE_ARM ? "arm" :
sysinfo.wProcessorArchitecture
== PROCESSOR_ARCHITECTURE_IA64 ? "ia64" :
sysinfo.wProcessorArchitecture
== PROCESSOR_ARCHITECTURE_INTEL ? "intel" :
"unknown");
#else
struct utsname name; /* uname info */
uname(&name);
snprintf(buf, sizeof(buf), CUPS_MINIMAL " (%s %s; %s) IPP/2.0",
name.sysname, name.release, name.machine);
#endif /* WIN32 */
DEBUG_printf(("8http_send: Default User-Agent: %s", buf));
httpSetField(http, HTTP_FIELD_USER_AGENT, buf);
}
/*
* Encode the URI as needed...
@@ -3702,8 +3738,17 @@ http_send(http_t *http, /* I - Connection to server */
DEBUG_printf(("9http_send: %s: %s", http_fields[i],
httpGetField(http, i)));
if (httpPrintf(http, "%s: %s\r\n", http_fields[i],
httpGetField(http, i)) < 1)
if (i == HTTP_FIELD_HOST)
{
if (httpPrintf(http, "Host: %s:%d\r\n", httpGetField(http, i),
_httpAddrPort(http->hostaddr)) < 1)
{
http->status = HTTP_ERROR;
return (-1);
}
}
else if (httpPrintf(http, "%s: %s\r\n", http_fields[i],
httpGetField(http, i)) < 1)
{
http->status = HTTP_ERROR;
return (-1);
@@ -3781,63 +3826,6 @@ http_set_credentials(http_t *http) /* I - Connection to server */
if ((credentials = http->tls_credentials) == NULL)
credentials = cg->tls_credentials;
# if HAVE_SECPOLICYCREATESSL
/*
* Otherwise root around in the user's keychain to see if one can be found...
*/
if (!credentials)
{
CFDictionaryRef query; /* Query dictionary */
CFTypeRef matches = NULL; /* Matching credentials */
CFArrayRef dn_array = NULL;/* Distinguished names array */
CFTypeRef keys[] = { kSecClass,
kSecMatchLimit,
kSecReturnRef };
/* Keys for dictionary */
CFTypeRef values[] = { kSecClassCertificate,
kSecMatchLimitOne,
kCFBooleanTrue };
/* Values for dictionary */
/*
* Get the names associated with the server.
*/
if ((error = SSLCopyDistinguishedNames(http->tls, &dn_array)) != noErr)
{
DEBUG_printf(("4http_set_credentials: SSLCopyDistinguishedNames, error=%d",
(int)error));
return (error);
}
/*
* Create a query which will return all identities that can sign and match
* the passed in policy.
*/
query = CFDictionaryCreate(NULL,
(const void**)(&keys[0]),
(const void**)(&values[0]),
sizeof(keys) / sizeof(keys[0]),
&kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks);
if (query)
{
error = SecItemCopyMatching(query, &matches);
DEBUG_printf(("4http_set_credentials: SecItemCopyMatching, error=%d",
(int)error));
CFRelease(query);
}
if (matches)
CFRelease(matches);
if (dn_array)
CFRelease(dn_array);
}
# endif /* HAVE_SECPOLICYCREATESSL */
if (credentials)
{
error = SSLSetCertificate(http->tls, credentials);
@@ -3907,12 +3895,11 @@ http_set_wait(http_t *http) /* I - Connection to server */
static int /* O - 0 on success, -1 on failure */
http_setup_ssl(http_t *http) /* I - Connection to server */
{
_cups_globals_t *cg = _cupsGlobals();
/* Pointer to library globals */
int any_root; /* Allow any root */
char hostname[256], /* Hostname */
*hostptr; /* Pointer into hostname */
_cups_globals_t *cg = _cupsGlobals();
/* Pointer to library globals */
# ifdef HAVE_LIBSSL
SSL_CTX *context; /* Context for encryption */
BIO *bio; /* BIO data */
@@ -4222,6 +4209,8 @@ http_setup_ssl(http_t *http) /* I - Connection to server */
credential->datalen);
cupsArrayAdd(names, credential);
}
else
free(credential);
}
}
}
+2 -1
Ver Arquivo
@@ -279,7 +279,8 @@ typedef enum http_uri_coding_e /**** URI en/decode flags ****/
HTTP_URI_CODING_RESOURCE = 4, /* En/decode the resource portion */
HTTP_URI_CODING_MOST = 7, /* En/decode all but the query */
HTTP_URI_CODING_QUERY = 8, /* En/decode the query portion */
HTTP_URI_CODING_ALL = 15 /* En/decode everything */
HTTP_URI_CODING_ALL = 15, /* En/decode everything */
HTTP_URI_CODING_RFC6874 = 16 /* Use RFC 6874 address format */
} http_uri_coding_t;
typedef enum http_version_e /**** HTTP version numbers ****/
+9 -9
Ver Arquivo
@@ -645,8 +645,8 @@ ippEnumString(const char *attrname, /* I - Attribute name */
if (!strcmp(attrname, "document-state") &&
enumvalue >= 3 &&
enumvalue <= (3 + (int)(sizeof(ipp_document_states) /
sizeof(ipp_document_states[0]))))
enumvalue < (3 + (int)(sizeof(ipp_document_states) /
sizeof(ipp_document_states[0]))))
return (ipp_document_states[enumvalue - 3]);
else if ((!strcmp(attrname, "finishings") ||
!strcmp(attrname, "finishings-actual") ||
@@ -654,13 +654,13 @@ ippEnumString(const char *attrname, /* I - Attribute name */
!strcmp(attrname, "finishings-ready") ||
!strcmp(attrname, "finishings-supported")) &&
enumvalue >= 3 &&
enumvalue <= (3 + (int)(sizeof(ipp_finishings) / sizeof(ipp_finishings[0]))))
enumvalue < (3 + (int)(sizeof(ipp_finishings) / sizeof(ipp_finishings[0]))))
return (ipp_finishings[enumvalue - 3]);
else if ((!strcmp(attrname, "job-collation-type") ||
!strcmp(attrname, "job-collation-type-actual")) &&
enumvalue >= 3 &&
enumvalue <= (3 + (int)(sizeof(ipp_job_collation_types) /
sizeof(ipp_job_collation_types[0]))))
enumvalue < (3 + (int)(sizeof(ipp_job_collation_types) /
sizeof(ipp_job_collation_types[0]))))
return (ipp_job_collation_types[enumvalue - 3]);
else if (!strcmp(attrname, "job-state") &&
enumvalue >= IPP_JOB_PENDING && enumvalue <= IPP_JOB_COMPLETED)
@@ -672,16 +672,16 @@ ippEnumString(const char *attrname, /* I - Attribute name */
!strcmp(attrname, "orientation-requested-default") ||
!strcmp(attrname, "orientation-requested-supported")) &&
enumvalue >= 3 &&
enumvalue <= (3 + (int)(sizeof(ipp_orientation_requesteds) /
sizeof(ipp_orientation_requesteds[0]))))
enumvalue < (3 + (int)(sizeof(ipp_orientation_requesteds) /
sizeof(ipp_orientation_requesteds[0]))))
return (ipp_orientation_requesteds[enumvalue - 3]);
else if ((!strcmp(attrname, "print-quality") ||
!strcmp(attrname, "print-quality-actual") ||
!strcmp(attrname, "print-quality-default") ||
!strcmp(attrname, "print-quality-supported")) &&
enumvalue >= 3 &&
enumvalue <= (3 + (int)(sizeof(ipp_print_qualities) /
sizeof(ipp_print_qualities[0]))))
enumvalue < (3 + (int)(sizeof(ipp_print_qualities) /
sizeof(ipp_print_qualities[0]))))
return (ipp_print_qualities[enumvalue - 3]);
else if (!strcmp(attrname, "printer-state") &&
enumvalue >= IPP_PRINTER_IDLE && enumvalue <= IPP_PRINTER_STOPPED)
+45 -8
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Internet Printing Protocol functions for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -2327,7 +2327,9 @@ ippNextAttribute(ipp_t *ipp) /* I - IPP message */
ipp_t * /* O - New IPP message */
ippNew(void)
{
ipp_t *temp; /* New IPP message */
ipp_t *temp; /* New IPP message */
_cups_globals_t *cg = _cupsGlobals();
/* Global data */
DEBUG_puts("ippNew()");
@@ -2335,11 +2337,14 @@ ippNew(void)
if ((temp = (ipp_t *)calloc(1, sizeof(ipp_t))) != NULL)
{
/*
* Default to IPP 2.0...
* Set default version - usually 2.0...
*/
temp->request.any.version[0] = 2;
temp->request.any.version[1] = 0;
if (cg->server_version == 0)
_cupsSetDefaults();
temp->request.any.version[0] = cg->server_version / 10;
temp->request.any.version[1] = cg->server_version % 10;
temp->use = 1;
}
@@ -2771,6 +2776,13 @@ ippReadIO(void *src, /* I - Data source */
ipp->prev = ipp->current;
attr = ipp->current = ipp_add_attr(ipp, NULL, ipp->curtag, IPP_TAG_ZERO, 1);
if (!attr)
{
_cupsSetHTTPError(HTTP_ERROR);
DEBUG_puts("1ippReadIO: unable to allocate attribute.");
_cupsBufferRelease((char *)buffer);
return (IPP_ERROR);
}
DEBUG_printf(("2ippReadIO: membername, ipp->current=%p, ipp->prev=%p",
ipp->current, ipp->prev));
@@ -3116,7 +3128,15 @@ ippReadIO(void *src, /* I - Data source */
* we need to carry over...
*/
if (n == 0)
if (!attr)
{
_cupsSetError(IPP_INTERNAL_ERROR,
_("IPP memberName with no attribute."), 1);
DEBUG_puts("1ippReadIO: Member name without attribute.");
_cupsBufferRelease((char *)buffer);
return (IPP_ERROR);
}
else if (n == 0)
{
_cupsSetError(IPP_INTERNAL_ERROR,
_("IPP memberName value is empty."), 1);
@@ -4996,7 +5016,8 @@ ipp_free_values(ipp_attribute_t *attr, /* I - Attribute to free values from */
_ipp_value_t *value; /* Current value */
DEBUG_printf(("4ipp_free_values(attr=%p, element=%d, count=%d)", attr, element, count));
DEBUG_printf(("4ipp_free_values(attr=%p, element=%d, count=%d)", attr,
element, count));
if (!(attr->value_tag & IPP_TAG_COPY))
{
@@ -5008,8 +5029,13 @@ ipp_free_values(ipp_attribute_t *attr, /* I - Attribute to free values from */
{
case IPP_TAG_TEXTLANG :
case IPP_TAG_NAMELANG :
if (element == 0 && count == attr->num_values && attr->values[0].string.language)
if (element == 0 && count == attr->num_values &&
attr->values[0].string.language)
{
_cupsStrFree(attr->values[0].string.language);
attr->values[0].string.language = NULL;
}
/* Fall through to other string values */
case IPP_TAG_TEXT :
case IPP_TAG_NAME :
@@ -5023,7 +5049,10 @@ ipp_free_values(ipp_attribute_t *attr, /* I - Attribute to free values from */
for (i = count, value = attr->values + element;
i > 0;
i --, value ++)
{
_cupsStrFree(value->string.text);
value->string.text = NULL;
}
break;
case IPP_TAG_DEFAULT :
@@ -5044,7 +5073,10 @@ ipp_free_values(ipp_attribute_t *attr, /* I - Attribute to free values from */
for (i = count, value = attr->values + element;
i > 0;
i --, value ++)
{
ippDelete(value->collection);
value->collection = NULL;
}
break;
case IPP_TAG_STRING :
@@ -5052,8 +5084,13 @@ ipp_free_values(ipp_attribute_t *attr, /* I - Attribute to free values from */
for (i = count, value = attr->values + element;
i > 0;
i --, value ++)
{
if (value->unknown.data)
{
free(value->unknown.data);
value->unknown.data = NULL;
}
}
break;
}
}
+1 -1
Ver Arquivo
@@ -788,7 +788,7 @@ _cupsLangString(cups_lang_t *lang, /* I - Language */
* Range check input...
*/
if (!lang || !message)
if (!lang || !message || !*message)
return (message);
_cupsMutexLock(&lang_mutex);
+140 -134
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: ppd-cache.c 4185 2013-02-20 02:19:13Z msweet $"
*
* PPD cache implementation for CUPS.
*
@@ -69,7 +69,8 @@ static int pwg_compare_finishings(_pwg_finishings_t *a,
_pwg_finishings_t *b);
static void pwg_free_finishings(_pwg_finishings_t *f);
static void pwg_ppdize_name(const char *ipp, char *name, size_t namesize);
static void pwg_unppdize_name(const char *ppd, char *name, size_t namesize);
static void pwg_unppdize_name(const char *ppd, char *name, size_t namesize,
const char *dashchars);
/*
@@ -329,7 +330,7 @@ _ppdCacheCreateWithFile(
goto create_error;
}
if ((num_sizes = atoi(value)) <= 0 || num_sizes > 65536)
if ((num_sizes = atoi(value)) < 0 || num_sizes > 65536)
{
DEBUG_printf(("_ppdCacheCreateWithFile: Bad NumSizes value %d on line "
"%d.", num_sizes, linenum));
@@ -337,12 +338,15 @@ _ppdCacheCreateWithFile(
goto create_error;
}
if ((pc->sizes = calloc(num_sizes, sizeof(_pwg_size_t))) == NULL)
if (num_sizes > 0)
{
DEBUG_printf(("_ppdCacheCreateWithFile: Unable to allocate %d sizes.",
num_sizes));
_cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
goto create_error;
if ((pc->sizes = calloc(num_sizes, sizeof(_pwg_size_t))) == NULL)
{
DEBUG_printf(("_ppdCacheCreateWithFile: Unable to allocate %d sizes.",
num_sizes));
_cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
goto create_error;
}
}
}
else if (!_cups_strcasecmp(line, "Size"))
@@ -684,148 +688,145 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
* Copy and convert size data...
*/
if (ppd->num_sizes == 0)
if (ppd->num_sizes > 0)
{
DEBUG_puts("_ppdCacheCreateWithPPD: No page sizes in PPD.");
goto create_error;
}
if ((pc->sizes = calloc(ppd->num_sizes, sizeof(_pwg_size_t))) == NULL)
{
DEBUG_printf(("_ppdCacheCreateWithPPD: Unable to allocate %d "
"_pwg_size_t's.", ppd->num_sizes));
goto create_error;
}
for (i = ppd->num_sizes, pwg_size = pc->sizes, ppd_size = ppd->sizes;
i > 0;
i --, ppd_size ++)
{
/*
* Don't copy over custom size...
*/
if (!_cups_strcasecmp(ppd_size->name, "Custom"))
continue;
/*
* Convert the PPD size name to the corresponding PWG keyword name.
*/
if ((pwg_media = _pwgMediaForPPD(ppd_size->name)) != NULL)
if ((pc->sizes = calloc(ppd->num_sizes, sizeof(_pwg_size_t))) == NULL)
{
/*
* Standard name, do we have conflicts?
*/
for (j = 0; j < pc->num_sizes; j ++)
if (!strcmp(pc->sizes[j].map.pwg, pwg_media->pwg))
{
pwg_media = NULL;
break;
}
DEBUG_printf(("_ppdCacheCreateWithPPD: Unable to allocate %d "
"_pwg_size_t's.", ppd->num_sizes));
goto create_error;
}
if (pwg_media)
for (i = ppd->num_sizes, pwg_size = pc->sizes, ppd_size = ppd->sizes;
i > 0;
i --, ppd_size ++)
{
/*
* Standard name and no conflicts, use it!
* Don't copy over custom size...
*/
pwg_name = pwg_media->pwg;
new_known_pwg = 1;
}
else
{
if (!_cups_strcasecmp(ppd_size->name, "Custom"))
continue;
/*
* Not a standard name; convert it to a PWG vendor name of the form:
*
* pp_lowerppd_WIDTHxHEIGHTuu
* Convert the PPD size name to the corresponding PWG keyword name.
*/
pwg_name = pwg_keyword;
new_known_pwg = 0;
pwg_unppdize_name(ppd_size->name, ppd_name, sizeof(ppd_name));
_pwgGenerateSize(pwg_keyword, sizeof(pwg_keyword), NULL, ppd_name,
_PWG_FROMPTS(ppd_size->width),
_PWG_FROMPTS(ppd_size->length));
}
/*
* If we have a similar paper with non-zero margins then we only want to
* keep it if it has a larger imageable area length. The NULL check is for
* dimensions that are <= 0...
*/
if ((pwg_media = _pwgMediaForSize(_PWG_FROMPTS(ppd_size->width),
_PWG_FROMPTS(ppd_size->length))) == NULL)
continue;
new_width = pwg_media->width;
new_length = pwg_media->length;
new_left = _PWG_FROMPTS(ppd_size->left);
new_bottom = _PWG_FROMPTS(ppd_size->bottom);
new_right = _PWG_FROMPTS(ppd_size->width - ppd_size->right);
new_top = _PWG_FROMPTS(ppd_size->length - ppd_size->top);
new_imageable = new_length - new_top - new_bottom;
new_borderless = new_bottom == 0 && new_top == 0 &&
new_left == 0 && new_right == 0;
for (k = pc->num_sizes, similar = 0, old_size = pc->sizes, new_size = NULL;
k > 0 && !similar;
k --, old_size ++)
{
old_imageable = old_size->length - old_size->top - old_size->bottom;
old_borderless = old_size->left == 0 && old_size->bottom == 0 &&
old_size->right == 0 && old_size->top == 0;
old_known_pwg = strncmp(old_size->map.pwg, "oe_", 3) &&
strncmp(old_size->map.pwg, "om_", 3);
similar = old_borderless == new_borderless &&
_PWG_EQUIVALENT(old_size->width, new_width) &&
_PWG_EQUIVALENT(old_size->length, new_length);
if (similar &&
(new_known_pwg || (!old_known_pwg && new_imageable > old_imageable)))
if ((pwg_media = _pwgMediaForPPD(ppd_size->name)) != NULL)
{
/*
* The new paper has a larger imageable area so it could replace
* the older paper. Regardless of the imageable area, we always
* prefer the size with a well-known PWG name.
* Standard name, do we have conflicts?
*/
new_size = old_size;
_cupsStrFree(old_size->map.ppd);
_cupsStrFree(old_size->map.pwg);
for (j = 0; j < pc->num_sizes; j ++)
if (!strcmp(pc->sizes[j].map.pwg, pwg_media->pwg))
{
pwg_media = NULL;
break;
}
}
if (pwg_media)
{
/*
* Standard name and no conflicts, use it!
*/
pwg_name = pwg_media->pwg;
new_known_pwg = 1;
}
else
{
/*
* Not a standard name; convert it to a PWG vendor name of the form:
*
* pp_lowerppd_WIDTHxHEIGHTuu
*/
pwg_name = pwg_keyword;
new_known_pwg = 0;
pwg_unppdize_name(ppd_size->name, ppd_name, sizeof(ppd_name), "_.");
_pwgGenerateSize(pwg_keyword, sizeof(pwg_keyword), NULL, ppd_name,
_PWG_FROMPTS(ppd_size->width),
_PWG_FROMPTS(ppd_size->length));
}
}
if (!similar)
{
/*
* The paper was unique enough to deserve its own entry so add it to the
* end.
* If we have a similar paper with non-zero margins then we only want to
* keep it if it has a larger imageable area length. The NULL check is for
* dimensions that are <= 0...
*/
new_size = pwg_size ++;
pc->num_sizes ++;
}
if ((pwg_media = _pwgMediaForSize(_PWG_FROMPTS(ppd_size->width),
_PWG_FROMPTS(ppd_size->length))) == NULL)
continue;
if (new_size)
{
/*
* Save this size...
*/
new_width = pwg_media->width;
new_length = pwg_media->length;
new_left = _PWG_FROMPTS(ppd_size->left);
new_bottom = _PWG_FROMPTS(ppd_size->bottom);
new_right = _PWG_FROMPTS(ppd_size->width - ppd_size->right);
new_top = _PWG_FROMPTS(ppd_size->length - ppd_size->top);
new_imageable = new_length - new_top - new_bottom;
new_borderless = new_bottom == 0 && new_top == 0 &&
new_left == 0 && new_right == 0;
new_size->map.ppd = _cupsStrAlloc(ppd_size->name);
new_size->map.pwg = _cupsStrAlloc(pwg_name);
new_size->width = new_width;
new_size->length = new_length;
new_size->left = new_left;
new_size->bottom = new_bottom;
new_size->right = new_right;
new_size->top = new_top;
for (k = pc->num_sizes, similar = 0, old_size = pc->sizes, new_size = NULL;
k > 0 && !similar;
k --, old_size ++)
{
old_imageable = old_size->length - old_size->top - old_size->bottom;
old_borderless = old_size->left == 0 && old_size->bottom == 0 &&
old_size->right == 0 && old_size->top == 0;
old_known_pwg = strncmp(old_size->map.pwg, "oe_", 3) &&
strncmp(old_size->map.pwg, "om_", 3);
similar = old_borderless == new_borderless &&
_PWG_EQUIVALENT(old_size->width, new_width) &&
_PWG_EQUIVALENT(old_size->length, new_length);
if (similar &&
(new_known_pwg || (!old_known_pwg && new_imageable > old_imageable)))
{
/*
* The new paper has a larger imageable area so it could replace
* the older paper. Regardless of the imageable area, we always
* prefer the size with a well-known PWG name.
*/
new_size = old_size;
_cupsStrFree(old_size->map.ppd);
_cupsStrFree(old_size->map.pwg);
}
}
if (!similar)
{
/*
* The paper was unique enough to deserve its own entry so add it to the
* end.
*/
new_size = pwg_size ++;
pc->num_sizes ++;
}
if (new_size)
{
/*
* Save this size...
*/
new_size->map.ppd = _cupsStrAlloc(ppd_size->name);
new_size->map.pwg = _cupsStrAlloc(pwg_name);
new_size->width = new_width;
new_size->length = new_length;
new_size->left = new_left;
new_size->bottom = new_bottom;
new_size->right = new_right;
new_size->top = new_top;
}
}
}
@@ -913,7 +914,8 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
*/
pwg_name = pwg_keyword;
pwg_unppdize_name(choice->choice, pwg_keyword, sizeof(pwg_keyword));
pwg_unppdize_name(choice->choice, pwg_keyword, sizeof(pwg_keyword),
"_");
}
map->pwg = _cupsStrAlloc(pwg_name);
@@ -977,7 +979,8 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
*/
pwg_name = pwg_keyword;
pwg_unppdize_name(choice->choice, pwg_keyword, sizeof(pwg_keyword));
pwg_unppdize_name(choice->choice, pwg_keyword, sizeof(pwg_keyword),
"_");
}
map->pwg = _cupsStrAlloc(pwg_name);
@@ -1006,7 +1009,7 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
i > 0;
i --, choice ++, map ++)
{
pwg_unppdize_name(choice->choice, pwg_keyword, sizeof(pwg_keyword));
pwg_unppdize_name(choice->choice, pwg_keyword, sizeof(pwg_keyword), "_");
map->pwg = _cupsStrAlloc(pwg_keyword);
map->ppd = _cupsStrAlloc(choice->choice);
@@ -2602,7 +2605,8 @@ pwg_ppdize_name(const char *ipp, /* I - IPP keyword */
static void
pwg_unppdize_name(const char *ppd, /* I - PPD keyword */
char *name, /* I - Name buffer */
size_t namesize) /* I - Size of name buffer */
size_t namesize, /* I - Size of name buffer */
const char *dashchars)/* I - Characters to be replaced by dashes */
{
char *ptr, /* Pointer into name buffer */
*end; /* End of name buffer */
@@ -2612,8 +2616,10 @@ pwg_unppdize_name(const char *ppd, /* I - PPD keyword */
{
if (_cups_isalnum(*ppd) || *ppd == '-')
*ptr++ = tolower(*ppd & 255);
else if (*ppd == '_' || *ppd == '.')
else if (strchr(dashchars, *ppd))
*ptr++ = '-';
else
*ptr++ = *ppd;
if (!_cups_isupper(*ppd) && _cups_isalnum(*ppd) &&
_cups_isupper(ppd[1]) && ptr < end)
@@ -2625,5 +2631,5 @@ pwg_unppdize_name(const char *ppd, /* I - PPD keyword */
/*
* End of "$Id$".
* End of "$Id: ppd-cache.c 4185 2013-02-20 02:19:13Z msweet $".
*/
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: ppd-private.h 3683 2012-02-16 22:03:53Z msweet $"
*
* Private PPD definitions for CUPS.
*
@@ -211,5 +211,5 @@ extern const char *_pwgPageSizeForMedia(_pwg_media_t *media,
#endif /* !_CUPS_PPD_PRIVATE_H_ */
/*
* End of "$Id$".
* End of "$Id: ppd-private.h 3683 2012-02-16 22:03:53Z msweet $".
*/
+6 -6
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: pwg-media.c 10979 2013-05-13 17:39:19Z msweet $"
*
* PWG media name API implementation for CUPS.
*
@@ -794,13 +794,13 @@ _pwgMediaForPWG(const char *pwg) /* I - PWG size name */
if (!strcmp(ptr, "mm"))
{
size->width = (int)(w * 100);
size->length = (int)(l * 100);
size->width = (int)(w * 100 + 0.5);
size->length = (int)(l * 100 + 0.5);
}
else
{
size->width = (int)(w * 2540);
size->length = (int)(l * 2540);
size->width = (int)(w * 2540 + 0.5);
size->length = (int)(l * 2540 + 0.5);
}
strlcpy(cg->pwg_name, pwg, sizeof(cg->pwg_name));
@@ -924,5 +924,5 @@ pwg_compare_pwg(_pwg_media_t *a, /* I - First size */
/*
* End of "$Id$".
* End of "$Id: pwg-media.c 10979 2013-05-13 17:39:19Z msweet $".
*/
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: pwg-private.h 3833 2012-05-23 22:51:18Z msweet $"
*
* Private PWG media API definitions for CUPS.
*
@@ -100,5 +100,5 @@ extern _pwg_media_t *_pwgMediaForSize(int width, int length);
#endif /* !_CUPS_PWG_PRIVATE_H_ */
/*
* End of "$Id$".
* End of "$Id: pwg-private.h 3833 2012-05-23 22:51:18Z msweet $".
*/
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: raster-private.h 3794 2012-04-23 22:44:16Z msweet $"
*
* Private image library definitions for CUPS.
*
@@ -62,5 +62,5 @@ extern void _cupsRasterClearError(void);
#endif /* !_CUPS_RASTER_PRIVATE_H_ */
/*
* End of "$Id$".
* End of "$Id: raster-private.h 3794 2012-04-23 22:44:16Z msweet $".
*/
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: raster.h 3794 2012-04-23 22:44:16Z msweet $"
*
* Raster file definitions for CUPS.
*
@@ -401,5 +401,5 @@ extern cups_raster_t *cupsRasterOpenIO(cups_raster_iocb_t iocb, void *ctx,
#endif /* !_CUPS_RASTER_H_ */
/*
* End of "$Id$".
* End of "$Id: raster.h 3794 2012-04-23 22:44:16Z msweet $".
*/
+48 -23
Ver Arquivo
@@ -51,9 +51,9 @@
/*
* 'cupsDoFileRequest()' - Do an IPP request with a file.
*
* This function sends the IPP request to the specified server, retrying
* and authenticating as necessary. The request is freed with @link ippDelete@
* after receiving a valid IPP response.
* This function sends the IPP request and attached file to the specified
* server, retrying and authenticating as necessary. The request is freed with
* @link ippDelete@.
*/
ipp_t * /* O - Response data */
@@ -102,14 +102,14 @@ cupsDoFileRequest(http_t *http, /* I - Connection to server or @code CUPS_HT
/*
* 'cupsDoIORequest()' - Do an IPP request with file descriptors.
*
* This function sends the IPP request to the specified server, retrying
* and authenticating as necessary. The request is freed with ippDelete()
* after receiving a valid IPP response.
* This function sends the IPP request with the optional input file "infile" to
* the specified server, retrying and authenticating as necessary. The request
* is freed with @link ippDelete@.
*
* If "infile" is a valid file descriptor, cupsDoIORequest() copies
* If "infile" is a valid file descriptor, @code cupsDoIORequest@ copies
* all of the data from the file after the IPP request message.
*
* If "outfile" is a valid file descriptor, cupsDoIORequest() copies
* If "outfile" is a valid file descriptor, @code cupsDoIORequest@ copies
* all of the data after the IPP response message to the file.
*
* @since CUPS 1.3/OS X 10.5@
@@ -309,8 +309,7 @@ cupsDoIORequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
* 'cupsDoRequest()' - Do an IPP request.
*
* This function sends the IPP request to the specified server, retrying
* and authenticating as necessary. The request is freed with ippDelete()
* after receiving a valid IPP response.
* and authenticating as necessary. The request is freed with @link ippDelete@.
*/
ipp_t * /* O - Response data */
@@ -331,9 +330,9 @@ cupsDoRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
* 'cupsGetResponse()' - Get a response to an IPP request.
*
* Use this function to get the response for an IPP request sent using
* cupsSendDocument() or cupsSendRequest(). For requests that return
* additional data, use httpRead() after getting a successful response,
* otherwise call httpFlush() to complete the response processing.
* @link cupsSendRequest@. For requests that return additional data, use
* @link cupsReadResponseData@ after getting a successful response,
* otherwise call @link httpFlush@ to complete the response processing.
*
* @since CUPS 1.4/OS X 10.6@
*/
@@ -481,7 +480,8 @@ cupsGetResponse(http_t *http, /* I - Connection to server or @code CUPS_HTTP
/*
* 'cupsLastError()' - Return the last IPP status code.
* 'cupsLastError()' - Return the last IPP status code received on the current
* thread.
*/
ipp_status_t /* O - IPP status code from last request */
@@ -492,7 +492,8 @@ cupsLastError(void)
/*
* 'cupsLastErrorString()' - Return the last IPP status-message.
* 'cupsLastErrorString()' - Return the last IPP status-message received on the
* current thread.
*
* @since CUPS 1.2/OS X 10.5@
*/
@@ -537,8 +538,9 @@ _cupsNextDelay(int current, /* I - Current delay value or 0 */
/*
* 'cupsReadResponseData()' - Read additional data after the IPP response.
*
* This function is used after cupsGetResponse() to read the PPD or document
* files for CUPS_GET_PPD and CUPS_GET_DOCUMENT requests, respectively.
* This function is used after @link cupsGetResponse@ to read the PPD or document
* files from @code CUPS_GET_PPD@ and @code CUPS_GET_DOCUMENT@ requests,
* respectively.
*
* @since CUPS 1.4/OS X 10.6@
*/
@@ -579,13 +581,17 @@ cupsReadResponseData(
/*
* 'cupsSendRequest()' - Send an IPP request.
*
* Use httpWrite() to write any additional data (document, PPD file, etc.)
* for the request, cupsGetResponse() to get the IPP response, and httpRead()
* to read any additional data following the response. Only one request can be
* sent/queued at a time.
* Use @link cupsWriteRequestData@ to write any additional data (document, PPD
* file, etc.) for the request, @link cupsGetResponse@ to get the IPP response,
* and @link cupsReadResponseData@ to read any additional data following the
* response. Only one request can be sent/queued at a time per @code http_t@
* connection.
*
* Unlike cupsDoFileRequest(), cupsDoIORequest(), and cupsDoRequest(), the
* request is not freed.
* Returns the initial HTTP status code, which will be @code HTTP_CONTINUE@
* on a successful send of the request.
*
* Note: Unlike @link cupsDoFileRequest@, @link cupsDoIORequest@, and
* @link cupsDoRequest@, the request is NOT freed with @link ippDelete@.
*
* @since CUPS 1.4/OS X 10.6@
*/
@@ -998,6 +1004,25 @@ _cupsConnect(void)
httpClose(cg->http);
cg->http = NULL;
}
else
{
/*
* Same server, see if the connection is still established...
*/
char ch; /* Connection check byte */
if (recv(cg->http->fd, &ch, 1, MSG_PEEK | MSG_DONTWAIT) < 0 &&
errno != EWOULDBLOCK)
{
/*
* Nope, close the connection...
*/
httpClose(cg->http);
cg->http = NULL;
}
}
}
/*
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: snmp-private.h 3794 2012-04-23 22:44:16Z msweet $"
*
* Private SNMP definitions for CUPS.
*
@@ -142,5 +142,5 @@ extern int _cupsSNMPWrite(int fd, http_addr_t *address, int version,
/*
* End of "$Id$".
* End of "$Id: snmp-private.h 3794 2012-04-23 22:44:16Z msweet $".
*/
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: snmp.c 3794 2012-04-23 22:44:16Z msweet $"
*
* SNMP functions for CUPS.
*
@@ -1733,5 +1733,5 @@ snmp_set_error(cups_snmp_t *packet, /* I - Packet */
/*
* End of "$Id$".
* End of "$Id: snmp.c 3794 2012-04-23 22:44:16Z msweet $".
*/
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: sspi.c 3247 2011-05-12 06:22:31Z msweet $"
*
* Windows SSPI SSL implementation for CUPS.
*
@@ -1481,5 +1481,5 @@ cleanup:
/*
* End of "$Id$".
* End of "$Id: sspi.c 3247 2011-05-12 06:22:31Z msweet $".
*/
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: testconflicts.c 3755 2012-03-30 05:59:14Z msweet $"
*
* PPD constraint test program for CUPS.
*
@@ -134,5 +134,5 @@ main(int argc, /* I - Number of command-line arguments */
/*
* End of "$Id$".
* End of "$Id: testconflicts.c 3755 2012-03-30 05:59:14Z msweet $".
*/
+5 -1
Ver Arquivo
@@ -131,6 +131,8 @@ static uri_test_t uri_tests[] = /* URI test data */
"http", "", "", "", 80, 0 },
{ HTTP_URI_BAD_HOSTNAME, "http://serve%7/index.html",
"http", "", "", "", 80, 0 },
{ HTTP_URI_BAD_HOSTNAME, "http://server with spaces/index.html",
"http", "", "", "", 80, 0 },
/* Bad port number */
{ HTTP_URI_BAD_PORT, "http://127.0.0.1:9999a/index.html",
@@ -138,7 +140,9 @@ static uri_test_t uri_tests[] = /* URI test data */
/* Bad resource */
{ HTTP_URI_BAD_RESOURCE, "http://server/index.html%",
"http", "", "server", "", 80, 0 }
"http", "", "server", "", 80, 0 },
{ HTTP_URI_BAD_RESOURCE, "http://server/index with spaces.html",
"http", "", "server", "", 80, 0 }
};
static const char * const base64_tests[][2] =
{
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: testoptions.c 1992 2010-03-24 14:32:08Z msweet $"
*
* Option test program for CUPS.
*
@@ -112,5 +112,5 @@ main(int argc, /* I - Number of command-line arguments */
/*
* End of "$Id$".
* End of "$Id: testoptions.c 1992 2010-03-24 14:32:08Z msweet $".
*/
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: testpwg.c 3794 2012-04-23 22:44:16Z msweet $"
*
* PWG test program for CUPS.
*
@@ -521,5 +521,5 @@ test_ppd_cache(_ppd_cache_t *pc, /* I - PWG mapping data */
/*
* End of "$Id$".
* End of "$Id: testpwg.c 3794 2012-04-23 22:44:16Z msweet $".
*/
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: testsnmp.c 3411 2011-09-07 22:31:27Z msweet $"
*
* SNMP test program for CUPS.
*
@@ -300,5 +300,5 @@ usage(void)
/*
* End of "$Id$".
* End of "$Id: testsnmp.c 3411 2011-09-07 22:31:27Z msweet $".
*/
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: thread-private.h 3794 2012-04-23 22:44:16Z msweet $"
*
* Private threading definitions for CUPS.
*
@@ -94,5 +94,5 @@ extern int _cupsThreadCreate(_cups_thread_func_t func, void *arg);
#endif /* !_CUPS_THREAD_PRIVATE_H_ */
/*
* End of "$Id$".
* End of "$Id: thread-private.h 3794 2012-04-23 22:44:16Z msweet $".
*/
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: thread.c 3794 2012-04-23 22:44:16Z msweet $"
*
* Threading primitives for CUPS.
*
@@ -332,5 +332,5 @@ _cupsThreadCreate(
/*
* End of "$Id$".
* End of "$Id: thread.c 3794 2012-04-23 22:44:16Z msweet $".
*/
+25 -34
Ver Arquivo
@@ -3,7 +3,7 @@
*
* User, system, and password routines for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -341,7 +341,8 @@ cupsSetPasswordCB2(
void
cupsSetServer(const char *server) /* I - Server name */
{
char *port; /* Pointer to port */
char *options, /* Options */
*port; /* Pointer to port */
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
@@ -349,6 +350,24 @@ cupsSetServer(const char *server) /* I - Server name */
{
strlcpy(cg->server, server, sizeof(cg->server));
if (cg->server[0] != '/' && (options = strrchr(cg->server, '/')) != NULL)
{
*options++ = '\0';
if (!strcmp(options, "version=1.0"))
cg->server_version = 10;
else if (!strcmp(options, "version=1.1"))
cg->server_version = 11;
else if (!strcmp(options, "version=2.0"))
cg->server_version = 20;
else if (!strcmp(options, "version=2.1"))
cg->server_version = 21;
else if (!strcmp(options, "version=2.2"))
cg->server_version = 22;
}
else
cg->server_version = 20;
if (cg->server[0] != '/' && (port = strrchr(cg->server, ':')) != NULL &&
!strchr(port, ']') && isdigit(port[1] & 255))
{
@@ -364,8 +383,9 @@ cupsSetServer(const char *server) /* I - Server name */
}
else
{
cg->server[0] = '\0';
cg->servername[0] = '\0';
cg->server[0] = '\0';
cg->servername[0] = '\0';
cg->server_version = 20;
}
if (cg->http)
@@ -933,36 +953,7 @@ cups_read_client_conf(
}
if ((!cg->server[0] || !cg->ipp_port) && cups_server)
{
if (!cg->server[0])
{
/*
* Copy server name...
*/
strlcpy(cg->server, cups_server, sizeof(cg->server));
if (cg->server[0] != '/' && (value = strrchr(cg->server, ':')) != NULL &&
!strchr(value, ']') && isdigit(value[1] & 255))
*value++ = '\0';
else
value = NULL;
if (cg->server[0] == '/')
strcpy(cg->servername, "localhost");
else
strlcpy(cg->servername, cg->server, sizeof(cg->servername));
}
else if (cups_server[0] != '/' &&
(value = strrchr(cups_server, ':')) != NULL &&
!strchr(value, ']') && isdigit(value[1] & 255))
value ++;
else
value = NULL;
if (!cg->ipp_port && value)
cg->ipp_port = atoi(value);
}
cupsSetServer(cups_server);
if (!cg->server[0])
{
+41 -5
Ver Arquivo
@@ -935,10 +935,16 @@ cupsGetPPD3(http_t *http, /* I - HTTP connection or @code CUPS_HTTP_DEFAUL
* See if the PPD file is available locally...
*/
if (!cg->servername[0])
cupsServer();
if (http)
httpGetHostname(http, hostname, sizeof(hostname));
else
{
strlcpy(hostname, cupsServer(), sizeof(hostname));
if (hostname[0] == '/')
strlcpy(hostname, "localhost", sizeof(hostname));
}
if (!_cups_strcasecmp(cg->servername, "localhost"))
if (!_cups_strcasecmp(hostname, "localhost"))
{
char ppdname[1024]; /* PPD filename */
struct stat ppdinfo; /* PPD file information */
@@ -1636,6 +1642,7 @@ cups_get_printer_uri(
/* Hostname associated with connection */
static const char * const requested_attrs[] =
{ /* Requested attributes */
"device-uri",
"member-uris",
"printer-uri-supported",
"printer-type"
@@ -1694,9 +1701,38 @@ cups_get_printer_uri(
* Do the request and get back a response...
*/
if ((response = cupsDoRequest(http, request, "/")) != NULL)
snprintf(resource, resourcesize, "/printers/%s", name);
if ((response = cupsDoRequest(http, request, resource)) != NULL)
{
if ((attr = ippFindAttribute(response, "member-uris", IPP_TAG_URI)) != NULL)
const char *device_uri = NULL; /* device-uri value */
if ((attr = ippFindAttribute(response, "device-uri",
IPP_TAG_URI)) != NULL)
device_uri = attr->values[0].string.text;
if (device_uri &&
(!strncmp(device_uri, "ipp://", 6) ||
!strncmp(device_uri, "ipps://", 7) ||
((strstr(device_uri, "._ipp.") != NULL ||
strstr(device_uri, "._ipps.") != NULL) &&
!strcmp(device_uri + strlen(device_uri) - 5, "/cups"))))
{
/*
* Statically-configured shared printer.
*/
httpSeparateURI(HTTP_URI_CODING_ALL,
_httpResolveURI(device_uri, uri, sizeof(uri),
_HTTP_RESOLVE_DEFAULT, NULL, NULL),
scheme, sizeof(scheme), username, sizeof(username),
host, hostsize, port, resource, resourcesize);
ippDelete(response);
return (1);
}
else if ((attr = ippFindAttribute(response, "member-uris",
IPP_TAG_URI)) != NULL)
{
/*
* Get the first actual printer name in the class...
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: versioning.h 3794 2012-04-23 22:44:16Z msweet $"
*
* API versioning definitions for CUPS.
*
@@ -86,5 +86,5 @@
#endif /* !_CUPS_VERSIONING_H_ */
/*
* End of "$Id$".
* End of "$Id: versioning.h 3794 2012-04-23 22:44:16Z msweet $".
*/
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: epson.h 624 2008-02-16 00:27:39Z msweet $"
*
* This file contains model number definitions for the CUPS sample
* ESC/P driver.
@@ -23,5 +23,5 @@
/*
* End of "$Id$".
* End of "$Id: epson.h 624 2008-02-16 00:27:39Z msweet $".
*/
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: hp.h 624 2008-02-16 00:27:39Z msweet $"
*
* This file contains model number definitions for the CUPS sample
* HP driver.
@@ -20,5 +20,5 @@
/*
* End of "$Id$".
* End of "$Id: hp.h 624 2008-02-16 00:27:39Z msweet $".
*/
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id$"
* "$Id: label.h 624 2008-02-16 00:27:39Z msweet $"
*
* This file contains model number definitions for the CUPS sample
* label printer driver.
@@ -24,5 +24,5 @@
#define INTELLITECH_PCL 0x20 /* Intellitech PCL-based printers */
/*
* End of "$Id$".
* End of "$Id: label.h 624 2008-02-16 00:27:39Z msweet $".
*/
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
#
# "$Id$"
# "$Id: Makefile 1725 2009-10-15 18:50:47Z msweet $"
#
# Desktop makefile for CUPS.
#
@@ -131,5 +131,5 @@ uninstall:
#
# End of "$Id$".
# End of "$Id: Makefile 1725 2009-10-15 18:50:47Z msweet $".
#
+4
Ver Arquivo
@@ -7,6 +7,10 @@ Terminal=false
Type=Application
Name=Manage Printing
Comment=CUPS Web Interface
Name[ca]=Gestor d'impressió
Comment[ca]=Interfície web de CUPS
Name[cs]=Správa tisku CUPS
Comment[cs]=Webové rozhraní CUPS
Name[de]=Druckerverwaltung
Comment[de]=CUPS Webinterface
Name[en_US]=Manage Printing
+2 -1
Ver Arquivo
@@ -3,7 +3,7 @@
#
# Documentation makefile for CUPS.
#
# Copyright 2007-2011 by Apple Inc.
# Copyright 2007-2012 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
@@ -105,6 +105,7 @@ HELPFILES = \
help/ref-classes-conf.html \
help/ref-client-conf.html \
help/ref-cupsd-conf.html \
help/ref-cups-files-conf.html \
help/ref-error_log.html \
help/ref-mailto-conf.html \
help/ref-page_log.html \
+107
Ver Arquivo
@@ -0,0 +1,107 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<TITLE>Inici - CUPS @CUPS_VERSION@@CUPS_REVISION@</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/cups.css">
<LINK REL="SHORTCUT ICON" HREF="/images/cups-icon.png" TYPE="image/png">
</HEAD>
<BODY>
<TABLE CLASS="page" SUMMARY="{title}">
<TR><TD CLASS="body">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR HEIGHT="36">
<TD><A HREF="http://www.cups.org/" TARGET="_blank"><IMG
SRC="/images/left.gif" WIDTH="64" HEIGHT="36" BORDER="0" ALT=""></A></TD>
<TD CLASS="sel"><A HREF="/">&nbsp;&nbsp;Inici&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/admin">&nbsp;&nbsp;Administració&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/classes/">&nbsp;&nbsp;Classes&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/help/">&nbsp;&nbsp;Ajuda&nbsp;en&nbsp;línia&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/jobs/">&nbsp;&nbsp;Tasques&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/printers/">&nbsp;&nbsp;Impressores&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel" WIDTH="100%"><FORM ACTION="/help/" METHOD="GET"><INPUT
TYPE="SEARCH" NAME="QUERY" SIZE="20" PLACEHOLDER="Search Help"
AUTOSAVE="org.cups.help" RESULTS="20"></FORM></TD>
<TD><IMG SRC="/images/right.gif" WIDTH="4" HEIGHT="36" ALT=""></TD>
</TR>
</TABLE>
<TABLE CLASS="indent" SUMMARY="">
<TR><TD STYLE="padding-right: 20px;">
<H1>CUPS @CUPS_VERSION@</H1>
<P>CUPS és el sistema d'impressió de codi obert i basat en estandards desenvolupat per
<A HREF="http://www.apple.com/">Apple Inc.</A> per OS<SUP>&reg;</SUP> X and
altres sistemes operatius basats en UNIX<SUP>&reg;</SUP></P>
</TD>
<TD><A HREF="http://www.cups.org/"><IMG SRC="images/cups-icon.png" WIDTH="128"
HEIGHT="128" ALT="CUPS"></A></TD>
</TR>
</TABLE>
<TABLE CLASS="indent" SUMMARY="">
<TR><TD VALIGN="top" STYLE="border-right: dotted thin #cccccc; padding-right: 20px;">
<H2>CUPS per usuaris</H2>
<P><A HREF="help/overview.html">Descripció general del CUPS</A></P>
<P><A HREF="help/options.html">Impresió i opcions en linia de comandes</A></P>
<P><A HREF="help/whatsnew.html">Novetats del CUPS 1.4</A></P>
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Fòrum d'usuaris</A></P>
</TD><TD VALIGN="top" STYLE="border-right: dotted thin #cccccc; padding-left: 20px; padding-right: 20px;">
<H2>CUPS per Administradors</H2>
<P><A HREF="admin">Afegir impressores i classes</A></P>
<P><A HREF="help/policies.html">Gestió de les polítiques de treball</A></P>
<P><A HREF="help/accounting.html">Bàsic de comptes d'impressió</A></P>
<P><A HREF="help/security.html">Seguritat del servidor</A></P>
<P><A HREF="help/kerberos.html">Ús d'autenticació amb el Kerberos</A></P>
<P><A HREF="help/network.html">Ús d'impressores en xarxa</A></P>
<P><A HREF="help/ref-cupsd-conf.html">Referència del cupsd.conf</A></P>
<P><A HREF="http://www.cups.org/ppd.php">Cerca de controladors d'impressora</A></P>
</TD><TD VALIGN="top" STYLE="padding-left: 20px;">
<H2>CUPS per desenvolupadors</H2>
<P><A HREF="help/api-overview.html">Introducció a la programació amb CUPS</A></P>
<P><A HREF="help/api-cups.html">La API de CUPS</A></P>
<P><A HREF="help/api-filter.html">Programació de filtres i rerefons</A></P>
<P><A HREF="help/api-httpipp.html">APIs per HTTP i IPP</A></P>
<P><A HREF="help/api-ppd.html">API per PPD</A></P>
<P><A HREF="help/api-raster.html">API per Raster</A></P>
<P><A HREF="help/ref-ppdcfile.html">Referència del fitxer d'inf. del compilador del controlador per PPD</A></P>
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.development">Fòrum de desenvolupadors</A></P>
</TD></TR>
</TABLE>
</TD></TR>
<TR><TD>&nbsp;</TD></TR>
<TR><TD CLASS="trailer">CUPS i el seu logotip són marques registrades de
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS té copyright 2007-2013 d'Apple
Inc. Tots els drets reservats.</TD></TR>
</TABLE>
</BODY>
</HTML>
+107
Ver Arquivo
@@ -0,0 +1,107 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<TITLE>Hlavní strana - CUPS @CUPS_VERSION@@CUPS_REVISION@</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/cups.css">
<LINK REL="SHORTCUT ICON" HREF="/images/cups-icon.png" TYPE="image/png">
</HEAD>
<BODY>
<TABLE CLASS="page" SUMMARY="{title}">
<TR><TD CLASS="body">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR HEIGHT="36">
<TD><A HREF="http://www.cups.org/" TARGET="_blank"><IMG
SRC="/images/left.gif" WIDTH="64" HEIGHT="36" BORDER="0" ALT=""></A></TD>
<TD CLASS="sel"><A HREF="/">&nbsp;&nbsp;Hlavní strana&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/admin">&nbsp;&nbsp;Administrace&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/classes/">&nbsp;&nbsp;Třídy tiskáren&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/help/">&nbsp;&nbsp;Nápověda&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/jobs/">&nbsp;&nbsp;Úlohy&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/printers/">&nbsp;&nbsp;Tiskárny&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel" WIDTH="100%"><FORM ACTION="/help/" METHOD="GET"><INPUT
TYPE="SEARCH" NAME="QUERY" SIZE="20" PLACEHOLDER="Hledat"
AUTOSAVE="org.cups.help" RESULTS="20"></FORM></TD>
<TD><IMG SRC="/images/right.gif" WIDTH="4" HEIGHT="36" ALT=""></TD>
</TR>
</TABLE>
<TABLE CLASS="indent" SUMMARY="">
<TR><TD STYLE="padding-right: 20px;">
<H1>CUPS @CUPS_VERSION@</H1>
<P>CUPS je na bázi standardů otevřený zdrojový kód tiskového systému vyvinutý
společností <A HREF="http://www.apple.com/">Apple Inc.</A> pro Mac OS<SUP>&reg;</SUP>
X a jiné UNIX<SUP>&reg;</SUP>ové operační systémy.</P>
</TD>
<TD><A HREF="http://www.cups.org/"><IMG SRC="images/cups-icon.png" WIDTH="128"
HEIGHT="128" ALT="CUPS"></A></TD>
</TR>
</TABLE>
<TABLE CLASS="indent" SUMMARY="">
<TR><TD VALIGN="top" STYLE="border-right: dotted thin #cccccc; padding-right: 20px;">
<H2>CUPS pro uživatele</H2>
<P><A HREF="help/overview.html">Popis CUPS</A></P>
<P><A HREF="help/options.html">Příkazová řádka tisku a Možnosti</A></P>
<P><A HREF="help/whatsnew.html">Co je nového v CUPS 1.6</A></P>
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Uživatelské fórum</A></P>
</TD><TD VALIGN="top" STYLE="border-right: dotted thin #cccccc; padding-left: 20px; padding-right: 20px;">
<H2>CUPS pro administrátory</H2>
<P><A HREF="admin">Přidání tiskáren a tříd</A></P>
<P><A HREF="help/policies.html">Správa politik</A></P>
<P><A HREF="help/accounting.html">Základní účtování tiskáren</A></P>
<P><A HREF="help/security.html">Zabezpečení serveru</A></P>
<P><A HREF="help/kerberos.html">Použití ověřování pomocí protokolu Kerberos</A></P>
<P><A HREF="help/network.html">Použití síťových tiskáren</A></P>
<P><A HREF="help/ref-cupsd-conf.html">Konfigurační soubor cupsd.conf</A></P>
<P><A HREF="http://www.cups.org/ppd.php">Hedat ovladače tiskárny</A></P>
</TD><TD VALIGN="top" STYLE="padding-left: 20px;">
<H2>CUPS pro vývojáře</H2>
<P><A HREF="help/api-overview.html">Úvod do CUPS programování</A></P>
<P><A HREF="help/api-cups.html">CUPS API knihovny</A></P>
<P><A HREF="help/api-filter.html">Programování filtrů a backendů</A></P>
<P><A HREF="help/api-httpipp.html">HTTP a IPP API knihovny</A></P>
<P><A HREF="help/api-ppd.html">PPD API knihovny</A></P>
<P><A HREF="help/api-raster.html">Raster API knihovny</A></P>
<P><A HREF="help/ref-ppdcfile.html">PPD kompilátor Driver Information File Reference</A></P>
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.development">Vývojářské fórum</A></P>
</TD></TR>
</TABLE>
</TD></TR>
<TR><TD>&nbsp;</TD></TR>
<TR><TD CLASS="trailer">CUPS a logo CUPS jsou ochranné známky společnosti
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS je chráněn autorskými
právy 2007-2013 Apple Inc. Všechna práva vyhrazena.</TD></TR>
</TABLE>
</BODY>
</HTML>
+107
Ver Arquivo
@@ -0,0 +1,107 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<TITLE>Inicio - CUPS @CUPS_VERSION@@CUPS_REVISION@</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/cups.css">
<LINK REL="SHORTCUT ICON" HREF="/images/cups-icon.png" TYPE="image/png">
</HEAD>
<BODY>
<TABLE CLASS="page" SUMMARY="{title}">
<TR><TD CLASS="body">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR HEIGHT="36">
<TD><A HREF="http://www.cups.org/" TARGET="_blank"><IMG
SRC="/images/left.gif" WIDTH="64" HEIGHT="36" BORDER="0" ALT=""></A></TD>
<TD CLASS="sel"><A HREF="/">&nbsp;&nbsp;Inicio&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/admin">&nbsp;&nbsp;Administraci&oacute;n&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/classes/">&nbsp;&nbsp;Clases&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/help/">&nbsp;&nbsp;Ayuda&nbsp;en&nbsp;l&iacute;nea&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/jobs/">&nbsp;&nbsp;Trabajos&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/printers/">&nbsp;&nbsp;Impresoras&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel" WIDTH="100%"><FORM ACTION="/help/" METHOD="GET"><INPUT
TYPE="SEARCH" NAME="QUERY" SIZE="20" PLACEHOLDER="Search Help"
AUTOSAVE="org.cups.help" RESULTS="20"></FORM></TD>
<TD><IMG SRC="/images/right.gif" WIDTH="4" HEIGHT="36" ALT=""></TD>
</TR>
</TABLE>
<TABLE CLASS="indent" SUMMARY="">
<TR><TD STYLE="padding-right: 20px;">
<H1>CUPS @CUPS_VERSION@</H1>
<P>CUPS es el sistema de impresi&oacute;n de c&oacute;digo abierto basado en
est&aacute;ndares desarrollado por <A HREF="http://www.apple.com/">Apple Inc.</A> para
OS<SUP>&reg;</SUP> X y otros sistemas operativos tipo UNIX<SUP>&reg;</SUP>.</P>
</TD>
<TD><A HREF="http://www.cups.org/"><IMG SRC="images/cups-icon.png" WIDTH="128"
HEIGHT="128" ALT="CUPS"></A></TD>
</TR>
</TABLE>
<TABLE CLASS="indent" SUMMARY="">
<TR><TD VALIGN="top" STYLE="border-right: dotted thin #cccccc; padding-right: 20px;">
<H2>CUPS para usuarios</H2>
<P><A HREF="help/overview.html">Descripci&oacute;n de CUPS</A></P>
<P><A HREF="help/options.html">Impresi&oacute;n desde la l&iacute;nea de comandos y opciones</A></P>
<P><A HREF="help/whatsnew.html">Qu&eacute; hay de nuevo en CUPS 1.6</A></P>
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Foro de usuarios</A></P>
</TD><TD VALIGN="top" STYLE="border-right: dotted thin #cccccc; padding-left: 20px; padding-right: 20px;">
<H2>CUPS para administradores</H2>
<P><A HREF="admin">A&ntilde;adiendo impresoras y clases</A></P>
<P><A HREF="help/policies.html">Gestionando pol&iacute;ticas de funcionamiento</A></P>
<P><A HREF="help/accounting.html">Contabilidad b&aacute;sica de impresora</A></P>
<P><A HREF="help/security.html">Seguridad del servidor</A></P>
<P><A HREF="help/kerberos.html">Usando autentificaci&oacute;n Kerberos</A></P>
<P><A HREF="help/network.html">Usando impresoras de red</A></P>
<P><A HREF="help/ref-cupsd-conf.html">Referencia de cupsd.conf</A></P>
<P><A HREF="http://www.cups.org/ppd.php">Encontrar controladores de impresora</A></P>
</TD><TD VALIGN="top" STYLE="padding-left: 20px;">
<H2>CUPS para desarrolladores</H2>
<P><A HREF="help/api-overview.html">Introducci&oacute;n a la programaci&oacute;n de CUPS</A></P>
<P><A HREF="help/api-cups.html">La API de CUPS</A></P>
<P><A HREF="help/api-filter.html">Programaci&oacute;n de filtros y programas de conexi&oacute;n</A></P>
<P><A HREF="help/api-httpipp.html">Las APIs HTTP e IPP</A></P>
<P><A HREF="help/api-ppd.html">La API PPD</A></P>
<P><A HREF="help/api-raster.html">La API Raster</A></P>
<P><A HREF="help/ref-ppdcfile.html">Referencia del archivo de informaci&oacute;n del compilador de controladores PPD</A></P>
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.development">Foro de desarrollo</A></P>
</TD></TR>
</TABLE>
</TD></TR>
<TR><TD>&nbsp;</TD></TR>
<TR><TD CLASS="trailer">CUPS y el logo de CUPS son
marcas registradas de <A HREF="http://www.apple.com">Apple Inc.</A> Los derechos
de copia de CUPS 2007-2013 son de Apple Inc. Todos los derechos reservados.</TD></TR>
</TABLE>
</BODY>
</HTML>
+107
Ver Arquivo
@@ -0,0 +1,107 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<TITLE>Accueil - CUPS @CUPS_VERSION@@CUPS_REVISION@</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/cups.css">
<LINK REL="SHORTCUT ICON" HREF="/images/cups-icon.png" TYPE="image/png">
</HEAD>
<BODY>
<TABLE CLASS="page" SUMMARY="{title}">
<TR><TD CLASS="body">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR HEIGHT="36">
<TD><A HREF="http://www.cups.org/" TARGET="_blank"><IMG
SRC="/images/left.gif" WIDTH="64" HEIGHT="36" BORDER="0" ALT=""></A></TD>
<TD CLASS="sel"><A HREF="/">&nbsp;&nbsp;Accueil&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/admin">&nbsp;&nbsp;Administration&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/classes/">&nbsp;&nbsp;Classes&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/help/">&nbsp;&nbsp;Aide&nbsp;En&nbsp;Ligne&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/jobs/">&nbsp;&nbsp;T&acirc;ches&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel"><A HREF="/printers/">&nbsp;&nbsp;Imprimantes&nbsp;&nbsp;</A></TD>
<TD CLASS="unsel" WIDTH="100%"><FORM ACTION="/help/" METHOD="GET"><INPUT
TYPE="SEARCH" NAME="QUERY" SIZE="20" PLACEHOLDER="Search Help"
AUTOSAVE="org.cups.help" RESULTS="20"></FORM></TD>
<TD><IMG SRC="/images/right.gif" WIDTH="4" HEIGHT="36" ALT=""></TD>
</TR>
</TABLE>
<TABLE CLASS="indent" SUMMARY="">
<TR><TD STYLE="padding-right: 20px;">
<H1>CUPS @CUPS_VERSION@</H1>
<P>CUPS est le syst&egrave;me d'impression Open Source, bas&eacute; sur des standards, d&eacute;velopp&eacute; par
<A HREF="http://www.apple.com/">Apple Inc.</A> pour Mac OS<SUP>&reg;</SUP> X et
les autres OS UNIX<SUP>&reg;</SUP>-like.</P>
</TD>
<TD><A HREF="http://www.cups.org/"><IMG SRC="images/cups-icon.png" WIDTH="128"
HEIGHT="128" ALT="CUPS"></A></TD>
</TR>
</TABLE>
<TABLE CLASS="indent" SUMMARY="">
<TR><TD VALIGN="top" STYLE="border-right: dotted thin #cccccc; padding-right: 20px;">
<H2>CUPS pour les utilisateurs</H2>
<P><A HREF="help/overview.html">Pr&eacute;sentation de CUPS</A></P>
<P><A HREF="help/options.html">Impression en ligne de commande et options</A></P>
<P><A HREF="help/whatsnew.html">Quoi de neuf dans CUPS 1.6</A></P>
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Forum utilisateur</A></P>
</TD><TD VALIGN="top" STYLE="border-right: dotted thin #cccccc; padding-left: 20px; padding-right: 20px;">
<H2>CUPS pour les administrateurs</H2>
<P><A HREF="admin">Ajout d'imprimantes et de classes</A></P>
<P><A HREF="help/policies.html">G&eacute;rer les politiques</A></P>
<P><A HREF="help/accounting.html">Printer Accounting Basics</A></P>
<P><A HREF="help/security.html">S&eacute;curit&eacute; du serveur</A></P>
<P><A HREF="help/kerberos.html">Utiliser l'authentification Kerberos</A></P>
<P><A HREF="help/network.html">Utiliser des imprimantes r&eacute;seaux</A></P>
<P><A HREF="help/ref-cupsd-conf.html">R&eacute;f&eacute;rences sur cupsd.conf</A></P>
<P><A HREF="http://www.cups.org/ppd.php">Trouver des pilotes d'imprimantes</A></P>
</TD><TD VALIGN="top" STYLE="padding-left: 20px;">
<H2>CUPS pour les d&eacute;veloppeurs</H2>
<P><A HREF="help/api-overview.html">Introduction &agrave; la programmation CUPS</A></P>
<P><A HREF="help/api-cups.html">L'API CUPS</A></P>
<P><A HREF="help/api-filter.html">Programmation de filtres et de backends</A></P>
<P><A HREF="help/api-httpipp.html">Les API HTTP et IPP</A></P>
<P><A HREF="help/api-ppd.html">L'API PPD</A></P>
<P><A HREF="help/api-raster.html">L'API Raster</A></P>
<P><A HREF="help/ref-ppdcfile.html">PPD Compiler Driver Information File Reference</A></P>
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.development">Forum d&eacute;veloppeurs</A></P>
</TD></TR>
</TABLE>
</TD></TR>
<TR><TD>&nbsp;</TD></TR>
<TR><TD CLASS="trailer">CUPS et le logo CUPS sont des marques d&eacute;pos&eacute;es de
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS est sous copyright 2007-2013 Apple
Inc. Tous droits r&eacute;serv&eacute;s.</TD></TR>
</TABLE>
</BODY>
</HTML>
+2 -2
Ver Arquivo
@@ -341,7 +341,7 @@ div.contents ul.subcontents li {
<body>
<div class='body'>
<!--
"$Id$"
"$Id: api-array.header 7266 2008-01-29 02:15:29Z mike $"
Array API header for CUPS.
@@ -413,7 +413,7 @@ div.contents ul.subcontents li {
</ul></li>
</ul>
<!--
"$Id$"
"$Id: api-array.shtml 7616 2008-05-28 00:34:13Z mike $"
Array API introduction for CUPS.
+2 -2
Ver Arquivo
@@ -341,7 +341,7 @@ div.contents ul.subcontents li {
<body>
<div class='body'>
<!--
"$Id$"
"$Id: api-array.header 8087 2008-10-27 21:37:05Z mike $"
CGI API header for CUPS.
@@ -437,7 +437,7 @@ by the template file.">cgiGetAttributes</a></li>
</ul></li>
</ul>
<!--
"$Id$"
"$Id: api-array.shtml 7616 2008-05-28 00:34:13Z mike $"
CGI API introduction for CUPS.
+462 -25
Ver Arquivo
@@ -341,7 +341,7 @@ div.contents ul.subcontents li {
<body>
<div class='body'>
<!--
"$Id$"
"$Id: api-cups.header 7279 2008-01-31 01:50:44Z mike $"
CUPS API header for CUPS.
@@ -391,23 +391,34 @@ div.contents ul.subcontents li {
<li><a href="#PASSWORDS_AND_AUTHENTICATION">Passwords and Authentication</a></li>
</ul></li>
<li><a href="#FUNCTIONS">Functions</a><ul class="code">
<li><a href="#appleGetPaperSize" title="Get the default paper size.">appleGetPaperSize</a></li>
<li><a href="#cupsAddDest" title="Add a destination to the list of destinations.">cupsAddDest</a></li>
<li><a href="#cupsAddOption" title="Add an option to an option array.">cupsAddOption</a></li>
<li><a href="#cupsAdminCreateWindowsPPD" title="Create the Windows PPD file for a printer.">cupsAdminCreateWindowsPPD</a></li>
<li><a href="#cupsAdminExportSamba" title="Export a printer to Samba.">cupsAdminExportSamba</a></li>
<li><a href="#cupsAdminGetServerSettings" title="Get settings from the server.">cupsAdminGetServerSettings</a></li>
<li><a href="#cupsAdminSetServerSettings" title="Set settings on the server.">cupsAdminSetServerSettings</a></li>
<li><a href="#cupsCancelDestJob" title="Include necessary headers...">cupsCancelDestJob</a></li>
<li><a href="#cupsCancelJob" title="Cancel a print job on the default server.">cupsCancelJob</a></li>
<li><a href="#cupsCancelJob2" title="Cancel or purge a print job.">cupsCancelJob2</a></li>
<li><a href="#cupsCheckDestSupported" title="Check that the option and value are supported
by the destination.">cupsCheckDestSupported</a></li>
<li><a href="#cupsCloseDestJob" title="Close a job and start printing.">cupsCloseDestJob</a></li>
<li><a href="#cupsConnectDest" title="Connect to the server for a destination.">cupsConnectDest</a></li>
<li><a href="#cupsConnectDestBlock" title="Connect to the server for a destination.">cupsConnectDestBlock</a></li>
<li><a href="#cupsCopyDest" title="Callback block">cupsCopyDest</a></li>
<li><a href="#cupsCopyDestConflicts" title="Get conflicts and resolutions for a new
option/value pair.">cupsCopyDestConflicts</a></li>
<li><a href="#cupsCopyDestInfo" title="Get the supported values/capabilities for the
destination.">cupsCopyDestInfo</a></li>
<li><a href="#cupsCreateDestJob" title="Create a job on a destination.">cupsCreateDestJob</a></li>
<li><a href="#cupsCreateJob" title="Create an empty job for streaming.">cupsCreateJob</a></li>
<li><a href="#cupsEncryption" title="Get the current encryption settings.">cupsEncryption</a></li>
<li><a href="#cupsEnumDests" title="Enumerate available destinations with a callback function.">cupsEnumDests</a></li>
<li><a href="#cupsEnumDestsBlock" title="Enumerate available destinations with a block.">cupsEnumDestsBlock</a></li>
<li><a href="#cupsFinishDestDocument" title="Finish the current document.">cupsFinishDestDocument</a></li>
<li><a href="#cupsFinishDocument" title="Finish sending a document.">cupsFinishDocument</a></li>
<li><a href="#cupsFreeDestInfo" title="Free destination information obtained using
cupsCopyDestInfo.">cupsFreeDestInfo</a></li>
<li><a href="#cupsFreeDests" title="Free the memory used by the list of destinations.">cupsFreeDests</a></li>
<li><a href="#cupsFreeJobs" title="Free memory used by job data.">cupsFreeJobs</a></li>
<li><a href="#cupsFreeOptions" title="Free all memory used by options.">cupsFreeOptions</a></li>
@@ -415,6 +426,8 @@ div.contents ul.subcontents li {
<li><a href="#cupsGetDefault" title="Get the default printer or class for the default server.">cupsGetDefault</a></li>
<li><a href="#cupsGetDefault2" title="Get the default printer or class for the specified server.">cupsGetDefault2</a></li>
<li><a href="#cupsGetDest" title="Get the named destination from the list.">cupsGetDest</a></li>
<li><a href="#cupsGetDestMediaByName" title="Get media names, dimensions, and margins.">cupsGetDestMediaByName</a></li>
<li><a href="#cupsGetDestMediaBySize" title="Get media names, dimensions, and margins.">cupsGetDestMediaBySize</a></li>
<li><a href="#cupsGetDests" title="Get the list of destinations from the default server.">cupsGetDests</a></li>
<li><a href="#cupsGetDests2" title="Get the list of destinations from the specified server.">cupsGetDests2</a></li>
<li><a href="#cupsGetJobs" title="Get the jobs from the default server.">cupsGetJobs</a></li>
@@ -436,6 +449,10 @@ for the given language.">cupsLangEncoding</a></li>
<li><a href="#cupsLangFlush" title="Flush all language data out of the cache.">cupsLangFlush</a></li>
<li><a href="#cupsLangFree" title="Free language data.">cupsLangFree</a></li>
<li><a href="#cupsLangGet" title="Get a language.">cupsLangGet</a></li>
<li><a href="#cupsLocalizeDestOption" title="Get the localized string for a destination
option.">cupsLocalizeDestOption</a></li>
<li><a href="#cupsLocalizeDestValue" title="Get the localized string for a destination
option+value pair.">cupsLocalizeDestValue</a></li>
<li><a href="#cupsNotifySubject" title="Return the subject for the given notification message.">cupsNotifySubject</a></li>
<li><a href="#cupsNotifyText" title="Return the text for the given notification message.">cupsNotifyText</a></li>
<li><a href="#cupsParseOptions" title="Parse options from a command-line argument.">cupsParseOptions</a></li>
@@ -461,6 +478,7 @@ connections.">cupsSetCredentials</a></li>
<li><a href="#cupsSetServer" title="Set the default server name and port.">cupsSetServer</a></li>
<li><a href="#cupsSetServerCertCB" title="Set the server certificate callback.">cupsSetServerCertCB</a></li>
<li><a href="#cupsSetUser" title="Set the default user name.">cupsSetUser</a></li>
<li><a href="#cupsStartDestDocument" title="Start a new document.">cupsStartDestDocument</a></li>
<li><a href="#cupsStartDocument" title="Add a document to a job created with cupsCreateJob().">cupsStartDocument</a></li>
<li><a href="#cupsTempFd" title="Creates a temporary file.">cupsTempFd</a></li>
<li><a href="#cupsTempFile" title="Generates a temporary filename.">cupsTempFile</a></li>
@@ -506,11 +524,11 @@ constants">cups_ptype_e</a></li>
</ul></li>
</ul>
<!--
"$Id$"
"$Id: api-cups.shtml 7337 2008-02-22 04:44:04Z mike $"
API introduction for CUPS.
Copyright 2007-2011 by Apple Inc.
Copyright 2007-2013 by Apple Inc.
Copyright 1997-2006 by Easy Software Products, all rights reserved.
These coded instructions, statements, and computer programs are the
@@ -690,7 +708,7 @@ int num_options = 0;
<a href='#cups_option_t'>cups_option_t</a> *options = NULL;
<a href='#cups_dest_t'>cups_dest_t</a> *dest;
for (i = 0; i < dest->num_options; i ++)
for (i = 0; i &lt; dest->num_options; i ++)
num_options = <a href='#cupsAddOption'>cupsAddOption</a>(dest->options[i].name, dest->options[i].value,
num_options, &amp;options);
</pre>
@@ -742,7 +760,7 @@ job_id = <a href='#cupsPrintFiles'>cupsPrintFiles</a>(dest->name, 3, files, "Tes
<p>Finally, the <a href='#cupsCreateJob'><code>cupsCreateJob</code></a>
function creates a new job with no files in it. Files are added using the
<a href='#cupsStartDocument'><code>cupsStartDocument</code></a>,
<a href='#cupsStartDocument'><code>cupsStartDocument</code></a>,
<a href='api-httpipp.html#cupsWriteRequestData'><code>cupsWriteRequestData</code></a>,
and <a href='#cupsFinishDocument'><code>cupsFinishDocument</code></a> functions.
The following example creates a job with 10 text files for printing:</p>
@@ -806,7 +824,7 @@ int num_jobs;
<a href='#cups_job_t'>cups_job_t</a> *jobs;
int i;
ipp_jstate_t job_state = IPP_JOB_PENDING;
while (job_state &lt; IPP_JOB_STOPPED)
{
/* Get my jobs (1) with any state (-1) */
@@ -949,22 +967,6 @@ fields for the username and password. The username should default to the
string returned by the <a href="#cupsUser"><code>cupsUser</code></a>
function.</p>
<h2 class="title"><a name="FUNCTIONS">Functions</a></h2>
<h3 class="function"><a name="appleGetPaperSize">appleGetPaperSize</a></h3>
<p class="description">Get the default paper size.</p>
<p class="code">
char *appleGetPaperSize (<br>
&nbsp;&nbsp;&nbsp;&nbsp;char *name,<br>
&nbsp;&nbsp;&nbsp;&nbsp;int namesize<br>
);</p>
<h4 class="parameters">Parameters</h4>
<dl>
<dt>name</dt>
<dd class="description">Paper size name buffer</dd>
<dt>namesize</dt>
<dd class="description">Size of buffer</dd>
</dl>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Default paper size</p>
<h3 class="function"><a name="cupsAddDest">cupsAddDest</a></h3>
<p class="description">Add a destination to the list of destinations.</p>
<p class="code">
@@ -1023,7 +1025,7 @@ int cupsAddOption (<br>
<h4 class="discussion">Discussion</h4>
<p class="discussion">New option arrays can be initialized simply by passing 0 for the
&quot;num_options&quot; parameter.</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="cupsAdminCreateWindowsPPD">cupsAdminCreateWindowsPPD</a></h3>
<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="cupsAdminCreateWindowsPPD">cupsAdminCreateWindowsPPD</a></h3>
<p class="description">Create the Windows PPD file for a printer.</p>
<p class="code">
char *cupsAdminCreateWindowsPPD (<br>
@@ -1045,7 +1047,7 @@ char *cupsAdminCreateWindowsPPD (<br>
</dl>
<h4 class="returnvalue">Return Value</h4>
<p class="description">PPD file or NULL</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="cupsAdminExportSamba">cupsAdminExportSamba</a></h3>
<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="cupsAdminExportSamba">cupsAdminExportSamba</a></h3>
<p class="description">Export a printer to Samba.</p>
<p class="code">
int cupsAdminExportSamba (<br>
@@ -1116,6 +1118,31 @@ int cupsAdminSetServerSettings (<br>
</dl>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on failure</p>
<h3 class="function"><a name="cupsCancelDestJob">cupsCancelDestJob</a></h3>
<p class="description">Include necessary headers...</p>
<p class="code">
ipp_status_t cupsCancelDestJob (<br>
&nbsp;&nbsp;&nbsp;&nbsp;http_t *http,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
&nbsp;&nbsp;&nbsp;&nbsp;int job_id<br>
);</p>
<h4 class="parameters">Parameters</h4>
<dl>
<dt>http</dt>
<dd class="description">Connection to destination</dd>
<dt>dest</dt>
<dd class="description">Destination</dd>
<dt>job_id</dt>
<dd class="description">Job ID</dd>
</dl>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Cancel a job on a destination.</p>
<p class="discussion">The &quot;job_id&quot; is the number returned by cupsCreateDestJob.<br>
<br>
Returns IPP_OK on success and IPP_NOT_AUTHORIZED or IPP_FORBIDDEN on
failure.
</p>
<h3 class="function"><a name="cupsCancelJob">cupsCancelJob</a></h3>
<p class="description">Cancel a print job on the default server.</p>
<p class="code">
@@ -1170,6 +1197,64 @@ to cancel the current job on the named destination.<br>
Use the <a href="#cupsLastError"><code>cupsLastError</code></a> and <a href="#cupsLastErrorString"><code>cupsLastErrorString</code></a> functions to get
the cause of any failure.
</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="cupsCheckDestSupported">cupsCheckDestSupported</a></h3>
<p class="description">Check that the option and value are supported
by the destination.</p>
<p class="code">
int cupsCheckDestSupported (<br>
&nbsp;&nbsp;&nbsp;&nbsp;http_t *http,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
&nbsp;&nbsp;&nbsp;&nbsp;const char *option,<br>
&nbsp;&nbsp;&nbsp;&nbsp;const char *value<br>
);</p>
<h4 class="parameters">Parameters</h4>
<dl>
<dt>http</dt>
<dd class="description">Connection to destination</dd>
<dt>dest</dt>
<dd class="description">Destination</dd>
<dt>dinfo</dt>
<dd class="description">Destination information</dd>
<dt>option</dt>
<dd class="description">Option</dd>
<dt>value</dt>
<dd class="description">Value</dd>
</dl>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 if supported, 0 otherwise</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Returns 1 if supported, 0 otherwise.
</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="cupsCloseDestJob">cupsCloseDestJob</a></h3>
<p class="description">Close a job and start printing.</p>
<p class="code">
ipp_status_t cupsCloseDestJob (<br>
&nbsp;&nbsp;&nbsp;&nbsp;http_t *http,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_dinfo_t">cups_dinfo_t</a> *info,<br>
&nbsp;&nbsp;&nbsp;&nbsp;int job_id<br>
);</p>
<h4 class="parameters">Parameters</h4>
<dl>
<dt>http</dt>
<dd class="description">Connection to destination</dd>
<dt>dest</dt>
<dd class="description">Destination</dd>
<dt>info</dt>
<dd class="description">Destination information</dd>
<dt>job_id</dt>
<dd class="description">Job ID</dd>
</dl>
<h4 class="returnvalue">Return Value</h4>
<p class="description">IPP status code</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Use when the last call to cupsStartDocument passed 0 for &quot;last_document&quot;.
&quot;job_id&quot; is the job ID returned by cupsCreateDestJob. Returns <code>IPP_OK</code>
on success.
</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="cupsConnectDest">cupsConnectDest</a></h3>
<p class="description">Connect to the server for a destination.</p>
@@ -1272,6 +1357,125 @@ int cupsCopyDest (<br>
copy) - for use with the cupsEnumDests* functions. The caller is responsible
for calling cupsFreeDests() on the returned object(s).
</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="cupsCopyDestConflicts">cupsCopyDestConflicts</a></h3>
<p class="description">Get conflicts and resolutions for a new
option/value pair.</p>
<p class="code">
int cupsCopyDestConflicts (<br>
&nbsp;&nbsp;&nbsp;&nbsp;http_t *http,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
&nbsp;&nbsp;&nbsp;&nbsp;int num_options,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_option_t">cups_option_t</a> *options,<br>
&nbsp;&nbsp;&nbsp;&nbsp;const char *new_option,<br>
&nbsp;&nbsp;&nbsp;&nbsp;const char *new_value,<br>
&nbsp;&nbsp;&nbsp;&nbsp;int *num_conflicts,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_option_t">cups_option_t</a> **conflicts,<br>
&nbsp;&nbsp;&nbsp;&nbsp;int *num_resolved,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_option_t">cups_option_t</a> **resolved<br>
);</p>
<h4 class="parameters">Parameters</h4>
<dl>
<dt>http</dt>
<dd class="description">Connection to destination</dd>
<dt>dest</dt>
<dd class="description">Destination</dd>
<dt>dinfo</dt>
<dd class="description">Destination information</dd>
<dt>num_options</dt>
<dd class="description">Number of current options</dd>
<dt>options</dt>
<dd class="description">Current options</dd>
<dt>new_option</dt>
<dd class="description">New option</dd>
<dt>new_value</dt>
<dd class="description">New value</dd>
<dt>num_conflicts</dt>
<dd class="description">Number of conflicting options</dd>
<dt>conflicts</dt>
<dd class="description">Conflicting options</dd>
<dt>num_resolved</dt>
<dd class="description">Number of options to resolve</dd>
<dt>resolved</dt>
<dd class="description">Resolved options</dd>
</dl>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 if there is a conflict, 0 if none, -1 on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">&quot;num_options&quot; and &quot;options&quot; represent the currently selected options by the
user. &quot;new_option&quot; and &quot;new_value&quot; are the setting the user has just
changed.<br>
<br>
Returns 1 if there is a conflict, 0 if there are no conflicts, and -1 if
there was an unrecoverable error such as a resolver loop.<br>
<br>
If &quot;num_conflicts&quot; and &quot;conflicts&quot; are not <code>NULL</code>, they are set to
contain the list of conflicting option/value pairs. Similarly, if
&quot;num_resolved&quot; and &quot;resolved&quot; are not <code>NULL</code> they will be set to the
list of changes needed to resolve the conflict.<br>
<br>
If cupsCopyDestConflicts returns 1 but &quot;num_resolved&quot; and &quot;resolved&quot; are set
to 0 and <code>NULL</code>, respectively, then the conflict cannot be resolved.
</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="cupsCopyDestInfo">cupsCopyDestInfo</a></h3>
<p class="description">Get the supported values/capabilities for the
destination.</p>
<p class="code">
<a href="#cups_dinfo_t">cups_dinfo_t</a> *cupsCopyDestInfo (<br>
&nbsp;&nbsp;&nbsp;&nbsp;http_t *http,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_dest_t">cups_dest_t</a> *dest<br>
);</p>
<h4 class="parameters">Parameters</h4>
<dl>
<dt>http</dt>
<dd class="description">Connection to destination</dd>
<dt>dest</dt>
<dd class="description">Destination</dd>
</dl>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Destination information</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The caller is responsible for calling <a href="#cupsFreeDestInfo"><code>cupsFreeDestInfo</code></a> on the return
value. <code>NULL</code> is returned on error.
</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="cupsCreateDestJob">cupsCreateDestJob</a></h3>
<p class="description">Create a job on a destination.</p>
<p class="code">
ipp_status_t cupsCreateDestJob (<br>
&nbsp;&nbsp;&nbsp;&nbsp;http_t *http,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_dinfo_t">cups_dinfo_t</a> *info,<br>
&nbsp;&nbsp;&nbsp;&nbsp;int *job_id,<br>
&nbsp;&nbsp;&nbsp;&nbsp;const char *title,<br>
&nbsp;&nbsp;&nbsp;&nbsp;int num_options,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_option_t">cups_option_t</a> *options<br>
);</p>
<h4 class="parameters">Parameters</h4>
<dl>
<dt>http</dt>
<dd class="description">Connection to destination</dd>
<dt>dest</dt>
<dd class="description">Destination</dd>
<dt>info</dt>
<dd class="description">Destination information</dd>
<dt>job_id</dt>
<dd class="description">Job ID or 0 on error</dd>
<dt>title</dt>
<dd class="description">Job name</dd>
<dt>num_options</dt>
<dd class="description">Number of job options</dd>
<dt>options</dt>
<dd class="description">Job options</dd>
</dl>
<h4 class="returnvalue">Return Value</h4>
<p class="description">IPP status code</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Returns <code>IPP_OK</code> or <code>IPP_OK_SUBST</code> on success, saving the job ID
in the variable pointed to by &quot;job_id&quot;.
</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.4/OS X 10.6&nbsp;</span><a name="cupsCreateJob">cupsCreateJob</a></h3>
<p class="description">Create an empty job for streaming.</p>
@@ -1401,6 +1605,29 @@ continue enumeration or 0 to stop.<br>
Enumeration happens on the current thread and does not return until all
destinations have been enumerated or the block returns 0.
</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="cupsFinishDestDocument">cupsFinishDestDocument</a></h3>
<p class="description">Finish the current document.</p>
<p class="code">
ipp_status_t cupsFinishDestDocument (<br>
&nbsp;&nbsp;&nbsp;&nbsp;http_t *http,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_dinfo_t">cups_dinfo_t</a> *info<br>
);</p>
<h4 class="parameters">Parameters</h4>
<dl>
<dt>http</dt>
<dd class="description">Connection to destination</dd>
<dt>dest</dt>
<dd class="description">Destination</dd>
<dt>info</dt>
<dd class="description">Destination information</dd>
</dl>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Status of document submission</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Returns <code>IPP_OK</code> or <code>IPP_OK_SUBST</code> on success.
</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.4/OS X 10.6&nbsp;</span><a name="cupsFinishDocument">cupsFinishDocument</a></h3>
<p class="description">Finish sending a document.</p>
@@ -1422,6 +1649,18 @@ ipp_status_t cupsFinishDocument (<br>
<p class="discussion">The document must have been started using <a href="#cupsStartDocument"><code>cupsStartDocument</code></a>.
</p>
<h3 class="function"><a name="cupsFreeDestInfo">cupsFreeDestInfo</a></h3>
<p class="description">Free destination information obtained using
<a href="#cupsCopyDestInfo"><code>cupsCopyDestInfo</code></a>.</p>
<p class="code">
void cupsFreeDestInfo (<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo<br>
);</p>
<h4 class="parameters">Parameters</h4>
<dl>
<dt>dinfo</dt>
<dd class="description">Destination information</dd>
</dl>
<h3 class="function"><a name="cupsFreeDests">cupsFreeDests</a></h3>
<p class="description">Free the memory used by the list of destinations.</p>
<p class="code">
@@ -1541,6 +1780,99 @@ not support the lpoptions-defined default printer.
<h4 class="discussion">Discussion</h4>
<p class="discussion">Use the <a href="#cupsGetDests"><code>cupsGetDests</code></a> or <a href="#cupsGetDests2"><code>cupsGetDests2</code></a> functions to get a
list of supported destinations for the current user.</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="cupsGetDestMediaByName">cupsGetDestMediaByName</a></h3>
<p class="description">Get media names, dimensions, and margins.</p>
<p class="code">
int cupsGetDestMediaByName (<br>
&nbsp;&nbsp;&nbsp;&nbsp;http_t *http,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
&nbsp;&nbsp;&nbsp;&nbsp;const char *media,<br>
&nbsp;&nbsp;&nbsp;&nbsp;unsigned flags,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_size_t">cups_size_t</a> *size<br>
);</p>
<h4 class="parameters">Parameters</h4>
<dl>
<dt>http</dt>
<dd class="description">Connection to destination</dd>
<dt>dest</dt>
<dd class="description">Destination</dd>
<dt>dinfo</dt>
<dd class="description">Destination information</dd>
<dt>media</dt>
<dd class="description">Media name</dd>
<dt>flags</dt>
<dd class="description">Media matching flags</dd>
<dt>size</dt>
<dd class="description">Media size information</dd>
</dl>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on match, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;media&quot; string is a PWG media name. &quot;Flags&quot; provides some matching
guidance (multiple flags can be combined):<br>
<br>
CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer,
CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size,
CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing,
CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and
CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the
size amongst the &quot;ready&quot; media.<br>
<br>
The matching result (if any) is returned in the &quot;cups_size_t&quot; structure.<br>
<br>
Returns 1 when there is a match and 0 if there is not a match.
</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></h3>
<p class="description">Get media names, dimensions, and margins.</p>
<p class="code">
int cupsGetDestMediaBySize (<br>
&nbsp;&nbsp;&nbsp;&nbsp;http_t *http,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
&nbsp;&nbsp;&nbsp;&nbsp;int width,<br>
&nbsp;&nbsp;&nbsp;&nbsp;int length,<br>
&nbsp;&nbsp;&nbsp;&nbsp;unsigned flags,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_size_t">cups_size_t</a> *size<br>
);</p>
<h4 class="parameters">Parameters</h4>
<dl>
<dt>http</dt>
<dd class="description">Connection to destination</dd>
<dt>dest</dt>
<dd class="description">Destination</dd>
<dt>dinfo</dt>
<dd class="description">Destination information</dd>
<dt>width</dt>
<dd class="description">Media width in hundredths of
of millimeters</dd>
<dt>length</dt>
<dd class="description">Media length in hundredths of
of millimeters</dd>
<dt>flags</dt>
<dd class="description">Media matching flags</dd>
<dt>size</dt>
<dd class="description">Media size information</dd>
</dl>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on match, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">&quot;Width&quot; and &quot;length&quot; are the dimensions in hundredths of millimeters.
&quot;Flags&quot; provides some matching guidance (multiple flags can be combined):<br>
<br>
CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer,
CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size,
CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing,
CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and
CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the
size amongst the &quot;ready&quot; media.<br>
<br>
The matching result (if any) is returned in the &quot;cups_size_t&quot; structure.<br>
<br>
Returns 1 when there is a match and 0 if there is not a match.
</p>
<h3 class="function"><a name="cupsGetDests">cupsGetDests</a></h3>
<p class="description">Get the list of destinations from the default server.</p>
<p class="code">
@@ -1945,6 +2277,65 @@ cups_lang_t *cupsLangGet (<br>
</dl>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Language data</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="cupsLocalizeDestOption">cupsLocalizeDestOption</a></h3>
<p class="description">Get the localized string for a destination
option.</p>
<p class="code">
const char *cupsLocalizeDestOption (<br>
&nbsp;&nbsp;&nbsp;&nbsp;http_t *http,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
&nbsp;&nbsp;&nbsp;&nbsp;const char *option<br>
);</p>
<h4 class="parameters">Parameters</h4>
<dl>
<dt>http</dt>
<dd class="description">Connection to destination</dd>
<dt>dest</dt>
<dd class="description">Destination</dd>
<dt>dinfo</dt>
<dd class="description">Destination information</dd>
<dt>option</dt>
<dd class="description">Option to localize</dd>
</dl>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Localized string</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The returned string is stored in the destination information and will become
invalid if the destination information is deleted.
</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="cupsLocalizeDestValue">cupsLocalizeDestValue</a></h3>
<p class="description">Get the localized string for a destination
option+value pair.</p>
<p class="code">
const char *cupsLocalizeDestValue (<br>
&nbsp;&nbsp;&nbsp;&nbsp;http_t *http,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
&nbsp;&nbsp;&nbsp;&nbsp;const char *option,<br>
&nbsp;&nbsp;&nbsp;&nbsp;const char *value<br>
);</p>
<h4 class="parameters">Parameters</h4>
<dl>
<dt>http</dt>
<dd class="description">Connection to destination</dd>
<dt>dest</dt>
<dd class="description">Destination</dd>
<dt>dinfo</dt>
<dd class="description">Destination information</dd>
<dt>option</dt>
<dd class="description">Option to localize</dd>
<dt>value</dt>
<dd class="description">Value to localize</dd>
</dl>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Localized string</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The returned string is stored in the destination information and will become
invalid if the destination information is deleted.
</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="cupsNotifySubject">cupsNotifySubject</a></h3>
<p class="description">Return the subject for the given notification message.</p>
<p class="code">
@@ -2420,6 +2811,52 @@ void cupsSetUser (<br>
Note: The current user name is tracked separately for each thread in a
program. Multi-threaded programs that override the user name need to do so
in each thread for the same user name to be used.</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="cupsStartDestDocument">cupsStartDestDocument</a></h3>
<p class="description">Start a new document.</p>
<p class="code">
http_status_t cupsStartDestDocument (<br>
&nbsp;&nbsp;&nbsp;&nbsp;http_t *http,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_dinfo_t">cups_dinfo_t</a> *info,<br>
&nbsp;&nbsp;&nbsp;&nbsp;int job_id,<br>
&nbsp;&nbsp;&nbsp;&nbsp;const char *docname,<br>
&nbsp;&nbsp;&nbsp;&nbsp;const char *format,<br>
&nbsp;&nbsp;&nbsp;&nbsp;int num_options,<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#cups_option_t">cups_option_t</a> *options,<br>
&nbsp;&nbsp;&nbsp;&nbsp;int last_document<br>
);</p>
<h4 class="parameters">Parameters</h4>
<dl>
<dt>http</dt>
<dd class="description">Connection to destination</dd>
<dt>dest</dt>
<dd class="description">Destination</dd>
<dt>info</dt>
<dd class="description">Destination information</dd>
<dt>job_id</dt>
<dd class="description">Job ID</dd>
<dt>docname</dt>
<dd class="description">Document name</dd>
<dt>format</dt>
<dd class="description">Document format</dd>
<dt>num_options</dt>
<dd class="description">Number of document options</dd>
<dt>options</dt>
<dd class="description">Document options</dd>
<dt>last_document</dt>
<dd class="description">1 if this is the last document</dd>
</dl>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Status of document creation</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">&quot;job_id&quot; is the job ID returned by cupsCreateDestJob. &quot;docname&quot; is the name
of the document/file being printed, &quot;format&quot; is the MIME media type for the
document (see CUPS_FORMAT_xxx constants), and &quot;num_options&quot; and &quot;options&quot;
are the options do be applied to the document. &quot;last_document&quot; should be 1
if this is the last document to be submitted in the job. Returns
<code>HTTP_CONTINUE</code> on success.
</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.4/OS X 10.6&nbsp;</span><a name="cupsStartDocument">cupsStartDocument</a></h3>
<p class="description">Add a document to a job created with cupsCreateJob().</p>
<p class="code">
+2 -2
Ver Arquivo
@@ -341,7 +341,7 @@ div.contents ul.subcontents li {
<body>
<div class='body'>
<!--
"$Id$"
"$Id: api-filedir.header 7279 2008-01-31 01:50:44Z mike $"
File and Directory API header for CUPS.
@@ -424,7 +424,7 @@ file.">cupsFileRewind</a></li>
</ul></li>
</ul>
<!--
"$Id$"
"$Id: api-filedir.shtml 7279 2008-01-31 01:50:44Z mike $"
File and directory API introduction for CUPS.
+5 -5
Ver Arquivo
@@ -341,7 +341,7 @@ div.contents ul.subcontents li {
<body>
<div class='body'>
<!--
"$Id$"
"$Id: api-filter.header 7616 2008-05-28 00:34:13Z mike $"
Filter and backend programming header for CUPS.
@@ -426,11 +426,11 @@ div.contents ul.subcontents li {
</ul></li>
</ul>
<!--
"$Id$"
"$Id: api-filter.shtml 7677 2008-06-19 23:22:19Z mike $"
Filter and backend programming introduction for CUPS.
Copyright 2007-2012 by Apple Inc.
Copyright 2007-2013 by Apple Inc.
Copyright 1997-2006 by Easy Software Products, all rights reserved.
These coded instructions, statements, and computer programs are the
@@ -915,7 +915,7 @@ from localizing the vendor-prefixed keyword in the PPD file - otherwise both
the generic and vendor-specific keyword will be shown in the user
interface.</p>
</blockquote></dd>
</blockquote>
<h4><a name="REPORTING_SUPPLIES">Reporting Supply Levels</a></h4>
@@ -1040,7 +1040,7 @@ datalen = sizeof(data) - 1;
status = <a href="#cupsSideChannelDoRequest">cupsSideChannelDoRequest</a>(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)
if (status == CUPS_SC_STATUS_OK &amp;&amp; datalen > 0)
data[datalen] = '\0';
else
data[0] = '\0';
+37 -27
Ver Arquivo
@@ -341,7 +341,7 @@ div.contents ul.subcontents li {
<body>
<div class='body'>
<!--
"$Id$"
"$Id: api-httpipp.header 7258 2008-01-28 00:15:05Z mike $"
HTTP and IPP API header for CUPS.
@@ -395,8 +395,10 @@ div.contents ul.subcontents li {
<li><a href="#cupsGetFd" title="Get a file from the server.">cupsGetFd</a></li>
<li><a href="#cupsGetFile" title="Get a file from the server.">cupsGetFile</a></li>
<li><a href="#cupsGetResponse" title="Get a response to an IPP request.">cupsGetResponse</a></li>
<li><a href="#cupsLastError" title="Return the last IPP status code.">cupsLastError</a></li>
<li><a href="#cupsLastErrorString" title="Return the last IPP status-message.">cupsLastErrorString</a></li>
<li><a href="#cupsLastError" title="Return the last IPP status code received on the current
thread.">cupsLastError</a></li>
<li><a href="#cupsLastErrorString" title="Return the last IPP status-message received on the
current thread.">cupsLastErrorString</a></li>
<li><a href="#cupsPutFd" title="Put a file on the server.">cupsPutFd</a></li>
<li><a href="#cupsPutFile" title="Put a file on the server.">cupsPutFile</a></li>
<li><a href="#cupsReadResponseData" title="Read additional data after the IPP response.">cupsReadResponseData</a></li>
@@ -646,7 +648,7 @@ are server-oriented...">http_state_e</a></li>
</ul></li>
</ul>
<!--
"$Id$"
"$Id: api-httpipp.shtml 7684 2008-06-23 16:47:38Z mike $"
HTTP and IPP API introduction for CUPS.
@@ -1010,9 +1012,9 @@ status, prior to resubmitting your request.
<h4 class="returnvalue">Return Value</h4>
<p class="description">Response data</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function sends the IPP request to the specified server, retrying
and authenticating as necessary. The request is freed with <a href="#ippDelete"><code>ippDelete</code></a>
after receiving a valid IPP response.</p>
<p class="discussion">This function sends the IPP request and attached file to the specified
server, retrying and authenticating as necessary. The request is freed with
<a href="#ippDelete"><code>ippDelete</code></a>.</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.3/OS X 10.5&nbsp;</span><a name="cupsDoIORequest">cupsDoIORequest</a></h3>
<p class="description">Do an IPP request with file descriptors.</p>
<p class="code">
@@ -1039,14 +1041,14 @@ after receiving a valid IPP response.</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Response data</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function sends the IPP request to the specified server, retrying
and authenticating as necessary. The request is freed with ippDelete()
after receiving a valid IPP response.<br>
<p class="discussion">This function sends the IPP request with the optional input file &quot;infile&quot; to
the specified server, retrying and authenticating as necessary. The request
is freed with <a href="#ippDelete"><code>ippDelete</code></a>.<br>
<br>
If &quot;infile&quot; is a valid file descriptor, cupsDoIORequest() copies
If &quot;infile&quot; is a valid file descriptor, <code>cupsDoIORequest</code> copies
all of the data from the file after the IPP request message.<br>
<br>
If &quot;outfile&quot; is a valid file descriptor, cupsDoIORequest() copies
If &quot;outfile&quot; is a valid file descriptor, <code>cupsDoIORequest</code> copies
all of the data after the IPP response message to the file.
</p>
@@ -1071,8 +1073,7 @@ all of the data after the IPP response message to the file.
<p class="description">Response data</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function sends the IPP request to the specified server, retrying
and authenticating as necessary. The request is freed with ippDelete()
after receiving a valid IPP response.</p>
and authenticating as necessary. The request is freed with <a href="#ippDelete"><code>ippDelete</code></a>.</p>
<h3 class="function"><a name="cupsEncodeOptions">cupsEncodeOptions</a></h3>
<p class="description">Encode printer options into IPP attributes.</p>
<p class="code">
@@ -1220,19 +1221,21 @@ the request respectively.
<p class="description">Response or <code>NULL</code> on HTTP error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Use this function to get the response for an IPP request sent using
cupsSendDocument() or cupsSendRequest(). For requests that return
additional data, use httpRead() after getting a successful response,
otherwise call httpFlush() to complete the response processing.
<a href="#cupsSendRequest"><code>cupsSendRequest</code></a>. For requests that return additional data, use
<a href="#cupsReadResponseData"><code>cupsReadResponseData</code></a> after getting a successful response,
otherwise call <a href="#httpFlush"><code>httpFlush</code></a> to complete the response processing.
</p>
<h3 class="function"><a name="cupsLastError">cupsLastError</a></h3>
<p class="description">Return the last IPP status code.</p>
<p class="description">Return the last IPP status code received on the current
thread.</p>
<p class="code">
ipp_status_t cupsLastError (void);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">IPP status code from last request</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="cupsLastErrorString">cupsLastErrorString</a></h3>
<p class="description">Return the last IPP status-message.</p>
<p class="description">Return the last IPP status-message received on the
current thread.</p>
<p class="code">
const char *cupsLastErrorString (void);</p>
<h4 class="returnvalue">Return Value</h4>
@@ -1305,8 +1308,9 @@ ssize_t cupsReadResponseData (<br>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Bytes read, 0 on EOF, -1 on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function is used after cupsGetResponse() to read the PPD or document
files for CUPS_GET_PPD and CUPS_GET_DOCUMENT requests, respectively.
<p class="discussion">This function is used after <a href="#cupsGetResponse"><code>cupsGetResponse</code></a> to read the PPD or document
files from <code>CUPS_GET_PPD</code> and <code>CUPS_GET_DOCUMENT</code> requests,
respectively.
</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.4/OS X 10.6&nbsp;</span><a name="cupsSendRequest">cupsSendRequest</a></h3>
@@ -1332,13 +1336,17 @@ files for CUPS_GET_PPD and CUPS_GET_DOCUMENT requests, respectively.
<h4 class="returnvalue">Return Value</h4>
<p class="description">Initial HTTP status</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Use httpWrite() to write any additional data (document, PPD file, etc.)
for the request, cupsGetResponse() to get the IPP response, and httpRead()
to read any additional data following the response. Only one request can be
sent/queued at a time.<br>
<p class="discussion">Use <a href="#cupsWriteRequestData"><code>cupsWriteRequestData</code></a> to write any additional data (document, PPD
file, etc.) for the request, <a href="#cupsGetResponse"><code>cupsGetResponse</code></a> to get the IPP response,
and <a href="#cupsReadResponseData"><code>cupsReadResponseData</code></a> to read any additional data following the
response. Only one request can be sent/queued at a time per <code>http_t</code>
connection.<br>
<br>
Unlike cupsDoFileRequest(), cupsDoIORequest(), and cupsDoRequest(), the
request is not freed.
Returns the initial HTTP status code, which will be <code>HTTP_CONTINUE</code>
on a successful send of the request.<br>
<br>
Note: Unlike <a href="#cupsDoFileRequest"><code>cupsDoFileRequest</code></a>, <a href="#cupsDoIORequest"><code>cupsDoIORequest</code></a>, and
<a href="#cupsDoRequest"><code>cupsDoRequest</code></a>, the request is NOT freed with <a href="#ippDelete"><code>ippDelete</code></a>.
</p>
<h3 class="function"><span class="info">&nbsp;CUPS 1.4/OS X 10.6&nbsp;</span><a name="cupsWriteRequestData">cupsWriteRequestData</a></h3>
@@ -5015,6 +5023,8 @@ are server-oriented...</p>
<dd class="description">En/decode the query portion</dd>
<dt>HTTP_URI_CODING_RESOURCE </dt>
<dd class="description">En/decode the resource portion</dd>
<dt>HTTP_URI_CODING_RFC6874 </dt>
<dd class="description">Use RFC 6874 address format</dd>
<dt>HTTP_URI_CODING_USERNAME </dt>
<dd class="description">En/decode the username portion</dd>
</dl>
+2 -2
Ver Arquivo
@@ -341,7 +341,7 @@ div.contents ul.subcontents li {
<body>
<div class='body'>
<!--
"$Id$"
"$Id: api-array.header 8087 2008-10-27 21:37:05Z mike $"
MIME API header for CUPS.
@@ -412,7 +412,7 @@ including file size.">mimeFilter2</a></li>
</ul></li>
</ul>
<!--
"$Id$"
"$Id: api-array.shtml 7616 2008-05-28 00:34:13Z mike $"
MIME API introduction for CUPS.

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