Comparar commits
1 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| c2f1de8e25 |
@@ -1,6 +1,13 @@
|
||||
CHANGES-1.4.txt
|
||||
---------------
|
||||
|
||||
CHANGES IN CUPS V1.4.8
|
||||
|
||||
- The scheduler would delete job data files when restarted (STR #3880)
|
||||
- The network backends could crash if a printer returned a value of 0
|
||||
for the maximum capacity for a supply (STR #3875)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.4.7
|
||||
|
||||
- Documentation changes (STR #3710, STR #3720, STR #3745, STR #3750,
|
||||
@@ -9,6 +16,7 @@ CHANGES IN CUPS V1.4.7
|
||||
STR #3755, STR #3769, STR #3783)
|
||||
- Configure script fixes (STR #3659, STR #3691)
|
||||
- Compilation fixes (STR #3718, STR #3771, STR #3774)
|
||||
- The imageto* filters could crash with bad GIF files (STR #3867)
|
||||
- The scheduler might leave old job data files in the spool directory
|
||||
(STR #3795)
|
||||
- CUPS did not work with locales using the ASCII character set
|
||||
|
||||
+215
-1
@@ -1,6 +1,220 @@
|
||||
CHANGES.txt - 2011-05-20
|
||||
CHANGES.txt - 2012-07-16
|
||||
------------------------
|
||||
|
||||
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)
|
||||
- Sending a document in an unsupported format to an IPP printer now
|
||||
automatically cancels the job (STR #4093)
|
||||
- Fix some error reporting issues when printing from /dev/null and
|
||||
other unusual situations (STR #4015)
|
||||
- The scheduler now sets the CUPS_MAX_MESSAGE environment variable for
|
||||
filters (STR #4074)
|
||||
- Fixed a build issue when using older versions of autoconf (STR #4084)
|
||||
- The IPP backend now treats the client-error-not-possible status code
|
||||
as a job history issue, allowing IPP printing to Windows to work
|
||||
(STR #4047)
|
||||
- The IPP backend incorrectly included the document-format and
|
||||
compression attributes in Create-Job requests (STR #4086)
|
||||
- The libusb-based USB backend did not work on non-Linux platforms
|
||||
(STR #4088)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.5.3
|
||||
|
||||
- httpReconnect() did not reset the read/write buffers (STR #4065)
|
||||
- Compiling without threading support failed (STR #4060)
|
||||
- Fixed compile problem with old versions of OpenSSL (STR #4036)
|
||||
- The network backends did not check SNMP supply levels regularly
|
||||
(STR #4040)
|
||||
- The online help always included the "help on help" text (STR #4042)
|
||||
- Fixed a SSL handshake issue on OS X (STR #4045)
|
||||
- The scheduler could crash if a PPD file contained an invalid paper
|
||||
size (STR #4049)
|
||||
- The CUPS polling daemon did not reinitialize its connection to the
|
||||
remote server on errors in all cases (STR #4031)
|
||||
- PostScript auto-configuration was slow and unreliable with some
|
||||
printers (STR #4028)
|
||||
- Missing localizations caused empty output (STR #4033)
|
||||
- The cups-driverd program could temporarily "forget" a PPD file if it
|
||||
was updated in place.
|
||||
- The dnssd backend now prefers IPPS over IPP.
|
||||
- The USB backend now uses and requires LIBUSB 1.0 or later (STR #3477)
|
||||
- The LIBUSB-based USB backend now supports the back-channel (STR #2890)
|
||||
- Changed how timeouts are implemented in the LPD backend (STR #4013)
|
||||
- Added more supported color names for SNMP supplies (STR #3981)
|
||||
- The default InputSlot setting was never used (STR #3957)
|
||||
- POSIX ACLs are now set properly on certificate files (STR #3970)
|
||||
- Supplies with commas in their names were not reported correctly
|
||||
(STR #4020)
|
||||
- The cupsGetPPD3() function created a temporary file when one was not
|
||||
needed (STR #4018)
|
||||
- The scheduler now ensures that job notifications contain a value for
|
||||
the notify-printer-uri attribute (STR #4014)
|
||||
- The lp and lpr commands did not cancel jobs queued from stdin on an
|
||||
error (STR #4015)
|
||||
- Fixed the IPP backend's handling of HTTP/1.0 compatibility (STR #3988)
|
||||
- The IPP backend did not always setup username/password authentication
|
||||
for printers (STR #3985)
|
||||
- The IPP backend no longer re-queues print jobs that are too large for
|
||||
the printer/server (STR #3977)
|
||||
- The RPM spec file did not work (STR #4021, STR #4057)
|
||||
- Encryption did not work when the server name ended with "."
|
||||
(STR #4011)
|
||||
- The multi-purpose tray is now mapped to the IPP "by-pass-tray"
|
||||
(STR #4009)
|
||||
- The correct media size was not always passed to IPP printers
|
||||
(STR #4001)
|
||||
- Finishing options were not passed to IPP printers (STR #3995)
|
||||
- Fixed iCloud-based Back to My Mac printing (STR #3996)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.5.2
|
||||
|
||||
- Reposted what should have been CUPS 1.5.1.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.5.1
|
||||
|
||||
- Documentation updates (STR #3885, STR #3886, STR #3946, STR #3969)
|
||||
- Localization updates (STR #3840, STR #3989, STR #3997)
|
||||
- Build fixes (STR #3956, STR #3999)
|
||||
- The SNMP backend did not validate the device URIs reported by printers
|
||||
(STR #4004)
|
||||
- cupsBackendReport() did not handle newlines in 1284 Device IDs
|
||||
(STR #4005)
|
||||
- USB backend fixes for libusb (STR #3965, STR #3978)
|
||||
- The DBUS notifier did not validate string parameters (STR #3984)
|
||||
- Group quota ACLs did not work with Kerberos (STR #3972)
|
||||
- The IPP backend did not retry when a printer responded with
|
||||
client-error-not-possible (STR #3963)
|
||||
- PostScript PPDs with filters used the wrong command filter (STR #3973)
|
||||
- The scheduler incorrectly used free() on a POSIX ACL value, which
|
||||
could cause a crash (STR #3970)
|
||||
- PPD files using the MacStandard encoding did not work.
|
||||
- The web interface did not work on some platforms (STR #3902)
|
||||
- The lpstat command would crash when then "-u" option was used by a
|
||||
non-administrator (STR #3953)
|
||||
- Japanese supply level reporting did not always work.
|
||||
- The DBUS notifier could crash (STR #3947)
|
||||
- Relaxed some of the page size checks in cupstestppd.
|
||||
- The ipptool program now reports attributes that are repeated within
|
||||
the same attribute group.
|
||||
- Updated the PWG raster support to match the current draft
|
||||
specification.
|
||||
- Fixed some IPP conformance issues in the scheduler.
|
||||
- Added ipptool support for repeating requests.
|
||||
- Added IPP/2.2 conformance tests and greatly improved the IPP/1.1,
|
||||
IPP/2.0, and IPP/2.1 conformance testing.
|
||||
- IPP messages containing mixed integer/rangeOfInteger values did not
|
||||
work (STR #3942)
|
||||
- The ipptool program now provides additional diagnostics for badly-
|
||||
formatted responses (STR #3857)
|
||||
- When possible, the IPP backend now stops sending job data early on a
|
||||
cancel.
|
||||
- cupsSendRequest and cupsWriteRequestData did not properly read all
|
||||
HTTP headers, preventing authentication and encryption upgrades from
|
||||
working in all cases.
|
||||
- The client.conf Server directive is no longer supported on Mac OS X
|
||||
10.7 and later.
|
||||
- The IPP backend sent the wrong margins in media-col.
|
||||
- The scheduler did not save or restore large Kerberos credentials for
|
||||
jobs.
|
||||
- The dnssd backend did not properly browse for secure IPP printers.
|
||||
- httpAssembleURI* did not properly escape all special characters in the
|
||||
username/password field.
|
||||
- The scheduler now logs config file errors to stderr (STR #3936)
|
||||
- The configure script incorrectly used bundle-based localizations on
|
||||
Linux (STR #3938)
|
||||
- The cups-driverd helper program did not cache .drv files properly,
|
||||
sometimes leading to a crash (STR #3921)
|
||||
- CUPS did not build on stock Mac OS X installations.
|
||||
- Encryption was broken with OpenSSL.
|
||||
- ipptool's XML output used date/time values with timezone offsets,
|
||||
which are not supported by Mac OS X's NSDate class.
|
||||
- Several programs did not support the cupsFilter2 keyword in PPD files.
|
||||
- The IPP backend incorrectly reported spool-area-full states.
|
||||
- cupsMarkOptions() did not protect against a bad PPD that was missing
|
||||
one or more standard Duplex options.
|
||||
- The PostScript filter did not mirror N-up output properly.
|
||||
- The ipptool program did not validate UTF-8 strings in XML output.
|
||||
- Fixed supply level reporting for some printers.
|
||||
- The scheduler no longer automatically logs debug messages for jobs
|
||||
that were held or canceled.
|
||||
- The cupsSendRequest function did not flush remaining response data
|
||||
from a previous request, leading to apparent chunking issues.
|
||||
- The scheduler did not report the correct version in the Server: header
|
||||
(STR #3903)
|
||||
- The scheduler did not support 1284 device IDs reported by driver
|
||||
interface programs longer than 127 characters (STR #3871)
|
||||
- The image filters did not support loading images larger than the
|
||||
RIPCache setting (STR #3901)
|
||||
- "PAGE: total NNN" messages did not get logged properly (STR #3887)
|
||||
- Updated the PWG Raster support to conform to the current draft of the
|
||||
PWG Raster Format specification.
|
||||
- The PWG Raster filter did not always write the correct number of
|
||||
padding lines on the bottom of the page (STR #3904)
|
||||
- When reporting a denial-of-service attack from the domain socket, the
|
||||
address reported does not always contain the correct path (STR #3888)
|
||||
- Badly formed GIF files could cause the image filters to crash
|
||||
(STR #3914)
|
||||
- Jobs canceled at the printer were retried by the IPP backend.
|
||||
- "cupsfilter -u" deleted the input file instead of the PPD file.
|
||||
- The scheduler did not compute the cost of PPD filters defined using
|
||||
the cupsFilter2 keyword properly.
|
||||
- The scheduler did not correctly support the maxsize() attribute for
|
||||
PPD filters.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.5.0
|
||||
|
||||
- Documentation updates.
|
||||
- Localization update (STR #3865)
|
||||
- Needed to limit TLS to v1.0 on some versions of Mac OS X.
|
||||
- The snmp backend did not work with some printers.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.5rc1
|
||||
|
||||
- Compile fixes (STR #3849, STR #3850)
|
||||
- The scheduler didn't check for empty values for several configuration
|
||||
directives (STR #3861)
|
||||
- ipptool didn't generate valid XML when a test was skipped.
|
||||
- Added additional error checking to the 1284 device ID code (STR #3858)
|
||||
- Fixed some compatibility issues migrating from the old usblp backend
|
||||
to the libusb backend (STR #3860)
|
||||
- Fixed the wake-from-sleep printing behavior on Mac OS X.
|
||||
- The scheduler incorrectly allowed jobs to be held from a terminating
|
||||
state.
|
||||
- The cups-driverd program could crash when a PPD was renamed.
|
||||
- The dnssd backend took too long to discover printers on large or busy
|
||||
networks with the new default timeout used by lpinfo and the web
|
||||
interface. This resulted in "lost" printers.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.5b2
|
||||
|
||||
- Documentation updates.
|
||||
- Localization updates (STR #3845)
|
||||
- Compiler warning cleanup.
|
||||
- Fixed PIE support for Linux (STR #3846)
|
||||
- Made httpSetTimeout API public and use it in the IPP backend to avoid
|
||||
timeout errors.
|
||||
- The scheduler incorrectly set the "authenticated" printer-type bit for
|
||||
remote queues using authentication.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.5b1
|
||||
|
||||
- The CUPS library now supports per-connection HTTP timeouts and
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
INSTALL - CUPS v1.5b1 - 2011-05-20
|
||||
INSTALL - CUPS v1.5.4 - 2012-07-16
|
||||
----------------------------------
|
||||
|
||||
This file describes how to compile and install CUPS from source code. For more
|
||||
|
||||
+38
-7
@@ -1,4 +1,4 @@
|
||||
IPPTOOL.txt - 2011-05-20
|
||||
IPPTOOL.txt - 2011-09-20
|
||||
------------------------
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ BASIC USAGE
|
||||
|
||||
ipptool -c ipp://localhost/printers/myprinter get-jobs.test
|
||||
|
||||
which would produce something like this:
|
||||
which will produce something like this:
|
||||
|
||||
job-id,job-state,job-name,job-originating-user-name
|
||||
72,pending,testfile.pdf,msweet
|
||||
@@ -46,12 +46,43 @@ BASIC USAGE
|
||||
|
||||
CONFORMANCE TESTS
|
||||
|
||||
We provide basic IPP conformance tests for IPP/1.1, IPP/2.0, and IPP/2.1.
|
||||
For a given printer URI, the following commands perform tests at each level:
|
||||
We provide basic IPP conformance tests for IPP/1.1, IPP/2.0, IPP/2.1, and
|
||||
IPP/2.2. For a given printer URI, the following commands perform tests at
|
||||
each level:
|
||||
|
||||
ipptool -t printer-uri ipp-1.1.test
|
||||
ipptool -t -V 2.0 printer-uri ipp-2.0.test
|
||||
ipptool -t -V 2.1 printer-uri ipp-2.1.test
|
||||
ipptool -tf filename [options] -I printer-uri ipp-1.1.test
|
||||
ipptool -tf filename [options] -I -V 2.0 printer-uri ipp-2.0.test
|
||||
ipptool -tf filename [options] -I -V 2.1 printer-uri ipp-2.1.test
|
||||
ipptool -tf filename [options] -I -V 2.2 printer-uri ipp-2.2.test
|
||||
|
||||
The filename must use a format supported by the printer; ipptool will guess
|
||||
the MIME media type using the extension, otherwise application/octet stream
|
||||
will be used. The following standard test files are included:
|
||||
|
||||
color.jpg
|
||||
document-a4.pdf
|
||||
document-a4.ps
|
||||
document-letter.pdf
|
||||
document-letter.ps
|
||||
gray.jpg
|
||||
onepage-a4.pdf
|
||||
onepage-a4.ps
|
||||
onepage-letter.pdf
|
||||
onepage-letter.ps
|
||||
|
||||
Print-by-reference (URL) printing can be tested by defining the document-uri
|
||||
variable to a URL, for example:
|
||||
|
||||
ipptool -tf filename -d document-uri=url -I printer-uri ipp-1.1.test
|
||||
|
||||
The standard test files are available on cups.org under the "test"
|
||||
directory, for example:
|
||||
|
||||
http://www.cups.org/test/document-a4.pdf
|
||||
|
||||
The "document" test files contain 4 pages each. Doing the IPP conformance
|
||||
tests will will produce up to 90 pages on various media, depending on the
|
||||
printer.
|
||||
|
||||
|
||||
READING THE DOCUMENTATION
|
||||
|
||||
@@ -43,6 +43,7 @@ SHELL = /bin/sh
|
||||
|
||||
INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
|
||||
INSTALL_CONFIG = $(INSTALL) -c -m @CUPS_CONFIG_FILE_PERM@
|
||||
INSTALL_COMPDATA = $(INSTALL) -c -m 444 @INSTALL_GZIP@
|
||||
INSTALL_DATA = $(INSTALL) -c -m 444
|
||||
INSTALL_DIR = $(INSTALL) -d
|
||||
INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
|
||||
|
||||
+1
-1
@@ -285,7 +285,7 @@ docset: apihelp
|
||||
#
|
||||
|
||||
sloc:
|
||||
for dir in cups cupslite scheduler; do \
|
||||
for dir in cups scheduler; do \
|
||||
(cd $$dir; $(MAKE) $(MFLAGS) sloc) || exit 1;\
|
||||
done
|
||||
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
README - CUPS v1.5b1 - 2011-05-20
|
||||
README - CUPS v1.5.4 - 2012-07-16
|
||||
---------------------------------
|
||||
|
||||
Looking for compile instructions? Read the file "INSTALL.txt"
|
||||
@@ -150,7 +150,7 @@ PRINTING FILES
|
||||
|
||||
LEGAL STUFF
|
||||
|
||||
CUPS is Copyright 2007-2011 by Apple Inc. CUPS and the CUPS logo are
|
||||
CUPS is Copyright 2007-2012 by Apple Inc. CUPS and the CUPS logo are
|
||||
trademarks of Apple Inc.
|
||||
|
||||
The MD5 Digest code is Copyright 1999 Aladdin Enterprises.
|
||||
|
||||
+58
-52
@@ -3,77 +3,83 @@
|
||||
ipp.o: backend-private.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
|
||||
ipp.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
ipp.o: ../cups/language.h ../cups/string-private.h ../config.h
|
||||
ipp.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
|
||||
ipp.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
|
||||
ipp.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
|
||||
ipp.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
|
||||
ipp.o: ../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h
|
||||
ipp.o: ../cups/sidechannel.h ../cups/array-private.h
|
||||
ipp.o: ../cups/debug-private.h ../cups/versioning.h ../cups/ppd-private.h
|
||||
ipp.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
|
||||
ipp.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
|
||||
ipp.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
|
||||
ipp.o: ../cups/transcode.h ../cups/thread-private.h ../cups/snmp-private.h
|
||||
ipp.o: ../cups/backend.h ../cups/sidechannel.h ../cups/array-private.h
|
||||
ipp.o: ../cups/array.h
|
||||
lpd.o: ../cups/http-private.h ../config.h ../cups/http.h
|
||||
lpd.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
|
||||
lpd.o: backend-private.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
|
||||
lpd.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
lpd.o: ../cups/language.h ../cups/string-private.h ../cups/debug-private.h
|
||||
lpd.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
|
||||
lpd.o: ../cups/pwg-private.h ../cups/http-private.h
|
||||
lpd.o: ../cups/versioning.h ../cups/ppd-private.h ../cups/ppd.h
|
||||
lpd.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
|
||||
lpd.o: ../cups/language-private.h ../cups/transcode.h
|
||||
lpd.o: ../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h
|
||||
lpd.o: ../cups/sidechannel.h
|
||||
dnssd.o: backend-private.h ../cups/cups-private.h ../cups/cups.h
|
||||
dnssd.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
dnssd.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
|
||||
dnssd.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
|
||||
dnssd.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
|
||||
dnssd.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
|
||||
dnssd.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
|
||||
dnssd.o: ../cups/transcode.h ../cups/thread-private.h ../cups/snmp-private.h
|
||||
dnssd.o: ../cups/backend.h ../cups/sidechannel.h ../cups/array.h
|
||||
dnssd.o: ../config.h ../cups/debug-private.h ../cups/versioning.h
|
||||
dnssd.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
|
||||
dnssd.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
|
||||
dnssd.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
|
||||
dnssd.o: ../cups/language-private.h ../cups/transcode.h
|
||||
dnssd.o: ../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h
|
||||
dnssd.o: ../cups/sidechannel.h ../cups/array.h
|
||||
parallel.o: backend-private.h ../cups/cups-private.h ../cups/cups.h
|
||||
parallel.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
parallel.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
|
||||
parallel.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
|
||||
parallel.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
|
||||
parallel.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
|
||||
parallel.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
|
||||
parallel.o: ../cups/transcode.h ../cups/thread-private.h
|
||||
parallel.o: ../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
|
||||
parallel.o: ../config.h ../cups/debug-private.h ../cups/versioning.h
|
||||
parallel.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
|
||||
parallel.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
|
||||
parallel.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
|
||||
parallel.o: ../cups/language-private.h ../cups/transcode.h
|
||||
parallel.o: ../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h
|
||||
parallel.o: ../cups/sidechannel.h
|
||||
serial.o: backend-private.h ../cups/cups-private.h ../cups/cups.h
|
||||
serial.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
serial.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
|
||||
serial.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
|
||||
serial.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
|
||||
serial.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
|
||||
serial.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
|
||||
serial.o: ../cups/transcode.h ../cups/thread-private.h ../cups/snmp-private.h
|
||||
serial.o: ../cups/backend.h ../cups/sidechannel.h
|
||||
serial.o: ../config.h ../cups/debug-private.h ../cups/versioning.h
|
||||
serial.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
|
||||
serial.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
|
||||
serial.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
|
||||
serial.o: ../cups/language-private.h ../cups/transcode.h
|
||||
serial.o: ../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h
|
||||
serial.o: ../cups/sidechannel.h
|
||||
snmp.o: backend-private.h ../cups/cups-private.h ../cups/cups.h
|
||||
snmp.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
snmp.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
|
||||
snmp.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
|
||||
snmp.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
|
||||
snmp.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
|
||||
snmp.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
|
||||
snmp.o: ../cups/transcode.h ../cups/thread-private.h ../cups/snmp-private.h
|
||||
snmp.o: ../cups/backend.h ../cups/sidechannel.h ../cups/array.h
|
||||
snmp.o: ../cups/file.h ../cups/http-private.h
|
||||
snmp.o: ../config.h ../cups/debug-private.h ../cups/versioning.h
|
||||
snmp.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
|
||||
snmp.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
|
||||
snmp.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
|
||||
snmp.o: ../cups/language-private.h ../cups/transcode.h
|
||||
snmp.o: ../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h
|
||||
snmp.o: ../cups/sidechannel.h ../cups/array.h ../cups/file.h
|
||||
snmp.o: ../cups/http-private.h
|
||||
socket.o: ../cups/http-private.h ../config.h ../cups/http.h
|
||||
socket.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
|
||||
socket.o: backend-private.h ../cups/cups-private.h ../cups/cups.h
|
||||
socket.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
socket.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
|
||||
socket.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
|
||||
socket.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
|
||||
socket.o: ../cups/language-private.h ../cups/transcode.h
|
||||
socket.o: ../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h
|
||||
socket.o: ../cups/sidechannel.h
|
||||
socket.o: ../cups/debug-private.h ../cups/versioning.h ../cups/ppd-private.h
|
||||
socket.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
|
||||
socket.o: ../cups/http-private.h ../cups/language-private.h
|
||||
socket.o: ../cups/transcode.h ../cups/thread-private.h ../cups/snmp-private.h
|
||||
socket.o: ../cups/backend.h ../cups/sidechannel.h
|
||||
test1284.o: ../cups/string-private.h ../config.h ieee1284.c backend-private.h
|
||||
test1284.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
|
||||
test1284.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
test1284.o: ../cups/language.h ../cups/string-private.h
|
||||
test1284.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
|
||||
test1284.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
|
||||
test1284.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
|
||||
test1284.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
|
||||
test1284.o: ../cups/debug-private.h ../cups/versioning.h
|
||||
test1284.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
|
||||
test1284.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
|
||||
test1284.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
|
||||
test1284.o: ../cups/language-private.h ../cups/transcode.h
|
||||
test1284.o: ../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h
|
||||
test1284.o: ../cups/sidechannel.h
|
||||
testbackend.o: ../cups/string-private.h ../config.h ../cups/cups.h
|
||||
@@ -84,18 +90,18 @@ testsupplies.o: backend-private.h ../cups/cups-private.h ../cups/cups.h
|
||||
testsupplies.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
testsupplies.o: ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
testsupplies.o: ../cups/string-private.h ../config.h ../cups/debug-private.h
|
||||
testsupplies.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
|
||||
testsupplies.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
|
||||
testsupplies.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
|
||||
testsupplies.o: ../cups/language-private.h ../cups/transcode.h
|
||||
testsupplies.o: ../cups/versioning.h ../cups/ppd-private.h ../cups/ppd.h
|
||||
testsupplies.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
|
||||
testsupplies.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
|
||||
testsupplies.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
|
||||
testsupplies.o: ../cups/thread-private.h ../cups/snmp-private.h
|
||||
testsupplies.o: ../cups/backend.h ../cups/sidechannel.h
|
||||
usb.o: backend-private.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
|
||||
usb.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
usb.o: ../cups/language.h ../cups/string-private.h ../config.h
|
||||
usb.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
|
||||
usb.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
|
||||
usb.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
|
||||
usb.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
|
||||
usb.o: ../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h
|
||||
usb.o: ../cups/sidechannel.h
|
||||
usb.o: ../cups/debug-private.h ../cups/versioning.h ../cups/ppd-private.h
|
||||
usb.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
|
||||
usb.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
|
||||
usb.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
|
||||
usb.o: ../cups/transcode.h ../cups/thread-private.h ../cups/snmp-private.h
|
||||
usb.o: ../cups/backend.h ../cups/sidechannel.h
|
||||
|
||||
+3
-3
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# Backend makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2011 by Apple Inc.
|
||||
# Copyright 2007-2012 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -98,7 +98,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
|
||||
@@ -268,7 +268,7 @@ socket: socket.o ../cups/$(LIBCUPS) libbackend.a
|
||||
|
||||
usb: usb.o ../cups/$(LIBCUPS) libbackend.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) \
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) \
|
||||
$(BACKLIBS) $(LIBS)
|
||||
usb.o: usb.c usb-darwin.c usb-libusb.c usb-unix.c
|
||||
|
||||
|
||||
@@ -274,6 +274,7 @@ extern "C" {
|
||||
#define CUPS_TC_csUTF32 1017
|
||||
#define CUPS_TC_csUTF32BE 1018
|
||||
#define CUPS_TC_csUTF32LE 1019
|
||||
#define CUPS_TC_csWindows31J 2024
|
||||
|
||||
|
||||
/*
|
||||
|
||||
+65
-16
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* DNS-SD discovery backend for CUPS.
|
||||
*
|
||||
* Copyright 2008-2011 by Apple Inc.
|
||||
* Copyright 2008-2012 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -43,6 +43,7 @@
|
||||
typedef enum
|
||||
{
|
||||
CUPS_DEVICE_PRINTER = 0, /* lpd://... */
|
||||
CUPS_DEVICE_IPPS, /* ipps://... */
|
||||
CUPS_DEVICE_IPP, /* ipp://... */
|
||||
CUPS_DEVICE_FAX_IPP, /* ipp://... */
|
||||
CUPS_DEVICE_PDL_DATASTREAM, /* socket://... */
|
||||
@@ -83,7 +84,8 @@ static void browse_callback(DNSServiceRef sdRef,
|
||||
DNSServiceErrorType errorCode,
|
||||
const char *serviceName,
|
||||
const char *regtype,
|
||||
const char *replyDomain, void *context);
|
||||
const char *replyDomain, void *context)
|
||||
__attribute__((nonnull(1,5,6,7,8)));
|
||||
static void browse_local_callback(DNSServiceRef sdRef,
|
||||
DNSServiceFlags flags,
|
||||
uint32_t interfaceIndex,
|
||||
@@ -91,13 +93,15 @@ static void browse_local_callback(DNSServiceRef sdRef,
|
||||
const char *serviceName,
|
||||
const char *regtype,
|
||||
const char *replyDomain,
|
||||
void *context);
|
||||
void *context)
|
||||
__attribute__((nonnull(1,5,6,7,8)));
|
||||
static int compare_devices(cups_device_t *a, cups_device_t *b);
|
||||
static void exec_backend(char **argv);
|
||||
static cups_device_t *get_device(cups_array_t *devices,
|
||||
const char *serviceName,
|
||||
const char *regtype,
|
||||
const char *replyDomain);
|
||||
const char *replyDomain)
|
||||
__attribute__((nonnull(1,2,3,4)));
|
||||
static void query_callback(DNSServiceRef sdRef,
|
||||
DNSServiceFlags flags,
|
||||
uint32_t interfaceIndex,
|
||||
@@ -105,9 +109,11 @@ static void query_callback(DNSServiceRef sdRef,
|
||||
const char *fullName, uint16_t rrtype,
|
||||
uint16_t rrclass, uint16_t rdlen,
|
||||
const void *rdata, uint32_t ttl,
|
||||
void *context);
|
||||
void *context)
|
||||
__attribute__((nonnull(1,5,9,11)));
|
||||
static void sigterm_handler(int sig);
|
||||
static void unquote(char *dst, const char *src, size_t dstsize);
|
||||
static void unquote(char *dst, const char *src, size_t dstsize)
|
||||
__attribute__((nonnull(1,2)));
|
||||
|
||||
|
||||
/*
|
||||
@@ -123,9 +129,11 @@ main(int argc, /* I - Number of command-line args */
|
||||
fax_ipp_ref, /* IPP fax service reference */
|
||||
ipp_ref, /* IPP service reference */
|
||||
ipp_tls_ref, /* IPP w/TLS service reference */
|
||||
ipps_ref, /* IPP service reference */
|
||||
local_fax_ipp_ref, /* Local IPP fax service reference */
|
||||
local_ipp_ref, /* Local IPP service reference */
|
||||
local_ipp_tls_ref, /* Local IPP w/TLS service reference */
|
||||
local_ipps_ref, /* Local IPP service reference */
|
||||
local_printer_ref, /* Local LPD service reference */
|
||||
pdl_datastream_ref, /* AppSocket service reference */
|
||||
printer_ref, /* LPD service reference */
|
||||
@@ -215,6 +223,10 @@ main(int argc, /* I - Number of command-line args */
|
||||
DNSServiceBrowse(&ipp_tls_ref, kDNSServiceFlagsShareConnection, 0,
|
||||
"_ipp-tls._tcp", NULL, browse_callback, devices);
|
||||
|
||||
ipps_ref = main_ref;
|
||||
DNSServiceBrowse(&ipps_ref, kDNSServiceFlagsShareConnection, 0,
|
||||
"_ipps._tcp", NULL, browse_callback, devices);
|
||||
|
||||
local_fax_ipp_ref = main_ref;
|
||||
DNSServiceBrowse(&local_fax_ipp_ref, kDNSServiceFlagsShareConnection,
|
||||
kDNSServiceInterfaceIndexLocalOnly,
|
||||
@@ -230,6 +242,11 @@ main(int argc, /* I - Number of command-line args */
|
||||
kDNSServiceInterfaceIndexLocalOnly,
|
||||
"_ipp-tls._tcp", NULL, browse_local_callback, devices);
|
||||
|
||||
local_ipps_ref = main_ref;
|
||||
DNSServiceBrowse(&local_ipps_ref, kDNSServiceFlagsShareConnection,
|
||||
kDNSServiceInterfaceIndexLocalOnly,
|
||||
"_ipps._tcp", NULL, browse_local_callback, devices);
|
||||
|
||||
local_printer_ref = main_ref;
|
||||
DNSServiceBrowse(&local_printer_ref, kDNSServiceFlagsShareConnection,
|
||||
kDNSServiceInterfaceIndexLocalOnly,
|
||||
@@ -256,8 +273,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
FD_ZERO(&input);
|
||||
FD_SET(fd, &input);
|
||||
|
||||
timeout.tv_sec = 1;
|
||||
timeout.tv_usec = 0;
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_usec = 250000;
|
||||
|
||||
if (select(fd + 1, &input, NULL, NULL, &timeout) < 0)
|
||||
continue;
|
||||
@@ -280,19 +297,26 @@ main(int argc, /* I - Number of command-line args */
|
||||
cups_device_t *best; /* Best matching device */
|
||||
char device_uri[1024]; /* Device URI */
|
||||
int count; /* Number of queries */
|
||||
|
||||
int sent; /* Number of sent */
|
||||
|
||||
for (device = (cups_device_t *)cupsArrayFirst(devices),
|
||||
best = NULL, count = 0;
|
||||
best = NULL, count = 0, sent = 0;
|
||||
device;
|
||||
device = (cups_device_t *)cupsArrayNext(devices))
|
||||
{
|
||||
if (device->sent)
|
||||
sent ++;
|
||||
|
||||
if (device->ref)
|
||||
count ++;
|
||||
|
||||
if (!device->ref && !device->sent)
|
||||
{
|
||||
/*
|
||||
* Found the device, now get the TXT record(s) for it...
|
||||
*/
|
||||
|
||||
if (count < 10)
|
||||
if (count < 20)
|
||||
{
|
||||
device->ref = main_ref;
|
||||
|
||||
@@ -338,6 +362,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
best->name, best->device_id, NULL);
|
||||
best->sent = 1;
|
||||
best = device;
|
||||
|
||||
sent ++;
|
||||
}
|
||||
else if (best->priority > device->priority ||
|
||||
(best->priority == device->priority &&
|
||||
@@ -345,10 +371,17 @@ main(int argc, /* I - Number of command-line args */
|
||||
{
|
||||
best->sent = 1;
|
||||
best = device;
|
||||
|
||||
sent ++;
|
||||
}
|
||||
else
|
||||
{
|
||||
device->sent = 1;
|
||||
|
||||
sent ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (best)
|
||||
{
|
||||
@@ -361,7 +394,11 @@ main(int argc, /* I - Number of command-line args */
|
||||
cupsBackendReport("network", device_uri, best->make_and_model,
|
||||
best->name, best->device_id, NULL);
|
||||
best->sent = 1;
|
||||
sent ++;
|
||||
}
|
||||
|
||||
if (sent == cupsArrayCount(devices))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -558,9 +595,11 @@ get_device(cups_array_t *devices, /* I - Device array */
|
||||
|
||||
key.name = (char *)serviceName;
|
||||
|
||||
if (!strcmp(regtype, "_ipp._tcp.") ||
|
||||
!strcmp(regtype, "_ipp-tls._tcp."))
|
||||
if (!strcmp(regtype, "_ipp._tcp."))
|
||||
key.type = CUPS_DEVICE_IPP;
|
||||
else if (!strcmp(regtype, "_ipps._tcp.") ||
|
||||
!strcmp(regtype, "_ipp-tls._tcp."))
|
||||
key.type = CUPS_DEVICE_IPPS;
|
||||
else if (!strcmp(regtype, "_fax-ipp._tcp."))
|
||||
key.type = CUPS_DEVICE_FAX_IPP;
|
||||
else if (!strcmp(regtype, "_printer._tcp."))
|
||||
@@ -680,9 +719,11 @@ query_callback(
|
||||
if ((ptr = strstr(name, "._")) != NULL)
|
||||
*ptr = '\0';
|
||||
|
||||
if (strstr(fullName, "_ipp._tcp.") ||
|
||||
strstr(fullName, "_ipp-tls._tcp."))
|
||||
if (strstr(fullName, "_ipp._tcp."))
|
||||
dkey.type = CUPS_DEVICE_IPP;
|
||||
else if (strstr(fullName, "_ipps._tcp.") ||
|
||||
strstr(fullName, "_ipp-tls._tcp."))
|
||||
dkey.type = CUPS_DEVICE_IPPS;
|
||||
else if (strstr(fullName, "_fax-ipp._tcp."))
|
||||
dkey.type = CUPS_DEVICE_FAX_IPP;
|
||||
else if (strstr(fullName, "_printer._tcp."))
|
||||
@@ -738,7 +779,7 @@ query_callback(
|
||||
|
||||
datalen = *data++;
|
||||
|
||||
if (!datalen || (data + datalen) >= dataend)
|
||||
if (!datalen || (data + datalen) > dataend)
|
||||
break;
|
||||
|
||||
datanext = data + datalen;
|
||||
@@ -754,9 +795,16 @@ query_callback(
|
||||
if (data < datanext)
|
||||
memcpy(value, data, datanext - data);
|
||||
value[datanext - data] = '\0';
|
||||
|
||||
fprintf(stderr, "DEBUG2: query_callback: \"%s=%s\".\n",
|
||||
key, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "DEBUG2: query_callback: \"%s\" with no value.\n",
|
||||
key);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!_cups_strncasecmp(key, "usb_", 4))
|
||||
{
|
||||
@@ -800,6 +848,7 @@ query_callback(
|
||||
else if (!_cups_strcasecmp(key, "priority"))
|
||||
device->priority = atoi(value);
|
||||
else if ((device->type == CUPS_DEVICE_IPP ||
|
||||
device->type == CUPS_DEVICE_IPPS ||
|
||||
device->type == CUPS_DEVICE_PRINTER) &&
|
||||
!_cups_strcasecmp(key, "printer-type"))
|
||||
{
|
||||
|
||||
+21
-3
@@ -65,6 +65,7 @@ backendGetDeviceID(
|
||||
# if defined(__sun) && defined(ECPPIOC_GETDEVID)
|
||||
struct ecpp_device_id did; /* Device ID buffer */
|
||||
# endif /* __sun && ECPPIOC_GETDEVID */
|
||||
char *ptr; /* Pointer into device ID */
|
||||
|
||||
|
||||
DEBUG_printf(("backendGetDeviceID(fd=%d, device_id=%p, device_id_size=%d, "
|
||||
@@ -186,7 +187,7 @@ backendGetDeviceID(
|
||||
* and then limit the length to the size of our buffer...
|
||||
*/
|
||||
|
||||
if (length > device_id_size)
|
||||
if (length > device_id_size || length < 14)
|
||||
length = (((unsigned)device_id[1] & 255) << 8) +
|
||||
((unsigned)device_id[0] & 255);
|
||||
|
||||
@@ -224,11 +225,12 @@ backendGetDeviceID(
|
||||
device_id[length] = '\0';
|
||||
}
|
||||
}
|
||||
# ifdef DEBUG
|
||||
else
|
||||
{
|
||||
DEBUG_printf(("backendGetDeviceID: ioctl failed - %s\n",
|
||||
strerror(errno)));
|
||||
# endif /* DEBUG */
|
||||
*device_id = '\0';
|
||||
}
|
||||
# endif /* __linux */
|
||||
|
||||
# if defined(__sun) && defined(ECPPIOC_GETDEVID)
|
||||
@@ -256,6 +258,22 @@ backendGetDeviceID(
|
||||
# endif /* __sun && ECPPIOC_GETDEVID */
|
||||
}
|
||||
|
||||
/*
|
||||
* Check whether device ID is valid. Turn line breaks and tabs to spaces and
|
||||
* reject device IDs with non-printable characters.
|
||||
*/
|
||||
|
||||
for (ptr = device_id; *ptr; ptr ++)
|
||||
if (_cups_isspace(*ptr))
|
||||
*ptr = ' ';
|
||||
else if ((*ptr & 255) < ' ' || *ptr == 127)
|
||||
{
|
||||
DEBUG_printf(("backendGetDeviceID: Bad device_id character %d.",
|
||||
*ptr & 255));
|
||||
*device_id = '\0';
|
||||
break;
|
||||
}
|
||||
|
||||
DEBUG_printf(("backendGetDeviceID: device_id=\"%s\"\n", device_id));
|
||||
|
||||
if (scheme && uri)
|
||||
|
||||
+351
-111
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* IPP backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -62,7 +62,9 @@ typedef struct _cups_monitor_s /**** Monitoring data ****/
|
||||
*resource; /* Resource path */
|
||||
int port, /* Port number */
|
||||
version, /* IPP version */
|
||||
job_id; /* Job ID for submitted job */
|
||||
job_id, /* Job ID for submitted job */
|
||||
get_job_attrs; /* Support Get-Job-Attributes? */
|
||||
const char *job_name; /* Job name for submitted job */
|
||||
http_encryption_t encryption; /* Use encryption? */
|
||||
ipp_jstate_t job_state; /* Current job state */
|
||||
ipp_pstate_t printer_state; /* Current printer state */
|
||||
@@ -82,12 +84,16 @@ static const char * const jattrs[] = /* Job attributes we want */
|
||||
{
|
||||
"job-impressions-completed",
|
||||
"job-media-sheets-completed",
|
||||
"job-name",
|
||||
"job-originating-user-name",
|
||||
"job-state",
|
||||
"job-state-reasons"
|
||||
};
|
||||
static int job_canceled = 0;
|
||||
/* Job cancelled? */
|
||||
static char *password = NULL;
|
||||
static char username[256] = "",
|
||||
/* Username for device URI */
|
||||
*password = NULL;
|
||||
/* Password for device URI */
|
||||
static int password_tries = 0;
|
||||
/* Password tries */
|
||||
@@ -111,7 +117,7 @@ static const char * const pattrs[] = /* Printer attributes we want */
|
||||
"printer-is-accepting-jobs",
|
||||
"printer-state",
|
||||
"printer-state-message",
|
||||
"printer-state-reasons",
|
||||
"printer-state-reasons"
|
||||
};
|
||||
static const char * const remote_job_states[] =
|
||||
{ /* Remote job state keywords */
|
||||
@@ -186,7 +192,6 @@ main(int argc, /* I - Number of command-line args */
|
||||
const char *device_uri; /* Device URI */
|
||||
char scheme[255], /* Scheme in URI */
|
||||
hostname[1024], /* Hostname */
|
||||
username[255], /* Username info */
|
||||
resource[1024], /* Resource info (printer name) */
|
||||
addrname[256], /* Address name */
|
||||
*optptr, /* Pointer to URI options */
|
||||
@@ -205,6 +210,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
int port; /* Port number (not used) */
|
||||
char portname[255]; /* Port name */
|
||||
char uri[HTTP_MAX_URI]; /* Updated URI without user/pass */
|
||||
char print_job_name[1024]; /* Update job-name for Print-Job */
|
||||
http_status_t http_status; /* Status of HTTP request */
|
||||
ipp_status_t ipp_status; /* Status of IPP request */
|
||||
http_t *http; /* HTTP connection */
|
||||
@@ -231,7 +237,10 @@ main(int argc, /* I - Number of command-line args */
|
||||
ipp_attribute_t *doc_handling_sup; /* multiple-document-handling-supported */
|
||||
ipp_attribute_t *printer_state; /* printer-state attribute */
|
||||
ipp_attribute_t *printer_accepting; /* printer-is-accepting-jobs */
|
||||
int validate_job; /* Does printer support Validate-Job? */
|
||||
int create_job = 0, /* Does printer support Create-Job? */
|
||||
get_job_attrs = 0, /* Does printer support Get-Job-Attributes? */
|
||||
send_document = 0, /* Does printer support Send-Document? */
|
||||
validate_job = 0; /* Does printer support Validate-Job? */
|
||||
int copies, /* Number of copies for job */
|
||||
copies_remaining; /* Number of copies remaining */
|
||||
const char *content_type, /* CONTENT_TYPE environment variable */
|
||||
@@ -553,6 +562,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
if (argc == 6)
|
||||
{
|
||||
num_files = 0;
|
||||
files = NULL;
|
||||
send_options = !_cups_strcasecmp(final_content_type, "application/pdf") ||
|
||||
!_cups_strcasecmp(final_content_type, "application/vnd.cups-pdf") ||
|
||||
!_cups_strncasecmp(final_content_type, "image/", 6);
|
||||
@@ -603,7 +613,10 @@ main(int argc, /* I - Number of command-line args */
|
||||
const char *ptr = getenv("AUTH_USERNAME");
|
||||
|
||||
if (ptr)
|
||||
{
|
||||
strlcpy(username, ptr, sizeof(username));
|
||||
cupsSetUser(ptr);
|
||||
}
|
||||
|
||||
password = getenv("AUTH_PASSWORD");
|
||||
}
|
||||
@@ -788,7 +801,6 @@ main(int argc, /* I - Number of command-line args */
|
||||
supported = NULL;
|
||||
operations_sup = NULL;
|
||||
doc_handling_sup = NULL;
|
||||
validate_job = 0;
|
||||
|
||||
do
|
||||
{
|
||||
@@ -833,7 +845,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
fprintf(stderr, "DEBUG: Get-Printer-Attributes: %s (%s)\n",
|
||||
ippErrorString(ipp_status), cupsLastErrorString());
|
||||
|
||||
if (ipp_status > IPP_OK_CONFLICT)
|
||||
if (ipp_status <= IPP_OK_CONFLICT)
|
||||
password_tries = 0;
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Get-Printer-Attributes returned %s.\n",
|
||||
ippErrorString(ipp_status));
|
||||
@@ -890,16 +904,21 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
else if (ipp_status == IPP_NOT_AUTHORIZED || ipp_status == IPP_FORBIDDEN)
|
||||
else if (ipp_status == IPP_FORBIDDEN ||
|
||||
ipp_status == IPP_AUTHENTICATION_CANCELED)
|
||||
{
|
||||
if (!strncmp(httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE),
|
||||
"Negotiate", 9))
|
||||
const char *www_auth = httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE);
|
||||
/* WWW-Authenticate field value */
|
||||
|
||||
if (!strncmp(www_auth, "Negotiate", 9))
|
||||
auth_info_required = "negotiate";
|
||||
else if (www_auth[0])
|
||||
auth_info_required = "username,password";
|
||||
|
||||
fprintf(stderr, "ATTR: auth-info-required=%s\n", auth_info_required);
|
||||
return (CUPS_BACKEND_AUTH_REQUIRED);
|
||||
}
|
||||
else
|
||||
else if (ipp_status != IPP_NOT_AUTHORIZED)
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("Unable to get printer status."));
|
||||
@@ -1041,11 +1060,23 @@ main(int argc, /* I - Number of command-line args */
|
||||
"cups-ipp-missing-get-printer-attributes");
|
||||
|
||||
for (i = 0; i < operations_sup->num_values; i ++)
|
||||
{
|
||||
if (operations_sup->values[i].integer == IPP_VALIDATE_JOB)
|
||||
{
|
||||
validate_job = 1;
|
||||
break;
|
||||
}
|
||||
else if (operations_sup->values[i].integer == IPP_CREATE_JOB)
|
||||
create_job = 1;
|
||||
else if (operations_sup->values[i].integer == IPP_SEND_DOCUMENT)
|
||||
send_document = 1;
|
||||
else if (operations_sup->values[i].integer == IPP_GET_JOB_ATTRIBUTES)
|
||||
get_job_attrs = 1;
|
||||
}
|
||||
|
||||
if (!send_document)
|
||||
{
|
||||
fputs("DEBUG: Printer supports Create-Job but not Send-Document.\n",
|
||||
stderr);
|
||||
create_job = 0;
|
||||
}
|
||||
|
||||
if (!validate_job)
|
||||
update_reasons(NULL, "+cups-ipp-conformance-failure-report,"
|
||||
@@ -1115,7 +1146,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
{
|
||||
copies_remaining = 1;
|
||||
|
||||
if (argc < 7 && !send_options)
|
||||
if (argc < 7 && !_cups_strncasecmp(final_content_type, "image/", 6))
|
||||
copies = 1;
|
||||
}
|
||||
else
|
||||
@@ -1152,7 +1183,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
if (format_sup != NULL)
|
||||
{
|
||||
for (i = 0; i < format_sup->num_values; i ++)
|
||||
if (!_cups_strcasecmp(final_content_type, format_sup->values[i].string.text))
|
||||
if (!_cups_strcasecmp(final_content_type,
|
||||
format_sup->values[i].string.text))
|
||||
{
|
||||
document_format = final_content_type;
|
||||
break;
|
||||
@@ -1162,7 +1194,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
{
|
||||
for (i = 0; i < format_sup->num_values; i ++)
|
||||
if (!_cups_strcasecmp("application/octet-stream",
|
||||
format_sup->values[i].string.text))
|
||||
format_sup->values[i].string.text))
|
||||
{
|
||||
document_format = "application/octet-stream";
|
||||
break;
|
||||
@@ -1170,6 +1202,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: final_content_type=\"%s\", document_format=\"%s\"\n",
|
||||
final_content_type, document_format ? document_format : "(null)");
|
||||
|
||||
/*
|
||||
* If the printer does not support HTTP/1.1 (which IPP requires), copy stdin
|
||||
* to a temporary file so that we can do a HTTP/1.0 submission...
|
||||
@@ -1187,8 +1222,17 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Copying print data."));
|
||||
|
||||
compatsize = backendRunLoop(-1, fd, snmp_fd, &(addrlist->addr), 0, 0,
|
||||
backendNetworkSideCB);
|
||||
if ((compatsize = write(fd, buffer, bytes)) < 0)
|
||||
{
|
||||
perror("DEBUG: Unable to write temporary file");
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
if ((bytes = backendRunLoop(-1, fd, snmp_fd, &(addrlist->addr), 0, 0,
|
||||
backendNetworkSideCB)) < 0)
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
|
||||
compatsize += bytes;
|
||||
|
||||
close(fd);
|
||||
|
||||
@@ -1215,10 +1259,22 @@ main(int argc, /* I - Number of command-line args */
|
||||
monitor.port = port;
|
||||
monitor.version = version;
|
||||
monitor.job_id = 0;
|
||||
monitor.get_job_attrs = get_job_attrs;
|
||||
monitor.encryption = cupsEncryption();
|
||||
monitor.job_state = IPP_JOB_PENDING;
|
||||
monitor.printer_state = IPP_PRINTER_IDLE;
|
||||
|
||||
if (create_job)
|
||||
{
|
||||
monitor.job_name = argv[3];
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(print_job_name, sizeof(print_job_name), "%s - %s", argv[1],
|
||||
argv[3]);
|
||||
monitor.job_name = print_job_name;
|
||||
}
|
||||
|
||||
_cupsThreadCreate((_cups_thread_func_t)monitor_printer, &monitor);
|
||||
|
||||
/*
|
||||
@@ -1227,8 +1283,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
while (!job_canceled && validate_job)
|
||||
{
|
||||
request = new_request(IPP_VALIDATE_JOB, version, uri, argv[2], argv[3],
|
||||
num_options, options, compression,
|
||||
request = new_request(IPP_VALIDATE_JOB, version, uri, argv[2],
|
||||
monitor.job_name, num_options, options, compression,
|
||||
copies_sup ? copies : 1, document_format, pc,
|
||||
media_col_sup, doc_handling_sup);
|
||||
|
||||
@@ -1247,26 +1303,18 @@ main(int argc, /* I - Number of command-line args */
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("The printer is busy."));
|
||||
sleep(10);
|
||||
}
|
||||
else if (ipp_status == IPP_NOT_AUTHORIZED || ipp_status == IPP_FORBIDDEN ||
|
||||
else if (ipp_status == IPP_DOCUMENT_FORMAT)
|
||||
goto cleanup;
|
||||
else if (ipp_status == IPP_FORBIDDEN ||
|
||||
ipp_status == IPP_AUTHENTICATION_CANCELED)
|
||||
{
|
||||
/*
|
||||
* Update auth-info-required as needed...
|
||||
*/
|
||||
const char *www_auth = httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE);
|
||||
/* WWW-Authenticate field value */
|
||||
|
||||
fprintf(stderr, "DEBUG: WWW-Authenticate=\"%s\"\n",
|
||||
httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE));
|
||||
|
||||
/*
|
||||
* Normal authentication goes through the password callback, which sets
|
||||
* auth_info_required to "username,password". Kerberos goes directly
|
||||
* through GSSAPI, so look for Negotiate in the WWW-Authenticate header
|
||||
* here and set auth_info_required as needed...
|
||||
*/
|
||||
|
||||
if (!strncmp(httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE),
|
||||
"Negotiate", 9))
|
||||
if (!strncmp(www_auth, "Negotiate", 9))
|
||||
auth_info_required = "negotiate";
|
||||
else if (www_auth[0])
|
||||
auth_info_required = "username,password";
|
||||
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -1280,7 +1328,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
"cups-ipp-missing-validate-job");
|
||||
break;
|
||||
}
|
||||
else if (ipp_status < IPP_REDIRECTION_OTHER_SITE)
|
||||
else if (ipp_status < IPP_REDIRECTION_OTHER_SITE ||
|
||||
ipp_status == IPP_BAD_REQUEST)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1305,16 +1354,17 @@ main(int argc, /* I - Number of command-line args */
|
||||
if (job_canceled)
|
||||
break;
|
||||
|
||||
request = new_request(num_files > 1 ? IPP_CREATE_JOB : IPP_PRINT_JOB,
|
||||
version, uri, argv[2], argv[3], num_options, options,
|
||||
compression, copies_sup ? copies : 1, document_format,
|
||||
pc, media_col_sup, doc_handling_sup);
|
||||
request = new_request((num_files > 1 || create_job) ? IPP_CREATE_JOB :
|
||||
IPP_PRINT_JOB,
|
||||
version, uri, argv[2], monitor.job_name, num_options,
|
||||
options, compression, copies_sup ? copies : 1,
|
||||
document_format, pc, media_col_sup, doc_handling_sup);
|
||||
|
||||
/*
|
||||
* Do the request...
|
||||
*/
|
||||
|
||||
if (num_files > 1)
|
||||
if (num_files > 1 || create_job)
|
||||
response = cupsDoRequest(http, request, resource);
|
||||
else
|
||||
{
|
||||
@@ -1332,14 +1382,21 @@ main(int argc, /* I - Number of command-line args */
|
||||
if (http_status == HTTP_CONTINUE && request->state == IPP_DATA)
|
||||
{
|
||||
if (num_files == 1)
|
||||
fd = open(files[0], O_RDONLY);
|
||||
{
|
||||
if ((fd = open(files[0], O_RDONLY)) < 0)
|
||||
{
|
||||
_cupsLangPrintError("ERROR", _("Unable to open print file"));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fd = 0;
|
||||
http_status = cupsWriteRequestData(http, buffer, bytes);
|
||||
}
|
||||
|
||||
while (http_status == HTTP_CONTINUE)
|
||||
while (http_status == HTTP_CONTINUE &&
|
||||
(!job_canceled || compatsize > 0))
|
||||
{
|
||||
/*
|
||||
* Check for side-channel requests and more print data...
|
||||
@@ -1380,7 +1437,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
ipp_status = cupsLastError();
|
||||
|
||||
fprintf(stderr, "DEBUG: %s: %s (%s)\n",
|
||||
num_files > 1 ? "Create-Job" : "Print-Job",
|
||||
(num_files > 1 || create_job) ? "Create-Job" : "Print-Job",
|
||||
ippErrorString(ipp_status), cupsLastErrorString());
|
||||
|
||||
if (ipp_status > IPP_OK_CONFLICT)
|
||||
@@ -1391,6 +1448,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
break;
|
||||
|
||||
if (ipp_status == IPP_SERVICE_UNAVAILABLE ||
|
||||
ipp_status == IPP_NOT_POSSIBLE ||
|
||||
ipp_status == IPP_PRINTER_BUSY)
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("The printer is busy."));
|
||||
@@ -1406,6 +1464,10 @@ main(int argc, /* I - Number of command-line args */
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
else if (ipp_status == IPP_ERROR_JOB_CANCELED)
|
||||
goto cleanup;
|
||||
else if (ipp_status == IPP_NOT_AUTHORIZED)
|
||||
continue;
|
||||
else
|
||||
{
|
||||
/*
|
||||
@@ -1415,21 +1477,24 @@ main(int argc, /* I - Number of command-line args */
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("Print file was not accepted."));
|
||||
|
||||
if (ipp_status == IPP_NOT_AUTHORIZED || ipp_status == IPP_FORBIDDEN)
|
||||
if (ipp_status == IPP_FORBIDDEN ||
|
||||
ipp_status == IPP_AUTHENTICATION_CANCELED)
|
||||
{
|
||||
fprintf(stderr, "DEBUG: WWW-Authenticate=\"%s\"\n",
|
||||
httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE));
|
||||
const char *www_auth = httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE);
|
||||
/* WWW-Authenticate field value */
|
||||
|
||||
/*
|
||||
* Normal authentication goes through the password callback, which sets
|
||||
* auth_info_required to "username,password". Kerberos goes directly
|
||||
* through GSSAPI, so look for Negotiate in the WWW-Authenticate header
|
||||
* here and set auth_info_required as needed...
|
||||
if (!strncmp(www_auth, "Negotiate", 9))
|
||||
auth_info_required = "negotiate";
|
||||
else if (www_auth[0])
|
||||
auth_info_required = "username,password";
|
||||
}
|
||||
else if (ipp_status == IPP_REQUEST_VALUE)
|
||||
{
|
||||
/*
|
||||
* Print file is too large, abort this job...
|
||||
*/
|
||||
|
||||
if (!strncmp(httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE),
|
||||
"Negotiate", 9))
|
||||
auth_info_required = "negotiate";
|
||||
goto cleanup;
|
||||
}
|
||||
else
|
||||
sleep(10);
|
||||
@@ -1456,19 +1521,21 @@ main(int argc, /* I - Number of command-line args */
|
||||
}
|
||||
else
|
||||
{
|
||||
password_tries = 0;
|
||||
monitor.job_id = job_id = job_id_attr->values[0].integer;
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Print file accepted - job ID %d."), job_id);
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: job-id=%d\n", job_id);
|
||||
ippDelete(response);
|
||||
|
||||
if (job_canceled)
|
||||
break;
|
||||
|
||||
if (job_id && num_files > 1)
|
||||
if (job_id && (num_files > 1 || create_job))
|
||||
{
|
||||
for (i = 0; i < num_files; i ++)
|
||||
for (i = 0; num_files == 0 || i < num_files; i ++)
|
||||
{
|
||||
/*
|
||||
* Check for side-channel requests...
|
||||
@@ -1494,20 +1561,41 @@ main(int argc, /* I - Number of command-line args */
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
|
||||
"requesting-user-name", NULL, argv[2]);
|
||||
|
||||
if ((i + 1) == num_files)
|
||||
if ((i + 1) >= num_files)
|
||||
ippAddBoolean(request, IPP_TAG_OPERATION, "last-document", 1);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE,
|
||||
"document-format", NULL, content_type);
|
||||
if (document_format)
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE,
|
||||
"document-format", NULL, document_format);
|
||||
|
||||
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 &&
|
||||
(fd = open(files[i], O_RDONLY)) >= 0)
|
||||
if (http_status == HTTP_CONTINUE && request->state == IPP_DATA)
|
||||
{
|
||||
while ((bytes = read(fd, buffer, sizeof(buffer))) > 0)
|
||||
if (num_files == 0)
|
||||
{
|
||||
if (cupsWriteRequestData(http, buffer, bytes) != HTTP_CONTINUE)
|
||||
fd = 0;
|
||||
http_status = cupsWriteRequestData(http, buffer, bytes);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((fd = open(files[i], O_RDONLY)) < 0)
|
||||
{
|
||||
_cupsLangPrintError("ERROR", _("Unable to open print file"));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
fd = -1;
|
||||
|
||||
if (fd >= 0)
|
||||
{
|
||||
while (!job_canceled && http_status == HTTP_CONTINUE &&
|
||||
(bytes = read(fd, buffer, sizeof(buffer))) > 0)
|
||||
{
|
||||
if ((http_status = cupsWriteRequestData(http, buffer, bytes))
|
||||
!= HTTP_CONTINUE)
|
||||
break;
|
||||
else
|
||||
{
|
||||
@@ -1519,7 +1607,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
}
|
||||
}
|
||||
|
||||
close(fd);
|
||||
if (fd > 0)
|
||||
close(fd);
|
||||
}
|
||||
|
||||
ippDelete(cupsGetResponse(http, resource));
|
||||
@@ -1536,6 +1625,13 @@ main(int argc, /* I - Number of command-line args */
|
||||
_("Unable to add document to print job."));
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
password_tries = 0;
|
||||
|
||||
if (num_files == 0 || fd < 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1545,8 +1641,17 @@ main(int argc, /* I - Number of command-line args */
|
||||
copies_remaining --;
|
||||
}
|
||||
else if (ipp_status == IPP_SERVICE_UNAVAILABLE ||
|
||||
ipp_status == IPP_NOT_POSSIBLE ||
|
||||
ipp_status == IPP_PRINTER_BUSY)
|
||||
continue;
|
||||
else if (ipp_status == IPP_REQUEST_VALUE)
|
||||
{
|
||||
/*
|
||||
* Print file is too large, abort this job...
|
||||
*/
|
||||
|
||||
goto cleanup;
|
||||
}
|
||||
else
|
||||
copies_remaining --;
|
||||
|
||||
@@ -1554,7 +1659,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Wait for the job to complete...
|
||||
*/
|
||||
|
||||
if (!job_id || !waitjob)
|
||||
if (!job_id || !waitjob || !get_job_attrs)
|
||||
continue;
|
||||
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Waiting for job to complete."));
|
||||
@@ -1597,7 +1702,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
response = cupsDoRequest(http, request, resource);
|
||||
ipp_status = cupsLastError();
|
||||
|
||||
if (ipp_status == IPP_NOT_FOUND)
|
||||
if (ipp_status == IPP_NOT_FOUND || ipp_status == IPP_NOT_POSSIBLE)
|
||||
{
|
||||
/*
|
||||
* Job has gone away and/or the server has no job history...
|
||||
@@ -1614,15 +1719,15 @@ main(int argc, /* I - Number of command-line args */
|
||||
fprintf(stderr, "DEBUG: Get-Job-Attributes: %s (%s)\n",
|
||||
ippErrorString(ipp_status), cupsLastErrorString());
|
||||
|
||||
if (ipp_status > IPP_OK_CONFLICT)
|
||||
if (ipp_status <= IPP_OK_CONFLICT)
|
||||
password_tries = 0;
|
||||
else
|
||||
{
|
||||
if (ipp_status != IPP_SERVICE_UNAVAILABLE &&
|
||||
ipp_status != IPP_PRINTER_BUSY)
|
||||
{
|
||||
ippDelete(response);
|
||||
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("Unable to get print job status."));
|
||||
ipp_status = IPP_OK;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1664,7 +1769,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (ipp_status != IPP_SERVICE_UNAVAILABLE &&
|
||||
ipp_status != IPP_NOT_POSSIBLE &&
|
||||
ipp_status != IPP_PRINTER_BUSY)
|
||||
{
|
||||
/*
|
||||
* If the printer does not return a job-state attribute, it does not
|
||||
@@ -1764,10 +1871,20 @@ main(int argc, /* I - Number of command-line args */
|
||||
return (CUPS_BACKEND_AUTH_REQUIRED);
|
||||
else if (ipp_status == IPP_INTERNAL_ERROR)
|
||||
return (CUPS_BACKEND_STOP);
|
||||
else if (ipp_status == IPP_DOCUMENT_FORMAT ||
|
||||
ipp_status == IPP_CONFLICT)
|
||||
else if (ipp_status == IPP_CONFLICT)
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
else if (ipp_status > IPP_OK_CONFLICT)
|
||||
else if (ipp_status == IPP_REQUEST_VALUE ||
|
||||
ipp_status == IPP_DOCUMENT_FORMAT)
|
||||
{
|
||||
if (ipp_status == IPP_REQUEST_VALUE)
|
||||
_cupsLangPrintFilter(stderr, "ERROR", _("Print job too large."));
|
||||
else
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("Printer cannot print supplied content."));
|
||||
|
||||
return (CUPS_BACKEND_CANCEL);
|
||||
}
|
||||
else if (ipp_status > IPP_OK_CONFLICT && ipp_status != IPP_ERROR_JOB_CANCELED)
|
||||
return (CUPS_BACKEND_RETRY_CURRENT);
|
||||
else
|
||||
{
|
||||
@@ -1869,6 +1986,9 @@ 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...
|
||||
*/
|
||||
@@ -1962,6 +2082,11 @@ monitor_printer(
|
||||
ipp_attribute_t *attr; /* Attribute in response */
|
||||
int delay, /* Current delay */
|
||||
prev_delay; /* Previous delay */
|
||||
ipp_op_t job_op; /* Operation to use */
|
||||
int job_id; /* Job ID */
|
||||
const char *job_name; /* Job name */
|
||||
ipp_jstate_t job_state; /* Job state */
|
||||
const char *job_user; /* Job originating user name */
|
||||
|
||||
|
||||
/*
|
||||
@@ -1971,6 +2096,8 @@ monitor_printer(
|
||||
http = _httpCreate(monitor->hostname, monitor->port, NULL, monitor->encryption,
|
||||
AF_UNSPEC);
|
||||
httpSetTimeout(http, 30.0, timeout_cb, NULL);
|
||||
if (username[0])
|
||||
cupsSetUser(username);
|
||||
cupsSetPasswordCB(password_cb);
|
||||
|
||||
/*
|
||||
@@ -1996,46 +2123,99 @@ monitor_printer(
|
||||
monitor->user,
|
||||
monitor->version);
|
||||
|
||||
if (monitor->job_id > 0)
|
||||
{
|
||||
/*
|
||||
* Check the status of the job itself...
|
||||
*/
|
||||
/*
|
||||
* Check the status of the job itself...
|
||||
*/
|
||||
|
||||
request = ippNewRequest(IPP_GET_JOB_ATTRIBUTES);
|
||||
request->request.op.version[0] = monitor->version / 10;
|
||||
request->request.op.version[1] = monitor->version % 10;
|
||||
job_op = (monitor->job_id > 0 && monitor->get_job_attrs) ?
|
||||
IPP_GET_JOB_ATTRIBUTES : IPP_GET_JOBS;
|
||||
request = ippNewRequest(job_op);
|
||||
request->request.op.version[0] = monitor->version / 10;
|
||||
request->request.op.version[1] = monitor->version % 10;
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, monitor->uri);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, monitor->uri);
|
||||
if (job_op == IPP_GET_JOB_ATTRIBUTES)
|
||||
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id",
|
||||
monitor->job_id);
|
||||
monitor->job_id);
|
||||
|
||||
if (monitor->user && monitor->user[0])
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
|
||||
"requesting-user-name", NULL, monitor->user);
|
||||
if (monitor->user && monitor->user[0])
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
|
||||
"requesting-user-name", NULL, monitor->user);
|
||||
|
||||
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
||||
"requested-attributes",
|
||||
(int)(sizeof(jattrs) / sizeof(jattrs[0])), NULL, jattrs);
|
||||
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
||||
"requested-attributes",
|
||||
(int)(sizeof(jattrs) / sizeof(jattrs[0])), NULL, jattrs);
|
||||
|
||||
/*
|
||||
* Do the request...
|
||||
*/
|
||||
/*
|
||||
* Do the request...
|
||||
*/
|
||||
|
||||
response = cupsDoRequest(http, request, monitor->resource);
|
||||
response = cupsDoRequest(http, request, monitor->resource);
|
||||
|
||||
fprintf(stderr, "DEBUG: Get-Job-Attributes: %s (%s)\n",
|
||||
ippErrorString(cupsLastError()), cupsLastErrorString());
|
||||
fprintf(stderr, "DEBUG: %s: %s (%s)\n", ippOpString(job_op),
|
||||
ippErrorString(cupsLastError()), cupsLastErrorString());
|
||||
|
||||
if (cupsLastError() <= IPP_OK_CONFLICT)
|
||||
password_tries = 0;
|
||||
|
||||
if (job_op == IPP_GET_JOB_ATTRIBUTES)
|
||||
{
|
||||
if ((attr = ippFindAttribute(response, "job-state",
|
||||
IPP_TAG_ENUM)) != NULL)
|
||||
monitor->job_state = (ipp_jstate_t)attr->values[0].integer;
|
||||
else
|
||||
monitor->job_state = IPP_JOB_COMPLETED;
|
||||
|
||||
ippDelete(response);
|
||||
}
|
||||
else if (response)
|
||||
{
|
||||
for (attr = response->attrs; attr; attr = attr->next)
|
||||
{
|
||||
job_id = 0;
|
||||
job_name = NULL;
|
||||
job_state = IPP_JOB_PENDING;
|
||||
job_user = NULL;
|
||||
|
||||
while (attr && attr->group_tag != IPP_TAG_JOB)
|
||||
attr = attr->next;
|
||||
|
||||
if (!attr)
|
||||
break;
|
||||
|
||||
while (attr && attr->group_tag == IPP_TAG_JOB)
|
||||
{
|
||||
if (!strcmp(attr->name, "job-id") &&
|
||||
attr->value_tag == IPP_TAG_INTEGER)
|
||||
job_id = attr->values[0].integer;
|
||||
else if (!strcmp(attr->name, "job-name") &&
|
||||
(attr->value_tag == IPP_TAG_NAME ||
|
||||
attr->value_tag == IPP_TAG_NAMELANG))
|
||||
job_name = attr->values[0].string.text;
|
||||
else if (!strcmp(attr->name, "job-state") &&
|
||||
attr->value_tag == IPP_TAG_ENUM)
|
||||
job_state = attr->values[0].integer;
|
||||
else if (!strcmp(attr->name, "job-originating-user-name") &&
|
||||
(attr->value_tag == IPP_TAG_NAME ||
|
||||
attr->value_tag == IPP_TAG_NAMELANG))
|
||||
job_user = attr->values[0].string.text;
|
||||
|
||||
attr = attr->next;
|
||||
}
|
||||
|
||||
if (job_id > 0 && job_name && !strcmp(job_name, monitor->job_name) &&
|
||||
job_user && monitor->user && !strcmp(job_user, monitor->user))
|
||||
{
|
||||
monitor->job_id = job_id;
|
||||
monitor->job_state = job_state;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!attr)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ippDelete(response);
|
||||
|
||||
/*
|
||||
* Disconnect from the printer - we'll reconnect on the next poll...
|
||||
@@ -2053,6 +2233,15 @@ monitor_printer(
|
||||
delay = _cupsNextDelay(delay, &prev_delay);
|
||||
}
|
||||
|
||||
/*
|
||||
* Cancel the job if necessary...
|
||||
*/
|
||||
|
||||
if (job_canceled && monitor->job_id > 0)
|
||||
if (!httpReconnect(http))
|
||||
cancel_job(http, monitor->uri, monitor->job_id, monitor->resource,
|
||||
monitor->user, monitor->version);
|
||||
|
||||
/*
|
||||
* Cleanup and return...
|
||||
*/
|
||||
@@ -2078,7 +2267,7 @@ new_request(
|
||||
cups_option_t *options, /* I - Options to send */
|
||||
const char *compression, /* I - compression value or NULL */
|
||||
int copies, /* I - copies value or 0 */
|
||||
const char *format, /* I - documet-format value or NULL */
|
||||
const char *format, /* I - document-format value or NULL */
|
||||
_ppd_cache_t *pc, /* I - PPD cache and mapping data */
|
||||
ipp_attribute_t *media_col_sup, /* I - media-col-supported values */
|
||||
ipp_attribute_t *doc_handling_sup) /* I - multiple-document-handling-supported values */
|
||||
@@ -2129,7 +2318,7 @@ new_request(
|
||||
fprintf(stderr, "DEBUG: job-name=\"%s\"\n", title);
|
||||
}
|
||||
|
||||
if (format)
|
||||
if (format && op != IPP_CREATE_JOB)
|
||||
{
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE,
|
||||
"document-format", NULL, format);
|
||||
@@ -2137,7 +2326,7 @@ new_request(
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBZ
|
||||
if (compression)
|
||||
if (compression && op != IPP_CREATE_JOB)
|
||||
{
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
||||
"compression", NULL, compression);
|
||||
@@ -2153,6 +2342,9 @@ new_request(
|
||||
{
|
||||
if (pc)
|
||||
{
|
||||
int num_finishings = 0, /* Number of finishing values */
|
||||
finishings[10]; /* Finishing enum values */
|
||||
|
||||
/*
|
||||
* Send standard IPP attributes...
|
||||
*/
|
||||
@@ -2191,15 +2383,15 @@ new_request(
|
||||
else if (!strcmp(media_col_sup->values[i].string.text,
|
||||
"media-bottom-margin"))
|
||||
ippAddInteger(media_col, IPP_TAG_ZERO, IPP_TAG_INTEGER,
|
||||
"media-bottom-margin", size->left);
|
||||
"media-bottom-margin", size->bottom);
|
||||
else if (!strcmp(media_col_sup->values[i].string.text,
|
||||
"media-right-margin"))
|
||||
ippAddInteger(media_col, IPP_TAG_ZERO, IPP_TAG_INTEGER,
|
||||
"media-right-margin", size->left);
|
||||
"media-right-margin", size->right);
|
||||
else if (!strcmp(media_col_sup->values[i].string.text,
|
||||
"media-top-margin"))
|
||||
ippAddInteger(media_col, IPP_TAG_ZERO, IPP_TAG_INTEGER,
|
||||
"media-top-margin", size->left);
|
||||
"media-top-margin", size->top);
|
||||
else if (!strcmp(media_col_sup->values[i].string.text,
|
||||
"media-source") && media_source)
|
||||
ippAddString(media_col, IPP_TAG_ZERO, IPP_TAG_KEYWORD,
|
||||
@@ -2274,6 +2466,7 @@ new_request(
|
||||
}
|
||||
|
||||
if (doc_handling_sup &&
|
||||
(!format || _cups_strncasecmp(format, "image/", 6)) &&
|
||||
(keyword = cupsGetOption("collate", num_options, options)) != NULL)
|
||||
{
|
||||
if (!_cups_strcasecmp(keyword, "true"))
|
||||
@@ -2289,6 +2482,43 @@ new_request(
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Map finishing options...
|
||||
*/
|
||||
|
||||
num_finishings = _ppdCacheGetFinishingValues(pc, num_options, options,
|
||||
(int)(sizeof(finishings) /
|
||||
sizeof(finishings[0])),
|
||||
finishings);
|
||||
if (num_finishings > 0)
|
||||
ippAddIntegers(request, IPP_TAG_JOB, IPP_TAG_ENUM, "finishings",
|
||||
num_finishings, finishings);
|
||||
|
||||
/*
|
||||
* Map FaxOut options...
|
||||
*/
|
||||
|
||||
if ((keyword = cupsGetOption("phone", num_options, options)) != NULL)
|
||||
{
|
||||
ipp_t *destination; /* destination collection */
|
||||
char tel_uri[1024]; /* tel: URI */
|
||||
|
||||
destination = ippNew();
|
||||
|
||||
httpAssembleURI(HTTP_URI_CODING_ALL, tel_uri, sizeof(tel_uri), "tel",
|
||||
NULL, NULL, 0, keyword);
|
||||
ippAddString(destination, IPP_TAG_JOB, IPP_TAG_URI, "destination-uri",
|
||||
NULL, tel_uri);
|
||||
|
||||
if ((keyword = cupsGetOption("faxPrefix", num_options,
|
||||
options)) != NULL && *keyword)
|
||||
ippAddString(destination, IPP_TAG_JOB, IPP_TAG_TEXT,
|
||||
"pre-dial-string", NULL, keyword);
|
||||
|
||||
ippAddCollection(request, IPP_TAG_JOB, "destination-uris", destination);
|
||||
ippDelete(destination);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2296,7 +2526,7 @@ new_request(
|
||||
* When talking to another CUPS server, send all options...
|
||||
*/
|
||||
|
||||
cupsEncodeOptions(request, num_options, options);
|
||||
cupsEncodeOptions2(request, num_options, options, IPP_TAG_JOB);
|
||||
}
|
||||
|
||||
if (copies > 1)
|
||||
@@ -2314,6 +2544,9 @@ new_request(
|
||||
static const char * /* O - Password */
|
||||
password_cb(const char *prompt) /* I - Prompt (not used) */
|
||||
{
|
||||
fprintf(stderr, "DEBUG: password_cb(prompt=\"%s\"), password=%p, "
|
||||
"password_tries=%d\n", prompt, password, password_tries);
|
||||
|
||||
(void)prompt;
|
||||
|
||||
/*
|
||||
@@ -2376,17 +2609,23 @@ report_attr(ipp_attribute_t *attr) /* I - Attribute */
|
||||
case IPP_TAG_TEXT :
|
||||
case IPP_TAG_NAME :
|
||||
case IPP_TAG_KEYWORD :
|
||||
*valptr++ = '\'';
|
||||
*valptr++ = '\"';
|
||||
for (attrptr = attr->values[i].string.text;
|
||||
*attrptr && valptr < (value + sizeof(value) - 10);
|
||||
attrptr ++)
|
||||
{
|
||||
if (*attrptr == '\\' || *attrptr == '\"')
|
||||
if (*attrptr == '\\' || *attrptr == '\"' || *attrptr == '\'')
|
||||
{
|
||||
*valptr++ = '\\';
|
||||
*valptr++ = '\\';
|
||||
*valptr++ = '\\';
|
||||
}
|
||||
|
||||
*valptr++ = *attrptr;
|
||||
}
|
||||
*valptr++ = '\"';
|
||||
*valptr++ = '\'';
|
||||
break;
|
||||
|
||||
default :
|
||||
@@ -2821,6 +3060,7 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */
|
||||
if (strcmp(reason, "none") &&
|
||||
strcmp(reason, "none-report") &&
|
||||
strcmp(reason, "paused") &&
|
||||
strncmp(reason, "spool-area-full", 15) &&
|
||||
strcmp(reason, "com.apple.print.recoverable-warning") &&
|
||||
strncmp(reason, "cups-", 5))
|
||||
cupsArrayAdd(new_reasons, reason);
|
||||
|
||||
+32
-68
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Line Printer Daemon backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -19,7 +19,6 @@
|
||||
* main() - Send a file to the printer or server.
|
||||
* lpd_command() - Send an LPR command sequence and wait for a reply.
|
||||
* lpd_queue() - Queue a file using the Line Printer Daemon protocol.
|
||||
* lpd_timeout() - Handle timeout alarms...
|
||||
* lpd_write() - Write a buffer of data to an LPD server.
|
||||
* rresvport_af() - A simple implementation of rresvport_af().
|
||||
* sigterm_handler() - Handle 'terminate' signals that stop the backend.
|
||||
@@ -87,14 +86,13 @@ static int abort_job = 0; /* Non-zero if we get SIGTERM */
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static int lpd_command(int lpd_fd, int timeout, char *format, ...);
|
||||
static int lpd_command(int lpd_fd, char *format, ...);
|
||||
static int lpd_queue(const char *hostname, http_addrlist_t *addrlist,
|
||||
const char *printer, int print_fd, int snmp_fd,
|
||||
int mode, const char *user, const char *title,
|
||||
int copies, int banner, int format, int order,
|
||||
int reserve, int manual_copies, int timeout,
|
||||
int contimeout);
|
||||
static void lpd_timeout(int sig);
|
||||
static int lpd_write(int lpd_fd, char *buffer, int length);
|
||||
#ifndef HAVE_RRESVPORT_AF
|
||||
static int rresvport_af(int *port, int family);
|
||||
@@ -564,7 +562,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
static int /* O - Status of command */
|
||||
lpd_command(int fd, /* I - Socket connection to LPD host */
|
||||
int timeout, /* I - Seconds to wait for a response */
|
||||
char *format, /* I - printf()-style format string */
|
||||
...) /* I - Additional args as necessary */
|
||||
{
|
||||
@@ -609,18 +606,12 @@ lpd_command(int fd, /* I - Socket connection to LPD host */
|
||||
|
||||
fputs("DEBUG: Reading command status...\n", stderr);
|
||||
|
||||
alarm(timeout);
|
||||
|
||||
if (recv(fd, &status, 1, 0) < 1)
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("Printer did not respond after %d seconds."),
|
||||
timeout);
|
||||
_cupsLangPrintFilter(stderr, "WARNING", _("Printer did not respond."));
|
||||
status = errno;
|
||||
}
|
||||
|
||||
alarm(0);
|
||||
|
||||
fprintf(stderr, "DEBUG: lpd_command returning %d\n", status);
|
||||
|
||||
return (status);
|
||||
@@ -666,26 +657,12 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
size_t nbytes; /* Number of bytes written */
|
||||
off_t tbytes; /* Total bytes written */
|
||||
char buffer[32768]; /* Output buffer */
|
||||
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
struct sigaction action; /* Actions for POSIX signals */
|
||||
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
|
||||
|
||||
|
||||
/*
|
||||
* Setup an alarm handler for timeouts...
|
||||
*/
|
||||
|
||||
#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
|
||||
sigset(SIGALRM, lpd_timeout);
|
||||
#elif defined(HAVE_SIGACTION)
|
||||
memset(&action, 0, sizeof(action));
|
||||
|
||||
sigemptyset(&action.sa_mask);
|
||||
action.sa_handler = lpd_timeout;
|
||||
sigaction(SIGALRM, &action, NULL);
|
||||
#ifdef WIN32
|
||||
DWORD tv; /* Timeout in milliseconds */
|
||||
#else
|
||||
signal(SIGALRM, lpd_timeout);
|
||||
#endif /* HAVE_SIGSET */
|
||||
struct timeval tv; /* Timeout in secs and usecs */
|
||||
#endif /* WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
* Remember when we started trying to connect to the printer...
|
||||
@@ -864,6 +841,23 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the timeout...
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
tv = (DWORD)(timeout * 1000);
|
||||
|
||||
setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(tv));
|
||||
setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, (char *)&tv, sizeof(tv));
|
||||
#else
|
||||
tv.tv_sec = timeout;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
|
||||
setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
|
||||
#endif /* WIN32 */
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Connected to printer."));
|
||||
|
||||
@@ -926,7 +920,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
* literal output...
|
||||
*/
|
||||
|
||||
if (lpd_command(fd, timeout, "\002%s\n",
|
||||
if (lpd_command(fd, "\002%s\n",
|
||||
printer)) /* Receive print job(s) */
|
||||
{
|
||||
close(fd);
|
||||
@@ -978,7 +972,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
* Send the control file...
|
||||
*/
|
||||
|
||||
if (lpd_command(fd, timeout, "\002%d cfA%03.3d%.15s\n", strlen(control),
|
||||
if (lpd_command(fd, "\002%d cfA%03.3d%.15s\n", strlen(control),
|
||||
(int)getpid() % 1000, localhost))
|
||||
{
|
||||
close(fd);
|
||||
@@ -997,17 +991,12 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
}
|
||||
else
|
||||
{
|
||||
alarm(timeout);
|
||||
|
||||
if (read(fd, &status, 1) < 1)
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("Printer did not respond after %d seconds."),
|
||||
timeout);
|
||||
_("Printer did not respond."));
|
||||
status = errno;
|
||||
}
|
||||
|
||||
alarm(0);
|
||||
}
|
||||
|
||||
if (status != 0)
|
||||
@@ -1033,7 +1022,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
* Send the print file...
|
||||
*/
|
||||
|
||||
if (lpd_command(fd, timeout, "\003" CUPS_LLFMT " dfA%03.3d%.15s\n",
|
||||
if (lpd_command(fd, "\003" CUPS_LLFMT " dfA%03.3d%.15s\n",
|
||||
CUPS_LLCAST filestats.st_size, (int)getpid() % 1000,
|
||||
localhost))
|
||||
{
|
||||
@@ -1084,17 +1073,12 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
* want to requeue it over and over...
|
||||
*/
|
||||
|
||||
alarm(timeout);
|
||||
|
||||
if (recv(fd, &status, 1, 0) < 1)
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("Printer did not respond after %d seconds."),
|
||||
timeout);
|
||||
_("Printer did not respond."));
|
||||
status = 0;
|
||||
}
|
||||
|
||||
alarm(0);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1121,7 +1105,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
* Send control file...
|
||||
*/
|
||||
|
||||
if (lpd_command(fd, timeout, "\002%d cfA%03.3d%.15s\n", strlen(control),
|
||||
if (lpd_command(fd, "\002%d cfA%03.3d%.15s\n", strlen(control),
|
||||
(int)getpid() % 1000, localhost))
|
||||
{
|
||||
close(fd);
|
||||
@@ -1139,17 +1123,12 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
}
|
||||
else
|
||||
{
|
||||
alarm(timeout);
|
||||
|
||||
if (read(fd, &status, 1) < 1)
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("Printer did not respond after %d seconds."),
|
||||
timeout);
|
||||
_("Printer did not respond."));
|
||||
status = errno;
|
||||
}
|
||||
|
||||
alarm(0);
|
||||
}
|
||||
|
||||
if (status != 0)
|
||||
@@ -1192,21 +1171,6 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'lpd_timeout()' - Handle timeout alarms...
|
||||
*/
|
||||
|
||||
static void
|
||||
lpd_timeout(int sig) /* I - Signal number */
|
||||
{
|
||||
(void)sig;
|
||||
|
||||
#if !defined(HAVE_SIGSET) && !defined(HAVE_SIGACTION)
|
||||
signal(SIGALRM, lpd_timeout);
|
||||
#endif /* !HAVE_SIGSET && !HAVE_SIGACTION */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'lpd_write()' - Write a buffer of data to an LPD server.
|
||||
*/
|
||||
|
||||
+23
-10
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Common run loop APIs for CUPS backends.
|
||||
*
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -434,12 +434,11 @@ backendWaitLoop(
|
||||
int use_bc, /* I - Use back-channel? */
|
||||
_cups_sccb_t side_cb) /* I - Side-channel callback */
|
||||
{
|
||||
fd_set input; /* Input set for reading */
|
||||
time_t curtime, /* Current time */
|
||||
snmp_update = 0;
|
||||
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
struct sigaction action; /* Actions for POSIX signals */
|
||||
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
|
||||
int nfds; /* Number of file descriptors */
|
||||
fd_set input; /* Input set for reading */
|
||||
time_t curtime, /* Current time */
|
||||
snmp_update = 0;/* Last SNMP status update */
|
||||
struct timeval timeout; /* Timeout for select() */
|
||||
|
||||
|
||||
fprintf(stderr, "DEBUG: backendWaitLoop(snmp_fd=%d, addr=%p, side_cb=%p)\n",
|
||||
@@ -449,6 +448,9 @@ backendWaitLoop(
|
||||
* Now loop until we receive data from stdin...
|
||||
*/
|
||||
|
||||
if (snmp_fd >= 0)
|
||||
snmp_update = time(NULL) + 5;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
/*
|
||||
@@ -460,7 +462,18 @@ backendWaitLoop(
|
||||
if (side_cb)
|
||||
FD_SET(CUPS_SC_FD, &input);
|
||||
|
||||
if (select(CUPS_SC_FD + 1, &input, NULL, NULL, NULL) < 0)
|
||||
if (snmp_fd >= 0)
|
||||
{
|
||||
curtime = time(NULL);
|
||||
timeout.tv_sec = curtime >= snmp_update ? 0 : snmp_update - curtime;
|
||||
timeout.tv_usec = 0;
|
||||
|
||||
nfds = select(CUPS_SC_FD + 1, &input, NULL, NULL, &timeout);
|
||||
}
|
||||
else
|
||||
nfds = select(CUPS_SC_FD + 1, &input, NULL, NULL, NULL);
|
||||
|
||||
if (nfds < 0)
|
||||
{
|
||||
/*
|
||||
* Pause printing to clear any pending errors...
|
||||
@@ -504,10 +517,10 @@ backendWaitLoop(
|
||||
* Do SNMP updates periodically...
|
||||
*/
|
||||
|
||||
if (snmp_fd >= 0 && time(&curtime) >= snmp_update)
|
||||
if (snmp_fd >= 0 && curtime >= snmp_update)
|
||||
{
|
||||
if (backendSNMPSupplies(snmp_fd, addr, NULL, NULL))
|
||||
snmp_update = INT_MAX;
|
||||
snmp_fd = -1;
|
||||
else
|
||||
snmp_update = curtime + 5;
|
||||
}
|
||||
|
||||
+43
-18
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SNMP supplies functions for CUPS.
|
||||
*
|
||||
* Copyright 2008-2011 by Apple Inc.
|
||||
* Copyright 2008-2012 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -229,12 +229,12 @@ backendSNMPSupplies(
|
||||
|
||||
for (i = 0, ptr = value; i < num_supplies; i ++, ptr += strlen(ptr))
|
||||
{
|
||||
if (supplies[i].max_capacity > 0)
|
||||
if (supplies[i].max_capacity > 0 && supplies[i].level >= 0)
|
||||
percent = 100 * supplies[i].level / supplies[i].max_capacity;
|
||||
else
|
||||
percent = 50;
|
||||
|
||||
if (percent <= 10)
|
||||
if (percent <= 5)
|
||||
{
|
||||
switch (supplies[i].type)
|
||||
{
|
||||
@@ -279,7 +279,7 @@ backendSNMPSupplies(
|
||||
if (i)
|
||||
*ptr++ = ',';
|
||||
|
||||
if (supplies[i].max_capacity > 0)
|
||||
if (supplies[i].max_capacity > 0 && supplies[i].level >= 0)
|
||||
sprintf(ptr, "%d", percent);
|
||||
else
|
||||
strcpy(ptr, "-1");
|
||||
@@ -408,7 +408,7 @@ backend_init_supplies(
|
||||
cachefilename[1024], /* Cache filename */
|
||||
description[CUPS_SNMP_MAX_STRING],
|
||||
/* Device description string */
|
||||
value[CUPS_MAX_SUPPLIES * (CUPS_SNMP_MAX_STRING * 2 + 3)],
|
||||
value[CUPS_MAX_SUPPLIES * (CUPS_SNMP_MAX_STRING * 4 + 3)],
|
||||
/* Value string */
|
||||
*ptr, /* Pointer into value string */
|
||||
*name_ptr; /* Pointer into name string */
|
||||
@@ -659,7 +659,8 @@ backend_init_supplies(
|
||||
fprintf(stderr, "ATTR: marker-colors=%s\n", value);
|
||||
|
||||
/*
|
||||
* Output the marker-names attribute...
|
||||
* Output the marker-names attribute (the double quoting is necessary to deal
|
||||
* with embedded quotes and commas in the marker names...)
|
||||
*/
|
||||
|
||||
for (i = 0, ptr = value; i < num_supplies; i ++)
|
||||
@@ -667,15 +668,21 @@ backend_init_supplies(
|
||||
if (i)
|
||||
*ptr++ = ',';
|
||||
|
||||
*ptr++ = '\'';
|
||||
*ptr++ = '\"';
|
||||
for (name_ptr = supplies[i].name; *name_ptr;)
|
||||
{
|
||||
if (*name_ptr == '\\' || *name_ptr == '\"')
|
||||
if (*name_ptr == '\\' || *name_ptr == '\"' || *name_ptr == '\'')
|
||||
{
|
||||
*ptr++ = '\\';
|
||||
*ptr++ = '\\';
|
||||
*ptr++ = '\\';
|
||||
}
|
||||
|
||||
*ptr++ = *name_ptr++;
|
||||
}
|
||||
*ptr++ = '\"';
|
||||
*ptr++ = '\'';
|
||||
}
|
||||
|
||||
*ptr = '\0';
|
||||
@@ -712,16 +719,33 @@ backend_walk_cb(cups_snmp_t *packet, /* I - SNMP packet */
|
||||
void *data) /* I - User data (unused) */
|
||||
{
|
||||
int i, j, k; /* Looping vars */
|
||||
static const char * const colors[8][2] =
|
||||
static const char * const colors[][2] =
|
||||
{ /* Standard color names */
|
||||
{ "black", "#000000" },
|
||||
{ "blue", "#0000FF" },
|
||||
{ "cyan", "#00FFFF" },
|
||||
{ "green", "#00FF00" },
|
||||
{ "magenta", "#FF00FF" },
|
||||
{ "red", "#FF0000" },
|
||||
{ "white", "#FFFFFF" },
|
||||
{ "yellow", "#FFFF00" }
|
||||
{ "black", "#000000" },
|
||||
{ "blue", "#0000FF" },
|
||||
{ "brown", "#A52A2A" },
|
||||
{ "cyan", "#00FFFF" },
|
||||
{ "dark-gray", "#404040" },
|
||||
{ "dark gray", "#404040" },
|
||||
{ "dark-yellow", "#FFCC00" },
|
||||
{ "dark yellow", "#FFCC00" },
|
||||
{ "gold", "#FFD700" },
|
||||
{ "gray", "#808080" },
|
||||
{ "green", "#00FF00" },
|
||||
{ "light-black", "#606060" },
|
||||
{ "light black", "#606060" },
|
||||
{ "light-cyan", "#E0FFFF" },
|
||||
{ "light cyan", "#E0FFFF" },
|
||||
{ "light-gray", "#D3D3D3" },
|
||||
{ "light gray", "#D3D3D3" },
|
||||
{ "light-magenta", "#FF77FF" },
|
||||
{ "light magenta", "#FF77FF" },
|
||||
{ "magenta", "#FF00FF" },
|
||||
{ "orange", "#FFA500" },
|
||||
{ "red", "#FF0000" },
|
||||
{ "silver", "#C0C0C0" },
|
||||
{ "white", "#FFFFFF" },
|
||||
{ "yellow", "#FFFF00" }
|
||||
};
|
||||
|
||||
|
||||
@@ -743,7 +767,8 @@ backend_walk_cb(cups_snmp_t *packet, /* I - SNMP packet */
|
||||
if (supplies[j].colorant == i)
|
||||
{
|
||||
for (k = 0; k < (int)(sizeof(colors) / sizeof(colors[0])); k ++)
|
||||
if (!strcmp(colors[k][0], (char *)packet->object_value.string.bytes))
|
||||
if (!_cups_strcasecmp(colors[k][0],
|
||||
(char *)packet->object_value.string.bytes))
|
||||
{
|
||||
strcpy(supplies[j].color, colors[k][1]);
|
||||
break;
|
||||
@@ -801,6 +826,7 @@ backend_walk_cb(cups_snmp_t *packet, /* I - SNMP packet */
|
||||
break;
|
||||
|
||||
case CUPS_TC_csShiftJIS :
|
||||
case CUPS_TC_csWindows31J : /* Close enough for our purposes */
|
||||
cupsCharsetToUTF8((cups_utf8_t *)supplies[i - 1].name,
|
||||
(char *)packet->object_value.string.bytes,
|
||||
sizeof(supplies[0].name), CUPS_JIS_X0213);
|
||||
@@ -833,7 +859,6 @@ backend_walk_cb(cups_snmp_t *packet, /* I - SNMP packet */
|
||||
{
|
||||
char *src, *dst; /* Pointers into strings */
|
||||
|
||||
|
||||
/*
|
||||
* Loop safe because both the object_value and supplies char arrays
|
||||
* are CUPS_SNMP_MAX_STRING elements long.
|
||||
|
||||
+16
-4
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SNMP discovery backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -948,7 +948,7 @@ read_snmp_response(int fd) /* I - SNMP socket file descriptor */
|
||||
debug_printf("DEBUG: request-id=%d\n", packet.request_id);
|
||||
debug_printf("DEBUG: error-status=%d\n", packet.error_status);
|
||||
|
||||
if (packet.error_status)
|
||||
if (packet.error_status && packet.request_id != DEVICE_TYPE)
|
||||
return;
|
||||
|
||||
/*
|
||||
@@ -1112,12 +1112,18 @@ read_snmp_response(int fd) /* I - SNMP socket file descriptor */
|
||||
|
||||
case DEVICE_URI :
|
||||
if (device && packet.object_type == CUPS_ASN1_OCTET_STRING &&
|
||||
!device->uri && packet.object_value.string.num_bytes > 0)
|
||||
!device->uri && packet.object_value.string.num_bytes > 3)
|
||||
{
|
||||
/*
|
||||
* Update an existing cache entry...
|
||||
*/
|
||||
|
||||
char scheme[32], /* URI scheme */
|
||||
userpass[256], /* Username:password in URI */
|
||||
hostname[256], /* Hostname in URI */
|
||||
resource[1024]; /* Resource path in URI */
|
||||
int port; /* Port number in URI */
|
||||
|
||||
if (!strncmp((char *)packet.object_value.string.bytes, "lpr:", 4))
|
||||
{
|
||||
/*
|
||||
@@ -1127,7 +1133,13 @@ read_snmp_response(int fd) /* I - SNMP socket file descriptor */
|
||||
packet.object_value.string.bytes[2] = 'd';
|
||||
}
|
||||
|
||||
device->uri = strdup((char *)packet.object_value.string.bytes);
|
||||
if (httpSeparateURI(HTTP_URI_CODING_ALL,
|
||||
(char *)packet.object_value.string.bytes,
|
||||
scheme, sizeof(scheme),
|
||||
userpass, sizeof(userpass),
|
||||
hostname, sizeof(hostname), &port,
|
||||
resource, sizeof(resource)) >= HTTP_URI_OK)
|
||||
device->uri = strdup((char *)packet.object_value.string.bytes);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
+23
-51
@@ -761,24 +761,8 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
fprintf(stderr, "DEBUG: Sent %lld bytes...\n", (off_t)total_bytes);
|
||||
|
||||
if (!print_fd)
|
||||
{
|
||||
/*
|
||||
* Re-enable the SIGTERM handler so pthread_kill() will work...
|
||||
*/
|
||||
|
||||
struct sigaction action; /* POSIX signal action */
|
||||
|
||||
memset(&action, 0, sizeof(action));
|
||||
|
||||
sigemptyset(&action.sa_mask);
|
||||
sigaddset(&action.sa_mask, SIGTERM);
|
||||
action.sa_handler = sigterm_handler;
|
||||
sigaction(SIGTERM, &action, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Wait for the side channel thread to exit...
|
||||
* Signal the side channel thread to exit...
|
||||
*/
|
||||
|
||||
if (have_sidechannel)
|
||||
@@ -805,44 +789,23 @@ print_device(const char *uri, /* I - Device URI */
|
||||
&cond_timeout) != 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!g.sidechannel_thread_done)
|
||||
{
|
||||
/*
|
||||
* Force the side-channel thread to exit...
|
||||
*/
|
||||
|
||||
fputs("DEBUG: Force the side-channel thread to exit...\n", stderr);
|
||||
pthread_kill(sidechannel_thread_id, SIGTERM);
|
||||
}
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&g.sidechannel_thread_mutex);
|
||||
|
||||
pthread_join(sidechannel_thread_id, NULL);
|
||||
|
||||
pthread_cond_destroy(&g.sidechannel_thread_cond);
|
||||
pthread_mutex_destroy(&g.sidechannel_thread_mutex);
|
||||
}
|
||||
|
||||
pthread_cond_destroy(&g.readwrite_lock_cond);
|
||||
pthread_mutex_destroy(&g.readwrite_lock_mutex);
|
||||
|
||||
/*
|
||||
* Signal the read thread to stop...
|
||||
* Signal the read thread to exit then wait 7 seconds for it to complete...
|
||||
*/
|
||||
|
||||
g.read_thread_stop = 1;
|
||||
|
||||
/*
|
||||
* Give the read thread WAIT_EOF_DELAY seconds to complete all the data. If
|
||||
* we are not signaled in that time then force the thread to exit.
|
||||
*/
|
||||
|
||||
pthread_mutex_lock(&g.read_thread_mutex);
|
||||
|
||||
if (!g.read_thread_done)
|
||||
{
|
||||
fputs("DEBUG: Waiting for read thread to exit...\n", stderr);
|
||||
|
||||
gettimeofday(&tv, NULL);
|
||||
cond_timeout.tv_sec = tv.tv_sec + WAIT_EOF_DELAY;
|
||||
cond_timeout.tv_nsec = tv.tv_usec * 1000;
|
||||
@@ -854,25 +817,34 @@ print_device(const char *uri, /* I - Device URI */
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* If it didn't exit abort the pending read and wait an additional second...
|
||||
*/
|
||||
|
||||
if (!g.read_thread_done)
|
||||
{
|
||||
/*
|
||||
* Force the read thread to exit...
|
||||
*/
|
||||
fputs("DEBUG: Read thread still active, aborting the pending read...\n",
|
||||
stderr);
|
||||
|
||||
g.wait_eof = 0;
|
||||
fputs("DEBUG: Force the read thread to exit...\n", stderr);
|
||||
pthread_kill(read_thread_id, SIGTERM);
|
||||
|
||||
(*g.classdriver)->Abort(g.classdriver);
|
||||
|
||||
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_join(read_thread_id, NULL); /* wait for the read thread to return */
|
||||
|
||||
pthread_cond_destroy(&g.read_thread_cond);
|
||||
pthread_mutex_destroy(&g.read_thread_mutex);
|
||||
|
||||
/*
|
||||
* Close the connection and input file and general clean up...
|
||||
*/
|
||||
|
||||
+1303
-251
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+3
-3
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* USB port backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -55,7 +55,7 @@ int print_device(const char *uri, const char *hostname,
|
||||
* Include the vendor-specific USB implementation...
|
||||
*/
|
||||
|
||||
#ifdef HAVE_USB_H
|
||||
#ifdef HAVE_LIBUSB
|
||||
# include "usb-libusb.c"
|
||||
#elif defined(__APPLE__)
|
||||
# include "usb-darwin.c"
|
||||
@@ -118,7 +118,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
#endif /* __APPLE__ */
|
||||
#endif /* HAVE_LIBUSB */
|
||||
|
||||
|
||||
/*
|
||||
|
||||
+20
-20
@@ -3,32 +3,32 @@
|
||||
lpc.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
|
||||
lpc.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
lpc.o: ../cups/language.h ../cups/string-private.h ../config.h
|
||||
lpc.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
|
||||
lpc.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
|
||||
lpc.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
|
||||
lpc.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
|
||||
lpc.o: ../cups/thread-private.h
|
||||
lpc.o: ../cups/debug-private.h ../cups/versioning.h ../cups/ppd-private.h
|
||||
lpc.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
|
||||
lpc.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
|
||||
lpc.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
|
||||
lpc.o: ../cups/transcode.h ../cups/thread-private.h
|
||||
lpq.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
|
||||
lpq.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
lpq.o: ../cups/language.h ../cups/string-private.h ../config.h
|
||||
lpq.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
|
||||
lpq.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
|
||||
lpq.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
|
||||
lpq.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
|
||||
lpq.o: ../cups/thread-private.h
|
||||
lpq.o: ../cups/debug-private.h ../cups/versioning.h ../cups/ppd-private.h
|
||||
lpq.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
|
||||
lpq.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
|
||||
lpq.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
|
||||
lpq.o: ../cups/transcode.h ../cups/thread-private.h
|
||||
lpr.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
|
||||
lpr.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
lpr.o: ../cups/language.h ../cups/string-private.h ../config.h
|
||||
lpr.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
|
||||
lpr.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
|
||||
lpr.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
|
||||
lpr.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
|
||||
lpr.o: ../cups/thread-private.h
|
||||
lpr.o: ../cups/debug-private.h ../cups/versioning.h ../cups/ppd-private.h
|
||||
lpr.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
|
||||
lpr.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
|
||||
lpr.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
|
||||
lpr.o: ../cups/transcode.h ../cups/thread-private.h
|
||||
lprm.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
|
||||
lprm.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
lprm.o: ../cups/language.h ../cups/string-private.h ../config.h
|
||||
lprm.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
|
||||
lprm.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
|
||||
lprm.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
|
||||
lprm.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
|
||||
lprm.o: ../cups/thread-private.h
|
||||
lprm.o: ../cups/debug-private.h ../cups/versioning.h ../cups/ppd-private.h
|
||||
lprm.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
|
||||
lprm.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
|
||||
lprm.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
|
||||
lprm.o: ../cups/transcode.h ../cups/thread-private.h
|
||||
|
||||
+3
-2
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* "lpc" command for CUPS.
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -364,7 +364,8 @@ show_status(http_t *http, /* I - HTTP connection to server */
|
||||
|
||||
for (ptr = printer;
|
||||
*ptr != '\0' && *dptr != '\0' && *ptr == *dptr;
|
||||
ptr ++, dptr ++);
|
||||
ptr ++, dptr ++)
|
||||
/* do nothing */;
|
||||
|
||||
if (*ptr == '\0' && (*dptr == '\0' || *dptr == ',' ||
|
||||
isspace(*dptr & 255)))
|
||||
|
||||
+7
-3
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* "lpq" command for CUPS.
|
||||
*
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -371,6 +371,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 +400,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 +451,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;
|
||||
|
||||
|
||||
+9
-4
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* "lpr" command 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
|
||||
@@ -89,7 +89,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
cupsSetUser(argv[i]);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 'H' : /* Connect to host */
|
||||
if (argv[i][2] != '\0')
|
||||
cupsSetServer(argv[i] + 2);
|
||||
@@ -377,7 +377,6 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
const char *format; /* Document format */
|
||||
ssize_t bytes; /* Bytes read */
|
||||
|
||||
|
||||
if (cupsGetOption("raw", num_options, options))
|
||||
format = CUPS_FORMAT_RAW;
|
||||
else if ((format = cupsGetOption("document-format", num_options,
|
||||
@@ -395,11 +394,17 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("%s: Error - unable to queue from stdin - %s."),
|
||||
argv[0], httpStatus(status));
|
||||
cupsFinishDocument(CUPS_HTTP_DEFAULT, printer);
|
||||
cupsCancelJob2(CUPS_HTTP_DEFAULT, printer, job_id, 0);
|
||||
return (1);
|
||||
}
|
||||
|
||||
if (cupsFinishDocument(CUPS_HTTP_DEFAULT, printer) != IPP_OK)
|
||||
job_id = 0;
|
||||
{
|
||||
_cupsLangPrintf(stderr, "%s: %s", argv[0], cupsLastErrorString());
|
||||
cupsCancelJob2(CUPS_HTTP_DEFAULT, printer, job_id, 0);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
if (job_id < 1)
|
||||
|
||||
+32
-23
@@ -3,64 +3,73 @@
|
||||
help-index.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
|
||||
help-index.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
help-index.o: ../cups/array.h ../cups/language.h ../cups/array.h help-index.h
|
||||
help-index.o: ../cups/debug-private.h ../cups/language-private.h
|
||||
help-index.o: ../cups/transcode.h ../cups/string-private.h ../config.h
|
||||
help-index.o: ../cups/dir.h
|
||||
help-index.o: ../cups/debug-private.h ../cups/versioning.h
|
||||
help-index.o: ../cups/language-private.h ../cups/transcode.h
|
||||
help-index.o: ../cups/string-private.h ../config.h ../cups/dir.h
|
||||
html.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
|
||||
html.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
html.o: ../cups/language.h ../cups/array.h help-index.h
|
||||
html.o: ../cups/debug-private.h ../cups/language-private.h
|
||||
html.o: ../cups/transcode.h ../cups/string-private.h ../config.h
|
||||
html.o: ../cups/debug-private.h ../cups/versioning.h
|
||||
html.o: ../cups/language-private.h ../cups/transcode.h
|
||||
html.o: ../cups/string-private.h ../config.h
|
||||
ipp-var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
|
||||
ipp-var.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
ipp-var.o: ../cups/language.h ../cups/array.h help-index.h
|
||||
ipp-var.o: ../cups/debug-private.h ../cups/language-private.h
|
||||
ipp-var.o: ../cups/transcode.h ../cups/string-private.h ../config.h
|
||||
ipp-var.o: ../cups/debug-private.h ../cups/versioning.h
|
||||
ipp-var.o: ../cups/language-private.h ../cups/transcode.h
|
||||
ipp-var.o: ../cups/string-private.h ../config.h
|
||||
search.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
|
||||
search.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
search.o: ../cups/language.h ../cups/array.h help-index.h
|
||||
search.o: ../cups/debug-private.h ../cups/language-private.h
|
||||
search.o: ../cups/transcode.h ../cups/string-private.h ../config.h
|
||||
search.o: ../cups/debug-private.h ../cups/versioning.h
|
||||
search.o: ../cups/language-private.h ../cups/transcode.h
|
||||
search.o: ../cups/string-private.h ../config.h
|
||||
template.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
|
||||
template.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
template.o: ../cups/language.h ../cups/array.h help-index.h
|
||||
template.o: ../cups/debug-private.h ../cups/language-private.h
|
||||
template.o: ../cups/transcode.h ../cups/string-private.h ../config.h
|
||||
template.o: ../cups/debug-private.h ../cups/versioning.h
|
||||
template.o: ../cups/language-private.h ../cups/transcode.h
|
||||
template.o: ../cups/string-private.h ../config.h
|
||||
var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
|
||||
var.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
var.o: ../cups/array.h help-index.h ../cups/debug-private.h
|
||||
var.o: ../cups/language-private.h ../cups/transcode.h
|
||||
var.o: ../cups/versioning.h ../cups/language-private.h ../cups/transcode.h
|
||||
var.o: ../cups/string-private.h ../config.h ../cups/http.h
|
||||
var.o: ../cups/md5-private.h
|
||||
admin.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
|
||||
admin.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
admin.o: ../cups/language.h ../cups/array.h help-index.h
|
||||
admin.o: ../cups/debug-private.h ../cups/language-private.h
|
||||
admin.o: ../cups/transcode.h ../cups/string-private.h ../config.h
|
||||
admin.o: ../cups/adminutil.h ../cups/cups.h ../cups/ppd.h
|
||||
admin.o: ../cups/debug-private.h ../cups/versioning.h
|
||||
admin.o: ../cups/language-private.h ../cups/transcode.h
|
||||
admin.o: ../cups/string-private.h ../config.h ../cups/adminutil.h
|
||||
admin.o: ../cups/cups.h ../cups/ppd.h
|
||||
classes.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
|
||||
classes.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
classes.o: ../cups/language.h ../cups/array.h help-index.h
|
||||
classes.o: ../cups/debug-private.h ../cups/language-private.h
|
||||
classes.o: ../cups/transcode.h ../cups/string-private.h ../config.h
|
||||
classes.o: ../cups/debug-private.h ../cups/versioning.h
|
||||
classes.o: ../cups/language-private.h ../cups/transcode.h
|
||||
classes.o: ../cups/string-private.h ../config.h
|
||||
help.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
|
||||
help.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
help.o: ../cups/language.h ../cups/array.h help-index.h
|
||||
help.o: ../cups/debug-private.h ../cups/language-private.h
|
||||
help.o: ../cups/transcode.h ../cups/string-private.h ../config.h
|
||||
help.o: ../cups/debug-private.h ../cups/versioning.h
|
||||
help.o: ../cups/language-private.h ../cups/transcode.h
|
||||
help.o: ../cups/string-private.h ../config.h
|
||||
jobs.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
|
||||
jobs.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
jobs.o: ../cups/language.h ../cups/array.h help-index.h
|
||||
jobs.o: ../cups/debug-private.h ../cups/language-private.h
|
||||
jobs.o: ../cups/transcode.h ../cups/string-private.h ../config.h
|
||||
jobs.o: ../cups/debug-private.h ../cups/versioning.h
|
||||
jobs.o: ../cups/language-private.h ../cups/transcode.h
|
||||
jobs.o: ../cups/string-private.h ../config.h
|
||||
makedocset.o: cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
|
||||
makedocset.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
makedocset.o: ../cups/array.h help-index.h
|
||||
printers.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
|
||||
printers.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
printers.o: ../cups/language.h ../cups/array.h help-index.h
|
||||
printers.o: ../cups/debug-private.h ../cups/language-private.h
|
||||
printers.o: ../cups/transcode.h ../cups/string-private.h ../config.h
|
||||
printers.o: ../cups/debug-private.h ../cups/versioning.h
|
||||
printers.o: ../cups/language-private.h ../cups/transcode.h
|
||||
printers.o: ../cups/string-private.h ../config.h
|
||||
testcgi.o: cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
|
||||
testcgi.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
testcgi.o: ../cups/array.h help-index.h
|
||||
|
||||
+15
-10
@@ -39,7 +39,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
const char *query; /* Search query */
|
||||
const char *cache_dir; /* CUPS_CACHEDIR environment variable */
|
||||
const char *docroot; /* CUPS_DOCROOT environment variable */
|
||||
const char *helpfile; /* Current help file */
|
||||
const char *helpfile, /* Current help file */
|
||||
*helptitle = NULL; /* Current help title */
|
||||
const char *topic; /* Current topic */
|
||||
char topic_data[1024]; /* Topic form data */
|
||||
const char *section; /* Current section */
|
||||
@@ -88,7 +89,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
perror(filename);
|
||||
|
||||
cgiStartHTML(cgiText(_("Online Help")));
|
||||
cgiSetVariable("ERROR", "Unable to load help index!");
|
||||
cgiSetVariable("ERROR", cgiText(_("Unable to load help index.")));
|
||||
cgiCopyTemplateLang("error.tmpl");
|
||||
cgiEndHTML();
|
||||
|
||||
@@ -129,7 +130,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
perror(filename);
|
||||
|
||||
cgiStartHTML(cgiText(_("Online Help")));
|
||||
cgiSetVariable("ERROR", "Unable to access help file!");
|
||||
cgiSetVariable("ERROR", cgiText(_("Unable to access help file.")));
|
||||
cgiCopyTemplateLang("error.tmpl");
|
||||
cgiEndHTML();
|
||||
|
||||
@@ -139,7 +140,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if ((n = helpFindNode(hi, helpfile, NULL)) == NULL)
|
||||
{
|
||||
cgiStartHTML(cgiText(_("Online Help")));
|
||||
cgiSetVariable("ERROR", "Help file not in index!");
|
||||
cgiSetVariable("ERROR", cgiText(_("Help file not in index.")));
|
||||
cgiCopyTemplateLang("error.tmpl");
|
||||
cgiEndHTML();
|
||||
|
||||
@@ -147,12 +148,11 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the page title and save the help file...
|
||||
* Save the page title and help file...
|
||||
*/
|
||||
|
||||
cgiSetVariable("HELPFILE", helpfile);
|
||||
cgiSetVariable("HELPTITLE", n->text);
|
||||
cgiSetVariable("TOPIC", n->section);
|
||||
helptitle = n->text;
|
||||
topic = n->section;
|
||||
|
||||
/*
|
||||
* Send a standard page header...
|
||||
@@ -170,6 +170,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
*/
|
||||
|
||||
cgiStartHTML(cgiText(_("Online Help")));
|
||||
|
||||
topic = cgiGetVariable("TOPIC");
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -180,7 +182,6 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
cgiSetVariable("QUERY", "");
|
||||
|
||||
query = cgiGetVariable("QUERY");
|
||||
topic = cgiGetVariable("TOPIC");
|
||||
si = helpSearchIndex(hi, query, topic, helpfile);
|
||||
|
||||
cgiClearVariables();
|
||||
@@ -188,6 +189,10 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
cgiSetVariable("QUERY", query);
|
||||
if (topic)
|
||||
cgiSetVariable("TOPIC", topic);
|
||||
if (helpfile)
|
||||
cgiSetVariable("HELPFILE", helpfile);
|
||||
if (helptitle)
|
||||
cgiSetVariable("HELPTITLE", helptitle);
|
||||
|
||||
fprintf(stderr, "DEBUG: query=\"%s\", topic=\"%s\"\n",
|
||||
query ? query : "(null)", topic ? topic : "(null)");
|
||||
@@ -356,7 +361,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
else
|
||||
{
|
||||
perror(filename);
|
||||
cgiSetVariable("ERROR", "Unable to open help file.");
|
||||
cgiSetVariable("ERROR", cgiText(_("Unable to open help file.")));
|
||||
cgiCopyTemplateLang("error.tmpl");
|
||||
}
|
||||
}
|
||||
|
||||
+11
-5
@@ -167,6 +167,8 @@ cgiClearVariables(void)
|
||||
_cgi_var_t *v; /* Current variable */
|
||||
|
||||
|
||||
fputs("DEBUG: cgiClearVariables called.\n", stderr);
|
||||
|
||||
for (v = form_vars, i = form_count; i > 0; v ++, i --)
|
||||
{
|
||||
_cupsStrFree(v->name);
|
||||
@@ -401,6 +403,8 @@ cgiSetArray(const char *name, /* I - Name of variable */
|
||||
if (name == NULL || value == NULL || element < 0 || element > 100000)
|
||||
return;
|
||||
|
||||
fprintf(stderr, "DEBUG: cgiSetArray: %s[%d]=\"%s\"\n", name, element, value);
|
||||
|
||||
if ((var = cgi_find_variable(name)) == NULL)
|
||||
{
|
||||
cgi_add_variable(name, element, value);
|
||||
@@ -452,19 +456,19 @@ cgiSetCookie(const char *name, /* I - Name */
|
||||
|
||||
printf("Set-Cookie: %s=%s;", name, value);
|
||||
if (path)
|
||||
printf("; path=%s", path);
|
||||
printf(" path=%s;", path);
|
||||
if (domain)
|
||||
printf("; domain=%s", domain);
|
||||
printf(" domain=%s;", domain);
|
||||
if (expires)
|
||||
{
|
||||
char date[256]; /* Date string */
|
||||
|
||||
printf("; expires=%s", httpGetDateString2(expires, date, sizeof(date)));
|
||||
printf(" expires=%s;", httpGetDateString2(expires, date, sizeof(date)));
|
||||
}
|
||||
if (secure)
|
||||
puts("; secure;");
|
||||
puts(" secure;");
|
||||
else
|
||||
puts(";");
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
|
||||
@@ -532,6 +536,8 @@ cgiSetVariable(const char *name, /* I - Name of variable */
|
||||
if (name == NULL || value == NULL)
|
||||
return;
|
||||
|
||||
fprintf(stderr, "cgiSetVariable: %s=\"%s\"\n", name, value);
|
||||
|
||||
if ((var = cgi_find_variable(name)) == NULL)
|
||||
{
|
||||
cgi_add_variable(name, 0, value);
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# "$Id: mime.types 9667 2011-04-01 04:48:21Z mike $"
|
||||
# "$Id: mime.types 9871 2011-08-06 06:34:46Z mike $"
|
||||
#
|
||||
# Base MIME types file for CUPS.
|
||||
#
|
||||
@@ -92,7 +92,7 @@ image/jpeg jpeg jpg jpe string(0,<FFD8FF>) +\
|
||||
char(3,0xe4) char(3,0xe5) char(3,0xe6) char(3,0xe7)\
|
||||
char(3,0xe8) char(3,0xe9) char(3,0xea) char(3,0xeb)\
|
||||
char(3,0xec) char(3,0xed) char(3,0xee) char(3,0xef))
|
||||
image/pwg-raster string(0,"RaS2") + string(356,<0000000000000000>) priority(100)
|
||||
image/pwg-raster string(0,"RaS2") + string(4,PwgRaster<00>) priority(100)
|
||||
image/tiff tiff tif string(0,MM<002A>) string(0,II<2A00>)
|
||||
image/x-photocd pcd string(2048,PCD_IPI)
|
||||
image/x-portable-anymap pnm
|
||||
@@ -170,5 +170,5 @@ application/vnd.cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) \
|
||||
application/octet-stream
|
||||
|
||||
#
|
||||
# End of "$Id: mime.types 9667 2011-04-01 04:48:21Z mike $".
|
||||
# End of "$Id: mime.types 9871 2011-08-06 06:34:46Z mike $".
|
||||
#
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-common.m4 9793 2011-05-20 03:49:49Z mike $"
|
||||
dnl "$Id: cups-common.m4 10466 2012-05-15 14:21:57Z mike $"
|
||||
dnl
|
||||
dnl Common configuration stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2011 by Apple Inc.
|
||||
dnl Copyright 2007-2012 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,7 +20,7 @@ dnl Set the name of the config header file...
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl Version number information...
|
||||
CUPS_VERSION="1.5b1"
|
||||
CUPS_VERSION="1.5.4"
|
||||
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'`"
|
||||
@@ -50,6 +50,7 @@ AC_PROG_CXX
|
||||
AC_PROG_RANLIB
|
||||
AC_PATH_PROG(AR,ar)
|
||||
AC_PATH_PROG(CHMOD,chmod)
|
||||
AC_PATH_PROG(GZIP,gzip)
|
||||
AC_PATH_PROG(HTMLDOC,htmldoc)
|
||||
AC_PATH_PROG(LD,ld)
|
||||
AC_PATH_PROG(LN,ln)
|
||||
@@ -92,6 +93,7 @@ dnl Check for pkg-config, which is used for some other tests later on...
|
||||
AC_PATH_PROG(PKGCONFIG, pkg-config)
|
||||
|
||||
dnl Check for libraries...
|
||||
AC_SEARCH_LIBS(fmod, m)
|
||||
AC_SEARCH_LIBS(crypt, crypt)
|
||||
AC_SEARCH_LIBS(getspent, sec gen)
|
||||
|
||||
@@ -213,19 +215,20 @@ AC_ARG_ENABLE(libusb, [ --enable-libusb use libusb for USB printing])
|
||||
LIBUSB=""
|
||||
AC_SUBST(LIBUSB)
|
||||
|
||||
if test x$enable_libusb = xyes; then
|
||||
check_libusb=yes
|
||||
elif test x$enable_libusb != xno -a $uname != Darwin; then
|
||||
check_libusb=yes
|
||||
else
|
||||
check_libusb=no
|
||||
fi
|
||||
|
||||
if test $check_libusb = yes; then
|
||||
AC_CHECK_LIB(usb, usb_get_string_simple,[
|
||||
AC_CHECK_HEADER(usb.h,
|
||||
AC_DEFINE(HAVE_USB_H)
|
||||
LIBUSB="-lusb")])
|
||||
if test "x$PKGCONFIG" != x; then
|
||||
if test x$enable_libusb = xyes -o $uname != Darwin; then
|
||||
AC_MSG_CHECKING(for libusb-1.0)
|
||||
if $PKGCONFIG --exists libusb-1.0; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_LIBUSB)
|
||||
CFLAGS="$CFLAGS `$PKGCONFIG --cflags libusb-1.0`"
|
||||
LIBUSB="`$PKGCONFIG --libs libusb-1.0`"
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
elif test x$enable_libusb = xyes; then
|
||||
AC_MSG_ERROR(Need pkg-config to enable libusb support.)
|
||||
fi
|
||||
|
||||
dnl See if we have libwrap for TCP wrappers support...
|
||||
@@ -380,7 +383,17 @@ case $uname in
|
||||
|
||||
dnl Check for sandbox/Seatbelt support
|
||||
if test $uversion -ge 100; then
|
||||
AC_CHECK_HEADER(sandbox.h,AC_DEFINE(HAVE_SANDBOX_H))
|
||||
AC_CHECK_HEADER(sandbox.h,AC_DEFINE(HAVE_SANDBOX_H))
|
||||
fi
|
||||
if test $uversion -ge 110; then
|
||||
# Broken public headers in 10.7...
|
||||
AC_MSG_CHECKING(for sandbox/private.h presence)
|
||||
if test -f /usr/local/include/sandbox/private.h; then
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR(Run 'sudo mkdir -p /usr/local/include/sandbox' and 'sudo touch /usr/local/include/sandbox/private.h' to build CUPS.)
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Check for XPC support
|
||||
@@ -406,7 +419,7 @@ AC_ARG_WITH(components, [ --with-components set components to build:
|
||||
|
||||
case "$COMPONENTS" in
|
||||
all)
|
||||
BUILDDIRS="filter backend berkeley cgi-bin driver monitor notifier ppdc scheduler systemv conf data locale man doc examples templates"
|
||||
BUILDDIRS="filter backend berkeley cgi-bin driver monitor notifier ppdc scheduler systemv conf data desktop locale man doc examples templates"
|
||||
;;
|
||||
|
||||
core)
|
||||
@@ -421,5 +434,5 @@ esac
|
||||
AC_SUBST(BUILDDIRS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-common.m4 9793 2011-05-20 03:49:49Z mike $".
|
||||
dnl End of "$Id: cups-common.m4 10466 2012-05-15 14:21:57Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-compiler.m4 9770 2011-05-12 04:51:01Z mike $"
|
||||
dnl "$Id: cups-compiler.m4 9981 2011-09-09 17:28:58Z mike $"
|
||||
dnl
|
||||
dnl Compiler stuff for CUPS.
|
||||
dnl
|
||||
@@ -138,7 +138,14 @@ if test -n "$GCC"; then
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -fPIE"
|
||||
AC_TRY_COMPILE(,,
|
||||
[PIEFLAGS="-fPIE -Wl,-pie"
|
||||
[case "$CC" in
|
||||
*clang)
|
||||
PIEFLAGS="-fPIE -Wl,-pie"
|
||||
;;
|
||||
*)
|
||||
PIEFLAGS="-fPIE -pie"
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT(yes)],
|
||||
AC_MSG_RESULT(no))
|
||||
CFLAGS="$OLDCFLAGS"
|
||||
@@ -146,11 +153,20 @@ if test -n "$GCC"; then
|
||||
if test "x$with_optim" = x; then
|
||||
# Add useful warning options for tracking down problems...
|
||||
OPTIM="-Wall -Wno-format-y2k -Wunused $OPTIM"
|
||||
|
||||
# Additional warning options for development testing...
|
||||
if test -d .svn; then
|
||||
OPTIM="-Wshadow $OPTIM"
|
||||
CFLAGS="-Werror-implicit-function-declaration $CFLAGS"
|
||||
OPTIM="-Wshadow -Werror $OPTIM"
|
||||
PHPOPTIONS="-Wno-shadow"
|
||||
else
|
||||
AC_MSG_CHECKING(if GCC supports -Wno-tautological-compare)
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror -Wno-tautological-compare"
|
||||
AC_TRY_COMPILE(,,
|
||||
[OPTIM="$OPTIM -Wno-tautological-compare"
|
||||
AC_MSG_RESULT(yes)],
|
||||
AC_MSG_RESULT(no))
|
||||
CFLAGS="$OLDCFLAGS"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -162,11 +178,6 @@ if test -n "$GCC"; then
|
||||
# CUPS since we already use buffer-limited calls, but
|
||||
# this will catch any additions that are broken.
|
||||
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
|
||||
|
||||
if test x$enable_pie = xyes; then
|
||||
# GCC 4 on Mac OS X needs -Wl,-pie as well
|
||||
LDFLAGS="$LDFLAGS -Wl,-pie"
|
||||
fi
|
||||
;;
|
||||
|
||||
HP-UX*)
|
||||
@@ -548,5 +559,5 @@ case $uname in
|
||||
esac
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-compiler.m4 9770 2011-05-12 04:51:01Z mike $".
|
||||
dnl End of "$Id: cups-compiler.m4 9981 2011-09-09 17:28:58Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-gssapi.m4 9771 2011-05-12 05:21:56Z mike $"
|
||||
dnl "$Id: cups-gssapi.m4 10083 2011-10-19 20:21:16Z mike $"
|
||||
dnl
|
||||
dnl GSSAPI/Kerberos library detection for CUPS.
|
||||
dnl
|
||||
@@ -71,10 +71,45 @@ if test x$enable_gssapi != xno; then
|
||||
if test "x$LIBGSSAPI" != x; then
|
||||
AC_CHECK_HEADER(krb5.h, AC_DEFINE(HAVE_KRB5_H))
|
||||
if test -d /System/Library/Frameworks/GSS.framework; then
|
||||
AC_CHECK_HEADER(GSS/gssapi.h, AC_DEFINE(HAVE_GSS_GSSAPI_H))
|
||||
AC_CHECK_HEADER(GSS/gssapi_generic.h, AC_DEFINE(HAVE_GSSAPI_GENERIC_H))
|
||||
AC_CHECK_HEADER(GSS/gssapi_krb5.h, AC_DEFINE(HAVE_GSSAPI_KRB5_H))
|
||||
AC_CHECK_HEADER(GSS/gssapi_spi.h, AC_DEFINE(HAVE_GSS_GSSAPI_SPI_H))
|
||||
gssdir="/System/Library/Frameworks/GSS.framework"
|
||||
AC_MSG_CHECKING(for GSS/gssapi.h presence)
|
||||
if test -f $gssdir/Headers/gssapi.h; then
|
||||
AC_DEFINE(HAVE_GSS_GSSAPI_H)
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AC_MSG_CHECKING(for GSS/gssapi_generic.h presence)
|
||||
if test -f $gssdir/Headers/gssapi_generic.h; then
|
||||
AC_DEFINE(HAVE_GSSAPI_GENERIC_H)
|
||||
AC_MSG_RESULT(yes)
|
||||
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)
|
||||
AC_MSG_CHECKING(for GSS/gssapi_spi.h usability)
|
||||
if test -s $gssdir/PrivateHeaders/gssapi_spi.h; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_GSS_GSSAPI_SPI_H)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
if test $uversion -ge 110; then
|
||||
# Broken public headers in 10.7...
|
||||
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))
|
||||
@@ -131,5 +166,5 @@ fi
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_GSSSERVICENAME, "$CUPS_DEFAULT_GSSSERVICENAME")
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-gssapi.m4 9771 2011-05-12 05:21:56Z mike $".
|
||||
dnl End of "$Id: cups-gssapi.m4 10083 2011-10-19 20:21:16Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-image.m4 9750 2011-05-06 22:53:53Z mike $"
|
||||
dnl "$Id: cups-image.m4 10317 2012-03-01 00:05:55Z mike $"
|
||||
dnl
|
||||
dnl Image library/filter stuff for CUPS.
|
||||
dnl
|
||||
@@ -66,11 +66,16 @@ else
|
||||
fi
|
||||
|
||||
dnl ZLIB library...
|
||||
INSTALL_GZIP=""
|
||||
AC_CHECK_HEADER(zlib.h,
|
||||
AC_CHECK_LIB(z, gzgets,
|
||||
AC_DEFINE(HAVE_LIBZ)
|
||||
LIBZ="-lz"
|
||||
LIBS="$LIBS -lz"))
|
||||
LIBS="$LIBS -lz"
|
||||
if test "x$GZIP" != x; then
|
||||
INSTALL_GZIP="-z"
|
||||
fi))
|
||||
AC_SUBST(INSTALL_GZIP)
|
||||
|
||||
dnl PNG library...
|
||||
if test x$enable_png != xno; then
|
||||
@@ -108,5 +113,5 @@ AC_SUBST(EXPORT_LIBZ)
|
||||
AC_CHECK_HEADER(stdlib.h,AC_DEFINE(HAVE_STDLIB_H))
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-image.m4 9750 2011-05-06 22:53:53Z mike $".
|
||||
dnl End of "$Id: cups-image.m4 10317 2012-03-01 00:05:55Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-ssl.m4 9756 2011-05-11 00:52:08Z mike $"
|
||||
dnl "$Id: cups-ssl.m4 10481 2012-05-18 18:02:10Z mike $"
|
||||
dnl
|
||||
dnl OpenSSL/GNUTLS stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2011 by Apple Inc.
|
||||
dnl Copyright 2007-2012 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
|
||||
@@ -56,6 +56,12 @@ 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
|
||||
@@ -118,7 +124,7 @@ if test x$enable_ssl != xno; then
|
||||
|
||||
dnl Check for the OpenSSL library last...
|
||||
if test $have_ssl = 0 -a "x$enable_openssl" != "xno"; then
|
||||
AC_CHECK_HEADER(openssl/ssl.h,
|
||||
AC_CHECK_HEADER(openssl/ssl.h,[
|
||||
dnl Save the current libraries so the crypto stuff isn't always
|
||||
dnl included...
|
||||
SAVELIBS="$LIBS"
|
||||
@@ -130,9 +136,9 @@ if test x$enable_ssl != xno; then
|
||||
dnl case the RSAREF libraries are needed.
|
||||
|
||||
for libcrypto in \
|
||||
"-lcrypto" \
|
||||
"-lcrypto -lrsaref" \
|
||||
"-lcrypto -lRSAglue -lrsaref"
|
||||
"-lcrypto" \
|
||||
"-lcrypto -lrsaref" \
|
||||
"-lcrypto -lRSAglue -lrsaref"
|
||||
do
|
||||
AC_CHECK_LIB(ssl,SSL_new,
|
||||
[have_ssl=1
|
||||
@@ -147,7 +153,12 @@ if test x$enable_ssl != xno; then
|
||||
fi
|
||||
done
|
||||
|
||||
LIBS="$SAVELIBS")
|
||||
if test "x${SSLLIBS}" != "x"; then
|
||||
LIBS="$SAVELIBS $SSLLIBS"
|
||||
AC_CHECK_FUNCS(SSL_set_tlsext_host_name)
|
||||
fi
|
||||
|
||||
LIBS="$SAVELIBS"])
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -167,7 +178,6 @@ AC_SUBST(SSLLIBS)
|
||||
EXPORT_SSLLIBS="$SSLLIBS"
|
||||
AC_SUBST(EXPORT_SSLLIBS)
|
||||
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-ssl.m4 9756 2011-05-11 00:52:08Z mike $".
|
||||
dnl End of "$Id: cups-ssl.m4 10481 2012-05-18 18:02:10Z mike $".
|
||||
dnl
|
||||
|
||||
+15
-1
@@ -299,6 +299,13 @@
|
||||
#undef HAVE_SSL
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the SSL_set_tlsext_host_name function?
|
||||
*/
|
||||
|
||||
#undef HAVE_SSL_SET_TLSEXT_HOST_NAME
|
||||
|
||||
|
||||
/*
|
||||
* What Security framework headers do we have?
|
||||
*/
|
||||
@@ -342,6 +349,13 @@
|
||||
#undef HAVE_SECPOLICYCREATESSL
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the SSLSetProtocolVersionMax function?
|
||||
*/
|
||||
|
||||
#undef HAVE_SSLSETPROTOCOLVERSIONMAX
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the cssmErrorString function?
|
||||
*/
|
||||
@@ -684,7 +698,7 @@
|
||||
* Do we have libusb?
|
||||
*/
|
||||
|
||||
#undef HAVE_USB_H
|
||||
#undef HAVE_LIBUSB
|
||||
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ if test "x$LANGUAGES" != x; then
|
||||
LANGFILES="$LANGFILES templates/$lang/header.tmpl"
|
||||
fi
|
||||
done
|
||||
elif test "x$CUPS_BUNDLEDIR" != ""; then
|
||||
elif test "x$CUPS_BUNDLEDIR" != x; then
|
||||
INSTALL_LANGUAGES="install-langbundle"
|
||||
UNINSTALL_LANGUAGES="uninstall-langbundle"
|
||||
fi
|
||||
|
||||
+504
-426
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+1
-1
@@ -376,7 +376,7 @@ libcups_s.a: $(LIBOBJS) libcups_s.exp
|
||||
echo Creating $@...
|
||||
$(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o \
|
||||
$(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(COMMONLIBS) $(LIBZ) -lm
|
||||
$(COMMONLIBS) $(LIBZ)
|
||||
$(RM) $@
|
||||
$(AR) $(ARFLAGS) $@ libcups_s.o
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
# include "array.h"
|
||||
# include <cups/array.h>
|
||||
|
||||
|
||||
/*
|
||||
|
||||
+13
-10
@@ -65,6 +65,8 @@ extern const char *cssmErrorString(int error);
|
||||
# ifdef HAVE_GSS_GSSAPI_SPI_H
|
||||
# include <GSS/gssapi_spi.h>
|
||||
# else
|
||||
# define GSS_AUTH_IDENTITY_TYPE_1 1
|
||||
# define gss_acquire_cred_ex_f __ApplePrivate_gss_acquire_cred_ex_f
|
||||
typedef struct gss_auth_identity
|
||||
{
|
||||
uint32_t type;
|
||||
@@ -122,7 +124,8 @@ cupsDoAuthentication(
|
||||
const char *method, /* I - Request method ("GET", "POST", "PUT") */
|
||||
const char *resource) /* I - Resource path */
|
||||
{
|
||||
const char *password; /* Password string */
|
||||
const char *password, /* Password string */
|
||||
*www_auth; /* WWW-Authenticate header */
|
||||
char prompt[1024], /* Prompt for user */
|
||||
realm[HTTP_MAX_VALUE], /* realm="xyz" string */
|
||||
nonce[HTTP_MAX_VALUE]; /* nonce="xyz" string */
|
||||
@@ -177,9 +180,11 @@ cupsDoAuthentication(
|
||||
* Nope, see if we should retry the current username:password...
|
||||
*/
|
||||
|
||||
www_auth = http->fields[HTTP_FIELD_WWW_AUTHENTICATE];
|
||||
|
||||
if ((http->digest_tries > 1 || !http->userpass[0]) &&
|
||||
(!strncmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Basic", 5) ||
|
||||
!strncmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Digest", 6)))
|
||||
(!_cups_strncasecmp(www_auth, "Basic", 5) ||
|
||||
!_cups_strncasecmp(www_auth, "Digest", 6)))
|
||||
{
|
||||
/*
|
||||
* Nope - get a new password from the user...
|
||||
@@ -195,8 +200,7 @@ cupsDoAuthentication(
|
||||
cupsUser(),
|
||||
http->hostname[0] == '/' ? "localhost" : http->hostname);
|
||||
|
||||
http->digest_tries = _cups_strncasecmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE],
|
||||
"Digest", 5) != 0;
|
||||
http->digest_tries = _cups_strncasecmp(www_auth, "Digest", 6) != 0;
|
||||
http->userpass[0] = '\0';
|
||||
|
||||
if ((password = cupsGetPassword2(prompt, http, method, resource)) == NULL)
|
||||
@@ -225,7 +229,7 @@ cupsDoAuthentication(
|
||||
*/
|
||||
|
||||
#ifdef HAVE_GSSAPI
|
||||
if (!strncmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Negotiate", 9))
|
||||
if (!_cups_strncasecmp(www_auth, "Negotiate", 9))
|
||||
{
|
||||
/*
|
||||
* Kerberos authentication...
|
||||
@@ -239,7 +243,7 @@ cupsDoAuthentication(
|
||||
}
|
||||
else
|
||||
#endif /* HAVE_GSSAPI */
|
||||
if (!strncmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Basic", 5))
|
||||
if (!_cups_strncasecmp(www_auth, "Basic", 5))
|
||||
{
|
||||
/*
|
||||
* Basic authentication...
|
||||
@@ -252,7 +256,7 @@ cupsDoAuthentication(
|
||||
(int)strlen(http->userpass));
|
||||
httpSetAuthString(http, "Basic", encode);
|
||||
}
|
||||
else if (!strncmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Digest", 6))
|
||||
else if (!_cups_strncasecmp(www_auth, "Digest", 6))
|
||||
{
|
||||
/*
|
||||
* Digest authentication...
|
||||
@@ -275,7 +279,7 @@ cupsDoAuthentication(
|
||||
else
|
||||
{
|
||||
DEBUG_printf(("1cupsDoAuthentication: Unknown auth type: \"%s\"",
|
||||
http->fields[HTTP_FIELD_WWW_AUTHENTICATE]));
|
||||
www_auth));
|
||||
http->status = HTTP_AUTHORIZATION_CANCELED;
|
||||
return (-1);
|
||||
}
|
||||
@@ -419,7 +423,6 @@ _cupsSetNegotiateAuthString(
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif /* HAVE_GSS_ACQUIRED_CRED_EX_F */
|
||||
|
||||
if (GSS_ERROR(major_status))
|
||||
|
||||
+5
-2
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Backend functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -125,7 +125,10 @@ quote_string(const char *s) /* I - String to write */
|
||||
if (*s == '\\' || *s == '\"')
|
||||
putchar('\\');
|
||||
|
||||
putchar(*s);
|
||||
if (*s == '\n')
|
||||
putchar(' ');
|
||||
else
|
||||
putchar(*s);
|
||||
|
||||
s ++;
|
||||
}
|
||||
|
||||
+4
-4
@@ -270,7 +270,7 @@ cupsResolveConflicts(
|
||||
* Resolver loop!
|
||||
*/
|
||||
|
||||
DEBUG_printf(("1ppdResolveConflicts: Resolver loop with %s!",
|
||||
DEBUG_printf(("1cupsResolveConflicts: Resolver loop with %s!",
|
||||
consts->resolver));
|
||||
goto error;
|
||||
}
|
||||
@@ -278,14 +278,14 @@ cupsResolveConflicts(
|
||||
if ((resolver = ppdFindAttr(ppd, "cupsUIResolver",
|
||||
consts->resolver)) == NULL)
|
||||
{
|
||||
DEBUG_printf(("1ppdResolveConflicts: Resolver %s not found!",
|
||||
DEBUG_printf(("1cupsResolveConflicts: Resolver %s not found!",
|
||||
consts->resolver));
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (!resolver->value)
|
||||
{
|
||||
DEBUG_printf(("1ppdResolveConflicts: Resolver %s has no value!",
|
||||
DEBUG_printf(("1cupsResolveConflicts: Resolver %s has no value!",
|
||||
consts->resolver));
|
||||
goto error;
|
||||
}
|
||||
@@ -507,7 +507,7 @@ cupsResolveConflicts(
|
||||
|
||||
if (!changed)
|
||||
{
|
||||
DEBUG_puts("1ppdResolveConflicts: Unable to automatically resolve "
|
||||
DEBUG_puts("1cupsResolveConflicts: Unable to automatically resolve "
|
||||
"constraint!");
|
||||
goto error;
|
||||
}
|
||||
|
||||
+2
-2
@@ -60,10 +60,10 @@ extern "C" {
|
||||
* Constants...
|
||||
*/
|
||||
|
||||
# define CUPS_VERSION 1.0499
|
||||
# define CUPS_VERSION 1.0504
|
||||
# define CUPS_VERSION_MAJOR 1
|
||||
# define CUPS_VERSION_MINOR 5
|
||||
# define CUPS_VERSION_PATCH -1
|
||||
# define CUPS_VERSION_PATCH 4
|
||||
|
||||
# define CUPS_BC_FD 3 /* Back-channel file descriptor for select/poll */
|
||||
# define CUPS_DATE_ANY (time_t)-1
|
||||
|
||||
+14
-5
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Private debugging macros for CUPS.
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2005 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -18,6 +18,14 @@
|
||||
#ifndef _CUPS_DEBUG_PRIVATE_H_
|
||||
# define _CUPS_DEBUG_PRIVATE_H_
|
||||
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
# include <cups/versioning.h>
|
||||
|
||||
|
||||
/*
|
||||
* C++ magic...
|
||||
*/
|
||||
@@ -88,14 +96,15 @@ extern "C" {
|
||||
extern int _cups_debug_fd;
|
||||
extern int _cups_debug_level;
|
||||
extern void DLLExport _cups_debug_printf(const char *format, ...)
|
||||
#ifdef __GNUC__
|
||||
__attribute__ ((__format__ (__printf__, 1, 2)))
|
||||
#endif /* __GNUC__ */
|
||||
;
|
||||
__attribute__ ((__format__ (__printf__, 1, 2)));
|
||||
extern void DLLExport _cups_debug_puts(const char *s);
|
||||
extern void DLLExport _cups_debug_set(const char *logfile,
|
||||
const char *level, const char *filter,
|
||||
int force);
|
||||
# ifdef WIN32
|
||||
extern int _cups_gettimeofday(struct timeval *tv, void *tz);
|
||||
# define gettimeofday(a,b) _cups_gettimeofday(a, b)
|
||||
# endif /* WIN32 */
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
|
||||
+94
-19
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Debugging functions for CUPS.
|
||||
*
|
||||
* Copyright 2008-2010 by Apple Inc.
|
||||
* Copyright 2008-2012 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -32,22 +32,22 @@
|
||||
# include <time.h>
|
||||
# include <io.h>
|
||||
# define getpid (int)GetCurrentProcessId
|
||||
static int /* O - 0 on success, -1 on failure */
|
||||
gettimeofday(struct timeval *tv, /* I - Timeval struct */
|
||||
void *tz) /* I - Timezone */
|
||||
{
|
||||
int /* O - 0 on success, -1 on failure */
|
||||
_cups_gettimeofday(struct timeval *tv, /* I - Timeval struct */
|
||||
void *tz) /* I - Timezone */
|
||||
{
|
||||
struct _timeb timebuffer; /* Time buffer struct */
|
||||
_ftime(&timebuffer);
|
||||
tv->tv_sec = (long)timebuffer.time;
|
||||
tv->tv_usec = timebuffer.millitm * 1000;
|
||||
tv->tv_usec = timebuffer.millitm * 1000;
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
# include <sys/time.h>
|
||||
# include <unistd.h>
|
||||
#endif /* WIN32 */
|
||||
#include <fcntl.h>
|
||||
#include <regex.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
|
||||
/*
|
||||
@@ -336,41 +336,54 @@ debug_vsnprintf(char *buffer, /* O - Output buffer */
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = 'n';
|
||||
bytes += 2;
|
||||
}
|
||||
else if (*s == '\r')
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = 'r';
|
||||
bytes += 2;
|
||||
}
|
||||
else if (*s == '\t')
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = 't';
|
||||
bytes += 2;
|
||||
}
|
||||
else if (*s == '\\')
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = '\\';
|
||||
bytes += 2;
|
||||
}
|
||||
else if (*s == '\'')
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = '\'';
|
||||
bytes += 2;
|
||||
}
|
||||
else if (*s == '\"')
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = '\"';
|
||||
bytes += 2;
|
||||
}
|
||||
else if ((*s & 255) < ' ')
|
||||
{
|
||||
if ((bufptr + 2) >= bufend)
|
||||
break;
|
||||
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = '0';
|
||||
*bufptr++ = '0' + *s / 8;
|
||||
*bufptr++ = '0' + (*s & 7);
|
||||
bytes += 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
*bufptr++ = *s;
|
||||
bytes ++;
|
||||
}
|
||||
}
|
||||
|
||||
bufend ++;
|
||||
@@ -463,15 +476,18 @@ _cups_debug_printf(const char *format, /* I - Printf-style format string */
|
||||
(int)(curtime.tv_sec % 60), (int)(curtime.tv_usec / 1000));
|
||||
|
||||
va_start(ap, format);
|
||||
debug_vsnprintf(buffer + 13, sizeof(buffer) - 14, format, ap);
|
||||
bytes = debug_vsnprintf(buffer + 13, sizeof(buffer) - 14, format, ap) + 13;
|
||||
va_end(ap);
|
||||
|
||||
bytes = strlen(buffer);
|
||||
if (buffer[bytes - 1] != '\n')
|
||||
if (bytes >= (sizeof(buffer) - 1))
|
||||
{
|
||||
buffer[bytes] = '\n';
|
||||
bytes ++;
|
||||
buffer[bytes] = '\0';
|
||||
buffer[sizeof(buffer) - 2] = '\n';
|
||||
bytes = sizeof(buffer) - 1;
|
||||
}
|
||||
else if (buffer[bytes - 1] != '\n')
|
||||
{
|
||||
buffer[bytes++] = '\n';
|
||||
buffer[bytes] = '\0';
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -489,15 +505,74 @@ _cups_debug_printf(const char *format, /* I - Printf-style format string */
|
||||
void DLLExport
|
||||
_cups_debug_puts(const char *s) /* I - String to output */
|
||||
{
|
||||
char format[4]; /* C%s */
|
||||
struct timeval curtime; /* Current time */
|
||||
char buffer[2048]; /* Output buffer */
|
||||
size_t bytes; /* Number of bytes in buffer */
|
||||
int level; /* Log level in message */
|
||||
|
||||
|
||||
format[0] = *s++;
|
||||
format[1] = '%';
|
||||
format[2] = 's';
|
||||
format[3] = '\0';
|
||||
/*
|
||||
* See if we need to do any logging...
|
||||
*/
|
||||
|
||||
_cups_debug_printf(format, s);
|
||||
if (!debug_init)
|
||||
_cups_debug_set(getenv("CUPS_DEBUG_LOG"), getenv("CUPS_DEBUG_LEVEL"),
|
||||
getenv("CUPS_DEBUG_FILTER"), 0);
|
||||
|
||||
if (_cups_debug_fd < 0)
|
||||
return;
|
||||
|
||||
/*
|
||||
* Filter as needed...
|
||||
*/
|
||||
|
||||
if (isdigit(s[0]))
|
||||
level = *s++ - '0';
|
||||
else
|
||||
level = 0;
|
||||
|
||||
if (level > _cups_debug_level)
|
||||
return;
|
||||
|
||||
if (debug_filter)
|
||||
{
|
||||
int result; /* Filter result */
|
||||
|
||||
_cupsMutexLock(&debug_mutex);
|
||||
result = regexec(debug_filter, s, 0, NULL, 0);
|
||||
_cupsMutexUnlock(&debug_mutex);
|
||||
|
||||
if (result)
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Format the message...
|
||||
*/
|
||||
|
||||
gettimeofday(&curtime, NULL);
|
||||
bytes = snprintf(buffer, sizeof(buffer), "%02d:%02d:%02d.%03d %s",
|
||||
(int)((curtime.tv_sec / 3600) % 24),
|
||||
(int)((curtime.tv_sec / 60) % 60),
|
||||
(int)(curtime.tv_sec % 60), (int)(curtime.tv_usec / 1000),
|
||||
s);
|
||||
|
||||
if (bytes >= (sizeof(buffer) - 1))
|
||||
{
|
||||
buffer[sizeof(buffer) - 2] = '\n';
|
||||
bytes = sizeof(buffer) - 1;
|
||||
}
|
||||
else if (buffer[bytes - 1] != '\n')
|
||||
{
|
||||
buffer[bytes++] = '\n';
|
||||
buffer[bytes] = '\0';
|
||||
}
|
||||
|
||||
/*
|
||||
* Write it out...
|
||||
*/
|
||||
|
||||
write(_cups_debug_fd, buffer, bytes);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -1225,7 +1225,7 @@ cupsSetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
|
||||
#endif /* WIN32 */
|
||||
char filename[1024]; /* lpoptions file */
|
||||
int num_temps; /* Number of temporary destinations */
|
||||
cups_dest_t *temps, /* Temporary destinations */
|
||||
cups_dest_t *temps = NULL, /* Temporary destinations */
|
||||
*temp; /* Current temporary dest */
|
||||
const char *val; /* Value of temporary option */
|
||||
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
|
||||
|
||||
+1
-1
@@ -286,7 +286,7 @@ ppdEmitAfterOrder(
|
||||
* Get the string...
|
||||
*/
|
||||
|
||||
buffer = ppdEmitString(ppd, section, limit ? min_order : 0.0);
|
||||
buffer = ppdEmitString(ppd, section, limit ? min_order : 0.0f);
|
||||
|
||||
/*
|
||||
* Write it as needed and return...
|
||||
|
||||
+6
-1
@@ -39,6 +39,7 @@
|
||||
* cupsFilePeekChar() - Peek at the next character from a file.
|
||||
* cupsFilePrintf() - Write a formatted string.
|
||||
* cupsFilePutChar() - Write a character.
|
||||
* cupsFilePutConf() - Write a configuration line.
|
||||
* cupsFilePuts() - Write a string.
|
||||
* cupsFileRead() - Read from a file.
|
||||
* cupsFileRewind() - Set the current file position to the beginning of
|
||||
@@ -52,6 +53,7 @@
|
||||
* cupsFileWrite() - Write to a file.
|
||||
* cups_compress() - Compress a buffer of data.
|
||||
* cups_fill() - Fill the input buffer.
|
||||
* cups_open() - Safely open a file for writing.
|
||||
* cups_read() - Read from a file descriptor.
|
||||
* cups_write() - Write to a file descriptor.
|
||||
*/
|
||||
@@ -78,6 +80,7 @@ static ssize_t cups_read(cups_file_t *fp, char *buf, size_t bytes);
|
||||
static ssize_t cups_write(cups_file_t *fp, const char *buf, size_t bytes);
|
||||
|
||||
|
||||
#ifndef WIN32
|
||||
/*
|
||||
* '_cupsFileCheck()' - Check the permissions of the given filename.
|
||||
*/
|
||||
@@ -89,7 +92,7 @@ _cupsFileCheck(
|
||||
int dorootchecks, /* I - Check for root permissions? */
|
||||
_cups_fc_func_t cb, /* I - Callback function */
|
||||
void *context) /* I - Context pointer for callback */
|
||||
|
||||
|
||||
{
|
||||
struct stat fileinfo; /* File information */
|
||||
char message[1024], /* Message string */
|
||||
@@ -335,6 +338,7 @@ _cupsFileCheckFilter(
|
||||
|
||||
switch (result)
|
||||
{
|
||||
default :
|
||||
case _CUPS_FILE_CHECK_OK :
|
||||
prefix = "DEBUG2";
|
||||
break;
|
||||
@@ -354,6 +358,7 @@ _cupsFileCheckFilter(
|
||||
|
||||
fprintf(stderr, "%s: %s\n", prefix, message);
|
||||
}
|
||||
#endif /* !WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -43,8 +43,10 @@ static _cups_threadkey_t cups_globals_key = _CUPS_THREADKEY_INITIALIZER;
|
||||
static pthread_once_t cups_globals_key_once = PTHREAD_ONCE_INIT;
|
||||
/* One-time initialization object */
|
||||
#endif /* HAVE_PTHREAD_H */
|
||||
#if defined(HAVE_PTHREAD_H) || defined(WIN32)
|
||||
static _cups_mutex_t cups_global_mutex = _CUPS_MUTEX_INITIALIZER;
|
||||
/* Global critical section */
|
||||
#endif /* HAVE_PTHREAD_H || WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -52,7 +54,9 @@ static _cups_mutex_t cups_global_mutex = _CUPS_MUTEX_INITIALIZER;
|
||||
*/
|
||||
|
||||
static _cups_globals_t *cups_globals_alloc(void);
|
||||
#if defined(HAVE_PTHREAD_H) || defined(WIN32)
|
||||
static void cups_globals_free(_cups_globals_t *g);
|
||||
#endif /* HAVE_PTHREAD_H || WIN32 */
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
static void cups_globals_init(void);
|
||||
#endif /* HAVE_PTHREAD_H */
|
||||
@@ -298,6 +302,7 @@ cups_globals_alloc(void)
|
||||
* 'cups_globals_free()' - Free global data.
|
||||
*/
|
||||
|
||||
#if defined(HAVE_PTHREAD_H) || defined(WIN32)
|
||||
static void
|
||||
cups_globals_free(_cups_globals_t *cg) /* I - Pointer to global data */
|
||||
{
|
||||
@@ -330,6 +335,7 @@ cups_globals_free(_cups_globals_t *cg) /* I - Pointer to global data */
|
||||
|
||||
free(cg);
|
||||
}
|
||||
#endif /* HAVE_PTHREAD_H || WIN32 */
|
||||
|
||||
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
|
||||
+6
-1
@@ -366,7 +366,12 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
|
||||
|
||||
#ifdef AF_LOCAL
|
||||
if (addr->addr.sa_family == AF_LOCAL)
|
||||
strlcpy(s, addr->un.sun_path, slen);
|
||||
{
|
||||
if (addr->un.sun_path[0] == '/')
|
||||
strlcpy(s, addr->un.sun_path, slen);
|
||||
else
|
||||
strlcpy(s, "localhost", slen);
|
||||
}
|
||||
else
|
||||
#endif /* AF_LOCAL */
|
||||
if (addr->addr.sa_family == AF_INET)
|
||||
|
||||
@@ -169,7 +169,7 @@ httpAddrConnect(
|
||||
}
|
||||
|
||||
if (!addrlist)
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, _("Unable to connect to server"), 1);
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, strerror(errno), 0);
|
||||
|
||||
return (addrlist);
|
||||
}
|
||||
|
||||
+25
-24
@@ -245,14 +245,14 @@ struct _http_s /**** HTTP connection structure. ****/
|
||||
http_status_t status; /* Status of last request */
|
||||
http_version_t version; /* Protocol version */
|
||||
http_keepalive_t keep_alive; /* Keep-alive supported? */
|
||||
struct sockaddr_in _hostaddr; /* Address of connected host @deprecated@ */
|
||||
struct sockaddr_in _hostaddr; /* Address of connected host (deprecated) */
|
||||
char hostname[HTTP_MAX_HOST],
|
||||
/* Name of connected host */
|
||||
fields[HTTP_FIELD_MAX][HTTP_MAX_VALUE];
|
||||
/* Field values */
|
||||
char *data; /* Pointer to data buffer */
|
||||
http_encoding_t data_encoding; /* Chunked or not */
|
||||
int _data_remaining;/* Number of bytes left @deprecated@ */
|
||||
int _data_remaining;/* Number of bytes left (deprecated) */
|
||||
int used; /* Number of bytes used in buffer */
|
||||
char buffer[HTTP_MAX_BUFFER];
|
||||
/* Buffer for incoming data */
|
||||
@@ -264,40 +264,41 @@ struct _http_s /**** HTTP connection structure. ****/
|
||||
http_tls_t tls; /* TLS state information */
|
||||
http_encryption_t encryption; /* Encryption requirements */
|
||||
/**** New in CUPS 1.1.19 ****/
|
||||
fd_set *input_set; /* select() set for httpWait() @deprecated@ */
|
||||
http_status_t expect; /* Expect: header @since CUPS 1.1.19@ */
|
||||
char *cookie; /* Cookie value(s) @since CUPS 1.1.19@ */
|
||||
fd_set *input_set; /* select() set for httpWait() (deprecated) */
|
||||
http_status_t expect; /* Expect: header */
|
||||
char *cookie; /* Cookie value(s) */
|
||||
/**** New in CUPS 1.1.20 ****/
|
||||
char _authstring[HTTP_MAX_VALUE],
|
||||
/* Current Authentication value. @deprecated@ */
|
||||
/* Current Authentication value (deprecated) */
|
||||
userpass[HTTP_MAX_VALUE];
|
||||
/* Username:password string @since CUPS 1.1.20@ */
|
||||
int digest_tries; /* Number of tries for digest auth @since CUPS 1.1.20@ */
|
||||
/* Username:password string */
|
||||
int digest_tries; /* Number of tries for digest auth */
|
||||
/**** New in CUPS 1.2 ****/
|
||||
off_t data_remaining; /* Number of bytes left @since CUPS 1.2@ */
|
||||
http_addr_t *hostaddr; /* Current host address and port @since CUPS 1.2@ */
|
||||
http_addrlist_t *addrlist; /* List of valid addresses @since CUPS 1.2@ */
|
||||
off_t data_remaining; /* Number of bytes left */
|
||||
http_addr_t *hostaddr; /* Current host address and port */
|
||||
http_addrlist_t *addrlist; /* List of valid addresses */
|
||||
char wbuffer[HTTP_MAX_BUFFER];
|
||||
/* Buffer for outgoing data */
|
||||
int wused; /* Write buffer bytes used @since CUPS 1.2@ */
|
||||
int wused; /* Write buffer bytes used */
|
||||
/**** New in CUPS 1.3 ****/
|
||||
char *field_authorization;
|
||||
/* Authorization field @since CUPS 1.3@ */
|
||||
char *authstring; /* Current authorization field @since CUPS 1.3 */
|
||||
/* Authorization field */
|
||||
char *authstring; /* Current authorization field */
|
||||
# ifdef HAVE_GSSAPI
|
||||
gss_OID gssmech; /* Authentication mechanism @since CUPS 1.3@ */
|
||||
gss_ctx_id_t gssctx; /* Authentication context @since CUPS 1.3@ */
|
||||
gss_name_t gssname; /* Authentication server name @since CUPS 1.3@ */
|
||||
gss_OID gssmech; /* Authentication mechanism */
|
||||
gss_ctx_id_t gssctx; /* Authentication context */
|
||||
gss_name_t gssname; /* Authentication server name */
|
||||
# endif /* HAVE_GSSAPI */
|
||||
# ifdef HAVE_AUTHORIZATION_H
|
||||
AuthorizationRef auth_ref; /* Authorization ref @since CUPS 1.3@ */
|
||||
AuthorizationRef auth_ref; /* Authorization ref */
|
||||
# endif /* HAVE_AUTHORIZATION_H */
|
||||
/**** New in CUPS 1.5 ****/
|
||||
http_tls_credentials_t tls_credentials;
|
||||
/* TLS credentials @since CUPS 1.5/Mac OS X 10.7@ */
|
||||
http_timeout_cb_t timeout_cb; /* Timeout callback @since CUPS 1.5/Mac OS X 10.7@ */
|
||||
void *timeout_data; /* User data pointer @since CUPS 1.5/Mac OS X 10.7@ */
|
||||
struct timeval timeout_value; /* Timeout in seconds */
|
||||
/* TLS credentials */
|
||||
http_timeout_cb_t timeout_cb; /* Timeout callback */
|
||||
void *timeout_data; /* User data pointer */
|
||||
double timeout_value; /* Timeout in seconds */
|
||||
int wait_value; /* httpWait value for timeout */
|
||||
# ifdef HAVE_GSSAPI
|
||||
char gsshost[256]; /* Hostname for Kerberos */
|
||||
# endif /* HAVE_GSSAPI */
|
||||
@@ -371,12 +372,12 @@ extern void _httpAddrSetPort(http_addr_t *addr, int port);
|
||||
extern char *_httpAssembleUUID(const char *server, int port,
|
||||
const char *name, int number,
|
||||
char *buffer, size_t bufsize);
|
||||
extern http_tls_credentials_t
|
||||
_httpConvertCredentials(cups_array_t *credentials);
|
||||
extern http_t *_httpCreate(const char *host, int port,
|
||||
http_addrlist_t *addrlist,
|
||||
http_encryption_t encryption,
|
||||
int family);
|
||||
extern http_tls_credentials_t
|
||||
_httpCreateCredentials(cups_array_t *credentials);
|
||||
extern char *_httpDecodeURI(char *dst, const char *src,
|
||||
size_t dstsize);
|
||||
extern void _httpDisconnect(http_t *http);
|
||||
|
||||
+33
-11
@@ -216,7 +216,7 @@ httpAssembleURI(
|
||||
* Add username@ first...
|
||||
*/
|
||||
|
||||
ptr = http_copy_encode(ptr, username, end, "/?@", NULL,
|
||||
ptr = http_copy_encode(ptr, username, end, "/?#[]@", NULL,
|
||||
encoding & HTTP_URI_CODING_USERNAME);
|
||||
|
||||
if (!ptr)
|
||||
@@ -466,7 +466,7 @@ _httpAssembleUUID(const char *server, /* I - Server name */
|
||||
|
||||
snprintf(data, sizeof(data), "%s:%d:%s:%d:%04x:%04x", server,
|
||||
port, name ? name : server, number,
|
||||
CUPS_RAND() & 0xffff, CUPS_RAND() & 0xffff);
|
||||
(unsigned)CUPS_RAND() & 0xffff, (unsigned)CUPS_RAND() & 0xffff);
|
||||
|
||||
_cupsMD5Init(&md5state);
|
||||
_cupsMD5Append(&md5state, (unsigned char *)data, strlen(data));
|
||||
@@ -757,10 +757,13 @@ httpGetDateString2(time_t t, /* I - UNIX time */
|
||||
|
||||
|
||||
tdate = gmtime(&t);
|
||||
snprintf(s, slen, "%s, %02d %s %d %02d:%02d:%02d GMT",
|
||||
http_days[tdate->tm_wday], tdate->tm_mday,
|
||||
http_months[tdate->tm_mon], tdate->tm_year + 1900,
|
||||
tdate->tm_hour, tdate->tm_min, tdate->tm_sec);
|
||||
if (tdate)
|
||||
snprintf(s, slen, "%s, %02d %s %d %02d:%02d:%02d GMT",
|
||||
http_days[tdate->tm_wday], tdate->tm_mday,
|
||||
http_months[tdate->tm_mon], tdate->tm_year + 1900,
|
||||
tdate->tm_hour, tdate->tm_min, tdate->tm_sec);
|
||||
else
|
||||
s[0] = '\0';
|
||||
|
||||
return (s);
|
||||
}
|
||||
@@ -1823,17 +1826,36 @@ http_resolve_cb(
|
||||
|
||||
if ((value = TXTRecordGetValuePtr(txtLen, txtRecord, "rp",
|
||||
&valueLen)) != NULL)
|
||||
{
|
||||
if (((char *)value)[0] == '/')
|
||||
{
|
||||
/*
|
||||
* "rp" value (incorrectly) has a leading slash already...
|
||||
*/
|
||||
|
||||
memcpy(rp, value, valueLen);
|
||||
rp[valueLen] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Convert to resource by concatenating with a leading "/"...
|
||||
*/
|
||||
|
||||
rp[0] = '/';
|
||||
memcpy(rp + 1, value, valueLen);
|
||||
rp[valueLen + 1] = '\0';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Convert to resource by concatenating with a leading "/"...
|
||||
* Default "rp" value is blank, mapping to a path of "/"...
|
||||
*/
|
||||
|
||||
rp[0] = '/';
|
||||
memcpy(rp + 1, value, valueLen);
|
||||
rp[valueLen + 1] = '\0';
|
||||
rp[1] = '\0';
|
||||
}
|
||||
else
|
||||
rp[0] = '\0';
|
||||
|
||||
/*
|
||||
* Lookup the FQDN if needed...
|
||||
|
||||
+433
-235
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+71
-53
@@ -89,7 +89,9 @@ static const char * const ipp_status_oks[] = /* "OK" status codes */
|
||||
"server-error-busy",
|
||||
"server-error-job-canceled",
|
||||
"server-error-multiple-document-jobs-not-supported",
|
||||
"server-error-printer-is-deactivated"
|
||||
"server-error-printer-is-deactivated",
|
||||
"server-error-too-many-jobs",
|
||||
"server-error-too-many-documents"
|
||||
},
|
||||
* const ipp_status_1000s[] = /* CUPS internal */
|
||||
{
|
||||
@@ -100,8 +102,8 @@ static const char * const ipp_status_oks[] = /* "OK" status codes */
|
||||
static char * const ipp_std_ops[] =
|
||||
{
|
||||
/* 0x0000 - 0x000f */
|
||||
"unknown-00",
|
||||
"unknown-01",
|
||||
"0x00",
|
||||
"0x01",
|
||||
"Print-Job",
|
||||
"Print-URI",
|
||||
"Validate-Job",
|
||||
@@ -115,7 +117,7 @@ static char * const ipp_std_ops[] =
|
||||
"Hold-Job",
|
||||
"Release-Job",
|
||||
"Restart-Job",
|
||||
"unknown-0f",
|
||||
"0x0f",
|
||||
|
||||
/* 0x0010 - 0x001f */
|
||||
"Pause-Printer",
|
||||
@@ -132,11 +134,11 @@ static char * const ipp_std_ops[] =
|
||||
"Cancel-Subscription",
|
||||
"Get-Notifications",
|
||||
"Send-Notifications",
|
||||
"unknown-1e",
|
||||
"unknown-1f",
|
||||
"0x1e",
|
||||
"0x1f",
|
||||
|
||||
/* 0x0020 - 0x002f */
|
||||
"unknown-20",
|
||||
"0x20",
|
||||
"Get-Printer-Support-Files",
|
||||
"Enable-Printer",
|
||||
"Disable-Printer",
|
||||
@@ -156,7 +158,7 @@ static char * const ipp_std_ops[] =
|
||||
/* 0x0030 - 0x003b */
|
||||
"Promote-Job",
|
||||
"Schedule-Job-After",
|
||||
"unknown-32",
|
||||
"0x32",
|
||||
"Cancel-Document",
|
||||
"Get-Document-Attributes",
|
||||
"Get-Documents",
|
||||
@@ -165,7 +167,8 @@ static char * const ipp_std_ops[] =
|
||||
"Cancel-Jobs",
|
||||
"Cancel-My-Jobs",
|
||||
"Resubmit-Job",
|
||||
"Close-Job"
|
||||
"Close-Job",
|
||||
"Identify-Printer"
|
||||
},
|
||||
* const ipp_cups_ops[] =
|
||||
{
|
||||
@@ -205,46 +208,47 @@ static char * const ipp_std_ops[] =
|
||||
/* 0x06 */
|
||||
"event-notification-attributes-tag",
|
||||
/* 0x07 */
|
||||
"unknown-08", /* 0x08 */
|
||||
"unknown-09", /* 0x09 */
|
||||
"unknown-0a", /* 0x0a */
|
||||
"unknown-0b", /* 0x0b */
|
||||
"unknown-0c", /* 0x0c */
|
||||
"unknown-0d", /* 0x0d */
|
||||
"unknown-0e", /* 0x0e */
|
||||
"unknown-0f", /* 0x0f */
|
||||
"0x08", /* 0x08 */
|
||||
"document-attributes-tag",
|
||||
/* 0x09 */
|
||||
"0x0a", /* 0x0a */
|
||||
"0x0b", /* 0x0b */
|
||||
"0x0c", /* 0x0c */
|
||||
"0x0d", /* 0x0d */
|
||||
"0x0e", /* 0x0e */
|
||||
"0x0f", /* 0x0f */
|
||||
"unsupported", /* 0x10 */
|
||||
"default", /* 0x11 */
|
||||
"unknown", /* 0x12 */
|
||||
"no-value", /* 0x13 */
|
||||
"unknown-14", /* 0x14 */
|
||||
"0x14", /* 0x14 */
|
||||
"not-settable", /* 0x15 */
|
||||
"delete-attribute", /* 0x16 */
|
||||
"admin-define", /* 0x17 */
|
||||
"unknown-18", /* 0x18 */
|
||||
"unknown-19", /* 0x19 */
|
||||
"unknown-1a", /* 0x1a */
|
||||
"unknown-1b", /* 0x1b */
|
||||
"unknown-1c", /* 0x1c */
|
||||
"unknown-1d", /* 0x1d */
|
||||
"unknown-1e", /* 0x1e */
|
||||
"unknown-1f", /* 0x1f */
|
||||
"unknown-20", /* 0x20 */
|
||||
"0x18", /* 0x18 */
|
||||
"0x19", /* 0x19 */
|
||||
"0x1a", /* 0x1a */
|
||||
"0x1b", /* 0x1b */
|
||||
"0x1c", /* 0x1c */
|
||||
"0x1d", /* 0x1d */
|
||||
"0x1e", /* 0x1e */
|
||||
"0x1f", /* 0x1f */
|
||||
"0x20", /* 0x20 */
|
||||
"integer", /* 0x21 */
|
||||
"boolean", /* 0x22 */
|
||||
"enum", /* 0x23 */
|
||||
"unknown-24", /* 0x24 */
|
||||
"unknown-25", /* 0x25 */
|
||||
"unknown-26", /* 0x26 */
|
||||
"unknown-27", /* 0x27 */
|
||||
"unknown-28", /* 0x28 */
|
||||
"unknown-29", /* 0x29 */
|
||||
"unknown-2a", /* 0x2a */
|
||||
"unknown-2b", /* 0x2b */
|
||||
"unknown-2c", /* 0x2c */
|
||||
"unknown-2d", /* 0x2d */
|
||||
"unknown-2e", /* 0x2e */
|
||||
"unknown-2f", /* 0x2f */
|
||||
"0x24", /* 0x24 */
|
||||
"0x25", /* 0x25 */
|
||||
"0x26", /* 0x26 */
|
||||
"0x27", /* 0x27 */
|
||||
"0x28", /* 0x28 */
|
||||
"0x29", /* 0x29 */
|
||||
"0x2a", /* 0x2a */
|
||||
"0x2b", /* 0x2b */
|
||||
"0x2c", /* 0x2c */
|
||||
"0x2d", /* 0x2d */
|
||||
"0x2e", /* 0x2e */
|
||||
"0x2f", /* 0x2f */
|
||||
"octetString", /* 0x30 */
|
||||
"dateTime", /* 0x31 */
|
||||
"resolution", /* 0x32 */
|
||||
@@ -253,18 +257,18 @@ static char * const ipp_std_ops[] =
|
||||
"textWithLanguage", /* 0x35 */
|
||||
"nameWithLanguage", /* 0x36 */
|
||||
"endCollection", /* 0x37 */
|
||||
"unknown-38", /* 0x38 */
|
||||
"unknown-39", /* 0x39 */
|
||||
"unknown-3a", /* 0x3a */
|
||||
"unknown-3b", /* 0x3b */
|
||||
"unknown-3c", /* 0x3c */
|
||||
"unknown-3d", /* 0x3d */
|
||||
"unknown-3e", /* 0x3e */
|
||||
"unknown-3f", /* 0x3f */
|
||||
"unknown-40", /* 0x40 */
|
||||
"0x38", /* 0x38 */
|
||||
"0x39", /* 0x39 */
|
||||
"0x3a", /* 0x3a */
|
||||
"0x3b", /* 0x3b */
|
||||
"0x3c", /* 0x3c */
|
||||
"0x3d", /* 0x3d */
|
||||
"0x3e", /* 0x3e */
|
||||
"0x3f", /* 0x3f */
|
||||
"0x40", /* 0x40 */
|
||||
"textWithoutLanguage",/* 0x41 */
|
||||
"nameWithoutLanguage",/* 0x42 */
|
||||
"unknown-43", /* 0x43 */
|
||||
"0x43", /* 0x43 */
|
||||
"keyword", /* 0x44 */
|
||||
"uri", /* 0x45 */
|
||||
"uriScheme", /* 0x46 */
|
||||
@@ -370,6 +374,16 @@ _ippAttrString(ipp_attribute_t *attr, /* I - Attribute */
|
||||
bufptr += strlen(ptr);
|
||||
break;
|
||||
}
|
||||
else if (!strcmp(attr->name, "operations-supported"))
|
||||
{
|
||||
ptr = ippOpString(val->integer);
|
||||
|
||||
if (buffer && bufptr < bufend)
|
||||
strlcpy(bufptr, ptr, bufend - bufptr + 1);
|
||||
|
||||
bufptr += strlen(ptr);
|
||||
break;
|
||||
}
|
||||
|
||||
case IPP_TAG_INTEGER :
|
||||
if (buffer && bufptr < bufend)
|
||||
@@ -437,6 +451,7 @@ _ippAttrString(ipp_attribute_t *attr, /* I - Attribute */
|
||||
case IPP_TAG_KEYWORD :
|
||||
case IPP_TAG_CHARSET :
|
||||
case IPP_TAG_URI :
|
||||
case IPP_TAG_URISCHEME :
|
||||
case IPP_TAG_MIMETYPE :
|
||||
case IPP_TAG_LANGUAGE :
|
||||
case IPP_TAG_TEXTLANG :
|
||||
@@ -544,10 +559,10 @@ ippErrorString(ipp_status_t error) /* I - Error status */
|
||||
return (ipp_status_1000s[error - IPP_AUTHENTICATION_CANCELED]);
|
||||
|
||||
/*
|
||||
* No, build an "unknown-xxxx" error string...
|
||||
* No, build an "0xxxxx" error string...
|
||||
*/
|
||||
|
||||
sprintf(cg->ipp_unknown, "unknown-%04x", error);
|
||||
sprintf(cg->ipp_unknown, "0x%04x", error);
|
||||
|
||||
return (cg->ipp_unknown);
|
||||
}
|
||||
@@ -617,10 +632,10 @@ ippOpString(ipp_op_t op) /* I - Operation ID */
|
||||
return (ipp_cups_ops2[0]);
|
||||
|
||||
/*
|
||||
* No, build an "unknown-xxxx" operation string...
|
||||
* No, build an "0xxxxx" operation string...
|
||||
*/
|
||||
|
||||
sprintf(cg->ipp_unknown, "unknown-%04x", op);
|
||||
sprintf(cg->ipp_unknown, "0x%04x", op);
|
||||
|
||||
return (cg->ipp_unknown);
|
||||
}
|
||||
@@ -638,6 +653,9 @@ ippOpValue(const char *name) /* I - Textual name */
|
||||
int i;
|
||||
|
||||
|
||||
if (!strncmp(name, "0x", 2))
|
||||
return ((ipp_op_t)strtol(name + 2, NULL, 16));
|
||||
|
||||
for (i = 0; i < (sizeof(ipp_std_ops) / sizeof(ipp_std_ops[0])); i ++)
|
||||
if (!_cups_strcasecmp(name, ipp_std_ops[i]))
|
||||
return ((ipp_op_t)i);
|
||||
|
||||
+158
-144
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Internet Printing Protocol functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -1109,14 +1109,14 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
DEBUG_printf(("ippReadIO(src=%p, cb=%p, blocking=%d, parent=%p, ipp=%p)",
|
||||
src, cb, blocking, parent, ipp));
|
||||
DEBUG_printf(("2ippReadIO: ipp->state=%d", ipp->state));
|
||||
DEBUG_printf(("2ippReadIO: ipp->state=%d", ipp ? ipp->state : IPP_ERROR));
|
||||
|
||||
if (!src || !ipp)
|
||||
return (IPP_ERROR);
|
||||
|
||||
if ((buffer = ipp_buffer_get()) == NULL)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: Unable to get read buffer!");
|
||||
DEBUG_puts("1ippReadIO: Unable to get read buffer.");
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
@@ -1134,7 +1134,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
if ((*cb)(src, buffer, 8) < 8)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: Unable to read header!");
|
||||
DEBUG_puts("1ippReadIO: Unable to read header.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1193,7 +1193,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
* No more attributes left...
|
||||
*/
|
||||
|
||||
DEBUG_puts("2ippReadIO: IPP_TAG_END!");
|
||||
DEBUG_puts("2ippReadIO: IPP_TAG_END.");
|
||||
|
||||
ipp->state = IPP_DATA;
|
||||
break;
|
||||
@@ -1225,7 +1225,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
if ((*cb)(src, buffer, 2) < 2)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: unable to read name length!");
|
||||
DEBUG_puts("1ippReadIO: unable to read name length.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1234,7 +1234,8 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
if (n >= IPP_BUF_SIZE)
|
||||
{
|
||||
DEBUG_printf(("1ippReadIO: bad name length %d!", n));
|
||||
_cupsSetError(IPP_ERROR, _("IPP name larger than 32767 bytes."), 1);
|
||||
DEBUG_printf(("1ippReadIO: bad name length %d.", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1250,7 +1251,8 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
if (ipp->current == NULL)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: Attribute without name and no current");
|
||||
_cupsSetError(IPP_ERROR, _("IPP attribute has no name."), 1);
|
||||
DEBUG_puts("1ippReadIO: Attribute without name and no current.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1285,6 +1287,9 @@ ippReadIO(void *src, /* I - Data source */
|
||||
(tag < IPP_TAG_TEXT || tag > IPP_TAG_MIMETYPE) &&
|
||||
tag != IPP_TAG_NOVALUE)
|
||||
{
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP 1setOf attribute with incompatible value "
|
||||
"tags."), 1);
|
||||
DEBUG_printf(("1ippReadIO: 1setOf value tag %x(%s) != %x(%s)",
|
||||
value_tag, ippTagString(value_tag), tag,
|
||||
ippTagString(tag)));
|
||||
@@ -1292,8 +1297,53 @@ ippReadIO(void *src, /* I - Data source */
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
}
|
||||
else if (value_tag == IPP_TAG_INTEGER ||
|
||||
value_tag == IPP_TAG_RANGE)
|
||||
{
|
||||
/*
|
||||
* Integer and rangeOfInteger values can sometimes be mixed; accept
|
||||
* sets of differing values...
|
||||
*/
|
||||
|
||||
if (tag != IPP_TAG_INTEGER && tag != IPP_TAG_RANGE)
|
||||
{
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP 1setOf attribute with incompatible value "
|
||||
"tags."), 1);
|
||||
DEBUG_printf(("1ippReadIO: 1setOf value tag %x(%s) != %x(%s)",
|
||||
value_tag, ippTagString(value_tag), tag,
|
||||
ippTagString(tag)));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if (value_tag == IPP_TAG_INTEGER && tag == IPP_TAG_RANGE)
|
||||
{
|
||||
/*
|
||||
* Convert integer values to rangeOfInteger values...
|
||||
*/
|
||||
|
||||
int i; /* Looping var */
|
||||
|
||||
DEBUG_printf(("1ippReadIO: Converting %s attribute to "
|
||||
"rangeOfInteger.", attr->name));
|
||||
|
||||
attr->value_tag = IPP_TAG_RANGE;
|
||||
|
||||
for (i = attr->num_values, value = attr->values;
|
||||
i > 0;
|
||||
i --, value ++)
|
||||
{
|
||||
n = value->integer;
|
||||
value->range.lower = value->range.upper = n;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (value_tag != tag)
|
||||
{
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP 1setOf attribute with incompatible value "
|
||||
"tags."), 1);
|
||||
DEBUG_printf(("1ippReadIO: value tag %x(%s) != %x(%s)",
|
||||
value_tag, ippTagString(value_tag), tag,
|
||||
ippTagString(tag)));
|
||||
@@ -1311,7 +1361,6 @@ ippReadIO(void *src, /* I - Data source */
|
||||
{
|
||||
ipp_attribute_t *temp; /* Pointer to new buffer */
|
||||
|
||||
|
||||
DEBUG_printf(("2ippReadIO: reallocating for up to %d values...",
|
||||
attr->num_values + IPP_MAX_VALUES));
|
||||
|
||||
@@ -1323,6 +1372,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
(attr->num_values + IPP_MAX_VALUES - 1) *
|
||||
sizeof(ipp_value_t))) == NULL)
|
||||
{
|
||||
_cupsSetHTTPError(HTTP_ERROR);
|
||||
DEBUG_puts("1ippReadIO: Unable to resize attribute");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
@@ -1351,7 +1401,8 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
if (n)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: member name not empty!");
|
||||
_cupsSetError(IPP_ERROR, _("IPP member name is not empty."), 1);
|
||||
DEBUG_puts("1ippReadIO: member name not empty.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1376,7 +1427,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
if ((*cb)(src, buffer, n) < n)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: unable to read name!");
|
||||
DEBUG_puts("1ippReadIO: unable to read name.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1388,7 +1439,8 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
if ((attr = ipp->current = _ippAddAttr(ipp, 1)) == NULL)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: unable to allocate attribute!");
|
||||
_cupsSetHTTPError(HTTP_ERROR);
|
||||
DEBUG_puts("1ippReadIO: unable to allocate attribute.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1411,7 +1463,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
if ((*cb)(src, buffer, 2) < 2)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: unable to read value length!");
|
||||
DEBUG_puts("1ippReadIO: unable to read value length.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1419,20 +1471,35 @@ ippReadIO(void *src, /* I - Data source */
|
||||
n = (buffer[0] << 8) | buffer[1];
|
||||
DEBUG_printf(("2ippReadIO: value length=%d", n));
|
||||
|
||||
if (n >= IPP_BUF_SIZE)
|
||||
{
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP value larger than 32767 bytes."), 1);
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d.", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
switch (tag)
|
||||
{
|
||||
case IPP_TAG_INTEGER :
|
||||
case IPP_TAG_ENUM :
|
||||
if (n != 4)
|
||||
{
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d!", n));
|
||||
if (tag == IPP_TAG_INTEGER)
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP integer value not 4 bytes."), 1);
|
||||
else
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP enum value not 4 bytes."), 1);
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d.", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if ((*cb)(src, buffer, 4) < 4)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: Unable to read integer value!");
|
||||
DEBUG_puts("1ippReadIO: Unable to read integer value.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1440,20 +1507,25 @@ ippReadIO(void *src, /* I - Data source */
|
||||
n = (((((buffer[0] << 8) | buffer[1]) << 8) | buffer[2]) << 8) |
|
||||
buffer[3];
|
||||
|
||||
value->integer = n;
|
||||
if (attr->value_tag == IPP_TAG_RANGE)
|
||||
value->range.lower = value->range.upper = n;
|
||||
else
|
||||
value->integer = n;
|
||||
break;
|
||||
|
||||
case IPP_TAG_BOOLEAN :
|
||||
if (n != 1)
|
||||
{
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d!", n));
|
||||
_cupsSetError(IPP_ERROR, _("IPP boolean value not 1 byte."),
|
||||
1);
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d.", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if ((*cb)(src, buffer, 1) < 1)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: Unable to read boolean value!");
|
||||
DEBUG_puts("1ippReadIO: Unable to read boolean value.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1487,16 +1559,9 @@ ippReadIO(void *src, /* I - Data source */
|
||||
case IPP_TAG_CHARSET :
|
||||
case IPP_TAG_LANGUAGE :
|
||||
case IPP_TAG_MIMETYPE :
|
||||
if (n >= IPP_BUF_SIZE)
|
||||
{
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d!", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if ((*cb)(src, buffer, n) < n)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: unable to read name!");
|
||||
DEBUG_puts("1ippReadIO: unable to read string value.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1509,14 +1574,16 @@ ippReadIO(void *src, /* I - Data source */
|
||||
case IPP_TAG_DATE :
|
||||
if (n != 11)
|
||||
{
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d!", n));
|
||||
_cupsSetError(IPP_ERROR, _("IPP date value not 11 bytes."),
|
||||
1);
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d.", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if ((*cb)(src, value->date, 11) < 11)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: Unable to read date value!");
|
||||
DEBUG_puts("1ippReadIO: Unable to read date value.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1525,14 +1592,16 @@ ippReadIO(void *src, /* I - Data source */
|
||||
case IPP_TAG_RESOLUTION :
|
||||
if (n != 9)
|
||||
{
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d!", n));
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP resolution value not 9 bytes."), 1);
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d.", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if ((*cb)(src, buffer, 9) < 9)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: Unable to read resolution value!");
|
||||
DEBUG_puts("1ippReadIO: Unable to read resolution value.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1550,14 +1619,16 @@ ippReadIO(void *src, /* I - Data source */
|
||||
case IPP_TAG_RANGE :
|
||||
if (n != 8)
|
||||
{
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d!", n));
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP rangeOfInteger value not 8 bytes."), 1);
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d.", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if ((*cb)(src, buffer, 8) < 8)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: Unable to read range value!");
|
||||
DEBUG_puts("1ippReadIO: Unable to read range value.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1572,9 +1643,17 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
case IPP_TAG_TEXTLANG :
|
||||
case IPP_TAG_NAMELANG :
|
||||
if (n >= IPP_BUF_SIZE || n < 4)
|
||||
if (n < 4)
|
||||
{
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d!", n));
|
||||
if (tag == IPP_TAG_TEXTLANG)
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP textWithLanguage value less than "
|
||||
"minimum 4 bytes."), 1);
|
||||
else
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP nameWithLanguage value less than "
|
||||
"minimum 4 bytes."), 1);
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d.", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1582,7 +1661,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
if ((*cb)(src, buffer, n) < n)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: Unable to read string w/language "
|
||||
"value!");
|
||||
"value.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1593,10 +1672,13 @@ ippReadIO(void *src, /* I - Data source */
|
||||
* text-with-language and name-with-language are composite
|
||||
* values:
|
||||
*
|
||||
* charset-length
|
||||
* charset
|
||||
* language-length
|
||||
* language
|
||||
* text-length
|
||||
* text
|
||||
*
|
||||
* The "charset" field name is an unfortunate typo from
|
||||
* CUPS 1.0...
|
||||
*/
|
||||
|
||||
n = (bufptr[0] << 8) | bufptr[1];
|
||||
@@ -1604,7 +1686,9 @@ ippReadIO(void *src, /* I - Data source */
|
||||
if ((bufptr + 2 + n) >= (buffer + IPP_BUF_SIZE) ||
|
||||
n >= sizeof(string))
|
||||
{
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d!", n));
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP language length overflows value."), 1);
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d.", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1619,7 +1703,9 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
if ((bufptr + 2 + n) >= (buffer + IPP_BUF_SIZE))
|
||||
{
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d!", n));
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP string length overflows value."), 1);
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d.", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1637,15 +1723,17 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
if (n > 0)
|
||||
{
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP begCollection value not 0 bytes."), 1);
|
||||
DEBUG_puts("1ippReadIO: begCollection tag with value length "
|
||||
"> 0!");
|
||||
"> 0.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if (ippReadIO(src, cb, 1, ipp, value->collection) == IPP_ERROR)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: Unable to read collection value!");
|
||||
DEBUG_puts("1ippReadIO: Unable to read collection value.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1656,8 +1744,10 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
if (n > 0)
|
||||
{
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP endCollection value not 0 bytes."), 1);
|
||||
DEBUG_puts("1ippReadIO: endCollection tag with value length "
|
||||
"> 0!");
|
||||
"> 0.");
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
@@ -1670,16 +1760,9 @@ ippReadIO(void *src, /* I - Data source */
|
||||
* we need to carry over...
|
||||
*/
|
||||
|
||||
if (n >= IPP_BUF_SIZE)
|
||||
{
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d!", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if ((*cb)(src, buffer, n) < n)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: Unable to read member name value!");
|
||||
DEBUG_puts("1ippReadIO: Unable to read member name value.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1699,25 +1782,12 @@ ippReadIO(void *src, /* I - Data source */
|
||||
break;
|
||||
|
||||
default : /* Other unsupported values */
|
||||
if (n > IPP_MAX_LENGTH)
|
||||
{
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d!", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if (!value)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: NULL value!");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
value->unknown.length = n;
|
||||
if (n > 0)
|
||||
{
|
||||
if ((value->unknown.data = malloc(n)) == NULL)
|
||||
{
|
||||
_cupsSetHTTPError(HTTP_ERROR);
|
||||
DEBUG_puts("1ippReadIO: Unable to allocate value");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
@@ -1725,7 +1795,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
if ((*cb)(src, value->unknown.data, n) < n)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: Unable to read unsupported value!");
|
||||
DEBUG_puts("1ippReadIO: Unable to read unsupported value.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1753,7 +1823,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
break; /* anti-compiler-warning-code */
|
||||
}
|
||||
|
||||
DEBUG_printf(("1ippReadIO: returning ipp->state=%d!", ipp->state));
|
||||
DEBUG_printf(("1ippReadIO: returning ipp->state=%d.", ipp->state));
|
||||
ipp_buffer_release(buffer);
|
||||
|
||||
return (ipp->state);
|
||||
@@ -3022,9 +3092,8 @@ ipp_read_http(http_t *http, /* I - Client connection */
|
||||
ipp_uchar_t *buffer, /* O - Buffer for data */
|
||||
size_t length) /* I - Total length */
|
||||
{
|
||||
int tbytes, /* Total bytes read */
|
||||
bytes; /* Bytes read this pass */
|
||||
char len[32]; /* Length string */
|
||||
int tbytes, /* Total bytes read */
|
||||
bytes; /* Bytes read this pass */
|
||||
|
||||
|
||||
DEBUG_printf(("7ipp_read_http(http=%p, buffer=%p, length=%d)",
|
||||
@@ -3044,91 +3113,36 @@ ipp_read_http(http_t *http, /* I - Client connection */
|
||||
if (http->state == HTTP_WAITING)
|
||||
break;
|
||||
|
||||
if (http->used > 0 && http->data_encoding == HTTP_ENCODE_LENGTH)
|
||||
if (http->used == 0 && !http->blocking)
|
||||
{
|
||||
/*
|
||||
* Do "fast read" from HTTP buffer directly...
|
||||
* Wait up to 10 seconds for more data on non-blocking sockets...
|
||||
*/
|
||||
|
||||
if (http->used > (int)(length - tbytes))
|
||||
bytes = (int)(length - tbytes);
|
||||
else
|
||||
bytes = http->used;
|
||||
|
||||
if (bytes == 1)
|
||||
buffer[0] = http->buffer[0];
|
||||
else
|
||||
memcpy(buffer, http->buffer, bytes);
|
||||
|
||||
http->used -= bytes;
|
||||
http->data_remaining -= bytes;
|
||||
|
||||
if (http->data_remaining <= INT_MAX)
|
||||
http->_data_remaining = (int)http->data_remaining;
|
||||
else
|
||||
http->_data_remaining = INT_MAX;
|
||||
|
||||
if (http->used > 0)
|
||||
memmove(http->buffer, http->buffer + bytes, http->used);
|
||||
|
||||
if (http->data_remaining == 0)
|
||||
{
|
||||
if (http->data_encoding == HTTP_ENCODE_CHUNKED)
|
||||
{
|
||||
/*
|
||||
* Get the trailing CR LF after the chunk...
|
||||
*/
|
||||
|
||||
if (!httpGets(len, sizeof(len), http))
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (http->data_encoding != HTTP_ENCODE_CHUNKED)
|
||||
{
|
||||
if (http->state == HTTP_POST_RECV)
|
||||
http->state ++;
|
||||
else
|
||||
http->state = HTTP_WAITING;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Wait a maximum of 1 second for data...
|
||||
*/
|
||||
|
||||
if (!http->blocking)
|
||||
if (!httpWait(http, 10000))
|
||||
{
|
||||
/*
|
||||
* Wait up to 10 seconds for more data on non-blocking sockets...
|
||||
* Signal no data...
|
||||
*/
|
||||
|
||||
if (!httpWait(http, 10000))
|
||||
{
|
||||
/*
|
||||
* Signal no data...
|
||||
*/
|
||||
|
||||
bytes = -1;
|
||||
break;
|
||||
}
|
||||
bytes = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
if ((bytes = httpRead2(http, (char *)buffer, length - tbytes)) < 0)
|
||||
{
|
||||
#ifdef WIN32
|
||||
break;
|
||||
#else
|
||||
if (errno != EAGAIN && errno != EINTR)
|
||||
break;
|
||||
|
||||
bytes = 0;
|
||||
#endif /* WIN32 */
|
||||
}
|
||||
else if (bytes == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if ((bytes = httpRead2(http, (char *)buffer, length - tbytes)) < 0)
|
||||
{
|
||||
#ifdef WIN32
|
||||
break;
|
||||
#else
|
||||
if (errno != EAGAIN && errno != EINTR)
|
||||
break;
|
||||
|
||||
bytes = 0;
|
||||
#endif /* WIN32 */
|
||||
}
|
||||
else if (bytes == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -73,6 +73,7 @@ typedef enum ipp_tag_e /**** Format tags for attributes ****/
|
||||
IPP_TAG_UNSUPPORTED_GROUP, /* Unsupported attributes group */
|
||||
IPP_TAG_SUBSCRIPTION, /* Subscription group */
|
||||
IPP_TAG_EVENT_NOTIFICATION, /* Event group */
|
||||
IPP_TAG_DOCUMENT = 0x09, /* Document group */
|
||||
IPP_TAG_UNSUPPORTED_VALUE = 0x10, /* Unsupported value */
|
||||
IPP_TAG_DEFAULT, /* Default value */
|
||||
IPP_TAG_UNKNOWN, /* Unknown value */
|
||||
@@ -241,6 +242,7 @@ typedef enum ipp_op_e /**** IPP operations ****/
|
||||
IPP_CANCEL_MY_JOBS, /* Cancel-My-Jobs */
|
||||
IPP_RESUBMIT_JOB, /* Resubmit-Job */
|
||||
IPP_CLOSE_JOB, /* Close-Job */
|
||||
IPP_IDENTIFY_PRINTER, /* Identify-Printer (proposed IPP JPS3) */
|
||||
IPP_PRIVATE = 0x4000, /* Reserved @private@ */
|
||||
CUPS_GET_DEFAULT, /* Get the default printer */
|
||||
CUPS_GET_PRINTERS, /* Get a list of printers and/or classes */
|
||||
@@ -312,6 +314,8 @@ typedef enum ipp_status_e /**** IPP status codes ****/
|
||||
IPP_ERROR_JOB_CANCELED, /* server-error-job-canceled */
|
||||
IPP_MULTIPLE_JOBS_NOT_SUPPORTED, /* server-error-multiple-document-jobs-not-supported */
|
||||
IPP_PRINTER_IS_DEACTIVATED, /* server-error-printer-is-deactivated */
|
||||
IPP_TOO_MANY_JOBS, /* server-error-too-many-jobs */
|
||||
IPP_TOO_MANY_DOCUMENTS, /* server-error-too-many-documents */
|
||||
|
||||
IPP_AUTHENTICATION_CANCELED = 0x1000, /* Authentication canceled by user @since CUPS 1.5/Mac OS X 10.7@ */
|
||||
IPP_PKI_ERROR, /* Error negotiating a secure connection @since CUPS 1.5/Mac OS X 10.7@ */
|
||||
|
||||
+45
-5
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* I18N/language support 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
|
||||
@@ -80,7 +80,7 @@ static const char * const lang_encodings[] =
|
||||
"cp1256", "cp1257",
|
||||
"cp1258", "koi8-r",
|
||||
"koi8-u", "iso-8859-11",
|
||||
"iso-8859-16", "mac-roman",
|
||||
"iso-8859-16", "mac",
|
||||
"unknown", "unknown",
|
||||
"unknown", "unknown",
|
||||
"unknown", "unknown",
|
||||
@@ -835,7 +835,7 @@ _cupsLangString(cups_lang_t *lang, /* I - Language */
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
if (!lang || !message)
|
||||
if (!lang || !message || !*message)
|
||||
return (message);
|
||||
|
||||
_cupsMutexLock(&lang_mutex);
|
||||
@@ -979,7 +979,23 @@ _cupsMessageLoad(const char *filename, /* I - Message catalog to load */
|
||||
*/
|
||||
|
||||
if (m)
|
||||
cupsArrayAdd(a, m);
|
||||
{
|
||||
if (m->str && m->str[0])
|
||||
{
|
||||
cupsArrayAdd(a, m);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Translation is empty, don't add it... (STR #4033)
|
||||
*/
|
||||
|
||||
free(m->id);
|
||||
if (m->str)
|
||||
free(m->str);
|
||||
free(m);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Create a new message with the given msgid string...
|
||||
@@ -1009,6 +1025,11 @@ _cupsMessageLoad(const char *filename, /* I - Message catalog to load */
|
||||
if ((temp = realloc(m->str ? m->str : m->id,
|
||||
length + strlen(ptr) + 1)) == NULL)
|
||||
{
|
||||
if (m->str)
|
||||
free(m->str);
|
||||
free(m->id);
|
||||
free(m);
|
||||
|
||||
cupsFileClose(fp);
|
||||
return (a);
|
||||
}
|
||||
@@ -1046,6 +1067,9 @@ _cupsMessageLoad(const char *filename, /* I - Message catalog to load */
|
||||
|
||||
if ((m->str = strdup(ptr)) == NULL)
|
||||
{
|
||||
free(m->id);
|
||||
free(m);
|
||||
|
||||
cupsFileClose(fp);
|
||||
return (a);
|
||||
}
|
||||
@@ -1057,7 +1081,23 @@ _cupsMessageLoad(const char *filename, /* I - Message catalog to load */
|
||||
*/
|
||||
|
||||
if (m)
|
||||
cupsArrayAdd(a, m);
|
||||
{
|
||||
if (m->str && m->str[0])
|
||||
{
|
||||
cupsArrayAdd(a, m);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Translation is empty, don't add it... (STR #4033)
|
||||
*/
|
||||
|
||||
free(m->id);
|
||||
if (m->str)
|
||||
free(m->str);
|
||||
free(m);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Close the message catalog file and return the new array...
|
||||
|
||||
+15
-14
@@ -25,6 +25,8 @@ _cupsStrFree
|
||||
_cupsStrRetain
|
||||
_cupsStrScand
|
||||
_cupsStrStatistics
|
||||
_cups_strcasecmp
|
||||
_cups_strncasecmp
|
||||
_cups_strcpy
|
||||
_cups_strlcat
|
||||
_cups_strlcpy
|
||||
@@ -35,12 +37,23 @@ _httpCreate
|
||||
_httpEncodeURI
|
||||
_httpPeek
|
||||
_httpResolveURI
|
||||
_httpSetTimeout
|
||||
_httpWait
|
||||
_ippAddAttr
|
||||
_ippAttrString
|
||||
_ippFindOption
|
||||
_ippFreeAttr
|
||||
_ppdCacheCreateWithFile
|
||||
_ppdCacheCreateWithPPD
|
||||
_ppdCacheDestroy
|
||||
_ppdCacheGetBin
|
||||
_ppdCacheGetInputSlot
|
||||
_ppdCacheGetMediaType
|
||||
_ppdCacheGetOutputBin
|
||||
_ppdCacheGetPageSize
|
||||
_ppdCacheGetSize
|
||||
_ppdCacheGetSource
|
||||
_ppdCacheGetType
|
||||
_ppdCacheWriteFile
|
||||
_ppdFreeLanguages
|
||||
_ppdGetEncoding
|
||||
_ppdGetLanguages
|
||||
@@ -48,25 +61,12 @@ _ppdHashName
|
||||
_ppdLocalizedAttr
|
||||
_ppdNormalizeMakeAndModel
|
||||
_ppdParseOptions
|
||||
_pwgCreateWithFile
|
||||
_pwgDestroy
|
||||
_pwgWriteFile
|
||||
_pwgGenerateSize
|
||||
_pwgInitSize
|
||||
_pwgMediaForLegacy
|
||||
_pwgMediaForPPD
|
||||
_pwgMediaForPWG
|
||||
_pwgMediaForSize
|
||||
_pwgCreateWithPPD
|
||||
_pwgGetBin
|
||||
_pwgGetInputSlot
|
||||
_pwgGetMediaType
|
||||
_pwgGetOutputBin
|
||||
_pwgGetPageSize
|
||||
_pwgGetSize
|
||||
_pwgGetSource
|
||||
_pwgGetType
|
||||
_pwgInputSlotForSource
|
||||
_pwgMediaTypeForType
|
||||
_pwgPageSizeForMedia
|
||||
cupsAddDest
|
||||
@@ -257,6 +257,7 @@ httpSetCredentials
|
||||
httpSetExpect
|
||||
httpSetField
|
||||
httpSetLength
|
||||
httpSetTimeout
|
||||
httpStatus
|
||||
httpTrace
|
||||
httpUpdate
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
#include "WinVersRes.h"
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION MASTER_PROD_VERS
|
||||
PRODUCTVERSION MASTER_PROD_VERS
|
||||
FILEFLAGSMASK 0x17L
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", MASTER_COMPANY_NAME
|
||||
VALUE "FileDescription", "CUPS Library"
|
||||
VALUE "FileVersion", MASTER_PROD_VERS_STR
|
||||
VALUE "InternalName", "libcups2.dll"
|
||||
VALUE "LegalCopyright", MASTER_LEGAL_COPYRIGHT
|
||||
VALUE "OriginalFilename", "libcups2.dll"
|
||||
VALUE "ProductName", MASTER_PROD_NAME
|
||||
VALUE "ProductVersion", MASTER_PROD_VERS_STR
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
+4
-4
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* PPD localization routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -310,9 +310,9 @@ ppdLocalizeIPPReason(
|
||||
!strncmp(reason, "shutdown", 8))
|
||||
message = _("The printer is not connected.");
|
||||
else if (!strncmp(reason, "toner-low", 9))
|
||||
message = _("The printer is low on toner.");
|
||||
message = _("The printer is running low on toner.");
|
||||
else if (!strncmp(reason, "toner-empty", 11))
|
||||
message = _("The printer is out of toner.");
|
||||
message = _("The printer may be out of toner.");
|
||||
else if (!strncmp(reason, "cover-open", 10))
|
||||
message = _("The printer's cover is open.");
|
||||
else if (!strncmp(reason, "interlock-open", 14))
|
||||
@@ -332,7 +332,7 @@ ppdLocalizeIPPReason(
|
||||
else if (!strncmp(reason, "output-area-full", 16))
|
||||
message = _("The output bin is full.");
|
||||
else if (!strncmp(reason, "marker-supply-low", 17))
|
||||
message = _("The printer is almost out of ink.");
|
||||
message = _("The printer is running low on ink.");
|
||||
else if (!strncmp(reason, "marker-supply-empty", 19))
|
||||
message = _("The printer is out of ink.");
|
||||
else if (!strncmp(reason, "marker-waste-almost-full", 24))
|
||||
|
||||
+5
-3
@@ -257,11 +257,13 @@ cupsMarkOptions(
|
||||
* Map sides to duplex option...
|
||||
*/
|
||||
|
||||
if (!strcmp(sides, "one-sided"))
|
||||
if (!strcmp(sides, "one-sided") && cache->sides_1sided)
|
||||
ppd_mark_option(ppd, cache->sides_option, cache->sides_1sided);
|
||||
else if (!strcmp(sides, "two-sided-long-edge"))
|
||||
else if (!strcmp(sides, "two-sided-long-edge") &&
|
||||
cache->sides_2sided_long)
|
||||
ppd_mark_option(ppd, cache->sides_option, cache->sides_2sided_long);
|
||||
else if (!strcmp(sides, "two-sided-short-edge"))
|
||||
else if (!strcmp(sides, "two-sided-short-edge") &&
|
||||
cache->sides_2sided_short)
|
||||
ppd_mark_option(ppd, cache->sides_option, cache->sides_2sided_short);
|
||||
}
|
||||
}
|
||||
|
||||
+252
-20
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* PPD cache implementation for CUPS.
|
||||
*
|
||||
* Copyright 2010-2011 by Apple Inc.
|
||||
* Copyright 2010-2012 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -65,6 +65,9 @@
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
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);
|
||||
|
||||
@@ -86,6 +89,7 @@ _ppdCacheCreateWithFile(
|
||||
_ppd_cache_t *pc; /* PWG mapping data */
|
||||
_pwg_size_t *size; /* Current size */
|
||||
_pwg_map_t *map; /* Current map */
|
||||
_pwg_finishings_t *finishings; /* Current finishings option */
|
||||
int linenum, /* Current line number */
|
||||
num_bins, /* Number of bins in file */
|
||||
num_sizes, /* Number of sizes in file */
|
||||
@@ -532,6 +536,23 @@ _ppdCacheCreateWithFile(
|
||||
pc->sides_2sided_long = _cupsStrAlloc(value);
|
||||
else if (!_cups_strcasecmp(line, "Sides2SidedShort"))
|
||||
pc->sides_2sided_short = _cupsStrAlloc(value);
|
||||
else if (!_cups_strcasecmp(line, "Finishings"))
|
||||
{
|
||||
if (!pc->finishings)
|
||||
pc->finishings =
|
||||
cupsArrayNew3((cups_array_func_t)pwg_compare_finishings,
|
||||
NULL, NULL, 0, NULL,
|
||||
(cups_afree_func_t)pwg_free_finishings);
|
||||
|
||||
if ((finishings = calloc(1, sizeof(_pwg_finishings_t))) == NULL)
|
||||
goto create_error;
|
||||
|
||||
finishings->value = strtol(value, &valueptr, 10);
|
||||
finishings->num_options = cupsParseOptions(valueptr, 0,
|
||||
&(finishings->options));
|
||||
|
||||
cupsArrayAdd(pc->finishings, finishings);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_printf(("_ppdCacheCreateWithFile: Unknown %s on line %d.", line,
|
||||
@@ -633,6 +654,7 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
new_known_pwg; /* New PWG name is well-known */
|
||||
_pwg_size_t *new_size; /* New size to add, if any */
|
||||
const char *filter; /* Current filter */
|
||||
_pwg_finishings_t *finishings; /* Current finishings value */
|
||||
|
||||
|
||||
DEBUG_printf(("_ppdCacheCreateWithPPD(ppd=%p)", ppd));
|
||||
@@ -727,12 +749,17 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
}
|
||||
|
||||
/*
|
||||
* 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.
|
||||
* 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_width = _PWG_FROMPTS(ppd_size->width);
|
||||
new_length = _PWG_FROMPTS(ppd_size->length);
|
||||
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);
|
||||
@@ -862,7 +889,7 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
else if (!_cups_strncasecmp(choice->choice, "Multipurpose", 12) ||
|
||||
!_cups_strcasecmp(choice->choice, "MP") ||
|
||||
!_cups_strcasecmp(choice->choice, "MPTray"))
|
||||
pwg_name = "alternate";
|
||||
pwg_name = "by-pass-tray";
|
||||
else if (!_cups_strcasecmp(choice->choice, "LargeCapacity"))
|
||||
pwg_name = "large-capacity";
|
||||
else if (!_cups_strncasecmp(choice->choice, "Lower", 5))
|
||||
@@ -873,11 +900,8 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
pwg_name = "top";
|
||||
else if (!_cups_strncasecmp(choice->choice, "Side", 4))
|
||||
pwg_name = "side";
|
||||
else if (!_cups_strcasecmp(choice->choice, "Roll") ||
|
||||
!_cups_strcasecmp(choice->choice, "Roll1"))
|
||||
else if (!_cups_strcasecmp(choice->choice, "Roll"))
|
||||
pwg_name = "main-roll";
|
||||
else if (!_cups_strcasecmp(choice->choice, "Roll2"))
|
||||
pwg_name = "alternate-roll";
|
||||
else
|
||||
{
|
||||
/*
|
||||
@@ -938,6 +962,8 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
pwg_name = "stationery-letterhead";
|
||||
else if (!_cups_strncasecmp(choice->choice, "Preprint", 8))
|
||||
pwg_name = "stationery-preprinted";
|
||||
else if (!_cups_strcasecmp(choice->choice, "Recycled"))
|
||||
pwg_name = "stationery-recycled";
|
||||
else if (!_cups_strncasecmp(choice->choice, "Transparen", 10))
|
||||
pwg_name = "transparency";
|
||||
else
|
||||
@@ -1272,7 +1298,8 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
|
||||
if (filter)
|
||||
cupsArrayAdd(pc->filters,
|
||||
"application/vnd.cups-command application/postscript 0 -");
|
||||
"application/vnd.cups-command application/postscript 100 "
|
||||
"commandtops");
|
||||
}
|
||||
|
||||
if ((ppd_attr = ppdFindAttr(ppd, "cupsPreFilter", NULL)) != NULL)
|
||||
@@ -1298,6 +1325,32 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
if (ppd->product)
|
||||
pc->product = _cupsStrAlloc(ppd->product);
|
||||
|
||||
/*
|
||||
* Copy finishings mapping data...
|
||||
*/
|
||||
|
||||
if ((ppd_attr = ppdFindAttr(ppd, "cupsIPPFinishings", NULL)) != NULL)
|
||||
{
|
||||
pc->finishings = cupsArrayNew3((cups_array_func_t)pwg_compare_finishings,
|
||||
NULL, NULL, 0, NULL,
|
||||
(cups_afree_func_t)pwg_free_finishings);
|
||||
|
||||
do
|
||||
{
|
||||
if ((finishings = calloc(1, sizeof(_pwg_finishings_t))) == NULL)
|
||||
goto create_error;
|
||||
|
||||
finishings->value = atoi(ppd_attr->spec);
|
||||
finishings->num_options = _ppdParseOptions(ppd_attr->value, 0,
|
||||
&(finishings->options),
|
||||
_PPD_PARSE_OPTIONS);
|
||||
|
||||
cupsArrayAdd(pc->finishings, finishings);
|
||||
}
|
||||
while ((ppd_attr = ppdFindNextAttr(ppd, "cupsIPPFinishings",
|
||||
NULL)) != NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the cache data...
|
||||
*/
|
||||
@@ -1396,6 +1449,7 @@ _ppdCacheDestroy(_ppd_cache_t *pc) /* I - PPD cache and mapping data */
|
||||
_cupsStrFree(pc->product);
|
||||
cupsArrayDelete(pc->filters);
|
||||
cupsArrayDelete(pc->prefilters);
|
||||
cupsArrayDelete(pc->finishings);
|
||||
|
||||
free(pc);
|
||||
}
|
||||
@@ -1434,6 +1488,125 @@ _ppdCacheGetBin(
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_ppdCacheGetFinishingOptions()' - Get PPD finishing options for the given
|
||||
* IPP finishings value(s).
|
||||
*/
|
||||
|
||||
int /* O - New number of options */
|
||||
_ppdCacheGetFinishingOptions(
|
||||
_ppd_cache_t *pc, /* I - PPD cache and mapping data */
|
||||
ipp_t *job, /* I - Job attributes or NULL */
|
||||
ipp_finish_t value, /* I - IPP finishings value of IPP_FINISHINGS_NONE */
|
||||
int num_options, /* I - Number of options */
|
||||
cups_option_t **options) /* IO - Options */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
_pwg_finishings_t *f, /* PWG finishings options */
|
||||
key; /* Search key */
|
||||
ipp_attribute_t *attr; /* Finishings attribute */
|
||||
cups_option_t *option; /* Current finishings option */
|
||||
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
if (!pc || cupsArrayCount(pc->finishings) == 0 || !options ||
|
||||
(!job && value == IPP_FINISHINGS_NONE))
|
||||
return (num_options);
|
||||
|
||||
/*
|
||||
* Apply finishing options...
|
||||
*/
|
||||
|
||||
if (job && (attr = ippFindAttribute(job, "finishings", IPP_TAG_ENUM)) != NULL)
|
||||
{
|
||||
for (i = 0; i < attr->num_values; i ++)
|
||||
{
|
||||
key.value = attr->values[i].integer;
|
||||
|
||||
if ((f = cupsArrayFind(pc->finishings, &key)) != NULL)
|
||||
{
|
||||
int j; /* Another looping var */
|
||||
|
||||
for (j = f->num_options, option = f->options; j > 0; j --, option ++)
|
||||
num_options = cupsAddOption(option->name, option->value,
|
||||
num_options, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (value != IPP_FINISHINGS_NONE)
|
||||
{
|
||||
key.value = value;
|
||||
|
||||
if ((f = cupsArrayFind(pc->finishings, &key)) != NULL)
|
||||
{
|
||||
int j; /* Another looping var */
|
||||
|
||||
for (j = f->num_options, option = f->options; j > 0; j --, option ++)
|
||||
num_options = cupsAddOption(option->name, option->value,
|
||||
num_options, options);
|
||||
}
|
||||
}
|
||||
|
||||
return (num_options);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_ppdCacheGetFinishingValues()' - Get IPP finishings value(s) from the given
|
||||
* PPD options.
|
||||
*/
|
||||
|
||||
int /* O - Number of finishings values */
|
||||
_ppdCacheGetFinishingValues(
|
||||
_ppd_cache_t *pc, /* I - PPD cache and mapping data */
|
||||
int num_options, /* I - Number of options */
|
||||
cups_option_t *options, /* I - Options */
|
||||
int max_values, /* I - Maximum number of finishings values */
|
||||
int *values) /* O - Finishings values */
|
||||
{
|
||||
int i, /* Looping var */
|
||||
num_values = 0; /* Number of values */
|
||||
_pwg_finishings_t *f; /* Current finishings option */
|
||||
cups_option_t *option; /* Current option */
|
||||
const char *val; /* Value for option */
|
||||
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
if (!pc || !pc->finishings || num_options < 1 || max_values < 1 || !values)
|
||||
return (0);
|
||||
|
||||
/*
|
||||
* Go through the finishings options and see what is set...
|
||||
*/
|
||||
|
||||
for (f = (_pwg_finishings_t *)cupsArrayFirst(pc->finishings);
|
||||
f;
|
||||
f = (_pwg_finishings_t *)cupsArrayNext(pc->finishings))
|
||||
{
|
||||
for (i = f->num_options, option = f->options; i > 0; i --, option ++)
|
||||
if ((val = cupsGetOption(option->name, num_options, options)) == NULL ||
|
||||
_cups_strcasecmp(option->value, val))
|
||||
break;
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
values[num_values ++] = f->value;
|
||||
|
||||
if (num_values >= max_values)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (num_values);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_ppdCacheGetInputSlot()' - Get the PPD InputSlot associated with the job
|
||||
* attributes or a keyword string.
|
||||
@@ -1835,7 +2008,8 @@ _ppdCacheGetSize(
|
||||
_ppd_cache_t *pc, /* I - PPD cache and mapping data */
|
||||
const char *page_size) /* I - PPD PageSize */
|
||||
{
|
||||
int i;
|
||||
int i; /* Looping var */
|
||||
_pwg_media_t *media; /* Media */
|
||||
_pwg_size_t *size; /* Current size */
|
||||
|
||||
|
||||
@@ -1914,9 +2088,26 @@ _ppdCacheGetSize(
|
||||
*/
|
||||
|
||||
for (i = pc->num_sizes, size = pc->sizes; i > 0; i --, size ++)
|
||||
if (!_cups_strcasecmp(page_size, size->map.ppd))
|
||||
if (!_cups_strcasecmp(page_size, size->map.ppd) ||
|
||||
!_cups_strcasecmp(page_size, size->map.pwg))
|
||||
return (size);
|
||||
|
||||
/*
|
||||
* Look up standard sizes...
|
||||
*/
|
||||
|
||||
if ((media = _pwgMediaForPPD(page_size)) == NULL)
|
||||
if ((media = _pwgMediaForLegacy(page_size)) == NULL)
|
||||
media = _pwgMediaForPWG(page_size);
|
||||
|
||||
if (media)
|
||||
{
|
||||
pc->custom_size.width = media->width;
|
||||
pc->custom_size.length = media->length;
|
||||
|
||||
return (&(pc->custom_size));
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@@ -1989,13 +2180,14 @@ _ppdCacheWriteFile(
|
||||
const char *filename, /* I - File to write */
|
||||
ipp_t *attrs) /* I - Attributes to write, if any */
|
||||
{
|
||||
int i, j, k; /* Looping vars */
|
||||
cups_file_t *fp; /* Output file */
|
||||
_pwg_size_t *size; /* Current size */
|
||||
_pwg_map_t *map; /* Current map */
|
||||
cups_option_t *option; /* Current option */
|
||||
const char *value; /* Filter/pre-filter value */
|
||||
char newfile[1024]; /* New filename */
|
||||
int i, j, k; /* Looping vars */
|
||||
cups_file_t *fp; /* Output file */
|
||||
_pwg_size_t *size; /* Current size */
|
||||
_pwg_map_t *map; /* Current map */
|
||||
_pwg_finishings_t *f; /* Current finishing option */
|
||||
cups_option_t *option; /* Current option */
|
||||
const char *value; /* Filter/pre-filter value */
|
||||
char newfile[1024]; /* New filename */
|
||||
|
||||
|
||||
/*
|
||||
@@ -2128,6 +2320,20 @@ _ppdCacheWriteFile(
|
||||
|
||||
cupsFilePrintf(fp, "SingleFile %s\n", pc->single_file ? "true" : "false");
|
||||
|
||||
/*
|
||||
* Finishing options...
|
||||
*/
|
||||
|
||||
for (f = (_pwg_finishings_t *)cupsArrayFirst(pc->finishings);
|
||||
f;
|
||||
f = (_pwg_finishings_t *)cupsArrayNext(pc->finishings))
|
||||
{
|
||||
cupsFilePrintf(fp, "Finishings %d", f->value);
|
||||
for (i = f->num_options, option = f->options; i > 0; i --, option ++)
|
||||
cupsFilePrintf(fp, " %s=%s", option->name, option->value);
|
||||
cupsFilePutChar(fp, '\n');
|
||||
}
|
||||
|
||||
/*
|
||||
* IPP attributes, if any...
|
||||
*/
|
||||
@@ -2310,6 +2516,32 @@ _pwgPageSizeForMedia(
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'pwg_compare_finishings()' - Compare two finishings values.
|
||||
*/
|
||||
|
||||
static int /* O- Result of comparison */
|
||||
pwg_compare_finishings(
|
||||
_pwg_finishings_t *a, /* I - First finishings value */
|
||||
_pwg_finishings_t *b) /* I - Second finishings value */
|
||||
{
|
||||
return (b->value - a->value);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'pwg_free_finishings()' - Free a finishings value.
|
||||
*/
|
||||
|
||||
static void
|
||||
pwg_free_finishings(
|
||||
_pwg_finishings_t *f) /* I - Finishings value */
|
||||
{
|
||||
cupsFreeOptions(f->num_options, f->options);
|
||||
free(f);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'pwg_ppdize_name()' - Convert an IPP keyword to a PPD keyword.
|
||||
*/
|
||||
|
||||
+16
-2
@@ -49,7 +49,7 @@ extern "C" {
|
||||
* Constants...
|
||||
*/
|
||||
|
||||
# define _PPD_CACHE_VERSION 1 /* Version number in cache file */
|
||||
# define _PPD_CACHE_VERSION 2 /* Version number in cache file */
|
||||
|
||||
|
||||
/*
|
||||
@@ -86,7 +86,7 @@ typedef enum _pwg_print_color_mode_e /**** PWG print-color-mode indices ****/
|
||||
_PWG_PRINT_COLOR_MODE_MAX
|
||||
} _pwg_print_color_mode_t;
|
||||
|
||||
typedef enum _pwg_print_quality_e /**** PWG print-quality indices ****/
|
||||
typedef enum _pwg_print_quality_e /**** PWG print-quality values ****/
|
||||
{
|
||||
_PWG_PRINT_QUALITY_DRAFT = 0, /* print-quality=3 */
|
||||
_PWG_PRINT_QUALITY_NORMAL, /* print-quality=4 */
|
||||
@@ -94,6 +94,13 @@ typedef enum _pwg_print_quality_e /**** PWG print-quality indices ****/
|
||||
_PWG_PRINT_QUALITY_MAX
|
||||
} _pwg_print_quality_t;
|
||||
|
||||
typedef struct _pwg_finishings_s /**** PWG finishings mapping data ****/
|
||||
{
|
||||
ipp_finish_t value; /* finishings value */
|
||||
int num_options; /* Number of options to apply */
|
||||
cups_option_t *options; /* Options to apply */
|
||||
} _pwg_finishings_t;
|
||||
|
||||
struct _ppd_cache_s /**** PPD cache and PWG conversion data ****/
|
||||
{
|
||||
int num_bins; /* Number of output bins */
|
||||
@@ -125,6 +132,7 @@ struct _ppd_cache_s /**** PPD cache and PWG conversion data ****/
|
||||
cups_array_t *filters, /* cupsFilter/cupsFilter2 values */
|
||||
*prefilters; /* cupsPreFilter values */
|
||||
int single_file; /* cupsSingleFile value */
|
||||
cups_array_t *finishings; /* cupsIPPFinishings values */
|
||||
};
|
||||
|
||||
|
||||
@@ -138,6 +146,12 @@ extern _ppd_cache_t *_ppdCacheCreateWithPPD(ppd_file_t *ppd);
|
||||
extern void _ppdCacheDestroy(_ppd_cache_t *pc);
|
||||
extern const char *_ppdCacheGetBin(_ppd_cache_t *pc,
|
||||
const char *output_bin);
|
||||
extern int _ppdCacheGetFinishingOptions(_ppd_cache_t *pc, ipp_t *job,
|
||||
ipp_finish_t value, int num_options,
|
||||
cups_option_t **options);
|
||||
extern int _ppdCacheGetFinishingValues(_ppd_cache_t *pc, int num_options,
|
||||
cups_option_t *options,
|
||||
int max_values, int *values);
|
||||
extern const char *_ppdCacheGetInputSlot(_ppd_cache_t *pc, ipp_t *job,
|
||||
const char *keyword);
|
||||
extern const char *_ppdCacheGetMediaType(_ppd_cache_t *pc, ipp_t *job,
|
||||
|
||||
+163
-11
@@ -43,6 +43,7 @@
|
||||
* ppd_compare_coptions() - Compare two custom options.
|
||||
* ppd_compare_options() - Compare two options.
|
||||
* ppd_decode() - Decode a string value...
|
||||
* ppd_free_filters() - Free the filters array.
|
||||
* ppd_free_group() - Free a single UI group.
|
||||
* ppd_free_option() - Free a single option.
|
||||
* ppd_get_coption() - Get a custom option record.
|
||||
@@ -52,6 +53,7 @@
|
||||
* ppd_hash_option() - Generate a hash of the option name...
|
||||
* ppd_read() - Read a line from a PPD file, skipping comment
|
||||
* lines as necessary.
|
||||
* ppd_update_filters() - Update the filters array as needed.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -110,6 +112,7 @@ static int ppd_compare_coptions(ppd_coption_t *a,
|
||||
ppd_coption_t *b);
|
||||
static int ppd_compare_options(ppd_option_t *a, ppd_option_t *b);
|
||||
static int ppd_decode(char *string);
|
||||
static void ppd_free_filters(ppd_file_t *ppd);
|
||||
static void ppd_free_group(ppd_group_t *group);
|
||||
static void ppd_free_option(ppd_option_t *option);
|
||||
static ppd_coption_t *ppd_get_coption(ppd_file_t *ppd, const char *name);
|
||||
@@ -125,6 +128,8 @@ static int ppd_read(cups_file_t *fp, _ppd_line_t *line,
|
||||
char *keyword, char *option, char *text,
|
||||
char **string, int ignoreblank,
|
||||
_cups_globals_t *cg);
|
||||
static int ppd_update_filters(ppd_file_t *ppd,
|
||||
_cups_globals_t *cg);
|
||||
|
||||
|
||||
/*
|
||||
@@ -138,7 +143,6 @@ ppdClose(ppd_file_t *ppd) /* I - PPD file record */
|
||||
ppd_emul_t *emul; /* Current emulation */
|
||||
ppd_group_t *group; /* Current group */
|
||||
char **font; /* Current font */
|
||||
char **filter; /* Current filter */
|
||||
ppd_attr_t **attr; /* Current attribute */
|
||||
ppd_coption_t *coption; /* Current custom option */
|
||||
ppd_cparam_t *cparam; /* Current custom parameter */
|
||||
@@ -211,13 +215,7 @@ ppdClose(ppd_file_t *ppd) /* I - PPD file record */
|
||||
* Free any filters...
|
||||
*/
|
||||
|
||||
if (ppd->num_filters > 0)
|
||||
{
|
||||
for (i = ppd->num_filters, filter = ppd->filters; i > 0; i --, filter ++)
|
||||
_cupsStrFree(*filter);
|
||||
|
||||
ppd_free(ppd->filters);
|
||||
}
|
||||
ppd_free_filters(ppd);
|
||||
|
||||
/*
|
||||
* Free any fonts...
|
||||
@@ -880,11 +878,10 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
|
||||
ppd->num_filters ++;
|
||||
|
||||
/*
|
||||
* Copy filter string and prevent it from being freed below...
|
||||
* Retain a copy of the filter string...
|
||||
*/
|
||||
|
||||
*filter = string;
|
||||
string = NULL;
|
||||
*filter = _cupsStrRetain(string);
|
||||
}
|
||||
else if (!strcmp(keyword, "Throughput"))
|
||||
ppd->throughput = atoi(string);
|
||||
@@ -1961,6 +1958,17 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Update the filters array as needed...
|
||||
*/
|
||||
|
||||
if (!ppd_update_filters(ppd, cg))
|
||||
{
|
||||
ppdClose(ppd);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Create the sorted options array and set the option back-pointer for
|
||||
* each choice and custom option...
|
||||
@@ -2376,6 +2384,30 @@ ppd_decode(char *string) /* I - String to decode */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ppd_free_filters()' - Free the filters array.
|
||||
*/
|
||||
|
||||
static void
|
||||
ppd_free_filters(ppd_file_t *ppd) /* I - PPD file */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
char **filter; /* Current filter */
|
||||
|
||||
|
||||
if (ppd->num_filters > 0)
|
||||
{
|
||||
for (i = ppd->num_filters, filter = ppd->filters; i > 0; i --, filter ++)
|
||||
_cupsStrFree(*filter);
|
||||
|
||||
ppd_free(ppd->filters);
|
||||
|
||||
ppd->num_filters = 0;
|
||||
ppd->filters = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ppd_free_group()' - Free a single UI group.
|
||||
*/
|
||||
@@ -3139,6 +3171,126 @@ ppd_read(cups_file_t *fp, /* I - File to read from */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ppd_update_filters()' - Update the filters array as needed.
|
||||
*
|
||||
* This function re-populates the filters array with cupsFilter2 entries that
|
||||
* have been stripped of the destination MIME media types and any maxsize hints.
|
||||
*
|
||||
* (All for backwards-compatibility)
|
||||
*/
|
||||
|
||||
static int /* O - 1 on success, 0 on failure */
|
||||
ppd_update_filters(ppd_file_t *ppd,/* I - PPD file */
|
||||
_cups_globals_t *cg) /* I - Global data */
|
||||
{
|
||||
ppd_attr_t *attr; /* Current cupsFilter2 value */
|
||||
char srcsuper[16], /* Source MIME media type */
|
||||
srctype[256],
|
||||
dstsuper[16], /* Destination MIME media type */
|
||||
dsttype[256],
|
||||
program[1024], /* Command to run */
|
||||
*ptr, /* Pointer into command to run */
|
||||
buffer[1024], /* Re-written cupsFilter value */
|
||||
**filter; /* Current filter */
|
||||
int cost; /* Cost of filter */
|
||||
|
||||
|
||||
DEBUG_printf(("4ppd_update_filters(ppd=%p, cg=%p)", ppd, cg));
|
||||
|
||||
/*
|
||||
* See if we have any cupsFilter2 lines...
|
||||
*/
|
||||
|
||||
if ((attr = ppdFindAttr(ppd, "cupsFilter2", NULL)) == NULL)
|
||||
{
|
||||
DEBUG_puts("5ppd_update_filters: No cupsFilter2 keywords present.");
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Yes, free the cupsFilter-defined filters and re-build...
|
||||
*/
|
||||
|
||||
ppd_free_filters(ppd);
|
||||
|
||||
do
|
||||
{
|
||||
/*
|
||||
* Parse the cupsFilter2 string:
|
||||
*
|
||||
* src/type dst/type cost program
|
||||
* src/type dst/type cost maxsize(n) program
|
||||
*/
|
||||
|
||||
DEBUG_printf(("5ppd_update_filters: cupsFilter2=\"%s\"", attr->value));
|
||||
|
||||
if (sscanf(attr->value, "%15[^/]/%255s%*[ \t]%15[^/]/%255s%d%*[ \t]%1023[^\n]",
|
||||
srcsuper, srctype, dstsuper, dsttype, &cost, program) != 6)
|
||||
{
|
||||
DEBUG_puts("5ppd_update_filters: Bad cupsFilter2 line.");
|
||||
cg->ppd_status = PPD_BAD_VALUE;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
DEBUG_printf(("5ppd_update_filters: srcsuper=\"%s\", srctype=\"%s\", "
|
||||
"dstsuper=\"%s\", dsttype=\"%s\", cost=%d, program=\"%s\"",
|
||||
srcsuper, srctype, dstsuper, dsttype, cost, program));
|
||||
|
||||
if (!strncmp(program, "maxsize(", 8) &&
|
||||
(ptr = strchr(program + 8, ')')) != NULL)
|
||||
{
|
||||
DEBUG_puts("5ppd_update_filters: Found maxsize(nnn).");
|
||||
|
||||
ptr ++;
|
||||
while (_cups_isspace(*ptr))
|
||||
ptr ++;
|
||||
|
||||
_cups_strcpy(program, ptr);
|
||||
DEBUG_printf(("5ppd_update_filters: New program=\"%s\"", program));
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert to cupsFilter format:
|
||||
*
|
||||
* src/type cost program
|
||||
*/
|
||||
|
||||
snprintf(buffer, sizeof(buffer), "%s/%s %d %s", srcsuper, srctype, cost,
|
||||
program);
|
||||
DEBUG_printf(("5ppd_update_filters: Adding \"%s\".", buffer));
|
||||
|
||||
/*
|
||||
* Add a cupsFilter-compatible string to the filters array.
|
||||
*/
|
||||
|
||||
if (ppd->num_filters == 0)
|
||||
filter = malloc(sizeof(char *));
|
||||
else
|
||||
filter = realloc(ppd->filters, sizeof(char *) * (ppd->num_filters + 1));
|
||||
|
||||
if (filter == NULL)
|
||||
{
|
||||
DEBUG_puts("5ppd_update_filters: Out of memory.");
|
||||
cg->ppd_status = PPD_ALLOC_ERROR;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
ppd->filters = filter;
|
||||
filter += ppd->num_filters;
|
||||
ppd->num_filters ++;
|
||||
|
||||
*filter = _cupsStrAlloc(buffer);
|
||||
}
|
||||
while ((attr = ppdFindNextAttr(ppd, "cupsFilter2", NULL)) != NULL);
|
||||
|
||||
DEBUG_puts("5ppd_update_filters: Completed OK.");
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
|
||||
+9
-6
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* PWG media name API implementation for CUPS.
|
||||
*
|
||||
* Copyright 2009-2011 by Apple Inc.
|
||||
* Copyright 2009-2012 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -104,7 +104,7 @@ static _pwg_media_t const cups_pwg_media[] =
|
||||
_PWG_MEDIA_IN("na_arch-b_12x18in", "arch-b", "ARCHB", 12, 18),
|
||||
_PWG_MEDIA_IN("na_12x19_12x19in", NULL, "12x19", 12, 19),
|
||||
_PWG_MEDIA_IN("na_b-plus_12x19.17in", NULL, "SuperB", 12, 19.17),
|
||||
_PWG_MEDIA_IN("na_super-b_13x19in", "super-b", NULL, 13, 19),
|
||||
_PWG_MEDIA_IN("na_super-b_13x19in", "super-b", "13x19", 13, 19),
|
||||
_PWG_MEDIA_IN("na_c_17x22in", "c", "AnsiC", 17, 22),
|
||||
_PWG_MEDIA_IN("na_arch-c_18x24in", "arch-c", "ARCHC", 18, 24),
|
||||
_PWG_MEDIA_IN("na_d_22x34in", "d", "AnsiD", 22, 34),
|
||||
@@ -117,7 +117,7 @@ static _pwg_media_t const cups_pwg_media[] =
|
||||
|
||||
/* Chinese Standard Sheet Media Inch Sizes */
|
||||
_PWG_MEDIA_IN("roc_16k_7.75x10.75in", NULL, "roc16k", 7.75, 10.75),
|
||||
_PWG_MEDIA_IN("roc_8k_10.75x15.5in", NULL, NULL, 10.75, 15.5),
|
||||
_PWG_MEDIA_IN("roc_8k_10.75x15.5in", NULL, "roc8k", 10.75, 15.5),
|
||||
|
||||
/* ISO Standard Sheet Media Sizes */
|
||||
_PWG_MEDIA_MM("iso_a10_26x37mm", "iso-a10", "A10", 26, 37),
|
||||
@@ -128,7 +128,7 @@ static _pwg_media_t const cups_pwg_media[] =
|
||||
_PWG_MEDIA_MM("iso_a5_148x210mm", "iso-a5", "A5", 148, 210),
|
||||
_PWG_MEDIA_MM("iso_a5-extra_174x235mm", NULL, "A5Extra", 174, 235),
|
||||
_PWG_MEDIA_MM("iso_a4_210x297mm", "iso-a4", "A4", 210, 297),
|
||||
_PWG_MEDIA_MM("iso_a4-tab_225x297mm", NULL, NULL, 225, 297),
|
||||
_PWG_MEDIA_MM("iso_a4-tab_225x297mm", NULL, "A4Tab", 225, 297),
|
||||
_PWG_MEDIA_MM("iso_a4-extra_235.5x322.3mm", NULL, "A4Extra", 235.5, 322.3),
|
||||
_PWG_MEDIA_MM("iso_a3_297x420mm", "iso-a3", "A3", 297, 420),
|
||||
_PWG_MEDIA_MM("iso_a4x3_297x630mm", "iso-a4x3", NULL, 297, 630),
|
||||
@@ -226,13 +226,16 @@ static _pwg_media_t const cups_pwg_media[] =
|
||||
_PWG_MEDIA_MM("om_dai-pa-kai_275x395mm", NULL, NULL, 275, 395),
|
||||
_PWG_MEDIA_MM("prc_10_324x458mm", NULL, "EnvPRC10", 324, 458),
|
||||
|
||||
/* Other English Standard Sheet Media Sizes */
|
||||
_PWG_MEDIA_IN("oe_photo-l_3.5x5in", NULL, "3.5x5", 3.5, 5),
|
||||
|
||||
/* Other Metric Standard Sheet Media Sizes */
|
||||
_PWG_MEDIA_MM("om_small-photo_100x150mm", NULL, NULL, 100, 150),
|
||||
_PWG_MEDIA_MM("om_italian_110x230mm", NULL, "EnvItalian", 110, 230),
|
||||
_PWG_MEDIA_MM("om_postfix_114x229mm", NULL, NULL, 114, 229),
|
||||
_PWG_MEDIA_MM("om_large-photo_200x300", NULL, NULL, 200, 300),
|
||||
_PWG_MEDIA_MM("om_large-photo_200x300", NULL, "om_large-photo", 200, 300),
|
||||
_PWG_MEDIA_MM("om_folio_210x330mm", "folio", "Folio", 210, 330),
|
||||
_PWG_MEDIA_MM("om_folio-sp_215x315mm", NULL, NULL, 215, 315),
|
||||
_PWG_MEDIA_MM("om_folio-sp_215x315mm", NULL, "FolioSP", 215, 315),
|
||||
_PWG_MEDIA_MM("om_invite_220x220mm", NULL, "EnvInvite", 220, 220)
|
||||
};
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ extern "C" {
|
||||
*/
|
||||
|
||||
/* Convert from points to 2540ths */
|
||||
# define _PWG_FROMPTS(n) (int)((n) * 2540 / 72)
|
||||
# define _PWG_FROMPTS(n) (int)(((n) * 2540 + 36) / 72)
|
||||
/* Convert from 2540ths to points */
|
||||
# define _PWG_TOPTS(n) ((n) * 72.0 / 2540.0)
|
||||
|
||||
|
||||
+91
-41
@@ -248,16 +248,9 @@ cupsDoIORequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
|
||||
while ((bytes = (int)read(infile, buffer, sizeof(buffer))) > 0)
|
||||
{
|
||||
if (httpCheck(http))
|
||||
{
|
||||
_httpUpdate(http, &status);
|
||||
|
||||
if (status >= HTTP_MULTIPLE_CHOICES)
|
||||
break;
|
||||
}
|
||||
|
||||
if (httpWrite2(http, buffer, bytes) < bytes)
|
||||
break;
|
||||
if ((status = cupsWriteRequestData(http, buffer, bytes))
|
||||
!= HTTP_CONTINUE)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,13 +258,11 @@ cupsDoIORequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
* Get the server's response...
|
||||
*/
|
||||
|
||||
if (status == HTTP_CONTINUE || status == HTTP_OK)
|
||||
if (status != HTTP_ERROR)
|
||||
{
|
||||
response = cupsGetResponse(http, resource);
|
||||
status = http->status;
|
||||
status = httpGetStatus(http);
|
||||
}
|
||||
else
|
||||
httpFlush(http);
|
||||
|
||||
DEBUG_printf(("2cupsDoIORequest: status=%d", status));
|
||||
|
||||
@@ -283,26 +274,24 @@ cupsDoIORequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
break;
|
||||
}
|
||||
|
||||
if (response)
|
||||
if (response && outfile >= 0)
|
||||
{
|
||||
if (outfile >= 0)
|
||||
{
|
||||
/*
|
||||
* Write trailing data to file...
|
||||
*/
|
||||
/*
|
||||
* Write trailing data to file...
|
||||
*/
|
||||
|
||||
while ((bytes = (int)httpRead2(http, buffer, sizeof(buffer))) > 0)
|
||||
if (write(outfile, buffer, bytes) < bytes)
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Flush any remaining data...
|
||||
*/
|
||||
while ((bytes = (int)httpRead2(http, buffer, sizeof(buffer))) > 0)
|
||||
if (write(outfile, buffer, bytes) < bytes)
|
||||
break;
|
||||
}
|
||||
|
||||
httpFlush(http);
|
||||
}
|
||||
if (http->state != HTTP_WAITING)
|
||||
{
|
||||
/*
|
||||
* Flush any remaining data...
|
||||
*/
|
||||
|
||||
httpFlush(http);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,7 +332,8 @@ cupsDoRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
|
||||
*
|
||||
* 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.
|
||||
* additional data, use httpRead() after getting a successful response,
|
||||
* otherwise call httpFlush() to complete the response processing.
|
||||
*
|
||||
* @since CUPS 1.4/Mac OS X 10.6@
|
||||
*/
|
||||
@@ -426,6 +416,8 @@ cupsGetResponse(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
response = NULL;
|
||||
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
|
||||
http->status = status = HTTP_ERROR;
|
||||
http->error = EIO;
|
||||
}
|
||||
}
|
||||
else if (status != HTTP_ERROR)
|
||||
@@ -451,7 +443,7 @@ cupsGetResponse(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
if (!cupsDoAuthentication(http, "POST", resource))
|
||||
httpReconnect(http);
|
||||
else
|
||||
status = HTTP_AUTHORIZATION_CANCELED;
|
||||
http->status = status = HTTP_AUTHORIZATION_CANCELED;
|
||||
}
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
@@ -484,6 +476,8 @@ cupsGetResponse(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
attr ? attr->values[0].string.text :
|
||||
ippErrorString(response->request.status.status_code), 0);
|
||||
}
|
||||
else if (status == HTTP_ERROR)
|
||||
_cupsSetError(IPP_INTERNAL_ERROR, strerror(http->error), 0);
|
||||
else if (status != HTTP_OK)
|
||||
_cupsSetHTTPError(status);
|
||||
|
||||
@@ -637,6 +631,25 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
if ((http = _cupsConnect()) == NULL)
|
||||
return (HTTP_SERVICE_UNAVAILABLE);
|
||||
|
||||
/*
|
||||
* If the prior request was not flushed out, do so now...
|
||||
*/
|
||||
|
||||
if (http->state == HTTP_GET_SEND ||
|
||||
http->state == HTTP_POST_SEND)
|
||||
{
|
||||
DEBUG_puts("2cupsSendRequest: Flush prior response.");
|
||||
httpFlush(http);
|
||||
}
|
||||
else if (http->state != HTTP_WAITING)
|
||||
{
|
||||
DEBUG_printf(("1cupsSendRequest: Unknown HTTP state (%d), bailing.",
|
||||
http->state));
|
||||
_cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
|
||||
|
||||
return (HTTP_ERROR);
|
||||
}
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
/*
|
||||
* See if we have an auth-info attribute and are communicating over
|
||||
@@ -648,7 +661,7 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
!httpAddrLocalhost(http->hostaddr) && !http->tls &&
|
||||
httpEncryption(http, HTTP_ENCRYPT_REQUIRED))
|
||||
{
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
|
||||
DEBUG_puts("1cupsSendRequest: Unable to encrypt connection.");
|
||||
return (HTTP_SERVICE_UNAVAILABLE);
|
||||
}
|
||||
#endif /* HAVE_SSL */
|
||||
@@ -658,11 +671,15 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
*/
|
||||
|
||||
if (!_cups_strcasecmp(http->fields[HTTP_FIELD_CONNECTION], "close"))
|
||||
{
|
||||
DEBUG_puts("2cupsSendRequest: Connection: close");
|
||||
httpClearFields(http);
|
||||
if (httpReconnect(http))
|
||||
{
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
|
||||
DEBUG_puts("1cupsSendRequest: Unable to reconnect.");
|
||||
return (HTTP_SERVICE_UNAVAILABLE);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Loop until we can send the request without authorization problems.
|
||||
@@ -707,9 +724,10 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
|
||||
if (httpPost(http, resource))
|
||||
{
|
||||
DEBUG_puts("2cupsSendRequest: POST failed, reconnecting.");
|
||||
if (httpReconnect(http))
|
||||
{
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
|
||||
DEBUG_puts("1cupsSendRequest: Unable to reconnect.");
|
||||
return (HTTP_SERVICE_UNAVAILABLE);
|
||||
}
|
||||
else
|
||||
@@ -740,6 +758,8 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
|
||||
if (state == IPP_ERROR)
|
||||
{
|
||||
DEBUG_puts("1cupsSendRequest: Unable to send IPP request.");
|
||||
|
||||
http->status = HTTP_ERROR;
|
||||
http->state = HTTP_WAITING;
|
||||
|
||||
@@ -770,22 +790,38 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
*/
|
||||
|
||||
if (status >= HTTP_MULTIPLE_CHOICES)
|
||||
{
|
||||
_cupsSetHTTPError(status);
|
||||
|
||||
do
|
||||
{
|
||||
status = httpUpdate(http);
|
||||
}
|
||||
while (status != HTTP_ERROR && http->state == HTTP_POST_RECV);
|
||||
|
||||
httpFlush(http);
|
||||
}
|
||||
|
||||
switch (status)
|
||||
{
|
||||
case HTTP_ERROR :
|
||||
case HTTP_CONTINUE :
|
||||
case HTTP_OK :
|
||||
DEBUG_printf(("1cupsSendRequest: Returning %d.", status));
|
||||
return (status);
|
||||
|
||||
case HTTP_UNAUTHORIZED :
|
||||
if (cupsDoAuthentication(http, "POST", resource))
|
||||
{
|
||||
DEBUG_puts("1cupsSendRequest: Returning HTTP_AUTHORIZATION_CANCELED.");
|
||||
return (HTTP_AUTHORIZATION_CANCELED);
|
||||
}
|
||||
|
||||
DEBUG_puts("2cupsSendRequest: Reconnecting after HTTP_UNAUTHORIZED.");
|
||||
|
||||
if (httpReconnect(http))
|
||||
{
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
|
||||
DEBUG_puts("1cupsSendRequest: Unable to reconnect.");
|
||||
return (HTTP_SERVICE_UNAVAILABLE);
|
||||
}
|
||||
break;
|
||||
@@ -797,15 +833,19 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
* encryption...
|
||||
*/
|
||||
|
||||
DEBUG_puts("2cupsSendRequest: Reconnecting after "
|
||||
"HTTP_UPGRADE_REQUIRED.");
|
||||
|
||||
if (httpReconnect(http))
|
||||
{
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
|
||||
DEBUG_puts("1cupsSendRequest: Unable to reconnect.");
|
||||
return (HTTP_SERVICE_UNAVAILABLE);
|
||||
}
|
||||
|
||||
DEBUG_puts("2cupsSendRequest: Upgrading to TLS.");
|
||||
if (httpEncryption(http, HTTP_ENCRYPT_REQUIRED))
|
||||
{
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
|
||||
DEBUG_puts("1cupsSendRequest: Unable to encrypt connection.");
|
||||
return (HTTP_SERVICE_UNAVAILABLE);
|
||||
}
|
||||
break;
|
||||
@@ -818,9 +858,12 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
|
||||
expect = (http_status_t)0;
|
||||
|
||||
DEBUG_puts("2cupsSendRequest: Reconnecting after "
|
||||
"HTTP_EXPECTATION_FAILED.");
|
||||
|
||||
if (httpReconnect(http))
|
||||
{
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
|
||||
DEBUG_puts("1cupsSendRequest: Unable to reconnect.");
|
||||
return (HTTP_SERVICE_UNAVAILABLE);
|
||||
}
|
||||
break;
|
||||
@@ -907,6 +950,13 @@ cupsWriteRequestData(
|
||||
if (status >= HTTP_MULTIPLE_CHOICES)
|
||||
{
|
||||
_cupsSetHTTPError(status);
|
||||
|
||||
do
|
||||
{
|
||||
status = httpUpdate(http);
|
||||
}
|
||||
while (status != HTTP_ERROR && http->state == HTTP_POST_RECV);
|
||||
|
||||
httpFlush(http);
|
||||
}
|
||||
|
||||
@@ -1082,7 +1132,7 @@ _cupsSetHTTPError(http_status_t status) /* I - HTTP status code */
|
||||
break;
|
||||
|
||||
case HTTP_ERROR :
|
||||
_cupsSetError(IPP_INTERNAL_ERROR, httpStatus(status), 0);
|
||||
_cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
|
||||
break;
|
||||
|
||||
default :
|
||||
|
||||
+12
-1
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* PPD constraint test program for CUPS.
|
||||
*
|
||||
* Copyright 2008-2011 by Apple Inc.
|
||||
* Copyright 2008-2012 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -91,7 +91,13 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if (option)
|
||||
{
|
||||
free(option);
|
||||
option = NULL;
|
||||
}
|
||||
|
||||
if (choice)
|
||||
{
|
||||
free(choice);
|
||||
choice = NULL;
|
||||
}
|
||||
|
||||
printf("\nNew Option(s): ");
|
||||
@@ -118,6 +124,11 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
cupsFreeOptions(num_options, options);
|
||||
}
|
||||
|
||||
if (option)
|
||||
free(option);
|
||||
if (choice)
|
||||
free(choice);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -117,7 +117,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
cupsFileClose(fp);
|
||||
|
||||
if (cupsFinishDocument(CUPS_HTTP_DEFAULT, argv[1]) != HTTP_OK)
|
||||
if (cupsFinishDocument(CUPS_HTTP_DEFAULT, argv[1]) > IPP_OK_SUBST)
|
||||
{
|
||||
puts("Unable to finish document!");
|
||||
return (1);
|
||||
|
||||
+8
-2
@@ -167,6 +167,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
{
|
||||
int i, j, k; /* Looping vars */
|
||||
http_t *http; /* HTTP connection */
|
||||
http_encryption_t encryption; /* Encryption type */
|
||||
http_status_t status; /* Status of GET command */
|
||||
int failures; /* Number of test failures */
|
||||
char buffer[8192]; /* Input buffer */
|
||||
@@ -541,7 +542,13 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
hostname, sizeof(hostname), &port,
|
||||
resource, sizeof(resource));
|
||||
|
||||
http = httpConnectEncrypt(hostname, port, HTTP_ENCRYPT_IF_REQUESTED);
|
||||
if (!_cups_strcasecmp(scheme, "https") || !_cups_strcasecmp(scheme, "ipps") ||
|
||||
port == 443)
|
||||
encryption = HTTP_ENCRYPT_ALWAYS;
|
||||
else
|
||||
encryption = HTTP_ENCRYPT_IF_REQUESTED;
|
||||
|
||||
http = httpConnectEncrypt(hostname, port, encryption);
|
||||
if (http == NULL)
|
||||
{
|
||||
perror(hostname);
|
||||
@@ -558,7 +565,6 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
else
|
||||
printf("GET failed with status %d...\n", status);
|
||||
|
||||
|
||||
start = time(NULL);
|
||||
length = httpGetLength2(http);
|
||||
total = 0;
|
||||
|
||||
+259
-121
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* IPP test program for CUPS.
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2005 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -38,148 +38,197 @@
|
||||
#endif /* WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
* Local types...
|
||||
*/
|
||||
|
||||
typedef struct _ippdata_t
|
||||
{
|
||||
size_t rpos, /* Read position */
|
||||
wused, /* Bytes used */
|
||||
wsize; /* Max size of buffer */
|
||||
ipp_uchar_t *wbuffer; /* Buffer */
|
||||
} _ippdata_t;
|
||||
|
||||
|
||||
/*
|
||||
* Local globals...
|
||||
*/
|
||||
|
||||
int rpos; /* Current position in buffer */
|
||||
ipp_uchar_t wbuffer[8192]; /* Write buffer */
|
||||
int wused; /* Number of bytes in buffer */
|
||||
ipp_uchar_t collection[] = /* Collection buffer */
|
||||
ipp_uchar_t collection[] = /* Collection buffer */
|
||||
{
|
||||
0x01, 0x01, /* IPP version */
|
||||
0x00, 0x02, /* Print-Job operation */
|
||||
0x00, 0x00, 0x00, 0x01, /* Request ID */
|
||||
0x01, 0x01, /* IPP version */
|
||||
0x00, 0x02, /* Print-Job operation */
|
||||
0x00, 0x00, 0x00, 0x01,
|
||||
/* Request ID */
|
||||
|
||||
IPP_TAG_OPERATION,
|
||||
|
||||
IPP_TAG_CHARSET,
|
||||
0x00, 0x12, /* Name length + name */
|
||||
0x00, 0x12, /* Name length + name */
|
||||
'a','t','t','r','i','b','u','t','e','s','-',
|
||||
'c','h','a','r','s','e','t',
|
||||
0x00, 0x05, /* Value length + value */
|
||||
0x00, 0x05, /* Value length + value */
|
||||
'u','t','f','-','8',
|
||||
|
||||
IPP_TAG_LANGUAGE,
|
||||
0x00, 0x1b, /* Name length + name */
|
||||
0x00, 0x1b, /* Name length + name */
|
||||
'a','t','t','r','i','b','u','t','e','s','-',
|
||||
'n','a','t','u','r','a','l','-','l','a','n',
|
||||
'g','u','a','g','e',
|
||||
0x00, 0x02, /* Value length + value */
|
||||
0x00, 0x02, /* Value length + value */
|
||||
'e','n',
|
||||
|
||||
IPP_TAG_URI,
|
||||
0x00, 0x0b, /* Name length + name */
|
||||
0x00, 0x0b, /* Name length + name */
|
||||
'p','r','i','n','t','e','r','-','u','r','i',
|
||||
0x00, 0x1c, /* Value length + value */
|
||||
'i','p','p',':','/','/','l','o','c','a','l',
|
||||
'h','o','s','t','/','p','r','i','n','t','e',
|
||||
'r','s','/','f','o','o',
|
||||
|
||||
IPP_TAG_JOB, /* job group tag */
|
||||
IPP_TAG_JOB, /* job group tag */
|
||||
|
||||
IPP_TAG_BEGIN_COLLECTION, /* begCollection tag */
|
||||
0x00, 0x09, /* Name length + name */
|
||||
IPP_TAG_BEGIN_COLLECTION,
|
||||
/* begCollection tag */
|
||||
0x00, 0x09, /* Name length + name */
|
||||
'm', 'e', 'd', 'i', 'a', '-', 'c', 'o', 'l',
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0a, /* Value length + value */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0a, /* Value length + value */
|
||||
'm', 'e', 'd', 'i', 'a', '-', 's', 'i', 'z', 'e',
|
||||
IPP_TAG_BEGIN_COLLECTION, /* begCollection tag */
|
||||
0x00, 0x00, /* Name length + name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
IPP_TAG_BEGIN_COLLECTION,
|
||||
/* begCollection tag */
|
||||
0x00, 0x00, /* Name length + name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME,
|
||||
/* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
'x', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
|
||||
IPP_TAG_INTEGER, /* integer tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
IPP_TAG_INTEGER, /* integer tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
0x00, 0x00, 0x54, 0x56,
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
IPP_TAG_MEMBERNAME,
|
||||
/* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
'y', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
|
||||
IPP_TAG_INTEGER, /* integer tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
IPP_TAG_INTEGER, /* integer tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
0x00, 0x00, 0x6d, 0x24,
|
||||
IPP_TAG_END_COLLECTION, /* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
IPP_TAG_END_COLLECTION,
|
||||
/* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
'm', 'e', 'd', 'i', 'a', '-', 'c', 'o', 'l', 'o', 'r',
|
||||
IPP_TAG_KEYWORD, /* keyword tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
IPP_TAG_KEYWORD, /* keyword tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
'b', 'l', 'u', 'e',
|
||||
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0a, /* Value length + value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0a, /* Value length + value */
|
||||
'm', 'e', 'd', 'i', 'a', '-', 't', 'y', 'p', 'e',
|
||||
IPP_TAG_KEYWORD, /* keyword tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x05, /* Value length + value */
|
||||
IPP_TAG_KEYWORD, /* keyword tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x05, /* Value length + value */
|
||||
'p', 'l', 'a', 'i', 'n',
|
||||
IPP_TAG_END_COLLECTION, /* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_END_COLLECTION,
|
||||
/* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
|
||||
IPP_TAG_BEGIN_COLLECTION, /* begCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0a, /* Value length + value */
|
||||
IPP_TAG_BEGIN_COLLECTION,
|
||||
/* begCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0a, /* Value length + value */
|
||||
'm', 'e', 'd', 'i', 'a', '-', 's', 'i', 'z', 'e',
|
||||
IPP_TAG_BEGIN_COLLECTION, /* begCollection tag */
|
||||
0x00, 0x00, /* Name length + name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
IPP_TAG_BEGIN_COLLECTION,
|
||||
/* begCollection tag */
|
||||
0x00, 0x00, /* Name length + name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME,
|
||||
/* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
'x', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
|
||||
IPP_TAG_INTEGER, /* integer tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
IPP_TAG_INTEGER, /* integer tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
0x00, 0x00, 0x52, 0x08,
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
IPP_TAG_MEMBERNAME,
|
||||
/* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
'y', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
|
||||
IPP_TAG_INTEGER, /* integer tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
IPP_TAG_INTEGER, /* integer tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
0x00, 0x00, 0x74, 0x04,
|
||||
IPP_TAG_END_COLLECTION, /* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
IPP_TAG_END_COLLECTION,
|
||||
/* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
'm', 'e', 'd', 'i', 'a', '-', 'c', 'o', 'l', 'o', 'r',
|
||||
IPP_TAG_KEYWORD, /* keyword tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x05, /* Value length + value */
|
||||
IPP_TAG_KEYWORD, /* keyword tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x05, /* Value length + value */
|
||||
'p', 'l', 'a', 'i', 'd',
|
||||
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0a, /* Value length + value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0a, /* Value length + value */
|
||||
'm', 'e', 'd', 'i', 'a', '-', 't', 'y', 'p', 'e',
|
||||
IPP_TAG_KEYWORD, /* keyword tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x06, /* Value length + value */
|
||||
IPP_TAG_KEYWORD, /* keyword tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x06, /* Value length + value */
|
||||
'g', 'l', 'o', 's', 's', 'y',
|
||||
IPP_TAG_END_COLLECTION, /* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_END_COLLECTION,
|
||||
/* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
|
||||
IPP_TAG_END /* end tag */
|
||||
IPP_TAG_END /* end tag */
|
||||
};
|
||||
|
||||
ipp_uchar_t mixed[] = /* Mixed value buffer */
|
||||
{
|
||||
0x01, 0x01, /* IPP version */
|
||||
0x00, 0x02, /* Print-Job operation */
|
||||
0x00, 0x00, 0x00, 0x01,
|
||||
/* Request ID */
|
||||
|
||||
IPP_TAG_OPERATION,
|
||||
|
||||
IPP_TAG_INTEGER, /* integer tag */
|
||||
0x00, 0x1f, /* Name length + name */
|
||||
'n', 'o', 't', 'i', 'f', 'y', '-', 'l', 'e', 'a', 's', 'e',
|
||||
'-', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '-', 's', 'u',
|
||||
'p', 'p', 'o', 'r', 't', 'e', 'd',
|
||||
0x00, 0x04, /* Value length + value */
|
||||
0x00, 0x00, 0x00, 0x01,
|
||||
|
||||
IPP_TAG_RANGE, /* rangeOfInteger tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x08, /* Value length + value */
|
||||
0x00, 0x00, 0x00, 0x10,
|
||||
0x00, 0x00, 0x00, 0x20,
|
||||
|
||||
IPP_TAG_END /* end tag */
|
||||
};
|
||||
|
||||
|
||||
@@ -189,8 +238,8 @@ ipp_uchar_t collection[] = /* Collection buffer */
|
||||
|
||||
void hex_dump(const char *title, ipp_uchar_t *buffer, int bytes);
|
||||
void print_attributes(ipp_t *ipp, int indent);
|
||||
ssize_t read_cb(void *data, ipp_uchar_t *buffer, size_t bytes);
|
||||
ssize_t write_cb(void *data, ipp_uchar_t *buffer, size_t bytes);
|
||||
ssize_t read_cb(_ippdata_t *data, ipp_uchar_t *buffer, size_t bytes);
|
||||
ssize_t write_cb(_ippdata_t *data, ipp_uchar_t *buffer, size_t bytes);
|
||||
|
||||
|
||||
/*
|
||||
@@ -201,6 +250,8 @@ int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
_ippdata_t data; /* IPP buffer */
|
||||
ipp_uchar_t buffer[8192]; /* Write buffer data */
|
||||
ipp_t *cols[2], /* Collections */
|
||||
*size; /* media-size collection */
|
||||
ipp_t *request; /* Request */
|
||||
@@ -280,33 +331,36 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
printf("Write Sample to Memory: ");
|
||||
|
||||
wused = 0;
|
||||
while ((state = ippWriteIO(wbuffer, write_cb, 1, NULL,
|
||||
data.wused = 0;
|
||||
data.wsize = sizeof(buffer);
|
||||
data.wbuffer = buffer;
|
||||
|
||||
while ((state = ippWriteIO(&data, (ipp_iocb_t)write_cb, 1, NULL,
|
||||
request)) != IPP_DATA)
|
||||
if (state == IPP_ERROR)
|
||||
break;
|
||||
|
||||
if (state != IPP_DATA)
|
||||
{
|
||||
printf("FAIL - %d bytes written.\n", wused);
|
||||
printf("FAIL - %d bytes written.\n", (int)data.wused);
|
||||
status = 1;
|
||||
}
|
||||
else if (wused != sizeof(collection))
|
||||
else if (data.wused != sizeof(collection))
|
||||
{
|
||||
printf("FAIL - wrote %d bytes, expected %d bytes!\n", wused,
|
||||
printf("FAIL - wrote %d bytes, expected %d bytes!\n", (int)data.wused,
|
||||
(int)sizeof(collection));
|
||||
hex_dump("Bytes Written", wbuffer, wused);
|
||||
hex_dump("Bytes Written", data.wbuffer, data.wused);
|
||||
hex_dump("Baseline", collection, sizeof(collection));
|
||||
status = 1;
|
||||
}
|
||||
else if (memcmp(wbuffer, collection, wused))
|
||||
else if (memcmp(data.wbuffer, collection, data.wused))
|
||||
{
|
||||
for (i = 0; i < wused; i ++)
|
||||
if (wbuffer[i] != collection[i])
|
||||
for (i = 0; i < data.wused; i ++)
|
||||
if (data.wbuffer[i] != collection[i])
|
||||
break;
|
||||
|
||||
printf("FAIL - output does not match baseline at 0x%04x!\n", i);
|
||||
hex_dump("Bytes Written", wbuffer, wused);
|
||||
hex_dump("Bytes Written", data.wbuffer, data.wused);
|
||||
hex_dump("Baseline", collection, sizeof(collection));
|
||||
status = 1;
|
||||
}
|
||||
@@ -321,10 +375,11 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
printf("Read Sample from Memory: ");
|
||||
|
||||
request = ippNew();
|
||||
rpos = 0;
|
||||
request = ippNew();
|
||||
data.rpos = 0;
|
||||
|
||||
while ((state = ippReadIO(wbuffer, read_cb, 1, NULL, request)) != IPP_DATA)
|
||||
while ((state = ippReadIO(&data, (ipp_iocb_t)read_cb, 1, NULL,
|
||||
request)) != IPP_DATA)
|
||||
if (state == IPP_ERROR)
|
||||
break;
|
||||
|
||||
@@ -332,12 +387,13 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
if (state != IPP_DATA)
|
||||
{
|
||||
printf("FAIL - %d bytes read.\n", rpos);
|
||||
printf("FAIL - %d bytes read.\n", (int)data.rpos);
|
||||
status = 1;
|
||||
}
|
||||
else if (rpos != wused)
|
||||
else if (data.rpos != data.wused)
|
||||
{
|
||||
printf("FAIL - read %d bytes, expected %d bytes!\n", rpos, wused);
|
||||
printf("FAIL - read %d bytes, expected %d bytes!\n", (int)data.rpos,
|
||||
(int)data.wused);
|
||||
print_attributes(request, 8);
|
||||
status = 1;
|
||||
}
|
||||
@@ -493,6 +549,82 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
ippDelete(request);
|
||||
|
||||
/*
|
||||
* Read the mixed data and confirm we converted everything to rangeOfInteger
|
||||
* values...
|
||||
*/
|
||||
|
||||
printf("Read Mixed integer/rangeOfInteger from Memory: ");
|
||||
|
||||
request = ippNew();
|
||||
data.rpos = 0;
|
||||
data.wused = sizeof(mixed);
|
||||
data.wsize = sizeof(mixed);
|
||||
data.wbuffer = mixed;
|
||||
|
||||
while ((state = ippReadIO(&data, (ipp_iocb_t)read_cb, 1, NULL,
|
||||
request)) != IPP_DATA)
|
||||
if (state == IPP_ERROR)
|
||||
break;
|
||||
|
||||
length = ippLength(request);
|
||||
|
||||
if (state != IPP_DATA)
|
||||
{
|
||||
printf("FAIL - %d bytes read.\n", (int)data.rpos);
|
||||
status = 1;
|
||||
}
|
||||
else if (data.rpos != sizeof(mixed))
|
||||
{
|
||||
printf("FAIL - read %d bytes, expected %d bytes!\n", (int)data.rpos,
|
||||
(int)sizeof(mixed));
|
||||
print_attributes(request, 8);
|
||||
status = 1;
|
||||
}
|
||||
else if (length != (sizeof(mixed) + 4))
|
||||
{
|
||||
printf("FAIL - wrong ippLength(), %d instead of %d bytes!\n",
|
||||
length, (int)sizeof(mixed) + 4);
|
||||
print_attributes(request, 8);
|
||||
status = 1;
|
||||
}
|
||||
else
|
||||
puts("PASS");
|
||||
|
||||
fputs("ippFindAttribute(notify-lease-duration-supported): ", stdout);
|
||||
if ((attr = ippFindAttribute(request, "notify-lease-duration-supported",
|
||||
IPP_TAG_ZERO)) == NULL)
|
||||
{
|
||||
puts("FAIL (not found)");
|
||||
status = 1;
|
||||
}
|
||||
else if (attr->value_tag != IPP_TAG_RANGE)
|
||||
{
|
||||
printf("FAIL (wrong type - %s)\n", ippTagString(attr->value_tag));
|
||||
status = 1;
|
||||
}
|
||||
else if (attr->num_values != 2)
|
||||
{
|
||||
printf("FAIL (wrong count - %d)\n", attr->num_values);
|
||||
status = 1;
|
||||
}
|
||||
else if (attr->values[0].range.lower != 1 ||
|
||||
attr->values[0].range.upper != 1 ||
|
||||
attr->values[1].range.lower != 16 ||
|
||||
attr->values[1].range.upper != 32)
|
||||
{
|
||||
printf("FAIL (wrong values - %d,%d and %d,%d)\n",
|
||||
attr->values[0].range.lower,
|
||||
attr->values[0].range.upper,
|
||||
attr->values[1].range.lower,
|
||||
attr->values[1].range.upper);
|
||||
status = 1;
|
||||
}
|
||||
else
|
||||
puts("PASS");
|
||||
|
||||
ippDelete(request);
|
||||
|
||||
/*
|
||||
* Test _ippFindOption() private API...
|
||||
*/
|
||||
@@ -813,25 +945,28 @@ print_attributes(ipp_t *ipp, /* I - IPP request */
|
||||
*/
|
||||
|
||||
ssize_t /* O - Number of bytes read */
|
||||
read_cb(void *data, /* I - Data */
|
||||
read_cb(_ippdata_t *data, /* I - Data */
|
||||
ipp_uchar_t *buffer, /* O - Buffer to read */
|
||||
size_t bytes) /* I - Number of bytes to read */
|
||||
{
|
||||
int count; /* Number of bytes */
|
||||
size_t count; /* Number of bytes */
|
||||
|
||||
|
||||
/*
|
||||
* Copy bytes from the data buffer to the read buffer...
|
||||
*/
|
||||
|
||||
for (count = bytes; count > 0 && rpos < wused; count --, rpos ++)
|
||||
*buffer++ = wbuffer[rpos];
|
||||
if ((count = data->wsize - data->rpos) > bytes)
|
||||
count = bytes;
|
||||
|
||||
memcpy(buffer, data->wbuffer + data->rpos, count);
|
||||
data->rpos += count;
|
||||
|
||||
/*
|
||||
* Return the number of bytes read...
|
||||
*/
|
||||
|
||||
return (bytes - count);
|
||||
return (count);
|
||||
}
|
||||
|
||||
|
||||
@@ -840,25 +975,28 @@ read_cb(void *data, /* I - Data */
|
||||
*/
|
||||
|
||||
ssize_t /* O - Number of bytes written */
|
||||
write_cb(void *data, /* I - Data */
|
||||
write_cb(_ippdata_t *data, /* I - Data */
|
||||
ipp_uchar_t *buffer, /* I - Buffer to write */
|
||||
size_t bytes) /* I - Number of bytes to write */
|
||||
{
|
||||
int count; /* Number of bytes */
|
||||
size_t count; /* Number of bytes */
|
||||
|
||||
|
||||
/*
|
||||
* Loop until all bytes are written...
|
||||
*/
|
||||
|
||||
for (count = bytes; count > 0 && wused < sizeof(wbuffer); count --, wused ++)
|
||||
wbuffer[wused] = *buffer++;
|
||||
if ((count = data->wsize - data->wused) > bytes)
|
||||
count = bytes;
|
||||
|
||||
memcpy(data->wbuffer + data->wused, buffer, count);
|
||||
data->wused += count;
|
||||
|
||||
/*
|
||||
* Return the number of bytes written...
|
||||
*/
|
||||
|
||||
return (bytes - count);
|
||||
return (count);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Private threading definitions for CUPS.
|
||||
*
|
||||
* Copyright 2009-2010 by Apple Inc.
|
||||
* Copyright 2009-2012 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -49,7 +49,7 @@ typedef pthread_key_t _cups_threadkey_t;
|
||||
typedef void *(__stdcall *_cups_thread_func_t)(void *arg);
|
||||
typedef struct _cups_mutex_s
|
||||
{
|
||||
int m_init; /* Flag for on-demand initialization */
|
||||
int m_init; /* Flag for on-demand initialization */
|
||||
CRITICAL_SECTION m_criticalSection;
|
||||
/* Win32 Critical Section */
|
||||
} _cups_mutex_t;
|
||||
@@ -62,6 +62,7 @@ typedef DWORD _cups_threadkey_t;
|
||||
# define _cupsThreadSetData(k,p) TlsSetValue(k,p)
|
||||
|
||||
# else
|
||||
typedef void *(*_cups_thread_func_t)(void *arg);
|
||||
typedef char _cups_mutex_t;
|
||||
typedef char _cups_rwlock_t;
|
||||
typedef void *_cups_threadkey_t;
|
||||
|
||||
+22
-3
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Threading primitives for CUPS.
|
||||
*
|
||||
* Copyright 2009-2010 by Apple Inc.
|
||||
* Copyright 2009-2012 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -113,7 +113,7 @@ _cupsRWUnlock(_cups_rwlock_t *rwlock) /* I - Reader/writer lock */
|
||||
* '_cupsThreadCreate()' - Create a thread.
|
||||
*/
|
||||
|
||||
int /* O - 0 on failure, 1 on success */
|
||||
int /* O - 0 on failure, 1 on success */
|
||||
_cupsThreadCreate(
|
||||
_cups_thread_func_t func, /* I - Entry point */
|
||||
void *arg) /* I - Entry point context */
|
||||
@@ -223,7 +223,7 @@ _cupsRWUnlock(_cups_rwlock_t *rwlock) /* I - Reader/writer lock */
|
||||
* '_cupsThreadCreate()' - Create a thread.
|
||||
*/
|
||||
|
||||
int /* O - 0 on failure, 1 on success */
|
||||
int /* O - 0 on failure, 1 on success */
|
||||
_cupsThreadCreate(
|
||||
_cups_thread_func_t func, /* I - Entry point */
|
||||
void *arg) /* I - Entry point context */
|
||||
@@ -309,6 +309,25 @@ _cupsRWUnlock(_cups_rwlock_t *rwlock) /* I - Reader/writer lock */
|
||||
{
|
||||
(void)rwlock;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_cupsThreadCreate()' - Create a thread.
|
||||
*/
|
||||
|
||||
int /* O - 0 on failure, 1 on success */
|
||||
_cupsThreadCreate(
|
||||
_cups_thread_func_t func, /* I - Entry point */
|
||||
void *arg) /* I - Entry point context */
|
||||
{
|
||||
fputs("DEBUG: CUPS was compiled without threading support, no thread "
|
||||
"created.\n", stderr);
|
||||
|
||||
(void)func;
|
||||
(void)arg;
|
||||
|
||||
return (0);
|
||||
}
|
||||
#endif /* HAVE_PTHREAD_H */
|
||||
|
||||
|
||||
|
||||
+8
-5
@@ -171,16 +171,17 @@ cupsCharsetToUTF8(
|
||||
|
||||
if (map_to_utf8 != (iconv_t)-1)
|
||||
{
|
||||
char *altdestptr = (char *)dest; /* Silence bogus GCC type-punned */
|
||||
|
||||
srclen = strlen(src);
|
||||
outBytesLeft = maxout - 1;
|
||||
|
||||
iconv(map_to_utf8, (char **)&src, &srclen, (char **)&destptr,
|
||||
&outBytesLeft);
|
||||
*destptr = '\0';
|
||||
iconv(map_to_utf8, (char **)&src, &srclen, &altdestptr, &outBytesLeft);
|
||||
*altdestptr = '\0';
|
||||
|
||||
_cupsMutexUnlock(&map_mutex);
|
||||
|
||||
return ((int)(destptr - dest));
|
||||
return ((int)(altdestptr - (char *)dest));
|
||||
}
|
||||
|
||||
_cupsMutexUnlock(&map_mutex);
|
||||
@@ -295,10 +296,12 @@ cupsUTF8ToCharset(
|
||||
|
||||
if (map_from_utf8 != (iconv_t)-1)
|
||||
{
|
||||
char *altsrc = (char *)src; /* Silence bogus GCC type-punned */
|
||||
|
||||
srclen = strlen((char *)src);
|
||||
outBytesLeft = maxout - 1;
|
||||
|
||||
iconv(map_from_utf8, (char **)&src, &srclen, &destptr, &outBytesLeft);
|
||||
iconv(map_from_utf8, &altsrc, &srclen, &destptr, &outBytesLeft);
|
||||
*destptr = '\0';
|
||||
|
||||
_cupsMutexUnlock(&map_mutex);
|
||||
|
||||
+9
-1
@@ -223,7 +223,7 @@ cupsSetCredentials(
|
||||
return (-1);
|
||||
|
||||
_httpFreeCredentials(cg->tls_credentials);
|
||||
cg->tls_credentials = _httpConvertCredentials(credentials);
|
||||
cg->tls_credentials = _httpCreateCredentials(credentials);
|
||||
|
||||
return (cg->tls_credentials ? 0 : -1);
|
||||
}
|
||||
@@ -636,7 +636,9 @@ cups_read_client_conf(
|
||||
char line[1024], /* Line from file */
|
||||
*value, /* Pointer into line */
|
||||
encryption[1024], /* Encryption value */
|
||||
#ifndef __APPLE__
|
||||
server_name[1024], /* ServerName value */
|
||||
#endif /* !__APPLE__ */
|
||||
any_root[1024], /* AllowAnyRoot value */
|
||||
expired_root[1024], /* AllowExpiredRoot value */
|
||||
expired_certs[1024]; /* AllowExpiredCerts value */
|
||||
@@ -658,12 +660,18 @@ cups_read_client_conf(
|
||||
strlcpy(encryption, value, sizeof(encryption));
|
||||
cups_encryption = encryption;
|
||||
}
|
||||
#ifndef __APPLE__
|
||||
/*
|
||||
* The Server directive is not supported on Mac OS X due to app sandboxing
|
||||
* restrictions, i.e. not all apps request network access.
|
||||
*/
|
||||
else if (!cups_server && (!cg->server[0] || !cg->ipp_port) &&
|
||||
!_cups_strcasecmp(line, "ServerName") && value)
|
||||
{
|
||||
strlcpy(server_name, value, sizeof(server_name));
|
||||
cups_server = server_name;
|
||||
}
|
||||
#endif /* !__APPLE__ */
|
||||
else if (!cups_anyroot && !_cups_strcasecmp(line, "AllowAnyRoot") && value)
|
||||
{
|
||||
strlcpy(any_root, value, sizeof(any_root));
|
||||
|
||||
+15
-3
@@ -248,7 +248,8 @@ cupsCreateJob(
|
||||
if (title)
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL,
|
||||
title);
|
||||
cupsEncodeOptions(request, num_options, options);
|
||||
cupsEncodeOptions2(request, num_options, options, IPP_TAG_JOB);
|
||||
cupsEncodeOptions2(request, num_options, options, IPP_TAG_SUBSCRIPTION);
|
||||
|
||||
/*
|
||||
* Send the request and get the job-id...
|
||||
@@ -899,6 +900,7 @@ cupsGetPPD3(http_t *http, /* I - HTTP connection or @code CUPS_HTTP_DEFAUL
|
||||
resource[HTTP_MAX_URI]; /* Resource name */
|
||||
int port; /* Port number */
|
||||
http_status_t status; /* HTTP status from server */
|
||||
char tempfile[1024] = ""; /* Temporary filename */
|
||||
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
|
||||
|
||||
|
||||
@@ -1090,7 +1092,7 @@ cupsGetPPD3(http_t *http, /* I - HTTP connection or @code CUPS_HTTP_DEFAUL
|
||||
if (buffer[0])
|
||||
fd = open(buffer, O_CREAT | O_TRUNC | O_WRONLY, 0600);
|
||||
else
|
||||
fd = cupsTempFd(buffer, bufsize);
|
||||
fd = cupsTempFd(tempfile, sizeof(tempfile));
|
||||
|
||||
if (fd < 0)
|
||||
{
|
||||
@@ -1125,13 +1127,23 @@ cupsGetPPD3(http_t *http, /* I - HTTP connection or @code CUPS_HTTP_DEFAUL
|
||||
*/
|
||||
|
||||
if (status == HTTP_OK)
|
||||
{
|
||||
*modtime = httpGetDateTime(httpGetField(http2, HTTP_FIELD_DATE));
|
||||
|
||||
if (tempfile[0])
|
||||
strlcpy(buffer, tempfile, bufsize);
|
||||
}
|
||||
else if (status != HTTP_NOT_MODIFIED)
|
||||
{
|
||||
_cupsSetHTTPError(status);
|
||||
|
||||
unlink(cg->ppd_filename);
|
||||
if (buffer[0])
|
||||
unlink(buffer);
|
||||
else if (tempfile[0])
|
||||
unlink(tempfile);
|
||||
}
|
||||
else if (tempfile[0])
|
||||
unlink(tempfile);
|
||||
|
||||
if (http2 != http)
|
||||
httpClose(http2);
|
||||
|
||||
+12
-9
@@ -13,15 +13,18 @@
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
#media "10x11/10 x 11\"" 720 792
|
||||
#media "10x13/10 x 13\"" 720 936
|
||||
#media "10x14/10 x 14\"" 720 1008
|
||||
#media "12x11/12 x 11\"" 864 792
|
||||
#media "15x11/15 x 11\"" 1080 792
|
||||
#media "7x9/7 x 9\"" 504 648
|
||||
#media "8x10/8 x 10\"" 576 720
|
||||
#media "9x11/9 x 11\"" 648 792
|
||||
#media "9x12/9 x 12\"" 648 864
|
||||
#media "3x5/3 x 5" 216 360
|
||||
#media "3.5x5/3.5 x 5" 252 360
|
||||
#media "5x7/5 x 7" 360 504
|
||||
#media "10x11/10 x 11" 720 792
|
||||
#media "10x13/10 x 13" 720 936
|
||||
#media "10x14/10 x 14" 720 1008
|
||||
#media "12x11/12 x 11" 864 792
|
||||
#media "15x11/15 x 11" 1080 792
|
||||
#media "7x9/7 x 9" 504 648
|
||||
#media "8x10/8 x 10" 576 720
|
||||
#media "9x11/9 x 11" 648 792
|
||||
#media "9x12/9 x 12" 648 864
|
||||
#media "A0/A0" 2384 3370
|
||||
#media "A0.Transverse/A0 Long Edge" 3370 2384
|
||||
#media "A1/A1" 1684 2384
|
||||
|
||||
@@ -21,6 +21,8 @@ Name[fr]=Gestionnaire d'impression
|
||||
Comment[fr]=Interface Web de CUPS
|
||||
Name[he]=נהל הדפסות
|
||||
Comment[he]=ממשק דפדפן של CUPS
|
||||
Name[hu]=Nyomtatás kezelése
|
||||
Comment[hu]=A CUPS webes felülete
|
||||
Name[id]=Manajemen Pencetakan
|
||||
Comment[id]=Antarmuka Web CUPS
|
||||
Name[it]=Gestione stampa
|
||||
|
||||
@@ -50,7 +50,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
|
||||
<P><A HREF="help/options.html">Kommandozeilendruck und Einstellungen</A></P>
|
||||
|
||||
<P><A HREF="help/whatsnew.html">Neues in CUPS 1.4</A></P>
|
||||
<P><A HREF="help/whatsnew.html">Neues in CUPS 1.5</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Benutzerforum</A></P>
|
||||
|
||||
@@ -101,7 +101,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
<TR><TD> </TD></TR>
|
||||
<TR><TD CLASS="trailer">CUPS und das CUPS Logo sind
|
||||
eingetragene Warenzeichen der <A HREF="http://www.apple.com">Apple Inc.</A>
|
||||
CUPS ist urheberrechtlich geschützt 2007-2011 von Apple Inc, alle Rechte vorbehalten.</TD></TR>
|
||||
CUPS ist urheberrechtlich geschützt 2007-2012 von Apple Inc, alle Rechte vorbehalten.</TD></TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
@@ -50,7 +50,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
|
||||
<P><A HREF="help/options.html">Impresión desde la línea de comandos y opciones</A></P>
|
||||
|
||||
<P><A HREF="help/whatsnew.html">Qué hay de nuevo en CUPS 1.4</A></P>
|
||||
<P><A HREF="help/whatsnew.html">Qué hay de nuevo en CUPS 1.5</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Foro de usuarios</A></P>
|
||||
|
||||
@@ -101,7 +101,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
<TR><TD> </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-2011 son de Apple Inc. Todos los derechos reservados.</TD></TR>
|
||||
de copia de CUPS 2007-2012 son de Apple Inc. Todos los derechos reservados.</TD></TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
@@ -32,7 +32,7 @@ AUTOSAVE="org.cups.help" RESULTS="20"></FORM></TD>
|
||||
<H1>CUPS @CUPS_VERSION@</H1>
|
||||
|
||||
<P><A HREF="http://www.apple.com/">Apple Inc.</A>-ek Mac OS<SUP>®</SUP> X eta
|
||||
beste UNIX<SUP>®</SUP> bezalako sistema eragileentzako iturburu irekiko
|
||||
beste UNIX<SUP>®</SUP> bezalako sistema eragileentzako iturburu irekiko
|
||||
inprimatzeko sisteman oinarrituta dago.</P>
|
||||
|
||||
</TD>
|
||||
@@ -50,7 +50,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
|
||||
<P><A HREF="help/options.html">Komando-lerroaren bidez inprimatzea eta aukerak</A></P>
|
||||
|
||||
<P><A HREF="help/whatsnew.html">CUPS 1.4 bertsioak dakartzan berrikuntza.</A></P>
|
||||
<P><A HREF="help/whatsnew.html">CUPS 1.5 bertsioak dakartzan berrikuntza.</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Erabiltzaileen foroa</A></P>
|
||||
|
||||
@@ -100,7 +100,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
</TD></TR>
|
||||
<TR><TD> </TD></TR>
|
||||
<TR><TD CLASS="trailer">CUPS eta CUPSen logotipoa <A HREF="http://www.apple.com">Apple Inc.</A> en marka erregistratuak dira.
|
||||
CUPSen copyright-a 2007-2011 Apple Inc. Eskubide guztiak gordeta.</TD></TR>
|
||||
CUPSen copyright-a 2007-2012 Apple Inc. Eskubide guztiak gordeta.</TD></TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
@@ -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="/"> Accueil </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/admin"> Administration </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/classes/"> Classes </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/help/"> Aide En Ligne </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/jobs/"> Tâches </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/printers/"> Imprimantes </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ème d'impression Open Source, basé sur des standards, développé par
|
||||
<A HREF="http://www.apple.com/">Apple Inc.</A> pour Mac OS<SUP>®</SUP> X et
|
||||
les autres OS UNIX<SUP>®</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é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.5</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érer les politiques</A></P>
|
||||
|
||||
<P><A HREF="help/accounting.html">Printer Accounting Basics</A></P>
|
||||
|
||||
<P><A HREF="help/security.html">Sécurité 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éseaux</A></P>
|
||||
|
||||
<P><A HREF="help/ref-cupsd-conf.html">Réfé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éveloppeurs</H2>
|
||||
|
||||
<P><A HREF="help/api-overview.html">Introduction à 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éveloppeurs</A></P>
|
||||
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
</TD></TR>
|
||||
<TR><TD> </TD></TR>
|
||||
<TR><TD CLASS="trailer">CUPS et le logo CUPS sont des marques déposées de
|
||||
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS est sous copyright 2007-2012 Apple
|
||||
Inc. Tous droits réservés.</TD></TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
</HTML>
|
||||
+18
-51
@@ -8,11 +8,7 @@
|
||||
|
||||
<H1 CLASS="title">Using Kerberos Authentication</H1>
|
||||
|
||||
<P>CUPS allows you to use a Key Distribution Center (KDC) for authentication
|
||||
on your local CUPS server and when printing to a remote authenticated queue.
|
||||
This document describes how to configure CUPS to use Kerberos authentication
|
||||
and provides links to the MIT help pages for configuring Kerberos on your
|
||||
systems and network.</P>
|
||||
<P>CUPS allows you to use a Key Distribution Center (KDC) for authentication on your local CUPS server and when printing to a remote authenticated queue. This document describes how to configure CUPS to use Kerberos authentication and provides links to the MIT help pages for configuring Kerberos on your systems and network.</P>
|
||||
|
||||
|
||||
<H2 CLASS="title"><A NAME="REQUIREMENTS">System Requirements</A></H2>
|
||||
@@ -23,42 +19,31 @@ systems and network.</P>
|
||||
|
||||
<li>Heimdal Kerberos (any version) or MIT Kerberos (1.6.3 or newer)</li>
|
||||
|
||||
<li>Properly configured Domain Name System (DNS)
|
||||
infrastructure:<ol type='a'>
|
||||
<li>DNS server(s) with static IP addresses for all CUPS clients
|
||||
and servers or configured to allow DHCP updates to the host
|
||||
addresses</li>
|
||||
<li>Properly configured Domain Name System (DNS) infrastructure (for your servers):<ol type='a'>
|
||||
<li>DNS server(s) with static IP addresses for all CUPS servers or configured to allow DHCP updates to the host addresses and</li>
|
||||
<li>All CUPS clients and servers configured to use the same
|
||||
DNS server(s)</li>
|
||||
DNS server(s).</li>
|
||||
</ol></li>
|
||||
|
||||
<li>Properly configured Kerberos infrastructure:<ol type='a'>
|
||||
<li>KDC configured to allow CUPS clients and servers to obtain
|
||||
Service Granting Tickets (SGTs) for the "ipp" service</li>
|
||||
<li>LDAP-based user accounts - both OpenDirectory and
|
||||
ActiveDirectory provide this with the KDC</li>
|
||||
<li>CUPS clients and servers bound to the KDC and LDAP
|
||||
server(s)</li>
|
||||
<li>KDC configured to allow CUPS servers to obtain Service Granting Tickets (SGTs) for the "host" service,</li>
|
||||
<li>LDAP-based user accounts - both OpenDirectory and ActiveDirectory provide this with the KDC, and</li>
|
||||
<li>CUPS clients and servers bound to the same KDC and LDAP
|
||||
server(s).</li>
|
||||
</ol></li>
|
||||
|
||||
<li>An "ipp" Service Granting Ticket (SGT) for every CUPS client and
|
||||
server</li>
|
||||
<li>A "host" Service Granting Ticket (SGT) for every CUPS server</li>
|
||||
|
||||
</ol>
|
||||
|
||||
|
||||
<H2 CLASS="title"><A NAME="KRB5">Configuring Kerberos on Your System</A></H2>
|
||||
|
||||
<P>Before you can use Kerberos with CUPS, you will need to configure
|
||||
Kerberos on your system and setup a system as a KDC. Because this
|
||||
configuration is highly system and site-specific, please consult
|
||||
the following on-line resources provided by the creators of Kerberos
|
||||
at the Massachusetts Institute of Technology (MIT):</P>
|
||||
<P>Before you can use Kerberos with CUPS, you will need to configure Kerberos on your system and setup a system as a KDC. Because this configuration is highly system and site-specific, please consult the following on-line resources provided by the creators of Kerberos at the Massachusetts Institute of Technology (MIT):</P>
|
||||
|
||||
<UL>
|
||||
|
||||
<LI><A HREF="http://web.mit.edu/kerberos/">Kerberos: The Network
|
||||
Authentication Protocol</A></LI>
|
||||
<LI><A HREF="http://web.mit.edu/kerberos/">Kerberos: The Network Authentication Protocol</A></LI>
|
||||
|
||||
<LI><A HREF="http://web.mit.edu/macdev/KfM/Common/Documentation/faq-osx.html">Kerberos
|
||||
on Mac OS X Frequently Asked Questions</A></LI>
|
||||
@@ -77,46 +62,28 @@ at the Massachusetts Institute of Technology (MIT):</P>
|
||||
|
||||
<H2 CLASS="title"><A NAME="CUPS">Configuring CUPS to Use Kerberos</A></H2>
|
||||
|
||||
<P>Once you have configured Kerberos on your system(s), you can then
|
||||
enable Kerberos authentication by selecting the <tt>Negotiate</tt>
|
||||
authentication type. The simplest way to do this is using the
|
||||
<tt>cupsctl(8)</tt> command:</P>
|
||||
<P>Once youhave configured Kerberos on your system(s), you can then enable Kerberos authentication by selecting the <tt>Negotiate</tt> authentication type. The simplest way to do this is using the <tt>cupsctl(8)</tt> command on your server(s):</P>
|
||||
|
||||
<PRE CLASS="command">
|
||||
<KBD>cupsctl DefaultAuthType=Negotiate</KBD>
|
||||
</PRE>
|
||||
|
||||
<P>You can also enable Kerberos from the web interface by checking the
|
||||
<VAR>Use Kerberos Authentication</VAR> box and clicking <VAR>Change
|
||||
Settings</VAR>:</P>
|
||||
<P>You can also enable Kerberos from the web interface by checking the <VAR>Use Kerberos Authentication</VAR> box and clicking <VAR>Change Settings</VAR>:</P>
|
||||
|
||||
<PRE CLASS="command">
|
||||
http://localhost:631/admin
|
||||
http://server.example.com:631/admin
|
||||
</PRE>
|
||||
|
||||
<P>After you have enabled Kerberos authentication, use the built-in
|
||||
"authenticated" policy or your own custom policies with the printers you
|
||||
will be sharing. See <a href="policies.html">Managing Operation Policies</a>
|
||||
for more information.</P>
|
||||
<P>After you have enabled Kerberos authentication, use the built-in "authenticated" policy or your own custom policies with the printers you will be sharing. See <a href="policies.html">Managing Operation Policies</a> for more information.</P>
|
||||
|
||||
|
||||
<H2 CLASS="title"><A NAME="IMPLEMENT">Implementation Information</A></H2>
|
||||
|
||||
<P>CUPS implements Kerberos over HTTP using GSSAPI and the service name
|
||||
"host". Because of limitations in the HTTP GSSAPI protocol extension, only
|
||||
a single domain/KDC is supported for authentication.</P>
|
||||
<P>CUPS implements Kerberos over HTTP using GSSAPI and the service name "host". Because of limitations in the HTTP GSSAPI protocol extension, only a single domain/KDC is supported for authentication. The HTTP extension is described in <a href="http://tools.ietf.org/html/rfc4559">RFC 4559</a>.</P>
|
||||
|
||||
<P>When doing printing tasks that require authentication, CUPS requests a
|
||||
single-use "ticket" from your login session to authenticate who you are.
|
||||
This ticket gives CUPS a username of the form "user@REALM", which is then
|
||||
converted to just "user" for purposes of user and group checks.</P>
|
||||
<P>When doing printing tasks that require authentication, CUPS requests single-use "tickets" from your login session to authenticate who you are. These tickets give CUPS a username of the form "user@REALM", which is then converted to just "user" for purposes of user and group checks.</P>
|
||||
|
||||
<P>In order to support printing to a shared printer, CUPS has to ask the KDC
|
||||
for a copy of your credentials (this is called delegation) that can be sent to
|
||||
the remote server for authentication. Delegation only works when the system
|
||||
has a stable hostname which maps to the current address of the system, which
|
||||
is why you need a static IP address or DHCP that updates the DNS entry for your
|
||||
system.</P>
|
||||
<P>In order to support printing to a shared printer, CUPS runs the IPP backend as the owner of the print job so it can obtain the necessary credentials.</P>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
@@ -909,9 +909,13 @@ ConfigFilePerm 0640
|
||||
|
||||
<H3>Description</H3>
|
||||
|
||||
<P>The <CODE>ConfigFilePerm</CODE> directive specifies the
|
||||
permissions to use when writing configuration files. The default
|
||||
is @CUPS_CONFIG_FILE_PERM@.</P>
|
||||
<P>The <CODE>ConfigFilePerm</CODE> directive specifies the permissions to use when the scheduler writes configuration and cache files, typically in response to IPP or HTTP requests. The default is @CUPS_CONFIG_FILE_PERM@.</P>
|
||||
|
||||
<BLOCKQUOTE><B>Note:</B>
|
||||
|
||||
<P>The permissions for the <VAR>printers.conf</VAR> file are always masked to only allow access from the scheduler user (typically root). This is done because printer device URIs sometimes contain sensitive authentication information that should not be generally known on the system. There is no way to disable this security feature.</P>
|
||||
|
||||
</BLOCKQUOTE>
|
||||
|
||||
|
||||
<H2 CLASS="title"><A NAME="DataDir">DataDir</A></H2>
|
||||
@@ -2038,7 +2042,7 @@ LogFilePerm 0600
|
||||
<H3>Description</H3>
|
||||
|
||||
<P>The <CODE>LogFilePerm</CODE> directive specifies the
|
||||
permissions to use when writing configuration files. The default
|
||||
permissions to use when writing log files. The default
|
||||
is @CUPS_LOG_FILE_PERM@.</P>
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ DeskJet root 2 [20/May/1999:19:21:05 +0000] 2 1 acme-123 localhost myjob letter
|
||||
|
||||
</P>
|
||||
|
||||
<p>The <a href="ref-cupsd_conf.html#PageLogFormat"><code>PageLogFormat</code></a>
|
||||
<p>The <a href="ref-cupsd-conf.html#PageLogFormat"><code>PageLogFormat</code></a>
|
||||
directive can be used to change this information.</p>
|
||||
|
||||
<P>The <I>printer</I> field contains the name of the printer that
|
||||
|
||||
@@ -341,7 +341,7 @@ div.contents ul.subcontents li {
|
||||
<body>
|
||||
<div class='body'>
|
||||
<!--
|
||||
"$Id: spec-ppd.html 9740 2011-05-04 06:26:22Z mike $"
|
||||
"$Id: spec-ppd.html 9813 2011-06-01 17:00:27Z mike $"
|
||||
|
||||
PPD extension documentation for CUPS.
|
||||
|
||||
@@ -604,9 +604,10 @@ f(x) = density * x <sup style='font-size: 100%'>gamma</sup>
|
||||
|
||||
<h4>Customizing the Profile Selection Keywords</h4>
|
||||
|
||||
<p>The <tt>MediaType</tt> and <tt>Resolution</tt> main keywords can be reassigned to different main keywords, allowing drivers to do color profile selection based on different parameters. The <tt>cupsICCQualifier2</tt> and <tt>cupsICCQualifier3</tt> keywords define the mapping from selector to main keyword:</p>
|
||||
<p>The <tt>ColorModel</tt>, <tt>MediaType</tt>, and <tt>Resolution</tt> main keywords can be reassigned to different main keywords, allowing drivers to do color profile selection based on different parameters. The <tt>cupsICCQualifier1</tt>, <tt>cupsICCQualifier2</tt>, and <tt>cupsICCQualifier3</tt> keywords define the mapping from selector to main keyword:</p>
|
||||
|
||||
<pre class='command'>
|
||||
*cupsICCQualifier1: MainKeyword1
|
||||
*cupsICCQualifier2: MainKeyword2
|
||||
*cupsICCQualifier3: MainKeyword3
|
||||
</pre>
|
||||
@@ -614,6 +615,7 @@ f(x) = density * x <sup style='font-size: 100%'>gamma</sup>
|
||||
<p>The default mapping is as follows:</p>
|
||||
|
||||
<pre class='command'>
|
||||
*cupsICCQualifier1: ColorModel
|
||||
*cupsICCQualifier2: MediaType
|
||||
*cupsICCQualifier3: Resolution
|
||||
</pre>
|
||||
@@ -1647,11 +1649,7 @@ scheduler's <code>DocumentRoot</code> directory, a full HTTP URL
|
||||
valid URI which directs the user at additional information
|
||||
concerning the condition that is being reported.</p>
|
||||
|
||||
<p>Since the reason text is limited to 80 characters by the PPD specification,
|
||||
longer text strings can be included by URI-encoding the text with the "text"
|
||||
scheme, for example "text:some%20text". Multiple <code>text</code> URIs are
|
||||
combined (with spaces between each URI) by the <tt>ppdLocalizeIPPReason</tt>
|
||||
into a single string that can be displayed to the user.</p>
|
||||
<p>Since the reason text is limited to 80 characters by the PPD specification, longer text strings can be included by URI-encoding the text with the "text" scheme, for example "text:some%20text". Multiple <code>text</code> URIs are combined by the <tt>ppdLocalizeIPPReason</tt> into a single string that can be displayed to the user.</p>
|
||||
|
||||
<p>Examples:</p>
|
||||
|
||||
|
||||
Arquivo executável
+113
@@ -0,0 +1,113 @@
|
||||
<!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>Kezdőlap - 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="/"> Kezdőoldal </A></TD>
|
||||
<TD CLASS="unsel"><A
|
||||
HREF="/admin"> Adminisztráció </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/classes/"> Osztályok </A></TD>
|
||||
<TD CLASS="unsel"><A
|
||||
HREF="/help/"> Online súgó </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/jobs/"> Feladatok </A></TD>
|
||||
<TD CLASS="unsel"><A
|
||||
HREF="/printers/"> Nyomtatók </A></TD>
|
||||
<TD CLASS="unsel" WIDTH="100%"><FORM ACTION="/help/" METHOD="GET"><INPUT
|
||||
TYPE="SEARCH" NAME="QUERY" SIZE="20" PLACEHOLDER="Keresés a súgóban"
|
||||
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>A CUPS az <A HREF="http://www.apple.com/">Apple Inc.</A> által a Mac
|
||||
OS<SUP>®</SUP> X és más UNIX<SUP>®</SUP>-szerű operációs
|
||||
rendszerekhez kifejlesztett, szabványokra épülő, nyílt forrású
|
||||
nyomtatórendszer.</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 felhasználóknak</H2>
|
||||
|
||||
<P><A HREF="help/overview.html">A CUPS bemutatása</A></P>
|
||||
|
||||
<P><A HREF="help/options.html">Parancssori nyomtatás és kapcsolók</A></P>
|
||||
|
||||
<P><A HREF="help/whatsnew.html">A CUPS 1.5 újdonságai</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Felhasználói fórum</A></P>
|
||||
|
||||
</TD><TD VALIGN="top" STYLE="border-right: dotted thin #cccccc; padding-left: 20px; padding-right: 20px;">
|
||||
|
||||
<H2>CUPS rendszergazdáknak</H2>
|
||||
|
||||
<P><A HREF="admin">Nyomtatók és osztályok hozzáadása</A></P>
|
||||
|
||||
<P><A HREF="help/policies.html">Műveletházirendek kezelése</A></P>
|
||||
|
||||
<P><A HREF="help/accounting.html">Nyomtatási számlázás alapjai</A></P>
|
||||
|
||||
<P><A HREF="help/security.html">Kiszolgáló biztonsága</A></P>
|
||||
|
||||
<P><A HREF="help/kerberos.html">Kerberos hitelesítés használata</A></P>
|
||||
|
||||
<P><A HREF="help/network.html">Hálózati nyomtatók használata</A></P>
|
||||
|
||||
<P><A HREF="help/ref-cupsd-conf.html">cupsd.conf referencia</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/ppd.php">Nyomtató-illesztőprogramok
|
||||
keresése</A></P>
|
||||
|
||||
</TD><TD VALIGN="top" STYLE="padding-left: 20px;">
|
||||
|
||||
<H2>A CUPS fejlesztőknek</H2>
|
||||
|
||||
<P><A HREF="help/api-overview.html">A CUPS programozásának bemutatása</A></P>
|
||||
|
||||
<P><A HREF="help/api-cups.html">CUPS API</A></P>
|
||||
|
||||
<P><A HREF="help/api-filter.html">Szűrők és háttérprogramok
|
||||
programozása</A></P>
|
||||
|
||||
<P><A HREF="help/api-httpipp.html">HTTP és IPP API-k</A></P>
|
||||
|
||||
<P><A HREF="help/api-ppd.html">PPD API</A></P>
|
||||
|
||||
<P><A HREF="help/api-raster.html">Raszter API</A></P>
|
||||
|
||||
<P><A HREF="help/ref-ppdcfile.html">PPD fordító illesztőprogram-információs fájljának referenciája</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.development">Fejlesztői fórum</A></P>
|
||||
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
</TD></TR>
|
||||
<TR><TD> </TD></TR>
|
||||
<TR><TD CLASS="trailer">A CUPS és a CUPS logó az <A
|
||||
HREF="http://www.apple.com">Apple Inc.</A> védjegyei. CUPS copyright
|
||||
2007-2012 Apple Inc. Minden jog fenntartva.</TD></TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -50,7 +50,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
|
||||
<P><A HREF="help/options.html">Opsi dan Pencetakan dari Baris Perintah</A></P>
|
||||
|
||||
<P><A HREF="help/whatsnew.html">Apa yang Baru di CUPS 1.4</A></P>
|
||||
<P><A HREF="help/whatsnew.html">Apa yang Baru di CUPS 1.5</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Forum Pengguna</A></P>
|
||||
|
||||
@@ -100,7 +100,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
</TD></TR>
|
||||
<TR><TD> </TD></TR>
|
||||
<TR><TD CLASS="trailer">CUPS dan logo CUPS logo adalah merek dagang dari
|
||||
<A HREF="http://www.apple.com">Apple Inc.</A> Hak cipta CUPS pada 2007-2011 Apple
|
||||
<A HREF="http://www.apple.com">Apple Inc.</A> Hak cipta CUPS pada 2007-2012 Apple
|
||||
Inc. Semua hak terpelihara.</TD></TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
|
||||
+2
-2
@@ -50,7 +50,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
|
||||
<P><A HREF="help/options.html">Command-Line Printing and Options</A></P>
|
||||
|
||||
<P><A HREF="help/whatsnew.html">What's New in CUPS 1.4</A></P>
|
||||
<P><A HREF="help/whatsnew.html">What's New in CUPS 1.5</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">User Forum</A></P>
|
||||
|
||||
@@ -100,7 +100,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
</TD></TR>
|
||||
<TR><TD> </TD></TR>
|
||||
<TR><TD CLASS="trailer">CUPS and the CUPS logo are trademarks of
|
||||
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS is copyright 2007-2011 Apple
|
||||
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS is copyright 2007-2012 Apple
|
||||
Inc. All rights reserved.</TD></TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
|
||||
@@ -50,7 +50,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
|
||||
<P><A HREF="help/options.html">Stampa e opzioni da riga di comando</A></P>
|
||||
|
||||
<P><A HREF="help/whatsnew.html">Cosa c'è di nuovo in CUPS 1.4</A></P>
|
||||
<P><A HREF="help/whatsnew.html">Cosa c'è di nuovo in CUPS 1.5</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Forum degli utenti</A></P>
|
||||
|
||||
@@ -100,7 +100,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
</TD></TR>
|
||||
<TR><TD> </TD></TR>
|
||||
<TR><TD CLASS="trailer">CUPS e il logo CUPS sono marchi di
|
||||
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS è un copyright 2007-2011 di Apple
|
||||
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS è un copyright 2007-2012 di Apple
|
||||
Inc. Tutti i diritti sono riservati.</TD></TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
|
||||
@@ -50,7 +50,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
|
||||
<P><A HREF="help/options.html">コマンドラインからの印刷とオプション</A></P>
|
||||
|
||||
<P><A HREF="help/whatsnew.html">CUPS 1.4 の新機能</A></P>
|
||||
<P><A HREF="help/whatsnew.html">CUPS 1.5 の新機能</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">ユーザーフォーラム</A></P>
|
||||
|
||||
@@ -100,7 +100,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
</TD></TR>
|
||||
<TR><TD> </TD></TR>
|
||||
<TR><TD CLASS="trailer">CUPS and the CUPS logo are trademarks of
|
||||
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS is copyright 2007-2011 Apple
|
||||
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS is copyright 2007-2012 Apple
|
||||
Inc. All rights reserved.</TD></TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
|
||||
@@ -50,7 +50,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
|
||||
<P><A HREF="help/options.html">Drukowanie i opcje w wierszu poleceń</A></P>
|
||||
|
||||
<P><A HREF="help/whatsnew.html">Co nowego w CUPS 1.4</A></P>
|
||||
<P><A HREF="help/whatsnew.html">Co nowego w CUPS 1.5</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Forum użytkowników</A></P>
|
||||
|
||||
@@ -101,7 +101,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
<TR><TD> </TD></TR>
|
||||
<TR><TD CLASS="trailer">CUPS i logo CUPS
|
||||
są znakami handlowymi <A HREF="http://www.apple.com">Apple Inc.</A> CUPS
|
||||
copyright 2007-2011 Apple Inc. Wszystkie prawa zastrzeżone.</TD></TR>
|
||||
copyright 2007-2012 Apple Inc. Wszystkie prawa zastrzeżone.</TD></TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
@@ -48,7 +48,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
|
||||
<P><A HREF="help/options.html">Печать из командной строки</A></P>
|
||||
|
||||
<P><A HREF="help/whatsnew.html">Что нового в CUPS 1.4</A></P>
|
||||
<P><A HREF="help/whatsnew.html">Что нового в CUPS 1.5</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Форум пользователей</A></P>
|
||||
|
||||
@@ -97,7 +97,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
|
||||
</TD></TR>
|
||||
<TR><TD> </TD></TR>
|
||||
<TR><TD CLASS="trailer">CUPS а также логотип CUPS являются зарегистрированными торговыми марками <A HREF="http://www.apple.com">Apple Inc.</A> Авторские права на CUPS принадлежат (2007-2011) компании Apple Inc. Все права защищены.</TD></TR>
|
||||
<TR><TD CLASS="trailer">CUPS а также логотип CUPS являются зарегистрированными торговыми марками <A HREF="http://www.apple.com">Apple Inc.</A> Авторские права на CUPS принадлежат (2007-2012) компании Apple Inc. Все права защищены.</TD></TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
@@ -3,20 +3,20 @@
|
||||
commandtoescpx.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
|
||||
commandtoescpx.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
commandtoescpx.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
|
||||
commandtoescpx.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
|
||||
commandtoescpx.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
|
||||
commandtoescpx.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
|
||||
commandtoescpx.o: ../cups/ipp-private.h ../cups/ipp.h
|
||||
commandtoescpx.o: ../config.h ../cups/debug-private.h ../cups/versioning.h
|
||||
commandtoescpx.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
|
||||
commandtoescpx.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
|
||||
commandtoescpx.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
|
||||
commandtoescpx.o: ../cups/language-private.h ../cups/transcode.h
|
||||
commandtoescpx.o: ../cups/thread-private.h driver.h ../cups/raster.h
|
||||
commandtoescpx.o: ../cups/ppd.h ../data/escp.h
|
||||
commandtopclx.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
|
||||
commandtopclx.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
commandtopclx.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
|
||||
commandtopclx.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
|
||||
commandtopclx.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
|
||||
commandtopclx.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
|
||||
commandtopclx.o: ../cups/ipp-private.h ../cups/ipp.h
|
||||
commandtopclx.o: ../config.h ../cups/debug-private.h ../cups/versioning.h
|
||||
commandtopclx.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
|
||||
commandtopclx.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
|
||||
commandtopclx.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
|
||||
commandtopclx.o: ../cups/language-private.h ../cups/transcode.h
|
||||
commandtopclx.o: ../cups/thread-private.h driver.h ../cups/raster.h
|
||||
commandtopclx.o: ../cups/ppd.h ../data/pcl.h
|
||||
|
||||
+9
-9
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Test the CMYK color separation code for CUPS.
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1993-2006 by Easy Software Products, All Rights Reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -28,8 +28,8 @@
|
||||
#include <sys/stat.h>
|
||||
|
||||
|
||||
void test_gray(int num_comps, const char *basename);
|
||||
void test_rgb(int num_comps, const char *basename);
|
||||
void test_gray(int num_comps, const char *base);
|
||||
void test_rgb(int num_comps, const char *base);
|
||||
|
||||
|
||||
/*
|
||||
@@ -78,7 +78,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
void
|
||||
test_gray(int num_comps, /* I - Number of components */
|
||||
const char *basename) /* I - Base filename of output */
|
||||
const char *base) /* I - Base filename of output */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
char filename[255]; /* Output filename */
|
||||
@@ -147,13 +147,13 @@ test_gray(int num_comps, /* I - Number of components */
|
||||
|
||||
for (i = 0; i < num_comps; i ++)
|
||||
{
|
||||
sprintf(filename, "%s%d.pgm", basename, i);
|
||||
sprintf(filename, "%s%d.pgm", base, i);
|
||||
out[i] = fopen(filename, "wb");
|
||||
|
||||
fprintf(out[i], "P5\n%d %d 255\n", width, height);
|
||||
}
|
||||
|
||||
sprintf(filename, "%s.ppm", basename);
|
||||
sprintf(filename, "%s.ppm", base);
|
||||
comp = fopen(filename, "wb");
|
||||
|
||||
fprintf(comp, "P6\n%d %d 255\n", width, height);
|
||||
@@ -260,7 +260,7 @@ test_gray(int num_comps, /* I - Number of components */
|
||||
|
||||
void
|
||||
test_rgb(int num_comps, /* I - Number of components */
|
||||
const char *basename) /* I - Base filename of output */
|
||||
const char *base) /* I - Base filename of output */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
char filename[255]; /* Output filename */
|
||||
@@ -325,13 +325,13 @@ test_rgb(int num_comps, /* I - Number of components */
|
||||
|
||||
for (i = 0; i < num_comps; i ++)
|
||||
{
|
||||
sprintf(filename, "%s%d.pgm", basename, i);
|
||||
sprintf(filename, "%s%d.pgm", base, i);
|
||||
out[i] = fopen(filename, "wb");
|
||||
|
||||
fprintf(out[i], "P5\n%d %d 255\n", width, height);
|
||||
}
|
||||
|
||||
sprintf(filename, "%s.ppm", basename);
|
||||
sprintf(filename, "%s.ppm", base);
|
||||
comp = fopen(filename, "wb");
|
||||
|
||||
fprintf(comp, "P6\n%d %d 255\n", width, height);
|
||||
|
||||
+9
-10
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Test the new RGB color separation code for CUPS.
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1993-2006 by Easy Software Products, All Rights Reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -33,10 +33,9 @@
|
||||
|
||||
|
||||
void test_gray(cups_sample_t *samples, int num_samples,
|
||||
int cube_size, int num_comps, const char *basename);
|
||||
int cube_size, int num_comps, const char *base);
|
||||
void test_rgb(cups_sample_t *samples, int num_samples,
|
||||
int cube_size, int num_comps,
|
||||
const char *basename);
|
||||
int cube_size, int num_comps, const char *base);
|
||||
|
||||
|
||||
/*
|
||||
@@ -92,7 +91,7 @@ test_gray(cups_sample_t *samples, /* I - Sample values */
|
||||
int num_samples, /* I - Number of samples */
|
||||
int cube_size, /* I - Cube size */
|
||||
int num_comps, /* I - Number of components */
|
||||
const char *basename) /* I - Base filename of output */
|
||||
const char *base) /* I - Base filename of output */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
char filename[255]; /* Output filename */
|
||||
@@ -135,13 +134,13 @@ test_gray(cups_sample_t *samples, /* I - Sample values */
|
||||
|
||||
for (i = 0; i < num_comps; i ++)
|
||||
{
|
||||
sprintf(filename, "%s%d.pgm", basename, i);
|
||||
sprintf(filename, "%s%d.pgm", base, i);
|
||||
out[i] = fopen(filename, "wb");
|
||||
|
||||
fprintf(out[i], "P5\n%d %d 255\n", width, height);
|
||||
}
|
||||
|
||||
sprintf(filename, "%s.ppm", basename);
|
||||
sprintf(filename, "%s.ppm", base);
|
||||
comp = fopen(filename, "wb");
|
||||
|
||||
fprintf(comp, "P6\n%d %d 255\n", width, height);
|
||||
@@ -222,7 +221,7 @@ test_rgb(cups_sample_t *samples, /* I - Sample values */
|
||||
int num_samples, /* I - Number of samples */
|
||||
int cube_size, /* I - Cube size */
|
||||
int num_comps, /* I - Number of components */
|
||||
const char *basename) /* I - Base filename of output */
|
||||
const char *base) /* I - Base filename of output */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
char filename[255]; /* Output filename */
|
||||
@@ -265,13 +264,13 @@ test_rgb(cups_sample_t *samples, /* I - Sample values */
|
||||
|
||||
for (i = 0; i < num_comps; i ++)
|
||||
{
|
||||
sprintf(filename, "%s%d.pgm", basename, i);
|
||||
sprintf(filename, "%s%d.pgm", base, i);
|
||||
out[i] = fopen(filename, "wb");
|
||||
|
||||
fprintf(out[i], "P5\n%d %d 255\n", width, height);
|
||||
}
|
||||
|
||||
sprintf(filename, "%s.ppm", basename);
|
||||
sprintf(filename, "%s.ppm", base);
|
||||
comp = fopen(filename, "wb");
|
||||
|
||||
fprintf(comp, "P6\n%d %d 255\n", width, height);
|
||||
|
||||
+174
-129
@@ -3,96 +3,106 @@
|
||||
image-bmp.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-bmp.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
image-bmp.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
image-bmp.o: ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
image-bmp.o: ../cups/debug-private.h ../cups/versioning.h
|
||||
image-bmp.o: ../cups/string-private.h ../config.h
|
||||
image-colorspace.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-colorspace.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
image-colorspace.o: ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
image-colorspace.o: ../cups/ppd.h ../cups/cups.h ../cups/debug-private.h
|
||||
image-colorspace.o: ../cups/string-private.h ../config.h
|
||||
image-colorspace.o: ../cups/versioning.h ../cups/string-private.h ../config.h
|
||||
image-gif.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-gif.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
image-gif.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
image-gif.o: ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
image-gif.o: ../cups/debug-private.h ../cups/versioning.h
|
||||
image-gif.o: ../cups/string-private.h ../config.h
|
||||
image-jpeg.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-jpeg.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
image-jpeg.o: ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h
|
||||
image-jpeg.o: ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h
|
||||
image-jpeg.o: ../config.h
|
||||
image-jpeg.o: ../cups/cups.h ../cups/debug-private.h ../cups/versioning.h
|
||||
image-jpeg.o: ../cups/string-private.h ../config.h
|
||||
image-photocd.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-photocd.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
image-photocd.o: ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
image-photocd.o: ../cups/ppd.h ../cups/cups.h ../cups/debug-private.h
|
||||
image-photocd.o: ../cups/string-private.h ../config.h
|
||||
image-photocd.o: ../cups/versioning.h ../cups/string-private.h ../config.h
|
||||
image-pix.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-pix.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
image-pix.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
image-pix.o: ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
image-pix.o: ../cups/debug-private.h ../cups/versioning.h
|
||||
image-pix.o: ../cups/string-private.h ../config.h
|
||||
image-png.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-png.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
image-png.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
image-png.o: ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
image-png.o: ../cups/debug-private.h ../cups/versioning.h
|
||||
image-png.o: ../cups/string-private.h ../config.h
|
||||
image-pnm.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-pnm.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
image-pnm.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
image-pnm.o: ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
image-pnm.o: ../cups/debug-private.h ../cups/versioning.h
|
||||
image-pnm.o: ../cups/string-private.h ../config.h
|
||||
image-sgi.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-sgi.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
image-sgi.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
image-sgi.o: ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
image-sgi.o: image-sgi.h
|
||||
image-sgi.o: ../cups/debug-private.h ../cups/versioning.h
|
||||
image-sgi.o: ../cups/string-private.h ../config.h image-sgi.h
|
||||
image-sgilib.o: image-sgi.h
|
||||
image-sun.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-sun.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
image-sun.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
image-sun.o: ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
image-sun.o: ../cups/debug-private.h ../cups/versioning.h
|
||||
image-sun.o: ../cups/string-private.h ../config.h
|
||||
image-tiff.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-tiff.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
image-tiff.o: ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h
|
||||
image-tiff.o: ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h
|
||||
image-tiff.o: ../config.h
|
||||
image-tiff.o: ../cups/cups.h ../cups/debug-private.h ../cups/versioning.h
|
||||
image-tiff.o: ../cups/string-private.h ../config.h
|
||||
image-zoom.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-zoom.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
image-zoom.o: ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h
|
||||
image-zoom.o: ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h
|
||||
image-zoom.o: ../config.h
|
||||
image-zoom.o: ../cups/cups.h ../cups/debug-private.h ../cups/versioning.h
|
||||
image-zoom.o: ../cups/string-private.h ../config.h
|
||||
image.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
image.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
image.o: ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
image.o: ../cups/debug-private.h ../cups/versioning.h
|
||||
image.o: ../cups/string-private.h ../config.h
|
||||
error.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
error.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
error.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
error.o: ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
error.o: ../cups/debug-private.h ../cups/versioning.h
|
||||
error.o: ../cups/string-private.h ../config.h
|
||||
interpret.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
interpret.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
interpret.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
interpret.o: ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
interpret.o: ../cups/debug-private.h ../cups/versioning.h
|
||||
interpret.o: ../cups/string-private.h ../config.h
|
||||
raster.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
raster.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
raster.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
raster.o: ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
raster.o: ../cups/debug-private.h ../cups/versioning.h
|
||||
raster.o: ../cups/string-private.h ../config.h
|
||||
bannertops.o: pstext.h common.h ../cups/string-private.h ../config.h
|
||||
bannertops.o: ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
|
||||
bannertops.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
bannertops.o: ../cups/array.h ../cups/language.h ../cups/transcode.h image.h
|
||||
bannertops.o: ../cups/raster.h ../cups/ppd.h ../cups/language-private.h
|
||||
commandtops.o: ../cups/cups-private.h ../cups/cups.h ../cups/string-private.h
|
||||
commandtops.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
|
||||
commandtops.o: ../cups/ppd.h ../cups/cups.h ../cups/file.h
|
||||
commandtops.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
commandtops.o: ../cups/array.h ../cups/language.h ../cups/pwg-private.h
|
||||
commandtops.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
|
||||
commandtops.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
|
||||
commandtops.o: ../cups/transcode.h ../cups/thread-private.h
|
||||
commandtops.o: ../cups/sidechannel.h
|
||||
commandtops.o: ../config.h ../cups/debug-private.h ../cups/versioning.h
|
||||
commandtops.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
|
||||
commandtops.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
commandtops.o: ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
commandtops.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
|
||||
commandtops.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
|
||||
commandtops.o: ../cups/language-private.h ../cups/transcode.h
|
||||
commandtops.o: ../cups/thread-private.h ../cups/sidechannel.h
|
||||
gziptoany.o: ../cups/cups-private.h ../cups/cups.h ../cups/string-private.h
|
||||
gziptoany.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
|
||||
gziptoany.o: ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
|
||||
gziptoany.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
gziptoany.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
|
||||
gziptoany.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
|
||||
gziptoany.o: ../cups/language-private.h ../cups/transcode.h
|
||||
gziptoany.o: ../cups/thread-private.h
|
||||
gziptoany.o: ../config.h ../cups/debug-private.h ../cups/versioning.h
|
||||
gziptoany.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
|
||||
gziptoany.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
gziptoany.o: ../cups/array.h ../cups/language.h ../cups/pwg-private.h
|
||||
gziptoany.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
|
||||
gziptoany.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
|
||||
gziptoany.o: ../cups/transcode.h ../cups/thread-private.h
|
||||
imagetops.o: common.h ../cups/string-private.h ../config.h ../cups/cups.h
|
||||
imagetops.o: ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
|
||||
imagetops.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
@@ -103,7 +113,8 @@ imagetoraster.o: ../cups/ppd.h ../cups/cups.h ../cups/file.h
|
||||
imagetoraster.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
imagetoraster.o: ../cups/array.h ../cups/language.h image-private.h image.h
|
||||
imagetoraster.o: ../cups/raster.h ../cups/ppd.h ../cups/debug-private.h
|
||||
imagetoraster.o: ../cups/language-private.h ../cups/transcode.h
|
||||
imagetoraster.o: ../cups/versioning.h ../cups/language-private.h
|
||||
imagetoraster.o: ../cups/transcode.h
|
||||
common.o: common.h ../cups/string-private.h ../config.h ../cups/cups.h
|
||||
common.o: ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
|
||||
common.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
@@ -138,19 +149,23 @@ rastertolabel.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
rastertolabel.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
|
||||
rastertolabel.o: ../config.h ../cups/language-private.h ../cups/transcode.h
|
||||
rastertolabel.o: ../cups/raster.h ../cups/ppd.h
|
||||
rastertopwg.o: ../cups/cups.h ../cups/language-private.h ../cups/transcode.h
|
||||
rastertopwg.o: ../cups/language.h ../cups/array.h ../cups/versioning.h
|
||||
rastertopwg.o: ../cups/raster.h ../cups/cups.h ../cups/file.h ../cups/ipp.h
|
||||
rastertopwg.o: ../cups/http.h ../cups/ppd.h ../cups/string-private.h
|
||||
rastertopwg.o: ../config.h
|
||||
rastertopwg.o: ../cups/cups-private.h ../cups/cups.h ../cups/string-private.h
|
||||
rastertopwg.o: ../config.h ../cups/debug-private.h ../cups/versioning.h
|
||||
rastertopwg.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
|
||||
rastertopwg.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
rastertopwg.o: ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
rastertopwg.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
|
||||
rastertopwg.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
|
||||
rastertopwg.o: ../cups/language-private.h ../cups/transcode.h
|
||||
rastertopwg.o: ../cups/thread-private.h ../cups/raster.h ../cups/ppd.h
|
||||
testimage.o: image.h ../cups/raster.h ../cups/cups.h ../cups/file.h
|
||||
testimage.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
testimage.o: ../cups/array.h ../cups/language.h ../cups/ppd.h
|
||||
testraster.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
testraster.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
testraster.o: ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h
|
||||
testraster.o: ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h
|
||||
testraster.o: ../config.h
|
||||
testraster.o: ../cups/cups.h ../cups/debug-private.h ../cups/versioning.h
|
||||
testraster.o: ../cups/string-private.h ../config.h
|
||||
textcommon.o: textcommon.h common.h ../cups/string-private.h ../config.h
|
||||
textcommon.o: ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
|
||||
textcommon.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
@@ -165,96 +180,106 @@ texttops.o: ../cups/language.h ../cups/language-private.h ../cups/transcode.h
|
||||
image-bmp.32.o: image-bmp.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-bmp.32.o: image-bmp.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
image-bmp.32.o: image-bmp.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
image-bmp.32.o: image-bmp.c ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
image-bmp.32.o: image-bmp.c ../cups/debug-private.h ../cups/versioning.h
|
||||
image-bmp.32.o: image-bmp.c ../cups/string-private.h ../config.h
|
||||
image-colorspace.32.o: image-colorspace.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-colorspace.32.o: image-colorspace.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
image-colorspace.32.o: image-colorspace.c ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
image-colorspace.32.o: image-colorspace.c ../cups/ppd.h ../cups/cups.h ../cups/debug-private.h
|
||||
image-colorspace.32.o: image-colorspace.c ../cups/string-private.h ../config.h
|
||||
image-colorspace.32.o: image-colorspace.c ../cups/versioning.h ../cups/string-private.h ../config.h
|
||||
image-gif.32.o: image-gif.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-gif.32.o: image-gif.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
image-gif.32.o: image-gif.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
image-gif.32.o: image-gif.c ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
image-gif.32.o: image-gif.c ../cups/debug-private.h ../cups/versioning.h
|
||||
image-gif.32.o: image-gif.c ../cups/string-private.h ../config.h
|
||||
image-jpeg.32.o: image-jpeg.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-jpeg.32.o: image-jpeg.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
image-jpeg.32.o: image-jpeg.c ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h
|
||||
image-jpeg.32.o: image-jpeg.c ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h
|
||||
image-jpeg.32.o: image-jpeg.c ../config.h
|
||||
image-jpeg.32.o: image-jpeg.c ../cups/cups.h ../cups/debug-private.h ../cups/versioning.h
|
||||
image-jpeg.32.o: image-jpeg.c ../cups/string-private.h ../config.h
|
||||
image-photocd.32.o: image-photocd.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-photocd.32.o: image-photocd.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
image-photocd.32.o: image-photocd.c ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
image-photocd.32.o: image-photocd.c ../cups/ppd.h ../cups/cups.h ../cups/debug-private.h
|
||||
image-photocd.32.o: image-photocd.c ../cups/string-private.h ../config.h
|
||||
image-photocd.32.o: image-photocd.c ../cups/versioning.h ../cups/string-private.h ../config.h
|
||||
image-pix.32.o: image-pix.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-pix.32.o: image-pix.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
image-pix.32.o: image-pix.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
image-pix.32.o: image-pix.c ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
image-pix.32.o: image-pix.c ../cups/debug-private.h ../cups/versioning.h
|
||||
image-pix.32.o: image-pix.c ../cups/string-private.h ../config.h
|
||||
image-png.32.o: image-png.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-png.32.o: image-png.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
image-png.32.o: image-png.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
image-png.32.o: image-png.c ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
image-png.32.o: image-png.c ../cups/debug-private.h ../cups/versioning.h
|
||||
image-png.32.o: image-png.c ../cups/string-private.h ../config.h
|
||||
image-pnm.32.o: image-pnm.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-pnm.32.o: image-pnm.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
image-pnm.32.o: image-pnm.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
image-pnm.32.o: image-pnm.c ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
image-pnm.32.o: image-pnm.c ../cups/debug-private.h ../cups/versioning.h
|
||||
image-pnm.32.o: image-pnm.c ../cups/string-private.h ../config.h
|
||||
image-sgi.32.o: image-sgi.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-sgi.32.o: image-sgi.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
image-sgi.32.o: image-sgi.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
image-sgi.32.o: image-sgi.c ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
image-sgi.32.o: image-sgi.c image-sgi.h
|
||||
image-sgi.32.o: image-sgi.c ../cups/debug-private.h ../cups/versioning.h
|
||||
image-sgi.32.o: image-sgi.c ../cups/string-private.h ../config.h image-sgi.h
|
||||
image-sgilib.32.o: image-sgilib.c image-sgi.h
|
||||
image-sun.32.o: image-sun.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-sun.32.o: image-sun.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
image-sun.32.o: image-sun.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
image-sun.32.o: image-sun.c ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
image-sun.32.o: image-sun.c ../cups/debug-private.h ../cups/versioning.h
|
||||
image-sun.32.o: image-sun.c ../cups/string-private.h ../config.h
|
||||
image-tiff.32.o: image-tiff.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-tiff.32.o: image-tiff.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
image-tiff.32.o: image-tiff.c ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h
|
||||
image-tiff.32.o: image-tiff.c ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h
|
||||
image-tiff.32.o: image-tiff.c ../config.h
|
||||
image-tiff.32.o: image-tiff.c ../cups/cups.h ../cups/debug-private.h ../cups/versioning.h
|
||||
image-tiff.32.o: image-tiff.c ../cups/string-private.h ../config.h
|
||||
image-zoom.32.o: image-zoom.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-zoom.32.o: image-zoom.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
image-zoom.32.o: image-zoom.c ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h
|
||||
image-zoom.32.o: image-zoom.c ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h
|
||||
image-zoom.32.o: image-zoom.c ../config.h
|
||||
image-zoom.32.o: image-zoom.c ../cups/cups.h ../cups/debug-private.h ../cups/versioning.h
|
||||
image-zoom.32.o: image-zoom.c ../cups/string-private.h ../config.h
|
||||
image.32.o: image.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image.32.o: image.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
image.32.o: image.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
image.32.o: image.c ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
image.32.o: image.c ../cups/debug-private.h ../cups/versioning.h
|
||||
image.32.o: image.c ../cups/string-private.h ../config.h
|
||||
error.32.o: error.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
error.32.o: error.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
error.32.o: error.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
error.32.o: error.c ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
error.32.o: error.c ../cups/debug-private.h ../cups/versioning.h
|
||||
error.32.o: error.c ../cups/string-private.h ../config.h
|
||||
interpret.32.o: interpret.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
interpret.32.o: interpret.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
interpret.32.o: interpret.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
interpret.32.o: interpret.c ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
interpret.32.o: interpret.c ../cups/debug-private.h ../cups/versioning.h
|
||||
interpret.32.o: interpret.c ../cups/string-private.h ../config.h
|
||||
raster.32.o: raster.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
raster.32.o: raster.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
raster.32.o: raster.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
raster.32.o: raster.c ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
raster.32.o: raster.c ../cups/debug-private.h ../cups/versioning.h
|
||||
raster.32.o: raster.c ../cups/string-private.h ../config.h
|
||||
bannertops.32.o: bannertops.c pstext.h common.h ../cups/string-private.h ../config.h
|
||||
bannertops.32.o: bannertops.c ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
|
||||
bannertops.32.o: bannertops.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
bannertops.32.o: bannertops.c ../cups/array.h ../cups/language.h ../cups/transcode.h image.h
|
||||
bannertops.32.o: bannertops.c ../cups/raster.h ../cups/ppd.h ../cups/language-private.h
|
||||
commandtops.32.o: commandtops.c ../cups/cups-private.h ../cups/cups.h ../cups/string-private.h
|
||||
commandtops.32.o: commandtops.c ../config.h ../cups/debug-private.h ../cups/ppd-private.h
|
||||
commandtops.32.o: commandtops.c ../cups/ppd.h ../cups/cups.h ../cups/file.h
|
||||
commandtops.32.o: commandtops.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
commandtops.32.o: commandtops.c ../cups/array.h ../cups/language.h ../cups/pwg-private.h
|
||||
commandtops.32.o: commandtops.c ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
|
||||
commandtops.32.o: commandtops.c ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
|
||||
commandtops.32.o: commandtops.c ../cups/transcode.h ../cups/thread-private.h
|
||||
commandtops.32.o: commandtops.c ../cups/sidechannel.h
|
||||
commandtops.32.o: commandtops.c ../config.h ../cups/debug-private.h ../cups/versioning.h
|
||||
commandtops.32.o: commandtops.c ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
|
||||
commandtops.32.o: commandtops.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
commandtops.32.o: commandtops.c ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
commandtops.32.o: commandtops.c ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
|
||||
commandtops.32.o: commandtops.c ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
|
||||
commandtops.32.o: commandtops.c ../cups/language-private.h ../cups/transcode.h
|
||||
commandtops.32.o: commandtops.c ../cups/thread-private.h ../cups/sidechannel.h
|
||||
gziptoany.32.o: gziptoany.c ../cups/cups-private.h ../cups/cups.h ../cups/string-private.h
|
||||
gziptoany.32.o: gziptoany.c ../config.h ../cups/debug-private.h ../cups/ppd-private.h
|
||||
gziptoany.32.o: gziptoany.c ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
|
||||
gziptoany.32.o: gziptoany.c ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
gziptoany.32.o: gziptoany.c ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
|
||||
gziptoany.32.o: gziptoany.c ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
|
||||
gziptoany.32.o: gziptoany.c ../cups/language-private.h ../cups/transcode.h
|
||||
gziptoany.32.o: gziptoany.c ../cups/thread-private.h
|
||||
gziptoany.32.o: gziptoany.c ../config.h ../cups/debug-private.h ../cups/versioning.h
|
||||
gziptoany.32.o: gziptoany.c ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
|
||||
gziptoany.32.o: gziptoany.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
gziptoany.32.o: gziptoany.c ../cups/array.h ../cups/language.h ../cups/pwg-private.h
|
||||
gziptoany.32.o: gziptoany.c ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
|
||||
gziptoany.32.o: gziptoany.c ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
|
||||
gziptoany.32.o: gziptoany.c ../cups/transcode.h ../cups/thread-private.h
|
||||
imagetops.32.o: imagetops.c common.h ../cups/string-private.h ../config.h ../cups/cups.h
|
||||
imagetops.32.o: imagetops.c ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
|
||||
imagetops.32.o: imagetops.c ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
@@ -265,7 +290,8 @@ imagetoraster.32.o: imagetoraster.c ../cups/ppd.h ../cups/cups.h ../cups/file.h
|
||||
imagetoraster.32.o: imagetoraster.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
imagetoraster.32.o: imagetoraster.c ../cups/array.h ../cups/language.h image-private.h image.h
|
||||
imagetoraster.32.o: imagetoraster.c ../cups/raster.h ../cups/ppd.h ../cups/debug-private.h
|
||||
imagetoraster.32.o: imagetoraster.c ../cups/language-private.h ../cups/transcode.h
|
||||
imagetoraster.32.o: imagetoraster.c ../cups/versioning.h ../cups/language-private.h
|
||||
imagetoraster.32.o: imagetoraster.c ../cups/transcode.h
|
||||
common.32.o: common.c common.h ../cups/string-private.h ../config.h ../cups/cups.h
|
||||
common.32.o: common.c ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
|
||||
common.32.o: common.c ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
@@ -300,19 +326,23 @@ rastertolabel.32.o: rastertolabel.c ../cups/versioning.h ../cups/ipp.h ../cups/
|
||||
rastertolabel.32.o: rastertolabel.c ../cups/array.h ../cups/language.h ../cups/string-private.h
|
||||
rastertolabel.32.o: rastertolabel.c ../config.h ../cups/language-private.h ../cups/transcode.h
|
||||
rastertolabel.32.o: rastertolabel.c ../cups/raster.h ../cups/ppd.h
|
||||
rastertopwg.32.o: rastertopwg.c ../cups/cups.h ../cups/language-private.h ../cups/transcode.h
|
||||
rastertopwg.32.o: rastertopwg.c ../cups/language.h ../cups/array.h ../cups/versioning.h
|
||||
rastertopwg.32.o: rastertopwg.c ../cups/raster.h ../cups/cups.h ../cups/file.h ../cups/ipp.h
|
||||
rastertopwg.32.o: rastertopwg.c ../cups/http.h ../cups/ppd.h ../cups/string-private.h
|
||||
rastertopwg.32.o: rastertopwg.c ../config.h
|
||||
rastertopwg.32.o: rastertopwg.c ../cups/cups-private.h ../cups/cups.h ../cups/string-private.h
|
||||
rastertopwg.32.o: rastertopwg.c ../config.h ../cups/debug-private.h ../cups/versioning.h
|
||||
rastertopwg.32.o: rastertopwg.c ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
|
||||
rastertopwg.32.o: rastertopwg.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
rastertopwg.32.o: rastertopwg.c ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
rastertopwg.32.o: rastertopwg.c ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
|
||||
rastertopwg.32.o: rastertopwg.c ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
|
||||
rastertopwg.32.o: rastertopwg.c ../cups/language-private.h ../cups/transcode.h
|
||||
rastertopwg.32.o: rastertopwg.c ../cups/thread-private.h ../cups/raster.h ../cups/ppd.h
|
||||
testimage.32.o: testimage.c image.h ../cups/raster.h ../cups/cups.h ../cups/file.h
|
||||
testimage.32.o: testimage.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
testimage.32.o: testimage.c ../cups/array.h ../cups/language.h ../cups/ppd.h
|
||||
testraster.32.o: testraster.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
testraster.32.o: testraster.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
testraster.32.o: testraster.c ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h
|
||||
testraster.32.o: testraster.c ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h
|
||||
testraster.32.o: testraster.c ../config.h
|
||||
testraster.32.o: testraster.c ../cups/cups.h ../cups/debug-private.h ../cups/versioning.h
|
||||
testraster.32.o: testraster.c ../cups/string-private.h ../config.h
|
||||
textcommon.32.o: textcommon.c textcommon.h common.h ../cups/string-private.h ../config.h
|
||||
textcommon.32.o: textcommon.c ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
|
||||
textcommon.32.o: textcommon.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
@@ -327,96 +357,106 @@ texttops.32.o: texttops.c ../cups/language.h ../cups/language-private.h ../cups
|
||||
image-bmp.64.o: image-bmp.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-bmp.64.o: image-bmp.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
image-bmp.64.o: image-bmp.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
image-bmp.64.o: image-bmp.c ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
image-bmp.64.o: image-bmp.c ../cups/debug-private.h ../cups/versioning.h
|
||||
image-bmp.64.o: image-bmp.c ../cups/string-private.h ../config.h
|
||||
image-colorspace.64.o: image-colorspace.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-colorspace.64.o: image-colorspace.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
image-colorspace.64.o: image-colorspace.c ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
image-colorspace.64.o: image-colorspace.c ../cups/ppd.h ../cups/cups.h ../cups/debug-private.h
|
||||
image-colorspace.64.o: image-colorspace.c ../cups/string-private.h ../config.h
|
||||
image-colorspace.64.o: image-colorspace.c ../cups/versioning.h ../cups/string-private.h ../config.h
|
||||
image-gif.64.o: image-gif.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-gif.64.o: image-gif.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
image-gif.64.o: image-gif.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
image-gif.64.o: image-gif.c ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
image-gif.64.o: image-gif.c ../cups/debug-private.h ../cups/versioning.h
|
||||
image-gif.64.o: image-gif.c ../cups/string-private.h ../config.h
|
||||
image-jpeg.64.o: image-jpeg.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-jpeg.64.o: image-jpeg.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
image-jpeg.64.o: image-jpeg.c ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h
|
||||
image-jpeg.64.o: image-jpeg.c ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h
|
||||
image-jpeg.64.o: image-jpeg.c ../config.h
|
||||
image-jpeg.64.o: image-jpeg.c ../cups/cups.h ../cups/debug-private.h ../cups/versioning.h
|
||||
image-jpeg.64.o: image-jpeg.c ../cups/string-private.h ../config.h
|
||||
image-photocd.64.o: image-photocd.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-photocd.64.o: image-photocd.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
image-photocd.64.o: image-photocd.c ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
image-photocd.64.o: image-photocd.c ../cups/ppd.h ../cups/cups.h ../cups/debug-private.h
|
||||
image-photocd.64.o: image-photocd.c ../cups/string-private.h ../config.h
|
||||
image-photocd.64.o: image-photocd.c ../cups/versioning.h ../cups/string-private.h ../config.h
|
||||
image-pix.64.o: image-pix.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-pix.64.o: image-pix.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
image-pix.64.o: image-pix.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
image-pix.64.o: image-pix.c ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
image-pix.64.o: image-pix.c ../cups/debug-private.h ../cups/versioning.h
|
||||
image-pix.64.o: image-pix.c ../cups/string-private.h ../config.h
|
||||
image-png.64.o: image-png.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-png.64.o: image-png.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
image-png.64.o: image-png.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
image-png.64.o: image-png.c ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
image-png.64.o: image-png.c ../cups/debug-private.h ../cups/versioning.h
|
||||
image-png.64.o: image-png.c ../cups/string-private.h ../config.h
|
||||
image-pnm.64.o: image-pnm.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-pnm.64.o: image-pnm.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
image-pnm.64.o: image-pnm.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
image-pnm.64.o: image-pnm.c ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
image-pnm.64.o: image-pnm.c ../cups/debug-private.h ../cups/versioning.h
|
||||
image-pnm.64.o: image-pnm.c ../cups/string-private.h ../config.h
|
||||
image-sgi.64.o: image-sgi.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-sgi.64.o: image-sgi.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
image-sgi.64.o: image-sgi.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
image-sgi.64.o: image-sgi.c ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
image-sgi.64.o: image-sgi.c image-sgi.h
|
||||
image-sgi.64.o: image-sgi.c ../cups/debug-private.h ../cups/versioning.h
|
||||
image-sgi.64.o: image-sgi.c ../cups/string-private.h ../config.h image-sgi.h
|
||||
image-sgilib.64.o: image-sgilib.c image-sgi.h
|
||||
image-sun.64.o: image-sun.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-sun.64.o: image-sun.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
image-sun.64.o: image-sun.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
image-sun.64.o: image-sun.c ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
image-sun.64.o: image-sun.c ../cups/debug-private.h ../cups/versioning.h
|
||||
image-sun.64.o: image-sun.c ../cups/string-private.h ../config.h
|
||||
image-tiff.64.o: image-tiff.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-tiff.64.o: image-tiff.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
image-tiff.64.o: image-tiff.c ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h
|
||||
image-tiff.64.o: image-tiff.c ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h
|
||||
image-tiff.64.o: image-tiff.c ../config.h
|
||||
image-tiff.64.o: image-tiff.c ../cups/cups.h ../cups/debug-private.h ../cups/versioning.h
|
||||
image-tiff.64.o: image-tiff.c ../cups/string-private.h ../config.h
|
||||
image-zoom.64.o: image-zoom.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image-zoom.64.o: image-zoom.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
image-zoom.64.o: image-zoom.c ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h
|
||||
image-zoom.64.o: image-zoom.c ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h
|
||||
image-zoom.64.o: image-zoom.c ../config.h
|
||||
image-zoom.64.o: image-zoom.c ../cups/cups.h ../cups/debug-private.h ../cups/versioning.h
|
||||
image-zoom.64.o: image-zoom.c ../cups/string-private.h ../config.h
|
||||
image.64.o: image.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
image.64.o: image.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
image.64.o: image.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
image.64.o: image.c ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
image.64.o: image.c ../cups/debug-private.h ../cups/versioning.h
|
||||
image.64.o: image.c ../cups/string-private.h ../config.h
|
||||
error.64.o: error.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
error.64.o: error.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
error.64.o: error.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
error.64.o: error.c ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
error.64.o: error.c ../cups/debug-private.h ../cups/versioning.h
|
||||
error.64.o: error.c ../cups/string-private.h ../config.h
|
||||
interpret.64.o: interpret.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
interpret.64.o: interpret.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
interpret.64.o: interpret.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
interpret.64.o: interpret.c ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
interpret.64.o: interpret.c ../cups/debug-private.h ../cups/versioning.h
|
||||
interpret.64.o: interpret.c ../cups/string-private.h ../config.h
|
||||
raster.64.o: raster.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
raster.64.o: raster.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
raster.64.o: raster.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
|
||||
raster.64.o: raster.c ../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
raster.64.o: raster.c ../cups/debug-private.h ../cups/versioning.h
|
||||
raster.64.o: raster.c ../cups/string-private.h ../config.h
|
||||
bannertops.64.o: bannertops.c pstext.h common.h ../cups/string-private.h ../config.h
|
||||
bannertops.64.o: bannertops.c ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
|
||||
bannertops.64.o: bannertops.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
bannertops.64.o: bannertops.c ../cups/array.h ../cups/language.h ../cups/transcode.h image.h
|
||||
bannertops.64.o: bannertops.c ../cups/raster.h ../cups/ppd.h ../cups/language-private.h
|
||||
commandtops.64.o: commandtops.c ../cups/cups-private.h ../cups/cups.h ../cups/string-private.h
|
||||
commandtops.64.o: commandtops.c ../config.h ../cups/debug-private.h ../cups/ppd-private.h
|
||||
commandtops.64.o: commandtops.c ../cups/ppd.h ../cups/cups.h ../cups/file.h
|
||||
commandtops.64.o: commandtops.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
commandtops.64.o: commandtops.c ../cups/array.h ../cups/language.h ../cups/pwg-private.h
|
||||
commandtops.64.o: commandtops.c ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
|
||||
commandtops.64.o: commandtops.c ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
|
||||
commandtops.64.o: commandtops.c ../cups/transcode.h ../cups/thread-private.h
|
||||
commandtops.64.o: commandtops.c ../cups/sidechannel.h
|
||||
commandtops.64.o: commandtops.c ../config.h ../cups/debug-private.h ../cups/versioning.h
|
||||
commandtops.64.o: commandtops.c ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
|
||||
commandtops.64.o: commandtops.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
commandtops.64.o: commandtops.c ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
commandtops.64.o: commandtops.c ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
|
||||
commandtops.64.o: commandtops.c ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
|
||||
commandtops.64.o: commandtops.c ../cups/language-private.h ../cups/transcode.h
|
||||
commandtops.64.o: commandtops.c ../cups/thread-private.h ../cups/sidechannel.h
|
||||
gziptoany.64.o: gziptoany.c ../cups/cups-private.h ../cups/cups.h ../cups/string-private.h
|
||||
gziptoany.64.o: gziptoany.c ../config.h ../cups/debug-private.h ../cups/ppd-private.h
|
||||
gziptoany.64.o: gziptoany.c ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
|
||||
gziptoany.64.o: gziptoany.c ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
gziptoany.64.o: gziptoany.c ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
|
||||
gziptoany.64.o: gziptoany.c ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
|
||||
gziptoany.64.o: gziptoany.c ../cups/language-private.h ../cups/transcode.h
|
||||
gziptoany.64.o: gziptoany.c ../cups/thread-private.h
|
||||
gziptoany.64.o: gziptoany.c ../config.h ../cups/debug-private.h ../cups/versioning.h
|
||||
gziptoany.64.o: gziptoany.c ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
|
||||
gziptoany.64.o: gziptoany.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
gziptoany.64.o: gziptoany.c ../cups/array.h ../cups/language.h ../cups/pwg-private.h
|
||||
gziptoany.64.o: gziptoany.c ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
|
||||
gziptoany.64.o: gziptoany.c ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
|
||||
gziptoany.64.o: gziptoany.c ../cups/transcode.h ../cups/thread-private.h
|
||||
imagetops.64.o: imagetops.c common.h ../cups/string-private.h ../config.h ../cups/cups.h
|
||||
imagetops.64.o: imagetops.c ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
|
||||
imagetops.64.o: imagetops.c ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
@@ -427,7 +467,8 @@ imagetoraster.64.o: imagetoraster.c ../cups/ppd.h ../cups/cups.h ../cups/file.h
|
||||
imagetoraster.64.o: imagetoraster.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
imagetoraster.64.o: imagetoraster.c ../cups/array.h ../cups/language.h image-private.h image.h
|
||||
imagetoraster.64.o: imagetoraster.c ../cups/raster.h ../cups/ppd.h ../cups/debug-private.h
|
||||
imagetoraster.64.o: imagetoraster.c ../cups/language-private.h ../cups/transcode.h
|
||||
imagetoraster.64.o: imagetoraster.c ../cups/versioning.h ../cups/language-private.h
|
||||
imagetoraster.64.o: imagetoraster.c ../cups/transcode.h
|
||||
common.64.o: common.c common.h ../cups/string-private.h ../config.h ../cups/cups.h
|
||||
common.64.o: common.c ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
|
||||
common.64.o: common.c ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
@@ -462,19 +503,23 @@ rastertolabel.64.o: rastertolabel.c ../cups/versioning.h ../cups/ipp.h ../cups/
|
||||
rastertolabel.64.o: rastertolabel.c ../cups/array.h ../cups/language.h ../cups/string-private.h
|
||||
rastertolabel.64.o: rastertolabel.c ../config.h ../cups/language-private.h ../cups/transcode.h
|
||||
rastertolabel.64.o: rastertolabel.c ../cups/raster.h ../cups/ppd.h
|
||||
rastertopwg.64.o: rastertopwg.c ../cups/cups.h ../cups/language-private.h ../cups/transcode.h
|
||||
rastertopwg.64.o: rastertopwg.c ../cups/language.h ../cups/array.h ../cups/versioning.h
|
||||
rastertopwg.64.o: rastertopwg.c ../cups/raster.h ../cups/cups.h ../cups/file.h ../cups/ipp.h
|
||||
rastertopwg.64.o: rastertopwg.c ../cups/http.h ../cups/ppd.h ../cups/string-private.h
|
||||
rastertopwg.64.o: rastertopwg.c ../config.h
|
||||
rastertopwg.64.o: rastertopwg.c ../cups/cups-private.h ../cups/cups.h ../cups/string-private.h
|
||||
rastertopwg.64.o: rastertopwg.c ../config.h ../cups/debug-private.h ../cups/versioning.h
|
||||
rastertopwg.64.o: rastertopwg.c ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
|
||||
rastertopwg.64.o: rastertopwg.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
rastertopwg.64.o: rastertopwg.c ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
rastertopwg.64.o: rastertopwg.c ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
|
||||
rastertopwg.64.o: rastertopwg.c ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
|
||||
rastertopwg.64.o: rastertopwg.c ../cups/language-private.h ../cups/transcode.h
|
||||
rastertopwg.64.o: rastertopwg.c ../cups/thread-private.h ../cups/raster.h ../cups/ppd.h
|
||||
testimage.64.o: testimage.c image.h ../cups/raster.h ../cups/cups.h ../cups/file.h
|
||||
testimage.64.o: testimage.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
testimage.64.o: testimage.c ../cups/array.h ../cups/language.h ../cups/ppd.h
|
||||
testraster.64.o: testraster.c image-private.h image.h ../cups/raster.h ../cups/cups.h
|
||||
testraster.64.o: testraster.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
testraster.64.o: testraster.c ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h
|
||||
testraster.64.o: testraster.c ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h
|
||||
testraster.64.o: testraster.c ../config.h
|
||||
testraster.64.o: testraster.c ../cups/cups.h ../cups/debug-private.h ../cups/versioning.h
|
||||
testraster.64.o: testraster.c ../cups/string-private.h ../config.h
|
||||
textcommon.64.o: textcommon.c textcommon.h common.h ../cups/string-private.h ../config.h
|
||||
textcommon.64.o: textcommon.c ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
|
||||
textcommon.64.o: textcommon.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
|
||||
+6
-6
@@ -321,7 +321,7 @@ gziptoany: gziptoany.o ../Makedefs ../cups/$(LIBCUPS)
|
||||
libcupsimage.so.2 libcupsimage.sl.2: $(IMAGEOBJS)
|
||||
echo Linking $@...
|
||||
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) \
|
||||
-L../cups $(LINKCUPS) -lm
|
||||
-L../cups $(LINKCUPS)
|
||||
$(RM) `basename $@ .2`
|
||||
$(LN) $@ `basename $@ .2`
|
||||
|
||||
@@ -334,7 +334,7 @@ libcupsimage.so.2 libcupsimage.sl.2: $(IMAGEOBJS)
|
||||
echo Linking 32-bit $@...
|
||||
-mkdir 32bit
|
||||
$(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(IMAGE32OBJS) $(DSOLIBS) \
|
||||
-L../cups/32bit $(LINKCUPS) -lm
|
||||
-L../cups/32bit $(LINKCUPS)
|
||||
|
||||
|
||||
#
|
||||
@@ -345,7 +345,7 @@ libcupsimage.so.2 libcupsimage.sl.2: $(IMAGEOBJS)
|
||||
echo Linking 64-bit $@...
|
||||
-mkdir 64bit
|
||||
$(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(IMAGE64OBJS) $(DSOLIBS) \
|
||||
-L../cups/64bit $(LINKCUPS) -lm
|
||||
-L../cups/64bit $(LINKCUPS)
|
||||
|
||||
|
||||
#
|
||||
@@ -358,7 +358,7 @@ libcupsimage.2.dylib: $(IMAGEOBJS) $(LIBCUPSIMAGEORDER)
|
||||
-install_name $(libdir)/$@ \
|
||||
-current_version 2.3.0 \
|
||||
-compatibility_version 2.0.0 \
|
||||
$(IMAGEOBJS) $(DSOLIBS) -L../cups $(LINKCUPS) -lm
|
||||
$(IMAGEOBJS) $(DSOLIBS) -L../cups $(LINKCUPS)
|
||||
$(RM) libcupsimage.dylib
|
||||
$(LN) $@ libcupsimage.dylib
|
||||
|
||||
@@ -370,7 +370,7 @@ libcupsimage.2.dylib: $(IMAGEOBJS) $(LIBCUPSIMAGEORDER)
|
||||
libcupsimage_s.a: $(IMAGEOBJS) libcupsimage_s.exp
|
||||
echo Linking $@...
|
||||
$(DSO) $(DSOFLAGS) -Wl,-berok,-bexport:libcupsimage_s.exp \
|
||||
-o libcupsimage_s.o $(IMAGEOBJS) $(DSOLIBS) -lm
|
||||
-o libcupsimage_s.o $(IMAGEOBJS) $(DSOLIBS)
|
||||
$(RM) $@
|
||||
$(AR) $(ARFLAGS) $@ libcupsimage_s.o
|
||||
|
||||
@@ -435,7 +435,7 @@ imagetoraster: imagetoraster.o common.o $(LIBCUPSIMAGE) \
|
||||
|
||||
pstops: pstops.o common.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ pstops.o common.o $(LIBS) -lm
|
||||
$(CC) $(LDFLAGS) -o $@ pstops.o common.o $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
|
||||
+187
-20
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* PostScript command filter for CUPS.
|
||||
*
|
||||
* Copyright 2008-2011 by Apple Inc.
|
||||
* Copyright 2008-2012 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -36,7 +36,7 @@
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static void auto_configure(ppd_file_t *ppd, const char *user);
|
||||
static int auto_configure(ppd_file_t *ppd, const char *user);
|
||||
static void begin_ps(ppd_file_t *ppd, const char *user);
|
||||
static void end_ps(ppd_file_t *ppd);
|
||||
static void print_self_test_page(ppd_file_t *ppd, const char *user);
|
||||
@@ -51,6 +51,7 @@ int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
int status = 0; /* Exit status */
|
||||
cups_file_t *fp; /* Command file */
|
||||
char line[1024], /* Line from file */
|
||||
*value; /* Value on line */
|
||||
@@ -113,16 +114,20 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
*/
|
||||
|
||||
if (!_cups_strcasecmp(line, "AutoConfigure"))
|
||||
auto_configure(ppd, argv[2]);
|
||||
status |= auto_configure(ppd, argv[2]);
|
||||
else if (!_cups_strcasecmp(line, "PrintSelfTestPage"))
|
||||
print_self_test_page(ppd, argv[2]);
|
||||
else if (!_cups_strcasecmp(line, "ReportLevels"))
|
||||
report_levels(ppd, argv[2]);
|
||||
else
|
||||
fprintf(stderr, "ERROR: Invalid printer command \"%s\"!\n", line);
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("Invalid printer command \"%s\"."), line);
|
||||
status = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return (0);
|
||||
return (status);
|
||||
}
|
||||
|
||||
|
||||
@@ -131,12 +136,14 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
* query commands and/or SNMP lookups.
|
||||
*/
|
||||
|
||||
static void
|
||||
static int /* O - Exit status */
|
||||
auto_configure(ppd_file_t *ppd, /* I - PPD file */
|
||||
const char *user) /* I - Printing user */
|
||||
{
|
||||
int status = 0; /* Exit status */
|
||||
ppd_option_t *option; /* Current option in PPD */
|
||||
ppd_attr_t *attr; /* Query command attribute */
|
||||
const char *valptr; /* Pointer into attribute value */
|
||||
char buffer[1024], /* String buffer */
|
||||
*bufptr; /* Pointer into buffer */
|
||||
ssize_t bytes; /* Number of bytes read */
|
||||
@@ -154,7 +161,7 @@ auto_configure(ppd_file_t *ppd, /* I - PPD file */
|
||||
{
|
||||
fputs("DEBUG: Unable to auto-configure PostScript Printer - no "
|
||||
"bidirectional I/O available!\n", stderr);
|
||||
return;
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -162,6 +169,25 @@ auto_configure(ppd_file_t *ppd, /* I - PPD file */
|
||||
*/
|
||||
|
||||
begin_ps(ppd, user);
|
||||
|
||||
/*
|
||||
* (STR #4028)
|
||||
*
|
||||
* As a lot of PPDs contain bad PostScript query code, we need to prevent one
|
||||
* bad query sequence from affecting all auto-configuration. The following
|
||||
* error handler allows us to log PostScript errors to cupsd.
|
||||
*/
|
||||
|
||||
puts("/cups_handleerror {\n"
|
||||
" $error /newerror false put\n"
|
||||
" (:PostScript error in \") print cups_query_keyword print (\": ) "
|
||||
"print\n"
|
||||
" $error /errorname get 128 string cvs print\n"
|
||||
" (; offending command:) print $error /command get 128 string cvs "
|
||||
"print (\n) print flush\n"
|
||||
"} bind def\n"
|
||||
"errordict /timeout {} put\n"
|
||||
"/cups_query_keyword (?Unknown) def\n");
|
||||
fflush(stdout);
|
||||
|
||||
/*
|
||||
@@ -202,7 +228,76 @@ auto_configure(ppd_file_t *ppd, /* I - PPD file */
|
||||
*/
|
||||
|
||||
fprintf(stderr, "DEBUG: Querying %s...\n", option->keyword);
|
||||
fputs(attr->value, stdout);
|
||||
|
||||
for (bufptr = buffer, valptr = attr->value; *valptr; valptr ++)
|
||||
{
|
||||
/*
|
||||
* Log the query code, breaking at newlines...
|
||||
*/
|
||||
|
||||
if (*valptr == '\n')
|
||||
{
|
||||
*bufptr = '\0';
|
||||
fprintf(stderr, "DEBUG: %s\\n\n", buffer);
|
||||
bufptr = buffer;
|
||||
}
|
||||
else if (*valptr < ' ')
|
||||
{
|
||||
if (bufptr >= (buffer + sizeof(buffer) - 4))
|
||||
{
|
||||
*bufptr = '\0';
|
||||
fprintf(stderr, "DEBUG: %s\n", buffer);
|
||||
bufptr = buffer;
|
||||
}
|
||||
|
||||
if (*valptr == '\r')
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = 'r';
|
||||
}
|
||||
else if (*valptr == '\t')
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = 't';
|
||||
}
|
||||
else
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = '0' + ((*valptr / 64) & 7);
|
||||
*bufptr++ = '0' + ((*valptr / 8) & 7);
|
||||
*bufptr++ = '0' + (*valptr & 7);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bufptr >= (buffer + sizeof(buffer) - 1))
|
||||
{
|
||||
*bufptr = '\0';
|
||||
fprintf(stderr, "DEBUG: %s\n", buffer);
|
||||
bufptr = buffer;
|
||||
}
|
||||
|
||||
*bufptr++ = *valptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (bufptr > buffer)
|
||||
{
|
||||
*bufptr = '\0';
|
||||
fprintf(stderr, "DEBUG: %s\n", buffer);
|
||||
}
|
||||
|
||||
printf("/cups_query_keyword (?%s) def\n", option->keyword);
|
||||
/* Set keyword for error reporting */
|
||||
fputs("{ (", stdout);
|
||||
for (valptr = attr->value; *valptr; valptr ++)
|
||||
{
|
||||
if (*valptr == '(' || *valptr == ')' || *valptr == '\\')
|
||||
putchar('\\');
|
||||
putchar(*valptr);
|
||||
}
|
||||
fputs(") cvx exec } stopped { cups_handleerror } if clear\n", stdout);
|
||||
/* Send query code */
|
||||
fflush(stdout);
|
||||
|
||||
datalen = 0;
|
||||
@@ -212,53 +307,119 @@ auto_configure(ppd_file_t *ppd, /* I - PPD file */
|
||||
* Read the response data...
|
||||
*/
|
||||
|
||||
while ((bytes = cupsBackChannelRead(buffer, sizeof(buffer) - 1, 90.0)) > 0)
|
||||
bufptr = buffer;
|
||||
buffer[0] = '\0';
|
||||
while ((bytes = cupsBackChannelRead(bufptr,
|
||||
sizeof(buffer) - (bufptr - buffer) - 1,
|
||||
10.0)) > 0)
|
||||
{
|
||||
/*
|
||||
* Trim whitespace from both ends...
|
||||
* No newline at the end? Go on reading ...
|
||||
*/
|
||||
|
||||
buffer[bytes] = '\0';
|
||||
bufptr += bytes;
|
||||
*bufptr = '\0';
|
||||
|
||||
for (bufptr = buffer + bytes - 1; bufptr >= buffer; bufptr --)
|
||||
if (isspace(*bufptr & 255))
|
||||
if (bytes == 0 ||
|
||||
(bufptr > buffer && bufptr[-1] != '\r' && bufptr[-1] != '\n'))
|
||||
continue;
|
||||
|
||||
/*
|
||||
* Trim whitespace and control characters from both ends...
|
||||
*/
|
||||
|
||||
bytes = bufptr - buffer;
|
||||
|
||||
for (bufptr --; bufptr >= buffer; bufptr --)
|
||||
if (isspace(*bufptr & 255) || iscntrl(*bufptr & 255))
|
||||
*bufptr = '\0';
|
||||
else
|
||||
break;
|
||||
|
||||
for (bufptr = buffer; isspace(*bufptr & 255); bufptr ++);
|
||||
for (bufptr = buffer; isspace(*bufptr & 255) || iscntrl(*bufptr & 255);
|
||||
bufptr ++);
|
||||
|
||||
fprintf(stderr, "DEBUG: Got \"%s\" (%d bytes)\n", bufptr, (int)bytes);
|
||||
if (bufptr > buffer)
|
||||
{
|
||||
_cups_strcpy(buffer, bufptr);
|
||||
bufptr = buffer;
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: Got %d bytes.\n", (int)bytes);
|
||||
|
||||
/*
|
||||
* Skip blank lines...
|
||||
*/
|
||||
|
||||
if (!*bufptr)
|
||||
if (!buffer[0])
|
||||
continue;
|
||||
|
||||
/*
|
||||
* Check the response...
|
||||
*/
|
||||
|
||||
if ((bufptr = strchr(buffer, ':')) != NULL)
|
||||
{
|
||||
/*
|
||||
* PostScript code for this option in the PPD is broken; show the
|
||||
* interpreter's error message that came back...
|
||||
*/
|
||||
|
||||
fprintf(stderr, "DEBUG%s\n", bufptr);
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Verify the result is a valid option choice...
|
||||
*/
|
||||
|
||||
if (!ppdFindChoice(option, bufptr))
|
||||
if (!ppdFindChoice(option, buffer))
|
||||
{
|
||||
if (!strcasecmp(buffer, "Unknown"))
|
||||
break;
|
||||
|
||||
bufptr = buffer;
|
||||
buffer[0] = '\0';
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Write out the result and move on to the next option...
|
||||
*/
|
||||
|
||||
fprintf(stderr, "DEBUG: Default%s=%s\n", option->keyword, bufptr);
|
||||
fprintf(stderr, "PPD: Default%s=%s\n", option->keyword, bufptr);
|
||||
fprintf(stderr, "PPD: Default%s=%s\n", option->keyword, buffer);
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Printer did not answer this option's query
|
||||
*/
|
||||
|
||||
if (bytes <= 0)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"DEBUG: No answer to query for option %s within 10 seconds.\n",
|
||||
option->keyword);
|
||||
status = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Finish the job...
|
||||
*/
|
||||
|
||||
fflush(stdout);
|
||||
end_ps(ppd);
|
||||
|
||||
/*
|
||||
* Return...
|
||||
*/
|
||||
|
||||
if (status)
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("Unable to configure printer options."));
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
@@ -280,6 +441,7 @@ begin_ps(ppd_file_t *ppd, /* I - PPD file */
|
||||
|
||||
puts("%!");
|
||||
puts("userdict dup(\\004)cvn{}put (\\004\\004)cvn{}put\n");
|
||||
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
@@ -319,7 +481,12 @@ print_self_test_page(ppd_file_t *ppd, /* I - PPD file */
|
||||
* the product/interpreter information...
|
||||
*/
|
||||
|
||||
puts("% You are using the wrong driver for your printer!\n"
|
||||
puts("\r%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
|
||||
"%%%%%%%%%%%%%\n"
|
||||
"\r%%%% If you can read this, you are using the wrong driver for your "
|
||||
"printer. %%%%\n"
|
||||
"\r%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
|
||||
"%%%%%%%%%%%%%\n"
|
||||
"0 setgray\n"
|
||||
"2 setlinewidth\n"
|
||||
"initclip newpath clippath gsave stroke grestore pathbbox\n"
|
||||
|
||||
+29
-31
@@ -353,7 +353,7 @@ gif_get_code(FILE *fp, /* I - File to read from */
|
||||
* Read in another buffer...
|
||||
*/
|
||||
|
||||
if ((count = gif_get_block (fp, buf + last_byte)) <= 0)
|
||||
if ((count = gif_get_block(fp, buf + last_byte)) <= 0)
|
||||
{
|
||||
/*
|
||||
* Whoops, no more data!
|
||||
@@ -582,19 +582,13 @@ gif_read_lzw(FILE *fp, /* I - File to read from */
|
||||
gif_get_code(fp, 0, 1);
|
||||
|
||||
/*
|
||||
* Wipe the decompressor table...
|
||||
* Wipe the decompressor table (already mostly 0 due to the calloc above...)
|
||||
*/
|
||||
|
||||
fresh = 1;
|
||||
|
||||
for (i = 0; i < clear_code; i ++)
|
||||
{
|
||||
table[0][i] = 0;
|
||||
for (i = 1; i < clear_code; i ++)
|
||||
table[1][i] = i;
|
||||
}
|
||||
|
||||
for (; i < 4096; i ++)
|
||||
table[0][i] = table[1][0] = 0;
|
||||
|
||||
sp = stack;
|
||||
|
||||
@@ -605,29 +599,30 @@ gif_read_lzw(FILE *fp, /* I - File to read from */
|
||||
fresh = 0;
|
||||
|
||||
do
|
||||
{
|
||||
firstcode = oldcode = gif_get_code(fp, code_size, 0);
|
||||
}
|
||||
while (firstcode == clear_code);
|
||||
|
||||
return (firstcode);
|
||||
return (firstcode & 255);
|
||||
}
|
||||
else if (!table)
|
||||
return (0);
|
||||
|
||||
if (sp > stack)
|
||||
return (*--sp);
|
||||
return ((*--sp) & 255);
|
||||
|
||||
while ((code = gif_get_code (fp, code_size, 0)) >= 0)
|
||||
while ((code = gif_get_code(fp, code_size, 0)) >= 0)
|
||||
{
|
||||
if (code == clear_code)
|
||||
{
|
||||
for (i = 0; i < clear_code; i ++)
|
||||
{
|
||||
table[0][i] = 0;
|
||||
table[1][i] = i;
|
||||
}
|
||||
/*
|
||||
* Clear/reset the compression table...
|
||||
*/
|
||||
|
||||
for (; i < 4096; i ++)
|
||||
table[0][i] = table[1][i] = 0;
|
||||
memset(table, 0, 2 * sizeof(gif_table_t));
|
||||
for (i = 1; i < clear_code; i ++)
|
||||
table[1][i] = i;
|
||||
|
||||
code_size = set_code_size + 1;
|
||||
max_code_size = 2 * clear_code;
|
||||
@@ -637,12 +632,11 @@ gif_read_lzw(FILE *fp, /* I - File to read from */
|
||||
|
||||
firstcode = oldcode = gif_get_code(fp, code_size, 0);
|
||||
|
||||
return (firstcode);
|
||||
return (firstcode & 255);
|
||||
}
|
||||
else if (code == end_code)
|
||||
else if (code == end_code || code > max_code)
|
||||
{
|
||||
unsigned char buf[260];
|
||||
|
||||
unsigned char buf[260]; /* Block buffer */
|
||||
|
||||
if (!gif_eof)
|
||||
while (gif_get_block(fp, buf) > 0);
|
||||
@@ -652,13 +646,15 @@ gif_read_lzw(FILE *fp, /* I - File to read from */
|
||||
|
||||
incode = code;
|
||||
|
||||
if (code >= max_code)
|
||||
if (code == max_code)
|
||||
{
|
||||
*sp++ = firstcode;
|
||||
code = oldcode;
|
||||
if (sp < (stack + 8192))
|
||||
*sp++ = firstcode;
|
||||
|
||||
code = oldcode;
|
||||
}
|
||||
|
||||
while (code >= clear_code)
|
||||
while (code >= clear_code && sp < (stack + 8192))
|
||||
{
|
||||
*sp++ = table[1][code];
|
||||
if (code == table[0][code])
|
||||
@@ -667,8 +663,10 @@ gif_read_lzw(FILE *fp, /* I - File to read from */
|
||||
code = table[0][code];
|
||||
}
|
||||
|
||||
*sp++ = firstcode = table[1][code];
|
||||
code = max_code;
|
||||
if (sp < (stack + 8192))
|
||||
*sp++ = firstcode = table[1][code];
|
||||
|
||||
code = max_code;
|
||||
|
||||
if (code < 4096)
|
||||
{
|
||||
@@ -686,10 +684,10 @@ gif_read_lzw(FILE *fp, /* I - File to read from */
|
||||
oldcode = incode;
|
||||
|
||||
if (sp > stack)
|
||||
return (*--sp);
|
||||
return ((*--sp) & 255);
|
||||
}
|
||||
|
||||
return (code);
|
||||
return (code & 255);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais
Referência em uma Nova Issue
Bloquear um usuário