From b86bc4cf571c35972a94a634ea884baff9799fa9 Mon Sep 17 00:00:00 2001
From: jlovell
Date: Wed, 14 Feb 2007 19:18:46 +0000
Subject: [PATCH] Load cups into easysw/current.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@266 a1ca3aef-8c08-0410-bb20-df032aa958be
---
CHANGES.txt | 88 +-
CREDITS.txt | 3 +-
INSTALL.txt | 2 +-
LICENSE.txt | 2 +-
Makefile | 9 +-
README.txt | 4 +-
backend/ipp.c | 6 +-
backend/parallel.c | 12 +-
backend/runloop.c | 8 +-
backend/snmp.c | 18 +-
backend/usb-unix.c | 8 +-
cgi-bin/ipp-var.c | 6 +-
config-scripts/cups-3264.m4 | 149 +
config-scripts/cups-common.m4 | 6 +-
config-scripts/cups-compiler.m4 | 122 +-
config-scripts/cups-defaults.m4 | 10 +-
config-scripts/cups-opsys.m4 | 7 +-
config-scripts/cups-sharedlibs.m4 | 37 +-
config-scripts/cups-ssl.m4 | 42 +-
config.h.in | 18 +-
configure.in | 5 +-
cups/adminutil.c | 307 +-
cups/auth.c | 20 +-
cups/backchannel.c | 16 +-
cups/cups.h | 17 +-
cups/dest.c | 8 +-
cups/emit.c | 14 +-
cups/encode.c | 12 +-
cups/file.c | 85 +-
cups/file.h | 12 +-
cups/http-addrlist.c | 12 +-
cups/http-private.h | 56 +-
cups/http-support.c | 10 +-
cups/http.c | 100 +-
cups/http.h | 11 +-
cups/ipp.c | 41 +-
cups/langprintf.c | 10 +-
cups/language.c | 8 +-
cups/mark.c | 44 +-
cups/page.c | 98 +-
cups/ppd.c | 62 +-
cups/request.c | 8 +-
cups/snprintf.c | 18 +-
cups/string.c | 49 +-
cups/testfile.c | 34 +-
cups/testppd.c | 73 +-
cups/transcode.c | 16 +-
cups/util.c | 7 +-
desktop/cups.desktop | 4 +-
doc/de/index.html.in | 2 +-
doc/es/index.html.in | 2 +-
doc/et/index.html.in | 2 +-
doc/fr/images/button-accept-jobs.gif | Bin 0 -> 668 bytes
doc/fr/images/button-add-class.gif | Bin 0 -> 628 bytes
doc/fr/images/button-add-printer.gif | Bin 0 -> 679 bytes
doc/fr/images/button-add-this-printer.gif | Bin 0 -> 715 bytes
doc/fr/images/button-cancel-all-jobs.gif | Bin 0 -> 725 bytes
doc/fr/images/button-cancel-job.gif | Bin 0 -> 568 bytes
doc/fr/images/button-change-settings.gif | Bin 0 -> 732 bytes
doc/fr/images/button-clean-print-heads.gif | Bin 0 -> 856 bytes
doc/fr/images/button-clear.gif | Bin 0 -> 466 bytes
doc/fr/images/button-continue.gif | Bin 0 -> 482 bytes
doc/fr/images/button-delete-class.gif | Bin 0 -> 636 bytes
doc/fr/images/button-delete-printer.gif | Bin 0 -> 645 bytes
.../images/button-edit-configuration-file.gif | Bin 0 -> 810 bytes
doc/fr/images/button-export-samba.gif | Bin 0 -> 958 bytes
doc/fr/images/button-help.gif | Bin 0 -> 361 bytes
doc/fr/images/button-hold-job.gif | Bin 0 -> 565 bytes
doc/fr/images/button-manage-classes.gif | Bin 0 -> 702 bytes
doc/fr/images/button-manage-jobs.gif | Bin 0 -> 694 bytes
doc/fr/images/button-manage-printers.gif | Bin 0 -> 760 bytes
doc/fr/images/button-manage-server.gif | Bin 0 -> 891 bytes
doc/fr/images/button-modify-class.gif | Bin 0 -> 618 bytes
doc/fr/images/button-modify-printer.gif | Bin 0 -> 644 bytes
doc/fr/images/button-move-job.gif | Bin 0 -> 610 bytes
doc/fr/images/button-move-jobs.gif | Bin 0 -> 785 bytes
doc/fr/images/button-print-self-test-page.gif | Bin 0 -> 946 bytes
doc/fr/images/button-print-test-page.gif | Bin 0 -> 859 bytes
doc/fr/images/button-publish-printer.gif | Bin 0 -> 616 bytes
doc/fr/images/button-reject-jobs.gif | Bin 0 -> 632 bytes
doc/fr/images/button-release-job.gif | Bin 0 -> 574 bytes
doc/fr/images/button-restart-job.gif | Bin 0 -> 601 bytes
doc/fr/images/button-save-changes.gif | Bin 0 -> 775 bytes
doc/fr/images/button-search.gif | Bin 0 -> 482 bytes
doc/fr/images/button-set-allowed-users.gif | Bin 0 -> 702 bytes
doc/fr/images/button-set-as-default.gif | Bin 0 -> 624 bytes
doc/fr/images/button-set-printer-options.gif | Bin 0 -> 867 bytes
doc/fr/images/button-show-active.gif | Bin 0 -> 781 bytes
doc/fr/images/button-show-all.gif | Bin 0 -> 756 bytes
doc/fr/images/button-show-completed.gif | Bin 0 -> 802 bytes
doc/fr/images/button-show-next.gif | Bin 0 -> 685 bytes
doc/fr/images/button-show-previous.gif | Bin 0 -> 730 bytes
doc/fr/images/button-sort-ascending.gif | Bin 0 -> 707 bytes
doc/fr/images/button-sort-descending.gif | Bin 0 -> 764 bytes
doc/fr/images/button-start-class.gif | Bin 0 -> 635 bytes
doc/fr/images/button-start-printer.gif | Bin 0 -> 646 bytes
doc/fr/images/button-stop-class.gif | Bin 0 -> 608 bytes
doc/fr/images/button-stop-printer.gif | Bin 0 -> 635 bytes
doc/fr/images/button-unpublish-printer.gif | Bin 0 -> 620 bytes
doc/fr/images/button-use-default-config.gif | Bin 0 -> 880 bytes
doc/fr/images/button-view-access-log.gif | Bin 0 -> 568 bytes
doc/fr/images/button-view-error-log.gif | Bin 0 -> 569 bytes
doc/fr/images/button-view-page-log.gif | Bin 0 -> 580 bytes
.../images/button-view-printable-version.gif | Bin 0 -> 637 bytes
doc/fr/index.html.in | 278 +
doc/help/api-raster.html | 143 +-
doc/help/license.html | 2 +-
doc/help/network.html | 519 +-
doc/help/options.html | 25 +-
doc/help/ref-cupsd-conf.html | 2 +-
doc/help/spec-ppd.html | 338 +-
doc/idd.shtml | 1445 -----
doc/index.html.in | 2 +-
doc/it/index.html.in | 2 +-
doc/ja/index.html.in | 2 +-
doc/pl/index.html.in | 2 +-
doc/sdd.shtml | 564 --
doc/sps.shtml | 457 --
doc/sv/index.html.in | 2 +-
filter/Dependencies | 888 +--
filter/Makefile | 10 +-
filter/image-pnm.c | 6 +-
filter/image-private.h | 9 +-
filter/image-sun.c | 14 +-
filter/interpret.c | 1329 +++-
filter/libcupsimage_s.exp | 1 +
filter/pstops.c | 341 +-
filter/raster.h | 104 +-
filter/rastertolabel.c | 20 +-
filter/testraster.c | 851 ++-
locale/cups.pot | 51 +-
locale/cups_de.po | 363 +-
locale/cups_es.po | 56 +-
locale/cups_et.po | 267 +-
locale/cups_fr.po | 5690 +++++++++++++++++
locale/cups_it.po | 364 +-
locale/cups_ja.po | 55 +-
locale/cups_pl.po | 54 +-
locale/cups_sv.po | 289 +-
packaging/cups.list.in | 25 +-
packaging/cups.spec.in | 23 +-
pdftops/PSOutputDev.cxx | 9 +-
scheduler/client.c | 282 +-
scheduler/client.h | 7 +-
scheduler/conf.c | 10 +-
scheduler/cups-driverd.c | 13 +-
scheduler/dirsvc.c | 8 +-
scheduler/ipp.c | 7 +-
scheduler/job.c | 18 +-
.../java/src/com/easysw/cups/Base64Coder.java | 145 +
.../src/com/easysw/cups/IPPBase64Encoder.java | 46 -
.../java/src/com/easysw/cups/IPPHttp.java | 15 +-
scripting/java/src/com/easysw/cups/class.list | 2 +-
systemv/lpoptions.c | 8 +-
templates/de/header.tmpl.in | 4 +-
templates/de/jobs.tmpl | 2 +-
templates/es/header.tmpl.in | 4 +-
templates/es/jobs.tmpl | 2 +-
templates/et/header.tmpl.in | 4 +-
templates/et/jobs.tmpl | 2 +-
templates/fr/add-class.tmpl | 66 +
templates/fr/add-printer.tmpl | 56 +
templates/fr/admin.tmpl | 166 +
templates/fr/choose-device.tmpl | 52 +
templates/fr/choose-make.tmpl | 84 +
templates/fr/choose-model.tmpl | 68 +
templates/fr/choose-serial.tmpl | 94 +
templates/fr/choose-uri.tmpl | 84 +
templates/fr/class-added.tmpl | 2 +
templates/fr/class-confirm.tmpl | 14 +
templates/fr/class-deleted.tmpl | 2 +
templates/fr/class-jobs-header.tmpl | 2 +
templates/fr/class-modified.tmpl | 2 +
templates/fr/classes-header.tmpl | 2 +
templates/fr/classes.tmpl | 108 +
templates/fr/edit-config.tmpl.in | 182 +
templates/fr/error-op.tmpl | 6 +
templates/fr/error.tmpl | 6 +
templates/fr/header.tmpl.in | 126 +
templates/fr/help-header.tmpl | 104 +
templates/fr/help-printable.tmpl | 22 +
templates/fr/job-cancel.tmpl | 2 +
templates/fr/job-hold.tmpl | 2 +
templates/fr/job-move.tmpl | 44 +
templates/fr/job-moved.tmpl | 4 +
templates/fr/job-release.tmpl | 2 +
templates/fr/job-restart.tmpl | 2 +
templates/fr/jobs-header.tmpl | 32 +
templates/fr/jobs.tmpl | 84 +
templates/fr/maintenance.tmpl | 4 +
templates/fr/modify-class.tmpl | 68 +
templates/fr/modify-printer.tmpl | 58 +
templates/fr/norestart.tmpl | 2 +
templates/fr/option-boolean.tmpl | 14 +
templates/fr/option-conflict.tmpl | 14 +
templates/fr/option-header.tmpl | 6 +
templates/fr/option-pickmany.tmpl | 14 +
templates/fr/option-pickone.tmpl | 14 +
templates/fr/option-trailer.tmpl | 12 +
templates/fr/pager.tmpl | 22 +
templates/fr/printer-accept.tmpl | 6 +
templates/fr/printer-added.tmpl | 2 +
templates/fr/printer-configured.tmpl | 2 +
templates/fr/printer-confirm.tmpl | 14 +
templates/fr/printer-default.tmpl | 14 +
templates/fr/printer-deleted.tmpl | 2 +
templates/fr/printer-jobs-header.tmpl | 2 +
templates/fr/printer-modified.tmpl | 2 +
templates/fr/printer-purge.tmpl | 6 +
templates/fr/printer-reject.tmpl | 6 +
templates/fr/printer-start.tmpl | 6 +
templates/fr/printer-stop.tmpl | 6 +
templates/fr/printers-header.tmpl | 2 +
templates/fr/printers.tmpl | 132 +
templates/fr/restart.tmpl | 2 +
templates/fr/samba-export.tmpl | 106 +
templates/fr/samba-exported.tmpl | 2 +
templates/fr/search.tmpl | 26 +
templates/fr/set-printer-options-header.tmpl | 6 +
templates/fr/set-printer-options-trailer.tmpl | 2 +
templates/fr/test-page.tmpl | 4 +
templates/fr/trailer.tmpl | 42 +
templates/fr/users.tmpl | 52 +
templates/header.tmpl.in | 4 +-
templates/it/header.tmpl.in | 4 +-
templates/it/jobs.tmpl | 2 +-
templates/ja/header.tmpl.in | 4 +-
templates/ja/jobs.tmpl | 2 +-
templates/jobs.tmpl | 2 +-
templates/pl/header.tmpl.in | 4 +-
templates/pl/jobs.tmpl | 2 +-
templates/sv/header.tmpl.in | 4 +-
templates/sv/jobs.tmpl | 2 +-
templates/trailer.tmpl | 2 +-
tools/checkpo | 22 +
vcnet/config.h | 128 +-
vcnet/cups.sln | 20 +
vcnet/libcups2.def | 118 +-
vcnet/libcups2.vcproj | 413 +-
vcnet/testfile.vcproj | 134 +
vcnet/testhttp.vcproj | 134 +
241 files changed, 15145 insertions(+), 4849 deletions(-)
create mode 100644 config-scripts/cups-3264.m4
create mode 100644 doc/fr/images/button-accept-jobs.gif
create mode 100644 doc/fr/images/button-add-class.gif
create mode 100644 doc/fr/images/button-add-printer.gif
create mode 100644 doc/fr/images/button-add-this-printer.gif
create mode 100644 doc/fr/images/button-cancel-all-jobs.gif
create mode 100644 doc/fr/images/button-cancel-job.gif
create mode 100644 doc/fr/images/button-change-settings.gif
create mode 100644 doc/fr/images/button-clean-print-heads.gif
create mode 100644 doc/fr/images/button-clear.gif
create mode 100644 doc/fr/images/button-continue.gif
create mode 100644 doc/fr/images/button-delete-class.gif
create mode 100644 doc/fr/images/button-delete-printer.gif
create mode 100644 doc/fr/images/button-edit-configuration-file.gif
create mode 100644 doc/fr/images/button-export-samba.gif
create mode 100644 doc/fr/images/button-help.gif
create mode 100644 doc/fr/images/button-hold-job.gif
create mode 100644 doc/fr/images/button-manage-classes.gif
create mode 100644 doc/fr/images/button-manage-jobs.gif
create mode 100644 doc/fr/images/button-manage-printers.gif
create mode 100644 doc/fr/images/button-manage-server.gif
create mode 100644 doc/fr/images/button-modify-class.gif
create mode 100644 doc/fr/images/button-modify-printer.gif
create mode 100644 doc/fr/images/button-move-job.gif
create mode 100644 doc/fr/images/button-move-jobs.gif
create mode 100644 doc/fr/images/button-print-self-test-page.gif
create mode 100644 doc/fr/images/button-print-test-page.gif
create mode 100644 doc/fr/images/button-publish-printer.gif
create mode 100644 doc/fr/images/button-reject-jobs.gif
create mode 100644 doc/fr/images/button-release-job.gif
create mode 100644 doc/fr/images/button-restart-job.gif
create mode 100644 doc/fr/images/button-save-changes.gif
create mode 100644 doc/fr/images/button-search.gif
create mode 100644 doc/fr/images/button-set-allowed-users.gif
create mode 100644 doc/fr/images/button-set-as-default.gif
create mode 100644 doc/fr/images/button-set-printer-options.gif
create mode 100644 doc/fr/images/button-show-active.gif
create mode 100644 doc/fr/images/button-show-all.gif
create mode 100644 doc/fr/images/button-show-completed.gif
create mode 100644 doc/fr/images/button-show-next.gif
create mode 100644 doc/fr/images/button-show-previous.gif
create mode 100644 doc/fr/images/button-sort-ascending.gif
create mode 100644 doc/fr/images/button-sort-descending.gif
create mode 100644 doc/fr/images/button-start-class.gif
create mode 100644 doc/fr/images/button-start-printer.gif
create mode 100644 doc/fr/images/button-stop-class.gif
create mode 100644 doc/fr/images/button-stop-printer.gif
create mode 100644 doc/fr/images/button-unpublish-printer.gif
create mode 100644 doc/fr/images/button-use-default-config.gif
create mode 100644 doc/fr/images/button-view-access-log.gif
create mode 100644 doc/fr/images/button-view-error-log.gif
create mode 100644 doc/fr/images/button-view-page-log.gif
create mode 100644 doc/fr/images/button-view-printable-version.gif
create mode 100644 doc/fr/index.html.in
delete mode 100644 doc/idd.shtml
delete mode 100644 doc/sdd.shtml
delete mode 100644 doc/sps.shtml
create mode 100644 locale/cups_fr.po
create mode 100644 scripting/java/src/com/easysw/cups/Base64Coder.java
create mode 100644 templates/fr/add-class.tmpl
create mode 100644 templates/fr/add-printer.tmpl
create mode 100644 templates/fr/admin.tmpl
create mode 100644 templates/fr/choose-device.tmpl
create mode 100644 templates/fr/choose-make.tmpl
create mode 100644 templates/fr/choose-model.tmpl
create mode 100644 templates/fr/choose-serial.tmpl
create mode 100644 templates/fr/choose-uri.tmpl
create mode 100644 templates/fr/class-added.tmpl
create mode 100644 templates/fr/class-confirm.tmpl
create mode 100644 templates/fr/class-deleted.tmpl
create mode 100644 templates/fr/class-jobs-header.tmpl
create mode 100644 templates/fr/class-modified.tmpl
create mode 100644 templates/fr/classes-header.tmpl
create mode 100644 templates/fr/classes.tmpl
create mode 100644 templates/fr/edit-config.tmpl.in
create mode 100644 templates/fr/error-op.tmpl
create mode 100644 templates/fr/error.tmpl
create mode 100644 templates/fr/header.tmpl.in
create mode 100644 templates/fr/help-header.tmpl
create mode 100644 templates/fr/help-printable.tmpl
create mode 100644 templates/fr/job-cancel.tmpl
create mode 100644 templates/fr/job-hold.tmpl
create mode 100644 templates/fr/job-move.tmpl
create mode 100644 templates/fr/job-moved.tmpl
create mode 100644 templates/fr/job-release.tmpl
create mode 100644 templates/fr/job-restart.tmpl
create mode 100644 templates/fr/jobs-header.tmpl
create mode 100644 templates/fr/jobs.tmpl
create mode 100644 templates/fr/maintenance.tmpl
create mode 100644 templates/fr/modify-class.tmpl
create mode 100644 templates/fr/modify-printer.tmpl
create mode 100644 templates/fr/norestart.tmpl
create mode 100644 templates/fr/option-boolean.tmpl
create mode 100644 templates/fr/option-conflict.tmpl
create mode 100644 templates/fr/option-header.tmpl
create mode 100644 templates/fr/option-pickmany.tmpl
create mode 100644 templates/fr/option-pickone.tmpl
create mode 100644 templates/fr/option-trailer.tmpl
create mode 100644 templates/fr/pager.tmpl
create mode 100644 templates/fr/printer-accept.tmpl
create mode 100644 templates/fr/printer-added.tmpl
create mode 100644 templates/fr/printer-configured.tmpl
create mode 100644 templates/fr/printer-confirm.tmpl
create mode 100644 templates/fr/printer-default.tmpl
create mode 100644 templates/fr/printer-deleted.tmpl
create mode 100644 templates/fr/printer-jobs-header.tmpl
create mode 100644 templates/fr/printer-modified.tmpl
create mode 100644 templates/fr/printer-purge.tmpl
create mode 100644 templates/fr/printer-reject.tmpl
create mode 100644 templates/fr/printer-start.tmpl
create mode 100644 templates/fr/printer-stop.tmpl
create mode 100644 templates/fr/printers-header.tmpl
create mode 100644 templates/fr/printers.tmpl
create mode 100644 templates/fr/restart.tmpl
create mode 100644 templates/fr/samba-export.tmpl
create mode 100644 templates/fr/samba-exported.tmpl
create mode 100644 templates/fr/search.tmpl
create mode 100644 templates/fr/set-printer-options-header.tmpl
create mode 100644 templates/fr/set-printer-options-trailer.tmpl
create mode 100644 templates/fr/test-page.tmpl
create mode 100644 templates/fr/trailer.tmpl
create mode 100644 templates/fr/users.tmpl
create mode 100755 tools/checkpo
create mode 100644 vcnet/testfile.vcproj
create mode 100644 vcnet/testhttp.vcproj
diff --git a/CHANGES.txt b/CHANGES.txt
index 49fe7d702..4dd18bf0c 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,6 +1,92 @@
-CHANGES.txt - 2006-11-16
+CHANGES.txt - 2007-02-06
------------------------
+CHANGES IN CUPS V1.2.8
+
+ - Documentation fixes (STR #2141, STR #2157)
+ - The HTTP upgrade redirection used by the scheduler did
+ not work with Internet Explorer (STR #2235)
+ - Members of a class with Unicode names did not appear
+ correctly in the web interface (STR #2154)
+ - Changing the "Save debugging information" setting in
+ the web interface no longer affects the other server
+ settings (STR #1993)
+ - The scheduler did not choose SSL certificates correctly
+ on Mac OS X (STR #2225)
+ - The scheduler could get in an infinite loop when
+ printing to a remote class (STR #2228)
+ - The jobs web page did not have separating space after
+ the number of pages column (STR #2230)
+ - Added French localization (STR #2221)
+ - Updated Spanish localization (STR #2223)
+ - Updated Japanese localization (STR #2216)
+ - cupsBorderlessScalingFacter was limited to a range of
+ 0.9 to 1.1, but some printers need larger values (STR
+ #2222)
+ - Landscape printing of PDF files did not always work
+ (STR #2149)
+ - Fixed slow USB printing on Minolta printers (STR #2104,
+ STR #2219)
+ - The ZPL label printer driver could produce stretched
+ output (PR #6448)
+ - The IPP backend now clears the printer-state-message
+ when there are no outstanding errors or warnings (STR
+ #2126)
+ - The CUPS Java scripting support did not work with
+ recent versions of Java due to the use of Sun's private
+ Base64 class (STR #2152)
+ - The scheduler did not pass HTTP GET form variables to
+ custom CGI programs (STR #2173)
+ - The lpoptions command now displays the reason why a PPD
+ file cannot be found (STR #2184)
+ - The scheduler did not accept "none" as a browse
+ protocol name (STR #2200)
+ - The scheduler still loaded the remote printer cache,
+ even when browsing was disabled (STR #2198)
+ - The SNMP backend now shows OfficeJet printers with the
+ "HP" manufacturer prefix (STR #2151)
+ - Web interface HTML cleanup (STR #2153)
+ - The parallel backend consumed 100% CPU on FreeBSD due
+ to an apparently common parallel port driver bug (STR
+ #2161)
+ - ippReadIO() incorrectly returned IPP_IDLE when the
+ initial IPP message header could not be read (STR
+ #2179)
+ - cupsRasterInterpretPPD() did not support custom options
+ (STR #1960)
+ - Collated output produced by the PostScript filter could
+ lose some options (STR #2137)
+ - job-hold-until with time values for the next day would
+ be held for 60 days (STR #2144)
+ - Some types of Sun raster files did not print correctly
+ (STR #2107)
+ - Raw PBM files did not print correctly (STR #2106)
+ - The SNMP backend no longer uses IPP with HP printers,
+ as some recent firmware versions appear to not work
+ (STR #2055)
+ - cupsMarkOptions() did not handle the
+ multiple-document-handling option (STR #2135)
+ - lpstat did not show the local job ID of active printers
+ (STR #2125)
+ - The backends incorrectly used STATUS:
+ media-tray-empty-error messages for out-of-paper
+ conditions (STR #2123, STR #2124)
+ - cupsGetPPD2() returned the wrong error when the PPD
+ file did not exist (STR #2122)
+ - cupsDoAuthentication() did not translate the password
+ prompt (STR #2121)
+ - httpGetLength2() did not handle error messages without
+ content correctly (STR #2133)
+ - Added support for 32/64-bit libraries on HP-UX Itanium
+ systems (STR #2115)
+ - Fixed a configure script problem with the 32/64-bit
+ library support (STR #2114)
+ - The PostScript filter did not properly output document
+ setup commands for reversed output (STR #2111)
+ - The scheduler did not parse IPv6 netmasks properly (STR
+ #2117)
+
+
CHANGES IN CUPS V1.2.7
- Documentation updates (STR #2089)
diff --git a/CREDITS.txt b/CREDITS.txt
index cfd4fcd33..c839ba1e4 100644
--- a/CREDITS.txt
+++ b/CREDITS.txt
@@ -1,4 +1,4 @@
-CREDITS.txt - 2006-10-02
+CREDITS.txt - 2007-02-05
------------------------
Few projects are completed by one person, and CUPS is no exception. We'd
@@ -6,6 +6,7 @@ like to thank the following individuals for their contributions:
Nathaniel Barbour - Lots of testing and feedback.
N. Becker - setsid().
+ Philippe Combes - French localization.
Jean-Eric Cuendet - GhostScript filters for CUPS.
Van Dang - HTTP and IPP policeman.
L. Peter Deutsch - MD5 code.
diff --git a/INSTALL.txt b/INSTALL.txt
index d6f9a0179..b9636837c 100644
--- a/INSTALL.txt
+++ b/INSTALL.txt
@@ -1,4 +1,4 @@
-INSTALL - CUPS v1.2.7 - 2006-11-16
+INSTALL - CUPS v1.2.8 - 2007-02-14
----------------------------------
This file describes how to compile and install CUPS from source
diff --git a/LICENSE.txt b/LICENSE.txt
index b15a77b77..4a3e913c3 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,6 +1,6 @@
Common UNIX Printing System License Agreement
- Copyright 1997-2006 by Easy Software Products
+ Copyright 1997-2007 by Easy Software Products
44141 AIRPORT VIEW DR STE 204
HOLLYWOOD, MARYLAND 20636 USA
diff --git a/Makefile b/Makefile
index 45dd92c05..3d96ec143 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
#
-# "$Id: Makefile 5902 2006-08-29 15:51:19Z mike $"
+# "$Id: Makefile 6128 2006-12-05 16:07:23Z mike $"
#
# Top-level Makefile for the Common UNIX Printing System (CUPS).
#
@@ -237,7 +237,7 @@ check: all
EPMFLAGS = -v --output-dir dist $(EPMARCH)
-aix bsd deb depot inst pkg rpm setld slackware swinstall tardist:
+aix bsd deb depot inst pkg setld slackware swinstall tardist:
epm $(EPMFLAGS) -f $@ cups packaging/cups.list
epm:
@@ -246,6 +246,9 @@ epm:
osx:
epm $(EPMFLAGS) -f osx -s packaging/installer.tif cups packaging/cups.list
+rpm:
+ epm $(EPMFLAGS) -f rpm -s packaging/installer.gif cups packaging/cups.list
+
.PHONEY: dist
dist: all
$(RM) -r dist
@@ -260,5 +263,5 @@ dist: all
#
-# End of "$Id: Makefile 5902 2006-08-29 15:51:19Z mike $".
+# End of "$Id: Makefile 6128 2006-12-05 16:07:23Z mike $".
#
diff --git a/README.txt b/README.txt
index d8b6b0fb0..8d555a2f3 100644
--- a/README.txt
+++ b/README.txt
@@ -1,4 +1,4 @@
-README - CUPS v1.2.7 - 2006-11-16
+README - CUPS v1.2.8 - 2007-02-14
---------------------------------
Looking for compile instructions? Read the file "INSTALL.txt"
@@ -170,7 +170,7 @@ PRINTING FILES
LEGAL STUFF
- CUPS is Copyright 1993-2006 by Easy Software Products. CUPS,
+ CUPS is Copyright 1993-2007 by Easy Software Products. CUPS,
the CUPS logo, and the Common UNIX Printing System are the
trademark property of Easy Software Products.
diff --git a/backend/ipp.c b/backend/ipp.c
index eb631b866..693911c65 100644
--- a/backend/ipp.c
+++ b/backend/ipp.c
@@ -1,5 +1,5 @@
/*
- * "$Id: ipp.c 6061 2006-10-23 00:26:52Z mike $"
+ * "$Id: ipp.c 6214 2007-01-23 17:01:48Z mike $"
*
* IPP backend for the Common UNIX Printing System (CUPS).
*
@@ -1380,7 +1380,7 @@ report_printer_state(ipp_t *ipp) /* I - IPP response */
strlcat(state, reason, sizeof(state));
prefix = ",";
- message = NULL;
+ message = "";
if (!strncmp(reason, "media-needed", 12))
message = "Media tray needs to be filled.";
@@ -1666,5 +1666,5 @@ sigterm_handler(int sig) /* I - Signal */
/*
- * End of "$Id: ipp.c 6061 2006-10-23 00:26:52Z mike $".
+ * End of "$Id: ipp.c 6214 2007-01-23 17:01:48Z mike $".
*/
diff --git a/backend/parallel.c b/backend/parallel.c
index 627c6227f..c33fc10d2 100644
--- a/backend/parallel.c
+++ b/backend/parallel.c
@@ -1,5 +1,5 @@
/*
- * "$Id: parallel.c 6068 2006-10-27 17:10:34Z mike $"
+ * "$Id: parallel.c 6181 2007-01-03 18:51:27Z mike $"
*
* Parallel port backend for the Common UNIX Printing System (CUPS).
*
@@ -189,10 +189,10 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
do
{
-#ifdef __linux
+#if defined(__linux) || defined(__FreeBSD__)
/*
- * The Linux parallel port driver currently is broken WRT select()
- * and bidirection I/O...
+ * The Linux and FreeBSD parallel port drivers currently are broken WRT
+ * select() and bidirection I/O...
*/
device_fd = open(resource, O_WRONLY | O_EXCL);
@@ -206,7 +206,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
else
use_bc = 1;
-#endif /* __linux */
+#endif /* __linux || __FreeBSD__ */
if (device_fd == -1)
{
@@ -598,5 +598,5 @@ list_devices(void)
/*
- * End of "$Id: parallel.c 6068 2006-10-27 17:10:34Z mike $".
+ * End of "$Id: parallel.c 6181 2007-01-03 18:51:27Z mike $".
*/
diff --git a/backend/runloop.c b/backend/runloop.c
index 82673a447..f613c0540 100644
--- a/backend/runloop.c
+++ b/backend/runloop.c
@@ -1,5 +1,5 @@
/*
- * "$Id: runloop.c 5776 2006-07-26 20:55:13Z mike $"
+ * "$Id: runloop.c 6145 2006-12-06 20:10:16Z mike $"
*
* Common run loop API for the Common UNIX Printing System (CUPS).
*
@@ -206,7 +206,7 @@ backendRunLoop(int print_fd, /* I - Print file descriptor */
if (!paperout)
{
fputs("ERROR: Out of paper!\n", stderr);
- fputs("STATUS: +media-tray-empty-error\n", stderr);
+ fputs("STATE: +media-empty-error\n", stderr);
paperout = 1;
}
}
@@ -229,7 +229,7 @@ backendRunLoop(int print_fd, /* I - Print file descriptor */
{
if (paperout)
{
- fputs("STATUS: -media-tray-empty-error\n", stderr);
+ fputs("STATE: -media-empty-error\n", stderr);
paperout = 0;
}
@@ -258,5 +258,5 @@ backendRunLoop(int print_fd, /* I - Print file descriptor */
/*
- * End of "$Id: runloop.c 5776 2006-07-26 20:55:13Z mike $".
+ * End of "$Id: runloop.c 6145 2006-12-06 20:10:16Z mike $".
*/
diff --git a/backend/snmp.c b/backend/snmp.c
index b76283aa2..fd7d3922e 100644
--- a/backend/snmp.c
+++ b/backend/snmp.c
@@ -1,5 +1,5 @@
/*
- * "$Id: snmp.c 6090 2006-11-14 16:35:27Z mike $"
+ * "$Id: snmp.c 6181 2007-01-03 18:51:27Z mike $"
*
* SNMP discovery backend for the Common UNIX Printing System (CUPS).
*
@@ -1471,6 +1471,8 @@ fix_make_model(
}
else if (!strncasecmp(old_make_model, "deskjet", 7))
snprintf(make_model, make_model_size, "HP DeskJet%s", old_make_model + 7);
+ else if (!strncasecmp(old_make_model, "officejet", 9))
+ snprintf(make_model, make_model_size, "HP OfficeJet%s", old_make_model + 9);
else if (!strncasecmp(old_make_model, "stylus_pro_", 11))
snprintf(make_model, make_model_size, "EPSON Stylus Pro %s",
old_make_model + 11);
@@ -1729,14 +1731,16 @@ probe_device(snmp_cache_t *device) /* I - Device */
if (device->make_and_model &&
(!strncasecmp(device->make_and_model, "Epson", 5) ||
+ !strncasecmp(device->make_and_model, "HP ", 3) ||
+ !strncasecmp(device->make_and_model, "Hewlett", 7) ||
!strncasecmp(device->make_and_model, "Kyocera", 7) ||
!strncasecmp(device->make_and_model, "Lexmark", 7) ||
!strncasecmp(device->make_and_model, "Tektronix", 9) ||
!strncasecmp(device->make_and_model, "Xerox", 5)))
{
/*
- * Epson, Kyocera, Lexmark, Tektronix, and Xerox printers often lock up on
- * IPP probes, so exclude them from the IPP connection test...
+ * Epson, HP, Kyocera, Lexmark, Tektronix, and Xerox printers often lock
+ * up on IPP probes, so exclude them from the IPP connection test...
*/
http = NULL;
@@ -1769,9 +1773,9 @@ probe_device(snmp_cache_t *device) /* I - Device */
static const char * const resources[] =
{ /* Common resource paths for IPP */
"/ipp",
- "/ipp/port2",
- "/ipp/port3",
- "/EPSON_IPP_Printer",
+ /*"/ipp/port2",*/
+ /*"/ipp/port3",*/
+ /*"/EPSON_IPP_Printer",*/
"/LPT1",
"/LPT2",
"/COM1",
@@ -2455,5 +2459,5 @@ update_cache(snmp_cache_t *device, /* I - Device */
/*
- * End of "$Id: snmp.c 6090 2006-11-14 16:35:27Z mike $".
+ * End of "$Id: snmp.c 6181 2007-01-03 18:51:27Z mike $".
*/
diff --git a/backend/usb-unix.c b/backend/usb-unix.c
index 4a4cbe259..7e78a3f27 100644
--- a/backend/usb-unix.c
+++ b/backend/usb-unix.c
@@ -1,5 +1,5 @@
/*
- * "$Id: usb-unix.c 6111 2006-11-15 20:28:39Z mike $"
+ * "$Id: usb-unix.c 6234 2007-02-05 20:25:50Z mike $"
*
* USB port backend for the Common UNIX Printing System (CUPS).
*
@@ -84,7 +84,9 @@ print_device(const char *uri, /* I - Device URI */
* device ID over and over and over when they get a read request...
*/
- use_bc = strcasecmp(hostname, "Canon") && !strstr(hostname, "Minolta");
+ use_bc = strcasecmp(hostname, "Canon") &&
+ strcasecmp(hostname, "Konica Minolta") &&
+ strcasecmp(hostname, "Minolta");
if ((device_fd = open_device(uri, &use_bc)) == -1)
{
@@ -524,5 +526,5 @@ open_device(const char *uri, /* I - Device URI */
/*
- * End of "$Id: usb-unix.c 6111 2006-11-15 20:28:39Z mike $".
+ * End of "$Id: usb-unix.c 6234 2007-02-05 20:25:50Z mike $".
*/
diff --git a/cgi-bin/ipp-var.c b/cgi-bin/ipp-var.c
index c312d8bff..4639643de 100644
--- a/cgi-bin/ipp-var.c
+++ b/cgi-bin/ipp-var.c
@@ -1,5 +1,5 @@
/*
- * "$Id: ipp-var.c 5838 2006-08-17 14:41:42Z mike $"
+ * "$Id: ipp-var.c 6244 2007-02-06 21:08:59Z mike $"
*
* CGI <-> IPP variable routines for the Common UNIX Printing System (CUPS).
*
@@ -914,7 +914,7 @@ cgiSetIPPObjectVars(
snprintf(valptr, sizeof(value) - (valptr - value),
"%s", url,
- strrchr(url, '/') + 1);
+ strrchr(attr->values[i].string.text, '/') + 1);
}
else
cgiRewriteURL(attr->values[i].string.text, valptr,
@@ -1280,5 +1280,5 @@ cgiText(const char *message) /* I - Message */
/*
- * End of "$Id: ipp-var.c 5838 2006-08-17 14:41:42Z mike $".
+ * End of "$Id: ipp-var.c 6244 2007-02-06 21:08:59Z mike $".
*/
diff --git a/config-scripts/cups-3264.m4 b/config-scripts/cups-3264.m4
new file mode 100644
index 000000000..1ce80df9d
--- /dev/null
+++ b/config-scripts/cups-3264.m4
@@ -0,0 +1,149 @@
+dnl
+dnl "$Id$"
+dnl
+dnl 32/64-bit library support stuff for the Common UNIX Printing System (CUPS).
+dnl
+dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
+dnl
+dnl These coded instructions, statements, and computer programs are the
+dnl property of Easy Software Products and are protected by Federal
+dnl copyright law. Distribution and use rights are outlined in the file
+dnl "LICENSE.txt" which should have been included with this file. If this
+dnl file is missing or damaged please contact Easy Software Products
+dnl at:
+dnl
+dnl Attn: CUPS Licensing Information
+dnl Easy Software Products
+dnl 44141 Airport View Drive, Suite 204
+dnl Hollywood, Maryland 20636 USA
+dnl
+dnl Voice: (301) 373-9600
+dnl EMail: cups-info@cups.org
+dnl WWW: http://www.cups.org
+dnl
+
+dnl Setup support for separate 32/64-bit library generation...
+AC_ARG_ENABLE(32bit, [ --enable-32bit generate 32-bit libraries on 32/64-bit systems, default=no])
+
+INSTALL32=""
+LIB32CUPS=""
+LIB32CUPSIMAGE=""
+LIB32DIR=""
+UNINSTALL32=""
+
+AC_SUBST(INSTALL32)
+AC_SUBST(LIB32CUPS)
+AC_SUBST(LIB32CUPSIMAGE)
+AC_SUBST(LIB32DIR)
+AC_SUBST(UNINSTALL32)
+
+AC_ARG_ENABLE(64bit, [ --enable-64bit generate 64-bit libraries on 32/64-bit systems, default=no])
+
+INSTALL64=""
+LIB64CUPS=""
+LIB64CUPSIMAGE=""
+LIB64DIR=""
+UNINSTALL64=""
+
+AC_SUBST(INSTALL64)
+AC_SUBST(LIB64CUPS)
+AC_SUBST(LIB64CUPSIMAGE)
+AC_SUBST(LIB64DIR)
+AC_SUBST(UNINSTALL64)
+
+case "$uname" in
+ HP-UX*)
+ if test "x$enable_32bit" = xyes; then
+ # Build 32-bit libraries, 64-bit base...
+ INSTALL32="install32bit"
+ LIB32CUPS="32bit/libcups.so.2"
+ LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
+ LIB32DIR="$exec_prefix/lib"
+ if test -d /usr/lib/hpux32; then
+ LIB32DIR="${LIB32DIR}/hpux32"
+ fi
+ UNINSTALL32="uninstall32bit"
+ fi
+
+ if test "x$enable_64bit" = xyes; then
+ # Build 64-bit libraries, 32-bit base...
+ INSTALL64="install64bit"
+ LIB64CUPS="64bit/libcups.so.2"
+ LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
+ LIB64DIR="$exec_prefix/lib"
+ if test -d /usr/lib/hpux64; then
+ LIB64DIR="${LIB64DIR}/hpux64"
+ fi
+ UNINSTALL64="uninstall64bit"
+ fi
+ ;;
+
+ IRIX)
+ if test "x$enable_32bit" = xyes; then
+ INSTALL32="install32bit"
+ LIB32CUPS="32bit/libcups.so.2"
+ LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
+ LIB32DIR="$prefix/lib32"
+ UNINSTALL32="uninstall32bit"
+ fi
+
+ if test "x$enable_64bit" = xyes; then
+ # Build 64-bit libraries, 32-bit base...
+ INSTALL64="install64bit"
+ LIB64CUPS="64bit/libcups.so.2"
+ LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
+ LIB64DIR="$prefix/lib64"
+ UNINSTALL64="uninstall64bit"
+ fi
+ ;;
+
+ Linux*)
+ if test "x$enable_32bit" = xyes; then
+ # Build 32-bit libraries, 64-bit base...
+ INSTALL32="install32bit"
+ LIB32CUPS="32bit/libcups.so.2"
+ LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
+ LIB32DIR="$exec_prefix/lib"
+ if test -d /usr/lib32; then
+ LIB32DIR="${LIB32DIR}32"
+ fi
+ UNINSTALL32="uninstall32bit"
+ fi
+
+ if test "x$enable_64bit" = xyes; then
+ # Build 64-bit libraries, 32-bit base...
+ INSTALL64="install64bit"
+ LIB64CUPS="64bit/libcups.so.2"
+ LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
+ LIB64DIR="$exec_prefix/lib"
+ if test -d /usr/lib64; then
+ LIB64DIR="${LIB64DIR}64"
+ fi
+ UNINSTALL64="uninstall64bit"
+ fi
+ ;;
+
+ SunOS*)
+ if test "x$enable_32bit" = xyes; then
+ # Build 32-bit libraries, 64-bit base...
+ INSTALL32="install32bit"
+ LIB32CUPS="32bit/libcups.so.2"
+ LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
+ LIB32DIR="$exec_prefix/lib/32"
+ UNINSTALL32="uninstall32bit"
+ fi
+
+ if test "x$enable_64bit" = xyes; then
+ # Build 64-bit libraries, 32-bit base...
+ INSTALL64="install64bit"
+ LIB64CUPS="64bit/libcups.so.2"
+ LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
+ LIB64DIR="$exec_prefix/lib/64"
+ UNINSTALL64="uninstall64bit"
+ fi
+ ;;
+esac
+
+dnl
+dnl End of "$Id$".
+dnl
diff --git a/config-scripts/cups-common.m4 b/config-scripts/cups-common.m4
index 7e54767fe..8610523ba 100644
--- a/config-scripts/cups-common.m4
+++ b/config-scripts/cups-common.m4
@@ -1,5 +1,5 @@
dnl
-dnl "$Id: cups-common.m4 6092 2006-11-14 16:36:36Z mike $"
+dnl "$Id: cups-common.m4 6145 2006-12-06 20:10:16Z mike $"
dnl
dnl Common configuration stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -29,7 +29,7 @@ dnl Set the name of the config header file...
AC_CONFIG_HEADER(config.h)
dnl Version number information...
-CUPS_VERSION="1.2.7"
+CUPS_VERSION="1.2.8"
CUPS_REVISION=""
AC_SUBST(CUPS_VERSION)
@@ -264,5 +264,5 @@ AC_SUBST(DEFAULT_IPP_PORT)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
dnl
-dnl End of "$Id: cups-common.m4 6092 2006-11-14 16:36:36Z mike $".
+dnl End of "$Id: cups-common.m4 6145 2006-12-06 20:10:16Z mike $".
dnl
diff --git a/config-scripts/cups-compiler.m4 b/config-scripts/cups-compiler.m4
index f265d2ca0..9a15cb535 100644
--- a/config-scripts/cups-compiler.m4
+++ b/config-scripts/cups-compiler.m4
@@ -1,5 +1,5 @@
dnl
-dnl "$Id: cups-compiler.m4 6049 2006-10-20 15:07:21Z mike $"
+dnl "$Id: cups-compiler.m4 6145 2006-12-06 20:10:16Z mike $"
dnl
dnl Compiler stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -46,41 +46,15 @@ fi
AC_SUBST(ARCHFLAGS)
dnl Setup support for separate 32/64-bit library generation...
-AC_ARG_ENABLE(32bit, [ --enable-32bit generate 32-bit libraries on 32/64-bit systems, default=no])
AC_ARG_WITH(arch32flags, [ --with-arch32flags="flags"
specifies 32-bit architecture flags])
-
ARCH32FLAGS=""
-INSTALL32=""
-LIB32CUPS=""
-LIB32CUPSIMAGE=""
-LIB32DIR=""
-UNINSTALL32=""
-
AC_SUBST(ARCH32FLAGS)
-AC_SUBST(INSTALL32)
-AC_SUBST(LIB32CUPS)
-AC_SUBST(LIB32CUPSIMAGE)
-AC_SUBST(LIB32DIR)
-AC_SUBST(UNINSTALL32)
-AC_ARG_ENABLE(64bit, [ --enable-64bit generate 64-bit libraries on 32/64-bit systems, default=no])
AC_ARG_WITH(arch64flags, [ --with-arch64flags="flags"
specifies 64-bit architecture flags])
-
ARCH64FLAGS=""
-INSTALL64=""
-LIB64CUPS=""
-LIB64CUPSIMAGE=""
-LIB64DIR=""
-UNINSTALL64=""
-
AC_SUBST(ARCH64FLAGS)
-AC_SUBST(INSTALL64)
-AC_SUBST(LIB64CUPS)
-AC_SUBST(LIB64CUPSIMAGE)
-AC_SUBST(LIB64DIR)
-AC_SUBST(UNINSTALL64)
dnl Position-Independent Executable support on Linux and *BSD...
AC_ARG_ENABLE(pie, [ --enable-pie use GCC -fPIE option, default=no])
@@ -129,6 +103,42 @@ if test -n "$GCC"; then
fi
case "$uname" in
+ HP-UX*)
+ if test "x$enable_32bit" = xyes; then
+ # Build 32-bit libraries, 64-bit base...
+ if test -z "$with_arch32flags"; then
+ ARCH32FLAGS="-milp32"
+ else
+ ARCH32FLAGS="$with_arch32flags"
+ fi
+
+ if test -z "$with_archflags"; then
+ if test -z "$with_arch64flags"; then
+ ARCHFLAGS="-mlp64"
+ else
+ ARCHFLAGS="$with_arch64flags"
+ fi
+ fi
+ fi
+
+ if test "x$enable_64bit" = xyes; then
+ # Build 64-bit libraries, 32-bit base...
+ if test -z "$with_arch64flags"; then
+ ARCH64FLAGS="-mlp64"
+ else
+ ARCH64FLAGS="$with_arch64flags"
+ fi
+
+ if test -z "$with_archflags"; then
+ if test -z "$with_arch32flags"; then
+ ARCHFLAGS="-milp32"
+ else
+ ARCHFLAGS="$with_arch32flags"
+ fi
+ fi
+ fi
+ ;;
+
IRIX)
if test "x$enable_32bit" = xyes; then
# Build 32-bit libraries, 64-bit base...
@@ -137,11 +147,6 @@ if test -n "$GCC"; then
else
ARCH32FLAGS="$with_arch32flags"
fi
- INSTALL32="install32bit"
- LIB32CUPS="32bit/libcups.so.2"
- LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
- LIB32DIR="$prefix/lib32"
- UNINSTALL32="uninstall32bit"
if test -z "$with_archflags"; then
if test -z "$with_arch64flags"; then
@@ -159,11 +164,6 @@ if test -n "$GCC"; then
else
ARCH64FLAGS="$with_arch64flags"
fi
- INSTALL64="install64bit"
- LIB64CUPS="64bit/libcups.so.2"
- LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
- LIB64DIR="$prefix/lib64"
- UNINSTALL64="uninstall64bit"
if test -z "$with_archflags"; then
if test -z "$with_arch32flags"; then
@@ -183,14 +183,6 @@ if test -n "$GCC"; then
else
ARCH32FLAGS="$with_arch32flags"
fi
- INSTALL32="install32bit"
- LIB32CUPS="32bit/libcups.so.2"
- LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
- LIB32DIR="$exec_prefix/lib"
- if test -d /usr/lib32; then
- LIB32DIR="${LIB32DIR}32"
- fi
- UNINSTALL32="uninstall32bit"
if test -z "$with_archflags"; then
if test -z "$with_arch64flags"; then
@@ -208,14 +200,6 @@ if test -n "$GCC"; then
else
ARCH64FLAGS="$with_arch64flags"
fi
- INSTALL64="install64bit"
- LIB64CUPS="64bit/libcups.so.2"
- LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
- LIB64DIR="$exec_prefix/lib"
- if test -d /usr/lib64; then
- LIB64DIR="${LIB64DIR}64"
- fi
- UNINSTALL64="uninstall64bit"
if test -z "$with_archflags"; then
if test -z "$with_arch32flags"; then
@@ -235,11 +219,6 @@ if test -n "$GCC"; then
else
ARCH32FLAGS="$with_arch32flags"
fi
- INSTALL32="install32bit"
- LIB32CUPS="32bit/libcups.so.2"
- LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
- LIB32DIR="$exec_prefix/lib/32"
- UNINSTALL32="uninstall32bit"
if test -z "$with_archflags"; then
if test -z "$with_arch64flags"; then
@@ -257,11 +236,6 @@ if test -n "$GCC"; then
else
ARCH64FLAGS="$with_arch64flags"
fi
- INSTALL64="install64bit"
- LIB64CUPS="64bit/libcups.so.2"
- LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
- LIB64DIR="$exec_prefix/lib/64"
- UNINSTALL64="uninstall64bit"
if test -z "$with_archflags"; then
if test -z "$with_arch32flags"; then
@@ -323,11 +297,6 @@ else
else
ARCH32FLAGS="$with_arch32flags"
fi
- INSTALL32="install32bit"
- LIB32CUPS="32bit/libcups.so.2"
- LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
- LIB32DIR="$prefix/lib32"
- UNINSTALL32="uninstall32bit"
if test -z "$with_archflags"; then
if test -z "$with_arch64flags"; then
@@ -345,11 +314,6 @@ else
else
ARCH64FLAGS="$with_arch64flags"
fi
- INSTALL64="install64bit"
- LIB64CUPS="64bit/libcups.so.2"
- LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
- LIB64DIR="$prefix/lib64"
- UNINSTALL64="uninstall64bit"
if test -z "$with_archflags"; then
if test -z "$with_arch32flags"; then
@@ -388,11 +352,6 @@ else
# Compiling on a Solaris system, build 64-bit
# binaries with separate 32-bit libraries...
ARCH32FLAGS="-xarch=generic"
- INSTALL32="install32bit"
- LIB32CUPS="32bit/libcups.so.2"
- LIB32CUPSIMAGE="32bit/libcupsimage.so.2"
- LIB32DIR="$exec_prefix/lib/32"
- UNINSTALL32="uninstall32bit"
if test "x$with_optim" = x; then
# Suppress all of Sun's questionable
@@ -412,11 +371,6 @@ else
if test "x$enable_64bit" = xyes; then
# Build 64-bit libraries...
ARCH64FLAGS="-xarch=generic64"
- INSTALL64="install64bit"
- LIB64CUPS="64bit/libcups.so.2"
- LIB64CUPSIMAGE="64bit/libcupsimage.so.2"
- LIB64DIR="$exec_prefix/lib/64"
- UNINSTALL64="uninstall64bit"
fi
if test "x$with_optim" = x; then
@@ -481,5 +435,5 @@ case $uname in
esac
dnl
-dnl End of "$Id: cups-compiler.m4 6049 2006-10-20 15:07:21Z mike $".
+dnl End of "$Id: cups-compiler.m4 6145 2006-12-06 20:10:16Z mike $".
dnl
diff --git a/config-scripts/cups-defaults.m4 b/config-scripts/cups-defaults.m4
index 66810f9e5..48b3aea5f 100644
--- a/config-scripts/cups-defaults.m4
+++ b/config-scripts/cups-defaults.m4
@@ -1,10 +1,10 @@
dnl
-dnl "$Id: cups-defaults.m4 6118 2006-11-16 13:34:44Z mike $"
+dnl "$Id: cups-defaults.m4 6234 2007-02-05 20:25:50Z mike $"
dnl
dnl Default cupsd configuration settings for the Common UNIX Printing System
dnl (CUPS).
dnl
-dnl Copyright 2006 by Easy Software Products, all rights reserved.
+dnl Copyright 2006-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
@@ -24,11 +24,11 @@ dnl WWW: http://www.cups.org
dnl
dnl Default langugages...
-AC_ARG_WITH(languages, [ --with-languages set installed languages, default="de es ja pl sv" ],
+AC_ARG_WITH(languages, [ --with-languages set installed languages, default="de es et fr it ja pl sv" ],
if test "x$withval" != xno; then
LANGUAGES="$withval"
fi,
- LANGUAGES="de es et it ja pl sv")
+ LANGUAGES="de es et fr it ja pl sv")
AC_SUBST(LANGUAGES)
dnl Default ConfigFilePerm
@@ -252,5 +252,5 @@ fi
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTCAP, "$CUPS_DEFAULT_PRINTCAP")
dnl
-dnl End of "$Id: cups-defaults.m4 6118 2006-11-16 13:34:44Z mike $".
+dnl End of "$Id: cups-defaults.m4 6234 2007-02-05 20:25:50Z mike $".
dnl
diff --git a/config-scripts/cups-opsys.m4 b/config-scripts/cups-opsys.m4
index b47f473a7..8d510da91 100644
--- a/config-scripts/cups-opsys.m4
+++ b/config-scripts/cups-opsys.m4
@@ -1,5 +1,5 @@
dnl
-dnl "$Id: cups-opsys.m4 5466 2006-04-26 19:52:27Z mike $"
+dnl "$Id: cups-opsys.m4 6145 2006-12-06 20:10:16Z mike $"
dnl
dnl Operating system stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -22,9 +22,10 @@ dnl EMail: cups-info@cups.org
dnl WWW: http://www.cups.org
dnl
-dnl Get the operating system and version number...
+dnl Get the operating system, version number, and architecture...
uname=`uname`
uversion=`uname -r | sed -e '1,$s/^[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\).*/\1\2/'`
+uarch=`uname -m`
case "$uname" in
GNU* | GNU/*)
@@ -39,5 +40,5 @@ case "$uname" in
esac
dnl
-dnl "$Id: cups-opsys.m4 5466 2006-04-26 19:52:27Z mike $"
+dnl "$Id: cups-opsys.m4 6145 2006-12-06 20:10:16Z mike $"
dnl
diff --git a/config-scripts/cups-sharedlibs.m4 b/config-scripts/cups-sharedlibs.m4
index 86d93e1a1..ca695aa13 100644
--- a/config-scripts/cups-sharedlibs.m4
+++ b/config-scripts/cups-sharedlibs.m4
@@ -1,5 +1,5 @@
dnl
-dnl "$Id: cups-sharedlibs.m4 5582 2006-05-24 01:00:35Z mike $"
+dnl "$Id: cups-sharedlibs.m4 6145 2006-12-06 20:10:16Z mike $"
dnl
dnl Shared library support for the Common UNIX Printing System (CUPS).
dnl
@@ -36,10 +36,20 @@ if test x$enable_shared != xno; then
DSOFLAGS="$DSOFLAGS -Wl,-h,\`basename \$@\` -G \$(OPTIM)"
;;
HP-UX*)
- LIBCUPS="libcups.sl.2"
- LIBCUPSIMAGE="libcupsimage.sl.2"
- DSO="\$(LD)"
- DSOFLAGS="$DSOFLAGS -b -z +h \`basename \$@\`"
+ case "$uarch" in
+ ia64)
+ LIBCUPS="libcups.so.2"
+ LIBCUPSIMAGE="libcupsimage.so.2"
+ DSO="\$(CC)"
+ DSOFLAGS="$DSOFLAGS -Wl,-b,-z,+h,\`basename \$@\`"
+ ;;
+ *)
+ LIBCUPS="libcups.sl.2"
+ LIBCUPSIMAGE="libcupsimage.sl.2"
+ DSO="\$(LD)"
+ DSOFLAGS="$DSOFLAGS -b -z +h \`basename \$@\`"
+ ;;
+ esac
;;
IRIX)
LIBCUPS="libcups.so.2"
@@ -126,9 +136,18 @@ if test "$DSO" != ":"; then
case $uname in
HP-UX*)
# HP-UX needs the path, even for /usr/lib...
- DSOFLAGS="+s +b $libdir $DSOFLAGS"
- DSO32FLAGS="+s +b $LIB32DIR $DSO32FLAGS"
- DSO64FLAGS="+s +b $LIB64DIR $DSO64FLAGS"
+ case "$uarch" in
+ ia64)
+ DSOFLAGS="-Wl,+s,+b,$libdir $DSOFLAGS"
+ DSO32FLAGS="-Wl,+s,+b,$LIB32DIR $DSO32FLAGS"
+ DSO64FLAGS="-Wl,+s,+b,$LIB64DIR $DSO64FLAGS"
+ ;;
+ *)
+ DSOFLAGS="+s +b $libdir $DSOFLAGS"
+ DSO32FLAGS="+s +b $LIB32DIR $DSO32FLAGS"
+ DSO64FLAGS="+s +b $LIB64DIR $DSO64FLAGS"
+ ;;
+ esac
LDFLAGS="$LDFLAGS -Wl,+s,+b,$libdir"
EXPORT_LDFLAGS="-Wl,+s,+b,$libdir"
;;
@@ -173,5 +192,5 @@ AC_SUBST(IMGLIBS)
AC_SUBST(EXPORT_LDFLAGS)
dnl
-dnl End of "$Id: cups-sharedlibs.m4 5582 2006-05-24 01:00:35Z mike $".
+dnl End of "$Id: cups-sharedlibs.m4 6145 2006-12-06 20:10:16Z mike $".
dnl
diff --git a/config-scripts/cups-ssl.m4 b/config-scripts/cups-ssl.m4
index ce6ea0859..2522e9b16 100644
--- a/config-scripts/cups-ssl.m4
+++ b/config-scripts/cups-ssl.m4
@@ -1,9 +1,9 @@
dnl
-dnl "$Id: cups-ssl.m4 5630 2006-06-05 18:42:53Z mike $"
+dnl "$Id: cups-ssl.m4 6238 2007-02-06 16:04:25Z mike $"
dnl
dnl OpenSSL/GNUTLS stuff for the Common UNIX Printing System (CUPS).
dnl
-dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
+dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
@@ -42,15 +42,33 @@ if test x$enable_ssl != xno; then
dnl Look for CDSA...
if test "x${SSLLIBS}" = "x" -a "x${enable_cdsassl}" != "xno"; then
if test $uname = Darwin; then
- AC_CHECK_HEADER(Security/SecureTransport.h,
- [SSLLIBS="-framework CoreFoundation -framework Security"
- # MacOS X doesn't (yet) come with pre-installed encryption
- # certificates for CUPS, so don't enable encryption on
- # /admin just yet...
- #ENCRYPTION_REQUIRED=" Encryption Required"
- AC_CHECK_HEADER(Security/SecBasePriv.h,AC_DEFINE(HAVE_SECBASEPRIV_H))
- AC_DEFINE(HAVE_SSL)
- AC_DEFINE(HAVE_CDSASSL)])
+ AC_CHECK_HEADER(Security/SecureTransport.h, [
+ SSLLIBS="-framework CoreFoundation -framework Security"
+ # MacOS X doesn't (yet) come with pre-installed encryption
+ # certificates for CUPS, so don't enable encryption on
+ # /admin just yet...
+ #ENCRYPTION_REQUIRED=" Encryption Required"
+ AC_DEFINE(HAVE_SSL)
+ AC_DEFINE(HAVE_CDSASSL)
+
+ dnl Check for the various security headers...
+ AC_CHECK_HEADER(Security/SecPolicy.h,
+ AC_DEFINE(HAVE_SECPOLICY_H))
+ AC_CHECK_HEADER(Security/SecPolicyPriv.h,
+ AC_DEFINE(HAVE_SECPOLICYPRIV_H))
+ AC_CHECK_HEADER(Security/SecBasePriv.h,
+ AC_DEFINE(HAVE_SECBASEPRIV_H))
+ AC_CHECK_HEADER(Security/SecIdentitySearchPriv.h,
+ AC_DEFINE(HAVE_SECIDENTITYSEARCHPRIV_H))
+
+ dnl Check for SecIdentitySearchCreateWithPolicy...
+ AC_MSG_CHECKING(for SecIdentitySearchCreateWithPolicy)
+ if test $uversion -ge 80; then
+ AC_DEFINE(HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY)
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi])
fi
fi
@@ -115,5 +133,5 @@ AC_SUBST(EXPORT_SSLLIBS)
dnl
-dnl End of "$Id: cups-ssl.m4 5630 2006-06-05 18:42:53Z mike $".
+dnl End of "$Id: cups-ssl.m4 6238 2007-02-06 16:04:25Z mike $".
dnl
diff --git a/config.h.in b/config.h.in
index ae2fb9dc7..bad25cb09 100644
--- a/config.h.in
+++ b/config.h.in
@@ -1,9 +1,9 @@
/*
- * "$Id: config.h.in 6073 2006-11-02 20:01:54Z mike $"
+ * "$Id: config.h.in 6238 2007-02-06 16:04:25Z mike $"
*
* Configuration file for the Common UNIX Printing System (CUPS).
*
- * Copyright 1997-2006 by Easy Software Products.
+ * Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -268,10 +268,20 @@
/*
- * Do we have ?
+ * What Security framework headers do we have?
*/
+#undef HAVE_SECPOLICY_H
+#undef HAVE_SECPOLICYPRIV_H
#undef HAVE_SECBASEPRIV_H
+#undef HAVE_SECIDENTITYSEARCHPRIV_H
+
+
+/*
+ * Do we have the SecIdentitySearchCreateWithPolicy function?
+ */
+
+#undef HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY
/*
@@ -461,5 +471,5 @@
#endif /* !_CUPS_CONFIG_H_ */
/*
- * End of "$Id: config.h.in 6073 2006-11-02 20:01:54Z mike $".
+ * End of "$Id: config.h.in 6238 2007-02-06 16:04:25Z mike $".
*/
diff --git a/configure.in b/configure.in
index 07909d7e1..b96b42272 100644
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,5 @@
dnl
-dnl "$Id: configure.in 5804 2006-08-04 16:51:58Z mike $"
+dnl "$Id: configure.in 6145 2006-12-06 20:10:16Z mike $"
dnl
dnl Configuration script for the Common UNIX Printing System (CUPS).
dnl
@@ -29,6 +29,7 @@ sinclude(config-scripts/cups-common.m4)
sinclude(config-scripts/cups-directories.m4)
sinclude(config-scripts/cups-manpages.m4)
+sinclude(config-scripts/cups-3264.m4)
sinclude(config-scripts/cups-sharedlibs.m4)
sinclude(config-scripts/cups-libtool.m4)
sinclude(config-scripts/cups-compiler.m4)
@@ -83,5 +84,5 @@ AC_OUTPUT(Makedefs packaging/cups.list init/cups.sh init/cups-lpd cups-config
chmod +x cups-config
dnl
-dnl End of "$Id: configure.in 5804 2006-08-04 16:51:58Z mike $".
+dnl End of "$Id: configure.in 6145 2006-12-06 20:10:16Z mike $".
dnl
diff --git a/cups/adminutil.c b/cups/adminutil.c
index edef4f909..e697e6a1d 100644
--- a/cups/adminutil.c
+++ b/cups/adminutil.c
@@ -1,5 +1,5 @@
/*
- * "$Id: adminutil.c 5970 2006-09-19 20:11:08Z mike $"
+ * "$Id: adminutil.c 6262 2007-02-11 16:59:33Z mike $"
*
* Administration utility API definitions for the Common UNIX Printing
* System (CUPS).
@@ -7,7 +7,7 @@
* MANY OF THE FUNCTIONS IN THIS HEADER ARE PRIVATE AND SUBJECT TO
* CHANGE AT ANY TIME. USE AT YOUR OWN RISK.
*
- * Copyright 2001-2006 by Easy Software Products.
+ * Copyright 2001-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -48,9 +48,12 @@
#include "debug.h"
#include
#include
-#include
#include
-#include
+#ifdef WIN32
+#else
+# include
+# include
+#endif /* WIN32 */
/*
@@ -243,7 +246,7 @@ cupsAdminCreateWindowsPPD(
if ((ptr = strchr(line, ':')) == NULL)
{
snprintf(line, sizeof(line),
- _cupsLangString(language, _("Missing value on line %d!\n")),
+ _cupsLangString(language, _("Missing value on line %d!")),
linenum);
_cupsSetError(IPP_DOCUMENT_FORMAT_ERROR, line);
@@ -262,7 +265,7 @@ cupsAdminCreateWindowsPPD(
{
snprintf(line, sizeof(line),
_cupsLangString(language,
- _("Missing double quote on line %d!\n")),
+ _("Missing double quote on line %d!")),
linenum);
_cupsSetError(IPP_DOCUMENT_FORMAT_ERROR, line);
@@ -281,7 +284,7 @@ cupsAdminCreateWindowsPPD(
{
snprintf(line, sizeof(line),
_cupsLangString(language,
- _("Bad option + choice on line %d!\n")),
+ _("Bad option + choice on line %d!")),
linenum);
_cupsSetError(IPP_DOCUMENT_FORMAT_ERROR, line);
@@ -324,6 +327,21 @@ cupsAdminCreateWindowsPPD(
cupsFileClose(srcfp);
unlink(src);
+ if (linenum == 0)
+ {
+ snprintf(line, sizeof(line),
+ _cupsLangString(language, _("Empty PPD file!")),
+ linenum);
+ _cupsSetError(IPP_DOCUMENT_FORMAT_ERROR, line);
+
+ cupsFileClose(dstfp);
+ unlink(buffer);
+
+ *buffer = '\0';
+
+ return (NULL);
+ }
+
/*
* Now add the CUPS-specific attributes and options...
*/
@@ -656,7 +674,7 @@ cupsAdminExportSamba(
{
snprintf(message, sizeof(message),
_cupsLangString(language,
- _("Unable to set Windows printer driver (%d)!\n")),
+ _("Unable to set Windows printer driver (%d)!")),
status);
_cupsSetError(IPP_INTERNAL_ERROR, message);
@@ -985,6 +1003,11 @@ _cupsAdminSetServerSettings(
wrote_root_location; /* Wrote the / location? */
int indent; /* Indentation */
int cupsd_num_settings; /* New number of settings */
+ int old_remote_printers, /* Show remote printers */
+ old_share_printers, /* Share local printers */
+ old_remote_admin, /* Remote administration allowed? */
+ old_user_cancel_any, /* Cancel-job policy set? */
+ old_debug_logging; /* LogLevel debug set? */
cups_option_t *cupsd_settings, /* New settings */
*setting; /* Current setting */
_cups_globals_t *cg = _cupsGlobals(); /* Global data */
@@ -1017,39 +1040,134 @@ _cupsAdminSetServerSettings(
else
return (0);
+ /*
+ * Get current settings...
+ */
+
+ if (!_cupsAdminGetServerSettings(http, &cupsd_num_settings,
+ &cupsd_settings))
+ return (0);
+
+ if ((val = cupsGetOption(CUPS_SERVER_DEBUG_LOGGING, cupsd_num_settings,
+ cupsd_settings)) != NULL)
+ old_debug_logging = atoi(val);
+ else
+ old_debug_logging = 0;
+
+ if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ADMIN, cupsd_num_settings,
+ cupsd_settings)) != NULL)
+ old_remote_admin = atoi(val);
+ else
+ old_remote_admin = 0;
+
+ if ((val = cupsGetOption(CUPS_SERVER_REMOTE_PRINTERS, cupsd_num_settings,
+ cupsd_settings)) != NULL)
+ old_remote_printers = atoi(val);
+ else
+ old_remote_printers = 1;
+
+ if ((val = cupsGetOption(CUPS_SERVER_SHARE_PRINTERS, cupsd_num_settings,
+ cupsd_settings)) != NULL)
+ old_share_printers = atoi(val);
+ else
+ old_share_printers = 0;
+
+ if ((val = cupsGetOption(CUPS_SERVER_USER_CANCEL_ANY, cupsd_num_settings,
+ cupsd_settings)) != NULL)
+ old_user_cancel_any = atoi(val);
+ else
+ old_user_cancel_any = 0;
+
+ cupsFreeOptions(cupsd_num_settings, cupsd_settings);
+
/*
* Get basic settings...
*/
if ((val = cupsGetOption(CUPS_SERVER_DEBUG_LOGGING, num_settings,
settings)) != NULL)
+ {
debug_logging = atoi(val);
+
+ if (debug_logging == old_debug_logging)
+ {
+ /*
+ * No change to this setting...
+ */
+
+ debug_logging = -1;
+ }
+ }
else
- debug_logging = 0;
+ debug_logging = -1;
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ADMIN, num_settings,
settings)) != NULL)
+ {
remote_admin = atoi(val);
+
+ if (remote_admin == old_remote_admin)
+ {
+ /*
+ * No change to this setting...
+ */
+
+ remote_admin = -1;
+ }
+ }
else
- remote_admin = 0;
+ remote_admin = -1;
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_PRINTERS, num_settings,
settings)) != NULL)
+ {
remote_printers = atoi(val);
+
+ if (remote_printers == old_remote_printers)
+ {
+ /*
+ * No change to this setting...
+ */
+
+ remote_printers = -1;
+ }
+ }
else
- remote_printers = 1;
+ remote_printers = -1;
if ((val = cupsGetOption(CUPS_SERVER_SHARE_PRINTERS, num_settings,
settings)) != NULL)
+ {
share_printers = atoi(val);
+
+ if (share_printers == old_share_printers)
+ {
+ /*
+ * No change to this setting...
+ */
+
+ share_printers = -1;
+ }
+ }
else
- share_printers = 0;
+ share_printers = -1;
if ((val = cupsGetOption(CUPS_SERVER_USER_CANCEL_ANY, num_settings,
settings)) != NULL)
+ {
user_cancel_any = atoi(val);
+
+ if (user_cancel_any == old_user_cancel_any)
+ {
+ /*
+ * No change to this setting...
+ */
+
+ user_cancel_any = -1;
+ }
+ }
else
- user_cancel_any = 0;
+ user_cancel_any = -1;
/*
* Create a temporary file for the new cupsd.conf file...
@@ -1101,13 +1219,14 @@ _cupsAdminSetServerSettings(
while (cupsFileGetConf(cupsd, line, sizeof(line), &value, &linenum))
{
- if (!strcasecmp(line, "Port") || !strcasecmp(line, "Listen"))
+ if ((!strcasecmp(line, "Port") || !strcasecmp(line, "Listen")) &&
+ (share_printers >= 0 || remote_admin >= 0))
{
if (!wrote_port_listen)
{
wrote_port_listen = 1;
- if (share_printers || remote_admin)
+ if (share_printers > 0 || remote_admin > 0)
{
cupsFilePuts(temp, "# Allow remote access\n");
cupsFilePrintf(temp, "Port %d\n", server_port);
@@ -1125,26 +1244,30 @@ _cupsAdminSetServerSettings(
cupsFilePuts(temp, "Listen " CUPS_DEFAULT_DOMAINSOCKET "\n");
#endif /* CUPS_DEFAULT_DOMAINSOCKET */
}
- else if (value && value[0] == '/' &&
- strcmp(CUPS_DEFAULT_DOMAINSOCKET, value))
+ else if (value && value[0] == '/'
+#ifdef CUPS_DEFAULT_DOMAINSOCKET
+ && strcmp(CUPS_DEFAULT_DOMAINSOCKET, value)
+#endif /* CUPS_DEFAULT_DOMAINSOCKET */
+ )
cupsFilePrintf(temp, "Listen %s\n", value);
}
- else if (!strcasecmp(line, "Browsing") ||
- !strcasecmp(line, "BrowseAddress") ||
- !strcasecmp(line, "BrowseAllow") ||
- !strcasecmp(line, "BrowseDeny") ||
- !strcasecmp(line, "BrowseOrder"))
+ else if ((!strcasecmp(line, "Browsing") ||
+ !strcasecmp(line, "BrowseAddress") ||
+ !strcasecmp(line, "BrowseAllow") ||
+ !strcasecmp(line, "BrowseDeny") ||
+ !strcasecmp(line, "BrowseOrder")) &&
+ (remote_printers >= 0 || share_printers >= 0))
{
if (!wrote_browsing)
{
wrote_browsing = 1;
- if (remote_printers || share_printers)
+ if (remote_printers > 0 || share_printers > 0)
{
- if (remote_printers && share_printers)
+ if (remote_printers > 0 && share_printers > 0)
cupsFilePuts(temp,
"# Enable printer sharing and shared printers.\n");
- else if (remote_printers)
+ else if (remote_printers > 0)
cupsFilePuts(temp,
"# Show shared printers on the local network.\n");
else
@@ -1154,10 +1277,10 @@ _cupsAdminSetServerSettings(
cupsFilePuts(temp, "Browsing On\n");
cupsFilePuts(temp, "BrowseOrder allow,deny\n");
- if (remote_printers)
+ if (remote_printers > 0)
cupsFilePuts(temp, "BrowseAllow @LOCAL\n");
- if (share_printers)
+ if (share_printers > 0)
cupsFilePuts(temp, "BrowseAddress @LOCAL\n");
}
else
@@ -1168,7 +1291,7 @@ _cupsAdminSetServerSettings(
}
}
}
- else if (!strcasecmp(line, "LogLevel"))
+ else if (!strcasecmp(line, "LogLevel") && debug_logging >= 0)
{
wrote_loglevel = 1;
@@ -1231,13 +1354,13 @@ _cupsAdminSetServerSettings(
{
in_location = 0;
indent -= 2;
- if (in_admin_location)
+ if (in_admin_location && remote_admin >= 0)
{
wrote_admin_location = 1;
if (remote_admin)
cupsFilePuts(temp, " # Allow remote administration...\n");
- else
+ else if (remote_admin == 0)
cupsFilePuts(temp, " # Restrict access to the admin pages...\n");
cupsFilePuts(temp, " Order allow,deny\n");
@@ -1247,7 +1370,7 @@ _cupsAdminSetServerSettings(
else
cupsFilePuts(temp, " Allow localhost\n");
}
- else if (in_conf_location)
+ else if (in_conf_location && remote_admin >= 0)
{
wrote_conf_location = 1;
@@ -1265,23 +1388,23 @@ _cupsAdminSetServerSettings(
else
cupsFilePuts(temp, " Allow localhost\n");
}
- else if (in_root_location)
+ else if (in_root_location && (remote_admin >= 0 || share_printers >= 0))
{
wrote_root_location = 1;
- if (remote_admin && share_printers)
+ if (remote_admin > 0 && share_printers > 0)
cupsFilePuts(temp, " # Allow shared printing and remote "
"administration...\n");
- else if (remote_admin)
+ else if (remote_admin > 0)
cupsFilePuts(temp, " # Allow remote administration...\n");
- else if (share_printers)
+ else if (share_printers > 0)
cupsFilePuts(temp, " # Allow shared printing...\n");
else
cupsFilePuts(temp, " # Restrict access to the server...\n");
cupsFilePuts(temp, " Order allow,deny\n");
- if (remote_admin || share_printers)
+ if (remote_admin > 0 || share_printers > 0)
cupsFilePuts(temp, " Allow @LOCAL\n");
else
cupsFilePuts(temp, " Allow localhost\n");
@@ -1304,7 +1427,7 @@ _cupsAdminSetServerSettings(
indent += 2;
- if (!strcasecmp(value, "cancel-job"))
+ if (!strcasecmp(value, "cancel-job") && user_cancel_any >= 0)
{
/*
* Don't write anything for this limit section...
@@ -1323,7 +1446,7 @@ _cupsAdminSetServerSettings(
if (*valptr)
*valptr++ = '\0';
- if (!strcasecmp(value, "cancel-job"))
+ if (!strcasecmp(value, "cancel-job") && user_cancel_any >= 0)
{
/*
* Write everything except for this definition...
@@ -1359,7 +1482,9 @@ _cupsAdminSetServerSettings(
in_cancel_job = 0;
}
- else if ((in_admin_location || in_conf_location || in_root_location) &&
+ else if ((((in_admin_location || in_conf_location || in_root_location) &&
+ remote_admin >= 0) ||
+ (in_root_location && share_printers >= 0)) &&
(!strcasecmp(line, "Allow") || !strcasecmp(line, "Deny") ||
!strcasecmp(line, "Order")))
continue;
@@ -1424,13 +1549,13 @@ _cupsAdminSetServerSettings(
* Write any missing info...
*/
- if (!wrote_browsing)
+ if (!wrote_browsing && (remote_printers >= 0 || share_printers >= 0))
{
- if (remote_printers || share_printers)
+ if (remote_printers > 0 || share_printers > 0)
{
- if (remote_printers && share_printers)
+ if (remote_printers > 0 && share_printers > 0)
cupsFilePuts(temp, "# Enable printer sharing and shared printers.\n");
- else if (remote_printers)
+ else if (remote_printers > 0)
cupsFilePuts(temp, "# Show shared printers on the local network.\n");
else
cupsFilePuts(temp, "# Share local printers on the local network.\n");
@@ -1438,10 +1563,10 @@ _cupsAdminSetServerSettings(
cupsFilePuts(temp, "Browsing On\n");
cupsFilePuts(temp, "BrowseOrder allow,deny\n");
- if (remote_printers)
+ if (remote_printers > 0)
cupsFilePuts(temp, "BrowseAllow @LOCAL\n");
- if (share_printers)
+ if (share_printers > 0)
cupsFilePuts(temp, "BrowseAddress @LOCAL\n");
}
else
@@ -1451,7 +1576,7 @@ _cupsAdminSetServerSettings(
}
}
- if (!wrote_loglevel)
+ if (!wrote_loglevel && debug_logging >= 0)
{
if (debug_logging)
{
@@ -1465,9 +1590,9 @@ _cupsAdminSetServerSettings(
}
}
- if (!wrote_port_listen)
+ if (!wrote_port_listen && (share_printers >= 0 || remote_admin >= 0))
{
- if (share_printers || remote_admin)
+ if (share_printers > 0 || remote_admin > 0)
{
cupsFilePuts(temp, "# Allow remote access\n");
cupsFilePrintf(temp, "Port %d\n", ippPort());
@@ -1485,14 +1610,14 @@ _cupsAdminSetServerSettings(
#endif /* CUPS_DEFAULT_DOMAINSOCKET */
}
- if (!wrote_root_location)
+ if (!wrote_root_location && (remote_admin >= 0 || share_printers >= 0))
{
- if (remote_admin && share_printers)
+ if (remote_admin > 0 && share_printers > 0)
cupsFilePuts(temp,
"# Allow shared printing and remote administration...\n");
- else if (remote_admin)
+ else if (remote_admin > 0)
cupsFilePuts(temp, "# Allow remote administration...\n");
- else if (share_printers)
+ else if (share_printers > 0)
cupsFilePuts(temp, "# Allow shared printing...\n");
else
cupsFilePuts(temp, "# Restrict access to the server...\n");
@@ -1500,7 +1625,7 @@ _cupsAdminSetServerSettings(
cupsFilePuts(temp, "\n"
" Order allow,deny\n");
- if (remote_admin || share_printers)
+ if (remote_admin > 0 || share_printers > 0)
cupsFilePuts(temp, " Allow @LOCAL\n");
else
cupsFilePuts(temp, " Allow localhost\n");
@@ -1508,7 +1633,7 @@ _cupsAdminSetServerSettings(
cupsFilePuts(temp, "\n");
}
- if (!wrote_admin_location)
+ if (!wrote_admin_location && remote_admin >= 0)
{
if (remote_admin)
cupsFilePuts(temp, "# Allow remote administration...\n");
@@ -1526,7 +1651,7 @@ _cupsAdminSetServerSettings(
cupsFilePuts(temp, "\n");
}
- if (!wrote_conf_location)
+ if (!wrote_conf_location && remote_admin >= 0)
{
if (remote_admin)
cupsFilePuts(temp,
@@ -1547,7 +1672,7 @@ _cupsAdminSetServerSettings(
cupsFilePuts(temp, "\n");
}
- if (!wrote_policy)
+ if (!wrote_policy && user_cancel_any >= 0)
{
cupsFilePuts(temp, "\n"
" # Job-related operations must be done by the owner "
@@ -1626,21 +1751,50 @@ _cupsAdminSetServerSettings(
* Updated OK, add the basic settings...
*/
- cupsd_num_settings = cupsAddOption(CUPS_SERVER_DEBUG_LOGGING,
- debug_logging ? "1" : "0",
- cupsd_num_settings, &cupsd_settings);
- cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ADMIN,
- remote_admin ? "1" : "0",
- cupsd_num_settings, &cupsd_settings);
- cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_PRINTERS,
- remote_printers ? "1" : "0",
- cupsd_num_settings, &cupsd_settings);
- cupsd_num_settings = cupsAddOption(CUPS_SERVER_SHARE_PRINTERS,
- share_printers ? "1" : "0",
- cupsd_num_settings, &cupsd_settings);
- cupsd_num_settings = cupsAddOption(CUPS_SERVER_USER_CANCEL_ANY,
- user_cancel_any ? "1" : "0",
- cupsd_num_settings, &cupsd_settings);
+ if (debug_logging >= 0)
+ cupsd_num_settings = cupsAddOption(CUPS_SERVER_DEBUG_LOGGING,
+ debug_logging ? "1" : "0",
+ cupsd_num_settings, &cupsd_settings);
+ else
+ cupsd_num_settings = cupsAddOption(CUPS_SERVER_DEBUG_LOGGING,
+ old_debug_logging ? "1" : "0",
+ cupsd_num_settings, &cupsd_settings);
+
+ if (remote_admin >= 0)
+ cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ADMIN,
+ remote_admin ? "1" : "0",
+ cupsd_num_settings, &cupsd_settings);
+ else
+ cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ADMIN,
+ old_remote_admin ? "1" : "0",
+ cupsd_num_settings, &cupsd_settings);
+
+ if (remote_printers >= 0)
+ cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_PRINTERS,
+ remote_printers ? "1" : "0",
+ cupsd_num_settings, &cupsd_settings);
+ else
+ cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_PRINTERS,
+ old_remote_printers ? "1" : "0",
+ cupsd_num_settings, &cupsd_settings);
+
+ if (share_printers >= 0)
+ cupsd_num_settings = cupsAddOption(CUPS_SERVER_SHARE_PRINTERS,
+ share_printers ? "1" : "0",
+ cupsd_num_settings, &cupsd_settings);
+ else
+ cupsd_num_settings = cupsAddOption(CUPS_SERVER_SHARE_PRINTERS,
+ old_share_printers ? "1" : "0",
+ cupsd_num_settings, &cupsd_settings);
+
+ if (user_cancel_any >= 0)
+ cupsd_num_settings = cupsAddOption(CUPS_SERVER_USER_CANCEL_ANY,
+ user_cancel_any ? "1" : "0",
+ cupsd_num_settings, &cupsd_settings);
+ else
+ cupsd_num_settings = cupsAddOption(CUPS_SERVER_USER_CANCEL_ANY,
+ old_user_cancel_any ? "1" : "0",
+ cupsd_num_settings, &cupsd_settings);
/*
* Save the new values...
@@ -1681,6 +1835,10 @@ do_samba_command(const char *command, /* I - Command to run */
const char *authfile, /* I - Samba authentication file */
FILE *logfile) /* I - Optional log file */
{
+#ifdef WIN32
+ return (1); /* Always fail on Windows... */
+
+#else
int status; /* Status of command */
int pid; /* Process ID of child */
@@ -1739,6 +1897,7 @@ do_samba_command(const char *command, /* I - Command to run */
return (WEXITSTATUS(status));
else
return (-WTERMSIG(status));
+#endif /* WIN32 */
}
@@ -1756,7 +1915,9 @@ get_cupsd_conf(
int *remote) /* O - Remote file? */
{
int fd; /* Temporary file descriptor */
+#ifndef WIN32
struct stat info; /* cupsd.conf file information */
+#endif /* WIN32 */
http_status_t status; /* Status of getting cupsd.conf */
char host[HTTP_MAX_HOST]; /* Hostname for connection */
@@ -1773,6 +1934,7 @@ get_cupsd_conf(
snprintf(name, namesize, "%s/cupsd.conf", cg->cups_serverroot);
*remote = 0;
+#ifndef WIN32
if (!strcasecmp(host, "localhost") && !access(name, R_OK))
{
/*
@@ -1799,6 +1961,7 @@ get_cupsd_conf(
status = HTTP_OK;
}
else
+#endif /* !WIN32 */
{
/*
* Read cupsd.conf via a HTTP GET request...
@@ -1965,5 +2128,5 @@ write_option(cups_file_t *dstfp, /* I - PPD file */
/*
- * End of "$Id: adminutil.c 5970 2006-09-19 20:11:08Z mike $".
+ * End of "$Id: adminutil.c 6262 2007-02-11 16:59:33Z mike $".
*/
diff --git a/cups/auth.c b/cups/auth.c
index 4c7318ce7..fc87d2ba5 100644
--- a/cups/auth.c
+++ b/cups/auth.c
@@ -1,9 +1,9 @@
/*
- * "$Id: auth.c 5961 2006-09-16 19:08:36Z mike $"
+ * "$Id: auth.c 6191 2007-01-10 16:48:37Z mike $"
*
* Authentication functions for the Common UNIX Printing System (CUPS).
*
- * Copyright 1997-2006 by Easy Software Products.
+ * Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -75,6 +75,7 @@ cupsDoAuthentication(http_t *http, /* I - HTTP connection to server */
realm[HTTP_MAX_VALUE], /* realm="xyz" string */
nonce[HTTP_MAX_VALUE], /* nonce="xyz" string */
encode[512]; /* Encoded username:password */
+ _cups_globals_t *cg; /* Global data */
DEBUG_printf(("cupsDoAuthentication(http=%p, method=\"%s\", resource=\"%s\")\n",
@@ -114,8 +115,15 @@ cupsDoAuthentication(http_t *http, /* I - HTTP connection to server */
* Nope - get a new password from the user...
*/
- snprintf(prompt, sizeof(prompt), _("Password for %s on %s? "), cupsUser(),
- http->hostname[0] == '/' ? "localhost" : http->hostname);
+ cg = _cupsGlobals();
+
+ if (!cg->lang_default)
+ cg->lang_default = cupsLangDefault();
+
+ snprintf(prompt, sizeof(prompt),
+ _cupsLangString(cg->lang_default, _("Password for %s on %s? ")),
+ cupsUser(),
+ http->hostname[0] == '/' ? "localhost" : http->hostname);
http->digest_tries = strncasecmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE],
"Digest", 5) != 0;
@@ -144,7 +152,7 @@ cupsDoAuthentication(http_t *http, /* I - HTTP connection to server */
*/
httpEncode64_2(encode, sizeof(encode), http->userpass,
- strlen(http->userpass));
+ (int)strlen(http->userpass));
snprintf(http->authstring, sizeof(http->authstring), "Basic %s", encode);
}
else
@@ -251,5 +259,5 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
/*
- * End of "$Id: auth.c 5961 2006-09-16 19:08:36Z mike $".
+ * End of "$Id: auth.c 6191 2007-01-10 16:48:37Z mike $".
*/
diff --git a/cups/backchannel.c b/cups/backchannel.c
index 09833fe46..2164ed750 100644
--- a/cups/backchannel.c
+++ b/cups/backchannel.c
@@ -1,9 +1,9 @@
/*
- * "$Id: backchannel.c 5551 2006-05-19 20:20:32Z mike $"
+ * "$Id: backchannel.c 6191 2007-01-10 16:48:37Z mike $"
*
* Backchannel functions for the Common UNIX Printing System (CUPS).
*
- * Copyright 1997-2006 by Easy Software Products.
+ * Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -95,7 +95,11 @@ cupsBackChannelRead(char *buffer, /* I - Buffer to read */
* Read bytes from the pipe...
*/
+#ifdef WIN32
+ return ((ssize_t)read(3, buffer, (unsigned)bytes));
+#else
return (read(3, buffer, bytes));
+#endif /* WIN32 */
}
@@ -153,7 +157,11 @@ cupsBackChannelWrite(
* Write bytes to the pipe...
*/
+#ifdef WIN32
+ count = (ssize_t)write(3, buffer, (unsigned)(bytes - total));
+#else
count = write(3, buffer, bytes - total);
+#endif /* WIN32 */
if (count < 0)
{
@@ -175,7 +183,7 @@ cupsBackChannelWrite(
}
}
- return (bytes);
+ return ((ssize_t)bytes);
}
@@ -197,5 +205,5 @@ cups_setup(fd_set *set, /* I - Set for select() */
/*
- * End of "$Id: backchannel.c 5551 2006-05-19 20:20:32Z mike $".
+ * End of "$Id: backchannel.c 6191 2007-01-10 16:48:37Z mike $".
*/
diff --git a/cups/cups.h b/cups/cups.h
index 9ae366298..96fe9afba 100644
--- a/cups/cups.h
+++ b/cups/cups.h
@@ -1,9 +1,9 @@
/*
- * "$Id: cups.h 6092 2006-11-14 16:36:36Z mike $"
+ * "$Id: cups.h 6188 2007-01-10 16:23:06Z mike $"
*
* API definitions for the Common UNIX Printing System (CUPS).
*
- * Copyright 1997-2006 by Easy Software Products.
+ * Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -31,6 +31,13 @@
* Include necessary headers...
*/
+# include
+# if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
+# define __CUPS_SSIZE_T_DEFINED
+/* Windows does not support the ssize_t type, so map it to off_t... */
+typedef off_t ssize_t; /* @private@ */
+# endif /* WIN32 && !__CUPS_SSIZE_T_DEFINED */
+
# include "ipp.h"
# include "ppd.h"
# include "language.h"
@@ -61,10 +68,10 @@ extern "C" {
* Constants...
*/
-# define CUPS_VERSION 1.0207
+# define CUPS_VERSION 1.0208
# define CUPS_VERSION_MAJOR 1
# define CUPS_VERSION_MINOR 2
-# define CUPS_VERSION_PATCH 7
+# define CUPS_VERSION_PATCH 8
# define CUPS_DATE_ANY -1
@@ -244,5 +251,5 @@ extern cups_file_t *cupsTempFile2(char *filename, int len);
#endif /* !_CUPS_CUPS_H_ */
/*
- * End of "$Id: cups.h 6092 2006-11-14 16:36:36Z mike $".
+ * End of "$Id: cups.h 6188 2007-01-10 16:23:06Z mike $".
*/
diff --git a/cups/dest.c b/cups/dest.c
index 289456370..f94aaaff5 100644
--- a/cups/dest.c
+++ b/cups/dest.c
@@ -1,10 +1,10 @@
/*
- * "$Id: dest.c 6044 2006-10-17 20:32:59Z mike $"
+ * "$Id: dest.c 6191 2007-01-10 16:48:37Z mike $"
*
* User-defined destination (and option) support for the Common UNIX
* Printing System (CUPS).
*
- * Copyright 1997-2006 by Easy Software Products.
+ * Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -500,7 +500,9 @@ cupsSetDests2(http_t *http, /* I - HTTP connection */
cups_option_t *option; /* Current option */
_ipp_option_t *match; /* Matching attribute for option */
FILE *fp; /* File pointer */
+#ifndef WIN32
const char *home; /* HOME environment variable */
+#endif /* WIN32 */
char filename[1024]; /* lpoptions file */
int num_temps; /* Number of temporary destinations */
cups_dest_t *temps, /* Temporary destinations */
@@ -1083,5 +1085,5 @@ cups_get_sdests(http_t *http, /* I - HTTP connection */
/*
- * End of "$Id: dest.c 6044 2006-10-17 20:32:59Z mike $".
+ * End of "$Id: dest.c 6191 2007-01-10 16:48:37Z mike $".
*/
diff --git a/cups/emit.c b/cups/emit.c
index c62cbf6ab..08ad83178 100644
--- a/cups/emit.c
+++ b/cups/emit.c
@@ -1,9 +1,9 @@
/*
- * "$Id: emit.c 5934 2006-09-11 14:54:40Z mike $"
+ * "$Id: emit.c 6191 2007-01-10 16:48:37Z mike $"
*
* PPD code emission routines for the Common UNIX Printing System (CUPS).
*
- * Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ * Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -291,7 +291,11 @@ ppdEmitFd(ppd_file_t *ppd, /* I - PPD file record */
while (buflength > 0)
{
+#ifdef WIN32
+ if ((bytes = (ssize_t)write(fd, bufptr, (unsigned)buflength)) < 0)
+#else
if ((bytes = write(fd, bufptr, buflength)) < 0)
+#endif /* WIN32 */
{
if (errno == EAGAIN || errno == EINTR)
continue;
@@ -725,7 +729,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
else
pos = 4;
- values[pos] = orientation;
+ values[pos] = (float)orientation;
for (pos = 0; pos < 5; pos ++)
{
@@ -811,7 +815,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
if (choices[i]->code && choices[i]->code[0])
{
- j = strlen(choices[i]->code);
+ j = (int)strlen(choices[i]->code);
memcpy(bufptr, choices[i]->code, j);
bufptr += j;
@@ -942,5 +946,5 @@ ppd_sort(ppd_choice_t **c1, /* I - First choice */
/*
- * End of "$Id: emit.c 5934 2006-09-11 14:54:40Z mike $".
+ * End of "$Id: emit.c 6191 2007-01-10 16:48:37Z mike $".
*/
diff --git a/cups/encode.c b/cups/encode.c
index b3cc28831..b691e8656 100644
--- a/cups/encode.c
+++ b/cups/encode.c
@@ -1,9 +1,9 @@
/*
- * "$Id: encode.c 5753 2006-07-18 19:53:24Z mike $"
+ * "$Id: encode.c 6266 2007-02-11 21:20:48Z mike $"
*
* Option encoding routines for the Common UNIX Printing System (CUPS).
*
- * Copyright 1997-2006 by Easy Software Products.
+ * Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -82,7 +82,7 @@ static const _ipp_option_t ipp_options[] =
{ "natural-scaling-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
{ "notify-charset", IPP_TAG_CHARSET, IPP_TAG_SUBSCRIPTION },
{ "notify-events", IPP_TAG_KEYWORD, IPP_TAG_SUBSCRIPTION },
- { "notify-lease-time", IPP_TAG_INTEGER, IPP_TAG_SUBSCRIPTION },
+ { "notify-lease-duration", IPP_TAG_INTEGER, IPP_TAG_SUBSCRIPTION },
{ "notify-natural-language", IPP_TAG_LANGUAGE, IPP_TAG_SUBSCRIPTION },
{ "notify-pull-method", IPP_TAG_KEYWORD, IPP_TAG_SUBSCRIPTION },
{ "notify-recipient", IPP_TAG_URI, IPP_TAG_SUBSCRIPTION },
@@ -265,7 +265,7 @@ cupsEncodeOptions2(
int namelen; /* Length of name */
- namelen = strlen(option->name);
+ namelen = (int)strlen(option->name);
if (namelen < 9 || strcmp(option->name + namelen - 8, "-default"))
{
@@ -500,7 +500,7 @@ cupsEncodeOptions2(
* octet-string
*/
- attr->values[j].unknown.length = strlen(val);
+ attr->values[j].unknown.length = (int)strlen(val);
attr->values[j].unknown.data = _cupsStrAlloc(val);
DEBUG_printf(("cupsEncodeOptions2: Added octet-string value \"%s\"...\n",
@@ -567,5 +567,5 @@ compare_ipp_options(_ipp_option_t *a, /* I - First option */
/*
- * End of "$Id: encode.c 5753 2006-07-18 19:53:24Z mike $".
+ * End of "$Id: encode.c 6266 2007-02-11 21:20:48Z mike $".
*/
diff --git a/cups/file.c b/cups/file.c
index f4bbf34e0..b2a831157 100644
--- a/cups/file.c
+++ b/cups/file.c
@@ -1,5 +1,5 @@
/*
- * "$Id: file.c 5993 2006-09-29 12:57:31Z mike $"
+ * "$Id: file.c 6193 2007-01-10 19:27:04Z mike $"
*
* File functions for the Common UNIX Printing System (CUPS).
*
@@ -8,7 +8,7 @@
* our own file functions allows us to provide transparent support of
* gzip'd print files, PPD files, etc.
*
- * Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ * Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -94,6 +94,16 @@
#endif /* !O_LARGEFILE */
+/*
+ * Some operating systems don't define O_BINARY, which is used by Microsoft
+ * and IBM to flag binary files...
+ */
+
+#ifndef O_BINARY
+# define O_BINARY 0
+#endif /* !O_BINARY */
+
+
/*
* Types and structures...
*/
@@ -332,7 +342,11 @@ cupsFileFind(const char *filename, /* I - File to find */
while (*path)
{
+#ifdef WIN32
+ if (*path == ';' || (*path == ':' && ((bufptr - buffer) > 1 || !isalpha(buffer[0] & 255))))
+#else
if (*path == ';' || *path == ':')
+#endif /* WIN32 */
{
if (bufptr > buffer && bufptr[-1] != '/' && bufptr < bufend)
*bufptr++ = '/';
@@ -344,7 +358,10 @@ cupsFileFind(const char *filename, /* I - File to find */
#else
if (!access(buffer, executable ? X_OK : 0))
#endif /* WIN32 */
+ {
+ DEBUG_printf(("cupsFileFind: Returning \"%s\"\n", buffer));
return (buffer);
+ }
bufptr = buffer;
}
@@ -364,9 +381,15 @@ cupsFileFind(const char *filename, /* I - File to find */
strlcpy(bufptr, filename, bufend - bufptr);
if (!access(buffer, 0))
+ {
+ DEBUG_printf(("cupsFileFind: Returning \"%s\"\n", buffer));
return (buffer);
+ }
else
+ {
+ DEBUG_puts("cupsFileFind: Returning NULL");
return (NULL);
+ }
}
@@ -392,7 +415,7 @@ cupsFileFlush(cups_file_t *fp) /* I - CUPS file */
return (-1);
}
- bytes = fp->ptr - fp->buf;
+ bytes = (ssize_t)(fp->ptr - fp->buf);
DEBUG_printf((" Flushing %ld bytes...\n", (long)bytes));
@@ -427,7 +450,10 @@ cupsFileGetChar(cups_file_t *fp) /* I - CUPS file */
*/
if (!fp || (fp->mode != 'r' && fp->mode != 's'))
+ {
+ DEBUG_puts("cupsFileGetChar: Bad arguments!");
return (-1);
+ }
/*
* If the input buffer is empty, try to read more data...
@@ -435,12 +461,17 @@ cupsFileGetChar(cups_file_t *fp) /* I - CUPS file */
if (fp->ptr >= fp->end)
if (cups_fill(fp) < 0)
+ {
+ DEBUG_puts("cupsFileGetChar: Unable to fill buffer!");
return (-1);
+ }
/*
* Return the next character in the buffer...
*/
+ DEBUG_printf(("cupsFileGetChar: Returning %d...\n", *(fp->ptr) & 255));
+
return (*(fp->ptr)++ & 255);
}
@@ -780,15 +811,15 @@ cupsFileOpen(const char *filename, /* I - Name of file */
switch (*mode)
{
case 'a' : /* Append file */
- fd = open(filename, O_RDWR | O_CREAT | O_APPEND | O_LARGEFILE, 0666);
+ fd = open(filename, O_RDWR | O_CREAT | O_APPEND | O_LARGEFILE | O_BINARY, 0666);
break;
case 'r' : /* Read file */
- fd = open(filename, O_RDONLY | O_LARGEFILE, 0);
+ fd = open(filename, O_RDONLY | O_LARGEFILE | O_BINARY, 0);
break;
case 'w' : /* Write file */
- fd = open(filename, O_WRONLY | O_TRUNC | O_CREAT | O_LARGEFILE, 0666);
+ fd = open(filename, O_WRONLY | O_TRUNC | O_CREAT | O_LARGEFILE | O_BINARY, 0666);
break;
case 's' : /* Read/write socket */
@@ -1104,7 +1135,7 @@ cupsFilePuts(cups_file_t *fp, /* I - CUPS file */
* Write the string...
*/
- bytes = strlen(s);
+ bytes = (int)strlen(s);
if (fp->mode == 's')
{
@@ -1179,14 +1210,14 @@ cupsFileRead(cups_file_t *fp, /* I - CUPS file */
DEBUG_printf((" cups_fill() returned -1, total=%d\n", total));
if (total > 0)
- return (total);
+ return ((ssize_t)total);
else
return (-1);
}
- count = fp->end - fp->ptr;
- if (count > bytes)
- count = bytes;
+ count = (ssize_t)(fp->end - fp->ptr);
+ if (count > (ssize_t)bytes)
+ count = (ssize_t)bytes;
memcpy(buf, fp->ptr, count);
fp->ptr += count;
@@ -1206,7 +1237,7 @@ cupsFileRead(cups_file_t *fp, /* I - CUPS file */
DEBUG_printf((" total=%d\n", total));
- return (total);
+ return ((ssize_t)total);
}
@@ -1328,7 +1359,7 @@ cupsFileSeek(cups_file_t *fp, /* I - CUPS file */
*/
if (fp->ptr)
- bytes = fp->end - fp->buf;
+ bytes = (ssize_t)(fp->end - fp->buf);
else
bytes = 0;
@@ -1582,16 +1613,16 @@ cupsFileWrite(cups_file_t *fp, /* I - CUPS file */
if (cups_write(fp, buf, bytes) < 0)
return (-1);
- fp->pos += bytes;
+ fp->pos += (off_t)bytes;
- return (bytes);
+ return ((ssize_t)bytes);
}
if ((fp->ptr + bytes) > fp->end)
if (cupsFileFlush(fp))
return (-1);
- fp->pos += bytes;
+ fp->pos += (off_t)bytes;
if (bytes > sizeof(fp->buf))
{
@@ -1606,7 +1637,7 @@ cupsFileWrite(cups_file_t *fp, /* I - CUPS file */
{
memcpy(fp->ptr, buf, bytes);
fp->ptr += bytes;
- return (bytes);
+ return ((ssize_t)bytes);
}
}
@@ -1687,7 +1718,7 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
*/
if (fp->ptr && fp->end)
- fp->pos += fp->end - fp->buf;
+ fp->pos += (off_t)(fp->end - fp->buf);
#ifdef HAVE_LIBZ
DEBUG_printf((" fp->compressed=%d\n", fp->compressed));
@@ -1995,10 +2026,17 @@ cups_read(cups_file_t *fp, /* I - CUPS file */
for (;;)
{
+#ifdef WIN32
+ if (fp->mode == 's')
+ total = (ssize_t)recv(fp->fd, buf, (unsigned)bytes, 0);
+ else
+ total = (ssize_t)read(fp->fd, buf, (unsigned)bytes);
+#else
if (fp->mode == 's')
total = recv(fp->fd, buf, bytes, 0);
else
total = read(fp->fd, buf, bytes);
+#endif /* WIN32 */
if (total >= 0)
break;
@@ -2044,10 +2082,17 @@ cups_write(cups_file_t *fp, /* I - CUPS file */
total = 0;
while (bytes > 0)
{
+#ifdef WIN32
+ if (fp->mode == 's')
+ count = (ssize_t)send(fp->fd, buf, (unsigned)bytes, 0);
+ else
+ count = (ssize_t)write(fp->fd, buf, (unsigned)bytes);
+#else
if (fp->mode == 's')
count = send(fp->fd, buf, bytes, 0);
else
count = write(fp->fd, buf, bytes);
+#endif /* WIN32 */
if (count < 0)
{
@@ -2076,10 +2121,10 @@ cups_write(cups_file_t *fp, /* I - CUPS file */
* Return the total number of bytes written...
*/
- return (total);
+ return ((ssize_t)total);
}
/*
- * End of "$Id: file.c 5993 2006-09-29 12:57:31Z mike $".
+ * End of "$Id: file.c 6193 2007-01-10 19:27:04Z mike $".
*/
diff --git a/cups/file.h b/cups/file.h
index b36aa0577..fd9eca731 100644
--- a/cups/file.h
+++ b/cups/file.h
@@ -1,5 +1,5 @@
/*
- * "$Id: file.h 5769 2006-07-20 17:17:14Z mike $"
+ * "$Id: file.h 6188 2007-01-10 16:23:06Z mike $"
*
* Public file definitions for the Common UNIX Printing System (CUPS).
*
@@ -8,7 +8,7 @@
* our own file functions allows us to provide transparent support of
* gzip'd print files, PPD files, etc.
*
- * Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ * Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -36,11 +36,11 @@
*/
# include
-
-# ifdef WIN32
+# if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
+# define __CUPS_SSIZE_T_DEFINED
/* Windows does not support the ssize_t type, so map it to off_t... */
typedef off_t ssize_t; /* @private@ */
-# endif /* WIN32 */
+# endif /* WIN32 && !__CUPS_SSIZE_T_DEFINED */
/*
@@ -109,5 +109,5 @@ extern ssize_t cupsFileWrite(cups_file_t *fp, const char *buf, size_t bytes);
#endif /* !_CUPS_FILE_H_ */
/*
- * End of "$Id: file.h 5769 2006-07-20 17:17:14Z mike $".
+ * End of "$Id: file.h 6188 2007-01-10 16:23:06Z mike $".
*/
diff --git a/cups/http-addrlist.c b/cups/http-addrlist.c
index 6700e567d..4e369d30c 100644
--- a/cups/http-addrlist.c
+++ b/cups/http-addrlist.c
@@ -1,9 +1,9 @@
/*
- * "$Id: http-addrlist.c 5679 2006-06-20 14:45:15Z mike $"
+ * "$Id: http-addrlist.c 6188 2007-01-10 16:23:06Z mike $"
*
* HTTP address list routines for the Common UNIX Printing System (CUPS).
*
- * Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ * Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -62,7 +62,7 @@ httpAddrConnect(
* Create the socket...
*/
- if ((*sock = socket(addrlist->addr.addr.sa_family, SOCK_STREAM, 0)) < 0)
+ if ((*sock = (int)socket(addrlist->addr.addr.sa_family, SOCK_STREAM, 0)) < 0)
{
/*
* Don't abort yet, as this could just be an issue with the local
@@ -248,7 +248,7 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
*/
strlcpy(ipv6, hostname + 4, sizeof(ipv6));
- if ((ipv6len = strlen(ipv6) - 1) >= 0 && ipv6[ipv6len] == ']')
+ if ((ipv6len = (int)strlen(ipv6) - 1) >= 0 && ipv6[ipv6len] == ']')
{
ipv6[ipv6len] = '\0';
hostname = ipv6;
@@ -268,7 +268,7 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
*/
strlcpy(ipv6, hostname + 1, sizeof(ipv6));
- if ((ipv6len = strlen(ipv6) - 1) >= 0 && ipv6[ipv6len] == ']')
+ if ((ipv6len = (int)strlen(ipv6) - 1) >= 0 && ipv6[ipv6len] == ']')
{
ipv6[ipv6len] = '\0';
hostname = ipv6;
@@ -605,5 +605,5 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
/*
- * End of "$Id: http-addrlist.c 5679 2006-06-20 14:45:15Z mike $".
+ * End of "$Id: http-addrlist.c 6188 2007-01-10 16:23:06Z mike $".
*/
diff --git a/cups/http-private.h b/cups/http-private.h
index d5b030d28..3e405d585 100644
--- a/cups/http-private.h
+++ b/cups/http-private.h
@@ -1,9 +1,9 @@
/*
- * "$Id: http-private.h 6111 2006-11-15 20:28:39Z mike $"
+ * "$Id: http-private.h 6188 2007-01-10 16:23:06Z mike $"
*
* Private HTTP definitions for the Common UNIX Printing System (CUPS).
*
- * Copyright 1997-2005 by Easy Software Products, all rights reserved.
+ * Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -138,21 +138,22 @@ extern const char *hstrerror(int error);
* Some OS's don't have getifaddrs() and freeifaddrs()...
*/
-# include
-# ifdef HAVE_GETIFADDRS
-# include
-# else
-# include
-# ifdef HAVE_SYS_SOCKIO_H
-# include
-# endif /* HAVE_SYS_SOCKIO_H */
-
-# ifdef ifa_dstaddr
-# undef ifa_dstaddr
-# endif /* ifa_dstaddr */
-# ifndef ifr_netmask
-# define ifr_netmask ifr_addr
-# endif /* !ifr_netmask */
+# ifndef WIN32
+# include
+# ifdef HAVE_GETIFADDRS
+# include
+# else
+# include
+# ifdef HAVE_SYS_SOCKIO_H
+# include
+# endif /* HAVE_SYS_SOCKIO_H */
+
+# ifdef ifa_dstaddr
+# undef ifa_dstaddr
+# endif /* ifa_dstaddr */
+# ifndef ifr_netmask
+# define ifr_netmask ifr_addr
+# endif /* !ifr_netmask */
struct ifaddrs /**** Interface Structure ****/
{
@@ -170,21 +171,22 @@ struct ifaddrs /**** Interface Structure ****/
void *ifa_data; /* Interface statistics */
};
-# ifndef ifa_broadaddr
-# define ifa_broadaddr ifa_ifu.ifu_broadaddr
-# endif /* !ifa_broadaddr */
-# ifndef ifa_dstaddr
-# define ifa_dstaddr ifa_ifu.ifu_dstaddr
-# endif /* !ifa_dstaddr */
+# ifndef ifa_broadaddr
+# define ifa_broadaddr ifa_ifu.ifu_broadaddr
+# endif /* !ifa_broadaddr */
+# ifndef ifa_dstaddr
+# define ifa_dstaddr ifa_ifu.ifu_dstaddr
+# endif /* !ifa_dstaddr */
extern int _cups_getifaddrs(struct ifaddrs **addrs);
-# define getifaddrs _cups_getifaddrs
+# define getifaddrs _cups_getifaddrs
extern void _cups_freeifaddrs(struct ifaddrs *addrs);
-# define freeifaddrs _cups_freeifaddrs
-# endif /* HAVE_GETIFADDRS */
+# define freeifaddrs _cups_freeifaddrs
+# endif /* HAVE_GETIFADDRS */
+# endif /* !WIN32 */
#endif /* !_CUPS_HTTP_PRIVATE_H_ */
/*
- * End of "$Id: http-private.h 6111 2006-11-15 20:28:39Z mike $".
+ * End of "$Id: http-private.h 6188 2007-01-10 16:23:06Z mike $".
*/
diff --git a/cups/http-support.c b/cups/http-support.c
index b4fec03da..7214d08cd 100644
--- a/cups/http-support.c
+++ b/cups/http-support.c
@@ -1,9 +1,9 @@
/*
- * "$Id: http-support.c 6061 2006-10-23 00:26:52Z mike $"
+ * "$Id: http-support.c 6188 2007-01-10 16:23:06Z mike $"
*
* HTTP support routines for the Common UNIX Printing System (CUPS) scheduler.
*
- * Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ * Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -549,7 +549,7 @@ char * /* O - Encoded string */
httpEncode64(char *out, /* I - String to write to */
const char *in) /* I - String to read from */
{
- return (httpEncode64_2(out, 512, in, strlen(in)));
+ return (httpEncode64_2(out, 512, in, (int)strlen(in)));
}
@@ -1112,7 +1112,7 @@ httpSeparateURI(
char *resptr = resource + strlen(resource);
- uri = http_copy_decode(resptr, uri, resourcelen - (resptr - resource),
+ uri = http_copy_decode(resptr, uri, resourcelen - (int)(resptr - resource),
NULL, decoding & HTTP_URI_CODING_QUERY);
}
}
@@ -1327,5 +1327,5 @@ http_copy_encode(char *dst, /* O - Destination buffer */
/*
- * End of "$Id: http-support.c 6061 2006-10-23 00:26:52Z mike $".
+ * End of "$Id: http-support.c 6188 2007-01-10 16:23:06Z mike $".
*/
diff --git a/cups/http.c b/cups/http.c
index 3e0fef0ed..7449596df 100644
--- a/cups/http.c
+++ b/cups/http.c
@@ -1,9 +1,9 @@
/*
- * "$Id: http.c 6111 2006-11-15 20:28:39Z mike $"
+ * "$Id: http.c 6191 2007-01-10 16:48:37Z mike $"
*
* HTTP routines for the Common UNIX Printing System (CUPS).
*
- * Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ * Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -694,8 +694,18 @@ httpGetLength2(http_t *http) /* I - HTTP connection */
* after the transfer is complete...
*/
- if (http->fields[HTTP_FIELD_CONTENT_LENGTH][0] == '\0')
- http->data_remaining = 2147483647;
+ if (!http->fields[HTTP_FIELD_CONTENT_LENGTH][0])
+ {
+ /*
+ * Default content length is 0 for errors and 2^31-1 for other
+ * successful requests...
+ */
+
+ if (http->status >= HTTP_MULTIPLE_CHOICES)
+ http->data_remaining = 0;
+ else
+ http->data_remaining = 2147483647;
+ }
else
http->data_remaining = strtoll(http->fields[HTTP_FIELD_CONTENT_LENGTH],
NULL, 10);
@@ -920,7 +930,11 @@ httpGets(char *line, /* I - Line to read into */
if (!http->blocking && !http_wait(http, 10000, 1))
{
DEBUG_puts("httpGets: Timed out!");
+#ifdef WIN32
+ http->error = WSAETIMEDOUT;
+#else
http->error = ETIMEDOUT;
+#endif /* WIN32 */
return (NULL);
}
@@ -996,7 +1010,7 @@ httpGets(char *line, /* I - Line to read into */
*lineptr++ = *bufptr++;
}
- http->used -= bufptr - http->buffer;
+ http->used -= (int)(bufptr - http->buffer);
if (http->used > 0)
memmove(http->buffer, bufptr, http->used);
@@ -1269,8 +1283,8 @@ httpRead2(http_t *http, /* I - HTTP connection */
return (0);
}
- else if (length > http->data_remaining)
- length = http->data_remaining;
+ else if (length > (size_t)http->data_remaining)
+ length = (size_t)http->data_remaining;
if (http->used == 0 && length <= 256)
{
@@ -1325,15 +1339,15 @@ httpRead2(http_t *http, /* I - HTTP connection */
if (http->used > 0)
{
- if (length > http->used)
- length = http->used;
+ if (length > (size_t)http->used)
+ length = (size_t)http->used;
- bytes = length;
+ bytes = (ssize_t)length;
DEBUG_printf(("httpRead2: grabbing %d bytes from input buffer...\n", bytes));
memcpy(buffer, http->buffer, length);
- http->used -= length;
+ http->used -= (int)length;
if (http->used > 0)
memmove(http->buffer, http->buffer + length, http->used);
@@ -1344,7 +1358,7 @@ httpRead2(http_t *http, /* I - HTTP connection */
if (!http->blocking && !httpWait(http, 10000))
return (0);
- bytes = http_read_ssl(http, buffer, length);
+ bytes = (ssize_t)http_read_ssl(http, buffer, (int)length);
}
#endif /* HAVE_SSL */
else
@@ -1354,9 +1368,13 @@ httpRead2(http_t *http, /* I - HTTP connection */
DEBUG_printf(("httpRead2: reading %d bytes from socket...\n", length));
+#ifdef WIN32
+ bytes = (ssize_t)recv(http->fd, buffer, (int)length, 0);
+#else
while ((bytes = recv(http->fd, buffer, length, 0)) < 0)
if (errno != EINTR)
break;
+#endif /* WIN32 */
DEBUG_printf(("httpRead2: read %d bytes from socket...\n", bytes));
}
@@ -2004,8 +2022,8 @@ httpWrite2(http_t *http, /* I - HTTP connection */
DEBUG_printf((" copying %d bytes to wbuffer...\n", length));
memcpy(http->wbuffer + http->wused, buffer, length);
- http->wused += length;
- bytes = length;
+ http->wused += (int)length;
+ bytes = (ssize_t)length;
}
else
{
@@ -2016,9 +2034,9 @@ httpWrite2(http_t *http, /* I - HTTP connection */
DEBUG_printf((" writing %d bytes to socket...\n", length));
if (http->data_encoding == HTTP_ENCODE_CHUNKED)
- bytes = http_write_chunk(http, buffer, length);
+ bytes = (ssize_t)http_write_chunk(http, buffer, (int)length);
else
- bytes = http_write(http, buffer, length);
+ bytes = (ssize_t)http_write(http, buffer, (int)length);
DEBUG_printf((" wrote %d bytes...\n", bytes));
}
@@ -2226,7 +2244,11 @@ static int /* O - Bytes written */
http_bio_puts(BIO *h, /* I - BIO data */
const char *str) /* I - String to write */
{
+#ifdef WIN32
+ return (send(((http_t *)h->ptr)->fd, str, (int)strlen(str), 0));
+#else
return (send(((http_t *)h->ptr)->fd, str, strlen(str), 0));
+#endif /* WIN32 */
}
@@ -2252,7 +2274,12 @@ http_bio_read(BIO *h, /* I - BIO data */
if (!http_wait(http, 10000, 0))
{
+#ifdef WIN32
+ http->error = WSAETIMEDOUT;
+#else
http->error = ETIMEDOUT;
+#endif /* WIN32 */
+
return (-1);
}
}
@@ -2730,43 +2757,30 @@ http_upgrade(http_t *http) /* I - HTTP connection */
* encryption on the link...
*/
- httpClearFields(&myhttp);
- httpSetField(&myhttp, HTTP_FIELD_CONNECTION, "upgrade");
- httpSetField(&myhttp, HTTP_FIELD_UPGRADE, "TLS/1.0, SSL/2.0, SSL/3.0");
+ httpClearFields(http);
+ httpSetField(http, HTTP_FIELD_CONNECTION, "upgrade");
+ httpSetField(http, HTTP_FIELD_UPGRADE, "TLS/1.0, SSL/2.0, SSL/3.0");
- if ((ret = httpOptions(&myhttp, "*")) == 0)
+ if ((ret = httpOptions(http, "*")) == 0)
{
/*
* Wait for the secure connection...
*/
- while (httpUpdate(&myhttp) == HTTP_CONTINUE);
+ while (httpUpdate(http) == HTTP_CONTINUE);
}
- httpFlush(&myhttp);
+ httpFlush(http);
/*
- * Copy the HTTP data back over, if any...
+ * Restore the HTTP request data...
*/
- http->fd = myhttp.fd;
- http->error = myhttp.error;
- http->activity = myhttp.activity;
- http->status = myhttp.status;
- http->version = myhttp.version;
- http->keep_alive = myhttp.keep_alive;
- http->used = myhttp.used;
-
- if (http->used)
- memcpy(http->buffer, myhttp.buffer, http->used);
-
- http->auth_type = myhttp.auth_type;
- http->nonce_count = myhttp.nonce_count;
-
- memcpy(http->nonce, myhttp.nonce, sizeof(http->nonce));
-
- http->tls = myhttp.tls;
- http->encryption = myhttp.encryption;
+ memcpy(http->fields, myhttp.fields, sizeof(http->fields));
+ http->data_encoding = myhttp.data_encoding;
+ http->data_remaining = myhttp.data_remaining;
+ http->_data_remaining = myhttp._data_remaining;
+ http->expect = myhttp.expect;
/*
* See if we actually went secure...
@@ -3013,7 +3027,7 @@ http_write_chunk(http_t *http, /* I - HTTP connection */
*/
sprintf(header, "%x\r\n", length);
- if (http_write(http, header, strlen(header)) < 0)
+ if (http_write(http, header, (int)strlen(header)) < 0)
{
DEBUG_puts(" http_write of length failed!");
return (-1);
@@ -3088,5 +3102,5 @@ http_write_ssl(http_t *http, /* I - HTTP connection */
/*
- * End of "$Id: http.c 6111 2006-11-15 20:28:39Z mike $".
+ * End of "$Id: http.c 6191 2007-01-10 16:48:37Z mike $".
*/
diff --git a/cups/http.h b/cups/http.h
index 2f8a28d73..1971bc3ed 100644
--- a/cups/http.h
+++ b/cups/http.h
@@ -1,10 +1,10 @@
/*
- * "$Id: http.h 5889 2006-08-24 21:44:35Z mike $"
+ * "$Id: http.h 6188 2007-01-10 16:23:06Z mike $"
*
* Hyper-Text Transport Protocol definitions for the Common UNIX Printing
* System (CUPS).
*
- * Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ * Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -36,6 +36,11 @@
# include
# include
# ifdef WIN32
+# ifndef __CUPS_SSIZE_T_DEFINED
+# define __CUPS_SSIZE_T_DEFINED
+/* Windows does not support the ssize_t type, so map it to off_t... */
+typedef off_t ssize_t; /* @private@ */
+# endif /* !__CUPS_SSIZE_T_DEFINED */
# include
# include
# else
@@ -508,5 +513,5 @@ extern ssize_t httpWrite2(http_t *http, const char *buffer,
#endif /* !_CUPS_HTTP_H_ */
/*
- * End of "$Id: http.h 5889 2006-08-24 21:44:35Z mike $".
+ * End of "$Id: http.h 6188 2007-01-10 16:23:06Z mike $".
*/
diff --git a/cups/ipp.c b/cups/ipp.c
index 148fc702d..dcd4b651d 100644
--- a/cups/ipp.c
+++ b/cups/ipp.c
@@ -1,10 +1,10 @@
/*
- * "$Id: ipp.c 5624 2006-06-02 15:15:23Z mike $"
+ * "$Id: ipp.c 6234 2007-02-05 20:25:50Z mike $"
*
* Internet Printing Protocol support functions for the Common UNIX
* Printing System (CUPS).
*
- * Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ * Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -1054,7 +1054,7 @@ ippReadIO(void *src, /* I - Data source */
if ((n = (*cb)(src, buffer, 8)) < 8)
{
DEBUG_printf(("ippReadIO: Unable to read header (%d bytes read)!\n", n));
- return (n == 0 ? IPP_IDLE : IPP_ERROR);
+ return (IPP_ERROR);
}
/*
@@ -1098,8 +1098,11 @@ ippReadIO(void *src, /* I - Data source */
break;
case IPP_ATTRIBUTE :
- while ((*cb)(src, buffer, 1) > 0)
+ for (;;)
{
+ if ((*cb)(src, buffer, 1) < 1)
+ return (IPP_ERROR);
+
DEBUG_printf(("ippReadIO: ipp->current=%p, ipp->prev=%p\n",
ipp->current, ipp->prev));
@@ -2156,10 +2159,10 @@ ippWriteIO(void *dst, /* I - Destination */
n = 4;
if (value->string.charset != NULL)
- n += strlen(value->string.charset);
+ n += (int)strlen(value->string.charset);
if (value->string.text != NULL)
- n += strlen(value->string.text);
+ n += (int)strlen(value->string.text);
if (n > (sizeof(buffer) - 2))
return (IPP_ERROR);
@@ -2562,7 +2565,7 @@ ipp_length(ipp_t *ipp, /* I - IPP message or collection */
DEBUG_printf(("attr->name = %s, attr->num_values = %d, bytes = %d\n",
attr->name, attr->num_values, bytes));
- bytes += strlen(attr->name); /* Name */
+ bytes += (int)strlen(attr->name); /* Name */
bytes += attr->num_values; /* Value tag for each value */
bytes += 2 * attr->num_values; /* Name lengths */
bytes += 2 * attr->num_values; /* Value lengths */
@@ -2594,7 +2597,7 @@ ipp_length(ipp_t *ipp, /* I - IPP message or collection */
i < attr->num_values;
i ++, value ++)
if (value->string.text != NULL)
- bytes += strlen(value->string.text);
+ bytes += (int)strlen(value->string.text);
break;
case IPP_TAG_DATE :
@@ -2618,10 +2621,10 @@ ipp_length(ipp_t *ipp, /* I - IPP message or collection */
i ++, value ++)
{
if (value->string.charset != NULL)
- bytes += strlen(value->string.charset);
+ bytes += (int)strlen(value->string.charset);
if (value->string.text != NULL)
- bytes += strlen(value->string.text);
+ bytes += (int)strlen(value->string.text);
}
break;
@@ -2629,7 +2632,7 @@ ipp_length(ipp_t *ipp, /* I - IPP message or collection */
for (i = 0, value = attr->values;
i < attr->num_values;
i ++, value ++)
- bytes += ipp_length(value->collection, 1);
+ bytes += (int)ipp_length(value->collection, 1);
break;
default :
@@ -2678,7 +2681,7 @@ ipp_read_http(http_t *http, /* I - Client connection */
* Loop until all bytes are read...
*/
- for (tbytes = 0, bytes = 0; tbytes < length; tbytes += bytes, buffer += bytes)
+ for (tbytes = 0, bytes = 0; tbytes < (int)length; tbytes += bytes, buffer += bytes)
{
DEBUG_printf(("tbytes = %d, http->state = %d\n", tbytes, http->state));
@@ -2691,8 +2694,8 @@ ipp_read_http(http_t *http, /* I - Client connection */
* Do "fast read" from HTTP buffer directly...
*/
- if (http->used > (length - tbytes))
- bytes = length - tbytes;
+ if (http->used > (int)(length - tbytes))
+ bytes = (int)(length - tbytes);
else
bytes = http->used;
@@ -2783,7 +2786,11 @@ ipp_read_file(int *fd, /* I - File descriptor */
ipp_uchar_t *buffer, /* O - Read buffer */
size_t length) /* I - Number of bytes to read */
{
+#ifdef WIN32
+ return ((ssize_t)read(*fd, buffer, (unsigned)length));
+#else
return (read(*fd, buffer, length));
+#endif /* WIN32 */
}
@@ -2796,7 +2803,11 @@ ipp_write_file(int *fd, /* I - File descriptor */
ipp_uchar_t *buffer, /* I - Data to write */
size_t length) /* I - Number of bytes to write */
{
+#ifdef WIN32
+ return ((ssize_t)write(*fd, buffer, (unsigned)length));
+#else
return (write(*fd, buffer, length));
+#endif /* WIN32 */
}
@@ -2824,5 +2835,5 @@ _ipp_free_attr(ipp_attribute_t *attr) /* I - Attribute to free */
/*
- * End of "$Id: ipp.c 5624 2006-06-02 15:15:23Z mike $".
+ * End of "$Id: ipp.c 6234 2007-02-05 20:25:50Z mike $".
*/
diff --git a/cups/langprintf.c b/cups/langprintf.c
index da835dc28..ebdccf244 100644
--- a/cups/langprintf.c
+++ b/cups/langprintf.c
@@ -1,10 +1,10 @@
/*
- * "$Id: langprintf.c 5926 2006-09-05 20:45:47Z mike $"
+ * "$Id: langprintf.c 6188 2007-01-10 16:23:06Z mike $"
*
* Localized printf/puts functions for the Common UNIX Printing
* System (CUPS).
*
- * Copyright 2002-2006 by Easy Software Products.
+ * Copyright 2002-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -88,7 +88,7 @@ _cupsLangPrintf(FILE *fp, /* I - File to write to */
*/
if (bytes > 0)
- return (fwrite(output, 1, bytes, fp));
+ return ((int)fwrite(output, 1, bytes, fp));
else
return (bytes);
}
@@ -133,7 +133,7 @@ _cupsLangPuts(FILE *fp, /* I - File to write to */
*/
if (bytes > 0)
- return (fwrite(output, 1, bytes, fp));
+ return ((int)fwrite(output, 1, bytes, fp));
else
return (bytes);
}
@@ -224,5 +224,5 @@ _cupsSetLocale(char *argv[]) /* IO - Command-line arguments */
/*
- * End of "$Id: langprintf.c 5926 2006-09-05 20:45:47Z mike $".
+ * End of "$Id: langprintf.c 6188 2007-01-10 16:23:06Z mike $".
*/
diff --git a/cups/language.c b/cups/language.c
index 891c96d84..e8cf5bed6 100644
--- a/cups/language.c
+++ b/cups/language.c
@@ -1,9 +1,9 @@
/*
- * "$Id: language.c 6073 2006-11-02 20:01:54Z mike $"
+ * "$Id: language.c 6188 2007-01-10 16:23:06Z mike $"
*
* I18N/language support for the Common UNIX Printing System (CUPS).
*
- * Copyright 1997-2006 by Easy Software Products.
+ * Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -887,7 +887,7 @@ _cupsMessageLoad(const char *filename) /* I - Message catalog to load */
* Append to current string...
*/
- length = strlen(m->str ? m->str : m->id);
+ length = (int)strlen(m->str ? m->str : m->id);
if ((temp = realloc(m->str ? m->str : m->id,
length + strlen(ptr) + 1)) == NULL)
@@ -1326,5 +1326,5 @@ cups_unquote(char *d, /* O - Unquoted string */
/*
- * End of "$Id: language.c 6073 2006-11-02 20:01:54Z mike $".
+ * End of "$Id: language.c 6188 2007-01-10 16:23:06Z mike $".
*/
diff --git a/cups/mark.c b/cups/mark.c
index 2e9cbee55..c3013999d 100644
--- a/cups/mark.c
+++ b/cups/mark.c
@@ -1,9 +1,9 @@
/*
- * "$Id: mark.c 6036 2006-10-13 22:06:43Z mike $"
+ * "$Id: mark.c 6188 2007-01-10 16:23:06Z mike $"
*
* Option marking routines for the Common UNIX Printing System (CUPS).
*
- * Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ * Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -409,26 +409,27 @@ ppdMarkOption(ppd_file_t *ppd, /* I - PPD file record */
case PPD_CUSTOM_CURVE :
case PPD_CUSTOM_INVCURVE :
case PPD_CUSTOM_REAL :
- cparam->current.custom_real = _cupsStrScand(choice + 7, NULL,
- loc);
+ cparam->current.custom_real = (float)_cupsStrScand(choice + 7,
+ NULL, loc);
break;
case PPD_CUSTOM_POINTS :
- cparam->current.custom_points = _cupsStrScand(choice + 7,
- &units, loc);
+ cparam->current.custom_points = (float)_cupsStrScand(choice + 7,
+ &units,
+ loc);
if (units)
{
if (!strcasecmp(units, "cm"))
- cparam->current.custom_points *= 72.0 / 2.54;
+ cparam->current.custom_points *= 72.0f / 2.54f;
else if (!strcasecmp(units, "mm"))
- cparam->current.custom_points *= 72.0 / 25.4;
+ cparam->current.custom_points *= 72.0f / 25.4f;
else if (!strcasecmp(units, "m"))
- cparam->current.custom_points *= 72.0 / 0.0254;
+ cparam->current.custom_points *= 72.0f / 0.0254f;
else if (!strcasecmp(units, "in"))
- cparam->current.custom_points *= 72.0;
+ cparam->current.custom_points *= 72.0f;
else if (!strcasecmp(units, "ft"))
- cparam->current.custom_points *= 12 * 72.0;
+ cparam->current.custom_points *= 12.0f * 72.0f;
}
break;
@@ -485,26 +486,27 @@ ppdMarkOption(ppd_file_t *ppd, /* I - PPD file record */
case PPD_CUSTOM_CURVE :
case PPD_CUSTOM_INVCURVE :
case PPD_CUSTOM_REAL :
- cparam->current.custom_real = _cupsStrScand(val->value, NULL,
- loc);
+ cparam->current.custom_real = (float)_cupsStrScand(val->value,
+ NULL, loc);
break;
case PPD_CUSTOM_POINTS :
- cparam->current.custom_points = _cupsStrScand(val->value, &units,
- loc);
+ cparam->current.custom_points = (float)_cupsStrScand(val->value,
+ &units,
+ loc);
if (units)
{
if (!strcasecmp(units, "cm"))
- cparam->current.custom_points *= 72.0 / 2.54;
+ cparam->current.custom_points *= 72.0f / 2.54f;
else if (!strcasecmp(units, "mm"))
- cparam->current.custom_points *= 72.0 / 25.4;
+ cparam->current.custom_points *= 72.0f / 25.4f;
else if (!strcasecmp(units, "m"))
- cparam->current.custom_points *= 72.0 / 0.0254;
+ cparam->current.custom_points *= 72.0f / 0.0254f;
else if (!strcasecmp(units, "in"))
- cparam->current.custom_points *= 72.0;
+ cparam->current.custom_points *= 72.0f;
else if (!strcasecmp(units, "ft"))
- cparam->current.custom_points *= 12 * 72.0;
+ cparam->current.custom_points *= 12.0f * 72.0f;
}
break;
@@ -677,5 +679,5 @@ ppd_defaults(ppd_file_t *ppd, /* I - PPD file */
/*
- * End of "$Id: mark.c 6036 2006-10-13 22:06:43Z mike $".
+ * End of "$Id: mark.c 6188 2007-01-10 16:23:06Z mike $".
*/
diff --git a/cups/page.c b/cups/page.c
index f8b79832f..66b64eeae 100644
--- a/cups/page.c
+++ b/cups/page.c
@@ -1,9 +1,9 @@
/*
- * "$Id: page.c 5549 2006-05-19 19:39:28Z mike $"
+ * "$Id: page.c 6188 2007-01-10 16:23:06Z mike $"
*
* Page size functions for the Common UNIX Printing System (CUPS).
*
- * Copyright 1997-2005 by Easy Software Products, all rights reserved.
+ * Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -50,9 +50,12 @@ ppdPageSize(ppd_file_t *ppd, /* I - PPD file record */
const char *name) /* I - Size name */
{
int i; /* Looping var */
+ ppd_size_t *size; /* Current page size */
float w, l; /* Width and length of page */
char *nameptr; /* Pointer into name */
struct lconv *loc; /* Locale data */
+ ppd_coption_t *coption; /* Custom option for page size */
+ ppd_cparam_t *cparam; /* Custom option parameter */
if (!ppd)
@@ -66,11 +69,11 @@ ppdPageSize(ppd_file_t *ppd, /* I - PPD file record */
* Find the custom page size...
*/
- for (i = 0; i < ppd->num_sizes; i ++)
- if (!strcmp("Custom", ppd->sizes[i].name))
+ for (i = ppd->num_sizes, size = ppd->sizes; i > 0; i --, size ++)
+ if (!strcmp("Custom", size->name))
break;
- if (i == ppd->num_sizes)
+ if (!i)
return (NULL);
/*
@@ -83,52 +86,65 @@ ppdPageSize(ppd_file_t *ppd, /* I - PPD file record */
*/
loc = localeconv();
- w = _cupsStrScand(name + 7, &nameptr, loc);
+ w = (float)_cupsStrScand(name + 7, &nameptr, loc);
if (!nameptr || *nameptr != 'x')
return (NULL);
- l = _cupsStrScand(nameptr + 1, &nameptr, loc);
+ l = (float)_cupsStrScand(nameptr + 1, &nameptr, loc);
if (!nameptr)
return (NULL);
if (!strcasecmp(nameptr, "in"))
{
- ppd->sizes[i].width = w * 72.0f;
- ppd->sizes[i].length = l * 72.0f;
- ppd->sizes[i].left = ppd->custom_margins[0];
- ppd->sizes[i].bottom = ppd->custom_margins[1];
- ppd->sizes[i].right = w * 72.0f - ppd->custom_margins[2];
- ppd->sizes[i].top = l * 72.0f - ppd->custom_margins[3];
+ w *= 72.0f;
+ l *= 72.0f;
}
- else if (!strcasecmp(nameptr, "cm"))
+ else if (!strcasecmp(nameptr, "ft"))
{
- ppd->sizes[i].width = w / 2.54f * 72.0f;
- ppd->sizes[i].length = l / 2.54f * 72.0f;
- ppd->sizes[i].left = ppd->custom_margins[0];
- ppd->sizes[i].bottom = ppd->custom_margins[1];
- ppd->sizes[i].right = w / 2.54f * 72.0f - ppd->custom_margins[2];
- ppd->sizes[i].top = l / 2.54f * 72.0f - ppd->custom_margins[3];
+ w *= 12.0f * 72.0f;
+ l *= 12.0f * 72.0f;
}
else if (!strcasecmp(nameptr, "mm"))
{
- ppd->sizes[i].width = w / 25.4f * 72.0f;
- ppd->sizes[i].length = l / 25.4f * 72.0f;
- ppd->sizes[i].left = ppd->custom_margins[0];
- ppd->sizes[i].bottom = ppd->custom_margins[1];
- ppd->sizes[i].right = w / 25.4f * 72.0f - ppd->custom_margins[2];
- ppd->sizes[i].top = l / 25.4f * 72.0f - ppd->custom_margins[3];
+ w *= 72.0f / 25.4f;
+ l *= 72.0f / 25.4f;
+ }
+ else if (!strcasecmp(nameptr, "cm"))
+ {
+ w *= 72.0f / 2.54f;
+ l *= 72.0f / 2.54f;
}
- else
+ else if (!strcasecmp(nameptr, "m"))
{
- ppd->sizes[i].width = w;
- ppd->sizes[i].length = l;
- ppd->sizes[i].left = ppd->custom_margins[0];
- ppd->sizes[i].bottom = ppd->custom_margins[1];
- ppd->sizes[i].right = w - ppd->custom_margins[2];
- ppd->sizes[i].top = l - ppd->custom_margins[3];
+ w *= 72.0f / 0.0254f;
+ l *= 72.0f / 0.0254f;
}
- return (ppd->sizes + i);
+ size->width = w;
+ size->length = l;
+ size->left = ppd->custom_margins[0];
+ size->bottom = ppd->custom_margins[1];
+ size->right = w - ppd->custom_margins[2];
+ size->top = l - ppd->custom_margins[3];
+
+ /*
+ * Update the custom option records for the page size, too...
+ */
+
+ if ((coption = ppdFindCustomOption(ppd, "PageSize")) != NULL)
+ {
+ if ((cparam = ppdFindCustomParam(coption, "Width")) != NULL)
+ cparam->current.custom_points = w;
+
+ if ((cparam = ppdFindCustomParam(coption, "Height")) != NULL)
+ cparam->current.custom_points = l;
+ }
+
+ /*
+ * Return the page size...
+ */
+
+ return (size);
}
else
{
@@ -136,9 +152,9 @@ ppdPageSize(ppd_file_t *ppd, /* I - PPD file record */
* Lookup by name...
*/
- for (i = 0; i < ppd->num_sizes; i ++)
- if (!strcasecmp(name, ppd->sizes[i].name))
- return (ppd->sizes + i);
+ for (i = ppd->num_sizes, size = ppd->sizes; i > 0; i --, size ++)
+ if (!strcmp(name, size->name))
+ return (size);
}
}
else
@@ -147,9 +163,9 @@ ppdPageSize(ppd_file_t *ppd, /* I - PPD file record */
* Find default...
*/
- for (i = 0; i < ppd->num_sizes; i ++)
- if (ppd->sizes[i].marked)
- return (ppd->sizes + i);
+ for (i = ppd->num_sizes, size = ppd->sizes; i > 0; i --, size ++)
+ if (size->marked)
+ return (size);
}
return (NULL);
@@ -193,5 +209,5 @@ ppdPageLength(ppd_file_t *ppd, /* I - PPD file */
/*
- * End of "$Id: page.c 5549 2006-05-19 19:39:28Z mike $".
+ * End of "$Id: page.c 6188 2007-01-10 16:23:06Z mike $".
*/
diff --git a/cups/ppd.c b/cups/ppd.c
index 9facfe6b9..37d0f8d6b 100644
--- a/cups/ppd.c
+++ b/cups/ppd.c
@@ -1,9 +1,9 @@
/*
- * "$Id: ppd.c 6036 2006-10-13 22:06:43Z mike $"
+ * "$Id: ppd.c 6188 2007-01-10 16:23:06Z mike $"
*
* PPD file routines for the Common UNIX Printing System (CUPS).
*
- * Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ * Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -819,17 +819,17 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
strlcpy(profile->resolution, name, sizeof(profile->resolution));
strlcpy(profile->media_type, text, sizeof(profile->media_type));
- profile->density = _cupsStrScand(string, &sptr, loc);
- profile->gamma = _cupsStrScand(sptr, &sptr, loc);
- profile->matrix[0][0] = _cupsStrScand(sptr, &sptr, loc);
- profile->matrix[0][1] = _cupsStrScand(sptr, &sptr, loc);
- profile->matrix[0][2] = _cupsStrScand(sptr, &sptr, loc);
- profile->matrix[1][0] = _cupsStrScand(sptr, &sptr, loc);
- profile->matrix[1][1] = _cupsStrScand(sptr, &sptr, loc);
- profile->matrix[1][2] = _cupsStrScand(sptr, &sptr, loc);
- profile->matrix[2][0] = _cupsStrScand(sptr, &sptr, loc);
- profile->matrix[2][1] = _cupsStrScand(sptr, &sptr, loc);
- profile->matrix[2][2] = _cupsStrScand(sptr, &sptr, loc);
+ profile->density = (float)_cupsStrScand(string, &sptr, loc);
+ profile->gamma = (float)_cupsStrScand(sptr, &sptr, loc);
+ profile->matrix[0][0] = (float)_cupsStrScand(sptr, &sptr, loc);
+ profile->matrix[0][1] = (float)_cupsStrScand(sptr, &sptr, loc);
+ profile->matrix[0][2] = (float)_cupsStrScand(sptr, &sptr, loc);
+ profile->matrix[1][0] = (float)_cupsStrScand(sptr, &sptr, loc);
+ profile->matrix[1][1] = (float)_cupsStrScand(sptr, &sptr, loc);
+ profile->matrix[1][2] = (float)_cupsStrScand(sptr, &sptr, loc);
+ profile->matrix[2][0] = (float)_cupsStrScand(sptr, &sptr, loc);
+ profile->matrix[2][1] = (float)_cupsStrScand(sptr, &sptr, loc);
+ profile->matrix[2][2] = (float)_cupsStrScand(sptr, &sptr, loc);
}
else if (!strcmp(keyword, "cupsFilter"))
{
@@ -928,8 +928,8 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
if (!strcmp(ctype, "curve"))
{
cparam->type = PPD_CUSTOM_CURVE;
- cparam->minimum.custom_curve = _cupsStrScand(cminimum, NULL, loc);
- cparam->maximum.custom_curve = _cupsStrScand(cmaximum, NULL, loc);
+ cparam->minimum.custom_curve = (float)_cupsStrScand(cminimum, NULL, loc);
+ cparam->maximum.custom_curve = (float)_cupsStrScand(cmaximum, NULL, loc);
}
else if (!strcmp(ctype, "int"))
{
@@ -940,8 +940,8 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
else if (!strcmp(ctype, "invcurve"))
{
cparam->type = PPD_CUSTOM_INVCURVE;
- cparam->minimum.custom_invcurve = _cupsStrScand(cminimum, NULL, loc);
- cparam->maximum.custom_invcurve = _cupsStrScand(cmaximum, NULL, loc);
+ cparam->minimum.custom_invcurve = (float)_cupsStrScand(cminimum, NULL, loc);
+ cparam->maximum.custom_invcurve = (float)_cupsStrScand(cmaximum, NULL, loc);
}
else if (!strcmp(ctype, "passcode"))
{
@@ -958,14 +958,14 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
else if (!strcmp(ctype, "points"))
{
cparam->type = PPD_CUSTOM_POINTS;
- cparam->minimum.custom_points = _cupsStrScand(cminimum, NULL, loc);
- cparam->maximum.custom_points = _cupsStrScand(cmaximum, NULL, loc);
+ cparam->minimum.custom_points = (float)_cupsStrScand(cminimum, NULL, loc);
+ cparam->maximum.custom_points = (float)_cupsStrScand(cmaximum, NULL, loc);
}
else if (!strcmp(ctype, "real"))
{
cparam->type = PPD_CUSTOM_REAL;
- cparam->minimum.custom_real = _cupsStrScand(cminimum, NULL, loc);
- cparam->maximum.custom_real = _cupsStrScand(cmaximum, NULL, loc);
+ cparam->minimum.custom_real = (float)_cupsStrScand(cminimum, NULL, loc);
+ cparam->maximum.custom_real = (float)_cupsStrScand(cmaximum, NULL, loc);
}
else if (!strcmp(ctype, "string"))
{
@@ -1001,7 +1001,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
else if (!strcmp(keyword, "HWMargins"))
{
for (i = 0, sptr = string; i < 4; i ++)
- ppd->custom_margins[i] = _cupsStrScand(sptr, &sptr, loc);
+ ppd->custom_margins[i] = (float)_cupsStrScand(sptr, &sptr, loc);
}
else if (!strncmp(keyword, "Custom", 6) && !strcmp(name, "True"))
{
@@ -1400,7 +1400,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
else if (!strcmp(keyword, "OrderDependency") ||
!strcmp(keyword, "NonUIOrderDependency"))
{
- order = _cupsStrScand(string, &sptr, loc);
+ order = (float)_cupsStrScand(string, &sptr, loc);
if (!sptr || sscanf(sptr, "%40s%40s", name, keyword) != 2)
{
@@ -1728,8 +1728,8 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
goto error;
}
- size->width = _cupsStrScand(string, &sptr, loc);
- size->length = _cupsStrScand(sptr, NULL, loc);
+ size->width = (float)_cupsStrScand(string, &sptr, loc);
+ size->length = (float)_cupsStrScand(sptr, NULL, loc);
ppd_free(string);
string = NULL;
@@ -1750,10 +1750,10 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
goto error;
}
- size->left = _cupsStrScand(string, &sptr, loc);
- size->bottom = _cupsStrScand(sptr, &sptr, loc);
- size->right = _cupsStrScand(sptr, &sptr, loc);
- size->top = _cupsStrScand(sptr, NULL, loc);
+ size->left = (float)_cupsStrScand(string, &sptr, loc);
+ size->bottom = (float)_cupsStrScand(sptr, &sptr, loc);
+ size->right = (float)_cupsStrScand(sptr, &sptr, loc);
+ size->top = (float)_cupsStrScand(sptr, NULL, loc);
ppd_free(string);
string = NULL;
@@ -2370,7 +2370,7 @@ ppd_get_cparam(ppd_coption_t *opt, /* I - PPD file */
return (NULL);
strlcpy(cparam->name, param, sizeof(cparam->name));
- strlcpy(cparam->text, text, sizeof(cparam->text));
+ strlcpy(cparam->text, text[0] ? text : param, sizeof(cparam->text));
/*
* Add this record to the array...
@@ -3046,5 +3046,5 @@ ppd_read(cups_file_t *fp, /* I - File to read from */
/*
- * End of "$Id: ppd.c 6036 2006-10-13 22:06:43Z mike $".
+ * End of "$Id: ppd.c 6188 2007-01-10 16:23:06Z mike $".
*/
diff --git a/cups/request.c b/cups/request.c
index 329cce881..6c2924385 100644
--- a/cups/request.c
+++ b/cups/request.c
@@ -1,9 +1,9 @@
/*
- * "$Id: request.c 5555 2006-05-20 13:35:58Z mike $"
+ * "$Id: request.c 6188 2007-01-10 16:23:06Z mike $"
*
* IPP utilities for the Common UNIX Printing System (CUPS).
*
- * Copyright 1997-2006 by Easy Software Products.
+ * Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -285,7 +285,7 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
#ifdef WIN32
if (http->error != WSAENETDOWN && http->error != WSAENETUNREACH &&
- http->error != ETIMEDOUT)
+ http->error != WSAETIMEDOUT)
#else
if (http->error != ENETDOWN && http->error != ENETUNREACH &&
http->error != ETIMEDOUT)
@@ -479,5 +479,5 @@ _cupsSetError(ipp_status_t status, /* I - IPP status code */
/*
- * End of "$Id: request.c 5555 2006-05-20 13:35:58Z mike $".
+ * End of "$Id: request.c 6188 2007-01-10 16:23:06Z mike $".
*/
diff --git a/cups/snprintf.c b/cups/snprintf.c
index 683551b05..313102b86 100644
--- a/cups/snprintf.c
+++ b/cups/snprintf.c
@@ -1,9 +1,9 @@
/*
- * "$Id: snprintf.c 5529 2006-05-15 20:06:46Z mike $"
+ * "$Id: snprintf.c 6188 2007-01-10 16:23:06Z mike $"
*
* snprintf functions for the Common UNIX Printing System (CUPS).
*
- * Copyright 1997-2005 by Easy Software Products.
+ * Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -195,7 +195,7 @@ _cups_vsnprintf(char *buffer, /* O - Output buffer */
sprintf(temp, tformat, va_arg(ap, double));
- bytes += strlen(temp);
+ bytes += (int)strlen(temp);
if (bufptr)
{
@@ -225,7 +225,7 @@ _cups_vsnprintf(char *buffer, /* O - Output buffer */
sprintf(temp, tformat, va_arg(ap, int));
- bytes += strlen(temp);
+ bytes += (int)strlen(temp);
if (bufptr)
{
@@ -248,7 +248,7 @@ _cups_vsnprintf(char *buffer, /* O - Output buffer */
sprintf(temp, tformat, va_arg(ap, void *));
- bytes += strlen(temp);
+ bytes += (int)strlen(temp);
if (bufptr)
{
@@ -275,7 +275,7 @@ _cups_vsnprintf(char *buffer, /* O - Output buffer */
else
{
if ((bufptr + width) > bufend)
- width = bufend - bufptr;
+ width = (int)(bufend - bufptr);
memcpy(bufptr, va_arg(ap, char *), (size_t)width);
bufptr += width;
@@ -287,7 +287,7 @@ _cups_vsnprintf(char *buffer, /* O - Output buffer */
if ((s = va_arg(ap, char *)) == NULL)
s = "(null)";
- slen = strlen(s);
+ slen = (int)strlen(s);
if (slen > width && prec != width)
width = slen;
@@ -296,7 +296,7 @@ _cups_vsnprintf(char *buffer, /* O - Output buffer */
if (bufptr)
{
if ((bufptr + width) > bufend)
- width = bufend - bufptr;
+ width = (int)(bufend - bufptr);
if (slen > width)
slen = width;
@@ -368,6 +368,6 @@ _cups_snprintf(char *buffer, /* O - Output buffer */
/*
- * End of "$Id: snprintf.c 5529 2006-05-15 20:06:46Z mike $".
+ * End of "$Id: snprintf.c 6188 2007-01-10 16:23:06Z mike $".
*/
diff --git a/cups/string.c b/cups/string.c
index 733304a82..98cd344dc 100644
--- a/cups/string.c
+++ b/cups/string.c
@@ -1,9 +1,9 @@
/*
- * "$Id: string.c 5368 2006-04-02 19:23:50Z mike $"
+ * "$Id: string.c 6188 2007-01-10 16:23:06Z mike $"
*
* String functions for the Common UNIX Printing System (CUPS).
*
- * Copyright 1997-2006 by Easy Software Products.
+ * Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -243,7 +243,7 @@ _cupsStrFormatd(char *buf, /* I - String */
if (loc && loc->decimal_point)
{
dec = loc->decimal_point;
- declen = strlen(dec);
+ declen = (int)strlen(dec);
}
else
{
@@ -439,6 +439,47 @@ _cupsStrScand(const char *buf, /* I - Pointer to number */
}
}
+ if (*buf == 'e' || *buf == 'E')
+ {
+ /*
+ * Read exponent...
+ */
+
+ if (tempptr < (temp + sizeof(temp) - 1))
+ *tempptr++ = *buf++;
+ else
+ {
+ if (bufptr)
+ *bufptr = NULL;
+
+ return (0.0);
+ }
+
+ if (*buf == '+' || *buf == '-')
+ {
+ if (tempptr < (temp + sizeof(temp) - 1))
+ *tempptr++ = *buf++;
+ else
+ {
+ if (bufptr)
+ *bufptr = NULL;
+
+ return (0.0);
+ }
+ }
+
+ while (isdigit(*buf & 255))
+ if (tempptr < (temp + sizeof(temp) - 1))
+ *tempptr++ = *buf++;
+ else
+ {
+ if (bufptr)
+ *bufptr = NULL;
+
+ return (0.0);
+ }
+ }
+
/*
* Nul-terminate the temporary string and return the value...
*/
@@ -702,5 +743,5 @@ compare_sp_items(_cups_sp_item_t *a, /* I - First item */
/*
- * End of "$Id: string.c 5368 2006-04-02 19:23:50Z mike $".
+ * End of "$Id: string.c 6188 2007-01-10 16:23:06Z mike $".
*/
diff --git a/cups/testfile.c b/cups/testfile.c
index 7bd0c2b14..c4d6d90f5 100644
--- a/cups/testfile.c
+++ b/cups/testfile.c
@@ -1,9 +1,9 @@
/*
- * "$Id: testfile.c 5194 2006-02-27 20:57:07Z mike $"
+ * "$Id: testfile.c 6193 2007-01-10 19:27:04Z mike $"
*
* File test program for the Common UNIX Printing System (CUPS).
*
- * Copyright 1997-2005 by Easy Software Products.
+ * Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -86,8 +86,13 @@ main(int argc, /* I - Number of command-line arguments */
*/
fputs("cupsFileFind: ", stdout);
+#ifdef WIN32
+ if (cupsFileFind("notepad.exe", "C:/WINDOWS", 1, filename, sizeof(filename)) &&
+ cupsFileFind("notepad.exe", "C:/WINDOWS;C:/WINDOWS/SYSTEM32", 1, filename, sizeof(filename)))
+#else
if (cupsFileFind("cat", "/bin", 1, filename, sizeof(filename)) &&
cupsFileFind("cat", "/bin:/usr/bin", 1, filename, sizeof(filename)))
+#endif /* WIN32 */
printf("PASS (%s)\n", filename);
else
{
@@ -165,7 +170,12 @@ read_write_tests(int compression) /* I - Use compression? */
* Initialize the write buffer with random data...
*/
+#ifdef WIN32
+ srand((unsigned)time(NULL));
+#else
srand(time(NULL));
+#endif /* WIN32 */
+
for (i = 0; i < (int)sizeof(writebuf); i ++)
writebuf[i] = rand();
@@ -362,14 +372,28 @@ read_write_tests(int compression) /* I - Use compression? */
}
/*
- * cupsGetChar()
+ * cupsFileGetChar()
*/
- fputs("cupsGetChar(): ", stdout);
+ fputs("cupsFileGetChar(): ", stdout);
+
+#ifdef DEBUG
+ puts("\ni byte\n----- -----");
+
+ for (i = 0; i < 256; i ++)
+ {
+ byte = cupsFileGetChar(fp);
+
+ printf("%-5d %-5d\n", i, byte);
+ if (byte != i)
+ break;
+ }
+#else
for (i = 0; i < 256; i ++)
if ((byte = cupsFileGetChar(fp)) != i)
break;
+#endif /* DEBUG */
if (i >= 256)
puts("PASS");
@@ -444,5 +468,5 @@ read_write_tests(int compression) /* I - Use compression? */
/*
- * End of "$Id: testfile.c 5194 2006-02-27 20:57:07Z mike $".
+ * End of "$Id: testfile.c 6193 2007-01-10 19:27:04Z mike $".
*/
diff --git a/cups/testppd.c b/cups/testppd.c
index 37032ff62..a587acedf 100644
--- a/cups/testppd.c
+++ b/cups/testppd.c
@@ -1,5 +1,5 @@
/*
- * "$Id: testppd.c 5826 2006-08-15 19:04:11Z mike $"
+ * "$Id: testppd.c 6161 2006-12-19 20:10:22Z mike $"
*
* PPD test program for the Common UNIX Printing System (CUPS).
*
@@ -195,6 +195,8 @@ main(int argc, /* I - Number of command-line arguments */
ppd_attr_t *attr; /* Current attribute */
ppd_group_t *group; /* Option group */
ppd_option_t *option; /* Option */
+ ppd_coption_t *coption; /* Custom option */
+ ppd_cparam_t *cparam; /* Custom parameter */
char lang[255]; /* LANG environment variable */
@@ -221,6 +223,73 @@ main(int argc, /* I - Number of command-line arguments */
for (k = 0; k < option->num_choices; k ++)
printf(" - %s (%s)\n", option->choices[k].choice,
option->choices[k].text);
+
+ if ((coption = ppdFindCustomOption(ppd, option->keyword)) != NULL)
+ {
+ for (cparam = (ppd_cparam_t *)cupsArrayFirst(coption->params);
+ cparam;
+ cparam = (ppd_cparam_t *)cupsArrayNext(coption->params))
+ {
+ switch (cparam->type)
+ {
+ case PPD_CUSTOM_CURVE :
+ printf(" %s(%s): PPD_CUSTOM_CURVE (%g to %g)\n",
+ cparam->name, cparam->text,
+ cparam->minimum.custom_curve,
+ cparam->maximum.custom_curve);
+ break;
+
+ case PPD_CUSTOM_INT :
+ printf(" %s(%s): PPD_CUSTOM_INT (%d to %d)\n",
+ cparam->name, cparam->text,
+ cparam->minimum.custom_int,
+ cparam->maximum.custom_int);
+ break;
+
+ case PPD_CUSTOM_INVCURVE :
+ printf(" %s(%s): PPD_CUSTOM_INVCURVE (%g to %g)\n",
+ cparam->name, cparam->text,
+ cparam->minimum.custom_invcurve,
+ cparam->maximum.custom_invcurve);
+ break;
+
+ case PPD_CUSTOM_PASSCODE :
+ printf(" %s(%s): PPD_CUSTOM_PASSCODE (%d to %d)\n",
+ cparam->name, cparam->text,
+ cparam->minimum.custom_passcode,
+ cparam->maximum.custom_passcode);
+ break;
+
+ case PPD_CUSTOM_PASSWORD :
+ printf(" %s(%s): PPD_CUSTOM_PASSWORD (%d to %d)\n",
+ cparam->name, cparam->text,
+ cparam->minimum.custom_password,
+ cparam->maximum.custom_password);
+ break;
+
+ case PPD_CUSTOM_POINTS :
+ printf(" %s(%s): PPD_CUSTOM_POINTS (%g to %g)\n",
+ cparam->name, cparam->text,
+ cparam->minimum.custom_points,
+ cparam->maximum.custom_points);
+ break;
+
+ case PPD_CUSTOM_REAL :
+ printf(" %s(%s): PPD_CUSTOM_REAL (%g to %g)\n",
+ cparam->name, cparam->text,
+ cparam->minimum.custom_real,
+ cparam->maximum.custom_real);
+ break;
+
+ case PPD_CUSTOM_STRING :
+ printf(" %s(%s): PPD_CUSTOM_STRING (%d to %d)\n",
+ cparam->name, cparam->text,
+ cparam->minimum.custom_string,
+ cparam->maximum.custom_string);
+ break;
+ }
+ }
+ }
}
}
@@ -239,5 +308,5 @@ main(int argc, /* I - Number of command-line arguments */
/*
- * End of "$Id: testppd.c 5826 2006-08-15 19:04:11Z mike $".
+ * End of "$Id: testppd.c 6161 2006-12-19 20:10:22Z mike $".
*/
diff --git a/cups/transcode.c b/cups/transcode.c
index dc9d4dcb1..9955d2e35 100644
--- a/cups/transcode.c
+++ b/cups/transcode.c
@@ -1,9 +1,9 @@
/*
- * "$Id: transcode.c 6115 2006-11-15 22:21:18Z mike $"
+ * "$Id: transcode.c 6188 2007-01-10 16:23:06Z mike $"
*
* Transcoding support for the Common UNIX Printing System (CUPS).
*
- * Copyright 1997-2006 by Easy Software Products.
+ * Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are
* the property of Easy Software Products and are protected by Federal
@@ -292,7 +292,7 @@ cupsCharsetToUTF8(
encoding < 0 || encoding >= CUPS_ENCODING_VBCS_END)
{
strlcpy((char *)dest, src, maxout);
- return (strlen((char *)dest));
+ return ((int)strlen((char *)dest));
}
/*
@@ -324,7 +324,7 @@ cupsCharsetToUTF8(
*destptr = '\0';
- return (destptr - dest);
+ return ((int)(destptr - dest));
}
/*
@@ -392,7 +392,7 @@ cupsUTF8ToCharset(
encoding < 0 || encoding >= CUPS_ENCODING_VBCS_END)
{
strlcpy(dest, (char *)src, maxout);
- return (strlen(dest));
+ return ((int)strlen(dest));
}
/*
@@ -431,7 +431,7 @@ cupsUTF8ToCharset(
*destptr = '\0';
- return (destptr - dest);
+ return ((int)(destptr - dest));
}
/*
@@ -968,7 +968,7 @@ conv_utf8_to_vbcs(
if (unichar < 0x80)
{
- *dest++ = (cups_vbcs_t)unichar;
+ *dest++ = (cups_sbcs_t)unichar;
continue;
}
@@ -1655,5 +1655,5 @@ get_vbcs_charmap(
/*
- * End of "$Id: transcode.c 6115 2006-11-15 22:21:18Z mike $"
+ * End of "$Id: transcode.c 6188 2007-01-10 16:23:06Z mike $"
*/
diff --git a/cups/util.c b/cups/util.c
index 1082ceb24..623c22057 100644
--- a/cups/util.c
+++ b/cups/util.c
@@ -1,5 +1,5 @@
/*
- * "$Id: util.c 5716 2006-07-11 17:56:57Z mike $"
+ * "$Id: util.c 6145 2006-12-06 20:10:16Z mike $"
*
* Printing utilities for the Common UNIX Printing System (CUPS).
*
@@ -1649,7 +1649,8 @@ cups_get_printer_uri(
ippDelete(response);
}
- _cupsSetError(IPP_INTERNAL_ERROR, "No printer-uri found!");
+ if (cupsLastError() != IPP_NOT_FOUND)
+ _cupsSetError(IPP_INTERNAL_ERROR, "No printer-uri found!");
*host = '\0';
*resource = '\0';
@@ -1659,5 +1660,5 @@ cups_get_printer_uri(
/*
- * End of "$Id: util.c 5716 2006-07-11 17:56:57Z mike $".
+ * End of "$Id: util.c 6145 2006-12-06 20:10:16Z mike $".
*/
diff --git a/desktop/cups.desktop b/desktop/cups.desktop
index 0bb1c4620..bec77346a 100644
--- a/desktop/cups.desktop
+++ b/desktop/cups.desktop
@@ -21,7 +21,9 @@ Name[es]=Administrar impresión
Comment[es]=Interfaz Web de CUPS
Name[et]=Trükkimise haldur
Comment[et]=CUPS-i veebiliides
+Name[fr]=Gestionnaire d'impression
+Comment[fr]=Interface Web de CUPS
Name[pl]=ZarzÄ dzanie drukowaniem
Comment[pl]=Interfejs WWW CUPS
Name[it]=Gestione stampa
-Comment[it]=Interfaccia web di CUPS
\ No newline at end of file
+Comment[it]=Interfaccia web di CUPS
diff --git a/doc/de/index.html.in b/doc/de/index.html.in
index bd7ec21c8..1fbedf113 100644
--- a/doc/de/index.html.in
+++ b/doc/de/index.html.in
@@ -130,7 +130,7 @@ WIDTH="15" HEIGHT="15" ALT="">
Das Common UNIX Printing System, CUPS, und das CUPS Logo sind
Warenzeichen der Easy Software
-Products. CUPS ist urheberrechtlich geschützt 1997-2006 von Easy Software Products,
+Products. CUPS ist urheberrechtlich geschützt 1997-2007 von Easy Software Products,
Alle Rechte vorbehalten.
Common UNIX Printing System, CUPS, y el logo de CUPS son
marcas registradas de Easy Software
-Products. Los derechos de copia de CUPS 1997-2006 son de Easy Software Products.
+Products. Los derechos de copia de CUPS 1997-2007 son de Easy Software Products.
Todos los derechos reservados.
@@ -286,6 +160,10 @@ can make changes to the cups_page_header2_t data as needed to use a
supported raster format and then returns 0 on success and -1 if the
requested attributes cannot be supported.
+cupsRasterInterpretPPD() supports a subset of the PostScript language.
+Currently only the [, ], <<, >>, {, }, cleartomark, copy, dup, index,
+pop, roll, setpagedevice, and stopped operators are supported.
+
This help document describes how to discover, configure, and use TCP/IP network printers with CUPS.
-
Once you have set the IP address you can access the printer or
-print server using the ipp, lpd, or
-socket backends. The following is a list of common
-network interfaces and printer servers and the settings you
-should use with CUPS:
Every network printer or print server has a unique Internet Protocol (IP) address associated with it. This address is either configured manually or set using an automatic network protocol such as the Boot Protocol (BOOTP), Dynamic Host Control Protocol (DHCP), Reverse Address Resolution Protocol (RARP), or ZeroConf.
+
+
You can normally find the IP address of a printer on the printer's control panel or by printing the configuration or status page. The Simple Network Management Protocol (SNMP) can also be used to get the IP address remotely, which happens automatically when you visit the CUPS administration web page or choose an available CUPS device when adding a printer.
When you first install a network printer or print server on your LAN, you need to set the Internet Protocol ("IP") address. Most higher-end "workgroup" printers allow you to set the address through the printer control panel. However, if you have many printers you will want to assign the addresses remotely - this makes administration a bit easier and avoids assigning duplicate addresses accidentally.
+
+
To setup your printer or print server for remote address assignment, you'll need the Ethernet Media Access Control ("MAC") address, also sometimes called a node address, and the IP address you want to use for the device. The Ethernet MAC address can often be found on the printer test page or bottom of the print server.
The DHCP protocol is the usual way of setting the IP address of a printer on a managed network. Using the standard dhcpd(8) program supplied with UNIX you simply need to add a line to the /etc/dhcpd.conf file:
The BOOTP protocol is used when you need to provide additional information such as the location of a configuration file to the network interface. Using the standard bootpd(8) program supplied with UNIX you simply need to add a line to the /etc/bootptab file; for IRIX:
The myprinter.boot file resides in the /usr/local/boot directory by default. If you do not need to provide a boot file you may leave the last part of the line blank.
+
+
Note: Some versions of UNIX do not enable the BOOTP service by default. The /etc/inetd.conf or /etc/xinetd.d/bootp file usually contains a line for the BOOTP service that can be uncommented if needed.
To test that the IP address has been successfully assigned and
+that the printer is properly connected to your LAN, type:
+
+
+ping ip-address
+
+
+
If the connection is working properly you will see something
+like:
+
+
+ping myprinter
+PING myprinter (192.0.2.2): 56 data bytes
+64 bytes from 192.0.2.2: icmp_seq=0 ttl=15 time=5 ms
+64 bytes from 192.0.2.2: icmp_seq=1 ttl=15 time=3 ms
+64 bytes from 192.0.2.2: icmp_seq=2 ttl=15 time=3 ms
+64 bytes from 192.0.2.2: icmp_seq=3 ttl=15 time=3 ms
+
+
+
If not, verify that the printer or print server is connected
+to the LAN, it is powered on, the LAN cabling is good, and the IP
+address is set correctly. You can usually see the current IP
+address and network status by printing a configuration or test
+page on the device.
CUPS supports most network printers using one of three TCP/IP-based protocols. Printer discovery is currently accomplished using the SNMP protocol, however future versions of CUPS will also include support for multicast DNS service discovery as well.
The AppSocket protocol (sometimes also called the JetDirect protocol, owing to its origins with the HP JetDirect network interfaces) is the simplest, fastest, and generally the most reliable network protocol used for printers. AppSocket printing normally happens over port 9100 and uses the socket URI scheme:
IPP is the only protocol that CUPS supports natively, and is also supported by many network printers. We recommend using this protocol over others whenever the printer or server supports it. IPP printing normally happens over port 631 and uses the http and ipp URI schemes:
LPD is the original network printing protocol and is supported by many network printers. Due to limitations in the LPD protocol, we do not recommend using it if the printer or server supports one of the other protocols. LPD printing normally happens over port 515 and uses the lpd URI scheme:
Once you have set the IP address you can access the printer or print server using the ipp, lpd, or socket backends. Table 1 shows a list of common network interfaces and printer servers and the settings you should use with CUPS:
When you first install a network printer or print server on
-your LAN, you need to set the Internet Protocol ("IP") address.
-On most higher-end "workgroup" printers, you can set the address
-through the printer control panel. However, in most cases you
-will want to assign the addresses remotely from your workstation.
-This makes administration a bit easier and avoids assigning
-duplicate addresses accidentally.
-
-
To setup your printer or print server for remote address
-assignment, you'll need the Ethernet Media Access Control ("MAC")
-address, also sometimes called a node address, and the IP address
-you want to use for the device. The Ethernet MAC address can
-often be found on the printer test page or bottom of the print
-server.
-
-
Configuring the IP Address Using ARP
-
-
The easiest way to set the IP address of a network device is
-to use the arp(8) command. The arp
-sends an Address Resolution Protocol ("ARP") packet to the
-specified Ethernet MAC address, setting the network device's IP
-address:
Whenever you view the administration web page or a list of supported device URIs, the snmp backend will probe the local network(s) using Simple Network Management Protocol (SNMP) broadcasts. Printers that respond to these broadcasts are then interrogated for the make and model and supported protocols, yielding a device URI that can be used to add the printer.
+
+
That said, the SNMP requests sometimes expose problems in vendor SNMP or IPP implementations. If you are experiencing long delays in loading the CUPS web interface administration page, or if you don't see your printer listed, the following instructions will help you to diagnose those problems and/or provide important feedback to the CUPS developers so that we can correct problems and improve the SNMP backend in future releases.
+
+
Quick Fixes
+
+
If you don't use "public" as your community name, create a text file called /etc/cups/snmp.conf and put the following line in it:
-arp -s ip-address ethernet-address
-arp -s host.domain.com 08:00:69:00:12:34
-arp -s 192.0.2.2 08:00:69:00:12:34
+Community your community name
-
Configuring the IP Address Using RARP
+
If you have more than one community name, list them all on separate lines.
-
The most flexible way to remotely assign IP addresses under
-UNIX is through the Reverse Address Resolution Protocol ("RARP").
-RARP allows a network device to request an IP address using its
-Ethernet MAC address, and one or more RARP servers on the network
-will respond with an ARP packet with the IP address the device
-can use.
+
If you don't support SNMP v1 on your network, you are currently "out of luck". That said, we will be adding v2, v2c, and v3 support in future CUPS releases once we have a handle on the actual requirements people have for such things. Please file or update an SNMP enhancement request with specific requirements you have - what you need supported, why you need it supported, and how you would like to see the functionality provided/exposed - so that we can do it "right" the first time.
-
RARP should be used when you have to manage many printers or
-print servers, or when you have a network device that does not
-remember its IP address after a power cycle. If you just have a
-single printer or print server, the arp command is
-the way to go.
+
Basic Debugging
-
Some UNIX operating systems use a program called
-rarpd(8) to manage RARP. Others, like Linux, support
-this protocol in the kernel. For systems that provide the
-rarpd program you will need to start it before RARP
-lookups will work:
+
The SNMP backend supports a debugging mode that is activated by running it from a shell prompt. If you are using Bash (/bin/bash), Bourne shell (/bin/sh), Korn shell (/bin/ksh), or Z shell (/bin/zsh), you can run the following command to get a verbose log of the SNMP backend:
-rarpd
+CUPS_DEBUG_LEVEL=2 /usr/lib/cups/backend/snmp 2>&1 | tee snmp.log
-
Under IRIX you can enable this functionality by default
-using:
+
For C shell (/bin/csh) and TCsh (/bin/tcsh), use the following command instead:
-chkconfig rarpd on
+(setenv CUPS_DEBUG_LEVEL 2; /usr/lib/cups/backend/snmp) |& tee snmp.log
-
Both the rarpd program and kernel RARP support
-read a list of Ethernet and IP addresses from the file
-/etc/ethers. Each line contains the Ethernet address
-(colon delimited) followed by an IP address or hostname like:
+
On MacOS X you'll find the SNMP backend in /usr/libexec/cups/backend instead:
-08:00:69:00:12:34 myprinter.mydomain.com
-08:00:69:00:12:34 192.0.2.2
+CUPS_DEBUG_LEVEL=2 /usr/libexec/cups/backend/snmp 2>&1 | tee snmp.log
-
Add a line to this file and cycle the power on the printer or
-print server to set its address.
-
-
Configuring the IP Address Using BOOTP
-
-
The BOOTP protocol is used when you need to provide additional
-information such as the location of a configuration file to the
-network interface. Using the standard bootpd(8)
-program supplied with UNIX you simply need to add a line to the
-/etc/bootptab file; for IRIX:
The first two lines are just informational and let you know that the default community name and address are being used. Lines 3-15 contain the initial SNMP query for the device type OID (.1.3.6.1.2.1.25.3.2.1.2.1) from the Host MIB.
-
The myprinter.boot file resides in the
-/usr/local/boot directory by default. If you do not
-need to provide a boot file you may leave the last part of the
-line blank.
+
Lines 16-31 show the response we got from an HP LaserJet 4000 network printer. At this point we discover that it is a printer device and then send another SNMP query (lines 32-43) for the device description OID (.1.3.6.1.2.1.25.3.2.1.3.1) from the Host MIB as well.
-
Note:
+
Lines 44-58 show the response to the device description query, which tells us that this is an HP LaserJet 4000 Series printer.
-
Some versions of UNIX do not enable the BOOTP service by
-default. The /etc/inetd.conf usually contains a line
-for the BOOTP service that can be uncommented if needed.
+
On line 59 we start our active connection probe and discover that this print server supports the AppSocket (JetDirect) protocol on port 9100.
-
+
Finally, line 63 shows the device information line for the print server that is sent to CUPS.
To test that the IP address has been successfully assigned and
-that the printer is properly connected to your LAN, type:
+If you don't see your printer listed, or the wrong information is listed, then you need to gather more information on the printer. The easiest way to do this is to run the snmpwalk command:
-ping ip-address
+snmpwalk -Cc -v 1 -c public ip-address | tee snmpwalk.log
-
If the connection is working properly you will see something
-like:
+
where "ip-address" is the IP address of the printer or print server. You should see a lot of values stream by - the ones you want to see are:
-
-ping myprinter
-PING myprinter (192.0.2.2): 56 data bytes
-64 bytes from 192.0.2.2: icmp_seq=0 ttl=15 time=5 ms
-64 bytes from 192.0.2.2: icmp_seq=1 ttl=15 time=3 ms
-64 bytes from 192.0.2.2: icmp_seq=2 ttl=15 time=3 ms
-64 bytes from 192.0.2.2: icmp_seq=3 ttl=15 time=3 ms
+
+HOST-RESOURCES-MIB::hrDeviceType.1 = OID: HOST-RESOURCES-TYPES::hrDevicePrinter
+HOST-RESOURCES-MIB::hrDeviceDescr.1 = STRING: HP LaserJet 4000 Series
-
If not, verify that the printer or print server is connected
-to the LAN, it is powered on, the LAN cabling is good, and the IP
-address is set correctly. You can usually see the current IP
-address and network status by printing a configuration or test
-page on the device.
+
The hrDeviceType line should show hrDevicePrinter; if not, then your printer or print server doesn't identify itself as a printer. The hrDeviceDescr line should provide a human-readable string for the make and model of the printer, although in some cases you'll just see something less useful like "Axis OfficeBASIC Parallel Print Server".
+
+
Once you have collected the snmpwalk output, you should go to the CUPS Bugs & Features page to submit a feature request to support your printer or print server. Be sure to attach those two log files you created - they will help us to identify the SNMP values we need to look for.
The Axis print servers can be configured using ARP, RARP, or
-BOOTP. However, on models that do not provide IPP support an
-additional step must be performed to configure the TCP/IP portion
-of the print server for use with CUPS.
+
The Axis print servers can be configured using BOOTP or DHCP. However, on models that do not provide IPP support an additional step must be performed to configure the TCP/IP portion of the print server for use with CUPS.
-
Each print server contains a configuration file named
-config that contains a list of network parameters used
-by the server. To modify this file you must first download it
-from the print server using the ftp(1) program:
+
Each print server contains a configuration file named config that contains a list of network parameters used by the server. To modify this file you must first download it from the print server using the ftp(1) program:
This disables the Reverse TELNET protocol and enables the
-standard TELNET protocol on the print server. Next, assign a port
-number for each parallel and serial port on the server as
-follows:
+
This disables the Reverse TELNET protocol and enables the standard TELNET protocol on the print server. Next, assign a port number for each parallel and serial port on the server as follows:
This essentially makes the Axis print server look like a
-Hewlett Packard JetDirect EX print server. Save the file and then
-upload the new config file using the ftp
-command:
+
This essentially makes the Axis print server look like a Hewlett Packard JetDirect EX print server. Save the file and then upload the new config file using the ftp command:
The Linksys print servers can be configured using ARP, RARP,
-or BOOTP. Like older Axis print servers, an additional step must
-be performed to configure the TCP/IP portion of the print server
-for use with CUPS.
+
The Linksys print servers can be configured using BOOTP or DHCP. Like older Axis print servers, an additional step must be performed to configure the TCP/IP portion of the print server for use with CUPS.
-
Each print server contains a configuration file named
-CONFIG that contains a list of network parameters used
-by the server. To modify this file you must first download it
-from the print server using the ftp(1) program:
+
Each print server contains a configuration file named CONFIG that contains a list of network parameters used by the server. To modify this file you must first download it from the print server using the ftp(1) program:
The -o outputorder=normal and -o outputorder=reverse options specify the order of the pages. Normal order prints page 1 first, page 2 second, and so forth. Reverse order prints page 1 last.
The MIME type for CUPS PostScript files is
-application/vnd.cups-postscript.
-
-
CUPS Raster File
-
-
CUPS raster files are device-dependent raster image files that contain a
-PostScript page device dictionary and device-dependent raster imagery for
-each page in the document. These files are used to transfer raster data
-from the PostScript and image file RIPs to device-dependent filters that
-convert the raster data to a printable format.
-
-
A raster file begins with a four byte synchronization word: 0x52615374
-("RaSt") for big-endian architectures and 0x74536152 ("tSaR") for little-endian
-architectures. The writer of the raster file will use the native word order,
-and the reader is responsible for detecting a reversed word order file and
-swapping bytes as needed. The CUPS Image Library raster functions perform
-this function automatically.
-
-
Following the synchronization word are a series of raster pages. Each page
-starts with a page device dictionary header and is followed immediately by the
-raster data for that page.
-
-
-
-
Bytes
-
Description
-
Values
-
-
-
0-63
-
MediaClass
-
Nul-terminated ASCII string
-
-
-
64-127
-
MediaColor
-
Nul-terminated ASCII string
-
-
-
128-191
-
MediaType
-
Nul-terminated ASCII string
-
-
-
192-255
-
OutputType
-
Nul-terminated ASCII string
-
-
-
256-259
-
AdvanceDistance
-
0 to 232 - 1 points
-
-
-
260-263
-
AdvanceMedia
-
0 = Never advance roll
- 1 = Advance roll after file
- 2 = Advance roll after job
- 3 = Advance roll after set
- 4 = Advance roll after page
-
-
-
264-267
-
Collate
-
0 = do not collate copies
- 1 = collate copies
-
-
-
268-271
-
CutMedia
-
0 = Never cut media
- 1 = Cut roll after file
- 2 = Cut roll after job
- 3 = Cut roll after set
- 4 = Cut roll after page
-
-
-
272-275
-
Duplex
-
0 = Print single-sided
- 1 = Print double-sided
-
-
-
276-283
-
HWResolution
-
Horizontal and vertical resolution in dots-per-inch.
-
-
-
284-299
-
ImagingBoundingBox
-
Four integers giving the left, bottom, right, and top positions
- of the page bounding box in points
-
-
-
300-303
-
InsertSheet
-
0 = Do not insert separator sheets
- 1 = Insert separator sheets
-
-
-
304-307
-
Jog
-
0 = Do no jog pages
- 1 = Jog pages after file
- 2 = Jog pages after job
- 3 = Jog pages after set
-
-
-
308-311
-
LeadingEdge
-
0 = Top edge is first
- 1 = Right edge is first
- 2 = Bottom edge is first
- 3 = Left edge is first
-
-
-
312-319
-
Margins
-
Left and bottom origin of image in points
-
-
-
320-323
-
ManualFeed
-
0 = Do not manually feed media
- 1 = Manually feed media
-
-
-
324-327
-
MediaPosition
-
Input slot position from 0 to N
-
-
-
328-331
-
MediaWeight
-
Media weight in grams per meter squared
-
-
-
332-335
-
MirrorPrint
-
0 = Do not mirror prints
- 1 = Mirror prints
-
-
-
336-339
-
NegativePrint
-
0 = Do not invert prints
- 1 = Invert prints
-
-
-
340-343
-
NumCopies
-
1 to 232 - 1
-
-
-
344-347
-
Orientation
-
0 = Do not rotate page
- 1 = Rotate page counter-clockwise
- 2 = Turn page upside down
- 3 = Rotate page clockwise
The MIME type for CUPS Raster files is
-application/vnd.cups-raster.
-
-
CUPS Raw Files
-
-
Raw files are printer-dependent print files that are in a format suitable
-to the destination printer (e.g. HP-PCL, HP-RTL, etc.) The MIME type for CUPS
-Raw files is application/vnd.cups-raw.
-
-
Internet Printing Protocol
-
-
The Internet Printing Protocol and the CUPS extensions to it are
-described in the CUPS Implementation of IPP document.
-
-
The Server Message Block (SMB) and related Common Internet File
-System (CIFS) protocols are described at
-http://anu.samba.org/cifs.
-
-
The URI method name for SMB is "smb". Support for this protocol is
-provided via the SAMBA smbspool(1) program provided with
-SAMBA 2.0.6 and higher.
-
-
Directories
-
-
-
-
/etc/cups
-
The scheduler configuration and MIME files reside here.
-
-
/etc/cups/certs
-
The authentication certificates reside here.
-
-
/etc/cups/interfaces
-
System V interface scripts reside here.
-
-
/etc/cups/ppd
-
This directory contains PPD files for each printer.
-
-
/usr/bin
-
The cancel, lp, lpq,
- lpr, lprm, and lpstat commands
- reside here.
-
-
/usr/lib, /usr/lib32
-
The shared libraries (DSOs) reside here.
-
-
/usr/lib/cups/backend
-
The backend filters reside here.
-
-
/usr/lib/cups/cgi-bin
-
The CGI programs reside here.
-
-
/usr/lib/cups/daemon
-
The polling and LPD daemons reside here.
-
-
/usr/lib/cups/filter
-
The file filters reside here.
-
-
/usr/sbin
-
The accept, cupsd,
- lpadmin, lpc, and reject
- commands reside here.
-
-
/usr/share/cups
-
This is the root directory of the CUPS static data.
-
-
/usr/share/cups/charsets
-
The character set files reside here.
-
-
/usr/share/cups/data
-
The filter data files reside here.
-
-
/usr/share/cups/fonts
-
The pstoraster font files reside here.
-
-
/usr/share/cups/model
-
The sample PPD files reside here.
-
-
/usr/share/cups/pstoraster
-
The pstoraster data files reside here.
-
-
/usr/share/doc/cups
-
The scheduler documentation files reside here.
-
-
/var/log/cups
-
The access_log, error_log, and
- page_log files reside here.
-
-