]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Load cups into easysw/current.
authorjlovell <jlovell@a1ca3aef-8c08-0410-bb20-df032aa958be>
Thu, 22 Jun 2006 20:01:18 +0000 (20:01 +0000)
committerjlovell <jlovell@a1ca3aef-8c08-0410-bb20-df032aa958be>
Thu, 22 Jun 2006 20:01:18 +0000 (20:01 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@181 a1ca3aef-8c08-0410-bb20-df032aa958be

148 files changed:
CHANGES-1.2.txt [new file with mode: 0644]
CHANGES.txt
INSTALL.txt
Makedefs.in
README.txt
backend/Dependencies
backend/Makefile
backend/backend-private.h [new file with mode: 0644]
backend/ieee1284.c
backend/ipp.c
backend/parallel.c
backend/runloop.c [new file with mode: 0644]
backend/serial.c
backend/snmp.c
backend/socket.c
backend/test1284.c
backend/usb-darwin.c
backend/usb-unix.c
backend/usb.c
berkeley/Dependencies
berkeley/lpq.c
cgi-bin/Dependencies
cgi-bin/admin.c
cgi-bin/help-index.c
config-scripts/cups-common.m4
config-scripts/cups-compiler.m4
config-scripts/cups-defaults.m4
config-scripts/cups-image.m4
config-scripts/cups-sharedlibs.m4
config-scripts/cups-ssl.m4
config.h.in
configure.in
cups-config.in
cups/Dependencies
cups/Makefile
cups/adminutil.c
cups/cups.h
cups/encode.c
cups/getputfile.c
cups/globals.h
cups/http-addrlist.c
cups/http-private.h
cups/http.c
cups/http.h
cups/ipp.c
cups/testhttp.c
cups/testppd.c
cups/util.c
doc/Makefile
doc/help/spec-pdf.html [new file with mode: 0644]
doc/help/spec-postscript.html [new file with mode: 0644]
doc/help/spec-raster.html
doc/pl/images/button-accept-jobs.gif
doc/pl/images/button-add-class.gif
doc/pl/images/button-add-printer.gif
doc/pl/images/button-add-this-printer.gif
doc/pl/images/button-cancel-all-jobs.gif
doc/pl/images/button-cancel-job.gif
doc/pl/images/button-change-settings.gif
doc/pl/images/button-clean-print-heads.gif
doc/pl/images/button-clear.gif
doc/pl/images/button-continue.gif
doc/pl/images/button-delete-class.gif
doc/pl/images/button-delete-printer.gif
doc/pl/images/button-edit-configuration-file.gif
doc/pl/images/button-export-samba.gif
doc/pl/images/button-help.gif
doc/pl/images/button-hold-job.gif
doc/pl/images/button-manage-classes.gif
doc/pl/images/button-manage-jobs.gif
doc/pl/images/button-manage-printers.gif
doc/pl/images/button-manage-server.gif
doc/pl/images/button-modify-class.gif
doc/pl/images/button-modify-printer.gif
doc/pl/images/button-move-job.gif
doc/pl/images/button-move-jobs.gif
doc/pl/images/button-print-self-test-page.gif
doc/pl/images/button-print-test-page.gif
doc/pl/images/button-publish-printer.gif
doc/pl/images/button-reject-jobs.gif
doc/pl/images/button-release-job.gif
doc/pl/images/button-restart-job.gif
doc/pl/images/button-save-changes.gif
doc/pl/images/button-search.gif
doc/pl/images/button-set-allowed-users.gif
doc/pl/images/button-set-as-default.gif
doc/pl/images/button-set-printer-options.gif
doc/pl/images/button-show-active.gif
doc/pl/images/button-show-all.gif
doc/pl/images/button-show-completed.gif
doc/pl/images/button-show-next.gif
doc/pl/images/button-show-previous.gif
doc/pl/images/button-sort-ascending.gif
doc/pl/images/button-sort-descending.gif
doc/pl/images/button-start-class.gif
doc/pl/images/button-start-printer.gif
doc/pl/images/button-stop-class.gif
doc/pl/images/button-stop-printer.gif
doc/pl/images/button-unpublish-printer.gif
doc/pl/images/button-use-default-config.gif
doc/pl/images/button-view-access-log.gif
doc/pl/images/button-view-error-log.gif
doc/pl/images/button-view-page-log.gif
doc/pl/images/button-view-printable-version.gif
filter/Makefile
filter/pstops.c
filter/raster.c
filter/raster.h
filter/rasterbench.c [new file with mode: 0644]
filter/rastertolabel.c
locale/Makefile
locale/cups.pot
locale/cups_es.po
locale/cups_ja.po
locale/cups_pl.po
locale/cups_sv.po
man/cupsaddsmb.man.in
man/cupsd.conf.man.in
notifier/Dependencies
packaging/WELCOME.rtf
packaging/cups.list.in
packaging/cups.readme
packaging/cups.spec.in
pdftops/Dependencies
ppd/intelbar.ppd [new file with mode: 0644]
scheduler/Dependencies
scheduler/auth.c
scheduler/client.c
scheduler/conf.c
scheduler/dirsvc.c
scheduler/filter.c
scheduler/ipp.c
scheduler/job.c
scheduler/mime.c
scheduler/newselect.txt [new file with mode: 0644]
scheduler/printers.c
scheduler/printers.h
scheduler/subscriptions.c
scheduler/subscriptions.h
scheduler/testmime.c
standards/papi-1.0.pdf [new file with mode: 0644]
systemv/Makefile
systemv/lpstat.c
templates/Makefile
test/get-job-attributes.test
test/get-jobs.test [new file with mode: 0644]
tools/makesrcdist
tools/testosx

diff --git a/CHANGES-1.2.txt b/CHANGES-1.2.txt
new file mode 100644 (file)
index 0000000..a12e030
--- /dev/null
@@ -0,0 +1,701 @@
+CHANGES-1.2.txt
+---------------
+
+CHANGES IN CUPS V1.2.2
+
+       - Sending raw jobs from a client system could cause the
+         client's scheduler to eventually crash (STR #1786)
+       - The scheduler now checks that the notifier exists prior
+         to accepting a new subscription request.
+       - The scheduler now reports the supported
+         notify-recipient schemes based on the contents of the
+         ServerBin/notifier directory.
+       - Event notifications did not include the
+         notify-sequence-number or other required attributes
+         (STR #1747)
+       - Allow/Deny addresses of the form "11.22.33.*" did not
+         work on Linux (STR #1769)
+       - cupsGetPPD() did not work if the scheduler was only
+         listening on a domain socket (STR #1766)
+       - The scheduler could crash advertising a class (STR
+         #1768)
+       - The scheduler could crash if the default printer was
+         deleted (STR #1776)
+       - Added a new default CUPS raster format (v3) which does
+         not compress the raster stream in order to provide the
+         same cupsRasterReadPixels() and cupsRasterWritePixels()
+         performance as CUPS 1.1.x.
+       - The cupsaddsmb man page listed the wrong files for the
+         CUPS driver.
+       - Some configure --with options did not work (STR #1746)
+       - "Allow @IF(name)" didn't work if "name" wasn't the
+         first network interface (STR #1758)
+       - The lpstat command did not use the correct character
+         set when reporting the date and time (STR #1751)
+       - The cupsaddsmb command and web interface did not update
+         the Windows PPD files properly, resulting in corrupt
+         PPD files for the Windows client to use (STR #1750)
+       - The cupsd.conf man page didn't describe the Listen
+         domain socket syntax (STR #1753)
+       - The scheduler no longer tries to support more than
+         FD_SETSIZE file descriptors.
+       - CDSA (encryption) support fixes for MacOS X.
+       - The lppasswd program needs to be setuid to root to
+         create and update the /etc/cups/passwd.md5 file (STR
+         #1735)
+       - 32/64-bit library installation was broken (STR #1741)
+       - The USB backend now reports a "no such device" error
+         when using the old filename-based USB URIs instead of
+         the "success" error.
+       - Increased the HTTP and IPP read timeouts to 10 seconds,
+         as 1 second was too short on congested networks (STR
+         #1719)
+       - The SNMP backend now uses the device description over
+         the printer-make-and-model attribute when the attribute
+         contains a generic name (STR #1728)
+       - Fixed another file descriptor leak when printing raw
+         files (STR #1736)
+       - Raw queues were not shared via LDAP (STR #1739)
+       - The pstops filter didn't always embed PageSetup
+         commands from the PPD file (STR #1740)
+       - "make install" didn't work if you disabled all of the
+         localizations.
+       - The scheduler didn't always choose the least costly
+         filter.
+       - Fixed parsing of IPv6 addresses in Allow, Deny,
+         BrowseAllow, BrowseDeny, and BrowseRelay directives
+         (STR #1713)
+       - Printers that were shared via LDAP did not get added to
+         the LDAP server properly (STR #1733)
+       - LDAP browsing would crash the scheduler if a required
+         value was missing (STR #1731)
+       - Special cases for the "localhost" hostname did not
+         work, causing printing to not work when the /etc/hosts
+         file did not contain a localhost entry (STR #1723)
+       - Updated the Spanish translation (STR #1720)
+       - Reverse-order page output was broken when N-up or
+         landscape orientations were used (STR #1725)
+       - The parallel, serial, socket, and USB backends needed
+         print data before they would report back-channel data,
+         causing problems with several new drivers (STR #1724)
+
+
+CHANGES IN CUPS V1.2.1
+
+       - The web interface support programs crashed on Solaris
+         (STR #1699)
+       - cupstestppd incorrectly reported problems with
+         *1284DeviceID attributes (STR #1710)
+       - Browsing could get disabled after a restart (STR #1670)
+       - Custom page sizes were not parsed properly (STR #1709)
+       - The -U option wasn't supported by lpadmin (STR #1702)
+       - The -u option didn't work with lpadmin (STR #1703)
+       - The scheduler did not create non-blocking back-channel
+         pipes, which caused problems when the printer driver
+         did not read the back-channel data (STR #1705)
+       - The scheduler no longer uses chunking in responses to
+         clients - this caused problems with older versions of
+         CUPS like 1.1.17 (PR #6143)
+       - Automatic raw printing was broken (STR #1667)
+       - 6-up printing was broken (STR #1697)
+       - The pstops filter did not disable CTRL-D processing on
+         the printer/RIP.
+       - ppdOpen*() did not load custom options properly (STR
+         #1680)
+       - "Set Printer Options" in the web interface did not
+         update the DefaultImageableArea or
+         DefaultPaperDimension attributes in the PPD file (STR
+         #1689)
+       - Fixed compile errors (STR #1682, STR #1684, STR #1685,
+         STR #1690)
+       - The lpstat command displayed the wrong error message
+         for a missing destination (STR #1683)
+       - Revised and completed the Polish translation (STR
+         #1669)
+       - Stopped jobs did not show up in the list of active jobs
+         (STR #1676)
+       - The configure script did not use the GNU TLS
+         "libgnutls-config" script to find the proper compiler
+         and linker options.
+       - The imagetoraster filter did not correctly generate
+         several 1, 2, and 4-bit color modes.
+       - cupsRasterWritePixels() could lose track of the current
+         output row.
+       - cupsRasterReadPixels() did not automatically swap
+         12/16-bit chunked pixel data.
+       - Moved the private _cups_raster_s structure out of the
+         public header.
+       - Updated the CUPS raster format specification to include
+         encoding rules and colorspace definitions.
+       - The Zebra PPD files had the wrong PostScript code for
+         the "default" option choices.
+       - The imagetoraster filter did not generate correct CIE
+         XYZ or Lab color data.
+       - The cups-config script did not work when invoked from a
+         source directory (STR #1673)
+       - The SNMP backend did not compile on systems that used
+         the getifaddrs emulation functions (STR #1668)
+
+
+CHANGES IN CUPS V1.2
+
+       - Documentation updates (STR #1618, STR #1620, STR #1622,
+         STR #1637)
+       - Static file copy buffers reduced from 64k to 32k to
+         work around bogus MallocDebug library assumptions (STR
+         #1660)
+       - The scheduler did not decode the backend exit code
+         properly (STR #1648)
+       - The MacOS X USB backend did not report the 1284 device ID,
+         nor did it fix device IDs returned by HP printers.
+       - The scheduler started more slowly than 1.1.x with large
+         numbers of printers (STR #1653)
+       - cupsRasterInterpretPPD() didn't support the
+         cupsPreferredBitsPerColor attribute, and imagetoraster
+         didn't use the new API.
+       - The "make test" script did not create all of the necessary
+         subdirectories for testing (STR #1638)
+       - The scheduler did not prevent rotation of logs
+         redirected to /dev/null (STR #1651)
+       - "make test" did not include the SNMP backend in the
+         test environment (STR #1625)
+       - The EPM packaging files did not work (STR #1621)
+       - "Use Default Configuration" inserted a broken
+         configuration file (STR #1624)
+       - Redirects in the web interface did not always preserve
+         the encrypted status of a connection (STR #1603)
+       - Added the Apple "pap" backend.
+       - Added CUPS library to CUPS Image shared library
+         linkage to support Linux --as-needed linker option
+         (STR #1606)
+       - Fixed support for --enable-pie (STR #1609)
+       - The pdftops filter did not validate the length of the
+         encryption key (STR #1608)
+       - Updated the Polish localization.
+       - "Encryption Required" in the cupsd.conf file now only
+         requires encryption when the connection is not over the
+         loopback interface or domain socket.
+       - Printer names containing "+" were not quoted properly in
+         the web interface (STR #1600)
+       - The SNMP backend now reports the make and model in the
+         information string so that the auto-generated printer
+         name is more useful than just an IP address.
+
+
+CHANGES IN CUPS V1.2rc3
+
+       - The cups-lpd program always did reverse lookups on the
+         client address, which could be a performance problem.
+         Added a "-n" option to disable lookups.
+       - When configured with SSL support, require encryption by
+         default when displaying the /admin location (STR #1592)
+       - The next job ID was not computed correctly if the job
+         cache file got out of sync with the spool directory
+         (STR #1582)
+       - The PNG image handling code used deprecated functions
+         from libpng (STR #1587)
+       - Added a Polish translation (STR #1584, STR #1586)
+       - More changes to the scheduler to improve battery life
+         on portable devices (STR #1583)
+       - Changed the default log level for status messages back
+         to "DEBUG" to be consistent with CUPS 1.1.x (STR #1579)
+       - The error string was not set properly when
+         cupsDoFileRequest() was given the name of a directory
+         (STR #1578)
+       - Fixed handling of job-hold-until (STR #1581)
+       - Added explicit notes to the cupsaddsmb man page
+         explaining that the driver filenames are case-sensitive
+         under UNIX and that they must be all lowercase (Windows
+         2000) or all UPPERCASE (Windows 95/98/Me) to work (STR
+         #1568)
+       - The USB backend incorrectly split the manufacturer name
+         if it contained spaces (STR #1566)
+       - The scheduler would hang when listing PPD files for a
+         manufacturer whose name contained spaces (STR #1567)
+       - Added the SNMP backend for network printer discovery
+         (STR #1555)
+       - cupstestppd now fails PPD files with 1284DeviceId
+         instead of 1284DeviceID, and cups-driverd uses a
+         case-insensitive comparison when looking for it (STR
+         #1573)
+       - cupsDoFileRequest() and cupsDoRequest() now work
+         properly with non-blocking HTTP connections.
+       - Added Swedish translation (STR #1569)
+       - "make install" now installs the MIME files with world
+         read permissions (STR #1565)
+       - More CDSA encryption support fixes (STR #1563)
+       - Updated the default mime.types file to support printing
+         of files that do not have a locally-recognized MIME
+         media type to raw or System V queues.
+       - Updated the serial port detection code on Linux (STR
+         #1562)
+       - Added some more error checking to httpGetHostname()
+         (STR #1561)
+       - The title of some administration pages was not
+         localized (STR #1548)
+       - The edit-config.tmpl file was not generated or
+         installed for the Spanish or Japanese localizations
+         (STR #1547)
+       - The mimeDelete() function freed the types before the
+         filters, but the filters needed the type data (STR #1558)
+       - The scheduler didn't keep track of the status pipes
+         properly, leading to a bad select() for multi-file jobs
+         (STR #1559)
+       - The cupstestdsc program didn't validate the ordinal
+         page number value for %%Page: comments.
+
+
+CHANGES IN CUPS V1.2rc2
+
+       - The scheduler was not always using the string pool,
+         causing random crashes.
+       - The lpmove and the web interface's Move Job button did
+         not work with stopped jobs (STR #1534)
+       - The PostScript filter did not handle the page-set
+         option properly with number-up printing (STR #1543)
+       - The scheduler now only warns about unsupported ACLs
+         once (STR #1532)
+       - The "fitplot" option did not work with output from
+         Mozilla (STR #1542)
+       - The imagetops filter did not work with Level 2 or 3
+         printers (STR #1533)
+       - The scheduler now recognizes PostScript files with PJL
+         commands that do not include an ENTER LANGUAGE command.
+       - Added --with-printcap configure option.
+       - 64-bit SSL fixes for MacOS X.
+       - The scheduler didn't send some printer state change
+         events.
+       - The scheduler didn't send jobs to busy remote printers.
+       - Fixed some problems with the launchd support.
+       - Added new USB printer backend for MacOS X.
+       - The PostScript filter now handles files that start with
+         an incomplete PJL header (PR #6076)
+       - The web interface language selection code did not try
+         the generic language localization (STR #1531)
+       - The language cache, string pool, and transcoding caches
+         are now process global instead of per-thread to avoid
+         problems with GNOME and to allow for data sharing
+         between threads (STR #1530)
+       - Fixed a CUPS 1.1.x compatibility bug (STR #1528)
+       - The web interface redirection after certain printer
+         administration tasks was broken (STR #1516)
+       - Web interface authorization could get stuck (STR #1512)
+       - Localization updates (STR #1513, STR #1518, STR #1520)
+       - The pstops filter didn't work with some files (STR
+         #1523)
+       - "./configure --enable-static" didn't work (STR #1522)
+       - The scheduler was not using the configured default
+         Group (STR #1521)
+       - The web interface still did not show the localized time
+         and date for some locales and systems (STR #1509)
+       - httpAddrGetList() would crash on systems without
+         getaddrinfo().
+       - Socket URIs without a trailing slash would cause the
+         port number to not be accepted (STR #1519)
+       - Local raw and System V printers were not advertised as
+         such for printer browsing (STR #1502)
+       - The RPM spec file incorrectly put duplicate copies of
+         the Japanese and Spanish web interface templates in the
+         main cups package (STR #1517)
+       - cupsSetDests() did not explicitly set the permissions
+         of the /etc/cups/lpoptions file (STR #1508)
+       - The lpq command crashed with the -h option (STR #1515)
+
+
+CHANGES IN CUPS V1.2rc1
+
+       - Documentation updates (STR #1497, STR #1498)
+       - The scheduler now redirects browsers to https: URLs
+         when encryption is required.
+       - The scheduler would crash when printing with a banner
+         (STR #1500)
+       - cups-driverd did not use the LanguageEncoding attribute
+         in PPD files to convert the NickName to UTF-8 (STR
+         #1503)
+       - The lpadmin command could not set the
+         printer-error-policy attribute (STR #1504)
+       - The web interface did not show the time and date in the
+         correct format for the locale (STR #1505)
+       - CUPS no longer accepts print jobs if a printer does not
+         support the file format (STR #1501)
+       - Cleaned up the PostScript filter (pstops) so that it
+         properly supports %%IncludeFeature and page scaling
+         (STR #1453)
+       - Fixed the cupsFileRewind() and cupsFileSeek() functions
+         to work properly with uncompressed files.
+       - Added cupsFileGetLine(), cupsFileStderr(),
+         cupsFileStdin(), and cupsFileStdout() functions to the
+         CUPS library.
+       - Added a new cupstestdsc program to test the DSC
+         conformance of PostScript files.
+       - Added KDE/GNOME icons and a Manage Printers menu item.
+       - Added --enable-image and --enable-pdftops configure
+         options to control whether the image and PDF filters
+         are built and installed (default = yes for all
+         platforms but MacOS X)
+       - Fixed a minor memory leak in the PPD API.
+       - Fixed transcoding issues (STR #1493)
+       - The scheduler now enforces a minimum job cost of 100
+         when doing FilterLimit checks.
+       - The scheduler would leak file descriptors when printing
+         to raw queues (STR #1491)
+       - The IPv6 support did not compile on Tru64 UNIX (STR
+         #1488)
+       - ppdOpen2() now converts the NickName and all UI text to
+         UTF-8 (STR #1475)
+       - The Set Allowed Users web page did not work (STR #1486)
+       - When the default policy was not set or set to a non-
+         existing policy, the scheduler did not set the default
+         policy name to "default" (STR #1484)
+       - The Zebra CPCL driver did not use the correct righthand
+         margin for the 4" wide label sizes.
+       - Fixed a problem with the parsing of fractional real
+         numbers in PPD files.
+       - Added Spanish localization files (STR #1480)
+       - Fixed localization of a few scheduler messages (STR
+         #1478)
+       - Fixed support for HEAD requests in the scheduler (STR
+         #1481)
+
+
+CHANGES IN CUPS V1.2b2
+
+       - Updated the CUPS design description.
+       - Added --enable-32bit and --enable-64bit configure
+         options to allow building of separate 32/64-bit
+         libraries on systems that support both environments
+         (STR #1472)
+       - Various compiler warning fixes.
+       - Fixes for Solaris 10 builds against old GNU TLS and
+         LDAP libraries.
+       - Added a cupsArrayUserData() function to retrieve the
+         user data pointer for an array (useful for typing
+         arrays)
+       - The ppdEmitString() function did not compute the
+         required buffer size properly, leading to dropped
+         characters on the end of the printer commands in pstops
+         and imagetops (STR #1470)
+
+
+CHANGES IN CUPS V1.2b1
+
+       - The serial backend now supports Equinox 8-port serial
+         hubs (STR #526)
+       - The IPP backend now supports a compression option to
+         compress print files as they are sent to the remote
+         server (STR #956)
+       - The CUPS browse protocol now supports passing of
+         default options and browse timeout values from the
+         server to the clients (STR #800)
+       - Implicit classes that timed out could cause the
+         scheduler to crash (STR #1439)
+       - Added DragonFly support in local device backends (STR
+         #1362)
+       - Added LDAP printer browsing support (STR #338)
+       - Added official support for printer maintenance commands
+         via the CUPS Command file format and hooks in the
+         printer-type and web interfaces (STR #932)
+       - The HP-GL/2 filter could get in an infinite loop trying
+         to convert HP-PCL files (STR #1415)
+       - CUPS now implements the HTTP/1.1 Expect header (STR
+         #1407)
+       - Options in PPD files are no longer automatically put in
+         an "Extra" group; rather, all options that are not
+         inside an Open/CloseGroup will be placed in the
+         "General" group (STR #1385)
+       - The scheduler now creates a job-uuid attribute that
+         uniquely identifies a job on a network (STR #1410)
+       - The init script now unsets the TMPDIR environment
+         variable to prevent user temporary directories from
+         being used by cupsd accidentally (STR #1424)
+       - Added support for launchd on MacOS X.
+       - Added support for notify_post on MacOS X.
+       - Added support for DBUS on Linux.
+       - All of the Berkeley (except for lpc) and System V
+         commands now support specification of user, host, and
+         port (STR #1028, STR #1029, STR #1087)
+       - The lpmove command now allows you to move all jobs for
+         a given queue (STR #56)
+       - The web interface now supports moving of a job or jobs
+         to another queue (STR #56)
+       - The web interface now provides searching, paging, and
+         changing of the sort/display order of classes, jobs,
+         and printers.
+       - cupsaddsmb now accepts a password on the command-line
+         and supports passwords with special characters (STR
+         #822, STR #1236)
+       - ppdLoad*() no longer tries to "fix" bad characters in
+         UI text (STR #1101)
+       - Printer names can now (reliably) contain Unicode
+         characters (STR #896)
+       - The lpstat command now shows the time and date of the
+         last printer state change instead of the hardcoded "Jan
+         01 00:00" (STR #659)
+       - The scheduler now adds a job-actual-printer-uri
+         attribute to job objects when printing to a class (STR
+         #116)
+       - The scheduler now logs log file open errors to the
+         system log (STR #1289)
+       - The scheduler now sets the job-originating-user-name to
+         the authenticated username, if available (STR #1318)
+       - The scheduler now only updates the permissions of SSL
+         keys and certificates when they are under the
+         ServerRoot directory (STR #1324)
+       - The rastertodymo driver has been renamed to
+         rastertolabel (a symlink is installed so that existing
+         queues continue to work) and now also supports Zebra's
+         CPCL language.
+       - The lpstat command could show the wrong active job for
+         a printer (STR #1301)
+       - Fixed a potential crash problem in the scheduler when
+         aborting a CGI program (STR #1290)
+       - Added a "cancel all jobs" button to the class and
+         printer web interfaces (STR #1140)
+       - The add-printer web page now shows the
+         set-printer-options page after the printer has been
+         added (STR #690)
+       - The classes web page now provides links to each of the
+         member printers (STR #307)
+       - CUPS now handles HTTP request/response lines up to 32k
+         in length; this is mainly for better cookie support
+         (STR #1274)
+       - Added support for the Apache PassEnv and SetEnv
+         directives to cupsd.conf (STR #853)
+       - Added large file (64-bit) support (STR #541)
+       - Fixed a performance issue with the ippReadIO()
+         implementation (STR #1284)
+       - Fixed a performance issue with the scheduler's implicit
+         class implementation (STR #1283)
+       - The pdftops filter now adds the Title and Creator
+         fields from the PDF file to the PostScript document
+         comments section (STR #539, STR #830)
+       - Added a new cups_array_t and cupsArray*() functions to
+         the CUPS API to support sorted lists of data.
+       - Made the CUPS API library thread-safe (STR #1276)
+       - Added "media" option support for EFI EFMediaType option
+         (STR #902)
+       - Added write buffering to the HTTP code to improve
+         performance (STR #547)
+       - The scheduler now uses the attributes-natural-language
+         attribute to localize banner pages (STR #386)
+       - The scheduler now returns the address that was used to
+         connect to it (STR #1076)
+       - Fixed a problem with N-up printing and OpenOffice (STR
+         #576)
+       - Added support for the GCC position independent
+         executable options (STR #1209)
+       - Added new BrowseLocalProtocols and
+         BrowseRemoteProtocols directives to cupsd.conf,
+         allowing for different browse protocols for local and
+         remote printers (STR #877)
+       - PPD files can now contain strings up to 256k in length
+         (STR #1215)
+       - The pstops filter now supports the IncludeFeature DSC
+         comment (STR #1212)
+       - The pstops filter now disables the setpagedevice
+         procedure when doing N-up printing (STR #1161)
+       - The serial backend now supports "stop=1", "stop=2",
+         "parity=space", and "parity=mark" options (STR #1155)
+       - "make install" no longer overwrites an existing PAM
+         configuration file (STR #1064)
+       - The scheduler now closes all files on startup when run
+         in daemon mode (STR #1009)
+       - Added a new RGBW colorspace to the CUPS raster format
+         (STR #1071)
+       - The pdftops filter now sets the page size based on the
+         media box when not scaling the output (STR #912)
+       - The pdftops filter now supports masked images (STR
+         #281)
+       - The pdftops filter produced large output when rendering
+         PDF files containing lot of repeated images (STR #327)
+       - The pdftops filter now minimizes print processing of
+         PDF files when using the page-ranges option (STR #273)
+       - Updated pdftops filter to Xpdf 3.01.
+       - Added new cupsBackchannelRead() and
+         cupsBackchannelWrite() functions, as well as
+         backchannel support to the parallel, serial, socket,
+         and USB backends (STR #1252)
+       - The parallel and USB backends now treat a "no space
+         available" error as an out-of-paper condition (STR
+         #1225)
+       - The "lpc" command now supports the "status all" command
+         (STR #1004)
+       - ippReadIO() did not read collections properly (STR
+         #1249)
+       - The "make test" script now creates the test files in
+         "/tmp/cups-$USER" instead of "/tmp/$USER" (STR #981)
+       - All backends now abort on error when printing a job to
+         a class - this allows the next printer in the class to
+         print the job (STR #1084)
+       - The scheduler now verifies that a printer supports
+         Letter or A4 media sizes before setting them as the
+         initial default (STR #1250)
+       - The cupstestppd program now flags bad Resolution
+         options (STR #1269)
+       - The USB backend now retries printing when the printer
+         is disconnected or turned off (STR #1267)
+       - Added new httpGetHostname() function to CUPS API, and
+         use it instead of gethostname() so that the web
+         interface will work correctly on systems whose hostname
+         is not the FQDN (STR #1266)
+       - The scheduler now stops printers if the backend for the
+         queue is missing on startup (STR #1265)
+       - The configure script now supports "--disable-library"
+         to disable particular image file format support
+         libraries, even if they are available on the build
+         system (STR #1248)
+       - The IPP backend did not always report on the total
+         number of pages that were printed (STR #1251)
+       - The lpstat program could display garbage date and time
+         values for locales whose date format exceeded 31
+         characters (STR #1263)
+       - The cupstestppd program would segfault when testing
+         certain broken PPD files (STR #1268)
+       - Dramatically reduced the overhead of implicit classes.
+       - Added new cupsDir*() functions to CUPS API.
+       - Printers can now be published individually for sharing.
+       - Fixed a bug in the scheduler's startup signalling code
+         which caused cupsd to send the SIGUSR1 signal to the
+         init process instead of the original parent process
+         (STR #1258)
+       - Added new on-line help CGI to web interface to provide
+         searchable help.
+       - Devices are now tracked dynamically, with each query
+         doing a new device scan.  This eliminates a previous
+         startup delay caused by slow backends and allows new
+         printers to be seen without restarting the server,
+         however it limits the amount of device URI checking
+         that can be done (basically now the scheduler only
+         requires a URI with a method that is a listed backend)
+       - Added new printer auto-detection, server configuration,
+         and log file viewing to the administration web page.
+       - Added new "set allowed users" web interface to set the
+         list of allowed users for a printer or class.
+       - The scheduler, command-line, and web interfaces now
+         limit the list of printers and classes to those
+         accessible by a user.
+       - cupsMarkOptions() now handles more non-standard
+         duplexing options and choices (STR #915)
+       - cups-lpd now honors remote banner requests with the
+         "standard" banner whenever a printer does not have one
+         defined (STR #1220)
+       - The scheduler's denial-of-service checks did not work
+         properly with IPv6 addresses (STR #1134)
+       - The lp and lpr commands did not error out properly when
+         they were unable to write to a temporary file (STR
+         #1129)
+       - The pstops filter did not handle Adobe-specific
+         comments in Windows NT driver output (STR #1085)
+       - "lpstat -l -p" incorrectly reported the printer
+         interface (STR #936)
+       - The web interface now operates exclusively with the
+         UTF-8 encoding, and sends the appropriate character set
+         and header information to the web browser (STR #919,
+         STR #1007)
+       - Added a "set allowed users" interface to the web
+         interface so that you can set the list of allowed or
+         denied users/groups for a printer or class.
+       - Disallow the "#" character in printer names, since it
+         has special meaning in the shell, config files, and in
+         URIs (STR #917, STR #1202)
+       - Added a new application/x-csource MIME type, and
+         support for it to the texttops filter so that you can
+         pretty print plain text files without the C/C++
+         keywords being highlighted.
+       - The pdftops filter did not compile with GCC 4.0 (STR
+         #1226)
+       - The texttops filter did not highlight preprocessor
+         directives followed by a tab properly.
+       - HP PJL output now uses both JOB DISPLAY and RDYMSG
+         commands to show the current job on the printer's
+         display (STR #1218)
+       - Local authentication certificates are now stored in
+         /var/run/cups/certs by default instead of
+         /etc/cups/certs (STR #1211)
+       - Backends now use "&" to separate options in device
+         URIs; "+" is still recognized but is deprecated (STR
+         #842)
+       - The USB backend no longer supports the usb:/dev/foo
+         format on systems that support device ID queries.
+       - Forced classification markings did not work when the
+         job-sheets parameters were "none,none".
+       - "lpstat -l -p" incorrectly showed all users as allowed,
+         even if the queue was restricted to certain users (STR
+         #801)
+       - The scheduler now automatically detects SSL/TLS clients
+         without using the SSLPort/SSLListen directives.
+       - The CUPS API and scheduler no longer support SSLv2-
+         encrypted connections.
+       - Updated the cupsaddsmb utility to correctly export the
+         CUPS driver for Windows.
+       - Fixed a signal-handling bug in httpRead() which
+         ultimately caused the server to print multiple copies
+         when it was busy (STR #1184)
+       - The cupsFile API now uses the O_APPEND option when
+         opening files in append mode (STR #990)
+       - The md5.h header and md5_* functions are now officially
+         private and have been renamed to avoid conflicts with
+         other implementations with the same name.
+       - The pdftops filter incorrectly embedded some Type1
+         fonts (STR #1093)
+       - The scheduler didn't detect a closed connection in the
+         middle of an IPP request (STR #1153)
+       - The scheduler could block trying to read the job status
+         if there was input pending and the job was cancelled in
+         the same input cycle (STR #1157)
+       - The scheduler could crash when deleting a class due to
+         infinite recursion.
+       - Updated the Zebra ZPL label printer driver to use the
+         run-length encoding and support more options.
+       - Updated serial backend to scan for /dev/ttyC* as well
+         as /dev/ttyc* for Cyclades serial ports (STR #1049)
+       - The scheduler could hang reading the job status under
+         certain circumstances (STR #1068)
+       - The USB backend termination signal code was inverted
+         (STR #1046)
+       - Moved enable and disable commands to sbindir to be
+         consistent.
+       - Added new cupsRasterInterpretPPD() function for RIP
+         filters to setup the raster page header from
+         PostScript commands in a PPD file.
+       - The CUPS browsing protocol now offers a "delete" bit
+         to remove printers as soon as they are deleted on the
+         server or as soon as the server shuts down gracefully
+         (STR #793)
+       - The CUPS_SERVER and ServerName directives (client.conf
+         and ~/.cupsrc) may now contain names of the form
+         "server:port" and "/path/to/domain/socket".
+       - The "cancel -u user" command now works for ordinary
+         users (STR #751)
+       - Added test run support to "make test" target (STR #64)
+       - Added domain socket support (STR #656)
+       - Added BrowseLocalOptions directive to allow the
+         administrator to add printer URI options to the browse
+         URI, e.g. "encryption=required" (STR #732)
+       - Added BrowseRemoteOptions directive to allow the
+         administrator to add standard URI options to the
+         remote printer URI, e.g. "encryption=required" (STR
+         #732)
+       - Now put "-I.." compiler option in front of all others
+         to ensure that local CUPS headers are used before
+         installed headers (STR #437)
+       - New cupsLangPrintf() and cupsLangPuts() for localized
+         interfaces.
+       - Now support custom attributes and extended options in
+         PPD files.
+       - Now provide functions to save PPD files.
+       - New policy mechanism allows per-operation and
+         per-printer control over what users and groups are
+         allowed to do various IPP operations.
+       - New error policy mechanism to control how aborted
+         backend errors are handled by the scheduler
+         (abort-job, retry-job, requeue-job, stop-printer)
+       - Updated the printer test page with a better color
+         wheel and a separate grayscale ramp.
+       - A single backend process is now run to send all print
+         data for a job.
+       - Backends and filters can now send and receive
+         backchannel data over file descriptor 3.
+       - Updated the raster stream format to support more
+         user-defined attributes and to do compression of the
+         page data.
index 87691a8c70334c673ddb8d000104a1e28d340f71..e78abe1a3c7762029bfdf0624d3ca037b9ed2a02 100644 (file)
-CHANGES.txt - 2006-05-22
+CHANGES.txt - 2006-06-06
 ------------------------
 
-CHANGES IN CUPS V1.2.1
+CHANGES IN CUPS V1.3
 
-       - The web interface did not handle reloads properly for
-         MSIE (STR #1716)
-       - The configure script no longer adds linker rpath
-         options when they are unnecessary.
-       - The scheduler could crash printing a debug message on
-         Solaris (STR #1714)
-       - The --enable-32bit and --enable-64bit configure options
-         did not always work.
-       - The password prompt showed the domain socket address
-         instead of "localhost" for local authentication (STR
-         #1706)
-       - The web interface filtered the list of printers even if
-         the user wasn't logged in (STR #1700)
-       - The IPP backend did not work reliably with some Xerox
-         printers (STR #1704)
-       - Trailing banners were not added when printing a single
-         file (STR #1698)
-       - The web interface support programs crashed on Solaris
-         (STR #1699)
-       - cupstestppd incorrectly reported problems with
-         *1284DeviceID attributes (STR #1710)
-       - Browsing could get disabled after a restart (STR #1670)
-       - Custom page sizes were not parsed properly (STR #1709)
-       - The -U option wasn't supported by lpadmin (STR #1702)
-       - The -u option didn't work with lpadmin (STR #1703)
-       - The scheduler did not create non-blocking back-channel
-         pipes, which caused problems when the printer driver
-         did not read the back-channel data (STR #1705)
-       - The scheduler no longer uses chunking in responses to
-         clients - this caused problems with older versions of
-         CUPS like 1.1.17 (PR #6143)
-       - Automatic raw printing was broken (STR #1667)
-       - 6-up printing was broken (STR #1697)
-       - The pstops filter did not disable CTRL-D processing on
-         the printer/RIP.
-       - ppdOpen*() did not load custom options properly (STR
-         #1680)
-       - "Set Printer Options" in the web interface did not
-         update the DefaultImageableArea or
-         DefaultPaperDimension attributes in the PPD file (STR
-         #1689)
-       - Fixed compile errors (STR #1682, STR #1684, STR #1685,
-         STR #1690)
-       - The lpstat command displayed the wrong error message
-         for a missing destination (STR #1683)
-       - Revised and completed the Polish translation (STR
-         #1669)
-       - Stopped jobs did not show up in the list of active jobs
-         (STR #1676)
-       - The configure script did not use the GNU TLS
-         "libgnutls-config" script to find the proper compiler
-         and linker options.
-       - The imagetoraster filter did not correctly generate
-         several 1, 2, and 4-bit color modes.
-       - cupsRasterWritePixels() could lose track of the current
-         output row.
-       - cupsRasterReadPixels() did not automatically swap
-         12/16-bit chunked pixel data.
-       - Moved the private _cups_raster_s structure out of the
-         public header.
-       - Updated the CUPS raster format specification to include
-         encoding rules and colorspace definitions.
-       - The Zebra PPD files had the wrong PostScript code for
-         the "default" option choices.
-       - The imagetoraster filter did not generate correct CIE
-         XYZ or Lab color data.
-       - The cups-config script did not work when invoked from a
-         source directory (STR #1673)
-       - The SNMP backend did not compile on systems that used
-         the getifaddrs emulation functions (STR #1668)
-
-
-CHANGES IN CUPS V1.2.0
-
-       - Documentation updates (STR #1618, STR #1620, STR #1622,
-         STR #1637)
-       - Static file copy buffers reduced from 64k to 32k to
-         work around bogus MallocDebug library assumptions (STR
-         #1660)
-       - The scheduler did not decode the backend exit code
-         properly (STR #1648)
-       - The MacOS X USB backend did not report the 1284 device ID,
-         nor did it fix device IDs returned by HP printers.
-       - The scheduler started more slowly than 1.1.x with large
-         numbers of printers (STR #1653)
-       - cupsRasterInterpretPPD() didn't support the
-         cupsPreferredBitsPerColor attribute, and imagetoraster
-         didn't use the new API.
-       - The "make test" script did not create all of the necessary
-         subdirectories for testing (STR #1638)
-       - The scheduler did not prevent rotation of logs
-         redirected to /dev/null (STR #1651)
-       - "make test" did not include the SNMP backend in the
-         test environment (STR #1625)
-       - The EPM packaging files did not work (STR #1621)
-       - "Use Default Configuration" inserted a broken
-         configuration file (STR #1624)
-       - Redirects in the web interface did not always preserve
-         the encrypted status of a connection (STR #1603)
-       - Added the Apple "pap" backend.
-       - Added CUPS library to CUPS Image shared library
-         linkage to support Linux --as-needed linker option
-         (STR #1606)
-       - Fixed support for --enable-pie (STR #1609)
-       - The pdftops filter did not validate the length of the
-         encryption key (STR #1608)
-       - Updated the Polish localization.
-       - "Encryption Required" in the cupsd.conf file now only
-         requires encryption when the connection is not over the
-         loopback interface or domain socket.
-       - Printer names containing "+" were not quoted properly in
-         the web interface (STR #1600)
-       - The SNMP backend now reports the make and model in the
-         information string so that the auto-generated printer
-         name is more useful than just an IP address.
-
-
-CHANGES IN CUPS V1.2rc3
-
-       - The cups-lpd program always did reverse lookups on the
-         client address, which could be a performance problem.
-         Added a "-n" option to disable lookups.
-       - When configured with SSL support, require encryption by
-         default when displaying the /admin location (STR #1592)
-       - The next job ID was not computed correctly if the job
-         cache file got out of sync with the spool directory
-         (STR #1582)
-       - The PNG image handling code used deprecated functions
-         from libpng (STR #1587)
-       - Added a Polish translation (STR #1584, STR #1586)
-       - More changes to the scheduler to improve battery life
-         on portable devices (STR #1583)
-       - Changed the default log level for status messages back
-         to "DEBUG" to be consistent with CUPS 1.1.x (STR #1579)
-       - The error string was not set properly when
-         cupsDoFileRequest() was given the name of a directory
-         (STR #1578)
-       - Fixed handling of job-hold-until (STR #1581)
-       - Added explicit notes to the cupsaddsmb man page
-         explaining that the driver filenames are case-sensitive
-         under UNIX and that they must be all lowercase (Windows
-         2000) or all UPPERCASE (Windows 95/98/Me) to work (STR
-         #1568)
-       - The USB backend incorrectly split the manufacturer name
-         if it contained spaces (STR #1566)
-       - The scheduler would hang when listing PPD files for a
-         manufacturer whose name contained spaces (STR #1567)
-       - Added the SNMP backend for network printer discovery
-         (STR #1555)
-       - cupstestppd now fails PPD files with 1284DeviceId
-         instead of 1284DeviceID, and cups-driverd uses a
-         case-insensitive comparison when looking for it (STR
-         #1573)
-       - cupsDoFileRequest() and cupsDoRequest() now work
-         properly with non-blocking HTTP connections.
-       - Added Swedish translation (STR #1569)
-       - "make install" now installs the MIME files with world
-         read permissions (STR #1565)
-       - More CDSA encryption support fixes (STR #1563)
-       - Updated the default mime.types file to support printing
-         of files that do not have a locally-recognized MIME
-         media type to raw or System V queues.
-       - Updated the serial port detection code on Linux (STR
-         #1562)
-       - Added some more error checking to httpGetHostname()
-         (STR #1561)
-       - The title of some administration pages was not
-         localized (STR #1548)
-       - The edit-config.tmpl file was not generated or
-         installed for the Spanish or Japanese localizations
-         (STR #1547)
-       - The mimeDelete() function freed the types before the
-         filters, but the filters needed the type data (STR #1558)
-       - The scheduler didn't keep track of the status pipes
-         properly, leading to a bad select() for multi-file jobs
-         (STR #1559)
-       - The cupstestdsc program didn't validate the ordinal
-         page number value for %%Page: comments.
-
-
-CHANGES IN CUPS V1.2rc2
-
-       - The scheduler was not always using the string pool,
-         causing random crashes.
-       - The lpmove and the web interface's Move Job button did
-         not work with stopped jobs (STR #1534)
-       - The PostScript filter did not handle the page-set
-         option properly with number-up printing (STR #1543)
-       - The scheduler now only warns about unsupported ACLs
-         once (STR #1532)
-       - The "fitplot" option did not work with output from
-         Mozilla (STR #1542)
-       - The imagetops filter did not work with Level 2 or 3
-         printers (STR #1533)
-       - The scheduler now recognizes PostScript files with PJL
-         commands that do not include an ENTER LANGUAGE command.
-       - Added --with-printcap configure option.
-       - 64-bit SSL fixes for MacOS X.
-       - The scheduler didn't send some printer state change
-         events.
-       - The scheduler didn't send jobs to busy remote printers.
-       - Fixed some problems with the launchd support.
-       - Added new USB printer backend for MacOS X.
-       - The PostScript filter now handles files that start with
-         an incomplete PJL header (PR #6076)
-       - The web interface language selection code did not try
-         the generic language localization (STR #1531)
-       - The language cache, string pool, and transcoding caches
-         are now process global instead of per-thread to avoid
-         problems with GNOME and to allow for data sharing
-         between threads (STR #1530)
-       - Fixed a CUPS 1.1.x compatibility bug (STR #1528)
-       - The web interface redirection after certain printer
-         administration tasks was broken (STR #1516)
-       - Web interface authorization could get stuck (STR #1512)
-       - Localization updates (STR #1513, STR #1518, STR #1520)
-       - The pstops filter didn't work with some files (STR
-         #1523)
-       - "./configure --enable-static" didn't work (STR #1522)
-       - The scheduler was not using the configured default
-         Group (STR #1521)
-       - The web interface still did not show the localized time
-         and date for some locales and systems (STR #1509)
-       - httpAddrGetList() would crash on systems without
-         getaddrinfo().
-       - Socket URIs without a trailing slash would cause the
-         port number to not be accepted (STR #1519)
-       - Local raw and System V printers were not advertised as
-         such for printer browsing (STR #1502)
-       - The RPM spec file incorrectly put duplicate copies of
-         the Japanese and Spanish web interface templates in the
-         main cups package (STR #1517)
-       - cupsSetDests() did not explicitly set the permissions
-         of the /etc/cups/lpoptions file (STR #1508)
-       - The lpq command crashed with the -h option (STR #1515)
-
-
-CHANGES IN CUPS V1.2rc1
-
-       - Documentation updates (STR #1497, STR #1498)
-       - The scheduler now redirects browsers to https: URLs
-         when encryption is required.
-       - The scheduler would crash when printing with a banner
-         (STR #1500)
-       - cups-driverd did not use the LanguageEncoding attribute
-         in PPD files to convert the NickName to UTF-8 (STR
-         #1503)
-       - The lpadmin command could not set the
-         printer-error-policy attribute (STR #1504)
-       - The web interface did not show the time and date in the
-         correct format for the locale (STR #1505)
-       - CUPS no longer accepts print jobs if a printer does not
-         support the file format (STR #1501)
-       - Cleaned up the PostScript filter (pstops) so that it
-         properly supports %%IncludeFeature and page scaling
-         (STR #1453)
-       - Fixed the cupsFileRewind() and cupsFileSeek() functions
-         to work properly with uncompressed files.
-       - Added cupsFileGetLine(), cupsFileStderr(),
-         cupsFileStdin(), and cupsFileStdout() functions to the
-         CUPS library.
-       - Added a new cupstestdsc program to test the DSC
-         conformance of PostScript files.
-       - Added KDE/GNOME icons and a Manage Printers menu item.
-       - Added --enable-image and --enable-pdftops configure
-         options to control whether the image and PDF filters
-         are built and installed (default = yes for all
-         platforms but MacOS X)
-       - Fixed a minor memory leak in the PPD API.
-       - Fixed transcoding issues (STR #1493)
-       - The scheduler now enforces a minimum job cost of 100
-         when doing FilterLimit checks.
-       - The scheduler would leak file descriptors when printing
-         to raw queues (STR #1491)
-       - The IPv6 support did not compile on Tru64 UNIX (STR
-         #1488)
-       - ppdOpen2() now converts the NickName and all UI text to
-         UTF-8 (STR #1475)
-       - The Set Allowed Users web page did not work (STR #1486)
-       - When the default policy was not set or set to a non-
-         existing policy, the scheduler did not set the default
-         policy name to "default" (STR #1484)
-       - The Zebra CPCL driver did not use the correct righthand
-         margin for the 4" wide label sizes.
-       - Fixed a problem with the parsing of fractional real
-         numbers in PPD files.
-       - Added Spanish localization files (STR #1480)
-       - Fixed localization of a few scheduler messages (STR
-         #1478)
-       - Fixed support for HEAD requests in the scheduler (STR
-         #1481)
-
-
-CHANGES IN CUPS V1.2b2
-
-       - Updated the CUPS design description.
-       - Added --enable-32bit and --enable-64bit configure
-         options to allow building of separate 32/64-bit
-         libraries on systems that support both environments
-         (STR #1472)
-       - Various compiler warning fixes.
-       - Fixes for Solaris 10 builds against old GNU TLS and
-         LDAP libraries.
-       - Added a cupsArrayUserData() function to retrieve the
-         user data pointer for an array (useful for typing
-         arrays)
-       - The ppdEmitString() function did not compute the
-         required buffer size properly, leading to dropped
-         characters on the end of the printer commands in pstops
-         and imagetops (STR #1470)
-
-
-CHANGES IN CUPS V1.2b1
-
-       - The serial backend now supports Equinox 8-port serial
-         hubs (STR #526)
-       - The IPP backend now supports a compression option to
-         compress print files as they are sent to the remote
-         server (STR #956)
-       - The CUPS browse protocol now supports passing of
-         default options and browse timeout values from the
-         server to the clients (STR #800)
-       - Implicit classes that timed out could cause the
-         scheduler to crash (STR #1439)
-       - Added DragonFly support in local device backends (STR
-         #1362)
-       - Added LDAP printer browsing support (STR #338)
-       - Added official support for printer maintenance commands
-         via the CUPS Command file format and hooks in the
-         printer-type and web interfaces (STR #932)
-       - The HP-GL/2 filter could get in an infinite loop trying
-         to convert HP-PCL files (STR #1415)
-       - CUPS now implements the HTTP/1.1 Expect header (STR
-         #1407)
-       - Options in PPD files are no longer automatically put in
-         an "Extra" group; rather, all options that are not
-         inside an Open/CloseGroup will be placed in the
-         "General" group (STR #1385)
-       - The scheduler now creates a job-uuid attribute that
-         uniquely identifies a job on a network (STR #1410)
-       - The init script now unsets the TMPDIR environment
-         variable to prevent user temporary directories from
-         being used by cupsd accidentally (STR #1424)
-       - Added support for launchd on MacOS X.
-       - Added support for notify_post on MacOS X.
-       - Added support for DBUS on Linux.
-       - All of the Berkeley (except for lpc) and System V
-         commands now support specification of user, host, and
-         port (STR #1028, STR #1029, STR #1087)
-       - The lpmove command now allows you to move all jobs for
-         a given queue (STR #56)
-       - The web interface now supports moving of a job or jobs
-         to another queue (STR #56)
-       - The web interface now provides searching, paging, and
-         changing of the sort/display order of classes, jobs,
-         and printers.
-       - cupsaddsmb now accepts a password on the command-line
-         and supports passwords with special characters (STR
-         #822, STR #1236)
-       - ppdLoad*() no longer tries to "fix" bad characters in
-         UI text (STR #1101)
-       - Printer names can now (reliably) contain Unicode
-         characters (STR #896)
-       - The lpstat command now shows the time and date of the
-         last printer state change instead of the hardcoded "Jan
-         01 00:00" (STR #659)
-       - The scheduler now adds a job-actual-printer-uri
-         attribute to job objects when printing to a class (STR
-         #116)
-       - The scheduler now logs log file open errors to the
-         system log (STR #1289)
-       - The scheduler now sets the job-originating-user-name to
-         the authenticated username, if available (STR #1318)
-       - The scheduler now only updates the permissions of SSL
-         keys and certificates when they are under the
-         ServerRoot directory (STR #1324)
-       - The rastertodymo driver has been renamed to
-         rastertolabel (a symlink is installed so that existing
-         queues continue to work) and now also supports Zebra's
-         CPCL language.
-       - The lpstat command could show the wrong active job for
-         a printer (STR #1301)
-       - Fixed a potential crash problem in the scheduler when
-         aborting a CGI program (STR #1290)
-       - Added a "cancel all jobs" button to the class and
-         printer web interfaces (STR #1140)
-       - The add-printer web page now shows the
-         set-printer-options page after the printer has been
-         added (STR #690)
-       - The classes web page now provides links to each of the
-         member printers (STR #307)
-       - CUPS now handles HTTP request/response lines up to 32k
-         in length; this is mainly for better cookie support
-         (STR #1274)
-       - Added support for the Apache PassEnv and SetEnv
-         directives to cupsd.conf (STR #853)
-       - Added large file (64-bit) support (STR #541)
-       - Fixed a performance issue with the ippReadIO()
-         implementation (STR #1284)
-       - Fixed a performance issue with the scheduler's implicit
-         class implementation (STR #1283)
-       - The pdftops filter now adds the Title and Creator
-         fields from the PDF file to the PostScript document
-         comments section (STR #539, STR #830)
-       - Added a new cups_array_t and cupsArray*() functions to
-         the CUPS API to support sorted lists of data.
-       - Made the CUPS API library thread-safe (STR #1276)
-       - Added "media" option support for EFI EFMediaType option
-         (STR #902)
-       - Added write buffering to the HTTP code to improve
-         performance (STR #547)
-       - The scheduler now uses the attributes-natural-language
-         attribute to localize banner pages (STR #386)
-       - The scheduler now returns the address that was used to
-         connect to it (STR #1076)
-       - Fixed a problem with N-up printing and OpenOffice (STR
-         #576)
-       - Added support for the GCC position independent
-         executable options (STR #1209)
-       - Added new BrowseLocalProtocols and
-         BrowseRemoteProtocols directives to cupsd.conf,
-         allowing for different browse protocols for local and
-         remote printers (STR #877)
-       - PPD files can now contain strings up to 256k in length
-         (STR #1215)
-       - The pstops filter now supports the IncludeFeature DSC
-         comment (STR #1212)
-       - The pstops filter now disables the setpagedevice
-         procedure when doing N-up printing (STR #1161)
-       - The serial backend now supports "stop=1", "stop=2",
-         "parity=space", and "parity=mark" options (STR #1155)
-       - "make install" no longer overwrites an existing PAM
-         configuration file (STR #1064)
-       - The scheduler now closes all files on startup when run
-         in daemon mode (STR #1009)
-       - Added a new RGBW colorspace to the CUPS raster format
-         (STR #1071)
-       - The pdftops filter now sets the page size based on the
-         media box when not scaling the output (STR #912)
-       - The pdftops filter now supports masked images (STR
-         #281)
-       - The pdftops filter produced large output when rendering
-         PDF files containing lot of repeated images (STR #327)
-       - The pdftops filter now minimizes print processing of
-         PDF files when using the page-ranges option (STR #273)
-       - Updated pdftops filter to Xpdf 3.01.
-       - Added new cupsBackchannelRead() and
-         cupsBackchannelWrite() functions, as well as
-         backchannel support to the parallel, serial, socket,
-         and USB backends (STR #1252)
-       - The parallel and USB backends now treat a "no space
-         available" error as an out-of-paper condition (STR
-         #1225)
-       - The "lpc" command now supports the "status all" command
-         (STR #1004)
-       - ippReadIO() did not read collections properly (STR
-         #1249)
-       - The "make test" script now creates the test files in
-         "/tmp/cups-$USER" instead of "/tmp/$USER" (STR #981)
-       - All backends now abort on error when printing a job to
-         a class - this allows the next printer in the class to
-         print the job (STR #1084)
-       - The scheduler now verifies that a printer supports
-         Letter or A4 media sizes before setting them as the
-         initial default (STR #1250)
-       - The cupstestppd program now flags bad Resolution
-         options (STR #1269)
-       - The USB backend now retries printing when the printer
-         is disconnected or turned off (STR #1267)
-       - Added new httpGetHostname() function to CUPS API, and
-         use it instead of gethostname() so that the web
-         interface will work correctly on systems whose hostname
-         is not the FQDN (STR #1266)
-       - The scheduler now stops printers if the backend for the
-         queue is missing on startup (STR #1265)
-       - The configure script now supports "--disable-library"
-         to disable particular image file format support
-         libraries, even if they are available on the build
-         system (STR #1248)
-       - The IPP backend did not always report on the total
-         number of pages that were printed (STR #1251)
-       - The lpstat program could display garbage date and time
-         values for locales whose date format exceeded 31
-         characters (STR #1263)
-       - The cupstestppd program would segfault when testing
-         certain broken PPD files (STR #1268)
-       - Dramatically reduced the overhead of implicit classes.
-       - Added new cupsDir*() functions to CUPS API.
-       - Printers can now be published individually for sharing.
-       - Fixed a bug in the scheduler's startup signalling code
-         which caused cupsd to send the SIGUSR1 signal to the
-         init process instead of the original parent process
-         (STR #1258)
-       - Added new on-line help CGI to web interface to provide
-         searchable help.
-       - Devices are now tracked dynamically, with each query
-         doing a new device scan.  This eliminates a previous
-         startup delay caused by slow backends and allows new
-         printers to be seen without restarting the server,
-         however it limits the amount of device URI checking
-         that can be done (basically now the scheduler only
-         requires a URI with a method that is a listed backend)
-       - Added new printer auto-detection, server configuration,
-         and log file viewing to the administration web page.
-       - Added new "set allowed users" web interface to set the
-         list of allowed users for a printer or class.
-       - The scheduler, command-line, and web interfaces now
-         limit the list of printers and classes to those
-         accessible by a user.
-       - cupsMarkOptions() now handles more non-standard
-         duplexing options and choices (STR #915)
-       - cups-lpd now honors remote banner requests with the
-         "standard" banner whenever a printer does not have one
-         defined (STR #1220)
-       - The scheduler's denial-of-service checks did not work
-         properly with IPv6 addresses (STR #1134)
-       - The lp and lpr commands did not error out properly when
-         they were unable to write to a temporary file (STR
-         #1129)
-       - The pstops filter did not handle Adobe-specific
-         comments in Windows NT driver output (STR #1085)
-       - "lpstat -l -p" incorrectly reported the printer
-         interface (STR #936)
-       - The web interface now operates exclusively with the
-         UTF-8 encoding, and sends the appropriate character set
-         and header information to the web browser (STR #919,
-         STR #1007)
-       - Added a "set allowed users" interface to the web
-         interface so that you can set the list of allowed or
-         denied users/groups for a printer or class.
-       - Disallow the "#" character in printer names, since it
-         has special meaning in the shell, config files, and in
-         URIs (STR #917, STR #1202)
-       - Added a new application/x-csource MIME type, and
-         support for it to the texttops filter so that you can
-         pretty print plain text files without the C/C++
-         keywords being highlighted.
-       - The pdftops filter did not compile with GCC 4.0 (STR
-         #1226)
-       - The texttops filter did not highlight preprocessor
-         directives followed by a tab properly.
-       - HP PJL output now uses both JOB DISPLAY and RDYMSG
-         commands to show the current job on the printer's
-         display (STR #1218)
-       - Local authentication certificates are now stored in
-         /var/run/cups/certs by default instead of
-         /etc/cups/certs (STR #1211)
-       - Backends now use "&" to separate options in device
-         URIs; "+" is still recognized but is deprecated (STR
-         #842)
-       - The USB backend no longer supports the usb:/dev/foo
-         format on systems that support device ID queries.
-       - Forced classification markings did not work when the
-         job-sheets parameters were "none,none".
-       - "lpstat -l -p" incorrectly showed all users as allowed,
-         even if the queue was restricted to certain users (STR
-         #801)
-       - The scheduler now automatically detects SSL/TLS clients
-         without using the SSLPort/SSLListen directives.
-       - The CUPS API and scheduler no longer support SSLv2-
-         encrypted connections.
-       - Updated the cupsaddsmb utility to correctly export the
-         CUPS driver for Windows.
-       - Fixed a signal-handling bug in httpRead() which
-         ultimately caused the server to print multiple copies
-         when it was busy (STR #1184)
-       - The cupsFile API now uses the O_APPEND option when
-         opening files in append mode (STR #990)
-       - The md5.h header and md5_* functions are now officially
-         private and have been renamed to avoid conflicts with
-         other implementations with the same name.
-       - The pdftops filter incorrectly embedded some Type1
-         fonts (STR #1093)
-       - The scheduler didn't detect a closed connection in the
-         middle of an IPP request (STR #1153)
-       - The scheduler could block trying to read the job status
-         if there was input pending and the job was cancelled in
-         the same input cycle (STR #1157)
-       - The scheduler could crash when deleting a class due to
-         infinite recursion.
-       - Updated the Zebra ZPL label printer driver to use the
-         run-length encoding and support more options.
-       - Updated serial backend to scan for /dev/ttyC* as well
-         as /dev/ttyc* for Cyclades serial ports (STR #1049)
-       - The scheduler could hang reading the job status under
-         certain circumstances (STR #1068)
-       - The USB backend termination signal code was inverted
-         (STR #1046)
-       - Moved enable and disable commands to sbindir to be
-         consistent.
-       - Added new cupsRasterInterpretPPD() function for RIP
-         filters to setup the raster page header from
-         PostScript commands in a PPD file.
-       - The CUPS browsing protocol now offers a "delete" bit
-         to remove printers as soon as they are deleted on the
-         server or as soon as the server shuts down gracefully
-         (STR #793)
-       - The CUPS_SERVER and ServerName directives (client.conf
-         and ~/.cupsrc) may now contain names of the form
-         "server:port" and "/path/to/domain/socket".
-       - The "cancel -u user" command now works for ordinary
-         users (STR #751)
-       - Added test run support to "make test" target (STR #64)
-       - Added domain socket support (STR #656)
-       - Added BrowseLocalOptions directive to allow the
-         administrator to add printer URI options to the browse
-         URI, e.g. "encryption=required" (STR #732)
-       - Added BrowseRemoteOptions directive to allow the
-         administrator to add standard URI options to the
-         remote printer URI, e.g. "encryption=required" (STR
-         #732)
-       - Now put "-I.." compiler option in front of all others
-         to ensure that local CUPS headers are used before
-         installed headers (STR #437)
-       - New cupsLangPrintf() and cupsLangPuts() for localized
-         interfaces.
-       - Now support custom attributes and extended options in
-         PPD files.
-       - Now provide functions to save PPD files.
-       - New policy mechanism allows per-operation and
-         per-printer control over what users and groups are
-         allowed to do various IPP operations.
-       - New error policy mechanism to control how aborted
-         backend errors are handled by the scheduler
-         (abort-job, retry-job, requeue-job, stop-printer)
-       - Updated the printer test page with a better color
-         wheel and a separate grayscale ramp.
-       - A single backend process is now run to send all print
-         data for a job.
-       - Backends and filters can now send and receive
-         backchannel data over file descriptor 3.
-       - Updated the raster stream format to support more
-         user-defined attributes and to do compression of the
-         page data.
+       - Moved the definition of the (private) _http_s structure
+         to http-private.h; code that directly accesses the
+         http_t members will no longer compile!
+       - Added support for setting the document-format-default
+         attribute on a per-printer basis.
+       - Added support for IntelliBar label printers.
index df6022b46d195ad7c83cf0c127c15bfa4ec08f16..329409b374ef25a32f1a1aa4ae22786d8dfbe7e7 100644 (file)
@@ -1,5 +1,5 @@
-INSTALL - CUPS v1.2.0 - 2006-05-08
-----------------------------------
+INSTALL - CUPS v1.2rc1 - 2006-03-24
+-----------------------------------
 
 This file describes how to compile and install CUPS from source
 code. For more information on CUPS see the file called
index e1bd9f3812590b73670caf82afb50616a2d7ab85..961a5e95783c98b19726ce0f39ffaeed7452c055 100644 (file)
@@ -78,6 +78,8 @@ CUPS_LOG_FILE_PERM = @CUPS_LOG_FILE_PERM@
 #
 
 LANGUAGES      =       @LANGUAGES@
+INSTALL_LANGUAGES =    @INSTALL_LANGUAGES@
+UNINSTALL_LANGUAGES =  @UNINSTALL_LANGUAGES@
 
 #
 # Libraries...
@@ -127,9 +129,9 @@ CXXFLAGS    =       -I.. $(SSLFLAGS) @CPPFLAGS@ @CXXFLAGS@ \
 CXXLIBS                =       @CXXLIBS@
 DSOFLAGS       =       @DSOFLAGS@
 DSOLIBS                =       @DSOLIBS@ $(COMMONLIBS)
-IMGLIBS                =       @IMGLIBS@ -lm
+IMGLIBS                =       @IMGLIBS@
 IMGFILTERS     =       @IMGFILTERS@
-LDFLAGS                =       -L../cups -L../filter $(RC_CFLAGS) $(ARCHFLAGS) \
+LDFLAGS                =       -L../cups -L../filter $(ARCHFLAGS) \
                        @LDFLAGS@ @PIEFLAGS@ $(OPTIM)
 LINKCUPS       =       @LINKCUPS@ $(SSLLIBS)
 LINKCUPSIMAGE  =       @LINKCUPSIMAGE@
index 4595be8c4ce528609aa45acf54072dbc43d5f408..fc0a146b4847dc1a8c4523c6caf87b423c30dcae 100644 (file)
@@ -1,5 +1,5 @@
-README - CUPS v1.2.0 - 2006-05-08
----------------------------------
+README - CUPS v1.2rc1 - 2006-03-24
+----------------------------------
 
 Looking for compile instructions?  Read the file "INSTALL.txt"
 instead...
index aed4364253e3f7deab91ace8a4b1d5a91469194b..0683438215fa3c6d726017c3911864132fce4f32 100644 (file)
@@ -9,26 +9,31 @@ lpd.o: ../cups/backend.h ../cups/http-private.h ../config.h ../cups/http.h
 lpd.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/cups.h
 lpd.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
 lpd.o: ../cups/string.h
-parallel.o: ../cups/backend.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
-parallel.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
-parallel.o: ../cups/language.h ../cups/string.h ../config.h ieee1284.c
-parallel.o: ../cups/debug.h
+pap.o: ../cups/http.h ../cups/md5.h
+parallel.o: backend-private.h ../cups/backend.h ../cups/cups.h ../cups/ipp.h
+parallel.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
+parallel.o: ../cups/file.h ../cups/language.h ../cups/debug.h
+parallel.o: ../cups/string.h ../config.h
 scsi.o: ../cups/backend.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
 scsi.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
 scsi.o: ../cups/language.h ../cups/string.h ../config.h
-serial.o: ../cups/backend.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
-serial.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
-serial.o: ../cups/language.h ../cups/string.h ../config.h
-snmp.o: ../cups/backend.h ../cups/http-private.h ../config.h ../cups/http.h
-snmp.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/cups.h
-snmp.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
-snmp.o: ../cups/string.h ../cups/array.h ../cups/file.h ieee1284.c
-snmp.o: ../cups/debug.h
-socket.o: ../cups/backend.h ../cups/http-private.h ../config.h ../cups/http.h
-socket.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/cups.h
-socket.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
-socket.o: ../cups/string.h
-test1284.o: ../cups/string.h ../config.h ieee1284.c ../cups/debug.h
+serial.o: backend-private.h ../cups/backend.h ../cups/cups.h ../cups/ipp.h
+serial.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
+serial.o: ../cups/file.h ../cups/language.h ../cups/debug.h ../cups/string.h
+serial.o: ../config.h
+snmp.o: ../cups/http-private.h ../config.h ../cups/http.h ../cups/md5.h
+snmp.o: ../cups/ipp-private.h ../cups/ipp.h backend-private.h
+snmp.o: ../cups/backend.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
+snmp.o: ../cups/file.h ../cups/language.h ../cups/debug.h ../cups/string.h
+snmp.o: ../cups/array.h ../cups/file.h
+socket.o: ../cups/http-private.h ../config.h ../cups/http.h ../cups/md5.h
+socket.o: ../cups/ipp-private.h ../cups/ipp.h backend-private.h
+socket.o: ../cups/backend.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
+socket.o: ../cups/file.h ../cups/language.h ../cups/debug.h ../cups/string.h
+test1284.o: ../cups/string.h ../config.h ieee1284.c backend-private.h
+test1284.o: ../cups/backend.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
+test1284.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
+test1284.o: ../cups/language.h ../cups/debug.h
 usb.o: ../cups/backend.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
 usb.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
 usb.o: ../cups/language.h ../cups/string.h ../config.h
index 62b44d37e3d0df2a07161e2c1cbcbd2e7558e1d9..e3ba7dc286b20600e7aea099144fe10cded4c6ac 100644 (file)
@@ -28,7 +28,8 @@ include ../Makedefs
 
 RBACKENDS =    ipp lpd
 UBACKENDS =    $(PAP) parallel scsi serial snmp socket usb
-TARGETS        =       betest test1284 $(RBACKENDS) $(UBACKENDS)
+TARGETS        =       betest test1284 libbackend.a $(RBACKENDS) $(UBACKENDS)
+LIBOBJS        =       ieee1284.o runloop.o
 OBJS   =       betest.o ipp.o lpd.o pap.o parallel.o scsi.o \
                serial.o snmp.o socket.o test1284.o usb.o
 
@@ -104,6 +105,17 @@ test1284:  test1284.o ../cups/libcups.a
                $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
 
 
+#
+# libbackend.a
+#
+
+libbackend.a:  $(LIBOBJS)
+       echo Archiving $@...
+       $(RM) $@
+       $(AR) $(ARFLAGS) $@ $(LIBOBJS)
+       $(RANLIB) $@
+
+
 #
 # ieee1394
 #
@@ -149,9 +161,9 @@ pap:        pap.o ../cups/$(LIBCUPS)
 # parallel
 #
 
-parallel:      parallel.o ../cups/$(LIBCUPS)
+parallel:      parallel.o ../cups/$(LIBCUPS) libbackend.a
        echo Linking $@...
-       $(CC) $(LDFLAGS) -o parallel parallel.o $(LIBS)
+       $(CC) $(LDFLAGS) -o parallel parallel.o libbackend.a $(LIBS)
 
 
 #
@@ -169,37 +181,37 @@ scsi.o:   scsi.c scsi-irix.c scsi-linux.c
 # serial
 #
 
-serial:        serial.o ../cups/$(LIBCUPS)
+serial:        serial.o ../cups/$(LIBCUPS) libbackend.a
        echo Linking $@...
-       $(CC) $(LDFLAGS) -o serial serial.o $(BACKLIBS) $(LIBS)
+       $(CC) $(LDFLAGS) -o serial serial.o libbackend.a $(BACKLIBS) $(LIBS)
 
 
 #
 # snmp
 #
 
-snmp:  snmp.o ../cups/$(LIBCUPS)
+snmp:  snmp.o ../cups/$(LIBCUPS) libbackend.a
        echo Linking $@...
-       $(CC) $(LDFLAGS) -o snmp snmp.o $(LIBS)
+       $(CC) $(LDFLAGS) -o snmp snmp.o libbackend.a $(LIBS)
 
 
 #
 # socket
 #
 
-socket:        socket.o ../cups/$(LIBCUPS)
+socket:        socket.o ../cups/$(LIBCUPS) libbackend.a
        echo Linking $@...
-       $(CC) $(LDFLAGS) -o socket socket.o $(LIBS)
+       $(CC) $(LDFLAGS) -o socket socket.o libbackend.a $(LIBS)
 
 
 #
 # usb
 #
 
-usb:   usb.o ../cups/$(LIBCUPS)
+usb:   usb.o ../cups/$(LIBCUPS) libbackend.a
        echo Linking $@...
-       $(CC) $(LDFLAGS) -o usb usb.o $(BACKLIBS) $(LIBS)
-usb.o: usb.c usb-darwin.c usb-unix.c ieee1284.c
+       $(CC) $(LDFLAGS) -o usb usb.o libbackend.a $(BACKLIBS) $(LIBS)
+usb.o: usb.c usb-darwin.c usb-unix.c
 
 
 #
diff --git a/backend/backend-private.h b/backend/backend-private.h
new file mode 100644 (file)
index 0000000..bdbe427
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * "$Id: backend-private.h 5590 2006-05-26 19:48:26Z mike $"
+ *
+ *   Backend support definitions for the Common UNIX Printing System (CUPS).
+ *
+ *   Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ *
+ *   These coded instructions, statements, and computer programs are the
+ *   property of Easy Software Products and are protected by Federal
+ *   copyright law.  Distribution and use rights are outlined in the file
+ *   "LICENSE" which should have been included with this file.  If this
+ *   file is missing or damaged please contact Easy Software Products
+ *   at:
+ *
+ *       Attn: CUPS Licensing Information
+ *       Easy Software Products
+ *       44141 Airport View Drive, Suite 204
+ *       Hollywood, Maryland 20636 USA
+ *
+ *       Voice: (301) 373-9600
+ *       EMail: cups-info@cups.org
+ *         WWW: http://www.cups.org
+ *
+ *   This file is subject to the Apple OS-Developed Software exception.
+ */
+
+#ifndef _CUPS_BACKEND_PRIVATE_H_
+#  define _CUPS_BACKEND_PRIVATE_H_
+
+
+/*
+ * Include necessary headers.
+ */
+
+#  include <cups/backend.h>
+#  include <cups/cups.h>
+#  include <cups/debug.h>
+#  include <stdlib.h>
+#  include <errno.h>
+#  include <cups/string.h>
+#  include <signal.h>
+
+
+/*
+ * C++ magic...
+ */
+
+#  ifdef _cplusplus
+extern "C" {
+#  endif /* _cplusplus */
+
+
+/*
+ * Prototypes...
+ */
+
+extern int     backendGetDeviceID(int fd, char *device_id, int device_id_size,
+                                  char *make_model, int make_model_size,
+                                  const char *scheme, char *uri, int uri_size);
+extern int     backendGetMakeModel(const char *device_id, char *make_model,
+                                   int make_model_size);
+extern ssize_t backendRunLoop(int print_fd, int device_fd, int use_bc);
+
+
+#  ifdef _cplusplus
+}
+#  endif /* _cplusplus */
+#endif /* !_CUPS_BACKEND_PRIVATE_H_ */
+
+
+/*
+ * End of "$Id: backend-private.h 5590 2006-05-26 19:48:26Z mike $".
+ */
index 03720bf7225d14338d6801c335299b67df8030ce..d623b293df3b0f4362bf0781344fd8577651d3e1 100644 (file)
  *
  * Contents:
  *
- *   get_device_id()  - Get the IEEE-1284 device ID string and corresponding
- *                      URI.
- *   get_make_model() - Get the make and model string from the device ID.
+ *   backendGetDeviceID()  - Get the IEEE-1284 device ID string and
+ *                           corresponding URI.
+ *   backendGetMakeModel() - Get the make and model string from the device ID.
  */
 
 /*
  * Include necessary headers.
  */
 
-#include <cups/debug.h>
+#include "backend-private.h"
 
+#ifdef __linux
+#  include <sys/ioctl.h>
+#  include <linux/lp.h>
+#  define IOCNR_GET_DEVICE_ID          1
+#  define LPIOC_GET_DEVICE_ID(len)     _IOC(_IOC_READ, 'P', IOCNR_GET_DEVICE_ID, len)
+#endif /* __linux */
 
-/*
- * Prototypes...
- */
-
-static int     get_make_model(const char *device_id, char *make_model,
-                              int make_model_size);
+#ifdef __sun
+#  ifdef __sparc
+#    include <sys/ecppio.h>
+#  else
+#    include <sys/ioccom.h>
+#    include <sys/ecppsys.h>
+#  endif /* __sparc */
+#endif /* __sun */
 
 
 /*
- * 'get_device_id()' - Get the IEEE-1284 device ID string and
- *                     corresponding URI.
+ * 'backendGetDeviceID()' - Get the IEEE-1284 device ID string and
+ *                          corresponding URI.
  */
 
-#ifndef SNMP_BACKEND
-#  ifdef __linux
-#    include <sys/ioctl.h>
-#    include <linux/lp.h>
-#    define IOCNR_GET_DEVICE_ID                1
-#    define LPIOC_GET_DEVICE_ID(len)   _IOC(_IOC_READ, 'P', IOCNR_GET_DEVICE_ID, len)
-#  endif /* __linux */
-
-#  ifdef __sun
-#    ifdef __sparc
-#      include <sys/ecppio.h>
-#    else
-#      include <sys/ioccom.h>
-#      include <sys/ecppsys.h>
-#    endif /* __sparc */
-#  endif /* __sun */
-
-
 int                                    /* O - 0 on success, -1 on failure */
-get_device_id(
+backendGetDeviceID(
     int        fd,                     /* I - File descriptor */
     char       *device_id,             /* O - 1284 device ID */
     int        device_id_size,         /* I - Size of buffer */
@@ -93,7 +83,7 @@ get_device_id(
 #endif /* __sun && ECPPIOC_GETDEVID */
 
 
-  DEBUG_printf(("get_device_id(fd=%d, device_id=%p, device_id_size=%d, "
+  DEBUG_printf(("backendGetDeviceID(fd=%d, device_id=%p, device_id_size=%d, "
                 "make_model=%p, make_model_size=%d, scheme=\"%s\", "
                "uri=%p, uri_size=%d)\n", fd, device_id, device_id_size,
                make_model, make_model_size, scheme ? scheme : "(null)",
@@ -107,7 +97,7 @@ get_device_id(
       !device_id || device_id_size < 32 ||
       !make_model || make_model_size < 32)
   {
-    DEBUG_puts("get_device_id: Bad args!");
+    DEBUG_puts("backendGetDeviceID: Bad args!");
     return (-1);
   }
 
@@ -155,7 +145,7 @@ get_device_id(
   }
 #  ifdef DEBUG
   else
-    printf("get_device_id: ioctl failed - %s\n", strerror(errno));
+    printf("backendGetDeviceID: ioctl failed - %s\n", strerror(errno));
 #  endif /* DEBUG */
 #endif /* __linux */
 
@@ -178,11 +168,11 @@ get_device_id(
   }
 #  ifdef DEBUG
   else
-    printf("get_device_id: ioctl failed - %s\n", strerror(errno));
+    printf("backendGetDeviceID: ioctl failed - %s\n", strerror(errno));
 #  endif /* DEBUG */
 #endif /* __sun && ECPPIOC_GETDEVID */
 
-  DEBUG_printf(("get_device_id: device_id=\"%s\"\n", device_id));
+  DEBUG_printf(("backendGetDeviceID: device_id=\"%s\"\n", device_id));
 
   if (!*device_id)
     return (-1);
@@ -191,7 +181,7 @@ get_device_id(
   * Get the make and model...
   */
 
-  get_make_model(device_id, make_model, make_model_size);
+  backendGetMakeModel(device_id, make_model, make_model_size);
 
  /*
   * Then generate a device URI...
@@ -303,15 +293,14 @@ get_device_id(
 
   return (0);
 }
-#endif /* !SNMP_BACKEND */
 
 
 /*
- * 'get_make_model()' - Get the make and model string from the device ID.
+ * 'backendGetMakeModel()' - Get the make and model string from the device ID.
  */
 
 int                                    /* O - 0 on success, -1 on failure */
-get_make_model(
+backendGetMakeModel(
     const char *device_id,             /* O - 1284 device ID */
     char       *make_model,            /* O - Make/model */
     int        make_model_size)                /* I - Size of buffer */
@@ -322,7 +311,7 @@ get_make_model(
        *mdl;                           /* Model string */
 
 
-  DEBUG_printf(("get_make_model(device_id=\"%s\", "
+  DEBUG_printf(("backendGetMakeModel(device_id=\"%s\", "
                 "make_model=%p, make_model_size=%d)\n", device_id,
                make_model, make_model_size));
 
@@ -332,7 +321,7 @@ get_make_model(
 
   if (!device_id || !*device_id || !make_model || make_model_size < 32)
   {
-    DEBUG_puts("get_make_model: Bad args!");
+    DEBUG_puts("backendGetMakeModel: Bad args!");
     return (-1);
   }
 
index f1b22cdf89f489f6a6b9e6817ccf4054689e14e7..4943dbbdb116328fe04b1e7bc69b72010cd93321 100644 (file)
@@ -211,7 +211,8 @@ main(int  argc,                             /* I - Number of command-line args */
   */
 
   if ((content_type = getenv("FINAL_CONTENT_TYPE")) == NULL)
-    content_type = "application/octet-stream";
+    if ((content_type = getenv("CONTENT_TYPE")) == NULL)
+      content_type = "application/octet-stream";
 
  /*
   * Extract the hostname and printer name from the URI...
index 539fec755d83078f4aa138977713a67ef5d529af..e5c92ef4dc0fb16f4ee1551969415139f989c08f 100644 (file)
  * Include necessary headers.
  */
 
-#include <cups/backend.h>
-#include <cups/cups.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <cups/string.h>
-#include <signal.h>
-#include "ieee1284.c"
+#include "backend-private.h"
 
 #ifdef __hpux
 #  include <sys/time.h>
@@ -94,25 +87,18 @@ main(int  argc,                             /* I - Number of command-line arguments (6 or 7) */
                resource[1024],         /* Resource info (device and options) */
                *options;               /* Pointer to options */
   int          port;                   /* Port number (not used) */
-  int          fp;                     /* Print file */
+  int          print_fd,               /* Print file */
+               device_fd;              /* Parallel device */
   int          copies;                 /* Number of copies to print */
-  int          fd;                     /* Parallel device */
-  int          rbytes;                 /* Number of bytes read */
-  int          wbytes;                 /* Number of bytes written */
-  size_t       nbytes,                 /* Number of bytes read */
-               tbytes;                 /* Total number of bytes written */
-  char         buffer[8192],           /* Output buffer */
-               *bufptr;                /* Pointer into buffer */
+  size_t       tbytes;                 /* Total number of bytes written */
   struct termios opts;                 /* Parallel port options */
-  fd_set       input,                  /* Input set for select() */
-               output;                 /* Output set for select() */
+#if defined(__linux) && defined(LP_POUTPA)
+  unsigned int status;                 /* Port status (off-line, out-of-paper, etc.) */
   int          paperout;               /* Paper out? */
+#endif /* __linux && LP_POUTPA */
 #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
   struct sigaction action;             /* Actions for POSIX signals */
 #endif /* HAVE_SIGACTION && !HAVE_SIGSET */
-#ifdef __linux
-  unsigned int status;                 /* Port status (off-line, out-of-paper, etc.) */
-#endif /* __linux */
 
 
  /*
@@ -157,8 +143,8 @@ main(int  argc,                             /* I - Number of command-line arguments (6 or 7) */
 
   if (argc == 6)
   {
-    fp     = 0;
-    copies = 1;
+    print_fd = 0;
+    copies   = 1;
   }
   else
   {
@@ -166,7 +152,7 @@ main(int  argc,                             /* I - Number of command-line arguments (6 or 7) */
     * Try to open the print file...
     */
 
-    if ((fp = open(argv[6], O_RDONLY)) < 0)
+    if ((print_fd = open(argv[6], O_RDONLY)) < 0)
     {
       perror("ERROR: unable to open print file");
       return (CUPS_BACKEND_FAILED);
@@ -206,7 +192,7 @@ main(int  argc,                             /* I - Number of command-line arguments (6 or 7) */
 
   do
   {
-    if ((fd = open(resource, O_WRONLY | O_EXCL)) == -1)
+    if ((device_fd = open(resource, O_WRONLY | O_EXCL)) == -1)
     {
       if (getenv("CLASS") != NULL)
       {
@@ -217,8 +203,8 @@ main(int  argc,                             /* I - Number of command-line arguments (6 or 7) */
        * available printer in the class.
        */
 
-        fputs("INFO: Unable to open parallel port, queuing on next printer in class...\n",
-             stderr);
+        fputs("INFO: Unable to open parallel port, queuing on next printer "
+             "in class...\n", stderr);
 
        /*
         * Sleep 5 seconds to keep the job from requeuing too rapidly...
@@ -231,23 +217,26 @@ main(int  argc,                           /* I - Number of command-line arguments (6 or 7) */
 
       if (errno == EBUSY)
       {
-        fputs("INFO: Parallel port busy; will retry in 30 seconds...\n", stderr);
+        fputs("INFO: Parallel port busy; will retry in 30 seconds...\n",
+             stderr);
        sleep(30);
       }
       else if (errno == ENXIO || errno == EIO || errno == ENOENT)
       {
-        fputs("INFO: Printer not connected; will retry in 30 seconds...\n", stderr);
+        fputs("INFO: Printer not connected; will retry in 30 seconds...\n",
+             stderr);
        sleep(30);
       }
       else
       {
-       fprintf(stderr, "ERROR: Unable to open parallel port device file \"%s\": %s\n",
+       fprintf(stderr,
+               "ERROR: Unable to open parallel port device file \"%s\": %s\n",
                resource, strerror(errno));
        return (CUPS_BACKEND_FAILED);
       }
     }
   }
-  while (fd < 0);
+  while (device_fd < 0);
 
   fputs("STATE: -connecting-to-device\n", stderr);
 
@@ -255,25 +244,21 @@ main(int  argc,                           /* I - Number of command-line arguments (6 or 7) */
   * Set any options provided...
   */
 
-  tcgetattr(fd, &opts);
+  tcgetattr(device_fd, &opts);
 
   opts.c_lflag &= ~(ICANON | ECHO | ISIG);     /* Raw mode */
 
   /**** No options supported yet ****/
 
-  tcsetattr(fd, TCSANOW, &opts);
-
- /*
-  * Check printer status...
-  */
-
-  paperout = 0;
+  tcsetattr(device_fd, TCSANOW, &opts);
 
 #if defined(__linux) && defined(LP_POUTPA)
  /*
   * Show the printer status before we send the file...
   */
 
+  paperout = 0;
+
   while (!ioctl(fd, LPGETSTATUS, &status))
   {
     fprintf(stderr, "DEBUG: LPGETSTATUS returned a port status of %02X...\n", status);
@@ -297,147 +282,39 @@ main(int  argc,                          /* I - Number of command-line arguments (6 or 7) */
   }
 #endif /* __linux && LP_POUTPA */
 
- /*
-  * Now that we are "connected" to the port, ignore SIGTERM so that we
-  * can finish out any page data the driver sends (e.g. to eject the
-  * current page...  Only ignore SIGTERM if we are printing data from
-  * stdin (otherwise you can't cancel raw jobs...)
-  */
-
-  if (argc < 7)
-  {
-#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
-    sigset(SIGTERM, SIG_IGN);
-#elif defined(HAVE_SIGACTION)
-    memset(&action, 0, sizeof(action));
-
-    sigemptyset(&action.sa_mask);
-    action.sa_handler = SIG_IGN;
-    sigaction(SIGTERM, &action, NULL);
-#else
-    signal(SIGTERM, SIG_IGN);
-#endif /* HAVE_SIGSET */
-  }
-
  /*
   * Finally, send the print file...
   */
 
-  wbytes = 0;
+  tbytes = 0;
 
-  while (copies > 0)
+  while (copies > 0 && tbytes >= 0)
   {
     copies --;
 
-    if (fp != 0)
+    if (print_fd != 0)
     {
       fputs("PAGE: 1 1\n", stderr);
-      lseek(fp, 0, SEEK_SET);
+      lseek(print_fd, 0, SEEK_SET);
     }
 
-    tbytes = 0;
-    while ((nbytes = read(fp, buffer, sizeof(buffer))) > 0)
-    {
-     /*
-      * Write the print data to the printer...
-      */
-
-      tbytes += nbytes;
-      bufptr = buffer;
-
-      while (nbytes > 0)
-      {
-       /*
-        * See if we are ready to read or write...
-       */
-
-        do
-       {
-          FD_ZERO(&input);
-         FD_SET(fd, &input);
-         FD_ZERO(&output);
-         FD_SET(fd, &output);
-        }
-       while (select(fd + 1, &input, &output, NULL, NULL) < 0);
-
-        if (FD_ISSET(fd, &input))
-       {
-        /*
-         * Read backchannel data...
-         */
-
-         if ((rbytes = read(fd, resource, sizeof(resource))) > 0)
-         {
-           fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
-                   rbytes);
-            cupsBackChannelWrite(resource, rbytes, 1.0);
-          }
-       }
+    tbytes = backendRunLoop(print_fd, device_fd, 1);
 
-        if (FD_ISSET(fd, &output))
-       {
-        /*
-         * Write print data...
-         */
-
-         if ((wbytes = write(fd, bufptr, nbytes)) < 0)
-           if (errno == ENOTTY)
-             wbytes = write(fd, bufptr, nbytes);
-
-         if (wbytes < 0)
-         {
-          /*
-           * Check for retryable errors...
-           */
-
-            if (errno == ENOSPC)
-           {
-             paperout = 1;
-             fputs("ERROR: Out of paper!\n", stderr);
-             fputs("STATUS: +media-tray-empty-error\n", stderr);
-           }
-           else if (errno != EAGAIN && errno != EINTR)
-           {
-             perror("ERROR: Unable to send print file to printer");
-             break;
-           }
-         }
-         else
-         {
-          /*
-           * Update count and pointer...
-           */
-
-            if (paperout)
-           {
-             fputs("STATUS: -media-tray-empty-error\n", stderr);
-             paperout = 0;
-           }
-
-           nbytes -= wbytes;
-           bufptr += wbytes;
-         }
-       }
-      }
-
-      if (wbytes < 0)
-        break;
-
-      if (argc > 6)
-       fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
-               (unsigned long)tbytes);
-    }
+    if (print_fd != 0 && tbytes >= 0)
+      fprintf(stderr, "INFO: Sent print file, " CUPS_LLFMT " bytes...\n",
+             CUPS_LLCAST tbytes);
   }
 
  /*
   * Close the socket connection and input file and return...
   */
 
-  close(fd);
-  if (fp != 0)
-    close(fp);
+  close(device_fd);
+
+  if (print_fd != 0)
+    close(print_fd);
 
-  return (wbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
+  return (tbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
 }
 
 
@@ -485,9 +362,9 @@ list_devices(void)
       * Now grab the IEEE 1284 device ID string...
       */
 
-      if (!get_device_id(fd, device_id, sizeof(device_id),
-                         make_model, sizeof(make_model),
-                        NULL, NULL, 0))
+      if (!backendGetDeviceID(fd, device_id, sizeof(device_id),
+                              make_model, sizeof(make_model),
+                             NULL, NULL, 0))
        printf("direct parallel:%s \"%s\" \"%s LPT #%d\" \"%s\"\n", device,
               make_model, make_model, i + 1, device_id);
       else
diff --git a/backend/runloop.c b/backend/runloop.c
new file mode 100644 (file)
index 0000000..4d247f1
--- /dev/null
@@ -0,0 +1,218 @@
+/*
+ * "$Id: runloop.c 5593 2006-05-27 03:13:38Z mike $"
+ *
+ *   Common run loop API for the Common UNIX Printing System (CUPS).
+ *
+ *   Copyright 2006 by Easy Software Products, all rights reserved.
+ *
+ *   These coded instructions, statements, and computer programs are the
+ *   property of Easy Software Products and are protected by Federal
+ *   copyright law.  Distribution and use rights are outlined in the file
+ *   "LICENSE" which should have been included with this file.  If this
+ *   file is missing or damaged please contact Easy Software Products
+ *   at:
+ *
+ *       Attn: CUPS Licensing Information
+ *       Easy Software Products
+ *       44141 Airport View Drive, Suite 204
+ *       Hollywood, Maryland 20636 USA
+ *
+ *       Voice: (301) 373-9600
+ *       EMail: cups-info@cups.org
+ *         WWW: http://www.cups.org
+ *
+ *   This file is subject to the Apple OS-Developed Software exception.
+ *
+ * Contents:
+ *
+ *   backendRunLoop() - Read and write print and back-channel data.
+ */
+
+/*
+ * Include necessary headers.
+ */
+
+#include "backend-private.h"
+#include <sys/select.h>
+
+
+/*
+ * 'backendRunLoop()' - Read and write print and back-channel data.
+ */
+
+ssize_t                                        /* O - Total bytes on success, -1 on error */
+backendRunLoop(int print_fd,           /* I - Print file descriptor */
+               int device_fd,          /* I - Device file descriptor */
+              int use_bc)              /* I - Use back-channel? */
+{
+  int          nfds;                   /* Maximum file descriptor value + 1 */
+  fd_set       input,                  /* Input set for reading */
+               output;                 /* Output set for writing */
+  ssize_t      print_bytes,            /* Print bytes read */
+               bc_bytes,               /* Backchannel bytes read */
+               total_bytes,            /* Total bytes written */
+               bytes;                  /* Bytes written */
+  int          paperout;               /* "Paper out" status */
+  char         print_buffer[8192],     /* Print data buffer */
+               *print_ptr,             /* Pointer into print data buffer */
+               bc_buffer[1024];        /* Back-channel data buffer */
+#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
+  struct sigaction action;             /* Actions for POSIX signals */
+#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
+
+
+ /*
+  * If we are printing data from a print driver on stdin, ignore SIGTERM
+  * so that the driver can finish out any page data, e.g. to eject the
+  * current page.  We only do this for stdin printing as otherwise there
+  * is no way to cancel a raw print job...
+  */
+
+  if (!print_fd)
+  {
+#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
+    sigset(SIGTERM, SIG_IGN);
+#elif defined(HAVE_SIGACTION)
+    memset(&action, 0, sizeof(action));
+
+    sigemptyset(&action.sa_mask);
+    action.sa_handler = SIG_IGN;
+    sigaction(SIGTERM, &action, NULL);
+#else
+    signal(SIGTERM, SIG_IGN);
+#endif /* HAVE_SIGSET */
+  }
+
+ /*
+  * Figure out the maximum file descriptor value to use with select()...
+  */
+
+  nfds = (print_fd > device_fd ? print_fd : device_fd) + 1;
+
+ /*
+  * Now loop until we are out of data from print_fd...
+  */
+
+  for (print_bytes = 0, print_ptr = print_buffer, paperout = 0, total_bytes = 0;;)
+  {
+   /*
+    * Use select() to determine whether we have data to copy around...
+    */
+
+    FD_ZERO(&input);
+    if (!print_bytes)
+      FD_SET(print_fd, &input);
+    if (use_bc)
+      FD_SET(device_fd, &input);
+
+    FD_ZERO(&output);
+    if (print_bytes)
+      FD_SET(device_fd, &output);
+
+    if (select(nfds, &input, &output, NULL, NULL) < 0)
+      continue;                                /* Ignore errors here */
+
+   /*
+    * Check if we have back-channel data ready...
+    */
+
+    if (FD_ISSET(device_fd, &input))
+    {
+      if ((bc_bytes = read(device_fd, bc_buffer, sizeof(bc_buffer))) > 0)
+      {
+       fprintf(stderr,
+               "DEBUG: Received " CUPS_LLFMT " bytes of back-channel data!\n",
+               CUPS_LLCAST bc_bytes);
+        cupsBackChannelWrite(bc_buffer, bc_bytes, 1.0);
+      }
+    }
+
+   /*
+    * Check if we have print data ready...
+    */
+
+    if (FD_ISSET(print_fd, &input))
+    {
+      if ((print_bytes = read(print_fd, print_buffer,
+                              sizeof(print_buffer))) < 0)
+      {
+       /*
+        * Read error - bail if we don't see EAGAIN or EINTR...
+       */
+
+       if (errno != EAGAIN || errno != EINTR)
+       {
+         perror("ERROR: Unable to read print data");
+         return (-1);
+       }
+
+        print_bytes = 0;
+      }
+      else if (print_bytes == 0)
+      {
+       /*
+        * End of file, break out of the loop...
+       */
+
+        break;
+      }
+
+      print_ptr = print_buffer;
+    }
+
+   /*
+    * Check if the device is ready to receive data and we have data to
+    * send...
+    */
+
+    if (print_bytes && FD_ISSET(device_fd, &output))
+    {
+      if ((bytes = write(device_fd, print_ptr, print_bytes)) < 0)
+      {
+       /*
+        * Write error - bail if we don't see an error we can retry...
+       */
+
+        if (errno == ENOSPC)
+       {
+         if (!paperout)
+         {
+           fputs("ERROR: Out of paper!\n", stderr);
+           fputs("STATUS: +media-tray-empty-error\n", stderr);
+           paperout = 1;
+         }
+        }
+       else if (errno != EAGAIN && errno != EINTR && errno != ENOTTY)
+       {
+         perror("ERROR: Unable to write print data");
+         return (-1);
+       }
+      }
+      else
+      {
+        if (paperout)
+       {
+         fputs("STATUS: -media-tray-empty-error\n", stderr);
+         paperout = 0;
+       }
+
+        fprintf(stderr, "DEBUG: Wrote %d bytes...\n", (int)bytes);
+
+        print_bytes -= bytes;
+       print_ptr   += bytes;
+       total_bytes += bytes;
+      }
+    }
+  }
+
+ /*
+  * Return with success...
+  */
+
+  return (total_bytes);
+}
+
+
+/*
+ * End of "$Id: runloop.c 5593 2006-05-27 03:13:38Z mike $".
+ */
index 24533d5e1a50a0f2d68b1a5d0b51ed7232d90c1c..0e613b49057fb652e5474077bbf7001ccb3b11db 100644 (file)
  * Include necessary headers.
  */
 
-#include <cups/backend.h>
-#include <cups/cups.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <cups/string.h>
-#include <signal.h>
+#include "backend-private.h"
 
 #ifdef __hpux
 #  include <sys/modem.h>
@@ -121,21 +115,23 @@ main(int  argc,                           /* I - Number of command-line arguments (6 or 7) */
                value[255],             /* Value of option */
                *ptr;                   /* Pointer into name or value */
   int          port;                   /* Port number (not used) */
-  int          fp;                     /* Print file */
   int          copies;                 /* Number of copies to print */
-  int          fd;                     /* Parallel device */
-  int          rbytes;                 /* Number of bytes read */
-  int          wbytes;                 /* Number of bytes written */
-  size_t       nbytes,                 /* Number of bytes read */
-               tbytes;                 /* Total number of bytes written */
+  int          print_fd,               /* Print file */
+               device_fd;              /* Serial device */
+  int          nfds;                   /* Maximum file descriptor value + 1 */
+  fd_set       input,                  /* Input set for reading */
+               output;                 /* Output set for writing */
+  ssize_t      print_bytes,            /* Print bytes read */
+               bc_bytes,               /* Backchannel bytes read */
+               total_bytes,            /* Total bytes written */
+               bytes;                  /* Bytes written */
   int          dtrdsr;                 /* Do dtr/dsr flow control? */
-  int          bufsize;                /* Size of output buffer for writes */
-  char         buffer[8192],           /* Output buffer */
-               *bufptr;                /* Pointer into buffer */
+  int          print_size;             /* Size of output buffer for writes */
+  char         print_buffer[8192],     /* Print data buffer */
+               *print_ptr,             /* Pointer into print data buffer */
+               bc_buffer[1024];        /* Back-channel data buffer */
   struct termios opts;                 /* Serial port options */
   struct termios origopts;             /* Original port options */
-  fd_set       input,                  /* Input set for select() */
-               output;                 /* Output set for select() */
 #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
   struct sigaction action;             /* Actions for POSIX signals */
 #endif /* HAVE_SIGACTION && !HAVE_SIGSET */
@@ -183,8 +179,8 @@ main(int  argc,                             /* I - Number of command-line arguments (6 or 7) */
 
   if (argc == 6)
   {
-    fp     = 0;
-    copies = 1;
+    print_fd = 0;
+    copies   = 1;
   }
   else
   {
@@ -192,7 +188,7 @@ main(int  argc,                             /* I - Number of command-line arguments (6 or 7) */
     * Try to open the print file...
     */
 
-    if ((fp = open(argv[6], O_RDONLY)) < 0)
+    if ((print_fd = open(argv[6], O_RDONLY)) < 0)
     {
       perror("ERROR: unable to open print file");
       return (CUPS_BACKEND_FAILED);
@@ -232,7 +228,8 @@ main(int  argc,                             /* I - Number of command-line arguments (6 or 7) */
 
   do
   {
-    if ((fd = open(resource, O_WRONLY | O_NOCTTY | O_EXCL | O_NDELAY)) == -1)
+    if ((device_fd = open(resource, O_RDWR | O_NOCTTY | O_EXCL |
+                                    O_NDELAY)) == -1)
     {
       if (getenv("CLASS") != NULL)
       {
@@ -268,7 +265,7 @@ main(int  argc,                             /* I - Number of command-line arguments (6 or 7) */
       }
     }
   }
-  while (fd < 0);
+  while (device_fd < 0);
 
   fputs("STATE: -connecting-to-device\n", stderr);
 
@@ -276,16 +273,18 @@ main(int  argc,                           /* I - Number of command-line arguments (6 or 7) */
   * Set any options provided...
   */
 
-  tcgetattr(fd, &origopts);
-  tcgetattr(fd, &opts);
+  tcgetattr(device_fd, &origopts);
+  tcgetattr(device_fd, &opts);
 
-  opts.c_lflag &= ~(ICANON | ECHO | ISIG);     /* Raw mode */
-  opts.c_oflag &= ~OPOST;                      /* Don't post-process */
+  opts.c_lflag &= ~(ICANON | ECHO | ISIG);
+                                       /* Raw mode */
+  opts.c_oflag &= ~OPOST;              /* Don't post-process */
 
-  bufsize = 96;                /* 9600 baud / 10 bits/char / 10Hz */
-  dtrdsr  = 0;         /* No dtr/dsr flow control */
+  print_size = 96;                     /* 9600 baud / 10 bits/char / 10Hz */
+  dtrdsr     = 0;                      /* No dtr/dsr flow control */
 
-  if (options != NULL)
+  if (options)
+  {
     while (*options)
     {
      /*
@@ -326,7 +325,7 @@ main(int  argc,                             /* I - Number of command-line arguments (6 or 7) */
         * Set the baud rate...
        */
 
-        bufsize = atoi(value) / 100;
+        print_size = atoi(value) / 100;
 
 #if B19200 == 19200
         cfsetispeed(&opts, atoi(value));
@@ -488,9 +487,10 @@ main(int  argc,                            /* I - Number of command-line arguments (6 or 7) */
        }
       }
     }
+  }
 
-  tcsetattr(fd, TCSANOW, &opts);
-  fcntl(fd, F_SETFL, 0);
+  tcsetattr(device_fd, TCSANOW, &opts);
+  fcntl(device_fd, F_SETFL, 0);
 
  /*
   * Now that we are "connected" to the port, ignore SIGTERM so that we
@@ -499,7 +499,7 @@ main(int  argc,                             /* I - Number of command-line arguments (6 or 7) */
   * stdin (otherwise you can't cancel raw jobs...)
   */
 
-  if (argc < 7)
+  if (print_fd != 0)
   {
 #ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
     sigset(SIGTERM, SIG_IGN);
@@ -515,133 +515,181 @@ main(int  argc,                         /* I - Number of command-line arguments (6 or 7) */
   }
 
  /*
-  * Finally, send the print file...
+  * Figure out the maximum file descriptor value to use with select()...
   */
 
-  if (bufsize > sizeof(buffer))
-    bufsize = sizeof(buffer);
+  nfds = (print_fd > device_fd ? print_fd : device_fd) + 1;
+
+ /*
+  * Finally, send the print file.  Ordinarily we would just use the
+  * backendRunLoop() function, however since we need to use smaller
+  * writes and may need to do DSR/DTR flow control, we duplicate much
+  * of the code here instead...
+  */
 
-  wbytes = 0;
+  if (print_size > sizeof(print_buffer))
+    print_size = sizeof(print_buffer);
+
+  total_bytes = 0;
 
   while (copies > 0)
   {
     copies --;
 
-    if (fp != 0)
+    if (print_fd != 0)
     {
       fputs("PAGE: 1 1\n", stderr);
-      lseek(fp, 0, SEEK_SET);
+      lseek(print_fd, 0, SEEK_SET);
     }
 
-    if (dtrdsr)
+   /*
+    * Now loop until we are out of data from print_fd...
+    */
+
+    for (print_bytes = 0, print_ptr = print_buffer;;)
     {
      /*
-      * Check the port and sleep until DSR is set...
+      * Use select() to determine whether we have data to copy around...
       */
 
-      int status;
+      FD_ZERO(&input);
+      if (!print_bytes)
+       FD_SET(print_fd, &input);
+      FD_SET(device_fd, &input);
 
+      FD_ZERO(&output);
+      if (print_bytes)
+       FD_SET(device_fd, &output);
 
-      if (!ioctl(fd, TIOCMGET, &status))
-        if (!(status & TIOCM_DSR))
+      if (select(nfds, &input, &output, NULL, NULL) < 0)
+       continue;                       /* Ignore errors here */
+
+     /*
+      * Check if we have back-channel data ready...
+      */
+
+      if (FD_ISSET(device_fd, &input))
+      {
+       if ((bc_bytes = read(device_fd, bc_buffer, sizeof(bc_buffer))) > 0)
+       {
+         fprintf(stderr,
+                 "DEBUG: Received " CUPS_LLFMT " bytes of back-channel data!\n",
+                 CUPS_LLCAST bc_bytes);
+          cupsBackChannelWrite(bc_buffer, bc_bytes, 1.0);
+       }
+      }
+
+     /*
+      * Check if we have print data ready...
+      */
+
+      if (FD_ISSET(print_fd, &input))
+      {
+       if ((print_bytes = read(print_fd, print_buffer, print_size)) < 0)
        {
         /*
-         * Wait for DSR to go high...
+          * Read error - bail if we don't see EAGAIN or EINTR...
          */
 
-         fputs("DEBUG: DSR is low; waiting for device...\n", stderr);
-
-          do
+         if (errno != EAGAIN || errno != EINTR)
          {
-           sleep(1);
-           if (ioctl(fd, TIOCMGET, &status))
-             break;
-         }
-         while (!(status & TIOCM_DSR));
+           perror("ERROR: Unable to read print data");
 
-         fputs("DEBUG: DSR is high; writing to device...\n", stderr);
-        }
-    }
+            tcsetattr(device_fd, TCSADRAIN, &origopts);
 
-    tbytes = 0;
-    while ((nbytes = read(fp, buffer, bufsize)) > 0)
-    {
-     /*
-      * Write the print data to the printer...
-      */
-
-      tbytes += nbytes;
-      bufptr = buffer;
+           close(device_fd);
 
-      while (nbytes > 0)
-      {
-       /*
-        * See if we are ready to read or write...
-       */
+           if (print_fd != 0)
+             close(print_fd);
 
-        do
-       {
-          FD_ZERO(&input);
-         FD_SET(fd, &input);
-         FD_ZERO(&output);
-         FD_SET(fd, &output);
-        }
-       while (select(fd + 1, &input, &output, NULL, NULL) < 0);
+           return (CUPS_BACKEND_FAILED);
+         }
 
-        if (FD_ISSET(fd, &input))
+          print_bytes = 0;
+       }
+       else if (print_bytes == 0)
        {
         /*
-         * Read backchannel data...
+          * End of file, break out of the loop...
          */
 
-         if ((rbytes = read(fd, resource, sizeof(resource))) > 0)
-         {
-           fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
-                   rbytes);
-            cupsBackChannelWrite(resource, rbytes, 1.0);
-          }
+          break;
        }
 
-        if (FD_ISSET(fd, &output))
+       print_ptr = print_buffer;
+      }
+
+     /*
+      * Check if the device is ready to receive data and we have data to
+      * send...
+      */
+
+      if (print_bytes && FD_ISSET(device_fd, &output))
+      {
+       if (dtrdsr)
        {
         /*
-         * Write print data...
+         * Check the port and sleep until DSR is set...
          */
 
-         if ((wbytes = write(fd, bufptr, nbytes)) < 0)
-           if (errno == ENOTTY)
-             wbytes = write(fd, bufptr, nbytes);
+         int status;
 
-         if (wbytes < 0)
-         {
-          /*
-           * Check for retryable errors...
-           */
 
-           if (errno != EAGAIN && errno != EINTR)
+         if (!ioctl(device_fd, TIOCMGET, &status))
+            if (!(status & TIOCM_DSR))
            {
-             perror("ERROR: Unable to send print file to printer");
-             break;
-           }
-         }
-         else
+            /*
+             * Wait for DSR to go high...
+             */
+
+             fputs("DEBUG: DSR is low; waiting for device...\n", stderr);
+
+              do
+             {
+              /*
+               * Poll every 100ms...
+               */
+
+               usleep(100000);
+
+               if (ioctl(device_fd, TIOCMGET, &status))
+                 break;
+             }
+             while (!(status & TIOCM_DSR));
+
+             fputs("DEBUG: DSR is high; writing to device...\n", stderr);
+            }
+       }
+
+       if ((bytes = write(device_fd, print_ptr, print_bytes)) < 0)
+       {
+        /*
+          * Write error - bail if we don't see an error we can retry...
+         */
+
+         if (errno != EAGAIN && errno != EINTR && errno != ENOTTY)
          {
-          /*
-           * Update count and pointer...
-           */
+           perror("ERROR: Unable to write print data");
+
+            tcsetattr(device_fd, TCSADRAIN, &origopts);
+
+           close(device_fd);
 
-           nbytes -= wbytes;
-           bufptr += wbytes;
+           if (print_fd != 0)
+             close(print_fd);
+
+           return (CUPS_BACKEND_FAILED);
          }
        }
-      }
-
-      if (wbytes < 0)
-        break;
+       else
+       {
+          fprintf(stderr, "DEBUG: Wrote %d bytes...\n", (int)bytes);
 
-      if (argc > 6)
-       fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
-               (unsigned long)tbytes);
+          print_bytes -= bytes;
+         print_ptr   += bytes;
+         total_bytes += bytes;
+       }
+      }
     }
   }
 
@@ -649,13 +697,14 @@ main(int  argc,                           /* I - Number of command-line arguments (6 or 7) */
   * Close the serial port and input file and return...
   */
 
-  tcsetattr(fd, TCSADRAIN, &origopts);
+  tcsetattr(device_fd, TCSADRAIN, &origopts);
+
+  close(device_fd);
 
-  close(fd);
-  if (fp != 0)
-    close(fp);
+  if (print_fd != 0)
+    close(print_fd);
 
-  return (wbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
+  return (total_bytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
 }
 
 
index 701e3f46098d802e3ddc6e5f8ab241b09e379b05..502f5514afd9051b0cde5480045d4ce78d825364 100644 (file)
  * Include necessary headers.
  */
 
-#include <cups/backend.h>
 #include <cups/http-private.h>
-#include <cups/cups.h>
-#include <cups/string.h>
+#include "backend-private.h"
 #include <cups/array.h>
 #include <cups/file.h>
-#include <errno.h>
-#include <signal.h>
-
-#define SNMP_BACKEND
-#include "ieee1284.c"
 
 
 /*
@@ -1647,6 +1640,14 @@ probe_device(snmp_cache_t *device)       /* I - Device */
             !strchr(info->values[0].string.text, ';')))
          info = NULL;
 
+       /*
+        * Don't use the printer-make-and-model if it contains a generic
+       * string like "Ricoh IPP Printer"...
+       */
+
+       if (model && strstr(model->values[0].string.text, "IPP Printer"))
+         model = NULL;
+
        /*
         * If we don't have a printer-make-and-model string from the printer
        * but do have the 1284 device ID string, generate a make-and-model
@@ -1656,7 +1657,9 @@ probe_device(snmp_cache_t *device)        /* I - Device */
        if (model)
           strlcpy(temp, model->values[0].string.text, sizeof(temp));
        else if (info)
-         get_make_model(info->values[0].string.text, temp, sizeof(temp));
+         backendGetMakeModel(info->values[0].string.text, temp, sizeof(temp));
+        else
+         temp[0] = '\0';
 
         fix_make_model(make_model, temp, sizeof(make_model));
 
@@ -1928,8 +1931,8 @@ read_snmp_response(int fd)                /* I - SNMP socket file descriptor */
       * Description is the IEEE-1284 device ID...
       */
 
-      get_make_model(packet.object_value.string, make_model,
-                     sizeof(make_model));
+      backendGetMakeModel(packet.object_value.string, make_model,
+                         sizeof(make_model));
     }
     else
     {
index d09509cb8538830f5b3f0ce8ac7816f4a87b5bd1..93a5f76bfb1d96ccfc241b23920d02aeab6365f6 100644 (file)
  * Include necessary headers.
  */
 
-#include <cups/backend.h>
 #include <cups/http-private.h>
-#include <cups/cups.h>
-#include <stdio.h>
-#include <stdlib.h>
+#include "backend-private.h"
 #include <stdarg.h>
-#include <cups/string.h>
-#include <errno.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <signal.h>
 
 #ifdef WIN32
 #  include <winsock.h>
@@ -76,24 +70,19 @@ main(int  argc,                             /* I - Number of command-line arguments (6 or 7) */
                name[255],              /* Name of option */
                value[255],             /* Value of option */
                *ptr;                   /* Pointer into name or value */
-  int          fp;                     /* Print file */
+  int          print_fd;               /* Print file */
   int          copies;                 /* Number of copies to print */
   int          waiteof;                /* Wait for end-of-file? */
   int          port;                   /* Port number */
   char         portname[255];          /* Port name */
   int          delay;                  /* Delay for retries... */
-  int          fd;                     /* AppSocket */
+  int          device_fd;              /* AppSocket */
   int          error;                  /* Error code (if any) */
   http_addrlist_t *addrlist;           /* Address list */
-  int          rbytes;                 /* Number of bytes read */
-  int          wbytes;                 /* Number of bytes written */
-  int          nbytes;                 /* Number of bytes read */
-  size_t       tbytes;                 /* Total number of bytes written */
-  char         buffer[8192],           /* Output buffer */
-               *bufptr;                /* Pointer into buffer */
+  ssize_t      tbytes;                 /* Total number of bytes written */
   struct timeval timeout;              /* Timeout for select() */
-  fd_set       input,                  /* Input set for select() */
-               output;                 /* Output set for select() */
+  fd_set       input;                  /* Input set for select() */
+  ssize_t      bc_bytes;               /* Number of back-channel bytes read */
 #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
   struct sigaction action;             /* Actions for POSIX signals */
 #endif /* HAVE_SIGACTION && !HAVE_SIGSET */
@@ -142,8 +131,8 @@ main(int  argc,                             /* I - Number of command-line arguments (6 or 7) */
 
   if (argc == 6)
   {
-    fp     = 0;
-    copies = 1;
+    print_fd = 0;
+    copies   = 1;
   }
   else
   {
@@ -151,7 +140,7 @@ main(int  argc,                             /* I - Number of command-line arguments (6 or 7) */
     * Try to open the print file...
     */
 
-    if ((fp = open(argv[6], O_RDONLY)) < 0)
+    if ((print_fd = open(argv[6], O_RDONLY)) < 0)
     {
       perror("ERROR: unable to open print file");
       return (CUPS_BACKEND_FAILED);
@@ -252,228 +241,134 @@ main(int  argc,                         /* I - Number of command-line arguments (6 or 7) */
   fprintf(stderr, "INFO: Attempting to connect to host %s on port %d\n",
           hostname, port);
 
-  wbytes = 0;
+  fputs("STATE: +connecting-to-device\n", stderr);
 
-  while (copies > 0)
+  for (delay = 5;;)
   {
-    fputs("STATE: +connecting-to-device\n", stderr);
-
-    for (delay = 5;;)
+    if (!httpAddrConnect(addrlist, &device_fd))
     {
-      if (!httpAddrConnect(addrlist, &fd))
-      {
-       error = errno;
-       fd    = -1;
+      error     = errno;
+      device_fd = -1;
 
-       if (getenv("CLASS") != NULL)
-       {
-        /*
-          * If the CLASS environment variable is set, the job was submitted
-         * to a class and not to a specific queue.  In this case, we want
-         * to abort immediately so that the job can be requeued on the next
-         * available printer in the class.
-         */
+      if (getenv("CLASS") != NULL)
+      {
+       /*
+        * If the CLASS environment variable is set, the job was submitted
+       * to a class and not to a specific queue.  In this case, we want
+       * to abort immediately so that the job can be requeued on the next
+       * available printer in the class.
+       */
 
-          fprintf(stderr, "INFO: Unable to connect to \"%s\", queuing on next printer in class...\n",
-                 hostname);
+        fprintf(stderr, "INFO: Unable to connect to \"%s\", queuing on next printer in class...\n",
+               hostname);
 
-        /*
-          * Sleep 5 seconds to keep the job from requeuing too rapidly...
-         */
+       /*
+        * Sleep 5 seconds to keep the job from requeuing too rapidly...
+       */
 
-         sleep(5);
+       sleep(5);
 
-          return (CUPS_BACKEND_FAILED);
-       }
+        return (CUPS_BACKEND_FAILED);
+      }
 
-       if (error == ECONNREFUSED || error == EHOSTDOWN ||
-            error == EHOSTUNREACH)
-       {
-         fprintf(stderr, "INFO: Network host \'%s\' is busy; will retry in %d seconds...\n",
-                  hostname, delay);
-         sleep(delay);
+      if (error == ECONNREFUSED || error == EHOSTDOWN ||
+          error == EHOSTUNREACH)
+      {
+       fprintf(stderr,
+               "INFO: Network host \'%s\' is busy; will retry in %d seconds...\n",
+                hostname, delay);
+       sleep(delay);
 
-         if (delay < 30)
-           delay += 5;
-       }
-       else
-       {
-         perror("ERROR: Unable to connect to printer (retrying in 30 seconds)");
-         sleep(30);
-       }
+       if (delay < 30)
+         delay += 5;
       }
       else
-       break;
+      {
+       perror("ERROR: Unable to connect to printer (retrying in 30 seconds)");
+       sleep(30);
+      }
     }
+    else
+      break;
+  }
 
-    fputs("STATE: -connecting-to-device\n", stderr);
-
-   /*
-    * Now that we are "connected" to the port, ignore SIGTERM so that we
-    * can finish out any page data the driver sends (e.g. to eject the
-    * current page...  Only ignore SIGTERM if we are printing data from
-    * stdin (otherwise you can't cancel raw jobs...)
-    */
-
-    if (argc < 7)
-    {
-#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
-      sigset(SIGTERM, SIG_IGN);
-#elif defined(HAVE_SIGACTION)
-      memset(&action, 0, sizeof(action));
+  fputs("STATE: -connecting-to-device\n", stderr);
 
-      sigemptyset(&action.sa_mask);
-      action.sa_handler = SIG_IGN;
-      sigaction(SIGTERM, &action, NULL);
-#else
-      signal(SIGTERM, SIG_IGN);
-#endif /* HAVE_SIGSET */
-    }
+ /*
+  * Print everything...
+  */
 
-   /*
-    * Finally, send the print file...
-    */
+  tbytes = 0;
 
+  while (copies > 0 && tbytes >= 0)
+  {
     copies --;
 
-    if (fp != 0)
+    if (print_fd != 0)
     {
       fputs("PAGE: 1 1\n", stderr);
-      lseek(fp, 0, SEEK_SET);
+      lseek(print_fd, 0, SEEK_SET);
     }
 
-    fputs("INFO: Connected to host, sending print job...\n", stderr);
-
-    tbytes = 0;
-    while ((nbytes = read(fp, buffer, sizeof(buffer))) > 0)
-    {
-     /*
-      * Write the print data to the printer...
-      */
-
-      tbytes += nbytes;
-      bufptr = buffer;
-
-      while (nbytes > 0)
-      {
-       /*
-        * See if we are ready to read or write...
-       */
+    tbytes = backendRunLoop(print_fd, device_fd, 1);
 
-        do
-       {
-          FD_ZERO(&input);
-         FD_SET(fd, &input);
-         FD_ZERO(&output);
-         FD_SET(fd, &output);
-        }
-       while (select(fd + 1, &input, &output, NULL, NULL) < 0);
-
-        if (FD_ISSET(fd, &input))
-       {
-        /*
-         * Read backchannel data...
-         */
-
-         if ((rbytes = recv(fd, resource, sizeof(resource), 0)) > 0)
-         {
-           fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
-                   rbytes);
-            cupsBackChannelWrite(resource, rbytes, 1.0);
-          }
-       }
+    if (print_fd != 0 && tbytes >= 0)
+      fprintf(stderr, "INFO: Sent print file, " CUPS_LLFMT " bytes...\n",
+             CUPS_LLCAST tbytes);
+  }
 
-        if (FD_ISSET(fd, &output))
-       {
-        /*
-         * Write print data...
-         */
-
-         if ((wbytes = send(fd, bufptr, nbytes, 0)) < 0)
-         {
-          /*
-           * Check for retryable errors...
-           */
-
-           if (errno != EAGAIN && errno != EINTR)
-           {
-             perror("ERROR: Unable to send print file to printer");
-             break;
-           }
-         }
-         else
-         {
-          /*
-           * Update count and pointer...
-           */
-
-           nbytes -= wbytes;
-           bufptr += wbytes;
-         }
-        }
-      }
+  if (waiteof)
+  {
+   /*
+    * Shutdown the socket and wait for the other end to finish...
+    */
 
-      if (wbytes < 0)
-        break;
+    fputs("INFO: Print file sent, waiting for printer to finish...\n", stderr);
 
-      if (argc > 6)
-       fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
-               (unsigned long)tbytes);
-    }
+    shutdown(device_fd, 1);
 
-    if (waiteof)
+    for (;;)
     {
      /*
-      * Shutdown the socket and wait for the other end to finish...
+      * Wait a maximum of 90 seconds for backchannel data or a closed
+      * connection...
       */
 
-      fputs("INFO: Print file sent, waiting for printer to finish...\n", stderr);
+      timeout.tv_sec  = 90;
+      timeout.tv_usec = 0;
 
-      shutdown(fd, 1);
+      FD_ZERO(&input);
+      FD_SET(device_fd, &input);
 
-      for (;;)
+#ifdef __hpux
+      if (select(device_fd + 1, (int *)&input, NULL, NULL, &timeout) > 0)
+#else
+      if (select(device_fd + 1, &input, NULL, NULL, &timeout) > 0)
+#endif /* __hpux */
       {
        /*
-       * Wait a maximum of 90 seconds for backchannel data or a closed
-       * connection...
+       * Grab the data coming back and spit it out to stderr...
        */
 
-       timeout.tv_sec  = 90;
-       timeout.tv_usec = 0;
-
-       FD_ZERO(&input);
-       FD_SET(fd, &input);
-
-  #ifdef __hpux
-       if (select(fd + 1, (int *)&input, NULL, NULL, &timeout) > 0)
-  #else
-       if (select(fd + 1, &input, NULL, NULL, &timeout) > 0)
-  #endif /* __hpux */
+       if ((bc_bytes = read(device_fd, resource, sizeof(resource))) > 0)
        {
-        /*
-         * Grab the data coming back and spit it out to stderr...
-         */
-
-         if ((rbytes = recv(fd, resource, sizeof(resource), 0)) > 0)
-         {
-           fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
-                   rbytes);
-           cupsBackChannelWrite(resource, rbytes, 1.0);
-         }
-         else
-           break;
+         fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
+                 (int)bc_bytes);
+         cupsBackChannelWrite(resource, bc_bytes, 1.0);
        }
        else
          break;
       }
+      else
+       break;
     }
+  }
 
  /*
-    * Close the socket connection...
-    */
+ /*
+  * Close the socket connection...
+  */
 
-    close(fd);
-  }
+  close(device_fd);
 
   httpAddrFreeList(addrlist);
 
@@ -481,13 +376,13 @@ main(int  argc,                           /* I - Number of command-line arguments (6 or 7) */
   * Close the input file and return...
   */
 
-  if (fp != 0)
-    close(fp);
+  if (print_fd != 0)
+    close(print_fd);
 
-  if (wbytes >= 0)
+  if (tbytes >= 0)
     fputs("INFO: Ready to print.\n", stderr);
 
-  return (wbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
+  return (tbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
 }
 
 
index 8491fd0ced712e7bc0f1fba36be0079f73e2c40e..4d77cc68fd1a9fef34ae0a2973fc8fcf37d26b43 100644 (file)
@@ -41,6 +41,7 @@
 #  include <unistd.h>
 #  include <fcntl.h>
 #endif /* WIN32 */
+
 #define DEBUG
 #include "ieee1284.c"
 
@@ -76,8 +77,8 @@ main(int  argc,                               /* I - Number of command-line args */
 
     printf("%s:\n", argv[i]);
 
-    get_device_id(fd, device_id, sizeof(device_id), make_model,
-                  sizeof(make_model), "test", uri, sizeof(uri));
+    backendGetDeviceID(fd, device_id, sizeof(device_id), make_model,
+                       sizeof(make_model), "test", uri, sizeof(uri));
 
     printf("    device_id=\"%s\"\n", device_id);
     printf("    make_model=\"%s\"\n", make_model);
index b1f283b1f95a0bee84932ad7af191b9f69cc94d1..093535054e474e4d9124be5d52458b0bd1e4efe0 100644 (file)
@@ -1310,7 +1310,7 @@ static void *read_thread(void *reference)
      */
     start = mach_absolute_time();
 
-    rbytes = sizeof(readbuffer) - 1;
+    rbytes = sizeof(readbuffer);
     readstatus = (*classdriver)->ReadPipe( classdriver, readbuffer, &rbytes );
     if ( kIOReturnSuccess == readstatus && rbytes > 0 ) {
 
index 3ca30c965d6e5e3040248587f12af65ffcea1de7..6c635b4764e1c41aa110333b56f534623bcfcb46 100644 (file)
@@ -27,8 +27,9 @@
  *
  * Contents:
  *
- *   main()         - Send a file to the specified USB port.
+ *   print_device() - Print a file to a USB device.
  *   list_devices() - List all USB devices.
+ *   open_device()  - Open a USB device...
  */
 
 /*
@@ -55,30 +56,20 @@ print_device(const char *uri,               /* I - Device URI */
              const char *hostname,     /* I - Hostname/manufacturer */
              const char *resource,     /* I - Resource/modelname */
             const char *options,       /* I - Device options/serial number */
-            int        fp,             /* I - File descriptor to print */
+            int        print_fd,       /* I - File descriptor to print */
             int        copies,         /* I - Copies to print */
             int        argc,           /* I - Number of command-line arguments (6 or 7) */
             char       *argv[])        /* I - Command-line arguments */
 {
-  int          usebc;                  /* Use backchannel path? */
-  int          fd;                     /* USB device */
-  int          rbytes;                 /* Number of bytes read */
-  int          wbytes;                 /* Number of bytes written */
-  size_t       nbytes,                 /* Number of bytes read */
-               tbytes;                 /* Total number of bytes written */
-  char         buffer[8192],           /* Output buffer */
-               *bufptr,                /* Pointer into buffer */
-               backbuf[1024];          /* Backchannel buffer */
+  int          use_bc;                 /* Use backchannel path? */
+  int          device_fd;              /* USB device */
+  size_t       tbytes;                 /* Total number of bytes written */
   struct termios opts;                 /* Parallel port options */
-  fd_set       input,                  /* Input set for select() */
-               output;                 /* Output set for select() */
-  int          paperout;               /* Paper out? */
-#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
-  struct sigaction action;             /* Actions for POSIX signals */
-#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
-#ifdef __linux
+#if defined(__linux) && defined(LP_POUTPA)
   unsigned int status;                 /* Port status (off-line, out-of-paper, etc.) */
-#endif /* __linux */
+  int          paperout;               /* Paper out? */
+#endif /* __linux && LP_POUTPA */
+
 
   (void)argc;
   (void)argv;
@@ -89,7 +80,7 @@ print_device(const char *uri,         /* I - Device URI */
   * when they get a read request...
   */
 
-  usebc = strcasecmp(hostname, "Canon") != 0;
+  use_bc = strcasecmp(hostname, "Canon") != 0;
 
  /*
   * Open the USB port device...
@@ -99,7 +90,7 @@ print_device(const char *uri,         /* I - Device URI */
 
   do
   {
-    if ((fd = open_device(uri)) == -1)
+    if ((device_fd = open_device(uri)) == -1)
     {
       if (getenv("CLASS") != NULL)
       {
@@ -127,7 +118,8 @@ print_device(const char *uri,               /* I - Device URI */
         fputs("INFO: USB port busy; will retry in 30 seconds...\n", stderr);
        sleep(30);
       }
-      else if (errno == ENXIO || errno == EIO || errno == ENOENT || errno == ENODEV)
+      else if (errno == ENXIO || errno == EIO || errno == ENOENT ||
+               errno == ENODEV)
       {
         fputs("INFO: Printer not connected; will retry in 30 seconds...\n", stderr);
        sleep(30);
@@ -140,7 +132,7 @@ print_device(const char *uri,               /* I - Device URI */
       }
     }
   }
-  while (fd < 0);
+  while (device_fd < 0);
 
   fputs("STATE: -connecting-to-device\n", stderr);
 
@@ -148,28 +140,25 @@ print_device(const char *uri,             /* I - Device URI */
   * Set any options provided...
   */
 
-  tcgetattr(fd, &opts);
+  tcgetattr(device_fd, &opts);
 
   opts.c_lflag &= ~(ICANON | ECHO | ISIG);     /* Raw mode */
 
   /**** No options supported yet ****/
 
-  tcsetattr(fd, TCSANOW, &opts);
-
- /*
-  * Check printer status...
-  */
-
-  paperout = 0;
+  tcsetattr(device_fd, TCSANOW, &opts);
 
 #if defined(__linux) && defined(LP_POUTPA)
  /*
   * Show the printer status before we send the file...
   */
 
-  while (!ioctl(fd, LPGETSTATUS, &status))
+  paperout = 0;
+
+  while (!ioctl(device_fd, LPGETSTATUS, &status))
   {
-    fprintf(stderr, "DEBUG: LPGETSTATUS returned a port status of %02X...\n", status);
+    fprintf(stderr, "DEBUG: LPGETSTATUS returned a port status of %02X...\n",
+            status);
 
     if (status & LP_POUTPA)
     {
@@ -190,147 +179,36 @@ print_device(const char *uri,            /* I - Device URI */
   }
 #endif /* __linux && LP_POUTPA */
 
- /*
-  * Now that we are "connected" to the port, ignore SIGTERM so that we
-  * can finish out any page data the driver sends (e.g. to eject the
-  * current page...  Only ignore SIGTERM if we are printing data from
-  * stdin (otherwise you can't cancel raw jobs...)
-  */
-
-  if (!fp)
-  {
-#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
-    sigset(SIGTERM, SIG_IGN);
-#elif defined(HAVE_SIGACTION)
-    memset(&action, 0, sizeof(action));
-
-    sigemptyset(&action.sa_mask);
-    action.sa_handler = SIG_IGN;
-    sigaction(SIGTERM, &action, NULL);
-#else
-    signal(SIGTERM, SIG_IGN);
-#endif /* HAVE_SIGSET */
-  }
-
  /*
   * Finally, send the print file...
   */
 
-  wbytes = 0;
+  tbytes = 0;
 
-  while (copies > 0)
+  while (copies > 0 && tbytes >= 0)
   {
     copies --;
 
-    if (fp != 0)
+    if (print_fd != 0)
     {
       fputs("PAGE: 1 1\n", stderr);
-      lseek(fp, 0, SEEK_SET);
+      lseek(print_fd, 0, SEEK_SET);
     }
 
-    tbytes = 0;
-    while ((nbytes = read(fp, buffer, sizeof(buffer))) > 0)
-    {
-     /*
-      * Write the print data to the printer...
-      */
-
-      tbytes += nbytes;
-      bufptr = buffer;
-
-      while (nbytes > 0)
-      {
-       /*
-        * See if we are ready to read or write...
-       */
-
-        do
-       {
-          FD_ZERO(&input);
-         if (usebc)
-           FD_SET(fd, &input);
-
-         FD_ZERO(&output);
-         FD_SET(fd, &output);
-        }
-       while (select(fd + 1, &input, &output, NULL, NULL) < 0);
-
-        if (FD_ISSET(fd, &input))
-       {
-        /*
-         * Read backchannel data...
-         */
-
-         if ((rbytes = read(fd, backbuf, sizeof(backbuf))) > 0)
-         {
-           fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
-                   rbytes);
-            cupsBackChannelWrite(backbuf, rbytes, 1.0);
-          }
-       }
-
-        if (FD_ISSET(fd, &output))
-       {
-        /*
-         * Write print data...
-         */
-
-         if ((wbytes = write(fd, bufptr, nbytes)) < 0)
-           if (errno == ENOTTY)
-             wbytes = write(fd, bufptr, nbytes);
-
-         if (wbytes < 0)
-         {
-          /*
-           * Check for retryable errors...
-           */
-
-           if (errno == ENOSPC)
-           {
-             paperout = 1;
-             fputs("ERROR: Out of paper!\n", stderr);
-             fputs("STATUS: +media-tray-empty-error\n", stderr);
-           }
-           else if (errno != EAGAIN && errno != EINTR)
-           {
-             perror("ERROR: Unable to send print file to printer");
-             break;
-           }
-         }
-         else
-         {
-          /*
-           * Update count and pointer...
-           */
-
-            if (paperout)
-           {
-             fputs("STATUS: -media-tray-empty-error\n", stderr);
-             paperout = 0;
-           }
-
-           nbytes -= wbytes;
-           bufptr += wbytes;
-         }
-       }
-      }
-
-      if (wbytes < 0)
-        break;
+    tbytes = backendRunLoop(print_fd, device_fd, 1);
 
-      if (fp)
-       fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
-               (unsigned long)tbytes);
-    }
+    if (print_fd != 0 && tbytes >= 0)
+      fprintf(stderr, "INFO: Sent print file, " CUPS_LLFMT " bytes...\n",
+             CUPS_LLCAST tbytes);
   }
 
  /*
   * Close the USB port and return...
   */
 
-  close(fd);
+  close(device_fd);
 
-  return (wbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
+  return (tbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
 }
 
 
@@ -372,9 +250,9 @@ list_devices(void)
 
     if ((fd = open(device, O_RDWR | O_EXCL)) >= 0)
     {
-      if (!get_device_id(fd, device_id, sizeof(device_id),
-                         make_model, sizeof(make_model),
-                        "usb", device_uri, sizeof(device_uri)))
+      if (!backendGetDeviceID(fd, device_id, sizeof(device_id),
+                              make_model, sizeof(make_model),
+                             "usb", device_uri, sizeof(device_uri)))
        printf("direct %s \"%s\" \"%s USB #%d\" \"%s\"\n", device_uri,
               make_model, make_model, i + 1, device_id);
 
@@ -401,9 +279,9 @@ list_devices(void)
 
     if ((fd = open(device, O_RDWR | O_EXCL)) >= 0)
     {
-      if (!get_device_id(fd, device_id, sizeof(device_id),
-                         make_model, sizeof(make_model),
-                        "usb", device_uri, sizeof(device_uri)))
+      if (!backendGetDeviceID(fd, device_id, sizeof(device_id),
+                              make_model, sizeof(make_model),
+                             "usb", device_uri, sizeof(device_uri)))
        printf("direct %s \"%s\" \"%s USB #%d\" \"%s\"\n", device_uri,
               make_model, make_model, i + 1, device_id);
 
@@ -446,7 +324,14 @@ open_device(const char *uri)               /* I - Device URI */
 
   if (!strncmp(uri, "usb:/dev/", 9))
 #ifdef __linux
-    return (-1); /* Do not allow direct devices anymore */
+  {
+   /*
+    * Do not allow direct devices anymore...
+    */
+
+    errno = ENODEV;
+    return (-1);
+  }
   else if (!strncmp(uri, "usb://", 6))
   {
    /*
@@ -486,9 +371,9 @@ open_device(const char *uri)                /* I - Device URI */
 
        if ((fd = open(device, O_RDWR | O_EXCL)) >= 0)
        {
-         get_device_id(fd, device_id, sizeof(device_id),
-                        make_model, sizeof(make_model),
-                       "usb", device_uri, sizeof(device_uri));
+         backendGetDeviceID(fd, device_id, sizeof(device_id),
+                             make_model, sizeof(make_model),
+                            "usb", device_uri, sizeof(device_uri));
        }
        else
        {
@@ -545,7 +430,14 @@ open_device(const char *uri)               /* I - Device URI */
     return (-1);
   }
 #elif defined(__sun) && defined(ECPPIOC_GETDEVID)
-    return (-1); /* Do not allow direct devices anymore */
+  {
+   /*
+    * Do not allow direct devices anymore...
+    */
+
+    errno = ENODEV;
+    return (-1);
+  }
   else if (!strncmp(uri, "usb://", 6))
   {
    /*
@@ -572,9 +464,9 @@ open_device(const char *uri)                /* I - Device URI */
        sprintf(device, "/dev/usb/printer%d", i);
 
        if ((fd = open(device, O_RDWR | O_EXCL)) >= 0)
-         get_device_id(fd, device_id, sizeof(device_id),
-                        make_model, sizeof(make_model),
-                       "usb", device_uri, sizeof(device_uri));
+         backendGetDeviceID(fd, device_id, sizeof(device_id),
+                             make_model, sizeof(make_model),
+                            "usb", device_uri, sizeof(device_uri));
        else
        {
         /*
index 9e81f8f12a396365a7f7f40cd17dff45b426fb13..eb9a0540c4d8880ce341820a10fe6e46ec7c6010 100644 (file)
@@ -63,7 +63,7 @@
 void   list_devices(void);
 int    print_device(const char *uri, const char *hostname,
                     const char *resource, const char *options,
-                    int fp, int copies, int argc, char *argv[]);
+                    int print_fd, int copies, int argc, char *argv[]);
 
 
 /*
@@ -108,7 +108,7 @@ print_device(const char *uri,               /* I - Device URI */
              const char *hostname,     /* I - Hostname/manufacturer */
              const char *resource,     /* I - Resource/modelname */
             const char *options,       /* I - Device options/serial number */
-            int        fp,             /* I - File descriptor to print */
+            int        print_fd,       /* I - File descriptor to print */
             int        copies,         /* I - Copies to print */
             int        argc,           /* I - Number of command-line arguments (6 or 7) */
             char       *argv[])        /* I - Command-line arguments */
@@ -124,7 +124,7 @@ print_device(const char *uri,               /* I - Device URI */
   (void)hostname;
   (void)resource;
   (void)options;
-  (void)fp;
+  (void)print_fd;
   (void)copies;
   (void)argc;
   (void)argv;
@@ -146,7 +146,7 @@ int                                 /* O - Exit status */
 main(int  argc,                                /* I - Number of command-line arguments (6 or 7) */
      char *argv[])                     /* I - Command-line arguments */
 {
-  int          fp;                     /* Print file */
+  int          print_fd;               /* Print file */
   int          copies;                 /* Number of copies to print */
   int          status;                 /* Exit status */
   int          port;                   /* Port number (not used) */
@@ -232,8 +232,8 @@ main(int  argc,                             /* I - Number of command-line arguments (6 or 7) */
 
   if (argc == 6)
   {
-    fp     = 0;
-    copies = 1;
+    print_fd = 0;
+    copies   = 1;
   }
   else
   {
@@ -241,7 +241,7 @@ main(int  argc,                             /* I - Number of command-line arguments (6 or 7) */
     * Try to open the print file...
     */
 
-    if ((fp = open(argv[6], O_RDONLY)) < 0)
+    if ((print_fd = open(argv[6], O_RDONLY)) < 0)
     {
       fprintf(stderr, "ERROR: unable to open print file %s - %s\n",
               argv[6], strerror(errno));
@@ -255,14 +255,15 @@ main(int  argc,                           /* I - Number of command-line arguments (6 or 7) */
   * Finally, send the print file...
   */
 
-  status = print_device(uri, hostname, resource, options, fp, copies, argc, argv);
+  status = print_device(uri, hostname, resource, options, print_fd, copies,
+                        argc, argv);
 
  /*
   * Close the input file and return...
   */
 
-  if (fp != 0)
-    close(fp);
+  if (print_fd != 0)
+    close(print_fd);
 
   return (status);
 }
index d8db9344af24c7627e0160c6dad1dd0e38a2f2e0..767d33e1c4b8af7ca7165ccbabd92463af23ed04 100644 (file)
@@ -2,13 +2,15 @@
 
 lpc.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
 lpc.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
-lpc.o: ../cups/i18n.h ../cups/debug.h ../cups/string.h ../config.h
+lpc.o: ../cups/i18n.h ../cups/transcode.h ../cups/debug.h ../cups/string.h
+lpc.o: ../config.h
 lpq.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h
 lpq.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
-lpq.o: ../cups/file.h ../cups/language.h ../cups/i18n.h ../cups/debug.h
+lpq.o: ../cups/file.h ../cups/language.h ../cups/i18n.h ../cups/transcode.h
+lpq.o: ../cups/debug.h
 lpr.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h
 lpr.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
-lpr.o: ../cups/file.h ../cups/language.h ../cups/i18n.h
+lpr.o: ../cups/file.h ../cups/language.h ../cups/i18n.h ../cups/transcode.h
 lprm.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
 lprm.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
-lprm.o: ../cups/i18n.h ../cups/string.h ../config.h
+lprm.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
index 59bb3187a70e35f1cb5d4600ee7f715246135209..835109fa41dee504b73bc39ffa6b39336b5830a7 100644 (file)
@@ -79,8 +79,6 @@ main(int  argc,                               /* I - Number of command-line arguments */
   cups_lang_t  *language;              /* Language */
 
 
-
-
  /*
   * Check for command-line options...
   */
index a1e09d3988f9496b09b017c8722955a3480b78ef..7e976859d166872c8eaf3ff9e0100f7a38c797df 100644 (file)
@@ -3,47 +3,49 @@
 help-index.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
 help-index.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
 help-index.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
-help-index.o: ../cups/i18n.h ../cups/string.h ../config.h ../cups/dir.h
+help-index.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
+help-index.o: ../cups/dir.h
 html.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
 html.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
 html.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
-html.o: ../cups/i18n.h ../cups/string.h ../config.h
+html.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
 ipp-var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
 ipp-var.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
 ipp-var.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
-ipp-var.o: ../cups/i18n.h ../cups/string.h ../config.h
+ipp-var.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
 search.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
 search.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
 search.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
-search.o: ../cups/i18n.h ../cups/string.h ../config.h
+search.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
 template.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
 template.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
 template.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
-template.o: ../cups/i18n.h ../cups/string.h ../config.h
+template.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
 var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
 var.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
 var.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
-var.o: ../cups/i18n.h ../cups/string.h ../config.h
+var.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
 admin.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
 admin.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
 admin.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
-admin.o: ../cups/i18n.h ../cups/string.h ../config.h ../cups/file.h
+admin.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
+admin.o: ../cups/adminutil.h ../cups/cups.h ../cups/file.h
 classes.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
 classes.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
 classes.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
-classes.o: ../cups/i18n.h ../cups/string.h ../config.h
+classes.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
 help.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
 help.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
 help.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
-help.o: ../cups/i18n.h ../cups/string.h ../config.h
+help.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
 jobs.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
 jobs.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
 jobs.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
-jobs.o: ../cups/i18n.h ../cups/string.h ../config.h
+jobs.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
 printers.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
 printers.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
 printers.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
-printers.o: ../cups/i18n.h ../cups/string.h ../config.h
+printers.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
 testcgi.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
 testcgi.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
 testcgi.o: ../cups/array.h help-index.h
index 2ca12143387e6ddbffd33459eb6ffb4aa1f97151..0fae095082a7f2bf3259148ccfe551905c7dd8b4 100644 (file)
@@ -651,8 +651,6 @@ do_am_printer(http_t *http,         /* I - HTTP connection */
     * Do the request and get back a response...
     */
 
-    fprintf(stderr, "DEBUG: http=%p (%s)\n", http, http->hostname);
-
     if ((response = cupsDoRequest(http, request, "/")) != NULL)
     {
       fputs("DEBUG: Got device list!\n", stderr);
index 8f148c471e4f54e473ea6e9078da8bd025085c28..b27ca066657369ffc14c15ea5fb4dbb523ef741b 100644 (file)
@@ -842,7 +842,7 @@ help_load_file(
        if (isspace(*ptr & 255))
        {
          while (isspace(*ptr & 255))
-           *ptr ++;
+           ptr ++;
 
          *text++ = ' ';
         }
index a2340d2bc71d804a7854205a69b5b3d1c667e424..d400d18ff190b989dd993ef2ca42f133b2cb6b58 100644 (file)
@@ -29,7 +29,7 @@ dnl Set the name of the config header file...
 AC_CONFIG_HEADER(config.h)
 
 dnl Versio number information...
-CUPS_VERSION="1.2svn"
+CUPS_VERSION="1.3svn"
 CUPS_REVISION=""
 if test -z "$CUPS_REVISION" -a -d .svn; then
        CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
index 318df21030ec1b2a8a5fd4483af7d50446ee235b..403293135ad5b6c5fbcd08b2741075767d0c5b14 100644 (file)
@@ -24,22 +24,31 @@ dnl
 
 dnl Clear the debugging and non-shared library options unless the user asks
 dnl for them...
-ARCHFLAGS=""
 OPTIM=""
-AC_SUBST(ARCHFLAGS)
 AC_SUBST(OPTIM)
 
 AC_ARG_WITH(optim, [  --with-optim="flags"    set optimization flags ])
-AC_ARG_WITH(archflags, [  --with-arch="flags"     set default architecture flags ])
-
 AC_ARG_ENABLE(debug, [  --enable-debug          turn on debugging, default=no],
        [if test x$enable_debug = xyes; then
                OPTIM="-g"
        fi])
 
+dnl Setup general architecture flags...
+AC_ARG_WITH(archflags, [  --with-archflags="flags"
+                          set default architecture flags ])
+
+if test -z "$with_archflags"; then
+       ARCHFLAGS=""
+else
+       ARCHFLAGS="$with_archflags"
+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-arch32="flags"   specifies 32-bit architecture flags])
+AC_ARG_WITH(arch32flags, [  --with-arch32flags="flags"
+                          specifies 32-bit architecture flags])
 
 ARCH32FLAGS=""
 INSTALL32=""
@@ -56,7 +65,8 @@ 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-arch64="flags"   specifies 64-bit architecture flags])
+AC_ARG_WITH(arch64flags, [  --with-arch64flags="flags"
+                          specifies 64-bit architecture flags])
 
 ARCH64FLAGS=""
 INSTALL64=""
@@ -118,17 +128,6 @@ if test -n "$GCC"; then
        fi
 
        case "$uname" in
-               Darwin*)
-                       if test -z "$with_archflags"; then
-                               if test "x`uname -m`" = xi386; then
-                                       # Build universal binaries for OSX on Intel...
-                                       ARCHFLAGS="-arch i386 -arch ppc"
-                               fi
-                       else
-                               ARCHFLAGS="$with_archflags"
-                       fi
-                       ;;
-
                IRIX)
                        if test "x$enable_32bit" = xyes; then
                                # Build 32-bit libraries, 64-bit base...
@@ -149,8 +148,6 @@ if test -n "$GCC"; then
                                        else
                                                ARCHFLAGS="$with_arch64flags"
                                        fi
-                               else
-                                       ARCHFLAGS="$with_archflags"
                                fi
                        fi
 
@@ -173,8 +170,6 @@ if test -n "$GCC"; then
                                        else
                                                ARCHFLAGS="$with_arch32flags"
                                        fi
-                               else
-                                       ARCHFLAGS="$with_archflags"
                                fi
                        fi
                        ;;
@@ -202,8 +197,6 @@ if test -n "$GCC"; then
                                        else
                                                ARCHFLAGS="$with_arch64flags"
                                        fi
-                               else
-                                       ARCHFLAGS="$with_archflags"
                                fi
                        fi
 
@@ -229,8 +222,6 @@ if test -n "$GCC"; then
                                        else
                                                ARCHFLAGS="$with_arch32flags"
                                        fi
-                               else
-                                       ARCHFLAGS="$with_archflags"
                                fi
                        fi
                        ;;
@@ -255,8 +246,6 @@ if test -n "$GCC"; then
                                        else
                                                ARCHFLAGS="$with_arch64flags"
                                        fi
-                               else
-                                       ARCHFLAGS="$with_archflags"
                                fi
                        fi
 
@@ -279,8 +268,6 @@ if test -n "$GCC"; then
                                        else
                                                ARCHFLAGS="$with_arch32flags"
                                        fi
-                               else
-                                       ARCHFLAGS="$with_archflags"
                                fi
                        fi
                        ;;
@@ -313,8 +300,6 @@ else
                        if test -z "$with_archflags"; then
                                # Build portable binaries for all HP systems...
                                ARCHFLAGS="+DAportable"
-                       else
-                               ARCHFLAGS="$with_archflags"
                        fi
 
                        if test $PICFLAG = 1; then
@@ -353,8 +338,6 @@ else
                                        else
                                                ARCHFLAGS="$with_arch64flags"
                                        fi
-                               else
-                                       ARCHFLAGS="$with_archflags"
                                fi
                        fi
 
@@ -377,8 +360,6 @@ else
                                        else
                                                ARCHFLAGS="$with_arch32flags"
                                        fi
-                               else
-                                       ARCHFLAGS="$with_archflags"
                                fi
                        fi
                        ;;
@@ -386,7 +367,7 @@ else
                        # Solaris
                        if test -z "$OPTIM"; then
                                if test "x$with_optim" = x; then
-                                       OPTIM="-xO4"
+                                       OPTIM="-xO2"
                                else
                                        OPTIM="$with_optim $OPTIM"
                                fi
@@ -419,8 +400,6 @@ else
                                        else
                                                ARCHFLAGS="$with_arch64flags"
                                        fi
-                               else
-                                       ARCHFLAGS="$with_archflags"
                                fi
                        else
                                if test "x$enable_64bit" = xyes; then
@@ -446,8 +425,6 @@ else
                                        else
                                                ARCHFLAGS="$with_arch32flags"
                                        fi
-                               else
-                                       ARCHFLAGS="$with_archflags"
                                fi
                        fi
                        ;;
index 4c6425af57527d5eb73b673d8b3b85642cb876cd..c23cf3947fca492408bdb9010f8bf2eb13648680 100644 (file)
@@ -30,7 +30,7 @@ AC_ARG_WITH(languages, [  --with-languages        set installed languages, defau
 AC_SUBST(LANGUAGES)
 
 dnl Default ConfigFilePerm
-AC_ARG_WITH(config_perm, [  --with-config-file-perm set default ConfigFilePerm value, default=0640],
+AC_ARG_WITH(config_file_perm, [  --with-config-file-perm set default ConfigFilePerm value, default=0640],
        CUPS_CONFIG_FILE_PERM="$withval",
        if test "x$uname" = xDarwin; then
                CUPS_CONFIG_FILE_PERM="644"
@@ -41,7 +41,7 @@ AC_SUBST(CUPS_CONFIG_FILE_PERM)
 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_CONFIG_FILE_PERM, 0$CUPS_CONFIG_FILE_PERM)
 
 dnl Default LogFilePerm
-AC_ARG_WITH(log_perm, [  --with-log-file-perm    set default LogFilePerm value, default=0644],
+AC_ARG_WITH(log_file_perm, [  --with-log-file-perm    set default LogFilePerm value, default=0644],
        CUPS_LOG_FILE_PERM="$withval",
        CUPS_LOG_FILE_PERM="644")
 AC_SUBST(CUPS_LOG_FILE_PERM)
@@ -59,7 +59,7 @@ fi
 AC_SUBST(CUPS_BROWSING)
 
 dnl Default BrowseLocalProtocols
-AC_ARG_WITH(browse_local, [  --with-local-protocols  set default BrowseLocalProtocols, default="CUPS"],
+AC_ARG_WITH(local_protocols, [  --with-local-protocols  set default BrowseLocalProtocols, default="CUPS"],
        CUPS_BROWSE_LOCAL_PROTOCOLS="$withval",
        CUPS_BROWSE_LOCAL_PROTOCOLS="CUPS")
 AC_SUBST(CUPS_BROWSE_LOCAL_PROTOCOLS)
@@ -67,7 +67,7 @@ AC_DEFINE_UNQUOTED(CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS,
        "$CUPS_BROWSE_LOCAL_PROTOCOLS")
 
 dnl Default BrowseRemoteProtocols
-AC_ARG_WITH(browse_remote, [  --with-remote-protocols set default BrowseRemoteProtocols, default="CUPS"],
+AC_ARG_WITH(remote_protocols, [  --with-remote-protocols set default BrowseRemoteProtocols, default="CUPS"],
        CUPS_BROWSE_REMOTE_PROTOCOLS="$withval",
        CUPS_BROWSE_REMOTE_PROTOCOLS="CUPS")
 AC_SUBST(CUPS_BROWSE_REMOTE_PROTOCOLS)
@@ -130,7 +130,7 @@ fi
 AC_SUBST(CUPS_USE_NETWORK_DEFAULT)
 
 dnl Determine the correct username and group for this OS...
-AC_ARG_WITH(cups-user, [  --with-cups-user        set default user for CUPS],
+AC_ARG_WITH(cups_user, [  --with-cups-user        set default user for CUPS],
        CUPS_USER="$withval",
        AC_MSG_CHECKING(for default print user)
        if test -f /etc/passwd; then
@@ -152,7 +152,7 @@ AC_ARG_WITH(cups-user, [  --with-cups-user        set default user for CUPS],
                AC_MSG_RESULT(no password file, using "$CUPS_USER")
        fi)
 
-AC_ARG_WITH(cups-group, [  --with-cups-group       set default group for CUPS],
+AC_ARG_WITH(cups_group, [  --with-cups-group       set default group for CUPS],
        CUPS_GROUP="$withval",
        AC_MSG_CHECKING(for default print group)
        if test -f /etc/group; then
@@ -175,7 +175,7 @@ AC_ARG_WITH(cups-group, [  --with-cups-group       set default group for CUPS],
                AC_MSG_RESULT(no group file, using "$CUPS_GROUP")
        fi)
 
-AC_ARG_WITH(system-groups, [  --with-system-groups    set default system groups for CUPS],
+AC_ARG_WITH(system_groups, [  --with-system-groups    set default system groups for CUPS],
        CUPS_SYSTEM_GROUPS="$withval",
        if test x$uname = xDarwin; then
                GROUP_LIST="admin"
@@ -221,13 +221,25 @@ AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SYSTEM_GROUPS, "$CUPS_SYSTEM_GROUPS")
 dnl Default printcap file...
 AC_ARG_WITH(printcap, [  --with-printcap         set default printcap file],
        default_printcap="$withval",
-       default_printcap="/etc/printcap")
+       default_printcap="default")
 
 if test x$enable_printcap != xno -a x$default_printcap != xno; then
-       if test "x$default_printcap" = "x/etc/printcap" -a "$uname" = "Darwin" -a $uversion -ge 90; then
-               CUPS_DEFAULT_PRINTCAP=""
-       else
-               CUPS_DEFAULT_PRINTCAP="$default_printcap"
+       if test "x$default_printcap" = "xdefault"; then
+               case $uname in
+                       Darwin*)
+                               if test $uversion -ge 90; then
+                                       CUPS_DEFAULT_PRINTCAP=""
+                               else
+                                       CUPS_DEFAULT_PRINTCAP="/etc/printcap"
+                               fi
+                               ;;
+                       SunOS*)
+                               CUPS_DEFAULT_PRINTCAP="/etc/printers.conf"
+                               ;;
+                       *)
+                               CUPS_DEFAULT_PRINTCAP="/etc/printcap"
+                               ;;
+               esac
        fi
 else
        CUPS_DEFAULT_PRINTCAP=""
index 64a55f98afcd1c1a63b515f368157e3807fab757..d2cc19a2a118b751fb2682f564436772ff103ff0 100644 (file)
@@ -38,10 +38,6 @@ fi
 
 AC_SUBST(IMGFILTERS)
 
-dnl Save the current libraries since we don't want the image libraries
-dnl included with every program...
-SAVELIBS="$LIBS"
-
 dnl Check for image libraries...
 AC_ARG_ENABLE(jpeg, [  --enable-jpeg           turn on JPEG support, default=yes])
 AC_ARG_ENABLE(png, [  --enable-png            turn on PNG support, default=yes])
@@ -57,6 +53,14 @@ AC_SUBST(LIBPNG)
 AC_SUBST(LIBTIFF)
 AC_SUBST(LIBZ)
 
+dnl Image libraries use math library functions...
+AC_SEARCH_LIBS(pow, m)
+
+dnl Save the current libraries since we don't want the image libraries
+dnl included with every program...
+SAVELIBS="$LIBS"
+
+dnl JPEG library...
 if test x$enable_jpeg != xno; then
     AC_CHECK_HEADER(jpeglib.h,
        AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
@@ -67,24 +71,24 @@ else
     AC_MSG_NOTICE([JPEG support disabled with --disable-jpeg.])
 fi
 
+dnl ZLIB library...
 AC_CHECK_HEADER(zlib.h,
     AC_CHECK_LIB(z, gzgets,
        AC_DEFINE(HAVE_LIBZ)
        LIBZ="-lz"
        LIBS="$LIBS -lz"))
 
-dnl PNG library uses math library functions...
-AC_CHECK_LIB(m, pow)
-
+dnl PNG library...
 if test x$enable_png != xno; then
     AC_CHECK_HEADER(png.h,
        AC_CHECK_LIB(png, png_create_read_struct,
            AC_DEFINE(HAVE_LIBPNG)
-           LIBPNG="-lpng -lm"))
+           LIBPNG="-lpng"))
 else
     AC_MSG_NOTICE([PNG support disabled with --disable-png.])
 fi
 
+dnl TIFF library...
 if test x$enable_tiff != xno; then
     AC_CHECK_HEADER(tiff.h,
        AC_CHECK_LIB(tiff, TIFFReadScanline,
index 8aa54d74ff3962df84fbe6936790ab727ba8ad68..556e1e2fc417118158cc0998680e672b1d1667f1 100644 (file)
@@ -117,7 +117,7 @@ if test "$DSO" != ":"; then
        # rather than to the executables.  This makes things smaller if you
        # are using any static libraries, and it also allows us to distribute
        # a single DSO rather than a bunch...
-       DSOLIBS="\$(LIBPNG) \$(LIBTIFF) \$(LIBJPEG) \$(LIBZ)"
+       DSOLIBS="\$(LIBTIFF) \$(LIBPNG) \$(LIBJPEG) \$(LIBZ)"
        IMGLIBS=""
 
        # Tell the run-time linkers where to find a DSO.  Some platforms
@@ -126,46 +126,46 @@ 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"
-                       LDFLAGS="$LDFLAGS -Wl,+s,+b,\$(libdir)"
-                       EXPORT_LDFLAGS="-Wl,+s,+b,\$(libdir)"
+                       DSOFLAGS="+s +b $libdir $DSOFLAGS"
+                       DSO32FLAGS="+s +b $LIB32DIR $DSO32FLAGS"
+                       DSO64FLAGS="+s +b $LIB64DIR $DSO64FLAGS"
+                       LDFLAGS="$LDFLAGS -Wl,+s,+b,$libdir"
+                       EXPORT_LDFLAGS="-Wl,+s,+b,$libdir"
                        ;;
                 SunOS*)
                        # Solaris...
                        if test $exec_prefix != /usr; then
-                               DSOFLAGS="-R\$(libdir) $DSOFLAGS"
-                               DSO32FLAGS="-R\$(LIB32DIR) $DSO32FLAGS"
-                               DSO64FLAGS="-R\$(LIB64DIR) $DSO64FLAGS"
-                               LDFLAGS="$LDFLAGS -R\$(libdir)"
-                               EXPORT_LDFLAGS="-R\$(libdir)"
+                               DSOFLAGS="-R$libdir $DSOFLAGS"
+                               DSO32FLAGS="-R$LIB32DIR $DSO32FLAGS"
+                               DSO64FLAGS="-R$LIB64DIR $DSO64FLAGS"
+                               LDFLAGS="$LDFLAGS -R$libdir"
+                               EXPORT_LDFLAGS="-R$libdir"
                        fi
                        ;;
                 *BSD*)
                         # *BSD...
                        if test $exec_prefix != /usr; then
-                               DSOFLAGS="-Wl,-R\$(libdir) $DSOFLAGS"
-                               DSO32FLAGS="-Wl,-R\$(LIB32DIR) $DSO32FLAGS"
-                               DSO64FLAGS="-Wl,-R\$(LIB64DIR) $DSO64FLAGS"
-                               LDFLAGS="$LDFLAGS -Wl,-R\$(libdir)"
-                               EXPORT_LDFLAGS="-Wl,-R\$(libdir)"
+                               DSOFLAGS="-Wl,-R$libdir $DSOFLAGS"
+                               DSO32FLAGS="-Wl,-R$LIB32DIR $DSO32FLAGS"
+                               DSO64FLAGS="-Wl,-R$LIB64DIR $DSO64FLAGS"
+                               LDFLAGS="$LDFLAGS -Wl,-R$libdir"
+                               EXPORT_LDFLAGS="-Wl,-R$libdir"
                        fi
                        ;;
                 IRIX | Linux | GNU)
                         # IRIX, Linux, and HURD...
                        if test $exec_prefix != /usr; then
-                               DSOFLAGS="-Wl,-rpath,\$(libdir) $DSOFLAGS"
-                               DSO32FLAGS="-Wl,-rpath,\$(LIB32DIR) $DSO32FLAGS"
-                               DSO64FLAGS="-Wl,-rpath,\$(LIB64DIR) $DSO64FLAGS"
-                               LDFLAGS="$LDFLAGS -Wl,-rpath,\$(libdir)"
-                               EXPORT_LDFLAGS="-Wl,-rpath,\$(libdir)"
+                               DSOFLAGS="-Wl,-rpath,$libdir $DSOFLAGS"
+                               DSO32FLAGS="-Wl,-rpath,$LIB32DIR $DSO32FLAGS"
+                               DSO64FLAGS="-Wl,-rpath,$LIB64DIR $DSO64FLAGS"
+                               LDFLAGS="$LDFLAGS -Wl,-rpath,$libdir"
+                               EXPORT_LDFLAGS="-Wl,-rpath,$libdir"
                        fi
                        ;;
        esac
 else
        DSOLIBS=""
-       IMGLIBS="\$(LIBPNG) \$(LIBTIFF) \$(LIBJPEG) \$(LIBZ)"
+       IMGLIBS="\$(LIBTIFF) \$(LIBPNG) \$(LIBJPEG) \$(LIBZ)"
 fi
 
 AC_SUBST(DSOLIBS)
index 156c7252928c987433621a8aee78aad7a3053c94..294f2cd97b2f970c50ecf20b5451f6d28aa8aaa1 100644 (file)
@@ -48,6 +48,7 @@ if test x$enable_ssl != xno; then
                 # certificates for CUPS, so don't enable encryption on
                 # /admin just yet...
                 #ENCRYPTION_REQUIRED="  Encryption Required"
+                AC_CHECK_HEADER(Security/SecBasePriv.h,AC_DEFINE(HAVE_SECBASEPRIV_H))
                 AC_DEFINE(HAVE_SSL)
                 AC_DEFINE(HAVE_CDSASSL)])
        fi
index 4bc36199552084aa9bf1d0d24e23c94b12f3072a..60b3beab9d61e6031fe8763d2ed2d2bf1b28461a 100644 (file)
 #undef HAVE_SSL
 
 
+/*
+ * Do we have <Security/SecBasePriv.h>?
+ */
+
+#undef HAVE_SECBASEPRIV_H
+
+
 /*
  * Do we have the SLP library?
  */
index 9969eb6172a0da1f1e095643e2f7f602092cb67d..2b406cfabc12b4ca2f38736b628e02f3da276873 100644 (file)
@@ -47,8 +47,12 @@ sinclude(config-scripts/cups-pap.m4)
 sinclude(config-scripts/cups-pdf.m4)
 sinclude(config-scripts/cups-scripting.m4)
 
+INSTALL_LANGUAGES=""
+UNINSTALL_LANGUAGES=""
 LANGFILES=""
 if test "x$LANGUAGES" != x; then
+       INSTALL_LANGUAGES="install-languages"
+       UNINSTALL_LANGUAGES="uninstall-languages"
        for lang in $LANGUAGES; do
                LANGFILES="$LANGFILES doc/$lang/index.html"
                LANGFILES="$LANGFILES templates/$lang/edit-config.tmpl"
@@ -56,6 +60,9 @@ if test "x$LANGUAGES" != x; then
        done
 fi
 
+AC_SUBST(INSTALL_LANGUAGES)
+AC_SUBST(UNINSTALL_LANGUAGES)
+
 AC_OUTPUT(Makedefs packaging/cups.list init/cups.sh init/cups-lpd cups-config
          conf/cupsd.conf conf/pam.std doc/index.html
          doc/help/standard.html man/client.conf.man
index 33fe5c41d2656cbc26a9ae7215e4053b2ea5e58d..0f6d5041b61ba3c2cb2cc6f782eab2b1b248c92f 100755 (executable)
@@ -24,7 +24,7 @@
 #
 
 VERSION="@CUPS_VERSION@"
-APIVERSION="1.2"
+APIVERSION="1.3"
 
 prefix=@prefix@
 exec_prefix=@exec_prefix@
@@ -53,7 +53,7 @@ if test -f "$selfdir/cups/cups.h"; then
     LDFLAGS="-L$selfdir/cups -L$selfdir/filter $LDFLAGS"
     libdir="$selfdir/cups"
     imagelibdir="$selfdir/filter"
-    if test ! -e "$selfdir/cups/raster.h"; then
+    if test ! -f "$selfdir/cups/raster.h"; then
         ln -s ../filter/raster.h "$selfdir/cups"
     fi
 else
index 4cb7cb37f69b902b686abf99afae70955a6ed909..012ef0b3b9c59a9774584c48b42dcb002e2577eb 100644 (file)
@@ -1,18 +1,21 @@
 # DO NOT DELETE
 
 adminutil.o: adminutil.h cups.h ipp.h http.h md5.h ppd.h array.h file.h
-adminutil.o: language.h globals.h string.h ../config.h i18n.h transcode.h
-adminutil.o: debug.h
+adminutil.o: language.h globals.h string.h ../config.h http-private.h
+adminutil.o: ipp-private.h i18n.h transcode.h debug.h
 array.o: array.h string.h ../config.h debug.h
 attr.o: ppd.h array.h file.h debug.h string.h ../config.h
-auth.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-auth.o: array.h file.h language.h i18n.h transcode.h debug.h
+auth.o: globals.h string.h ../config.h http-private.h http.h md5.h
+auth.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+auth.o: transcode.h debug.h
 backchannel.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
 backend.o: backend.h string.h ../config.h
-custom.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-custom.o: array.h file.h language.h i18n.h transcode.h debug.h
-dest.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-dest.o: array.h file.h language.h i18n.h transcode.h
+custom.o: globals.h string.h ../config.h http-private.h http.h md5.h
+custom.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+custom.o: transcode.h debug.h
+dest.o: globals.h string.h ../config.h http-private.h http.h md5.h
+dest.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+dest.o: transcode.h
 dir.o: dir.h string.h ../config.h debug.h
 emit.o: ppd.h array.h file.h string.h ../config.h
 encode.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
@@ -21,56 +24,68 @@ file.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
 file.o: string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
 file.o: debug.h
 getifaddrs.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
-getputfile.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
-getputfile.o: string.h ../config.h debug.h
+getputfile.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
+getputfile.o: cups.h ppd.h array.h file.h language.h string.h debug.h
 globals.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
 globals.o: globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
 globals.o: transcode.h debug.h
 http.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
 http.o: string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
 http.o: debug.h
-http-addr.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-http-addr.o: array.h file.h language.h i18n.h transcode.h debug.h
+http-addr.o: globals.h string.h ../config.h http-private.h http.h md5.h
+http-addr.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
+http-addr.o: i18n.h transcode.h debug.h
 http-addrlist.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
 http-addrlist.o: globals.h string.h cups.h ppd.h array.h file.h language.h
 http-addrlist.o: i18n.h transcode.h debug.h
-http-support.o: debug.h globals.h string.h ../config.h cups.h ipp.h http.h
-http-support.o: md5.h ppd.h array.h file.h language.h i18n.h transcode.h
+http-support.o: debug.h globals.h string.h ../config.h http-private.h http.h
+http-support.o: md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h
+http-support.o: language.h i18n.h transcode.h
 ipp.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
 ipp.o: string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
 ipp.o: debug.h
-ipp-support.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-ipp-support.o: array.h file.h language.h i18n.h transcode.h debug.h
-langprintf.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-langprintf.o: array.h file.h language.h i18n.h transcode.h
-language.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-language.o: array.h file.h language.h i18n.h transcode.h debug.h
-localize.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-localize.o: array.h file.h language.h i18n.h transcode.h debug.h
+ipp-support.o: globals.h string.h ../config.h http-private.h http.h md5.h
+ipp-support.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
+ipp-support.o: i18n.h transcode.h debug.h
+langprintf.o: globals.h string.h ../config.h http-private.h http.h md5.h
+langprintf.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
+langprintf.o: i18n.h transcode.h
+language.o: globals.h string.h ../config.h http-private.h http.h md5.h
+language.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+language.o: transcode.h debug.h
+localize.o: globals.h string.h ../config.h http-private.h http.h md5.h
+localize.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+localize.o: transcode.h debug.h
 mark.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h string.h
 mark.o: ../config.h debug.h
 md5.o: md5.h string.h ../config.h
 md5passwd.o: http.h md5.h string.h ../config.h
-notify.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-notify.o: array.h file.h language.h i18n.h transcode.h
+notify.o: globals.h string.h ../config.h http-private.h http.h md5.h
+notify.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+notify.o: transcode.h
 options.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h string.h
 options.o: ../config.h debug.h
 page.o: ppd.h array.h file.h string.h ../config.h
-ppd.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h array.h
-ppd.o: file.h language.h i18n.h transcode.h debug.h
-request.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-request.o: array.h file.h language.h i18n.h transcode.h debug.h
+ppd.o: globals.h string.h ../config.h http-private.h http.h md5.h
+ppd.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+ppd.o: transcode.h debug.h
+request.o: globals.h string.h ../config.h http-private.h http.h md5.h
+request.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+request.o: transcode.h debug.h
 snprintf.o: string.h ../config.h
 string.o: array.h debug.h string.h ../config.h
-tempfile.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-tempfile.o: array.h file.h language.h i18n.h transcode.h debug.h
-transcode.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-transcode.o: array.h file.h language.h i18n.h transcode.h debug.h
+tempfile.o: globals.h string.h ../config.h http-private.h http.h md5.h
+tempfile.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+tempfile.o: transcode.h debug.h
+transcode.o: globals.h string.h ../config.h http-private.h http.h md5.h
+transcode.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
+transcode.o: i18n.h transcode.h debug.h
 usersys.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
 usersys.o: globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
 usersys.o: transcode.h
-util.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-util.o: array.h file.h language.h i18n.h transcode.h debug.h
+util.o: globals.h string.h ../config.h http-private.h http.h md5.h
+util.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+util.o: transcode.h debug.h
 testadmin.o: adminutil.h cups.h ipp.h http.h md5.h ppd.h array.h file.h
 testadmin.o: language.h string.h ../config.h
 testarray.o: ../cups/string.h ../config.h string.h array.h dir.h debug.h
@@ -83,18 +98,21 @@ testppd.o: ../cups/string.h ../config.h string.h ppd.h array.h file.h
 # DO NOT DELETE
 
 adminutil.32.o: adminutil.c  adminutil.h cups.h ipp.h http.h md5.h ppd.h array.h file.h
-adminutil.32.o: adminutil.c  language.h globals.h string.h ../config.h i18n.h transcode.h
-adminutil.32.o: adminutil.c  debug.h
+adminutil.32.o: adminutil.c  language.h globals.h string.h ../config.h http-private.h
+adminutil.32.o: adminutil.c  ipp-private.h i18n.h transcode.h debug.h
 array.32.o: array.c  array.h string.h ../config.h debug.h
 attr.32.o: attr.c  ppd.h array.h file.h debug.h string.h ../config.h
-auth.32.o: auth.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-auth.32.o: auth.c  array.h file.h language.h i18n.h transcode.h debug.h
+auth.32.o: auth.c  globals.h string.h ../config.h http-private.h http.h md5.h
+auth.32.o: auth.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+auth.32.o: auth.c  transcode.h debug.h
 backchannel.32.o: backchannel.c  cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
 backend.32.o: backend.c  backend.h string.h ../config.h
-custom.32.o: custom.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-custom.32.o: custom.c  array.h file.h language.h i18n.h transcode.h debug.h
-dest.32.o: dest.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-dest.32.o: dest.c  array.h file.h language.h i18n.h transcode.h
+custom.32.o: custom.c  globals.h string.h ../config.h http-private.h http.h md5.h
+custom.32.o: custom.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+custom.32.o: custom.c  transcode.h debug.h
+dest.32.o: dest.c  globals.h string.h ../config.h http-private.h http.h md5.h
+dest.32.o: dest.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+dest.32.o: dest.c  transcode.h
 dir.32.o: dir.c  dir.h string.h ../config.h debug.h
 emit.32.o: emit.c  ppd.h array.h file.h string.h ../config.h
 encode.32.o: encode.c  cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
@@ -103,56 +121,68 @@ file.32.o: file.c  http-private.h ../config.h http.h md5.h ipp-private.h ipp.h g
 file.32.o: file.c  string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
 file.32.o: file.c  debug.h
 getifaddrs.32.o: getifaddrs.c  http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
-getputfile.32.o: getputfile.c  cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
-getputfile.32.o: getputfile.c  string.h ../config.h debug.h
+getputfile.32.o: getputfile.c  http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
+getputfile.32.o: getputfile.c  cups.h ppd.h array.h file.h language.h string.h debug.h
 globals.32.o: globals.c  http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
 globals.32.o: globals.c  globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
 globals.32.o: globals.c  transcode.h debug.h
 http.32.o: http.c  http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
 http.32.o: http.c  string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
 http.32.o: http.c  debug.h
-http-addr.32.o: http-addr.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-http-addr.32.o: http-addr.c  array.h file.h language.h i18n.h transcode.h debug.h
+http-addr.32.o: http-addr.c  globals.h string.h ../config.h http-private.h http.h md5.h
+http-addr.32.o: http-addr.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
+http-addr.32.o: http-addr.c  i18n.h transcode.h debug.h
 http-addrlist.32.o: http-addrlist.c  http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
 http-addrlist.32.o: http-addrlist.c  globals.h string.h cups.h ppd.h array.h file.h language.h
 http-addrlist.32.o: http-addrlist.c  i18n.h transcode.h debug.h
-http-support.32.o: http-support.c  debug.h globals.h string.h ../config.h cups.h ipp.h http.h
-http-support.32.o: http-support.c  md5.h ppd.h array.h file.h language.h i18n.h transcode.h
+http-support.32.o: http-support.c  debug.h globals.h string.h ../config.h http-private.h http.h
+http-support.32.o: http-support.c  md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h
+http-support.32.o: http-support.c  language.h i18n.h transcode.h
 ipp.32.o: ipp.c  http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
 ipp.32.o: ipp.c  string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
 ipp.32.o: ipp.c  debug.h
-ipp-support.32.o: ipp-support.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-ipp-support.32.o: ipp-support.c  array.h file.h language.h i18n.h transcode.h debug.h
-langprintf.32.o: langprintf.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-langprintf.32.o: langprintf.c  array.h file.h language.h i18n.h transcode.h
-language.32.o: language.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-language.32.o: language.c  array.h file.h language.h i18n.h transcode.h debug.h
-localize.32.o: localize.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-localize.32.o: localize.c  array.h file.h language.h i18n.h transcode.h debug.h
+ipp-support.32.o: ipp-support.c  globals.h string.h ../config.h http-private.h http.h md5.h
+ipp-support.32.o: ipp-support.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
+ipp-support.32.o: ipp-support.c  i18n.h transcode.h debug.h
+langprintf.32.o: langprintf.c  globals.h string.h ../config.h http-private.h http.h md5.h
+langprintf.32.o: langprintf.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
+langprintf.32.o: langprintf.c  i18n.h transcode.h
+language.32.o: language.c  globals.h string.h ../config.h http-private.h http.h md5.h
+language.32.o: language.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+language.32.o: language.c  transcode.h debug.h
+localize.32.o: localize.c  globals.h string.h ../config.h http-private.h http.h md5.h
+localize.32.o: localize.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+localize.32.o: localize.c  transcode.h debug.h
 mark.32.o: mark.c  cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h string.h
 mark.32.o: mark.c  ../config.h debug.h
 md5.32.o: md5.c  md5.h string.h ../config.h
 md5passwd.32.o: md5passwd.c  http.h md5.h string.h ../config.h
-notify.32.o: notify.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-notify.32.o: notify.c  array.h file.h language.h i18n.h transcode.h
+notify.32.o: notify.c  globals.h string.h ../config.h http-private.h http.h md5.h
+notify.32.o: notify.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+notify.32.o: notify.c  transcode.h
 options.32.o: options.c  cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h string.h
 options.32.o: options.c  ../config.h debug.h
 page.32.o: page.c  ppd.h array.h file.h string.h ../config.h
-ppd.32.o: ppd.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h array.h
-ppd.32.o: ppd.c  file.h language.h i18n.h transcode.h debug.h
-request.32.o: request.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-request.32.o: request.c  array.h file.h language.h i18n.h transcode.h debug.h
+ppd.32.o: ppd.c  globals.h string.h ../config.h http-private.h http.h md5.h
+ppd.32.o: ppd.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+ppd.32.o: ppd.c  transcode.h debug.h
+request.32.o: request.c  globals.h string.h ../config.h http-private.h http.h md5.h
+request.32.o: request.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+request.32.o: request.c  transcode.h debug.h
 snprintf.32.o: snprintf.c  string.h ../config.h
 string.32.o: string.c  array.h debug.h string.h ../config.h
-tempfile.32.o: tempfile.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-tempfile.32.o: tempfile.c  array.h file.h language.h i18n.h transcode.h debug.h
-transcode.32.o: transcode.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-transcode.32.o: transcode.c  array.h file.h language.h i18n.h transcode.h debug.h
+tempfile.32.o: tempfile.c  globals.h string.h ../config.h http-private.h http.h md5.h
+tempfile.32.o: tempfile.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+tempfile.32.o: tempfile.c  transcode.h debug.h
+transcode.32.o: transcode.c  globals.h string.h ../config.h http-private.h http.h md5.h
+transcode.32.o: transcode.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
+transcode.32.o: transcode.c  i18n.h transcode.h debug.h
 usersys.32.o: usersys.c  http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
 usersys.32.o: usersys.c  globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
 usersys.32.o: usersys.c  transcode.h
-util.32.o: util.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-util.32.o: util.c  array.h file.h language.h i18n.h transcode.h debug.h
+util.32.o: util.c  globals.h string.h ../config.h http-private.h http.h md5.h
+util.32.o: util.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+util.32.o: util.c  transcode.h debug.h
 testadmin.32.o: testadmin.c  adminutil.h cups.h ipp.h http.h md5.h ppd.h array.h file.h
 testadmin.32.o: testadmin.c  language.h string.h ../config.h
 testarray.32.o: testarray.c  ../cups/string.h ../config.h string.h array.h dir.h debug.h
@@ -165,18 +195,21 @@ testppd.32.o: testppd.c  ../cups/string.h ../config.h string.h ppd.h array.h fil
 # DO NOT DELETE
 
 adminutil.64.o: adminutil.c  adminutil.h cups.h ipp.h http.h md5.h ppd.h array.h file.h
-adminutil.64.o: adminutil.c  language.h globals.h string.h ../config.h i18n.h transcode.h
-adminutil.64.o: adminutil.c  debug.h
+adminutil.64.o: adminutil.c  language.h globals.h string.h ../config.h http-private.h
+adminutil.64.o: adminutil.c  ipp-private.h i18n.h transcode.h debug.h
 array.64.o: array.c  array.h string.h ../config.h debug.h
 attr.64.o: attr.c  ppd.h array.h file.h debug.h string.h ../config.h
-auth.64.o: auth.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-auth.64.o: auth.c  array.h file.h language.h i18n.h transcode.h debug.h
+auth.64.o: auth.c  globals.h string.h ../config.h http-private.h http.h md5.h
+auth.64.o: auth.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+auth.64.o: auth.c  transcode.h debug.h
 backchannel.64.o: backchannel.c  cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
 backend.64.o: backend.c  backend.h string.h ../config.h
-custom.64.o: custom.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-custom.64.o: custom.c  array.h file.h language.h i18n.h transcode.h debug.h
-dest.64.o: dest.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-dest.64.o: dest.c  array.h file.h language.h i18n.h transcode.h
+custom.64.o: custom.c  globals.h string.h ../config.h http-private.h http.h md5.h
+custom.64.o: custom.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+custom.64.o: custom.c  transcode.h debug.h
+dest.64.o: dest.c  globals.h string.h ../config.h http-private.h http.h md5.h
+dest.64.o: dest.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+dest.64.o: dest.c  transcode.h
 dir.64.o: dir.c  dir.h string.h ../config.h debug.h
 emit.64.o: emit.c  ppd.h array.h file.h string.h ../config.h
 encode.64.o: encode.c  cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
@@ -185,56 +218,68 @@ file.64.o: file.c  http-private.h ../config.h http.h md5.h ipp-private.h ipp.h g
 file.64.o: file.c  string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
 file.64.o: file.c  debug.h
 getifaddrs.64.o: getifaddrs.c  http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
-getputfile.64.o: getputfile.c  cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h
-getputfile.64.o: getputfile.c  string.h ../config.h debug.h
+getputfile.64.o: getputfile.c  http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
+getputfile.64.o: getputfile.c  cups.h ppd.h array.h file.h language.h string.h debug.h
 globals.64.o: globals.c  http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
 globals.64.o: globals.c  globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
 globals.64.o: globals.c  transcode.h debug.h
 http.64.o: http.c  http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
 http.64.o: http.c  string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
 http.64.o: http.c  debug.h
-http-addr.64.o: http-addr.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-http-addr.64.o: http-addr.c  array.h file.h language.h i18n.h transcode.h debug.h
+http-addr.64.o: http-addr.c  globals.h string.h ../config.h http-private.h http.h md5.h
+http-addr.64.o: http-addr.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
+http-addr.64.o: http-addr.c  i18n.h transcode.h debug.h
 http-addrlist.64.o: http-addrlist.c  http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
 http-addrlist.64.o: http-addrlist.c  globals.h string.h cups.h ppd.h array.h file.h language.h
 http-addrlist.64.o: http-addrlist.c  i18n.h transcode.h debug.h
-http-support.64.o: http-support.c  debug.h globals.h string.h ../config.h cups.h ipp.h http.h
-http-support.64.o: http-support.c  md5.h ppd.h array.h file.h language.h i18n.h transcode.h
+http-support.64.o: http-support.c  debug.h globals.h string.h ../config.h http-private.h http.h
+http-support.64.o: http-support.c  md5.h ipp-private.h ipp.h cups.h ppd.h array.h file.h
+http-support.64.o: http-support.c  language.h i18n.h transcode.h
 ipp.64.o: ipp.c  http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h
 ipp.64.o: ipp.c  string.h cups.h ppd.h array.h file.h language.h i18n.h transcode.h
 ipp.64.o: ipp.c  debug.h
-ipp-support.64.o: ipp-support.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-ipp-support.64.o: ipp-support.c  array.h file.h language.h i18n.h transcode.h debug.h
-langprintf.64.o: langprintf.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-langprintf.64.o: langprintf.c  array.h file.h language.h i18n.h transcode.h
-language.64.o: language.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-language.64.o: language.c  array.h file.h language.h i18n.h transcode.h debug.h
-localize.64.o: localize.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-localize.64.o: localize.c  array.h file.h language.h i18n.h transcode.h debug.h
+ipp-support.64.o: ipp-support.c  globals.h string.h ../config.h http-private.h http.h md5.h
+ipp-support.64.o: ipp-support.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
+ipp-support.64.o: ipp-support.c  i18n.h transcode.h debug.h
+langprintf.64.o: langprintf.c  globals.h string.h ../config.h http-private.h http.h md5.h
+langprintf.64.o: langprintf.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
+langprintf.64.o: langprintf.c  i18n.h transcode.h
+language.64.o: language.c  globals.h string.h ../config.h http-private.h http.h md5.h
+language.64.o: language.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+language.64.o: language.c  transcode.h debug.h
+localize.64.o: localize.c  globals.h string.h ../config.h http-private.h http.h md5.h
+localize.64.o: localize.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+localize.64.o: localize.c  transcode.h debug.h
 mark.64.o: mark.c  cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h string.h
 mark.64.o: mark.c  ../config.h debug.h
 md5.64.o: md5.c  md5.h string.h ../config.h
 md5passwd.64.o: md5passwd.c  http.h md5.h string.h ../config.h
-notify.64.o: notify.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-notify.64.o: notify.c  array.h file.h language.h i18n.h transcode.h
+notify.64.o: notify.c  globals.h string.h ../config.h http-private.h http.h md5.h
+notify.64.o: notify.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+notify.64.o: notify.c  transcode.h
 options.64.o: options.c  cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h string.h
 options.64.o: options.c  ../config.h debug.h
 page.64.o: page.c  ppd.h array.h file.h string.h ../config.h
-ppd.64.o: ppd.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h array.h
-ppd.64.o: ppd.c  file.h language.h i18n.h transcode.h debug.h
-request.64.o: request.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-request.64.o: request.c  array.h file.h language.h i18n.h transcode.h debug.h
+ppd.64.o: ppd.c  globals.h string.h ../config.h http-private.h http.h md5.h
+ppd.64.o: ppd.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+ppd.64.o: ppd.c  transcode.h debug.h
+request.64.o: request.c  globals.h string.h ../config.h http-private.h http.h md5.h
+request.64.o: request.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+request.64.o: request.c  transcode.h debug.h
 snprintf.64.o: snprintf.c  string.h ../config.h
 string.64.o: string.c  array.h debug.h string.h ../config.h
-tempfile.64.o: tempfile.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-tempfile.64.o: tempfile.c  array.h file.h language.h i18n.h transcode.h debug.h
-transcode.64.o: transcode.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-transcode.64.o: transcode.c  array.h file.h language.h i18n.h transcode.h debug.h
+tempfile.64.o: tempfile.c  globals.h string.h ../config.h http-private.h http.h md5.h
+tempfile.64.o: tempfile.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+tempfile.64.o: tempfile.c  transcode.h debug.h
+transcode.64.o: transcode.c  globals.h string.h ../config.h http-private.h http.h md5.h
+transcode.64.o: transcode.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
+transcode.64.o: transcode.c  i18n.h transcode.h debug.h
 usersys.64.o: usersys.c  http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
 usersys.64.o: usersys.c  globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
 usersys.64.o: usersys.c  transcode.h
-util.64.o: util.c  globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h
-util.64.o: util.c  array.h file.h language.h i18n.h transcode.h debug.h
+util.64.o: util.c  globals.h string.h ../config.h http-private.h http.h md5.h
+util.64.o: util.c  ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
+util.64.o: util.c  transcode.h debug.h
 testadmin.64.o: testadmin.c  adminutil.h cups.h ipp.h http.h md5.h ppd.h array.h file.h
 testadmin.64.o: testadmin.c  language.h string.h ../config.h
 testarray.64.o: testarray.c  ../cups/string.h ../config.h string.h array.h dir.h debug.h
index b4bd58313de0a1dc2fddfd2ea5b7fcf9cf689eb7..648798688463deb00c6b050978b1a6bf602f648a 100644 (file)
@@ -138,7 +138,7 @@ all:        $(TARGETS)
 clean:
        $(RM) $(OBJS) $(TARGETS)
        $(RM) libcups.so libcups.sl libcups.dylib
-       $(RM) -r 32bit 64it
+       $(RM) -r 32bit 64bit
 
 
 #
@@ -186,12 +186,12 @@ installhdrs:
 install32bit:
        $(INSTALL_DIR) -m 755 $(LIB32DIR)
        $(INSTALL_LIB) 32bit/libcups.so.2 $(LIB32DIR)/libcups.so.2
-       $(LN) libcups.so $(LIB32DIR)/libcups.so.2
+       $(LN) libcups.so.2 $(LIB32DIR)/libcups.so
 
 install64bit:
        $(INSTALL_DIR) -m 755 $(LIB64DIR)
        $(INSTALL_LIB) 64bit/libcups.so.2 $(LIB64DIR)/libcups.so.2
-       $(LN) libcups.so $(LIB64DIR)/libcups.so.2
+       $(LN) libcups.so.2 $(LIB64DIR)/libcups.so
 
 
 #
index 548deafa0af8688b404e3d322dc34a79cbab4485..4702dd63060be3275c5bcfdde9f45fc51f9f6bd0 100644 (file)
@@ -222,18 +222,18 @@ cupsAdminCreateWindowsPPD(
       */
 
       cupsFilePrintf(dstfp, "*%% Commented out for CUPS Windows Driver...\n"
-                            "*%%%s", line + 1);
+                            "*%%%s\n", line + 1);
       continue;
     }
     else if (!strncmp(line, "*JCLOpenUI", 10))
     {
       jcloption = 1;
-      cupsFilePuts(dstfp, line);
+      cupsFilePrintf(dstfp, "%s\n", line);
     }
     else if (!strncmp(line, "*JCLCloseUI", 11))
     {
       jcloption = 0;
-      cupsFilePuts(dstfp, line);
+      cupsFilePrintf(dstfp, "%s\n", line);
     }
     else if (jcloption &&
              strncmp(line, "*End", 4) &&
@@ -312,12 +312,13 @@ cupsAdminCreateWindowsPPD(
       }
 
       snprintf(ptr + 1, sizeof(line) - (ptr - line + 1),
-               "%%cupsJobTicket: %s=%s\n\"\n*End\n", option, choice);
+               "%%cupsJobTicket: %s=%s\n\"\n*End", option, choice);
 
-      cupsFilePrintf(dstfp, "*%% Changed for CUPS Windows Driver...\n%s", line);
+      cupsFilePrintf(dstfp, "*%% Changed for CUPS Windows Driver...\n%s\n",
+                     line);
     }
     else
-      cupsFilePuts(dstfp, line);
+      cupsFilePrintf(dstfp, "%s\n", line);
   }
 
   cupsFileClose(srcfp);
index 3085d5da52fcf47ba4bec900dd91019109b6a81e..f503957a1c6dd1407fbd66e67874cf8e87c6253e 100644 (file)
@@ -61,9 +61,9 @@ extern "C" {
  * Constants...
  */
 
-#  define CUPS_VERSION         1.0200
+#  define CUPS_VERSION         1.0300
 #  define CUPS_VERSION_MAJOR   1
-#  define CUPS_VERSION_MINOR   2
+#  define CUPS_VERSION_MINOR   3
 #  define CUPS_VERSION_PATCH   0
 #  define CUPS_DATE_ANY                -1
 
index f0a4c76812a7e64634469979fb701b7c296af055..47a6e50ddc9700b151dc7fe63fbd1936719a53f4 100644 (file)
@@ -67,6 +67,7 @@ static const _ipp_option_t ipp_options[] =
   { "copies",                  IPP_TAG_INTEGER,        IPP_TAG_JOB },
   { "copies-default",          IPP_TAG_INTEGER,        IPP_TAG_PRINTER },
   { "document-format",         IPP_TAG_MIMETYPE,       IPP_TAG_OPERATION },
+  { "document-format-default", IPP_TAG_MIMETYPE,       IPP_TAG_PRINTER },
   { "finishings",              IPP_TAG_ENUM,           IPP_TAG_JOB },
   { "finishings-default",      IPP_TAG_ENUM,           IPP_TAG_PRINTER },
   { "fitplot",                 IPP_TAG_BOOLEAN,        IPP_TAG_JOB },
@@ -88,6 +89,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-events-default",   IPP_TAG_KEYWORD,        IPP_TAG_PRINTER },
   { "notify-lease-time",       IPP_TAG_INTEGER,        IPP_TAG_SUBSCRIPTION },
   { "notify-natural-language", IPP_TAG_LANGUAGE,       IPP_TAG_SUBSCRIPTION },
   { "notify-pull-method",      IPP_TAG_KEYWORD,        IPP_TAG_SUBSCRIPTION },
index 9e4056746ccb958415715ed7922e44370b2897cb..c2c8d15a33c300a03532976bcda7cb879af2e28e 100644 (file)
@@ -35,8 +35,8 @@
  * Include necessary headers...
  */
 
+#include "http-private.h"
 #include "cups.h"
-#include "ipp.h"
 #include "language.h"
 #include "string.h"
 #include "debug.h"
index a69e1726d9c3c4383342e313da49a4a8db44c7a9..7c3e37aaaab0f218791f24e0c672c9b94d7c4f80 100644 (file)
@@ -32,6 +32,7 @@
  */
 
 #  include "string.h"
+#  include "http-private.h"
 #  include "cups.h"
 #  include "i18n.h"
 
index 71f4d18f2a589eb3b468c1fb980d244a53a94fc6..2d814fbc68c9c8971153bc84b7b49002bea46fd0 100644 (file)
@@ -412,7 +412,7 @@ httpAddrGetList(const char *hostname,       /* I - Hostname, IP address, or NULL for p
           if (host->h_addrtype == AF_INET6)
          {
             temp->addr.ipv6.sin6_family = AF_INET6;
-           memcpy(&(temp->addr.ipv6), host->h_addr_list[i],
+           memcpy(&(temp->addr.ipv6.sin6_addr), host->h_addr_list[i],
                   sizeof(temp->addr.ipv6));
             temp->addr.ipv6.sin6_port = htons(portnum);
          }
@@ -420,7 +420,7 @@ httpAddrGetList(const char *hostname,       /* I - Hostname, IP address, or NULL for p
 #  endif /* AF_INET6 */
          {
             temp->addr.ipv4.sin_family = AF_INET;
-           memcpy(&(temp->addr.ipv4), host->h_addr_list[i],
+           memcpy(&(temp->addr.ipv4.sin_addr), host->h_addr_list[i],
                   sizeof(temp->addr.ipv4));
             temp->addr.ipv4.sin_port = htons(portnum);
           }
@@ -506,6 +506,9 @@ httpAddrGetList(const char *hostname,       /* I - Hostname, IP address, or NULL for p
        temp->addr.ipv6.sin6_addr.s6_addr32[3] = htonl(1);
 #  endif /* WIN32 */
 
+        if (!first)
+          first = temp;
+
         addr = temp;
       }
 
@@ -527,6 +530,9 @@ httpAddrGetList(const char *hostname,       /* I - Hostname, IP address, or NULL for p
        temp->addr.ipv4.sin_port        = htons(portnum);
        temp->addr.ipv4.sin_addr.s_addr = htonl(0x7f000001);
 
+        if (!first)
+          first = temp;
+
         if (addr)
          addr->next = temp;
        else
@@ -556,6 +562,9 @@ httpAddrGetList(const char *hostname,       /* I - Hostname, IP address, or NULL for p
         temp->addr.ipv6.sin6_family = AF_INET6;
        temp->addr.ipv6.sin6_port   = htons(portnum);
 
+        if (!first)
+          first = temp;
+
         addr = temp;
       }
 
@@ -576,6 +585,9 @@ httpAddrGetList(const char *hostname,       /* I - Hostname, IP address, or NULL for p
         temp->addr.ipv4.sin_family = AF_INET;
        temp->addr.ipv4.sin_port   = htons(portnum);
 
+        if (!first)
+          first = temp;
+
         if (addr)
          addr->next = temp;
        else
index 78072dbf7dda25eeba5332b20339fa87053fd548..ee2f9485152a57afa5577a73ebb0d37e24e6af90 100644 (file)
@@ -120,6 +120,55 @@ extern OSStatus    _httpWriteCDSA(SSLConnectionRef connection, const void *data,
                               size_t *dataLength);
 #  endif /* HAVE_LIBSSL */
 
+
+struct _http_s                         /**** HTTP connection structure. ****/
+{
+  int                  fd;             /* File descriptor for this socket */
+  int                  blocking;       /* To block or not to block */
+  int                  error;          /* Last error on read */
+  time_t               activity;       /* Time since last read/write */
+  http_state_t         state;          /* State of client */
+  http_status_t                status;         /* Status of last request */
+  http_version_t       version;        /* Protocol version */
+  http_keepalive_t     keep_alive;     /* Keep-alive supported? */
+  struct sockaddr_in   _hostaddr;      /* Address of connected host @deprecated@ */
+  char                 hostname[HTTP_MAX_HOST],
+                                       /* Name of connected host */
+                       fields[HTTP_FIELD_MAX][HTTP_MAX_VALUE];
+                                       /* Field values */
+  char                 *data;          /* Pointer to data buffer */
+  http_encoding_t      data_encoding;  /* Chunked or not */
+  int                  _data_remaining;/* Number of bytes left @deprecated@ */
+  int                  used;           /* Number of bytes used in buffer */
+  char                 buffer[HTTP_MAX_BUFFER];
+                                       /* Buffer for incoming data */
+  int                  auth_type;      /* Authentication in use */
+  _cups_md5_state_t    md5_state;      /* MD5 state */
+  char                 nonce[HTTP_MAX_VALUE];
+                                       /* Nonce value */
+  int                  nonce_count;    /* Nonce count */
+  void                 *tls;           /* TLS state information */
+  http_encryption_t    encryption;     /* Encryption requirements */
+  /**** New in CUPS 1.1.19 ****/
+  fd_set               *input_set;     /* select() set for httpWait() @since CUPS 1.1.19@ */
+  http_status_t                expect;         /* Expect: header @since CUPS 1.1.19@ */
+  char                 *cookie;        /* Cookie value(s) @since CUPS 1.1.19@ */
+  /**** New in CUPS 1.1.20 ****/
+  char                 authstring[HTTP_MAX_VALUE],
+                                       /* Current Authentication value @since CUPS 1.1.20@ */
+                       userpass[HTTP_MAX_VALUE];
+                                       /* Username:password string @since CUPS 1.1.20@ */
+  int                  digest_tries;   /* Number of tries for digest auth @since CUPS 1.1.20@ */
+  /**** New in CUPS 1.2 ****/
+  off_t                        data_remaining; /* Number of bytes left @since CUPS 1.2@ */
+  http_addr_t          *hostaddr;      /* Current host address and port @since CUPS 1.2@ */
+  http_addrlist_t      *addrlist;      /* List of valid addresses @since CUPS 1.2@ */
+  char                 wbuffer[HTTP_MAX_BUFFER];
+                                       /* Buffer for outgoing data */
+  int                  wused;          /* Write buffer bytes used @since CUPS 1.2@ */
+};
+
+
 /*
  * Some OS's don't have hstrerror(), most notably Solaris...
  */
index 1f90be5b430b4cc0f80a0bb215a529dace0566f2..07381616dc530032ecf689b1a4979c9d8b89a836 100644 (file)
@@ -866,7 +866,7 @@ httpGets(char   *line,                      /* I - Line to read into */
       * No newline; see if there is more data to be read...
       */
 
-      if (!http->blocking && !http_wait(http, 1000))
+      if (!http->blocking && !http_wait(http, 10000))
       {
         DEBUG_puts("httpGets: Timed out!");
         http->error = ETIMEDOUT;
@@ -1222,7 +1222,7 @@ httpRead2(http_t *http,                   /* I - HTTP connection */
     * Buffer small reads for better performance...
     */
 
-    if (!http->blocking && !httpWait(http, 1000))
+    if (!http->blocking && !httpWait(http, 10000))
       return (0);
 
     if (http->data_remaining > sizeof(http->buffer))
@@ -1285,7 +1285,7 @@ httpRead2(http_t *http,                   /* I - HTTP connection */
 #ifdef HAVE_SSL
   else if (http->tls)
   {
-    if (!http->blocking && !httpWait(http, 1000))
+    if (!http->blocking && !httpWait(http, 10000))
       return (0);
 
     bytes = http_read_ssl(http, buffer, length);
@@ -1293,7 +1293,7 @@ httpRead2(http_t *http,                   /* I - HTTP connection */
 #endif /* HAVE_SSL */
   else
   {
-    if (!http->blocking && !httpWait(http, 1000))
+    if (!http->blocking && !httpWait(http, 10000))
       return (0);
 
     DEBUG_printf(("httpRead2: reading %d bytes from socket...\n", length));
@@ -1415,13 +1415,11 @@ _httpReadCDSA(
     *dataLength = 0;
 
     if (bytes == 0)
-      result = errSSLClosedAbort;
+      result = errSSLClosedGraceful;
     else if (errno == EAGAIN)
       result = errSSLWouldBlock;
-    else if (errno == EPIPE)
-      result = errSSLClosedAbort;
     else
-      result = errSSLInternal;
+      result = errSSLClosedAbort;
   }
 
   return result;
@@ -1994,10 +1992,8 @@ _httpWriteCDSA(
   
     if (errno == EAGAIN)
       result = errSSLWouldBlock;
-    else if (errno == EPIPE)
-      result = errSSLClosedAbort;
     else
-      result = errSSLInternal;
+      result = errSSLClosedAbort;
   }
 
   return result;
@@ -2337,6 +2333,9 @@ http_setup_ssl(http_t *http)              /* I - HTTP connection */
   if (!error)
     error = SSLSetAllowsAnyRoot(conn->session, true);
 
+  if (!error)
+    error = SSLSetProtocolVersionEnabled(conn->session, kSSLProtocol2, false);
+
   if (!error)
   {
     while ((error = SSLHandshake(conn->session)) == errSSLWouldBlock)
index a85971fcd655c0abd662953afa329d1cb4b95b0d..40ba98235fd60e95ff60ab0a9a66a77bcc7a4b5b 100644 (file)
@@ -320,52 +320,7 @@ typedef struct http_addrlist_s             /**** Socket address list, which is
   http_addr_t          addr;           /* Address */
 } http_addrlist_t;
 
-typedef struct _http_s                 /**** HTTP connection structure. ****/
-{
-  int                  fd;             /* File descriptor for this socket */
-  int                  blocking;       /* To block or not to block */
-  int                  error;          /* Last error on read */
-  time_t               activity;       /* Time since last read/write */
-  http_state_t         state;          /* State of client */
-  http_status_t                status;         /* Status of last request */
-  http_version_t       version;        /* Protocol version */
-  http_keepalive_t     keep_alive;     /* Keep-alive supported? */
-  struct sockaddr_in   _hostaddr;      /* Address of connected host @deprecated@ */
-  char                 hostname[HTTP_MAX_HOST],
-                                       /* Name of connected host */
-                       fields[HTTP_FIELD_MAX][HTTP_MAX_VALUE];
-                                       /* Field values */
-  char                 *data;          /* Pointer to data buffer */
-  http_encoding_t      data_encoding;  /* Chunked or not */
-  int                  _data_remaining;/* Number of bytes left @deprecated@ */
-  int                  used;           /* Number of bytes used in buffer */
-  char                 buffer[HTTP_MAX_BUFFER];
-                                       /* Buffer for incoming data */
-  int                  auth_type;      /* Authentication in use */
-  _cups_md5_state_t    md5_state;      /* MD5 state */
-  char                 nonce[HTTP_MAX_VALUE];
-                                       /* Nonce value */
-  int                  nonce_count;    /* Nonce count */
-  void                 *tls;           /* TLS state information */
-  http_encryption_t    encryption;     /* Encryption requirements */
-  /**** New in CUPS 1.1.19 ****/
-  fd_set               *input_set;     /* select() set for httpWait() @since CUPS 1.1.19@ */
-  http_status_t                expect;         /* Expect: header @since CUPS 1.1.19@ */
-  char                 *cookie;        /* Cookie value(s) @since CUPS 1.1.19@ */
-  /**** New in CUPS 1.1.20 ****/
-  char                 authstring[HTTP_MAX_VALUE],
-                                       /* Current Authentication value @since CUPS 1.1.20@ */
-                       userpass[HTTP_MAX_VALUE];
-                                       /* Username:password string @since CUPS 1.1.20@ */
-  int                  digest_tries;   /* Number of tries for digest auth @since CUPS 1.1.20@ */
-  /**** New in CUPS 1.2 ****/
-  off_t                        data_remaining; /* Number of bytes left @since CUPS 1.2@ */
-  http_addr_t          *hostaddr;      /* Current host address and port @since CUPS 1.2@ */
-  http_addrlist_t      *addrlist;      /* List of valid addresses @since CUPS 1.2@ */
-  char                 wbuffer[HTTP_MAX_BUFFER];
-                                       /* Buffer for outgoing data */
-  int                  wused;          /* Write buffer bytes used @since CUPS 1.2@ */
-} http_t;
+typedef struct _http_s http_t;         /**** HTTP connection type ****/
 
 
 /*
index 96bf8911439d4466fa29d746e7fa3cc0e9aab2c9..cc22e2bf5ca3640cfe8686dae11d9de08efb7b59 100644 (file)
@@ -2742,10 +2742,10 @@ ipp_read_http(http_t      *http,        /* I - Client connection */
       if (!http->blocking)
       {
        /*
-        * Wait up to 1 second for more data on non-blocking sockets...
+        * Wait up to 10 seconds for more data on non-blocking sockets...
        */
 
-       if (!httpWait(http, 1000))
+       if (!httpWait(http, 10000))
        {
         /*
           * Signal no data...
index a7fde7124045a5b74b694e87ff4427fa22e0d6c0..c6b173a82e2613453175aff217f070c1717c9878 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   HTTP test program for the Common UNIX Printing System (CUPS).
  *
- *   Copyright 1997-2005 by Easy Software Products.
+ *   Copyright 1997-2006 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Easy Software Products and are protected by Federal
@@ -311,9 +311,21 @@ main(int  argc,                            /* I - Number of command-line arguments */
     addrlist = httpAddrGetList(hostname, AF_UNSPEC, NULL);
     if (addrlist)
     {
-      for (i = 0, addr = addrlist; addr; i ++, addr = addr->next);
+      for (i = 0, addr = addrlist; addr; i ++, addr = addr->next)
+      {
+        char   numeric[1024];          /* Numeric IP address */
+
+
+       httpAddrString(&(addr->addr), numeric, sizeof(numeric));
+       if (!strcmp(numeric, "UNKNOWN"))
+         break;
+      }
+
+      if (addr)
+        printf("FAIL (bad address for %s)\n", hostname);
+      else
+        printf("PASS (%d address(es) for %s)\n", i, hostname);
 
-      printf("PASS (%d address(es) for %s)\n", i, hostname);
       httpAddrFreeList(addrlist);
     }
     else
index 0610de2960dba02a265bf099e28c42c78478e0df..4d1ee2da062458fdf3bb589a35427bebb2f11021 100644 (file)
@@ -59,6 +59,39 @@ static const char    *default_code =
                        "%%BeginFeature: *InputSlot Tray\n"
                        "InputSlot=Tray\n"
                        "%%EndFeature\n"
+                       "} stopped cleartomark\n"
+                       "[{\n"
+                       "%%BeginFeature: *IntOption None\n"
+                       "%%EndFeature\n"
+                       "} stopped cleartomark\n"
+                       "[{\n"
+                       "%%BeginFeature: *StringOption None\n"
+                       "%%EndFeature\n"
+                       "} stopped cleartomark\n";
+
+static const char      *custom_code =
+                       "[{\n"
+                       "%%BeginFeature: *CustomPageSize True\n"
+                       "500\n"
+                       "400\n"
+                       "0\n"
+                       "0\n"
+                       "0\n"
+                       "PageSize=Custom\n"
+                       "%%EndFeature\n"
+                       "} stopped cleartomark\n"
+                       "[{\n"
+                       "%%BeginFeature: *InputSlot Tray\n"
+                       "InputSlot=Tray\n"
+                       "%%EndFeature\n"
+                       "} stopped cleartomark\n"
+                       "[{\n"
+                       "%%BeginFeature: *IntOption None\n"
+                       "%%EndFeature\n"
+                       "} stopped cleartomark\n"
+                       "[{\n"
+                       "%%BeginFeature: *StringOption None\n"
+                       "%%EndFeature\n"
                        "} stopped cleartomark\n";
 
 
@@ -107,7 +140,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
       printf("FAIL (%d conflicts)\n", conflicts);
     }
 
-    fputs("ppdEmitString: ", stdout);
+    fputs("ppdEmitString (defaults): ", stdout);
     if ((s = ppdEmitString(ppd, PPD_ORDER_ANY, 0.0)) != NULL &&
        !strcmp(s, default_code))
       puts("PASS");
@@ -120,6 +153,24 @@ main(int  argc,                            /* I - Number of command-line arguments */
        puts(s);
     }
 
+    if (s)
+      free(s);
+
+    fputs("ppdEmitString (custom size): ", stdout);
+    ppdMarkOption(ppd, "PageSize", "Custom.400x500");
+
+    if ((s = ppdEmitString(ppd, PPD_ORDER_ANY, 0.0)) != NULL &&
+       !strcmp(s, custom_code))
+      puts("PASS");
+    else
+    {
+      printf("FAIL (%d bytes instead of %d)\n", s ? (int)strlen(s) : 0,
+            (int)strlen(custom_code));
+
+      if (s)
+       puts(s);
+    }
+
     if (s)
       free(s);
 
index 3bd960b6de63fffbbaaf3e82adde5433414b8c69..0d3cd03282f60f00425fe74815c4a21ebc097907 100644 (file)
@@ -800,6 +800,8 @@ cupsGetPPD2(http_t     *http,               /* I - HTTP connection */
             const char *name)          /* I - Printer name */
 {
   int          http_port;              /* Port number */
+  char         http_hostname[HTTP_MAX_HOST];
+                                       /* Hostname associated with connection */
   http_t       *http2;                 /* Alternate HTTP connection */
   int          fd;                     /* PPD file */
   char         localhost[HTTP_MAX_URI],/* Local hostname */
@@ -845,9 +847,11 @@ cupsGetPPD2(http_t     *http,              /* I - HTTP connection */
     strcpy(hostname, "localhost");
 
  /*
-  * Get the port number we are connected to...
+  * Get the hostname and port number we are connected to...
   */
 
+  httpGetHostname(http, http_hostname, sizeof(http_hostname));
+
 #ifdef AF_INET6
   if (http->hostaddr->addr.sa_family == AF_INET6)
     http_port = ntohs(http->hostaddr->ipv6.sin6_port);
@@ -862,7 +866,7 @@ cupsGetPPD2(http_t     *http,               /* I - HTTP connection */
   * Reconnect to the correct server as needed...
   */
 
-  if (!strcasecmp(http->hostname, hostname) && port == http_port)
+  if (!strcasecmp(http_hostname, hostname) && port == http_port)
     http2 = http;
   else if ((http2 = httpConnectEncrypt(hostname, port,
                                        cupsEncryption())) == NULL)
@@ -1394,7 +1398,8 @@ cups_connect(const char *name,            /* I - Destination (printer[@host]) */
             char       *printer,       /* O - Printer name [HTTP_MAX_URI] */
              char       *hostname)     /* O - Hostname [HTTP_MAX_URI] */
 {
-  char hostbuf[HTTP_MAX_URI];          /* Name of host */
+  char hostbuf[HTTP_MAX_URI],          /* Name of host */
+       http_hostname[HTTP_MAX_HOST];   /* Hostname associated with connection */
   _cups_globals_t  *cg = _cupsGlobals();/* Pointer to library globals */
 
 
@@ -1415,6 +1420,8 @@ cups_connect(const char *name,            /* I - Destination (printer[@host]) */
 
   strlcpy(hostbuf, cupsServer(), sizeof(hostbuf));
 
+  httpGetHostname(cg->http, http_hostname, sizeof(http_hostname));
+
   if (hostname != NULL)
     strlcpy(hostname, hostbuf, HTTP_MAX_URI);
   else
@@ -1427,7 +1434,7 @@ cups_connect(const char *name,            /* I - Destination (printer[@host]) */
 
   if (cg->http != NULL)
   {
-    if (!strcasecmp(cg->http->hostname, hostname))
+    if (!strcasecmp(http_hostname, hostname))
       return (printer);
 
     httpClose(cg->http);
@@ -1473,7 +1480,9 @@ cups_get_printer_uri(
   char         uri[HTTP_MAX_URI],      /* printer-uri attribute */
                scheme[HTTP_MAX_URI],   /* Scheme name */
                username[HTTP_MAX_URI], /* Username:password */
-               classname[255];         /* Temporary class name */
+               classname[255],         /* Temporary class name */
+               http_hostname[HTTP_MAX_HOST];
+                                       /* Hostname associated with connection */
   static const char * const requested_attrs[] =
                {                       /* Requested attributes */
                  "printer-uri-supported",
@@ -1505,9 +1514,11 @@ cups_get_printer_uri(
   DEBUG_printf(("cups_get_printer_uri: printer-uri=\"%s\"\n", uri));
 
  /*
-  * Get the port number we are connected to...
+  * Get the hostname and port number we are connected to...
   */
 
+  httpGetHostname(http, http_hostname, sizeof(http_hostname));
+
 #ifdef AF_INET6
   if (http->hostaddr->addr.sa_family == AF_INET6)
     http_port = ntohs(http->hostaddr->ipv6.sin6_port);
@@ -1585,7 +1596,7 @@ cups_get_printer_uri(
            * Found a class!  Connect to the right server...
            */
 
-           if (!strcasecmp(http->hostname, host) && *port == http_port)
+           if (!strcasecmp(http_hostname, host) && *port == http_port)
              http2 = http;
            else if ((http2 = httpConnectEncrypt(host, *port,
                                                 cupsEncryption())) == NULL)
index f3e0a30fa19e628d33625e27527519eec75af43a..ff1f1d249585fd9df55576811e4ba17883892f71 100644 (file)
@@ -167,6 +167,7 @@ HELPFILES   =       \
                        help/spec-command.html \
                        help/spec-design.html \
                        help/spec-ipp.html \
+                       help/spec-postscript.html \
                        help/spec-ppd.html \
                        help/spec-raster.html \
                        help/spec-stp.html \
@@ -200,7 +201,7 @@ depend:
 # Install all documentation files...
 #
 
-install:       all
+install:       all $(INSTALL_LANGUAGES)
        $(INSTALL_DIR) -m 755 $(DOCDIR)
        for file in $(WEBPAGES); do \
                $(INSTALL_MAN) $$file $(DOCDIR); \
@@ -213,6 +214,8 @@ install:    all
        for file in $(WEBIMAGES) $(WEBBUTTONS); do \
                $(INSTALL_MAN) $$file $(DOCDIR)/images; \
        done
+
+install-languages:
        for lang in $(LANGUAGES); do \
                $(INSTALL_DIR) -m 755 $(DOCDIR)/$$lang/images; \
                if test -f $$lang/index.html; then \
@@ -230,7 +233,7 @@ install:    all
 # Unnstall all documentation files...
 #
 
-uninstall:
+uninstall: $(UNINSTALL_LANGUAGES)
        for file in $(WEBPAGES); do \
                $(RM) $(DOCDIR)/$$file; \
        done
@@ -240,6 +243,11 @@ uninstall:
        for file in $(WEBIMAGES) $(WEBBUTTONS); do \
                $(INSTALL_MAN) $(DOCDIR)/images/$$file; \
        done
+       -$(RMDIR) $(DOCDIR)/images
+       -$(RMDIR) $(DOCDIR)/help
+       -$(RMDIR) $(DOCDIR)
+
+uninstall-languages:
        -for lang in $(LANGUAGES); do \
                $(RM) $(DOCDIR)/$$lang/index.html; \
                for file in $(WEBBUTTONS); do \
@@ -248,9 +256,6 @@ uninstall:
                $(RMDIR) $(DOCDIR)/$$lang/images; \
                $(RMDIR) $(DOCDIR)/$$lang; \
        done
-       -$(RMDIR) $(DOCDIR)/images
-       -$(RMDIR) $(DOCDIR)/help
-       -$(RMDIR) $(DOCDIR)
 
 
 #
diff --git a/doc/help/spec-pdf.html b/doc/help/spec-pdf.html
new file mode 100644 (file)
index 0000000..862eb0c
--- /dev/null
@@ -0,0 +1,21 @@
+<HTML>
+<!-- SECTION: Specifications -->
+<HEAD>
+       <TITLE>CUPS PDF Format</TITLE>
+       <LINK REL="STYLESHEET" TYPE="test/css" HREF="../cups.css">
+</HEAD>
+<BODY>
+
+<P>CUPS PDF files (application/vnd.cups-pdf) are device-dependent
+PDF/A files that contain a job ticket information. These files
+are typically produced by the CUPS <CODE>pdftopdf</CODE> filter
+which handles job ticket generation, imposition, page labeling,
+scaling, and other formatting options requested by the user. CUPS
+PDF files are intended for direct consumption by a PDF-capable
+printer, PDF RIP, or the <CODE>pdftops</CODE> filter.</P>
+
+<P>More information will be posted here as the PDF workflow
+filters are added to CUPS.</P>
+
+</BODY>
+</HTML>
diff --git a/doc/help/spec-postscript.html b/doc/help/spec-postscript.html
new file mode 100644 (file)
index 0000000..7e9f9a8
--- /dev/null
@@ -0,0 +1,120 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+<!-- SECTION: Specifications -->
+<head>
+       <title>Generating PostScript for CUPS</title>
+       <meta name='keywords' content='Programming, PostScript, Document Structuring Conventions'>
+       <link rel='stylesheet' type='text/css' href='../cups.css'>
+</head>
+<body>
+<!--
+  "$Id$"
+
+  CUPS PostScript file specification for the Common UNIX Printing System (CUPS).
+
+  Copyright 2006 by Easy Software Products.
+
+  These coded instructions, statements, and computer programs are the
+  property of Easy Software Products and are protected by Federal
+  copyright law.  Distribution and use rights are outlined in the file
+  "LICENSE.txt" which should have been included with this file.  If this
+  file is missing or damaged please contact Easy Software Products
+  at:
+
+      Attn: CUPS Licensing Information
+      Easy Software Products
+      44141 Airport View Drive, Suite 204
+      Hollywood, Maryland 20636 USA
+
+      Voice: (301) 373-9600
+      EMail: cups-info@cups.org
+        WWW: http://www.cups.org
+-->
+
+<h2 class='title'><a name='INTRODUCTION'>Introduction</a></h2>
+
+<p>This document describes how to generate PostScript output for
+CUPS and is largely based on the <a
+href="http://partners.adobe.com/public/developer/en/ps/5001.DSC_Spec.pdf">
+Adobe TechNote #5001: PostScript Language Document Structuring
+Conventions Specification Version 3.0</a>. While CUPS can
+generally print any PostScript file, following the rules in the
+Adobe TechNote and this document will ensure that your PostScript
+output will work reliably.</p>
+
+<blockquote><b>Note:</b> While PostScript is currently the
+defacto-standard print job file format/language for UNIX-based
+applications, it is slowly being phased out in favor of Adobe's
+Portable Document Format ("PDF") which offers many advantages
+over PostScript. MacOS X uses PDF as the primary print job file
+format, and we expect Linux to soon follow. Both PostScript and
+PDF are complex formats, and we highly recommend using high-level
+toolkits whenever possible.</blockquote>
+
+<h3>Anatomy of a PostScript File</h3>
+
+<p>PostScript files are ASCII text files starting with a header
+line (<tt>%!PS-Adobe-3.0</tt>) followed by a combination of
+comment lines starting with two percent signs (<tt>%%</tt>) and
+PostScript code lines. The lines themselves should not exceed 255
+characters to conform to the DSC. The following short PostScript
+file produces a box with a smiley face in it:</p>
+
+<pre class="command">
+%!PS-Adobe-3.0
+%%BoundingBox: 36 36 576 756
+%%Pages: 1
+%%LanguageLevel: 2
+%%EndComments
+%%Page: (1) 1
+% Draw a black box around the page
+0 setgray
+1 setlinewidth
+36 36 540 720 rectstroke
+
+% Draw a two inch blue circle in the middle of the page
+0 0 1 setrgbcolor
+306 396 144 0 360 arc closepath fill
+
+% Draw two half inch yellow circles for eyes
+1 1 0 setrgbcolor
+252 432 36 0 360 arc closepath fill
+360 432 36 0 360 arc closepath fill
+
+% Draw the smile
+1 setlinecap
+18 setlinewidth
+306 396 99 200 340 arc stroke
+
+% Print it!
+showpage
+%%EOF
+</pre>
+
+<div class="figure"><table summary="Sample PostScript File Output">
+<caption>Figure 1: <a name="FIGURE_1">Sample PostScript File Output</a></caption>
+<tr><td align="center"><img src="../images/smiley.jpg"
+width="445" height="570" alt="Sample PostScript File Output"></td></tr>
+</table></div>
+
+
+<h2>Embedding Printer Options</h2>
+
+
+<h2>Embedding Fonts and Text</h2>
+
+
+<h2>Embedding Images</h2>
+
+
+<blockquote><b>Note:</b> While some printers support arbitrary
+binary data in PostScript files, we do not recommend this
+practice because it does not work with all printers or
+interfaces. In most cases, the Base-85 encoding and compression
+filters can be used to embed images with very little, if any,
+increase in data size.</blockquote>
+
+
+
+</body>
+</html>
index b3a44a4f932c30b6ab21a7e189c1db01d6911f47..a0d6b895fee0c8d2b96ff4c80fad498fc233f22b 100644 (file)
@@ -14,9 +14,10 @@ RIPs to device-dependent filters that convert the raster data to
 a printable format.</P>
 
 <P>CUPS 1.0 and 1.1 used a version 1 raster format. CUPS 1.2
-introduces a version 2 format that is a superset of the version 1
-format. Applications using the CUPS Imaging API (the cupsRaster*
-functions) can read both formats without code changes.</P>
+introduces version 2 (compressed) and version 3 (uncompressed)
+formats that are a superset of the version 1 format. Applications
+using the CUPS Imaging API (the cupsRaster* functions) can read
+all formats without code changes.</P>
 
 <P>The registered MIME media type for CUPS raster files is
 <CODE>application/vnd.cups-raster</CODE>.</P>
@@ -485,6 +486,22 @@ colors are encoded using an initial byte of "257 - count"
 followed by the color value bytes.</P>
 
 
+<H2 CLASS="title"><A NAME="V3">Version 3 Raster File Format</A></H2>
+
+<P>A version 3 raster file begins with a 32-bit synchronization
+word: 0x52615333 ("RaS3") for big-endian architectures and
+0x33536152 ("3SaR") 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 Imaging API raster functions
+perform this function automatically.</P>
+
+<P>Following the synchronization word are a series of raster
+pages. Each page starts with a version 2 page device dictionary
+header and is followed immediately by the uncompressed raster data
+for that page.</P>
+
+
 <H2 CLASS="title"><A NAME="ENCODING">Pixel Value Coding</A></H2>
 
 <P>The following sections describe the encoding and decoding of
@@ -673,6 +690,15 @@ accuracy.</P>
 
 <H2 CLASS="title"><A NAME="HISTORY">Change History</A></H2>
 
+<H3>Changes in CUPS 1.2.2</H3>
+
+<ul>
+
+       <li>Added version 3 (uncompressed) format.</li>
+
+</ul>
+
+
 <H3>Changes in CUPS 1.2.1</H3>
 
 <ul>
index 5b8cd5b217b72db7ac0113641d84564d17fa70ea..8013e5de5cd0f6e5b6a6a863fcdf546dcd98f4f1 100644 (file)
Binary files a/doc/pl/images/button-accept-jobs.gif and b/doc/pl/images/button-accept-jobs.gif differ
index ce7ea6ccf4c2d6a095df4ad448d17a13805d66b3..ca9b8c616f085e7bdde577ff8eb1e9b71b078ef0 100644 (file)
Binary files a/doc/pl/images/button-add-class.gif and b/doc/pl/images/button-add-class.gif differ
index 0f284487f7a42cd2397f2ccf8fe0bca294ac3a5e..1e099e647ae049ce64d0d697b77fd750b78acb5b 100644 (file)
Binary files a/doc/pl/images/button-add-printer.gif and b/doc/pl/images/button-add-printer.gif differ
index dc00856bd5ec775d88874a9831f743fe70274565..4fa4e4d4ba77682d7b7d2a6c17c7185c1fc88faa 100644 (file)
Binary files a/doc/pl/images/button-add-this-printer.gif and b/doc/pl/images/button-add-this-printer.gif differ
index 84e724b258420db708c42248ab002418fbe5dc5b..093b3e7fdbc7f3b0cfb98f8870ef0c96112060e9 100644 (file)
Binary files a/doc/pl/images/button-cancel-all-jobs.gif and b/doc/pl/images/button-cancel-all-jobs.gif differ
index 2d122bac5a2493f0056932e388fd41d57539f5e0..1cc3be3af2398d36578903bc1341dc62b6d830df 100644 (file)
Binary files a/doc/pl/images/button-cancel-job.gif and b/doc/pl/images/button-cancel-job.gif differ
index 73de99527d7687050eee99b40815191d6ceb6452..8abeb0774aeb7e0870a6999a202c3000d2f1716d 100644 (file)
Binary files a/doc/pl/images/button-change-settings.gif and b/doc/pl/images/button-change-settings.gif differ
index 2f45608d8ebb47781af49a95f59a286a0b6a8a1c..0daf9a9ac2c66b59b5f12818924d33af253e6ef3 100644 (file)
Binary files a/doc/pl/images/button-clean-print-heads.gif and b/doc/pl/images/button-clean-print-heads.gif differ
index e15a4bb3ddd3b399131d94750fdd62ef23aad5bb..9e1c36d36fec58c7adb8e81b7f91c39658b7fd92 100644 (file)
Binary files a/doc/pl/images/button-clear.gif and b/doc/pl/images/button-clear.gif differ
index 93f849041d2623ec1ac6b7d83a61c2b83ebb9ff7..d0d291666dab4076311c7a2c57244cb6b6238ece 100644 (file)
Binary files a/doc/pl/images/button-continue.gif and b/doc/pl/images/button-continue.gif differ
index 934b8d66b5416a52d47b736acd2d9f04d1fd0379..38f69eca1315cc0b0f1cda6236e523d2d78fcfef 100644 (file)
Binary files a/doc/pl/images/button-delete-class.gif and b/doc/pl/images/button-delete-class.gif differ
index f7c6984186825ae6669814888c6557d0d884a8ab..7e5bf74ea00b04d9e70fc801062abe71e1e28af0 100644 (file)
Binary files a/doc/pl/images/button-delete-printer.gif and b/doc/pl/images/button-delete-printer.gif differ
index 89fd8a7d65c32d33d8d58c41bbab4c1cd7db2f3d..e892aa1d96743d4509d354b85ca1db0b2a538978 100644 (file)
Binary files a/doc/pl/images/button-edit-configuration-file.gif and b/doc/pl/images/button-edit-configuration-file.gif differ
index c6c333619f0a63822bb55f558224bed57e8a1d9c..1fdbf67f09737a6a1b508f4c87a08af4449a9c1b 100644 (file)
Binary files a/doc/pl/images/button-export-samba.gif and b/doc/pl/images/button-export-samba.gif differ
index d2d4f85307814ff2a5dc8f1053e9183333f333ef..f5e239e0ece00f1da4e6636ab7c777b63fef1178 100644 (file)
Binary files a/doc/pl/images/button-help.gif and b/doc/pl/images/button-help.gif differ
index 2ab556492963ccaf8028641cb9f77a858da0ee59..5219e686845c7edad00817d227fae787bd023eda 100644 (file)
Binary files a/doc/pl/images/button-hold-job.gif and b/doc/pl/images/button-hold-job.gif differ
index c758f98029d1bd9a283328fc90973432f39b067d..63a8f660d6d365f32cc53619da40a7186856fc00 100644 (file)
Binary files a/doc/pl/images/button-manage-classes.gif and b/doc/pl/images/button-manage-classes.gif differ
index 7aefeddaf30070dba892829e05df8d4a89c46337..f8f6f0d8bca56c717b8e27f68e1f8a8221a425ba 100644 (file)
Binary files a/doc/pl/images/button-manage-jobs.gif and b/doc/pl/images/button-manage-jobs.gif differ
index f884f7f6068bc69d41e459f06b576d67e2f8db6d..041efc2159eb1745c89e330e5c4ee2a0f4f42b92 100644 (file)
Binary files a/doc/pl/images/button-manage-printers.gif and b/doc/pl/images/button-manage-printers.gif differ
index ba6e31cdc83fe2645602a2a2c3aeb9f2a89111f0..cb6d760478cadf100e87ad8fe82b3a9f5556ced4 100644 (file)
Binary files a/doc/pl/images/button-manage-server.gif and b/doc/pl/images/button-manage-server.gif differ
index fcf5f6d3eeb48059a7a9e4a914af3a38aac43961..38cce158f37ba23431691ab4c6c11371b70d0d0c 100644 (file)
Binary files a/doc/pl/images/button-modify-class.gif and b/doc/pl/images/button-modify-class.gif differ
index e3d5346630b20235f2014a9b91b194fd3f708bbc..acbb6daac0920e9e49d1c9619da33875b447f9f5 100644 (file)
Binary files a/doc/pl/images/button-modify-printer.gif and b/doc/pl/images/button-modify-printer.gif differ
index 02ce3300d1800a639daaf95efee8ac449186bfdb..585f48e8bc0977e69c7246c83fc12f972d28def8 100644 (file)
Binary files a/doc/pl/images/button-move-job.gif and b/doc/pl/images/button-move-job.gif differ
index 36029ac30866cd37479cbed72319027f08da6abf..4600b780fa4690ca6e08cf687df65f9edef7eb4b 100644 (file)
Binary files a/doc/pl/images/button-move-jobs.gif and b/doc/pl/images/button-move-jobs.gif differ
index bcea1ba01aa6288f82651a3c78fb25110aff8389..1aa3349f10a5544aabc67d62a2d60dc40db136b1 100644 (file)
Binary files a/doc/pl/images/button-print-self-test-page.gif and b/doc/pl/images/button-print-self-test-page.gif differ
index 57ac13be7778b697bc175e8f748769754a4e9392..8eb7ec39848e3f1c0f5c95cf9e45c269dff08b75 100644 (file)
Binary files a/doc/pl/images/button-print-test-page.gif and b/doc/pl/images/button-print-test-page.gif differ
index c12abe87e6d1bc8ffe9fea6393a8e11384ef64bd..909702fb496c325876a3208094373eb88fc56a1b 100644 (file)
Binary files a/doc/pl/images/button-publish-printer.gif and b/doc/pl/images/button-publish-printer.gif differ
index a81848bdee5cf3f704a304bd7844cdc16f867010..bcff455807c99e6f26f145a6d10bd587a04ba0a0 100644 (file)
Binary files a/doc/pl/images/button-reject-jobs.gif and b/doc/pl/images/button-reject-jobs.gif differ
index d8a82f0925e0a567b89a2f42c223154d007bfb74..a3d95ad3762722539f9fffa961675383c42ca9bd 100644 (file)
Binary files a/doc/pl/images/button-release-job.gif and b/doc/pl/images/button-release-job.gif differ
index 42b7568ecf8b4bea868f7845ed1cce07eab75965..5d5a7c0313339648474e7d695ae7980b4928890d 100644 (file)
Binary files a/doc/pl/images/button-restart-job.gif and b/doc/pl/images/button-restart-job.gif differ
index 2f1fee1704193adc9582f3d1f8d369e915a9b1ae..5056b80beffe421794309faa251eb6b737b03a73 100644 (file)
Binary files a/doc/pl/images/button-save-changes.gif and b/doc/pl/images/button-save-changes.gif differ
index 1bc194527128e4f7d8adc04b79575083993dde12..5f99760e6f1ef8063ed86d80d88364a1a59d1585 100644 (file)
Binary files a/doc/pl/images/button-search.gif and b/doc/pl/images/button-search.gif differ
index cd7709ef593ad8693246a6fc6c6ed9475027b219..728ced1eebb8d76f208cd59168608fa19a918b08 100644 (file)
Binary files a/doc/pl/images/button-set-allowed-users.gif and b/doc/pl/images/button-set-allowed-users.gif differ
index 203d097347ef33dfd28e729f0812bea3c538b9ec..b01c19122eff17f6f5fdfa5b7d9fd9ab3f8feffd 100644 (file)
Binary files a/doc/pl/images/button-set-as-default.gif and b/doc/pl/images/button-set-as-default.gif differ
index 6610735e41d8c0d3be6bf564e8a6f0f111bcbea4..ed026d57ecd0a696fd11f5081dff3d5df7025657 100644 (file)
Binary files a/doc/pl/images/button-set-printer-options.gif and b/doc/pl/images/button-set-printer-options.gif differ
index 82751977db94cfa4a2431fb6d9ba3212575d5165..ac9d4e05f446d3b64929884a0c20ecbe722b2705 100644 (file)
Binary files a/doc/pl/images/button-show-active.gif and b/doc/pl/images/button-show-active.gif differ
index 0473ee62638671fecb3a840bc9de6167c8f0a551..0bd0388225c1d2d1bccf716023c6da51b23ad176 100644 (file)
Binary files a/doc/pl/images/button-show-all.gif and b/doc/pl/images/button-show-all.gif differ
index 5481f4d9a7101bb8e0e948153f9a0da0991e7af1..d27b3074c54f6122418b0e41d9620ade9e908ff5 100644 (file)
Binary files a/doc/pl/images/button-show-completed.gif and b/doc/pl/images/button-show-completed.gif differ
index 3fdf85798153637310627d54bbb2710d110fdd5f..a584f885ad3c99b4299ece98f39f06605e495f54 100644 (file)
Binary files a/doc/pl/images/button-show-next.gif and b/doc/pl/images/button-show-next.gif differ
index 8a6f8c4cf484cddd6c0771b161dd26df616b1aa2..64613b9ec0845505709e56044eb4f402a4c7cc05 100644 (file)
Binary files a/doc/pl/images/button-show-previous.gif and b/doc/pl/images/button-show-previous.gif differ
index 5a88283f334ef865cfbf6e24ca1f232cfd7939f4..993cf6a93aee0df7aa31ea9636166b7e70a71e1d 100644 (file)
Binary files a/doc/pl/images/button-sort-ascending.gif and b/doc/pl/images/button-sort-ascending.gif differ
index 61c85de29e5f18df35e7a837b823327065ccba1d..fbc5e966dd052c37317b90b7b865d756389ea0da 100644 (file)
Binary files a/doc/pl/images/button-sort-descending.gif and b/doc/pl/images/button-sort-descending.gif differ
index 85c098a38a3bffe13fee42003896a6701606d323..834f8a1254ff8e708c26601e745803a61b9f05e3 100644 (file)
Binary files a/doc/pl/images/button-start-class.gif and b/doc/pl/images/button-start-class.gif differ
index cd1734cce7bcf8107c18ea34ac9fecb1119d6b34..7d86be593c0121a339cad5b59fefbda15b169040 100644 (file)
Binary files a/doc/pl/images/button-start-printer.gif and b/doc/pl/images/button-start-printer.gif differ
index 8031731a4599854d145b198dffd905d053e451f3..c1f96cc85bd5223e81abded6cb55c3279d760b86 100644 (file)
Binary files a/doc/pl/images/button-stop-class.gif and b/doc/pl/images/button-stop-class.gif differ
index ce485f3a16ba177971f378394a751743aa556b69..34bf39da66a5c98c8fb5400ca23f2dc5fc9c54b0 100644 (file)
Binary files a/doc/pl/images/button-stop-printer.gif and b/doc/pl/images/button-stop-printer.gif differ
index 2842a3e1806fcf40b2d28af24d42f4863783f3dc..fdb48f32de5030ea1c496aae3f532ea25b503bd8 100644 (file)
Binary files a/doc/pl/images/button-unpublish-printer.gif and b/doc/pl/images/button-unpublish-printer.gif differ
index 47697cde896ccc4088762ce12db7f196911563d2..578cd05ac94dd82aa9f0988b0b5119f20cd5adee 100644 (file)
Binary files a/doc/pl/images/button-use-default-config.gif and b/doc/pl/images/button-use-default-config.gif differ
index 5d89af521454b3ce89ebf558d88a8baed7eb372f..b6ffd0ab49f4341c4418aa2e3d270e6fd67bc714 100644 (file)
Binary files a/doc/pl/images/button-view-access-log.gif and b/doc/pl/images/button-view-access-log.gif differ
index c99078ad81bec964609dc5feed96ed4b2b7e592a..bbdd548f4183a08f0925135ca6bdbd7cb324e3c1 100644 (file)
Binary files a/doc/pl/images/button-view-error-log.gif and b/doc/pl/images/button-view-error-log.gif differ
index ad49a2f4fc8aaaaefd3d838e7c7046554b372e29..30b3a7e0cb9f354f3df4a59d7a149ff91419164b 100644 (file)
Binary files a/doc/pl/images/button-view-page-log.gif and b/doc/pl/images/button-view-page-log.gif differ
index 27ae97c763e3a512c98bb9506cbc1b0f9f8680a8..726cd3a744f67ba6dbabe6aae31ee809d47f57a6 100644 (file)
Binary files a/doc/pl/images/button-view-printable-version.gif and b/doc/pl/images/button-view-printable-version.gif differ
index 3e1651576e7b5f4c51582f84abeb0ddc14c5ff01..528839bc1fca8118a8c1ce7788e0cd7072a15fbf 100644 (file)
@@ -33,6 +33,7 @@ TARGETS       =       $(FILTERS) \
                libcupsimage.a \
                $(LIB32CUPSIMAGE) \
                $(LIB64CUPSIMAGE) \
+               rasterbench \
                testimage \
                testraster
 
@@ -47,7 +48,7 @@ IMAGE64OBJS = $(IMAGEOBJS:.o=.64.o)
 FORMOBJS =     form-attr.o form-main.o form-ps.o form-text.o form-tree.o
 OBJS   =       $(HPGLOBJS) $(IMAGEOBJS) $(FORMOBJS) \
                gziptoany.o imagetops.o imagetoraster.o common.o pstops.o \
-               raster.o rastertoepson.o rastertohp.o rastertolabel.o \
+               rasterbench.o rastertoepson.o rastertohp.o rastertolabel.o \
                testimage.o testraster.o textcommon.o texttops.o
 
 
@@ -118,12 +119,12 @@ installhdrs:
 install32bit:
        $(INSTALL_DIR) -m 755 $(LIB32DIR)
        $(INSTALL_LIB) 32bit/libcupsimage.so.2 $(LIB32DIR)/libcupsimage.so.2
-       $(LN) libcupsimage.so $(LIB32DIR)/libcupsimage.so.2
+       $(LN) libcupsimage.so.2 $(LIB32DIR)/libcupsimage.so
 
 install64bit:
        $(INSTALL_DIR) -m 755 $(LIB64DIR)
        $(INSTALL_LIB) 64bit/libcupsimage.so.2 $(LIB64DIR)/libcupsimage.so.2
-       $(LN) libcupsimage.so $(LIB64DIR)/libcupsimage.so.2
+       $(LN) libcupsimage.so.2 $(LIB64DIR)/libcupsimage.so
 
 
 #
@@ -359,6 +360,15 @@ testraster:        testraster.o raster.o
        $(CC) $(LDFLAGS) -o $@ testraster.o raster.o
 
 
+#
+# rasterbench
+#
+
+rasterbench:   rasterbench.o raster.o
+       echo Linking $@...
+       $(CC) $(LDFLAGS) -o $@ rasterbench.o raster.o
+
+
 #
 # texttops
 #
index 9978ba94a54acb502fa1c3d5ac6943c326dfbf72..da16eb0e55154a0062934489961631c072142e7b 100644 (file)
@@ -49,6 +49,7 @@
  *   set_pstops_options() - Set pstops options...
  *   skip_page()          - Skip past a page that won't be printed...
  *   start_nup()          - Start processing for N-up printing...
+ *   write_labels()       - Write the actual page labels.
  */
 
 /*
@@ -204,6 +205,7 @@ static size_t               skip_page(cups_file_t *fp, char *line, size_t linelen,
                                  size_t linesize);
 static void            start_nup(pstops_doc_t *doc, int number,
                                  int show_border, const int *bounding_box);
+static void            write_labels(pstops_doc_t *doc, int orient);
 
 
 /*
@@ -1305,6 +1307,9 @@ copy_page(cups_file_t  *fp,               /* I - File to read from */
 
   if (first_page)
   {
+    char       *page_setup;            /* PageSetup commands to send */
+
+
     doc_puts(doc, "%%BeginPageSetup\n");
 
     if (pageinfo->num_options > 0)
@@ -1344,20 +1349,28 @@ copy_page(cups_file_t  *fp,             /* I - File to read from */
       */
 
       if (doc_setup)
+      {
        doc_puts(doc, doc_setup);
+       free(doc_setup);
+      }
 
       if (any_setup)
+      {
        doc_puts(doc, any_setup);
+       free(any_setup);
+      }
+    }
 
-     /*
-      * Free the command strings...
-      */
+   /*
+    * Output commands for the current page...
+    */
 
-      if (doc_setup)
-       free(doc_setup);
+    page_setup = ppdEmitString(ppd, PPD_ORDER_PAGE, 0);
 
-      if (any_setup)
-       free(any_setup);
+    if (page_setup)
+    {
+      doc_puts(doc, page_setup);
+      free(page_setup);
     }
   }
 
@@ -1856,15 +1869,15 @@ end_nup(pstops_doc_t *doc,              /* I - Document information */
         int          number)           /* I - Page number */
 {
   if (doc->mirror || Orientation || doc->number_up > 1)
-    puts("userdict/ESPsave get restore");
+    doc_puts(doc, "userdict/ESPsave get restore\n");
 
   switch (doc->number_up)
   {
     case 1 :
        if (doc->use_ESPshowpage)
        {
-         WriteLabels(Orientation);
-          puts("ESPshowpage");
+         write_labels(doc, Orientation);
+          doc_puts(doc, "ESPshowpage\n");
        }
        break;
 
@@ -1878,7 +1891,7 @@ end_nup(pstops_doc_t *doc,                /* I - Document information */
            * Rotate the labels back to portrait...
            */
 
-           WriteLabels(Orientation - 1);
+           write_labels(doc, Orientation - 1);
          }
          else if (Orientation == 0)
          {
@@ -1886,7 +1899,7 @@ end_nup(pstops_doc_t *doc,                /* I - Document information */
            * Rotate the labels to landscape...
            */
 
-           WriteLabels(doc->normal_landscape ? 1 : 3);
+           write_labels(doc, doc->normal_landscape ? 1 : 3);
          }
          else
          {
@@ -1894,18 +1907,18 @@ end_nup(pstops_doc_t *doc,              /* I - Document information */
            * Rotate the labels to landscape...
            */
 
-           WriteLabels(doc->normal_landscape ? 3 : 1);
+           write_labels(doc, doc->normal_landscape ? 3 : 1);
          }
 
-          puts("ESPshowpage");
+          doc_puts(doc, "ESPshowpage\n");
        }
         break;
 
     default :
        if (is_last_page(number) && doc->use_ESPshowpage)
        {
-         WriteLabels(Orientation);
-          puts("ESPshowpage");
+         write_labels(doc, Orientation);
+          doc_puts(doc, "ESPshowpage\n");
        }
         break;
   }
@@ -2934,6 +2947,52 @@ start_nup(pstops_doc_t *doc,             /* I - Document information */
 }
 
 
+/*
+ * 'write_labels()' - Write the actual page labels.
+ *
+ * This function is a copy of the one in common.c since we need to
+ * use doc_puts/doc_printf instead of puts/printf...
+ */
+
+static void
+write_labels(pstops_doc_t *doc,                /* I - Document information */
+             int          orient)      /* I - Orientation of the page */
+{
+  float        width,                          /* Width of page */
+       length;                         /* Length of page */
+
+
+  doc_puts(doc, "gsave\n");
+
+  if ((orient ^ Orientation) & 1)
+  {
+    width  = PageLength;
+    length = PageWidth;
+  }
+  else
+  {
+    width  = PageWidth;
+    length = PageLength;
+  }
+
+  switch (orient & 3)
+  {
+    case 1 : /* Landscape */
+        doc_printf(doc, "%.1f 0.0 translate 90 rotate\n", length);
+        break;
+    case 2 : /* Reverse Portrait */
+        doc_printf(doc, "%.1f %.1f translate 180 rotate\n", width, length);
+        break;
+    case 3 : /* Reverse Landscape */
+        doc_printf(doc, "0.0 %.1f translate -90 rotate\n", width);
+        break;
+  }
+
+  doc_puts(doc, "ESPwl\n");
+  doc_puts(doc, "grestore\n");
+}
+
+
 /*
  * End of "$Id$".
  */
index 45bc06f849ee75e6f9743b5da52ce37587f8c82a..953f359c4cd71ec6fcd32b9a0e0fc0843432e332 100644 (file)
  *
  * Contents:
  *
- *   cupsRasterClose()        - Close a raster stream.
- *   cupsRasterOpen()         - Open a raster stream.
- *   cupsRasterReadHeader()   - Read a raster page header and store it in a
- *                              V1 page header structure.
- *   cupsRasterReadHeader2()  - Read a raster page header and store it in a
- *                              V2 page header structure.
- *   cupsRasterReadPixels()   - Read raster pixels.
- *   cupsRasterWriteHeader()  - Write a raster page header from a V1 page
- *                              header structure.
- *   cupsRasterWriteHeader2() - Write a raster page header from a V2 page
- *                              header structure.
- *   cupsRasterWritePixels()  - Write raster pixels.
- *   cups_raster_update()     - Update the raster header and row count for the
- *                              current page.
- *   cups_raster_write()      - Write a row of raster data...
- *   cups_read()              - Read bytes from a file.
- *   cups_write()             - Write bytes to a file.
+ *   cupsRasterClose()         - Close a raster stream.
+ *   cupsRasterOpen()          - Open a raster stream.
+ *   cupsRasterReadHeader()    - Read a raster page header and store it in a
+ *                               V1 page header structure.
+ *   cupsRasterReadHeader2()   - Read a raster page header and store it in a
+ *                               V2 page header structure.
+ *   cupsRasterReadPixels()    - Read raster pixels.
+ *   cupsRasterWriteHeader()   - Write a raster page header from a V1 page
+ *                               header structure.
+ *   cupsRasterWriteHeader2()  - Write a raster page header from a V2 page
+ *                               header structure.
+ *   cupsRasterWritePixels()   - Write raster pixels.
+ *   cups_raster_read()        - Read through the raster buffer.
+ *   cups_raster_read_header() - Read a raster page header.
+ *   cups_raster_update()      - Update the raster header and row count for the
+ *                               current page.
+ *   cups_raster_write()       - Write a row of raster data...
+ *   cups_read()               - Read bytes from a file.
+ *   cups_swap()               - Swap bytes in raster data...
+ *   cups_write()              - Write bytes to a file.
  */
 
 /*
@@ -58,7 +61,7 @@
  */
 
 #include "raster.h"
-#include <stdio.h>
+#include <cups/debug.h>
 #include <stdlib.h>
 #include <errno.h>
 #include <cups/string.h>
@@ -86,16 +89,26 @@ struct _cups_raster_s                       /**** Raster stream data ****/
   unsigned char                *pixels,        /* Pixels for current row */
                        *pend,          /* End of pixel buffer */
                        *pcurrent;      /* Current byte in pixel buffer */
+  int                  compressed,     /* Non-zero if data is compressed */
+                       swapped;        /* Non-zero if data is byte-swapped */
+  unsigned char                *buffer,        /* Read/write buffer */
+                       *bufptr,        /* Current (read) position in buffer */
+                       *bufend;        /* End of current (read) buffer */
+  int                  bufsize;        /* Buffer size */
 };
 
+
 /*
  * Local functions...
  */
 
 static unsigned        cups_raster_read_header(cups_raster_t *r);
+static int     cups_raster_read(cups_raster_t *r, unsigned char *buf,
+                                int bytes);
 static void    cups_raster_update(cups_raster_t *r);
-static int     cups_raster_write(cups_raster_t *r);
+static int     cups_raster_write(cups_raster_t *r, const unsigned char *pixels);
 static int     cups_read(int fd, unsigned char *buf, int bytes);
+static void    cups_swap(unsigned char *buf, int bytes);
 static int     cups_write(int fd, const unsigned char *buf, int bytes);
 
 
@@ -108,6 +121,9 @@ cupsRasterClose(cups_raster_t *r)   /* I - Stream to close */
 {
   if (r != NULL)
   {
+    if (r->buffer)
+      free(r->buffer);
+
     if (r->pixels)
       free(r->pixels);
 
@@ -131,7 +147,7 @@ cupsRasterOpen(int         fd,              /* I - File descriptor */
     return (NULL);
 
   r->fd   = fd;
-  r->mode = mode;
+  r->mode = mode == CUPS_RASTER_WRITE_COMPRESSED ? CUPS_RASTER_WRITE : mode;
 
   if (mode == CUPS_RASTER_READ)
   {
@@ -139,8 +155,7 @@ cupsRasterOpen(int         fd,              /* I - File descriptor */
     * Open for read - get sync word...
     */
 
-    if (cups_read(r->fd, (unsigned char *)&(r->sync), sizeof(r->sync))
-            < sizeof(r->sync))
+    if (!cups_read(r->fd, (unsigned char *)&(r->sync), sizeof(r->sync)))
     {
       free(r);
       return (NULL);
@@ -149,11 +164,22 @@ cupsRasterOpen(int         fd,            /* I - File descriptor */
     if (r->sync != CUPS_RASTER_SYNC &&
         r->sync != CUPS_RASTER_REVSYNC &&
         r->sync != CUPS_RASTER_SYNCv1 &&
-        r->sync != CUPS_RASTER_REVSYNCv1)
+        r->sync != CUPS_RASTER_REVSYNCv1 &&
+        r->sync != CUPS_RASTER_SYNCv2 &&
+        r->sync != CUPS_RASTER_REVSYNCv2)
     {
       free(r);
       return (NULL);
     }
+
+    if (r->sync == CUPS_RASTER_SYNCv2 ||
+        r->sync == CUPS_RASTER_REVSYNCv2)
+      r->compressed = 1;
+
+    if (r->sync == CUPS_RASTER_REVSYNC ||
+        r->sync == CUPS_RASTER_REVSYNCv1 ||
+        r->sync == CUPS_RASTER_REVSYNCv2)
+      r->swapped = 1;
   }
   else
   {
@@ -161,7 +187,14 @@ cupsRasterOpen(int         fd,             /* I - File descriptor */
     * Open for write - put sync word...
     */
 
-    r->sync = CUPS_RASTER_SYNC;
+    if (mode == CUPS_RASTER_WRITE_COMPRESSED)
+    {
+      r->compressed = 1;
+      r->sync       = CUPS_RASTER_SYNCv2;
+    }
+    else
+      r->sync = CUPS_RASTER_SYNC;
+
     if (cups_write(r->fd, (unsigned char *)&(r->sync), sizeof(r->sync))
             < sizeof(r->sync))
     {
@@ -240,15 +273,51 @@ cupsRasterReadPixels(cups_raster_t *r,    /* I - Raster stream */
                     unsigned      len) /* I - Number of bytes to read */
 {
   int          bytes;                  /* Bytes read */
+  unsigned     cupsBytesPerLine;       /* cupsBytesPerLine value */
   unsigned     remaining;              /* Bytes remaining */
   unsigned char        *ptr,                   /* Pointer to read buffer */
-               byte;                   /* Byte from file */
+               byte,                   /* Byte from file */
+               *temp;                  /* Pointer into buffer */
+  int          count;                  /* Repetition count */
 
 
   if (r == NULL || r->mode != CUPS_RASTER_READ || r->remaining == 0)
     return (0);
 
-  remaining = len;
+  if (!r->compressed)
+  {
+   /*
+    * Read without compression...
+    */
+
+    r->remaining -= len / r->header.cupsBytesPerLine;
+
+    if (!cups_read(r->fd, p, len))
+      return (0);
+
+   /*
+    * Swap bytes as needed...
+    */
+
+    if ((r->header.cupsBitsPerColor == 16 ||
+         r->header.cupsBitsPerPixel == 12 ||
+         r->header.cupsBitsPerPixel == 16) &&
+        r->swapped)
+      cups_swap(p, len);
+
+   /*
+    * Return...
+    */
+
+    return (len);
+  }
+
+ /*
+  * Read compressed data...
+  */
+
+  remaining        = len;
+  cupsBytesPerLine = r->header.cupsBytesPerLine;
 
   while (remaining > 0 && r->remaining > 0)
   {
@@ -258,127 +327,99 @@ cupsRasterReadPixels(cups_raster_t *r,   /* I - Raster stream */
       * Need to read a new row...
       */
 
-      if (remaining == r->header.cupsBytesPerLine)
+      if (remaining == cupsBytesPerLine)
        ptr = p;
       else
        ptr = r->pixels;
 
-      if (r->sync == CUPS_RASTER_SYNCv1 || r->sync == CUPS_RASTER_REVSYNCv1)
-      {
-       /*
-       * Read without compression...
-       */
+     /*
+      * Read using a modified TIFF "packbits" compression...
+      */
 
-        if (cups_read(r->fd, ptr, r->header.cupsBytesPerLine) <
-               r->header.cupsBytesPerLine)
-         return (0);
+      if (!cups_raster_read(r, &byte, 1))
+       return (0);
 
-        r->count = 1;
-      }
-      else
+      r->count = byte + 1;
+
+      if (r->count > 1)
+       ptr = r->pixels;
+
+      temp  = ptr;
+      bytes = cupsBytesPerLine;
+
+      while (bytes > 0)
       {
        /*
-        * Read using a modified TIFF "packbits" compression...
+       * Get a new repeat count...
        */
 
-        unsigned char  *temp;          /* Pointer into buffer */
-       int             count;          /* Repetition count */
-
-
-        if (cups_read(r->fd, &byte, 1) < 1)
+        if (!cups_raster_read(r, &byte, 1))
          return (0);
 
-        r->count = byte + 1;
-
-        if (r->count > 1)
-         ptr = r->pixels;
-
-        temp  = ptr;
-       bytes = r->header.cupsBytesPerLine;
-
-       while (bytes > 0)
+       if (byte & 128)
        {
         /*
-         * Get a new repeat count...
+         * Copy N literal pixels...
          */
 
-          if (cups_read(r->fd, &byte, 1) < 1)
-           return (0);
+         count = (257 - byte) * r->bpp;
 
-         if (byte & 128)
-         {
-          /*
-           * Copy N literal pixels...
-           */
+          if (count > bytes)
+           count = bytes;
 
-           count = (257 - byte) * r->bpp;
-
-            if (count > bytes)
-             count = bytes;
+          if (!cups_raster_read(r, temp, count))
+           return (0);
 
-            if (cups_read(r->fd, temp, count) < count)
-             return (0);
+         temp  += count;
+         bytes -= count;
+       }
+       else
+       {
+        /*
+         * Repeat the next N bytes...
+         */
 
-           temp  += count;
-           bytes -= count;
-         }
-         else
-         {
-          /*
-           * Repeat the next N bytes...
-           */
+          count = (byte + 1) * r->bpp;
+          if (count > bytes)
+           count = bytes;
 
-            count = (byte + 1) * r->bpp;
-            if (count > bytes)
-             count = bytes;
+          if (count < r->bpp)
+           break;
 
-            if (count < r->bpp)
-             break;
+         bytes -= count;
 
-           bytes -= count;
+          if (!cups_raster_read(r, temp, r->bpp))
+           return (0);
 
-            if (cups_read(r->fd, temp, r->bpp) < r->bpp)
-             return (0);
+         temp  += r->bpp;
+         count -= r->bpp;
 
+         while (count > 0)
+         {
+           memcpy(temp, temp - r->bpp, r->bpp);
            temp  += r->bpp;
            count -= r->bpp;
-
-           while (count > 0)
-           {
-             memcpy(temp, temp - r->bpp, r->bpp);
-             temp  += r->bpp;
-             count -= r->bpp;
-            }
-         }
+          }
        }
       }
 
+     /*
+      * Swap bytes as needed...
+      */
+
       if ((r->header.cupsBitsPerColor == 16 ||
            r->header.cupsBitsPerPixel == 12 ||
            r->header.cupsBitsPerPixel == 16) &&
-          (r->sync == CUPS_RASTER_REVSYNC || r->sync == CUPS_RASTER_REVSYNCv1))
-      {
-       /*
-       * Swap bytes in the pixel data...
-       */
-
-        unsigned char  *temp;
-       int             count;
+          r->swapped)
+        cups_swap(ptr, bytes);
 
+     /*
+      * Update pointers...
+      */
 
-        for (temp = ptr, count = r->header.cupsBytesPerLine;
-            count > 0;
-            temp += 2, count -= 2)
-       {
-         byte    = temp[0];
-         temp[0] = temp[1];
-         temp[1] = byte;
-       }
-      }
-
-      if (remaining >= r->header.cupsBytesPerLine)
+      if (remaining >= cupsBytesPerLine)
       {
-       bytes       = r->header.cupsBytesPerLine;
+       bytes       = cupsBytesPerLine;
         r->pcurrent = r->pixels;
        r->count --;
        r->remaining --;
@@ -389,6 +430,10 @@ cupsRasterReadPixels(cups_raster_t *r,     /* I - Raster stream */
         r->pcurrent = r->pixels + bytes;
       }
 
+     /*
+      * Copy data as needed...
+      */
+
       if (ptr != p)
         memcpy(p, ptr, bytes);
     }
@@ -506,8 +551,22 @@ cupsRasterWritePixels(cups_raster_t *r,    /* I - Raster stream */
   if (r == NULL || r->mode != CUPS_RASTER_WRITE || r->remaining == 0)
     return (0);
 
-  for (remaining = len; remaining > 0; remaining -= bytes, p += bytes)
+  if (!r->compressed)
+  {
+   /*
+    * Without compression, just write the raster data raw...
+    */
+
+    r->remaining -= len / r->header.cupsBytesPerLine;
+
+    return (cups_write(r->fd, p, len));
+  }
+
+ /*
+  * Otherwise, compress each line...
+  */
 
+  for (remaining = len; remaining > 0; remaining -= bytes, p += bytes)
   {
    /*
     * Figure out the number of remaining bytes on the current line...
@@ -524,7 +583,7 @@ cupsRasterWritePixels(cups_raster_t *r,     /* I - Raster stream */
 
       if (memcmp(p, r->pcurrent, bytes))
       {
-        if (!cups_raster_write(r))
+        if (!cups_raster_write(r, r->pixels))
          return (0);
 
        r->count = 0;
@@ -553,10 +612,10 @@ cupsRasterWritePixels(cups_raster_t *r,   /* I - Raster stream */
          r->remaining --;
 
          if (r->remaining == 0)
-           return (cups_raster_write(r));
+           return (cups_raster_write(r, r->pixels));
          else if (r->count == 256)
          {
-           if (cups_raster_write(r) == 0)
+           if (cups_raster_write(r, r->pixels) == 0)
              return (0);
 
            r->count = 0;
@@ -593,7 +652,7 @@ cupsRasterWritePixels(cups_raster_t *r,     /* I - Raster stream */
        r->remaining --;
 
        if (r->remaining == 0)
-         return (cups_raster_write(r));
+         return (cups_raster_write(r, r->pixels));
       }
     }
   }
@@ -636,14 +695,14 @@ cups_raster_read_header(
 
   memset(&(r->header), 0, sizeof(r->header));
 
-  if (cups_read(r->fd, (unsigned char *)&(r->header), len) < len)
+  if (cups_raster_read(r, (unsigned char *)&(r->header), len) < len)
     return (0);
 
  /*
   * Swap bytes as needed...
   */
 
-  if (r->sync == CUPS_RASTER_REVSYNC || r->sync == CUPS_RASTER_REVSYNCv1)
+  if (r->swapped)
     for (len = 81, s = (union swap_s *)&(r->header.AdvanceDistance);
         len > 0;
         len --, s ++)
@@ -659,6 +718,144 @@ cups_raster_read_header(
 }
 
 
+/*
+ * 'cups_raster_read()' - Read through the raster buffer.
+ */
+
+static int                             /* O - Number of bytes read */
+cups_raster_read(cups_raster_t *r,     /* I - Raster stream */
+                 unsigned char *buf,   /* I - Buffer */
+                 int           bytes)  /* I - Number of bytes to read */
+{
+  int          count,                  /* Number of bytes read */
+               remaining,              /* Remaining bytes in buffer */
+               total;                  /* Total bytes read */
+
+
+  DEBUG_printf(("cups_raster_read(r=%p, buf=%p, bytes=%d)\n", r, buf, bytes));
+
+  if (!r->compressed)
+    return (cups_read(r->fd, buf, bytes));
+
+ /*
+  * Allocate a read buffer as needed...
+  */
+
+  count = 2 * r->header.cupsBytesPerLine;
+
+  if (count > r->bufsize)
+  {
+    int offset = r->bufptr - r->buffer;        /* Offset to current start of buffer */
+    int end = r->bufend - r->buffer;   /* Offset to current end of buffer */
+    unsigned char *rptr;               /* Pointer in read buffer */
+
+    if (r->buffer)
+      rptr = realloc(r->buffer, count);
+    else
+      rptr = malloc(count);
+
+    if (!rptr)
+      return (0);
+
+    r->buffer  = rptr;
+    r->bufptr  = rptr + offset;
+    r->bufend  = rptr + end;
+    r->bufsize = count;
+  }
+
+ /*
+  * Loop until we have read everything...
+  */
+
+  for (total = 0, remaining = r->bufend - r->bufptr;
+       total < bytes;
+       total += count, buf += count)
+  {
+    count = bytes - total;
+
+    DEBUG_printf(("count=%d, remaining=%d, buf=%p, bufptr=%p, bufend=%p...\n",
+                  count, remaining, buf, r->bufptr, r->bufend));
+
+    if (remaining == 0)
+    {
+      if (count < 16)
+      {
+       /*
+        * Read into the raster buffer and then copy...
+       */
+
+        remaining = cups_read(r->fd, r->buffer, r->bufsize);
+       if (remaining <= 0)
+         return (0);
+
+       r->bufptr = r->buffer;
+       r->bufend = r->buffer + remaining;
+      }
+      else
+      {
+       /*
+        * Read directly into "buf"...
+       */
+
+       count = cups_read(r->fd, buf, count);
+
+       if (count <= 0)
+         return (0);
+
+       continue;
+      }
+    }
+
+   /*
+    * Copy bytes from raster buffer to "buf"...
+    */
+
+    if (count > remaining)
+      count = remaining;
+
+    if (count == 1)
+    {
+     /*
+      * Copy 1 byte...
+      */
+
+      *buf = *(r->bufptr)++;
+      remaining --;
+    }
+    else if (count < 128)
+    {
+     /*
+      * Copy up to 127 bytes without using memcpy(); this is
+      * faster because it avoids an extra function call and is
+      * often further optimized by the compiler...
+      */
+
+      unsigned char    *bufptr;        /* Temporary buffer pointer */
+
+
+      remaining -= count;
+
+      for (bufptr = r->bufptr; count > 0; count --, total ++)
+       *buf++ = *bufptr++;
+
+      r->bufptr = bufptr;
+    }
+    else
+    {
+     /*
+      * Use memcpy() for a large read...
+      */
+
+      memcpy(buf, r->bufptr, count);
+      r->bufptr += count;
+      remaining -= count;
+    }
+  }
+
+  return (total);
+}
+
+
 /*
  * 'cups_raster_update()' - Update the raster header and row count for the
  *                          current page.
@@ -745,117 +942,107 @@ cups_raster_update(cups_raster_t *r)    /* I - Raster stream */
     r->remaining = r->header.cupsHeight;
 
  /*
-  * Allocate the read/write buffer...
+  * Allocate the compression buffer...
   */
 
-  if (r->pixels != NULL)
-    free(r->pixels);
+  if (r->compressed)
+  {
+    if (r->pixels != NULL)
+      free(r->pixels);
 
-  r->pixels   = calloc(r->header.cupsBytesPerLine, 1);
-  r->pcurrent = r->pixels;
-  r->pend     = r->pixels + r->header.cupsBytesPerLine;
-  r->count    = 0;
+    r->pixels   = calloc(r->header.cupsBytesPerLine, 1);
+    r->pcurrent = r->pixels;
+    r->pend     = r->pixels + r->header.cupsBytesPerLine;
+    r->count    = 0;
+  }
 }
 
 
 /*
- * 'cups_raster_write()' - Write a row of raster data...
+ * 'cups_raster_write()' - Write a row of compressed raster data...
  */
 
 static int                             /* O - Number of bytes written */
-cups_raster_write(cups_raster_t *r)    /* I - Raster stream */
+cups_raster_write(
+    cups_raster_t       *r,            /* I - Raster stream */
+    const unsigned char *pixels)       /* I - Pixel data to write */
 {
-  unsigned char        *start,                 /* Start of sequence */
-               *ptr,                   /* Current pointer in sequence */
-               byte;                   /* Byte to write */
-  int          count;                  /* Count */
+  const unsigned char  *start,         /* Start of sequence */
+                       *ptr,           /* Current pointer in sequence */
+                       *pend,          /* End of raster buffer */
+                       *plast;         /* Pointer to last pixel */
+  unsigned char                *wptr;          /* Pointer into write buffer */
+  int                  bpp,            /* Bytes per pixel */
+                       count,          /* Count */
+                       maxrun;         /* Maximum run of 128 * bpp */
 
 
 #ifdef DEBUG
-  fprintf(stderr, "cups_raster_write(r=%p)\n", r);
+  fprintf(stderr, "cups_raster_write(r=%p, pixels=%p)\n", r, pixels);
 #endif /* DEBUG */
 
  /*
-  * Write the row repeat count...
+  * Allocate a write buffer as needed...
   */
 
-  byte = r->count - 1;
-
-  if (cups_write(r->fd, &byte, 1) < 1)
+  count = r->header.cupsBytesPerLine * 2;
+  if (count > r->bufsize)
   {
-#ifdef DEBUG
-    fputs("cups_raster_write: Unable to write row repeat count...\n",
-          stderr);
-#endif /* DEBUG */
+    if (r->buffer)
+      wptr = realloc(r->buffer, count);
+    else
+      wptr = malloc(count);
 
-    return (0);
+    if (!wptr)
+      return (-1);
+
+    r->buffer  = wptr;
+    r->bufsize = count;
   }
 
+ /*
+  * Write the row repeat count...
+  */
+
+  bpp     = r->bpp;
+  pend    = pixels + r->header.cupsBytesPerLine;
+  plast   = pend - bpp;
+  wptr    = r->buffer;
+  *wptr++ = r->count - 1;
+  maxrun  = 128 * bpp;
+
  /*
   * Write using a modified TIFF "packbits" compression...
   */
 
-  for (ptr = r->pixels; ptr < r->pend;)
+  for (ptr = pixels; ptr < pend;)
   {
     start = ptr;
-    ptr += r->bpp;
+    ptr += bpp;
 
-    if (ptr == r->pend)
+    if (ptr == pend)
     {
      /*
       * Encode a single pixel at the end...
       */
 
-      byte = 0;
-      if (cups_write(r->fd, &byte, 1) < 1)
-      {
-#ifdef DEBUG
-        fputs("cups_raster_write: Unable to write last pixel count...\n", stderr);
-#endif /* DEBUG */
-
-        return (0);
-      }
-
-      if (cups_write(r->fd, start, r->bpp) < r->bpp)
-      {
-#ifdef DEBUG
-        fputs("cups_raster_write: Unable to write last pixel data...\n", stderr);
-#endif /* DEBUG */
-
-        return (0);
-      }
+      *wptr++ = 0;
+      for (count = bpp; count > 0; count --)
+        *wptr++ = *start++;
     }
-    else if (!memcmp(start, ptr, r->bpp))
+    else if (!memcmp(start, ptr, bpp))
     {
      /*
       * Encode a sequence of repeating pixels...
       */
 
-      for (count = 2; count < 128 && ptr < (r->pend - r->bpp); count ++, ptr += r->bpp)
-        if (memcmp(ptr, ptr + r->bpp, r->bpp) != 0)
+      for (count = 2; count < 128 && ptr < plast; count ++, ptr += bpp)
+        if (memcmp(ptr, ptr + bpp, bpp))
          break;
 
-      ptr += r->bpp;
-
-      byte = count - 1;
-
-      if (cups_write(r->fd, &byte, 1) < 1)
-      {
-#ifdef DEBUG
-        fputs("cups_raster_write: Unable to write repeated pixel count...\n", stderr);
-#endif /* DEBUG */
-
-        return (0);
-      }
-
-      if (cups_write(r->fd, start, r->bpp) < r->bpp)
-      {
-#ifdef DEBUG
-        fputs("cups_raster_write: Unable to write repeated pixel data...\n", stderr);
-#endif /* DEBUG */
-
-        return (0);
-      }
+      *wptr++ = count - 1;
+      for (count = bpp; count > 0; count --)
+        *wptr++ = *ptr++;
     }
     else
     {
@@ -863,41 +1050,25 @@ cups_raster_write(cups_raster_t *r)      /* I - Raster stream */
       * Encode a sequence of non-repeating pixels...
       */
 
-      for (count = 1; count < 127 && ptr < (r->pend - r->bpp); count ++, ptr += r->bpp)
-        if (!memcmp(ptr, ptr + r->bpp, r->bpp))
+      for (count = 1; count < 127 && ptr < plast; count ++, ptr += bpp)
+        if (!memcmp(ptr, ptr + bpp, bpp))
          break;
 
-      if (ptr >= (r->pend - r->bpp) && count < 128)
+      if (ptr >= plast && count < 128)
       {
         count ++;
-       ptr += r->bpp;
+       ptr += bpp;
       }
  
-      byte = 257 - count;
-
-      if (cups_write(r->fd, &byte, 1) < 1)
-      {
-#ifdef DEBUG
-        fputs("cups_raster_write: Unable to write non-repeating pixel count...\n", stderr);
-#endif /* DEBUG */
+      *wptr++ = 257 - count;
 
-        return (0);
-      }
-
-      count *= r->bpp;
-
-      if (cups_write(r->fd, start, count) < count)
-      {
-#ifdef DEBUG
-        fputs("cups_raster_write: Unable to write non-repeating pixel data...\n", stderr);
-#endif /* DEBUG */
-
-        return (0);
-      }
+      count *= bpp;
+      memcpy(wptr, start, count);
+      wptr += count;
     }
   }
 
-  return (r->header.cupsBytesPerLine);
+  return (cups_write(r->fd, r->buffer, wptr - r->buffer));
 }
 
 
@@ -933,6 +1104,32 @@ cups_read(int           fd,               /* I - File descriptor */
 }
 
 
+/*
+ * 'cups_swap()' - Swap bytes in raster data...
+ */
+
+static void
+cups_swap(unsigned char *buf,          /* I - Buffer to swap */
+          int           bytes)         /* I - Number of bytes to swap */
+{
+  unsigned char        even, odd;              /* Temporary variables */
+
+
+  bytes /= 2;
+
+  while (bytes > 0)
+  {
+    even   = buf[0];
+    odd    = buf[1];
+    buf[0] = odd;
+    buf[1] = even;
+
+    buf += 2;
+    bytes --;
+  }
+}
+
+
 /*
  * 'cups_write()' - Write bytes to a file.
  */
index bb74543e1122d93555e3169661aaeb67aeedc688..8fc41b88fe222871874215752602f4f5830a85dd 100644 (file)
@@ -60,12 +60,15 @@ extern "C" {
  * Constants...
  */
 
-#  define CUPS_RASTER_SYNC     0x52615332      /* RaS2 */
-#  define CUPS_RASTER_REVSYNC  0x32536152      /* 2SaR */
+#  define CUPS_RASTER_SYNC     0x52615333      /* RaS3 */
+#  define CUPS_RASTER_REVSYNC  0x33536152      /* 3SaR */
 
 #  define CUPS_RASTER_SYNCv1   0x52615374      /* RaSt */
 #  define CUPS_RASTER_REVSYNCv1        0x74536152      /* tSaR */
 
+#  define CUPS_RASTER_SYNCv2   0x52615332      /* RaS2 */
+#  define CUPS_RASTER_REVSYNCv2        0x32536152      /* 2SaR */
+
 
 /*
  * The following definition can be used to determine if the
@@ -83,7 +86,8 @@ extern "C" {
 typedef enum cups_mode_e               /**** Raster modes ****/
 {
   CUPS_RASTER_READ = 0,                        /* Open stream for reading */
-  CUPS_RASTER_WRITE = 1                        /* Open stream for writing */
+  CUPS_RASTER_WRITE = 1,               /* Open stream for writing */
+  CUPS_RASTER_WRITE_COMPRESSED = 2     /* Open stream for compressed writing @since CUPS 1.3@ */
 } cups_mode_t;
 
 typedef enum cups_bool_e               /**** Boolean type ****/
diff --git a/filter/rasterbench.c b/filter/rasterbench.c
new file mode 100644 (file)
index 0000000..f954f63
--- /dev/null
@@ -0,0 +1,355 @@
+/*
+ * "$Id: rasterbench.c 5667 2006-06-16 10:21:49Z mike $"
+ *
+ *   Raster benchmark program for the Common UNIX Printing System (CUPS).
+ *
+ *   Copyright 1997-2006 by Easy Software Products.
+ *
+ *   These coded instructions, statements, and computer programs are the
+ *   property of Easy Software Products and are protected by Federal
+ *   copyright law.  Distribution and use rights for the CUPS Raster source
+ *   files are outlined in the GNU Library General Public License, located
+ *   in the "pstoraster" directory.  If this file is missing or damaged
+ *   please contact Easy Software Products at:
+ *
+ *       Attn: CUPS Licensing Information
+ *       Easy Software Products
+ *       44141 Airport View Drive, Suite 204
+ *       Hollywood, Maryland 20636 USA
+ *
+ *       Voice: (301) 373-9600
+ *       EMail: cups-info@cups.org
+ *         WWW: http://www.cups.org
+ *
+ *   This code and any derivative of it may be used and distributed
+ *   freely under the terms of the GNU General Public License when
+ *   used with GNU Ghostscript or its derivatives.  Use of the code
+ *   (or any derivative of it) with software other than GNU
+ *   GhostScript (or its derivatives) is governed by the CUPS license
+ *   agreement.
+ *
+ *   This file is subject to the Apple OS-Developed Software exception.
+ *
+ * Contents:
+ *
+ *   main()           - Benchmark the raster read/write functions.
+ *   compute_median() - Compute the median time for a test.
+ *   read_test()      - Benchmark the raster read functions.
+ *   write_test()     - Benchmark the raster write functions.
+ */
+
+/*
+ * Include necessary headers...
+ */
+
+#include "raster.h"
+#include <stdlib.h>
+#include <sys/time.h>
+#include <signal.h>
+#include <unistd.h>
+#include <sys/wait.h>
+
+
+/*
+ * Constants...
+ */
+
+#define TEST_WIDTH     1024
+#define TEST_HEIGHT    1024
+#define TEST_PAGES     16
+#define TEST_PASSES    20
+
+
+/*
+ * Local functions...
+ */
+
+static double  compute_median(double *secs);
+static double  get_time(void);
+static void    read_test(int fd);
+static int     run_read_test(void);
+static void    write_test(int fd);
+
+
+/*
+ * 'main()' - Benchmark the raster read/write functions.
+ */
+
+int                                    /* O - Exit status */
+main(void)
+{
+  int          i;                      /* Looping var */
+  int          ras_fd,                 /* File descriptor for read process */
+               status;                 /* Exit status of read process */
+  double       start_secs,             /* Start time */
+               write_secs,             /* Write time */
+               read_secs,              /* Read time */
+               pass_secs[TEST_PASSES]; /* Total test times */
+
+
+ /*
+  * Ignore SIGPIPE...
+  */
+
+  signal(SIGPIPE, SIG_IGN);
+
+ /*
+  * Run the tests several times to get a good average...
+  */
+
+  printf("Test read/write speed of %d pages, %dx%d pixels...\n\n",
+         TEST_PAGES, TEST_WIDTH, TEST_HEIGHT);
+  for (i = 0; i < TEST_PASSES; i ++)
+  {
+    printf("PASS %2d: ", i + 1);
+    fflush(stdout);
+
+    ras_fd     = run_read_test();
+    start_secs = get_time();
+
+    write_test(ras_fd);
+
+    write_secs = get_time();
+    printf(" %.3f write,", write_secs - start_secs);
+    fflush(stdout);
+
+    close(ras_fd);
+    wait(&status);
+
+    read_secs    = get_time();
+    pass_secs[i] = read_secs - start_secs;
+    printf(" %.3f read, %.3f total\n", read_secs - write_secs, pass_secs[i]);
+  }
+
+  printf("\nMedian Total Time: %.3f seconds per document\n",
+         compute_median(pass_secs));
+
+  return (0);
+}
+
+
+/*
+ * 'compute_median()' - Compute the median time for a test.
+ */
+
+static double                          /* O - Median time in seconds */
+compute_median(double *secs)           /* I - Array of time samples */
+{
+  int          i, j;                   /* Looping vars */
+  double       temp;                   /* Swap variable */
+
+
+ /*
+  * Sort the array into ascending order using a quicky bubble sort...
+  */
+
+  for (i = 0; i < (TEST_PASSES - 1); i ++)
+    for (j = i + 1; j < TEST_PASSES; j ++)
+      if (secs[i] > secs[j])
+      {
+        temp    = secs[i];
+       secs[i] = secs[j];
+       secs[j] = temp;
+      }
+
+ /*
+  * Return the average of the middle two samples...
+  */
+
+  return (0.5 * (secs[TEST_PASSES / 2 - 1] + secs[TEST_PASSES / 2]));
+}
+
+
+/*
+ * 'get_time()' - Get the current time in seconds.
+ */
+
+static double                          /* O - Time in seconds */
+get_time(void)
+{
+  struct timeval       curtime;        /* Current time */
+
+
+  gettimeofday(&curtime, NULL);
+  return (curtime.tv_sec + 0.000001 * curtime.tv_usec);
+}
+
+
+/*
+ * 'read_test()' - Benchmark the raster read functions.
+ */
+
+static void
+read_test(int fd)                      /* I - File descriptor to read from */
+{
+  int                  y;              /* Looping var */
+  cups_raster_t                *r;             /* Raster stream */
+  cups_page_header_t   header;         /* Page header */
+  unsigned char                buffer[8 * TEST_WIDTH];
+                                       /* Read buffer */
+
+
+ /*
+  * Test read speed...
+  */
+
+  if ((r = cupsRasterOpen(fd, CUPS_RASTER_READ)) == NULL)
+  {
+    perror("Unable to create raster input stream");
+    return;
+  }
+
+  while (cupsRasterReadHeader(r, &header))
+  {
+    for (y = 0; y < header.cupsHeight; y ++)
+      cupsRasterReadPixels(r, buffer, header.cupsBytesPerLine);
+  }
+
+  cupsRasterClose(r);
+}
+
+
+/*
+ * 'run_read_test()' - Run the read test as a child process via pipes.
+ */
+
+static int                             /* O - Standard input of child */
+run_read_test(void)
+{
+  int  ras_pipes[2];                   /* Raster data pipes */
+  int  pid;                            /* Child process ID */
+
+
+  if (pipe(ras_pipes))
+    return (-1);
+
+  if ((pid = fork()) < 0)
+  {
+   /*
+    * Fork error - return -1 on error...
+    */
+
+    close(ras_pipes[0]);
+    close(ras_pipes[1]);
+
+    return (-1);
+  }
+  else if (pid == 0)
+  {
+   /*
+    * Child comes here - read data from the input pipe...
+    */
+
+    close(ras_pipes[1]);
+    read_test(ras_pipes[0]);
+    exit(0);
+  }
+  else
+  {
+   /*
+    * Parent comes here - return the output pipe...
+    */
+
+    close(ras_pipes[0]);
+    return (ras_pipes[1]);
+  }
+}
+
+
+/*
+ * 'write_test()' - Benchmark the raster write functions.
+ */
+
+static void
+write_test(int fd)                     /* I - File descriptor to write to */
+{
+  int                  page, x, y;     /* Looping vars */
+  int                  count;          /* Number of bytes to set */
+  cups_raster_t                *r;             /* Raster stream */
+  cups_page_header_t   header;         /* Page header */
+  unsigned char                data[32][8 * TEST_WIDTH];
+                                       /* Raster data to write */
+
+
+ /*
+  * Create a combination of random data and repeated data to simulate
+  * text with some whitespace.
+  */
+
+  srand(time(NULL));
+
+  memset(data, 0, sizeof(data));
+
+  for (y = 0; y < 28; y ++)
+  {
+    for (x = rand() & 127, count = (rand() & 15) + 1;
+         x < sizeof(data[0]);
+         x ++, count --)
+    {
+      if (count <= 0)
+      {
+       x     += (rand() & 15) + 1;
+       count = (rand() & 15) + 1;
+
+        if (x >= sizeof(data[0]))
+         break;
+      }
+
+      data[y][x] = rand();
+    }
+  }
+
+ /*
+  * Test write speed...
+  */
+
+  if ((r = cupsRasterOpen(fd, CUPS_RASTER_WRITE)) == NULL)
+  {
+    perror("Unable to create raster output stream");
+    return;
+  }
+
+  for (page = 0; page < TEST_PAGES; page ++)
+  {
+    memset(&header, 0, sizeof(header));
+    header.cupsWidth        = TEST_WIDTH;
+    header.cupsHeight       = TEST_HEIGHT;
+    header.cupsBytesPerLine = TEST_WIDTH;
+
+    if (page & 1)
+    {
+      header.cupsBytesPerLine *= 4;
+      header.cupsColorSpace = CUPS_CSPACE_CMYK;
+      header.cupsColorOrder = CUPS_ORDER_CHUNKED;
+    }
+    else
+    {
+      header.cupsColorSpace = CUPS_CSPACE_K;
+      header.cupsColorOrder = CUPS_ORDER_BANDED;
+    }
+
+    if (page & 2)
+    {
+      header.cupsBytesPerLine *= 2;
+      header.cupsBitsPerColor = 16;
+      header.cupsBitsPerPixel = (page & 1) ? 64 : 16;
+    }
+    else
+    {
+      header.cupsBitsPerColor = 8;
+      header.cupsBitsPerPixel = (page & 1) ? 32 : 8;
+    }
+
+    cupsRasterWriteHeader(r, &header);
+
+    for (y = 0; y < TEST_HEIGHT; y ++)
+      cupsRasterWritePixels(r, data[y & 31], header.cupsBytesPerLine);
+  }
+
+  cupsRasterClose(r);
+}
+
+
+/*
+ * End of "$Id: rasterbench.c 5667 2006-06-16 10:21:49Z mike $".
+ */
index 9534467d4660fa616f40274cc11728108910e4e0..a3e79d04e2b7c554ac9e3e14a1da46d4318e239c 100644 (file)
@@ -30,6 +30,7 @@
  *   EndPage()      - Finish a page of graphics.
  *   CancelJob()    - Cancel the current job...
  *   OutputLine()   - Output a line of graphics.
+ *   PCLCompress()  - Output a PCL (mode 3) compressed line.
  *   ZPLCompress()  - Output a run-length compression sequence.
  *   main()         - Main entry and processing of driver.
  */
 
 
 /*
- * This driver filter currently supports Dymo and Zebra label printers.
+ * This driver filter currently supports Dymo, Intellitech, and Zebra
+ * label printers.
  *
  * The Dymo portion of the driver has been tested with the 300, 330,
- * and 330 Turbo label printers; it may also work with older models.
+ * and 330 Turbo label printers; it may also work with other models.
  * The Dymo printers support printing at 136, 203, and 300 DPI.
  *
- * The Zebra portion of the driver has been tested with the LP-2844Z label
- * printer; it may also work with other models.  The driver supports EPL
- * line mode, EPL page mode, ZPL, and CPCL as defined in Zebra's on-line
- * developer documentation.
+ * The Intellitech portion of the driver has been tested with the
+ * Intellibar 408, 412, and 808 and supports their PCL variant.
+ *
+ * The Zebra portion of the driver has been tested with the LP-2844,
+ * LP-2844Z, QL-320, and QL-420 label printers; it may also work with
+ * other models.  The driver supports EPL line mode, EPL page mode,
+ * ZPL, and CPCL as defined in Zebra's on-line developer documentation.
  */
 
 /*
 #define ZEBRA_ZPL      0x12            /* Zebra ZPL-based printers */
 #define ZEBRA_CPCL     0x13            /* Zebra CPCL-based printers */
 
+#define INTELLITECH_PCL        0x20            /* Intellitech PCL-based printers */
+
 
 /*
  * Globals...
  */
 
 unsigned char  *Buffer;                /* Output buffer */
-char           *CompBuffer;            /* Compression buffer */
+unsigned char  *CompBuffer;            /* Compression buffer */
 unsigned char  *LastBuffer;            /* Last buffer */
 int            LastSet;                /* Number of repeat characters */
 int            ModelNumber,            /* cupsModelNumber attribute */
@@ -95,6 +102,7 @@ void StartPage(ppd_file_t *ppd, cups_page_header_t *header);
 void   EndPage(ppd_file_t *ppd, cups_page_header_t *header);
 void   CancelJob(int sig);
 void   OutputLine(ppd_file_t *ppd, cups_page_header_t *header, int y);
+void   PCLCompress(unsigned char *line, int length);
 void   ZPLCompress(char repeat_char, int repeat_count);
 
 
@@ -147,6 +155,15 @@ Setup(ppd_file_t *ppd)                     /* I - PPD file */
 
     case ZEBRA_CPCL :
         break;
+
+    case INTELLITECH_PCL :
+       /*
+       * Send a PCL reset sequence.
+       */
+
+       putchar(0x1b);
+       putchar('E');
+        break;
   }
 }
 
@@ -213,6 +230,9 @@ StartPage(ppd_file_t         *ppd,  /* I - PPD file */
   fprintf(stderr, "DEBUG: cupsColorOrder = %d\n", header->cupsColorOrder);
   fprintf(stderr, "DEBUG: cupsColorSpace = %d\n", header->cupsColorSpace);
   fprintf(stderr, "DEBUG: cupsCompression = %d\n", header->cupsCompression);
+  fprintf(stderr, "DEBUG: cupsRowCount = %d\n", header->cupsRowCount);
+  fprintf(stderr, "DEBUG: cupsRowFeed = %d\n", header->cupsRowFeed);
+  fprintf(stderr, "DEBUG: cupsRowStep = %d\n", header->cupsRowStep);
 
  /*
   * Register a signal handler to eject the current page if the
@@ -353,6 +373,108 @@ StartPage(ppd_file_t         *ppd,        /* I - PPD file */
               header->HWResolution[1], header->cupsHeight,
               header->NumCopies);
         break;
+
+    case INTELLITECH_PCL :
+       /*
+        * Set the media size...
+       */
+
+       printf("\033&l6D\033&k12H");    /* Set 6 LPI, 10 CPI */
+       printf("\033&l0O");             /* Set portrait orientation */
+
+       switch (header->PageSize[1])
+       {
+         case 540 : /* Monarch Envelope */
+              printf("\033&l80A");     /* Set page size */
+             break;
+
+         case 624 : /* DL Envelope */
+              printf("\033&l90A");     /* Set page size */
+             break;
+
+         case 649 : /* C5 Envelope */
+              printf("\033&l91A");     /* Set page size */
+             break;
+
+         case 684 : /* COM-10 Envelope */
+              printf("\033&l81A");     /* Set page size */
+             break;
+
+         case 756 : /* Executive */
+              printf("\033&l1A");      /* Set page size */
+             break;
+
+         case 792 : /* Letter */
+              printf("\033&l2A");      /* Set page size */
+             break;
+
+         case 842 : /* A4 */
+              printf("\033&l26A");     /* Set page size */
+             break;
+
+         case 1008 : /* Legal */
+              printf("\033&l3A");      /* Set page size */
+             break;
+
+          default : /* Custom size */
+             printf("\033!f%dZ", header->PageSize[1] * 300 / 72);
+             break;
+       }
+
+       printf("\033&l%dP",             /* Set page length */
+               header->PageSize[1] / 12);
+       printf("\033&l0E");             /* Set top margin to 0 */
+        printf("\033&l%dX", header->NumCopies);
+                                       /* Set number copies */
+        printf("\033&l0L");            /* Turn off perforation skip */
+
+       /*
+        * Print settings...
+       */
+
+       if (Page == 1)
+       {
+          if (header->cupsRowFeed)     /* inPrintRate */
+           printf("\033!p%dS", header->cupsRowFeed);
+
+          if (header->cupsCompression != ~0)
+                                       /* inPrintDensity */
+           printf("\033&d%dA", 30 * header->cupsCompression / 100 - 15);
+
+          if (header->cupsRowCount != ~0)
+                                       /* inTearInterval */
+           printf("\033!n%dT", header->cupsRowCount);
+
+          if (header->cupsRowStep != ~0)
+                                       /* inCutInterval */
+           printf("\033!n%dC", header->cupsRowStep);
+        }
+
+       /*
+       * Setup graphics...
+       */
+
+       printf("\033*t%dR", header->HWResolution[0]);
+                                       /* Set resolution */
+
+       printf("\033*r%dS", header->cupsWidth);
+                                       /* Set width */
+       printf("\033*r%dT", header->cupsHeight);
+                                       /* Set height */
+
+       printf("\033&a0H");             /* Set horizontal position */
+       printf("\033&a0V");             /* Set vertical position */
+        printf("\033*r1A");            /* Start graphics */
+        printf("\033*b3M");            /* Set compression */
+
+       /*
+        * Allocate compression buffers...
+       */
+
+       CompBuffer = malloc(2 * header->cupsBytesPerLine + 1);
+       LastBuffer = malloc(header->cupsBytesPerLine);
+       LastSet    = 0;
+        break;
   }
 
  /*
@@ -591,6 +713,11 @@ EndPage(ppd_file_t *ppd,           /* I - PPD file */
         puts("FORM\r");
        puts("PRINT\r");
        break;
+
+    case INTELLITECH_PCL :
+        printf("\033*rB");             /* End GFX */
+        printf("\014");                        /* Eject current page */
+        break;
   }
 
   fflush(stdout);
@@ -647,7 +774,7 @@ OutputLine(ppd_file_t         *ppd, /* I - PPD file */
 {
   int          i;                      /* Looping var */
   unsigned char        *ptr;                   /* Pointer into buffer */
-  char         *compptr;               /* Pointer into compression buffer */
+  unsigned char        *compptr;               /* Pointer into compression buffer */
   char         repeat_char;            /* Repeated character */
   int          repeat_count;           /* Number of repeated characters */
   static const char *hex = "0123456789ABCDEF";
@@ -788,10 +915,163 @@ OutputLine(ppd_file_t         *ppd,      /* I - PPD file */
          fflush(stdout);
        }
        break;
+
+    case INTELLITECH_PCL :
+       if (Buffer[0] ||
+            memcmp(Buffer, Buffer + 1, header->cupsBytesPerLine - 1))
+        {
+         if (Feed)
+         {
+           printf("\033*b%dY", Feed);
+           Feed    = 0;
+           LastSet = 0;
+         }
+
+          PCLCompress(Buffer, header->cupsBytesPerLine);
+       }
+       else
+         Feed ++;
+        break;
   }
 }
 
 
+/*
+ * 'PCLCompress()' - Output a PCL (mode 3) compressed line.
+ */
+
+void
+PCLCompress(unsigned char *line,       /* I - Line to compress */
+            int           length)      /* I - Length of line */
+{
+  unsigned char        *line_ptr,              /* Current byte pointer */
+               *line_end,              /* End-of-line byte pointer */
+               *comp_ptr,              /* Pointer into compression buffer */
+               *start,                 /* Start of compression sequence */
+               *seed;                  /* Seed buffer pointer */
+  int           count,                 /* Count of bytes for output */
+               offset;                 /* Offset of bytes for output */
+
+
+ /*
+  * Do delta-row compression...
+  */
+
+  line_ptr = line;
+  line_end = line + length;
+
+  comp_ptr = CompBuffer;
+  seed     = LastBuffer;
+
+  while (line_ptr < line_end)
+  {
+   /*
+    * Find the next non-matching sequence...
+    */
+
+    start = line_ptr;
+
+    if (!LastSet)
+    {
+     /*
+      * The seed buffer is invalid, so do the next 8 bytes, max...
+      */
+
+      offset = 0;
+
+      if ((count = line_end - line_ptr) > 8)
+       count = 8;
+
+      line_ptr += count;
+    }
+    else
+    {
+     /*
+      * The seed buffer is valid, so compare against it...
+      */
+
+      while (*line_ptr == *seed &&
+             line_ptr < line_end)
+      {
+        line_ptr ++;
+        seed ++;
+      }
+
+      if (line_ptr == line_end)
+        break;
+
+      offset = line_ptr - start;
+
+     /*
+      * Find up to 8 non-matching bytes...
+      */
+
+      start = line_ptr;
+      count = 0;
+      while (*line_ptr != *seed &&
+             line_ptr < line_end &&
+             count < 8)
+      {
+        line_ptr ++;
+        seed ++;
+        count ++;
+      }
+    }
+
+   /*
+    * Place mode 3 compression data in the buffer; see HP manuals
+    * for details...
+    */
+
+    if (offset >= 31)
+    {
+     /*
+      * Output multi-byte offset...
+      */
+
+      *comp_ptr++ = ((count - 1) << 5) | 31;
+
+      offset -= 31;
+      while (offset >= 255)
+      {
+        *comp_ptr++ = 255;
+        offset    -= 255;
+      }
+
+      *comp_ptr++ = offset;
+    }
+    else
+    {
+     /*
+      * Output single-byte offset...
+      */
+
+      *comp_ptr++ = ((count - 1) << 5) | offset;
+    }
+
+    memcpy(comp_ptr, start, count);
+    comp_ptr += count;
+  }
+
+  line_ptr = CompBuffer;
+  line_end = comp_ptr;
+
+ /*
+  * Set the length of the data and write it...
+  */
+
+  printf("\033*b%dW", comp_ptr - CompBuffer);
+  fwrite(CompBuffer, comp_ptr - CompBuffer, 1, stdout);
+
+ /*
+  * Save this line as a "seed" buffer for the next...
+  */
+
+  memcpy(LastBuffer, line, length);
+  LastSet = 1;
+}
+
+
 /*
  * 'ZPLCompress()' - Output a run-length compression sequence.
  */
@@ -873,7 +1153,7 @@ main(int  argc,                            /* I - Number of command-line arguments */
     * and return.
     */
 
-    fputs("ERROR: rastertodymo job-id user title copies options [file]\n", stderr);
+    fputs("ERROR: rastertolabel job-id user title copies options [file]\n", stderr);
     return (1);
   }
 
index 65831181612193b5e0cc6a5e17cd3b81666bc625..34bcf1b953f1aa5956634b87c8334cb7d0a4455a 100644 (file)
@@ -51,7 +51,9 @@ depend:
 # Install files...
 #
 
-install:       all
+install:       all $(INSTALL_LANGUAGES)
+
+install-languages:
        $(INSTALL_DIR) -m 755 $(LOCALEDIR)
        for loc in $(LANGUAGES) ; do \
                if test -f cups_$$loc.po; then \
@@ -65,12 +67,12 @@ install:    all
 # Uninstall files...
 #
 
-uninstall:
+uninstall: $(UNINSTALL_LANGUAGES)
+
+uninstall-languages:
        -for loc in $(LANGUAGES) ; do \
                $(RM) $(LOCALEDIR)/$$loc/cups_$$loc.po ; \
-               $(RMDIR) $(LOCALEDIR)/$$loc ; \
        done
-       -$(RMDIR) $(LOCALEDIR)
 
 
 #
index 1ca4004d75de3a6e32d83f1e7c4dabe3fd17686a..a74569ef57bc1a6458bffa0e849b664fb8b81561 100644 (file)
@@ -29,7 +29,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: CUPS 1.2\n"
 "Report-Msgid-Bugs-To: http://www.cups.org/str.php\n"
-"POT-Creation-Date: 2006-05-21 10:08-0400\n"
+"POT-Creation-Date: 2006-05-21 10:07-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index f185289559b0605a4aea6b2cbd07d76c9c2a5741..7e736ba46429f99e592863e617399c85da3114b8 100644 (file)
@@ -1,29 +1,32 @@
+#
 # "$Id$"
-# Message catalog template for the Common UNIX Printing System (CUPS).
-# Copyright 2005-2006 by Easy Software Products.
-# These coded instructions, statements, and computer programs are the
-# property of Easy Software Products and are protected by Federal
-# copyright law.  Distribution and use rights are outlined in the file
-# "LICENSE.txt" which should have been included with this file.  If this
-# file is missing or damaged please contact Easy Software Products
-# at:
-# Attn: CUPS Licensing Information
-# Easy Software Products
-# 44141 Airport View Drive, Suite 204
-# Hollywood, Maryland 20636 USA
-# Voice: (301) 373-9600
-# EMail: cups-info@cups.org
-# WWW: http://www.cups.org
-# , fuzzy
-# <>, 2006.
-# 
-# 
+#
+#   Spanish message catalog for the Common UNIX Printing System (CUPS).
+#
+#   Copyright 2005-2006 by Easy Software Products.
+#
+#   These coded instructions, statements, and computer programs are the
+#   property of Easy Software Products and are protected by Federal
+#   copyright law.  Distribution and use rights are outlined in the file
+#   "LICENSE.txt" which should have been included with this file.  If this
+#   file is missing or damaged please contact Easy Software Products
+#   at:
+#
+#       Attn: CUPS Licensing Information
+#       Easy Software Products
+#       44141 Airport View Drive, Suite 204
+#       Hollywood, Maryland 20636 USA
+#
+#       Voice: (301) 373-9600
+#       EMail: cups-info@cups.org
+#         WWW: http://www.cups.org
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: CUPS 1.2\n"
 "Report-Msgid-Bugs-To: http://www.cups.org/str.php\n"
-"POT-Creation-Date: 2006-05-21 10:08-0400\n"
-"PO-Revision-Date: 2006-03-25 21:48+0100\n"
+"POT-Creation-Date: 2006-05-21 10:07-0400\n"
+"PO-Revision-Date: 2006-06-12 19:01+0100\n"
 "Last-Translator: Juan Pablo González Riopedre <riopedre@tiscali.es>\n"
 "Language-Team: Spanish\n"
 "MIME-Version: 1.0\n"
@@ -72,19 +75,15 @@ msgstr "No"
 msgid "Auto"
 msgstr "Auto"
 
-msgid ""
-"Enter your username and password or the root username and password to access "
-"this page."
-msgstr ""
-"Introduzca su nombre de usuario y contraseña o el nombre de usuario y "
-"contraseña de root para poder acceder a esta página."
+msgid "Enter your username and password or the root username and password to access this page."
+msgstr "Introduzca su nombre de usuario y contraseña o el nombre de usuario y contraseña de root para poder acceder a esta página."
 
 msgid "You must use a https: URL to access this page."
 msgstr "Debe escribir un URL https para acceder a esta página."
 
 #, c-format
 msgid "Bad request version number %d.%d!"
-msgstr "Petición incorrecta de número de versión %d %d."
+msgstr "Petición incorrecta de número de versión %d.%d."
 
 msgid "No attributes in request!"
 msgstr "No hay atributos en la solicitud."
@@ -103,11 +102,8 @@ msgstr "No se admite el uso de %s."
 msgid "The printer or class was not found."
 msgstr "No se ha encontrado la impresora o la clase."
 
-msgid ""
-"The printer-uri must be of the form \"ipp://HOSTNAME/classes/CLASSNAME\"."
-msgstr ""
-"El printer-uri debe ser de la forma \"ipp://NOMBRE_ORDENADOR/classes/"
-"NOMBRE_CLASE\"."
+msgid "The printer-uri must be of the form \"ipp://HOSTNAME/classes/CLASSNAME\"."
+msgstr "El printer-uri debe ser de la forma \"ipp://NOMBRE_ORDENADOR/classes/NOMBRE_CLASE\"."
 
 #, c-format
 msgid "The printer-uri \"%s\" contains invalid characters."
@@ -119,9 +115,7 @@ msgstr "Ya existe una impresora llamada \"%s\"."
 
 #, c-format
 msgid "Attempt to set %s printer-state to bad value %d!"
-msgstr ""
-"Se ha intentado cambiar el valor printer-state de %s a un valor incorrecto %"
-"d."
+msgstr "Se ha intentado cambiar el valor printer-state de %s a un valor incorrecto %d."
 
 #, c-format
 msgid "add_class: Unknown printer-op-policy \"%s\"."
@@ -146,29 +140,19 @@ msgstr "No se admite el uso del idioma \"%s\"."
 msgid "The notify-user-data value is too large (%d > 63 octets)!"
 msgstr "El valor notify-user-data es demasiado grande (%d > 63 octetos)."
 
-msgid ""
-"The notify-lease-duration attribute cannot be used with job subscriptions."
-msgstr ""
-"El atributo notify-lease-duration no puede ser usado con subscripciones de "
-"trabajos."
+msgid "The notify-lease-duration attribute cannot be used with job subscriptions."
+msgstr "El atributo notify-lease-duration no puede ser usado con subscripciones de trabajos."
 
-msgid ""
-"The printer-uri must be of the form \"ipp://HOSTNAME/printers/PRINTERNAME\"."
-msgstr ""
-"El printer-uri debe ser de la forma \"ipp://NOMBRE_ORDENADOR/printers/"
-"NOMBRE_IMPRESORA\"."
+msgid "The printer-uri must be of the form \"ipp://HOSTNAME/printers/PRINTERNAME\"."
+msgstr "El printer-uri debe ser de la forma \"ipp://NOMBRE_ORDENADOR/printers/NOMBRE_IMPRESORA\"."
 
 #, c-format
 msgid "A class named \"%s\" already exists!"
 msgstr "Ya existe una clase llamada \"%s\"."
 
 #, c-format
-msgid ""
-"File device URIs have been disabled! To enable, see the FileDevice directive "
-"in \"%s/cupsd.conf\"."
-msgstr ""
-"Los URIs del dispositivo de archivo han sido deshabilitados. Para "
-"habilitarlos, vea la directiva FileDevice en \"%s/cupsd.conf\"."
+msgid "File device URIs have been disabled! To enable, see the FileDevice directive in \"%s/cupsd.conf\"."
+msgstr "Los URIs del dispositivo de archivo han sido deshabilitados. Para habilitarlos, vea la directiva FileDevice en \"%s/cupsd.conf\"."
 
 #, c-format
 msgid "Bad device-uri \"%s\"!"
@@ -218,8 +202,7 @@ msgstr "El trabajo #%d no está retenido para autentificación."
 
 #, c-format
 msgid "You are not authorized to authenticate job #%d owned by \"%s\"!"
-msgstr ""
-"No tiene permiso para autentificar el trabajo #%d que pertenece a \"%s\"."
+msgstr "No tiene permiso para autentificar el trabajo #%d que pertenece a \"%s\"."
 
 msgid "The printer-uri attribute is required!"
 msgstr "Se necesita el atributo printer-uri."
@@ -360,14 +343,11 @@ msgstr "El trabajo #%d no puede ser reiniciado - no hay archivos."
 
 #, c-format
 msgid "You are not authorized to restart job id %d owned by \"%s\"!"
-msgstr ""
-"No tiene permiso para reiniciar el trabajo id %d que pertenece a \"%s\"."
+msgstr "No tiene permiso para reiniciar el trabajo id %d que pertenece a \"%s\"."
 
 #, c-format
 msgid "You are not authorized to send document for job #%d owned by \"%s\"!"
-msgstr ""
-"No tiene permiso para enviar el documento para el trabajo #%d que pertenece "
-"a \"%s\"."
+msgstr "No tiene permiso para enviar el documento para el trabajo #%d que pertenece a \"%s\"."
 
 #, c-format
 msgid "Bad document-format \"%s\"!"
@@ -465,11 +445,8 @@ msgid "lpq: Unknown destination \"%s\"!\n"
 msgstr "lpq: Destino desconocido \"%s\".\n"
 
 #, c-format
-msgid ""
-"lp: error - %s environment variable names non-existent destination \"%s\"!\n"
-msgstr ""
-"lp: error - los nombres de la variable de entorno %s no existentes en el "
-"destino \"%s\".\n"
+msgid "lp: error - %s environment variable names non-existent destination \"%s\"!\n"
+msgstr "lp: error - los nombres de la variable de entorno %s no existentes en el destino \"%s\".\n"
 
 msgid "lpq: error - no default destination available.\n"
 msgstr "lpq: error - no está disponible el destino predeterminado.\n"
@@ -478,10 +455,8 @@ msgstr "lpq: error - no está disponible el destino predeterminado.\n"
 msgid "lpq: get-jobs failed: %s\n"
 msgstr "lpq: get-jobs ha fallado: %s\n"
 
-msgid ""
-"Rank   Owner      Pri  Job        Files                       Total Size\n"
-msgstr ""
-"Rango  Propiet.   Pri  Trabajo    Archivos                    Tamaño total\n"
+msgid "Rank   Owner      Pri  Job        Files                       Total Size\n"
+msgstr "Rango  Propiet.   Pri  Trabajo    Archivos                    Tamaño total\n"
 
 msgid "Rank    Owner   Job     File(s)                         Total Size\n"
 msgstr "Rango  Propiet. Trabajo Archivo(s)                      Tamaño total\n"
@@ -492,15 +467,15 @@ msgstr "%s: %-33.33s [trabajo %d localhost]\n"
 
 #, c-format
 msgid "        %-39.39s %.0f bytes\n"
-msgstr "        %-39.39s %.de bytes\n"
+msgstr "        %-39.39s %.0f bytes\n"
 
 #, c-format
 msgid "%-6s %-10.10s %-4d %-10d %-27.27s %.0f bytes\n"
-msgstr "%-6s %-10.10s %-4d %-10d %-27.27s %.de bytes\n"
+msgstr "%-6s %-10.10s %-4d %-10d %-27.27s %.0f bytes\n"
 
 #, c-format
 msgid "%-7s %-7.7s %-7d %-31.31s %.0f bytes\n"
-msgstr "%-7s %-7.7s %-7d %-31.31s %.de bytes\n"
+msgstr "%-7s %-7.7s %-7d %-31.31s %.0f bytes\n"
 
 msgid "no entries\n"
 msgstr "no hay entradas\n"
@@ -529,20 +504,14 @@ msgid "lpr: error - expected value after -%c option!\n"
 msgstr "lpr: error - se esperaba un valor tras la opción %c\n"
 
 #, c-format
-msgid ""
-"lpr: warning - '%c' format modifier not supported - output may not be "
-"correct!\n"
-msgstr ""
-"lpr: advertencia - no admite el uso del modificador de formato '%c' - la "
-"salida puede que no sea correcta.\n"
+msgid "lpr: warning - '%c' format modifier not supported - output may not be correct!\n"
+msgstr "lpr: advertencia - no admite el uso del modificador de formato '%c' - la salida puede que no sea correcta.\n"
 
 msgid "lpr: error - expected option=value after -o option!\n"
 msgstr "lpr: error - se esperaba opción=valor tras la opción -o.\n"
 
 msgid "lpr: warning - email notification is not currently supported!\n"
-msgstr ""
-"lpr: advertencia - actualmente no admite el uso de la notificación por "
-"email.\n"
+msgstr "lpr: advertencia - actualmente no admite el uso de la notificación por email.\n"
 
 msgid "lpr: error - expected destination after -P option!\n"
 msgstr "lpr: error - se esperaba un destino tras la opción -P.\n"
@@ -563,18 +532,15 @@ msgstr "lpr: error - opción \"%c\" desconocida.\n"
 
 #, c-format
 msgid "lpr: error - unable to access \"%s\" - %s\n"
-msgstr "lpr: error - no se ha podido acceder a \"%s\" - \"s\n"
+msgstr "lpr: error - no se ha podido acceder a \"%s\" - %s\n"
 
 #, c-format
 msgid "lpr: error - too many files - \"%s\"\n"
 msgstr "lpr: error - demasiados archivos - \"%s\"\n"
 
 #, c-format
-msgid ""
-"lpr: error - %s environment variable names non-existent destination \"%s\"!\n"
-msgstr ""
-"lpr: error - los nombres de variables de entorno %s no existen en el destino "
-"\"%s\".\n"
+msgid "lpr: error - %s environment variable names non-existent destination \"%s\"!\n"
+msgstr "lpr: error - los nombres de variables de entorno %s no existen en el destino \"%s\".\n"
 
 msgid "lpr: error - no default destination available.\n"
 msgstr "lpr: error - no está disponible el destino predeterminado.\n"
@@ -588,13 +554,10 @@ msgstr "lpr: error - no se ha podido crear el archivo temporal \"%s\" - %s\n"
 
 #, c-format
 msgid "lpr: error - unable to write to temporary file \"%s\" - %s\n"
-msgstr ""
-"lpr: error - no se ha podido escribir en el archivo temporal \"%s\" - %s\n"
+msgstr "lpr: error - no se ha podido escribir en el archivo temporal \"%s\" - %s\n"
 
 msgid "lpr: error - stdin is empty, so no job has been sent.\n"
-msgstr ""
-"lpr: error - stdin está vacío, por lo tanto no se ha enviado ningún "
-"trabajo.\n"
+msgstr "lpr: error - stdin está vacío, por lo tanto no se ha enviado ningún trabajo.\n"
 
 #, c-format
 msgid "lpr: error - unable to print file: %s\n"
@@ -652,12 +615,10 @@ msgid "%s: Operation failed: %s\n"
 msgstr "%s: La operación ha fallado: %s\n"
 
 msgid "cancel: Error - expected hostname after '-h' option!\n"
-msgstr ""
-"cancel: Error - se esperaba un nombre de ordenador tras la opción '-h'.\n"
+msgstr "cancel: Error - se esperaba un nombre de ordenador tras la opción '-h'.\n"
 
 msgid "cancel: Error - expected username after '-u' option!\n"
-msgstr ""
-"cancel: Error - se esperaba un nombre de usuario tras la opción '-u'.\n"
+msgstr "cancel: Error - se esperaba un nombre de usuario tras la opción '-u'.\n"
 
 #, c-format
 msgid "cancel: Unknown option '%c'!\n"
@@ -704,39 +665,27 @@ msgstr "cupsaddsmb: No se ha podido convertir el archivo PPD para %s - %s\n"
 
 #, c-format
 msgid "cupsaddsmb: Unable to copy Windows 2000 printer driver files (%d)!\n"
-msgstr ""
-"cupsaddsmb: No se han podido copiar los archivos de los controladores de "
-"impresoras de Windows 2000 (%d).\n"
+msgstr "cupsaddsmb: No se han podido copiar los archivos de los controladores de impresoras de Windows 2000 (%d).\n"
 
 #, c-format
 msgid "cupsaddsmb: Unable to copy CUPS printer driver files (%d)!\n"
-msgstr ""
-"cupsaddsmb: No se han podido copiar los archivos de los controladores de "
-"impresoras de CUPS (%d).\n"
+msgstr "cupsaddsmb: No se han podido copiar los archivos de los controladores de impresoras de CUPS (%d).\n"
 
 #, c-format
 msgid "cupsaddsmb: Unable to install Windows 2000 printer driver files (%d)!\n"
-msgstr ""
-"cupsaddsmb: No se han podido instalar los archivos de los controladores de "
-"impresoras de Windows 2000 (%d).\n"
+msgstr "cupsaddsmb: No se han podido instalar los archivos de los controladores de impresoras de Windows 2000 (%d).\n"
 
 #, c-format
 msgid "cupsaddsmb: Unable to copy Windows 9x printer driver files (%d)!\n"
-msgstr ""
-"cupsaddsmb: No se han podido copiar los archivos de los controladores de "
-"impresoras de Windows 9x (%d).\n"
+msgstr "cupsaddsmb: No se han podido copiar los archivos de los controladores de impresoras de Windows 9x (%d).\n"
 
 #, c-format
 msgid "cupsaddsmb: Unable to install Windows 9x printer driver files (%d)!\n"
-msgstr ""
-"cupsaddsmb: No se han podido instalar los archivos de los controladores de "
-"impresoras de Windows 9x (%d).\n"
+msgstr "cupsaddsmb: No se han podido instalar los archivos de los controladores de impresoras de Windows 9x (%d).\n"
 
 #, c-format
 msgid "cupsaddsmb: Unable to set Windows printer driver (%d)!\n"
-msgstr ""
-"cupsaddsmb: No se ha podido poner el controlador de impresora de Windows (%"
-"d).\n"
+msgstr "cupsaddsmb: No se ha podido poner el controlador de impresora de Windows (%d).\n"
 
 msgid ""
 "Usage: cupsaddsmb [options] printer1 ... printerN\n"
@@ -1115,17 +1064,14 @@ msgstr " PASA\n"
 
 #, c-format
 msgid ""
-"        WARN    Duplex option keyword %s should be named Duplex or "
-"JCLDuplex!\n"
+"        WARN    Duplex option keyword %s should be named Duplex or JCLDuplex!\n"
 "                REF: Page 122, section 5.17\n"
 msgstr ""
-"        ADVERTENCIA    Clave de opción Duplex %s debería llamarse Duplex o "
-"JCLDuplex.\n"
+"        ADVERTENCIA    Clave de opción Duplex %s debería llamarse Duplex o JCLDuplex.\n"
 "                REF: Página 122, sección 5.17\n"
 
 msgid "        WARN    Default choices conflicting!\n"
-msgstr ""
-"        ADVERTENCIA    Las preferencias predeterminadas están en conflicto.\n"
+msgstr "        ADVERTENCIA    Las preferencias predeterminadas están en conflicto.\n"
 
 #, c-format
 msgid ""
@@ -1139,48 +1085,42 @@ msgid ""
 "        WARN    LanguageEncoding required by PPD 4.3 spec.\n"
 "                REF: Pages 56-57, section 5.3.\n"
 msgstr ""
-"        ADVERTENCIA    Se necesita LanguageEncoding por especificación de "
-"PPD 4.3.\n"
+"        ADVERTENCIA    Se necesita LanguageEncoding por especificación de PPD 4.3.\n"
 "                REF: Páginas 56-57, sección 5.3.\n"
 
 msgid ""
 "        WARN    Manufacturer required by PPD 4.3 spec.\n"
 "                REF: Pages 58-59, section 5.3.\n"
 msgstr ""
-"        ADVERTENCIA    Se necesita Manufacturer por especificación de PPD "
-"4.3.\n"
+"        ADVERTENCIA    Se necesita Manufacturer por especificación de PPD 4.3.\n"
 "                REF: Páginas 58-59, seccion 5.3.\n"
 
 msgid ""
 "        WARN    PCFileName longer than 8.3 in violation of PPD spec.\n"
 "                REF: Pages 61-62, section 5.3.\n"
 msgstr ""
-"        ADVERTENCIA    PCFileName es mas largo que 8.3 violando la "
-"especificación PPD.\n"
+"        ADVERTENCIA    PCFileName es mas largo que 8.3 violando la especificación PPD.\n"
 "                REF: Páginas 61-62, sección 5.3.\n"
 
 msgid ""
 "        WARN    ShortNickName required by PPD 4.3 spec.\n"
 "                REF: Pages 64-65, section 5.3.\n"
 msgstr ""
-"        ADVERTENCIA    Se necesita ShortNickName por especificación de PPD "
-"4.3.\n"
+"        ADVERTENCIA    Se necesita ShortNickName por especificación de PPD 4.3.\n"
 "                REF: Páginas 64-65, sección 5.3.\n"
 
 msgid ""
 "        WARN    Protocols contains both PJL and BCP; expected TBCP.\n"
 "                REF: Pages 78-79, section 5.7.\n"
 msgstr ""
-"        ADVERTENCIA    Protocols contiene a ambos, PJL y BCP; se esperaba "
-"TBCP.\n"
+"        ADVERTENCIA    Protocols contiene a ambos, PJL y BCP; se esperaba TBCP.\n"
 "                REF: Páginas 78-79, sección 5.7.\n"
 
 msgid ""
 "        WARN    Protocols contains PJL but JCL attributes are not set.\n"
 "                REF: Pages 78-79, section 5.7.\n"
 msgstr ""
-"        ADVERTENCIA    Protocols contiene a PJL pero no se especifican los "
-"atributos JCL.\n"
+"        ADVERTENCIA    Protocols contiene a PJL pero no se especifican los atributos JCL.\n"
 "                REF: Páginas 78-79, sección 5.7.\n"
 
 #, c-format
@@ -1207,12 +1147,10 @@ msgstr ""
 "                (restricción=\"%s %s %s %s\")\n"
 
 msgid ""
-"Usage: cupstestppd [-q] [-r] [-v[v]] filename1.ppd[.gz] [... filenameN.ppd[."
-"gz]]\n"
+"Usage: cupstestppd [-q] [-r] [-v[v]] filename1.ppd[.gz] [... filenameN.ppd[.gz]]\n"
 "       program | cupstestppd [-q] [-r] [-v[v]] -\n"
 msgstr ""
-"Uso: cupstestppd [-q] [-r] [-v[v]] nombre_archivo1.ppd[.gz] [... "
-"nombre_archivoN.ppd[.gz]]\n"
+"Uso: cupstestppd [-q] [-r] [-v[v]] nombre_archivo1.ppd[.gz] [... nombre_archivoN.ppd[.gz]]\n"
 "       programa | cupstestppd [-q] [-r] [-v[v]] -\n"
 
 msgid "lpstat: Need \"completed\" or \"not-completed\" after -W!\n"
@@ -1285,20 +1223,15 @@ msgid "system default destination: %s\n"
 msgstr "destino predeterminado del sistema: %s\n"
 
 #, c-format
-msgid ""
-"lpstat: error - %s environment variable names non-existent destination \"%s"
-"\"!\n"
-msgstr ""
-"lpstat: error - Los nombre de variable de entorno %s no existen en el "
-"destino \"%s\".\n"
+msgid "lpstat: error - %s environment variable names non-existent destination \"%s\"!\n"
+msgstr "lpstat: error - Los nombre de variable de entorno %s no existen en el destino \"%s\".\n"
 
 msgid "no system default destination\n"
 msgstr "no hay un destino predeterminado del sistema\n"
 
 #, c-format
 msgid "Output for printer %s is sent to remote printer %s on %s\n"
-msgstr ""
-"La salida de la impresora %s se ha enviado a la impresora remota %s en %s\n"
+msgstr "La salida de la impresora %s se ha enviado a la impresora remota %s en %s\n"
 
 #, c-format
 msgid "Output for printer %s is sent to %s\n"
@@ -1306,9 +1239,7 @@ msgstr "La salida de la impresora %s se ha enviado a %s\n"
 
 #, c-format
 msgid "Output for printer %s/%s is sent to remote printer %s on %s\n"
-msgstr ""
-"La salida de la impresora %s/%s se ha enviado a la impresora remota %s en %"
-"s\n"
+msgstr "La salida de la impresora %s/%s se ha enviado a la impresora remota %s en %s\n"
 
 #, c-format
 msgid "Output for printer %s/%s is sent to %s\n"
@@ -1452,16 +1383,13 @@ msgid "lpadmin: Expected class name after '-c' option!\n"
 msgstr "lpadmin: Se esperaba un nombre de clase tras la opción '-c'\n"
 
 msgid "lpadmin: Class name can only contain printable characters!\n"
-msgstr ""
-"lpadmin: El nombre de la clase sólo puede contener caracteres imprimibles.\n"
+msgstr "lpadmin: El nombre de la clase sólo puede contener caracteres imprimibles.\n"
 
 msgid "lpadmin: Expected printer name after '-d' option!\n"
 msgstr "lpadmin: Se esperaba un nombre de impresora tras la opción '-d'\n"
 
 msgid "lpadmin: Printer name can only contain printable characters!\n"
-msgstr ""
-"lpadmin: El nombre de la impresora sólo puede contener caracteres "
-"imprimibles.\n"
+msgstr "lpadmin: El nombre de la impresora sólo puede contener caracteres imprimibles.\n"
 
 msgid "lpadmin: Expected hostname after '-h' option!\n"
 msgstr "lpadmin: Se esperaba un nombre de ordenador tras la opción '-h'.\n"
@@ -1536,8 +1464,7 @@ msgid "lpadmin: Expected file type(s) after '-I' option!\n"
 msgstr "lpadmin: Se esperaba tipo(s) de archivo(s) tras la opción '-l'.\n"
 
 msgid "lpadmin: Warning - content type list ignored!\n"
-msgstr ""
-"lpadmin: Advertencia - lista de tipo de contenido no tenida en cuenta.\n"
+msgstr "lpadmin: Advertencia - lista de tipo de contenido no tenida en cuenta.\n"
 
 msgid ""
 "lpadmin: Unable to set the printer location:\n"
@@ -1640,9 +1567,7 @@ msgid "lp: Expected job ID after -i option!\n"
 msgstr "lp: Se esperaba un ID de trabajo tras la opción -i.\n"
 
 msgid "lp: Error - cannot print files and alter jobs simultaneously!\n"
-msgstr ""
-"lp: Error - no se pueden imprimir archivos y alterar trabajos al mismo "
-"tiempo.\n"
+msgstr "lp: Error - no se pueden imprimir archivos y alterar trabajos al mismo tiempo.\n"
 
 msgid "lp: Error - bad job ID!\n"
 msgstr "lp: Error - ID de trabajo incorrecta.\n"
@@ -1694,11 +1619,8 @@ msgstr "lp: Advertencia - opción de tipo de contenido no tenida en cuenta.\n"
 msgid "lp: Unknown option '%c'!\n"
 msgstr "lp: Opción '%c' desconocida.\n"
 
-msgid ""
-"lp: Error - cannot print from stdin if files or a job ID are provided!\n"
-msgstr ""
-"lp: Error - no se puede imprimir desde stdin si se proporcionan archivos o "
-"un ID de trabajo.\n"
+msgid "lp: Error - cannot print from stdin if files or a job ID are provided!\n"
+msgstr "lp: Error - no se puede imprimir desde stdin si se proporcionan archivos o un ID de trabajo.\n"
 
 #, c-format
 msgid "lp: Unable to access \"%s\" - %s\n"
@@ -1720,8 +1642,7 @@ msgstr "lp: no se ha podido crear el archivo temporal \"%s\" - %s\n"
 
 #, c-format
 msgid "lp: error - unable to write to temporary file \"%s\" - %s\n"
-msgstr ""
-"lp: error - no se ha podido escribir en el archivo temporal \"%s\" - %s\n"
+msgstr "lp: error - no se ha podido escribir en el archivo temporal \"%s\" - %s\n"
 
 msgid "lp: stdin is empty, so no job has been sent.\n"
 msgstr "lp: stdin está vacío, por lo tanto no se ha enviado ningún trabajo.\n"
@@ -1883,9 +1804,7 @@ msgstr "lppasswd: Archivo de contraseñas no actualizado.\n"
 
 #, c-format
 msgid "lppasswd: failed to backup old password file: %s\n"
-msgstr ""
-"lppasswd: falló al hacer una copia de seguridad del antiguo archivo de "
-"contraseñas: %s\n"
+msgstr "lppasswd: falló al hacer una copia de seguridad del antiguo archivo de contraseñas: %s\n"
 
 #, c-format
 msgid "lppasswd: failed to rename password file: %s\n"
@@ -1936,12 +1855,8 @@ msgstr "Modificar clase"
 msgid "Add Class"
 msgstr "Añadir clase"
 
-msgid ""
-"The class name may only contain up to 127 printable characters and may not "
-"contain spaces, slashes (/), or the pound sign (#)."
-msgstr ""
-"El nombre de la clase sólo puede contener hasta 127 caracteres imprimibles y "
-"no puede contener espacios, barras (/), o la almohadilla (#)."
+msgid "The class name may only contain up to 127 printable characters and may not contain spaces, slashes (/), or the pound sign (#)."
+msgstr "El nombre de la clase sólo puede contener hasta 127 caracteres imprimibles y no puede contener espacios, barras (/), o la almohadilla (#)."
 
 msgid "Unable to modify class:"
 msgstr "No se ha podido modificar la clase:"
@@ -1955,12 +1870,8 @@ msgstr "Modificar impresora"
 msgid "Add Printer"
 msgstr "Añadir impresora"
 
-msgid ""
-"The printer name may only contain up to 127 printable characters and may not "
-"contain spaces, slashes (/), or the pound sign (#)."
-msgstr ""
-"El nombre de la impresora sólo puede contener hasta 127 caracteres "
-"imprimibles y no puede contener espacios, barras (/), o la almohadilla (#)."
+msgid "The printer name may only contain up to 127 printable characters and may not contain spaces, slashes (/), or the pound sign (#)."
+msgstr "El nombre de la impresora sólo puede contener hasta 127 caracteres imprimibles y no puede contener espacios, barras (/), o la almohadilla (#)."
 
 msgid "Unable to get list of printer drivers:"
 msgstr "No se ha podido obtener la lista de controladores de impresora:"
@@ -2059,24 +1970,16 @@ msgid "Unable to convert PPD file!"
 msgstr "No se ha podido convertir el archivo PPD."
 
 msgid "Unable to copy Windows 2000 printer driver files!"
-msgstr ""
-"No se han podido copiar los archivos del controlador de impresora de Windows "
-"2000."
+msgstr "No se han podido copiar los archivos del controlador de impresora de Windows 2000."
 
 msgid "Unable to install Windows 2000 printer driver files!"
-msgstr ""
-"No se han podido instalar los archivos del controlador de impresora de "
-"Windows 2000."
+msgstr "No se han podido instalar los archivos del controlador de impresora de Windows 2000."
 
 msgid "Unable to copy Windows 9x printer driver files!"
-msgstr ""
-"No se han podido copiar los archivos del controlador de impresora de Windows "
-"9x."
+msgstr "No se han podido copiar los archivos del controlador de impresora de Windows 9x."
 
 msgid "Unable to install Windows 9x printer driver files!"
-msgstr ""
-"No se han podido instalar los archivos del controlador de impresora de "
-"Windows 9x."
+msgstr "No se han podido instalar los archivos del controlador de impresora de Windows 9x."
 
 msgid "Unable to set Windows printer driver!"
 msgstr "No se ha podido configurar el controlador de impresora de Windows."
@@ -2096,14 +1999,10 @@ msgid "cupsaddsmb crashed on signal %d"
 msgstr "cupsaddsmb se ha estropeado con señal %d"
 
 msgid "A Samba username is required to export printer drivers!"
-msgstr ""
-"Se requiere un nombre de usuario Samba para exportar los controladores de "
-"impresora."
+msgstr "Se requiere un nombre de usuario Samba para exportar los controladores de impresora."
 
 msgid "A Samba password is required to export printer drivers!"
-msgstr ""
-"Se requiere una contraseña Samba para exportar los controladores de "
-"impresora."
+msgstr "Se requiere una contraseña Samba para exportar los controladores de impresora."
 
 msgid "Unable to open cupsd.conf file:"
 msgstr "No se ha podido abrir el archivo cupsd.conf:"
@@ -2256,13 +2155,10 @@ msgid "cupsaddsmb: Unable to run \"%s\": %s\n"
 msgstr "cupsaddsmb: No se ha podido ejecutar \"%s\": %s\n"
 
 msgid "cupsaddsmb: No Windows printer drivers are installed!\n"
-msgstr ""
-"cupsaddsmb: No está instalado ningún controlador de impresora de Windows.\n"
+msgstr "cupsaddsmb: No está instalado ningún controlador de impresora de Windows.\n"
 
 msgid "cupsaddsmb: Warning, no Windows 2000 printer drivers are installed!\n"
-msgstr ""
-"cupsaddsmb: Advertencia, no está instalado ningún controlador de impresora "
-"de Windows 2000.\n"
+msgstr "cupsaddsmb: Advertencia, no está instalado ningún controlador de impresora de Windows 2000.\n"
 
 #, c-format
 msgid "lpadmin: Printer %s is already a member of class %s.\n"
@@ -2305,8 +2201,7 @@ msgid "Usage: lpmove job/src dest\n"
 msgstr "Uso: lpmove trabajo/fuente destino\n"
 
 msgid "lpstat: Need \"completed\", \"not-completed\", or \"all\" after -W!\n"
-msgstr ""
-"lpstat: Se necesita \"completed\", \"not completed\", o \"all\" tras -W.\n"
+msgstr "lpstat: Se necesita \"completed\", \"not completed\", o \"all\" tras -W.\n"
 
 #, c-format
 msgid "%s accepting requests since %s\n"
@@ -2356,21 +2251,15 @@ msgid "%s: Error - expected hostname after '-h' option!\n"
 msgstr "%s: Error - se esperaba un nombre de ordenador tras la opción '-h'.\n"
 
 #, c-format
-msgid ""
-"%s: error - %s environment variable names non-existent destination \"%s\"!\n"
-msgstr ""
-"%s: error - %s nombres de variables de entorno no existen en destino \"%s"
-"\".\n"
+msgid "%s: error - %s environment variable names non-existent destination \"%s\"!\n"
+msgstr "%s: error - %s nombres de variables de entorno no existen en destino \"%s\".\n"
 
 #, c-format
 msgid "%s: error - no default destination available.\n"
 msgstr "%s: error - destino predeterminado no disponible.\n"
 
-msgid ""
-"Usage: lpq [-P dest] [-U username] [-h hostname[:port]] [-l] [+interval]\n"
-msgstr ""
-"Uso: lpq (-P dest) (-U nombre_usuario) (-h nombre_ordenador(:puerto)) (-l) "
-"(+intervalo)\n"
+msgid "Usage: lpq [-P dest] [-U username] [-h hostname[:port]] [-l] [+interval]\n"
+msgstr "Uso: lpq (-P dest) (-U nombre_usuario) (-h nombre_ordenador(:puerto)) (-l) (+intervalo)\n"
 
 #, c-format
 msgid "%s: Error - expected hostname after '-H' option!\n"
@@ -2381,12 +2270,8 @@ msgid "%s: Error - expected value after '-%c' option!\n"
 msgstr "%s: Error - se esperaba un valor tras la opción '%c'.\n"
 
 #, c-format
-msgid ""
-"%s: Warning - '%c' format modifier not supported - output may not be "
-"correct!\n"
-msgstr ""
-"%s: Advertencia - no se admite el uso del modificador de formato '%c' - la "
-"salida puede no ser correcta.\n"
+msgid "%s: Warning - '%c' format modifier not supported - output may not be correct!\n"
+msgstr "%s: Advertencia - no se admite el uso del modificador de formato '%c' - la salida puede no ser correcta.\n"
 
 #, c-format
 msgid "%s: error - expected option=value after '-o' option!\n"
@@ -2417,11 +2302,8 @@ msgid "%s: Error - too many files - \"%s\"\n"
 msgstr "%s: Error - demasiados archivos - \"%s\"\n"
 
 #, c-format
-msgid ""
-"%s: Error - %s environment variable names non-existent destination \"%s\"!\n"
-msgstr ""
-"%s: Error - %s nombres de variables de entorno no existen en destino \"%s"
-"\".\n"
+msgid "%s: Error - %s environment variable names non-existent destination \"%s\"!\n"
+msgstr "%s: Error - %s nombres de variables de entorno no existen en destino \"%s\".\n"
 
 #, c-format
 msgid "%s: Error - no default destination available.\n"
@@ -2441,8 +2323,7 @@ msgstr "%s: Error - no se ha podido escribir al archivo temporal \"%s\" - %s\n"
 
 #, c-format
 msgid "%s: Error - stdin is empty, so no job has been sent.\n"
-msgstr ""
-"%s: Error - stdin está vacío, por lo tanto no se ha enviado ningún trabajo.\n"
+msgstr "%s: Error - stdin está vacío, por lo tanto no se ha enviado ningún trabajo.\n"
 
 #, c-format
 msgid "%s: Error - unknown destination \"%s\"!\n"
@@ -2478,9 +2359,7 @@ msgstr "%s : Se esperaba una ID de trabajo tras la opción '-i'.\n"
 
 #, c-format
 msgid "%s: Error - cannot print files and alter jobs simultaneously!\n"
-msgstr ""
-"%s: Error - no se pueden imprimir archivos y alterar trabajos al mismo "
-"tiempo.\n"
+msgstr "%s: Error - no se pueden imprimir archivos y alterar trabajos al mismo tiempo.\n"
 
 #, c-format
 msgid "%s: Error - bad job ID!\n"
@@ -2520,8 +2399,7 @@ msgstr "%s: Error - se esperaba un nombre de retención tras la opción '-H'.\n"
 
 #, c-format
 msgid "%s: Need job ID ('-i jobid') before '-H restart'!\n"
-msgstr ""
-"%s: Se necesita un ID de trabajo ('-i id_trabajo') antes de '-H restart'.\n"
+msgstr "%s: Se necesita un ID de trabajo ('-i id_trabajo') antes de '-H restart'.\n"
 
 #, c-format
 msgid "%s: Error - expected page list after '-P' option!\n"
@@ -2544,19 +2422,12 @@ msgid "%s: Warning - content type option ignored!\n"
 msgstr "%s: Advertencia - opción de tipo de contenido no tenida en cuenta.\n"
 
 #, c-format
-msgid ""
-"%s: Error - cannot print from stdin if files or a job ID are provided!\n"
-msgstr ""
-"%s: Error - no se puede imprimir desde stdin si se proporcionan archivos o "
-"una ID de trabajo.\n"
+msgid "%s: Error - cannot print from stdin if files or a job ID are provided!\n"
+msgstr "%s: Error - no se puede imprimir desde stdin si se proporcionan archivos o una ID de trabajo.\n"
 
 #, c-format
-msgid ""
-"%s: Error - need \"completed\", \"not-completed\", or \"all\" after '-W' "
-"option!\n"
-msgstr ""
-"%s: Error - se necesita \"completed\", \"not completed\", o \"all\" tras la "
-"opción '-W'.\n"
+msgid "%s: Error - need \"completed\", \"not-completed\", or \"all\" after '-W' option!\n"
+msgstr "%s: Error - se necesita \"completed\", \"not completed\", o \"all\" tras la opción '-W'.\n"
 
 #, c-format
 msgid "%s: Error - expected destination after '-b' option!\n"
@@ -2613,14 +2484,10 @@ msgid "Job subscriptions cannot be renewed!"
 msgstr "Las suscripciones de trabajos no han podido ser renovadas."
 
 msgid "cupsd: Expected config filename after \"-c\" option!\n"
-msgstr ""
-"cupsd: Se esperaba un nombre de archivo de configuración tras la opción \"-c"
-"\".\n"
+msgstr "cupsd: Se esperaba un nombre de archivo de configuración tras la opción \"-c\".\n"
 
 msgid "cupsd: launchd(8) support not compiled in, running in normal mode.\n"
-msgstr ""
-"cupsd: el uso de launchd(8) no ha sido compilado, ejecutándose en modo "
-"normal.\n"
+msgstr "cupsd: el uso de launchd(8) no ha sido compilado, ejecutándose en modo normal.\n"
 
 #, c-format
 msgid "cupsd: Unknown option \"%c\" - aborting!\n"
@@ -2651,18 +2518,11 @@ msgstr ""
 msgid "        WARN    Line %d only contains whitespace!\n"
 msgstr "        ADVERTENCIA    La línea %d solo contiene espacios en blanco.\n"
 
-msgid ""
-"        WARN    File contains a mix of CR, LF, and CR LF line endings!\n"
-msgstr ""
-"        ADVERTENCIA    El archivo contiene una mezcla de líneas acabadas en "
-"CR, LF y CR LF.\n"
+msgid "        WARN    File contains a mix of CR, LF, and CR LF line endings!\n"
+msgstr "        ADVERTENCIA    El archivo contiene una mezcla de líneas acabadas en CR, LF y CR LF.\n"
 
-msgid ""
-"        WARN    Non-Windows PPD files should use lines ending with only LF, "
-"not CR LF!\n"
-msgstr ""
-"        ADVERTENCIA    Los archivos PPD que no sean de Windows deben tener "
-"líneas que acaben sólo en LF, no en CR LF.\n"
+msgid "        WARN    Non-Windows PPD files should use lines ending with only LF, not CR LF!\n"
+msgstr "        ADVERTENCIA    Los archivos PPD que no sean de Windows deben tener líneas que acaben sólo en LF, no en CR LF.\n"
 
 msgid "Printer Maintenance"
 msgstr "Mantenimiento de impresora"
@@ -2684,31 +2544,19 @@ msgstr "      **FALLO**  Idioma incorrecto \"%s\".\n"
 
 #, c-format
 msgid "      **FAIL**  Missing \"%s\" translation string for option %s!\n"
-msgstr ""
-"      **FALLO**  Cadena de traducción \"%s\" para opción %s desaparecida.\n"
+msgstr "      **FALLO**  Cadena de traducción \"%s\" para opción %s desaparecida.\n"
 
 #, c-format
-msgid ""
-"      **FAIL**  Default translation string for option %s contains 8-bit "
-"characters!\n"
-msgstr ""
-"      **FALLO**  Cadena de traducción predeterminada para opción %s contiene "
-"caracteres de 8-bits.\n"
+msgid "      **FAIL**  Default translation string for option %s contains 8-bit characters!\n"
+msgstr "      **FALLO**  Cadena de traducción predeterminada para opción %s contiene caracteres de 8-bits.\n"
 
 #, c-format
-msgid ""
-"      **FAIL**  Missing \"%s\" translation string for option %s, choice %s!\n"
-msgstr ""
-"      **FALLO**  Cadena de traducción \"%s\" para opción %s, preferencia %"
-"s.\n"
+msgid "      **FAIL**  Missing \"%s\" translation string for option %s, choice %s!\n"
+msgstr "      **FALLO**  Cadena de traducción \"%s\" para opción %s, preferencia %s.\n"
 
 #, c-format
-msgid ""
-"      **FAIL**  Default translation string for option %s choice %s contains "
-"8-bit characters!\n"
-msgstr ""
-"      **FALLO**  Cadena de traducción predeterminada para opción %s "
-"preferencia %s contiene caracteres de 8-bits.\n"
+msgid "      **FAIL**  Default translation string for option %s choice %s contains 8-bit characters!\n"
+msgstr "      **FALLO**  Cadena de traducción predeterminada para opción %s preferencia %s contiene caracteres de 8-bits.\n"
 
 #, c-format
 msgid "      **FAIL**  Bad cupsFilter value \"%s\"!\n"
@@ -2727,50 +2575,37 @@ msgstr "Faltan dobles comillas en línea %d.\n"
 
 #, c-format
 msgid "Bad option + choice on line %d!\n"
-msgstr "Opción incorrecta + preferencia en línea %s.\n"
+msgstr "Opción incorrecta + preferencia en línea %d.\n"
 
 #, c-format
 msgid "Unable to copy Windows 2000 printer driver files (%d)!\n"
-msgstr ""
-"No se han podido copiar los archivos del controlador de impresora de Windows "
-"2000 (%d).\n"
+msgstr "No se han podido copiar los archivos del controlador de impresora de Windows 2000 (%d).\n"
 
 #, c-format
 msgid "Unable to copy CUPS printer driver files (%d)!\n"
-msgstr ""
-"No se han podido copiar los archivos del controlador de impresora de CUPS (%"
-"d).\n"
+msgstr "No se han podido copiar los archivos del controlador de impresora de CUPS (%d).\n"
 
 #, c-format
 msgid "Unable to install Windows 2000 printer driver files (%d)!\n"
-msgstr ""
-"No se han podido instalar los archivos del controlador de impresora de "
-"Windows 2000 (%d).\n"
+msgstr "No se han podido instalar los archivos del controlador de impresora de Windows 2000 (%d).\n"
 
 #, c-format
 msgid "Unable to copy Windows 9x printer driver files (%d)!\n"
-msgstr ""
-"No se han podido copiar los archivos del controlador de impresora de Windows "
-"9x (%d).\n"
+msgstr "No se han podido copiar los archivos del controlador de impresora de Windows 9x (%d).\n"
 
 #, c-format
 msgid "Unable to install Windows 9x printer driver files (%d)!\n"
-msgstr ""
-"No se han podido instalar los archivos del controlador de impresora de "
-"Windows 9x (%d).\n"
+msgstr "No se han podido instalar los archivos del controlador de impresora de Windows 9x (%d).\n"
 
 msgid "No Windows printer drivers are installed!\n"
 msgstr "No está instalado ningún controlador de impresora de Windows.\n"
 
 msgid "Warning, no Windows 2000 printer drivers are installed!\n"
-msgstr ""
-"Advertencia, no está instalado ningún controlador de impresora de Windows "
-"2000.\n"
+msgstr "Advertencia, no está instalado ningún controlador de impresora de Windows 2000.\n"
 
 #, c-format
 msgid "Unable to set Windows printer driver (%d)!\n"
-msgstr ""
-"No se ha podido configurar el controlador de impresora de Windows (%d).\n"
+msgstr "No se ha podido configurar el controlador de impresora de Windows (%d).\n"
 
 msgid ""
 "Usage: cupsaddsmb [options] printer1 ... printerN\n"
@@ -2788,8 +2623,7 @@ msgstr ""
 "       cupsaddsmb [opciones] -a\n"
 "\n"
 "Opciones:\n"
-"  -E               Hace que se use encriptación en la conexión con el "
-"servidor\n"
+"  -E               Hace que se use encriptación en la conexión con el servidor\n"
 "  -H servidor_samba  Usa el servidor SAMBA especificado\n"
 "  -U usuario_samba    Autentifica usando el usuario SAMBA especificado\n"
 "  -a               Exporta todas las impresoras\n"
@@ -2798,41 +2632,29 @@ msgstr ""
 
 #, c-format
 msgid "Unable to copy Windows 2000 printer driver files (%d)!"
-msgstr ""
-"No se han podido copiar los archivos del controlador de impresora de Windows "
-"2000 (%d)."
+msgstr "No se han podido copiar los archivos del controlador de impresora de Windows 2000 (%d)."
 
 #, c-format
 msgid "Unable to copy CUPS printer driver files (%d)!"
-msgstr ""
-"No se han podido copiar los archivos del controlador de impresora de CUPS (%"
-"d)."
+msgstr "No se han podido copiar los archivos del controlador de impresora de CUPS (%d)."
 
 #, c-format
 msgid "Unable to install Windows 2000 printer driver files (%d)!"
-msgstr ""
-"No se han podido instalar los archivos del controlador de impresora de "
-"Windows 2000 (%d)."
+msgstr "No se han podido instalar los archivos del controlador de impresora de Windows 2000 (%d)."
 
 #, c-format
 msgid "Unable to copy Windows 9x printer driver files (%d)!"
-msgstr ""
-"No se han podido copiar los archivos del controlador de impresora de Windows "
-"9x (%d)."
+msgstr "No se han podido copiar los archivos del controlador de impresora de Windows 9x (%d)."
 
 #, c-format
 msgid "Unable to install Windows 9x printer driver files (%d)!"
-msgstr ""
-"No se han podido instalar los archivos del controlador de impresora de "
-"Windows 9x (%d)."
+msgstr "No se han podido instalar los archivos del controlador de impresora de Windows 9x (%d)."
 
 msgid "No Windows printer drivers are installed!"
 msgstr "No está instalado ningún controlador de impresora de Windows."
 
 msgid "Warning, no Windows 2000 printer drivers are installed!"
-msgstr ""
-"Advertencia, no está instalado ningún controlador de impresora de Windows "
-"2000."
+msgstr "Advertencia, no está instalado ningún controlador de impresora de Windows 2000."
 
 #, c-format
 msgid "open of %s failed: %s"
@@ -2859,12 +2681,8 @@ msgid "Job #%d is already completed - can't cancel."
 msgstr "El trabajo #%d ya ha sido completado - no se puede cancelar."
 
 #, c-format
-msgid ""
-"You must access this page using the URL <A HREF=\"https://%s:%d%s\">https://%"
-"s:%d%s</A>."
-msgstr ""
-"Debe acceder a esta página usando el URL <A HREF=\"https://%s:%d%s\">https://"
-"%s:%d%s</A>."
+msgid "You must access this page using the URL <A HREF=\"https://%s:%d%s\">https://%s:%d%s</A>."
+msgstr "Debe acceder a esta página usando el URL <A HREF=\"https://%s:%d%s\">https://%s:%d%s</A>."
 
 #, c-format
 msgid "Unsupported format '%s'!"
@@ -2978,8 +2796,7 @@ msgid ""
 "\n"
 "    -h       Show program usage\n"
 "\n"
-"    Note: this program only validates the DSC comments, not the PostScript "
-"itself.\n"
+"    Note: this program only validates the DSC comments, not the PostScript itself.\n"
 msgstr ""
 "Uso: cupstestdsc [opciones] nombre_archivo.ps [... nombre_archivo.ps]\n"
 "       cupstestdsc [opciones] -\n"
@@ -2988,17 +2805,16 @@ msgstr ""
 "\n"
 "    -h       Muestra cómo se usa el programa\n"
 "\n"
-"    Nota: este programa sólo valida los comentarios DSC, no el PostScript en "
-"sí mismo.\n"
+"    Nota: este programa sólo valida los comentarios DSC, no el PostScript en sí mismo.\n"
 
 #, c-format
 msgid "Password for %s on %s? "
-msgstr ""
+msgstr "¿Contraseña de %s en %s? "
 
-#, fuzzy
 msgid ""
 "      **FAIL**  1284DeviceId must be 1284DeviceID!\n"
 "                REF: Page 72, section 5.5\n"
 msgstr ""
-"      **FALLO**  Preferencia %s incorrecta %s.\n"
-"                REF: Página 122, sección 5.17\n"
+"      **FALLO**  1284DeviceId debe ser 1284DeviceID.\n"
+"                REF: Página 72, sección 5.5\n"
+
index cf6d770a9a367f7ccc3550e785da9cb2f171336b..464407aba9843f38bc895982fcfaf4c2a364ef84 100644 (file)
@@ -25,7 +25,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: CUPS 1.2\n"
 "Report-Msgid-Bugs-To: http://www.cups.org/str.php\n"
-"POT-Creation-Date: 2006-05-21 10:08-0400\n"
+"POT-Creation-Date: 2006-05-21 10:07-0400\n"
 "PO-Revision-Date: 2006-03-29 23:44+0900\n"
 "Last-Translator: Kenshi Muto <kmuto@debian.org>\n"
 "Language-Team: Japanese <LL@li.org>\n"
index d10a852c4af355972b6b2d01310d616238a29874..49c815145ef06e839e92468c16bc20ab14fd53b7 100644 (file)
@@ -25,7 +25,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: CUPS 1.2\n"
 "Report-Msgid-Bugs-To: http://www.cups.org/str.php\n"
-"POT-Creation-Date: 2006-05-21 10:08-0400\n"
+"POT-Creation-Date: 2006-05-21 10:07-0400\n"
 "PO-Revision-Date: 2006-05-09 17:20+0200\n"
 "Last-Translator: Piotr DrÄ…g <raven@pmail.pl>\n"
 "Language-Team: Polish <pl@li.org>\n"
index 21b3c01498027a0975ddfe41d9a4857a2044a094..a245aa8139745f90e4bfd3362fba56c064ddbd62 100644 (file)
@@ -28,7 +28,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: CUPS 1.2\n"
 "Report-Msgid-Bugs-To: http://www.cups.org/str.php\n"
-"POT-Creation-Date: 2006-05-21 10:08-0400\n"
+"POT-Creation-Date: 2006-05-21 10:07-0400\n"
 "PO-Revision-Date: 2006-04-16 00:55+0100\n"
 "Last-Translator: Daniel Nylander <po@danielnylander.se>\n"
 "Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
index babf5d9df29edd1c070bf7a5c71e0c31f20f969b..e880a6d9752217cdec87d0f2440be88eba10217a 100644 (file)
@@ -21,7 +21,7 @@
 .\"       EMail: cups-info@cups.org
 .\"         WWW: http://www.cups.org
 .\"
-.TH cupsaddsmb 8 "Common UNIX Printing System" "19 April 2006" "Easy Software Products"
+.TH cupsaddsmb 8 "Common UNIX Printing System" "13 June 2006" "Easy Software Products"
 .SH NAME
 cupsaddsmb \- export printers to samba for windows clients
 
@@ -162,13 +162,14 @@ Once you have extracted the driver files, copy them to the
 .nf
 
     [Windows 2000 and higher]
-    cups6.ini
-    cupsui6.dll
-    cupsdrv6.dll
-    ps5ui.dll
-    pscript.hlp
-    pscript.ntf
-    pscript5.dll
+    cups6.inf (from www.cups.org)
+    cups6.ini (from www.cups.org)
+    cupsps6.dll (from www.cups.org)
+    cupsui6.dll (from www.cups.org)
+    ps5ui.dll (from your Windows system)
+    pscript.hlp (from your Windows system)
+    pscript.ntf (from your Windows system)
+    pscript5.dll (from your Windows system)
 .fi
 .LP
 \fBNote:\fR Unlike Windows, case is significant - make sure that
index da38d9a718e25d266a579161a7dbeac3b37879ac..d34c94b40a4ff1d6fcfeef4b95d39abd9177b722 100644 (file)
@@ -21,7 +21,7 @@
 .\"       EMail: cups-info@cups.org
 .\"         WWW: http://www.cups.org
 .\"
-.TH cupsd.conf 5 "Common UNIX Printing System" "23 March 2006" "Easy Software Products"
+.TH cupsd.conf 5 "Common UNIX Printing System" "6 June 2006" "Easy Software Products"
 .SH NAME
 cupsd.conf \- server configuration file for cups
 .SH DESCRIPTION
@@ -367,8 +367,10 @@ Specifies the maximum size of any print job request.
 Listen ip-address:port
 .TP 5
 Listen *:port
+.TP 5
+Listen /path/to/domain/socket
 .br
-Listens to the specified address and port.
+Listens to the specified address and port or domain socket path.
 .TP 5
 <Location /path> ... </Location>
 .br
index 6867d6207b8b92c32185c29effb2c4ddf3881cc7..4ee88b7767d96046e7b15bb4b853859d87205150 100644 (file)
@@ -2,7 +2,7 @@
 
 mailto.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
 mailto.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
-mailto.o: ../cups/i18n.h ../cups/string.h ../config.h
+mailto.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
 testnotify.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
 testnotify.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
 testnotify.o: ../cups/language.h ../cups/string.h ../config.h
index 832780032b4146da019e1ada9565c36b775c35fd..a949db828f698416bd602c90951146e33551faf3 100644 (file)
@@ -10,7 +10,7 @@
 \f1\b WARNING\
 
 \f0\b0 \
-Because MacOS X packages cannot be uninstalled, you will need to reinstall MacOS X to revert to the original CUPS 1.1.x software.\
+This is pre-release software and should not be used in production environments. Because MacOS X packages cannot be uninstalled, you will need to reinstall MacOS X to revert to the original CUPS 1.1.x software.\
 \
 Please report all problems using the Bugs & Features page on the CUPS home page:\
 \
index ab1d520e27ff8594cef0547a830ee6bf65e440da..e3ad2facaf84106836fd060895a90ae9df27bcbc 100644 (file)
@@ -270,7 +270,7 @@ f 0755 root sys $BINDIR/cupstestdsc systemv/cupstestdsc
 f 0755 root sys $BINDIR/cupstestppd systemv/cupstestppd
 f 0755 root sys $BINDIR/lp systemv/lp
 f 0755 root sys $BINDIR/lpoptions systemv/lpoptions
-f 4755 $CUPS_USER sys $BINDIR/lppasswd systemv/lppasswd
+f 4755 root sys $BINDIR/lppasswd systemv/lppasswd
 f 0755 root sys $BINDIR/lpq berkeley/lpq
 f 0755 root sys $BINDIR/lpr berkeley/lpr
 f 0755 root sys $BINDIR/lprm berkeley/lprm
@@ -342,7 +342,7 @@ f 0644 root sys $LOCALEDIR/es/cups_es.po locale/cups_es.po
 %subpackage ja
 f 0644 root sys $LOCALEDIR/ja/cups_ja.po locale/cups_ja.po
 %subpackage pl
-#f 0644 root sys $LOCALEDIR/pl/cups_pl.po locale/cups_pl.po
+f 0644 root sys $LOCALEDIR/pl/cups_pl.po locale/cups_pl.po
 %subpackage sv
 f 0644 root sys $LOCALEDIR/sv/cups_sv.po locale/cups_sv.po
 %subpackage
index 958bd7b10a8c39d94c244f319358735dcfe95ce6..c2f96483249d462afb6c6734ce538772b96d702a 100644 (file)
@@ -1,21 +1,86 @@
+README - CUPS v1.2.0b1 - 01/10/2006
+-----------------------------------
+
+*****************************************************************
+*****************************************************************
+****                                                         ****
+**** WARNING: THIS IS BETA RELEASE SOFTWARE AND MAY BE       ****
+****          TOTALLY UNSTABLE.  DO NOT USE IN ENVIRONMENTS  ****
+****          WHERE RELIABLE SOFTWARE IS REQUIRED!           ****
+****                                                         ****
+*****************************************************************
+*****************************************************************
+
+Looking for compile instructions?  Read the file "INSTALL.txt"
+instead...
+
+*****************************************************************
+*****************************************************************
+****                                                         ****
+**** IF YOU HAVE A NON-POSTSCRIPT PRINTER, YOU WILL ALSO     ****
+**** NEED TO INSTALL ESP GHOSTSCRIPT OR A PATCHED VERSION    ****
+**** OF A STANDARD GHOSTSCRIPT RELEASE.                      ****
+****                                                         ****
+*****************************************************************
+*****************************************************************
+
+
+INTRODUCTION
+
+CUPS provides a portable printing layer for UNIX(r)-based
+operating systems.  It has been developed by Easy Software
+Products to promote a standard printing solution for all UNIX
+vendors and users.  CUPS provides the System V and Berkeley
+command-line interfaces.
+
+CUPS uses the Internet Printing Protocol ("IPP") as the basis
+for managing print jobs and queues.  The Line Printer Daemon
+("LPD") Server Message Block ("SMB"), and AppSocket (a.k.a.
+JetDirect) protocols are also supported with reduced
+functionality.  CUPS adds network printer browsing and
+PostScript Printer Description ("PPD") based printing options to
+support real-world printing under UNIX.
+
+CUPS includes an image file RIP that supports printing of image
+files to non-PostScript printers.  A customized version of GNU
+Ghostscript for CUPS called ESP Ghostscript is available
+separately to support printing of PostScript files within the
+CUPS driver framework.  Sample drivers for Dymo, EPSON, HP, and
+OKIDATA printers are included that use these filters.
+
+Drivers for thousands of printers are provided with our ESP
+Print Pro software, available at:
+
+       http://www.easysw.com/printpro/
+
+CUPS is licensed under the GNU General Public License and GNU
+Library General Public License.  Please contact Easy Software
+Products for commercial support and "binary distribution"
+rights.
+
+
 SYSTEM REQUIREMENTS
 
 Binary distributions require a minimum of 10MB of free disk
 space. We do not recommend using CUPS on a workstation with less
 than 32MB of RAM or a PC with less than 16MB of RAM.
 
+If you are installing from source you'll need ANSI-compliant C
+and C++ compilers and optionally one or more image file support
+libraries.  Complete source installation instructions can be
+found in the file "INSTALL.txt".
+
 
 SOFTWARE REQUIREMENTS
 
 The following operating system software is required to install
 one of the binary distributions from Easy Software Products:
 
-    - AIX 5.2 or higher
+    - AIX 4.3 or higher
     - HP-UX 11.00 or higher
     - IRIX 6.5 or higher
-    - Linux 2.4 with glibc 2.3 or higher (LSB 3.1)
-    - MacOS X 10.4 or higher (PowerPC or Intel)
-    - Solaris 8 or higher (SPARC or Intel)
+    - Linux 2.4 with glibc 2.2 or higher
+    - Solaris 7 or higher (SPARC or Intel)
 
 
 INSTALLING "PORTABLE" CUPS DISTRIBUTIONS
@@ -25,7 +90,7 @@ distributions in TAR format with installation and removal
 scripts generated by our ESP Package Manager (EPM) software,
 which is available from:
 
-    http://www.easysw.com/epm/
+    http://www.easysw.com/epm
 
 WARNING: Installing CUPS will overwrite your existing printing
 system. Backup files are made by the installation script and
@@ -47,9 +112,10 @@ be installed and the scheduler will be started automatically.
 
 INSTALLING HOST-SPECIFIC (RPM, DEBIAN, ETC.) DISTRIBUTIONS
 
-The host-specific distributions use the operating system software
-installation tools.  To install a host-specific distribution
-please consult your operating system documentation.
+The host-specific distributions use the operating system
+software installation tools.  To install a host-specific
+distribution please consult the CUPS Software Administrators
+Manual or your operating system documentation.
 
 
 READING THE DOCUMENTATION
@@ -98,7 +164,93 @@ shown a menu of available functions.
 
 DO NOT use the hostname for your machine - it will not work with
 the default CUPS configuration.  To enable administration access
-on other addresses, consult the on-line help.
+on other addresses, consult the CUPS Software Administrators
+Manual.
+
+
+SETTING UP PRINTER QUEUES FROM THE COMMAND-LINE
+
+CUPS works best with PPD (PostScript Printer Description)
+files.  In a pinch you can also use System V style printer
+interface scripts.
+
+Six sample PPD files are provided with this distribution that
+utilize the PostScript and image file RIPs and the sample EPSON
+and HP printer drivers.  To add the sample DeskJet driver to the
+system for a printer connected to the parallel port, use one of
+the following commands:
+
+    HP-UX:
+
+        /usr/lib/lpadmin -p DeskJet -m deskjet.ppd -v parallel:/dev/c2t0d0_lp -E
+
+    IRIX:
+
+        /usr/lib/lpadmin -p DeskJet -m deskjet.ppd -v parallel:/dev/plp -E
+
+    Linux:
+
+        /usr/lib/lpadmin -p DeskJet -m deskjet.ppd -v parallel:/dev/lp0 -E
+        /usr/lib/lpadmin -p DeskJet -m deskjet.ppd -v parallel:/dev/lp1 -E
+        /usr/lib/lpadmin -p DeskJet -m deskjet.ppd -v parallel:/dev/lp2 -E
+
+    Solaris:
+
+        /usr/lib/lpadmin -p DeskJet -m deskjet.ppd -v parallel:/dev/bpp0 -E
+        /usr/lib/lpadmin -p DeskJet -m deskjet.ppd -v parallel:/dev/ecpp0 -E
+
+Similarly, for the other sample drivers you can use:
+
+    Driver                         PPD File
+    -----------------------------  ------------
+    Dymo Label Printers            dymo.ppd
+    EPSON Stylus Color Series      stcolor.ppd
+    EPSON Stylus Photo Series      stphoto.ppd
+    EPSON Stylus New Color Series  stcolor2.ppd
+    EPSON Stylus New Photo Series  stphoto2.ppd
+    EPSON 9-pin Series             epson9.ppd
+    EPSON 24-pin Series            epson24.ppd
+    HP DeskJet Series              deskjet.ppd
+    HP New DeskJet Series          deskjet2.ppd
+    HP LaserJet Series             laserjet.ppd
+    OKIDATA 9-Pin Series           okidata9.ppd
+    OKIDATA 24-Pin Series          okidat24.ppd
+
+These sample drivers provide basic printing capabilities, but
+generally do not exercise the full potential of the printers or
+CUPS.  For commercial printer drivers check out our ESP Print
+Pro software at:
+
+    http://www.easysw.com/printpro/
+
+
+PRINTING FILES
+
+CUPS provides both the System V "lp" and Berkeley "lpr" commands
+for printing:
+
+    lp filename
+    lpr filename
+
+Both the "lp" and "lpr" commands support printing options for
+the driver:
+
+    lp -omedia=A4 -oresolution=600dpi filename
+    lpr -omedia=A4 -oresolution=600dpi filename
+
+CUPS recognizes many types of images files as well as PDF,
+PostScript, HP-GL/2, and text files, so you can print those
+files directly rather than through an application.
+
+If you have an application that generates output specifically
+for your printer then you need to use the "-oraw" or "-l"
+options:
+
+    lp -oraw filename
+    lpr -l filename
+
+This will prevent the filters from misinterpreting your print
+file.
 
 
 LEGAL STUFF
index fd5d95567a2c3df84b68504be39004449df074e4..8d65e8ba4faf7cbb342a886062f1f8f4e52d7365 100644 (file)
@@ -399,7 +399,7 @@ rm -rf $RPM_BUILD_ROOT
 /usr/share/doc/cups/pl/images/*
 %dir /usr/share/cups/templates/pl
 /usr/share/cups/templates/pl/*
-#/usr/share/locale/pl/cups_pl.po
+/usr/share/locale/pl/cups_pl.po
 
 %files sv
 %defattr(-,root,root)
index 350408b56aff26d0dff41f66c868963d7be985cd..a36824a85a95ab1f02c88f2a966d30e236cc81c6 100644 (file)
@@ -91,51 +91,6 @@ PSTokenizer.o: ../config.h PSTokenizer.h gtypes.h
 SecurityHandler.o: ../config.h GString.h PDFDoc.h XRef.h gtypes.h Object.h
 SecurityHandler.o: gmem.h Array.h Dict.h Stream.h Catalog.h Page.h Decrypt.h
 SecurityHandler.o: Error.h GlobalParams.h CharTypes.h SecurityHandler.h
-SplashBitmap.o: ../config.h gmem.h SplashErrorCodes.h SplashBitmap.h
-SplashBitmap.o: SplashTypes.h gtypes.h
-SplashClip.o: ../config.h gmem.h SplashErrorCodes.h SplashMath.h
-SplashClip.o: SplashTypes.h gtypes.h SplashPath.h SplashXPath.h
-SplashClip.o: SplashXPathScanner.h SplashClip.h
-Splash.o: ../config.h gmem.h SplashErrorCodes.h SplashMath.h SplashTypes.h
-Splash.o: gtypes.h SplashBitmap.h SplashState.h SplashPath.h SplashXPath.h
-Splash.o: SplashXPathScanner.h SplashPattern.h SplashScreen.h SplashFont.h
-Splash.o: SplashGlyphBitmap.h Splash.h SplashClip.h
-SplashFont.o: ../config.h gmem.h SplashMath.h SplashTypes.h gtypes.h
-SplashFont.o: SplashGlyphBitmap.h SplashFontFile.h SplashFont.h
-SplashFontEngine.o: ../config.h gmem.h GString.h SplashT1FontEngine.h
-SplashFontEngine.o: SplashFTFontEngine.h SplashFontFile.h gtypes.h
-SplashFontEngine.o: SplashTypes.h SplashFontFileID.h SplashFont.h
-SplashFontEngine.o: SplashFontEngine.h
-SplashFontFile.o: ../config.h GString.h SplashFontFile.h gtypes.h
-SplashFontFile.o: SplashTypes.h SplashFontFileID.h
-SplashFontFileID.o: ../config.h SplashFontFileID.h gtypes.h
-SplashFTFont.o: ../config.h
-SplashFTFontEngine.o: ../config.h
-SplashFTFontFile.o: ../config.h
-SplashOutputDev.o: ../config.h gfile.h gtypes.h GlobalParams.h CharTypes.h
-SplashOutputDev.o: Error.h Object.h gmem.h GString.h Array.h Dict.h Stream.h
-SplashOutputDev.o: GfxFont.h Link.h CharCodeToUnicode.h FontEncodingTables.h
-SplashOutputDev.o: FoFiTrueType.h FoFiBase.h SplashBitmap.h SplashTypes.h
-SplashOutputDev.o: SplashGlyphBitmap.h SplashPattern.h SplashScreen.h
-SplashOutputDev.o: SplashPath.h SplashState.h SplashErrorCodes.h
-SplashOutputDev.o: SplashFontEngine.h SplashFont.h SplashFontFile.h
-SplashOutputDev.o: SplashFontFileID.h Splash.h SplashClip.h SplashOutputDev.h
-SplashOutputDev.o: OutputDev.h GfxState.h Function.h
-SplashPath.o: ../config.h gmem.h SplashErrorCodes.h SplashPath.h
-SplashPath.o: SplashTypes.h gtypes.h
-SplashPattern.o: ../config.h SplashMath.h SplashTypes.h gtypes.h
-SplashPattern.o: SplashScreen.h SplashPattern.h
-SplashScreen.o: ../config.h gmem.h SplashMath.h SplashTypes.h gtypes.h
-SplashScreen.o: SplashScreen.h
-SplashState.o: ../config.h gmem.h SplashPattern.h SplashTypes.h gtypes.h
-SplashState.o: SplashScreen.h SplashClip.h SplashState.h
-SplashT1Font.o: ../config.h
-SplashT1FontEngine.o: ../config.h
-SplashT1FontFile.o: ../config.h
-SplashXPath.o: ../config.h gmem.h SplashMath.h SplashTypes.h gtypes.h
-SplashXPath.o: SplashPath.h SplashXPath.h
-SplashXPathScanner.o: ../config.h gmem.h SplashMath.h SplashTypes.h gtypes.h
-SplashXPathScanner.o: SplashXPath.h SplashXPathScanner.h
 Stream.o: ../config.h gmem.h gfile.h gtypes.h Error.h Object.h GString.h
 Stream.o: Array.h Dict.h Stream.h Lexer.h Decrypt.h GfxState.h Function.h
 Stream.o: JBIG2Stream.h JPXStream.h Stream-CCITT.h
diff --git a/ppd/intelbar.ppd b/ppd/intelbar.ppd
new file mode 100644 (file)
index 0000000..f2af1a3
--- /dev/null
@@ -0,0 +1,219 @@
+*PPD-Adobe: "4.3"
+*%
+*% "$Id$"
+*%
+*%   Sample IntelliBar label printer driver PPD file for the Common UNIX
+*%   Printing System (CUPS).
+*%
+*%   Copyright 2001-2006 by Easy Software Products.
+*%
+*%   These coded instructions, statements, and computer programs are the
+*%   property of Easy Software Products and are protected by Federal
+*%   copyright law.  Distribution and use rights are outlined in the file
+*%   "LICENSE.txt" which should have been included with this file.  If this
+*%   file is missing or damaged please contact Easy Software Products
+*%   at:
+*%
+*%       Attn: CUPS Licensing Information
+*%       Easy Software Products
+*%       44141 Airport View Drive, Suite 204
+*%       Hollywood, Maryland 20636 USA
+*%
+*%       Voice: (301) 373-9600
+*%       EMail: cups-info@cups.org
+*%         WWW: http://www.cups.org
+*%
+*FormatVersion:        "4.3"
+*FileVersion:  "1.2"
+*LanguageVersion: English 
+*LanguageEncoding: ISOLatin1
+*PCFileName:   "INTELBAR.PPD"
+*Manufacturer: "Intellitech"
+*Product:      "(GNU Ghostscript)"
+*Product:      "(ESP Ghostscript)"
+*cupsVersion:  1.2
+*cupsManualCopies: False
+*cupsFilter:   "application/vnd.cups-raster 0 rastertolabel"
+*cupsModelNumber: 32
+*ModelName:     "Intellitech IntelliBar Series Label Printer"
+*ShortNickName: "Intellitech IntelliBar Series"
+*NickName:      "Intellitech IntelliBar Series Label Printer v1.2"
+*PSVersion:    "(3010.000) 81501"
+*LanguageLevel:        "3"
+*ColorDevice:  False
+*DefaultColorSpace: Gray
+*FileSystem:   False
+*Throughput:   "8"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+
+*OpenUI *PageSize/Media Size: PickOne
+*OrderDependency: 10 AnySetup *PageSize
+*DefaultPageSize: w288h432
+*PageSize w288h432/Label - 4.00x6.00": "<</PageSize[288 432]/ImagingBBox null>>setpagedevice"
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 10 AnySetup *PageRegion
+*DefaultPageRegion: w288h432
+*PageRegion w288h432/Label - 4.00x6.00": "<</PageSize[288 432]/ImagingBBox null>>setpagedevice"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: w288h432
+*ImageableArea w288h432/Label - 4.00x6.00": "0 5.76 288 426.24"
+
+*DefaultPaperDimension: w288h432
+*PaperDimension w288h432/Label - 4.00x6.00": "288 432"
+
+*MaxMediaWidth: "630"
+*MaxMediaHeight: "7128"
+*HWMargins: 0 5.76 0 5.76
+*CustomPageSize True: "pop pop pop <</PageSize[5 -2 roll]/ImagingBBox null>>setpagedevice"
+*ParamCustomPageSize Width: 1 points 36 630
+*ParamCustomPageSize Height: 2 points 36 7128
+*ParamCustomPageSize WidthOffset: 3 points 0 0
+*ParamCustomPageSize HeightOffset: 4 points 0 0
+*ParamCustomPageSize Orientation: 5 int 0 0
+
+*OpenUI *Resolution/Output Resolution: PickOne
+*OrderDependency: 20 AnySetup *Resolution
+*DefaultResolution: 300dpi
+*Resolution 300dpi/300 DPI: "<</HWResolution[300 300]>>setpagedevice"
+*CloseUI: *Resolution
+
+*OpenGroup: PrinterSettings/Printer Settings
+*OpenUI *inPrintDensity/Print Density: PickOne
+*OrderDependency: 20 DocumentSetup *inPrintDensity
+*DefaultinPrintDensity: Default
+*inPrintDensity Default/PrinterDefault: "<<cupsCompression -1>>setpagedevice"
+*inPrintDensity -15: "<</cupsCompression 0>>setpagedevice"
+*inPrintDensity -14: "<</cupsCompression 3>>setpagedevice"
+*inPrintDensity -13: "<</cupsCompression 6>>setpagedevice"
+*inPrintDensity -12: "<</cupsCompression 10>>setpagedevice"
+*inPrintDensity -11: "<</cupsCompression 13>>setpagedevice"
+*inPrintDensity -10: "<</cupsCompression 16>>setpagedevice"
+*inPrintDensity -9: "<</cupsCompression 20>>setpagedevice"
+*inPrintDensity -8: "<</cupsCompression 23>>setpagedevice"
+*inPrintDensity -7: "<</cupsCompression 26>>setpagedevice"
+*inPrintDensity -6: "<</cupsCompression 30>>setpagedevice"
+*inPrintDensity -5: "<</cupsCompression 33>>setpagedevice"
+*inPrintDensity -4: "<</cupsCompression 36>>setpagedevice"
+*inPrintDensity -3: "<</cupsCompression 40>>setpagedevice"
+*inPrintDensity -2: "<</cupsCompression 43>>setpagedevice"
+*inPrintDensity -1: "<</cupsCompression 46>>setpagedevice"
+*inPrintDensity 0: "<</cupsCompression 50>>setpagedevice"
+*inPrintDensity 1: "<</cupsCompression 53>>setpagedevice"
+*inPrintDensity 2: "<</cupsCompression 56>>setpagedevice"
+*inPrintDensity 3: "<</cupsCompression 60>>setpagedevice"
+*inPrintDensity 4: "<</cupsCompression 63>>setpagedevice"
+*inPrintDensity 5: "<</cupsCompression 66>>setpagedevice"
+*inPrintDensity 6: "<</cupsCompression 70>>setpagedevice"
+*inPrintDensity 7: "<</cupsCompression 73>>setpagedevice"
+*inPrintDensity 8: "<</cupsCompression 76>>setpagedevice"
+*inPrintDensity 9: "<</cupsCompression 80>>setpagedevice"
+*inPrintDensity 10: "<</cupsCompression 83>>setpagedevice"
+*inPrintDensity 11: "<</cupsCompression 86>>setpagedevice"
+*inPrintDensity 12: "<</cupsCompression 90>>setpagedevice"
+*inPrintDensity 13: "<</cupsCompression 93>>setpagedevice"
+*inPrintDensity 14: "<</cupsCompression 96>>setpagedevice"
+*inPrintDensity 15: "<</cupsCompression 100>>setpagedevice"
+*CloseUI: *inPrintDensity
+
+*OpenUI *inPrintRate/Print Speed: PickOne
+*OrderDependency: 20 DocumentSetup *inPrintRate
+*DefaultinPrintRate: Default
+*inPrintRate Default/PrinterDefault: "<</cupsRowFeed 0>>setpagedevice"
+*inPrintRate 15/15 mm/sec.: "<</cupsRowFeed 15>>setpagedevice"
+*inPrintRate 20/20 mm/sec.: "<</cupsRowFeed 20>>setpagedevice"
+*inPrintRate 30/30 mm/sec.: "<</cupsRowFeed 30>>setpagedevice"
+*inPrintRate 40/40 mm/sec.: "<</cupsRowFeed 40>>setpagedevice"
+*inPrintRate 60/60 mm/sec.: "<</cupsRowFeed 60>>setpagedevice"
+*inPrintRate 80/80 mm/sec.: "<</cupsRowFeed 80>>setpagedevice"
+*inPrintRate 100/100 mm/sec.: "<</cupsRowFeed 100>>setpagedevice"
+*inPrintRate 120/120 mm/sec.: "<</cupsRowFeed 120>>setpagedevice"
+*inPrintRate 150/150 mm/sec.: "<</cupsRowFeed 150>>setpagedevice"
+*inPrintRate 200/200 mm/sec.: "<</cupsRowFeed 200>>setpagedevice"
+*inPrintRate 250/250 mm/sec.: "<</cupsRowFeed 250>>setpagedevice"
+*inPrintRate 300/300 mm/sec.: "<</cupsRowFeed 300>>setpagedevice"
+*CloseUI: *inPrintRate
+
+*OpenUI *inTearInterval/Print and Tear: PickOne
+*OrderDependency: 20 DocumentSetup *inTearInterval
+*DefaultinTearInterval: Default
+*inTearInterval Default/PrinterDefault: "<</cupsRowCount -1>>setpagedevice"
+*inTearInterval None/Disabled: "<</cupsRowCount 0>>setpagedevice"
+*inTearInterval 1/Every Label: "<</cupsRowCount 1>>setpagedevice"
+*inTearInterval 2/Every 2 Labels: "<</cupsRowCount 2>>setpagedevice"
+*inTearInterval 3/Every 3 Labels: "<</cupsRowCount 3>>setpagedevice"
+*inTearInterval 4/Every 4 Labels: "<</cupsRowCount 4>>setpagedevice"
+*inTearInterval 5/Every 5 Labels: "<</cupsRowCount 5>>setpagedevice"
+*inTearInterval 6/Every 6 Labels: "<</cupsRowCount 6>>setpagedevice"
+*inTearInterval 7/Every 7 Labels: "<</cupsRowCount 7>>setpagedevice"
+*inTearInterval 8/Every 8 Labels: "<</cupsRowCount 8>>setpagedevice"
+*inTearInterval 9/Every 9 Labels: "<</cupsRowCount 9>>setpagedevice"
+*inTearInterval 10/Every 10 Labels: "<</cupsRowCount 10>>setpagedevice"
+*CloseUI: *inTearInterval
+
+*CustominTearInterval True: "<</cupsRowCount 2 1 roll>>setpagedevice"
+*ParamCustominTearInterval Interval: 1 int 1 99
+
+*OpenUI *inCutInterval/Print and Cut: PickOne
+*OrderDependency: 20 DocumentSetup *inCutInterval
+*DefaultinCutInterval: Default
+*inCutInterval Default/PrinterDefault: "<</cupsRowStep -1>>setpagedevice"
+*inCutInterval None/Disabled: "<</cupsRowStep 0>>setpagedevice"
+*inCutInterval 1/Every Label: "<</cupsRowStep 1>>setpagedevice"
+*inCutInterval 2/Every 2 Labels: "<</cupsRowStep 2>>setpagedevice"
+*inCutInterval 3/Every 3 Labels: "<</cupsRowStep 3>>setpagedevice"
+*inCutInterval 4/Every 4 Labels: "<</cupsRowStep 4>>setpagedevice"
+*inCutInterval 5/Every 5 Labels: "<</cupsRowStep 5>>setpagedevice"
+*inCutInterval 6/Every 6 Labels: "<</cupsRowStep 6>>setpagedevice"
+*inCutInterval 7/Every 7 Labels: "<</cupsRowStep 7>>setpagedevice"
+*inCutInterval 8/Every 8 Labels: "<</cupsRowStep 8>>setpagedevice"
+*inCutInterval 9/Every 9 Labels: "<</cupsRowStep 9>>setpagedevice"
+*inCutInterval 10/Every 10 Labels: "<</cupsRowStep 10>>setpagedevice"
+*CloseUI: *inCutInterval
+
+*CustominCutInterval True: "<</cupsRowStep 2 1 roll>>setpagedevice"
+*ParamCustominCutInterval Interval: 1 int 1 99
+*CloseGroup: *PrinterSettings
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+*%
+*% End of "$Id: zebra.ppd 5130 2006-02-17 20:25:33Z mike $".
+*%
index 7ca0a4300d76163fe38602abcf789ef78a612350..f6e2042a263c8e6d8a76c665ee9e435412c6f08a 100644 (file)
@@ -4,169 +4,177 @@ auth.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h
 auth.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h
 auth.o: ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
 auth.o: ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h ../cups/file.h
-auth.o: ../cups/http.h ../cups/i18n.h ../cups/debug.h sysman.h statbuf.h
-auth.o: cert.h auth.h client.h policy.h printers.h classes.h job.h conf.h
-auth.o: banners.h dirsvc.h network.h subscriptions.h
+auth.o: ../cups/http.h ../cups/i18n.h ../cups/transcode.h ../cups/debug.h
+auth.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
+auth.o: classes.h job.h conf.h banners.h dirsvc.h network.h subscriptions.h
 banners.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h
 banners.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h
 banners.o: ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
 banners.o: ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h
-banners.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/debug.h
-banners.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
-banners.o: classes.h job.h conf.h banners.h dirsvc.h network.h
+banners.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h
+banners.o: ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h
+banners.o: printers.h classes.h job.h conf.h banners.h dirsvc.h network.h
 banners.o: subscriptions.h ../cups/dir.h
 cert.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h
 cert.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h
 cert.o: ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
 cert.o: ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h ../cups/file.h
-cert.o: ../cups/http.h ../cups/i18n.h ../cups/debug.h sysman.h statbuf.h
-cert.o: cert.h auth.h client.h policy.h printers.h classes.h job.h conf.h
-cert.o: banners.h dirsvc.h network.h subscriptions.h
+cert.o: ../cups/http.h ../cups/i18n.h ../cups/transcode.h ../cups/debug.h
+cert.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
+cert.o: classes.h job.h conf.h banners.h dirsvc.h network.h subscriptions.h
 classes.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h
 classes.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h
 classes.o: ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
 classes.o: ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h
-classes.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/debug.h
-classes.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
-classes.o: classes.h job.h conf.h banners.h dirsvc.h network.h
+classes.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h
+classes.o: ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h
+classes.o: printers.h classes.h job.h conf.h banners.h dirsvc.h network.h
 classes.o: subscriptions.h
 client.o: ../cups/http-private.h ../config.h ../cups/http.h ../cups/md5.h
 client.o: ../cups/ipp-private.h ../cups/ipp.h cupsd.h ../cups/string.h
 client.o: ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
 client.o: ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h
-client.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/debug.h
-client.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
-client.o: classes.h job.h conf.h banners.h dirsvc.h network.h subscriptions.h
+client.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h
+client.o: ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h
+client.o: printers.h classes.h job.h conf.h banners.h dirsvc.h network.h
+client.o: subscriptions.h
 conf.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h
 conf.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h
 conf.o: ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
 conf.o: ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h ../cups/file.h
-conf.o: ../cups/http.h ../cups/i18n.h ../cups/debug.h sysman.h statbuf.h
-conf.o: cert.h auth.h client.h policy.h printers.h classes.h job.h conf.h
-conf.o: banners.h dirsvc.h network.h subscriptions.h ../cups/dir.h
+conf.o: ../cups/http.h ../cups/i18n.h ../cups/transcode.h ../cups/debug.h
+conf.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
+conf.o: classes.h job.h conf.h banners.h dirsvc.h network.h subscriptions.h
+conf.o: ../cups/dir.h
 dirsvc.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h
 dirsvc.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h
 dirsvc.o: ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
 dirsvc.o: ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h
-dirsvc.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/debug.h
-dirsvc.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
-dirsvc.o: classes.h job.h conf.h banners.h dirsvc.h network.h subscriptions.h
+dirsvc.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h
+dirsvc.o: ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h
+dirsvc.o: printers.h classes.h job.h conf.h banners.h dirsvc.h network.h
+dirsvc.o: subscriptions.h
 env.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h
 env.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h
 env.o: ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
 env.o: ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h ../cups/file.h
-env.o: ../cups/http.h ../cups/i18n.h ../cups/debug.h sysman.h statbuf.h
-env.o: cert.h auth.h client.h policy.h printers.h classes.h job.h conf.h
-env.o: banners.h dirsvc.h network.h subscriptions.h
+env.o: ../cups/http.h ../cups/i18n.h ../cups/transcode.h ../cups/debug.h
+env.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
+env.o: classes.h job.h conf.h banners.h dirsvc.h network.h subscriptions.h
 main.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h
 main.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h
 main.o: ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
 main.o: ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h ../cups/file.h
-main.o: ../cups/http.h ../cups/i18n.h ../cups/debug.h sysman.h statbuf.h
-main.o: cert.h auth.h client.h policy.h printers.h classes.h job.h conf.h
-main.o: banners.h dirsvc.h network.h subscriptions.h
+main.o: ../cups/http.h ../cups/i18n.h ../cups/transcode.h ../cups/debug.h
+main.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
+main.o: classes.h job.h conf.h banners.h dirsvc.h network.h subscriptions.h
 ipp.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h
 ipp.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h
 ipp.o: ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
 ipp.o: ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h ../cups/file.h
-ipp.o: ../cups/http.h ../cups/i18n.h ../cups/debug.h sysman.h statbuf.h
-ipp.o: cert.h auth.h client.h policy.h printers.h classes.h job.h conf.h
-ipp.o: banners.h dirsvc.h network.h subscriptions.h
+ipp.o: ../cups/http.h ../cups/i18n.h ../cups/transcode.h ../cups/debug.h
+ipp.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
+ipp.o: classes.h job.h conf.h banners.h dirsvc.h network.h subscriptions.h
 listen.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h
 listen.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h
 listen.o: ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
 listen.o: ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h
-listen.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/debug.h
-listen.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
-listen.o: classes.h job.h conf.h banners.h dirsvc.h network.h subscriptions.h
+listen.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h
+listen.o: ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h
+listen.o: printers.h classes.h job.h conf.h banners.h dirsvc.h network.h
+listen.o: subscriptions.h
 job.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h
 job.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h
 job.o: ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
 job.o: ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h ../cups/file.h
-job.o: ../cups/http.h ../cups/i18n.h ../cups/debug.h sysman.h statbuf.h
-job.o: cert.h auth.h client.h policy.h printers.h classes.h job.h conf.h
-job.o: banners.h dirsvc.h network.h subscriptions.h ../cups/backend.h
-job.o: ../cups/dir.h
+job.o: ../cups/http.h ../cups/i18n.h ../cups/transcode.h ../cups/debug.h
+job.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
+job.o: classes.h job.h conf.h banners.h dirsvc.h network.h subscriptions.h
+job.o: ../cups/backend.h ../cups/dir.h
 log.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h
 log.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h
 log.o: ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
 log.o: ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h ../cups/file.h
-log.o: ../cups/http.h ../cups/i18n.h ../cups/debug.h sysman.h statbuf.h
-log.o: cert.h auth.h client.h policy.h printers.h classes.h job.h conf.h
-log.o: banners.h dirsvc.h network.h subscriptions.h
-network.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h
-network.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h
+log.o: ../cups/http.h ../cups/i18n.h ../cups/transcode.h ../cups/debug.h
+log.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
+log.o: classes.h job.h conf.h banners.h dirsvc.h network.h subscriptions.h
+network.o: ../cups/http-private.h ../config.h ../cups/http.h ../cups/md5.h
+network.o: ../cups/ipp-private.h ../cups/ipp.h cupsd.h ../cups/string.h
 network.o: ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
 network.o: ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h
-network.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/debug.h
-network.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
-network.o: classes.h job.h conf.h banners.h dirsvc.h network.h
+network.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h
+network.o: ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h
+network.o: printers.h classes.h job.h conf.h banners.h dirsvc.h network.h
 network.o: subscriptions.h
 policy.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h
 policy.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h
 policy.o: ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
 policy.o: ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h
-policy.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/debug.h
-policy.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
-policy.o: classes.h job.h conf.h banners.h dirsvc.h network.h subscriptions.h
+policy.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h
+policy.o: ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h
+policy.o: printers.h classes.h job.h conf.h banners.h dirsvc.h network.h
+policy.o: subscriptions.h
 printers.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h
 printers.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h
 printers.o: ../cups/string.h ../cups/array.h ../cups/cups.h ../cups/ppd.h
 printers.o: ../cups/array.h ../cups/file.h ../cups/language.h mime.h
 printers.o: ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h
-printers.o: ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h
-printers.o: policy.h printers.h classes.h job.h conf.h banners.h dirsvc.h
-printers.o: network.h subscriptions.h ../cups/transcode.h
+printers.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h
+printers.o: auth.h client.h policy.h printers.h classes.h job.h conf.h
+printers.o: banners.h dirsvc.h network.h subscriptions.h
 process.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h
 process.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h
 process.o: ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
 process.o: ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h
-process.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/debug.h
-process.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
-process.o: classes.h job.h conf.h banners.h dirsvc.h network.h
+process.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h
+process.o: ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h
+process.o: printers.h classes.h job.h conf.h banners.h dirsvc.h network.h
 process.o: subscriptions.h
 quotas.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h
 quotas.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h
 quotas.o: ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
 quotas.o: ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h
-quotas.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/debug.h
-quotas.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
-quotas.o: classes.h job.h conf.h banners.h dirsvc.h network.h subscriptions.h
+quotas.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h
+quotas.o: ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h
+quotas.o: printers.h classes.h job.h conf.h banners.h dirsvc.h network.h
+quotas.o: subscriptions.h
 server.o: ../cups/http-private.h ../config.h ../cups/http.h ../cups/md5.h
 server.o: ../cups/ipp-private.h ../cups/ipp.h cupsd.h ../cups/string.h
 server.o: ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
 server.o: ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h
-server.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/debug.h
-server.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
-server.o: classes.h job.h conf.h banners.h dirsvc.h network.h subscriptions.h
+server.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h
+server.o: ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h
+server.o: printers.h classes.h job.h conf.h banners.h dirsvc.h network.h
+server.o: subscriptions.h
 statbuf.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h
 statbuf.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h
 statbuf.o: ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
 statbuf.o: ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h
-statbuf.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/debug.h
-statbuf.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
-statbuf.o: classes.h job.h conf.h banners.h dirsvc.h network.h
+statbuf.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h
+statbuf.o: ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h
+statbuf.o: printers.h classes.h job.h conf.h banners.h dirsvc.h network.h
 statbuf.o: subscriptions.h
 subscriptions.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h
 subscriptions.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h
 subscriptions.o: ../cups/string.h ../cups/array.h ../cups/cups.h
 subscriptions.o: ../cups/ppd.h ../cups/array.h ../cups/file.h
 subscriptions.o: ../cups/language.h mime.h ../cups/ipp.h ../cups/file.h
-subscriptions.o: ../cups/http.h ../cups/i18n.h ../cups/debug.h sysman.h
-subscriptions.o: statbuf.h cert.h auth.h client.h policy.h printers.h
-subscriptions.o: classes.h job.h conf.h banners.h dirsvc.h network.h
-subscriptions.o: subscriptions.h
+subscriptions.o: ../cups/http.h ../cups/i18n.h ../cups/transcode.h
+subscriptions.o: ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h
+subscriptions.o: policy.h printers.h classes.h job.h conf.h banners.h
+subscriptions.o: dirsvc.h network.h subscriptions.h
 sysman.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h
 sysman.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/string.h
 sysman.o: ../cups/array.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
 sysman.o: ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h
-sysman.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/debug.h
-sysman.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
-sysman.o: classes.h job.h conf.h banners.h dirsvc.h network.h subscriptions.h
+sysman.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h
+sysman.o: ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h
+sysman.o: printers.h classes.h job.h conf.h banners.h dirsvc.h network.h
+sysman.o: subscriptions.h
 filter.o: ../cups/debug.h ../cups/string.h ../config.h mime.h ../cups/array.h
 filter.o: ../cups/ipp.h ../cups/file.h
-mime.o: ../cups/dir.h ../cups/string.h ../config.h mime.h ../cups/array.h
-mime.o: ../cups/ipp.h ../cups/file.h
+mime.o: ../cups/debug.h ../cups/dir.h ../cups/string.h ../config.h mime.h
+mime.o: ../cups/array.h ../cups/ipp.h ../cups/file.h
 type.o: ../cups/string.h ../config.h mime.h ../cups/array.h ../cups/ipp.h
 type.o: ../cups/file.h ../cups/debug.h
 cups-deviced.o: util.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
@@ -176,7 +184,7 @@ cups-deviced.o: ../config.h ../cups/array.h ../cups/dir.h
 cups-driverd.o: util.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
 cups-driverd.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
 cups-driverd.o: ../cups/language.h ../cups/file.h ../cups/string.h
-cups-driverd.o: ../config.h ../cups/dir.h
+cups-driverd.o: ../config.h ../cups/dir.h ../cups/transcode.h
 cups-lpd.o: ../cups/http-private.h ../config.h ../cups/http.h ../cups/md5.h
 cups-lpd.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/cups.h ../cups/ppd.h
 cups-lpd.o: ../cups/array.h ../cups/file.h ../cups/language.h
index ee781150ccd26417e5f4427da0bce27c72033e93..c203ed5db6f730266099b54c4e7f19cb856373b5 100644 (file)
@@ -869,9 +869,12 @@ cupsdCheckAuth(
            */
 
            for (iface = (cupsd_netif_t *)cupsArrayFirst(NetIFList);
-                iface && !strcmp(masks->mask.name.name, iface->name);
+                iface;
                 iface = (cupsd_netif_t *)cupsArrayNext(NetIFList))
            {
+              if (strcmp(masks->mask.name.name, iface->name))
+                continue;
+
               if (iface->address.addr.sa_family == AF_INET)
              {
               /*
index 526e55bcc9e745cbb9de4239211a3c2da0ce2d53..ceb0591ae9de9b196f59db6d20246741b2c3efb6 100644 (file)
 
 #ifdef HAVE_CDSASSL
 #  include <Security/Security.h>
+#  ifdef HAVE_SECBASEPRIV_H
+#    include <Security/SecBasePriv.h>
+#  else
+     extern const char *cssmErrorString(int error);
+#  endif /* HAVE_SECBASEPRIV_H */
 #endif /* HAVE_CDSASSL */
 #ifdef HAVE_GNUTLS
 #  include <gnutls/x509.h>
@@ -1882,24 +1887,27 @@ cupsdSendCommand(
 
 
   if (con->filename)
+  {
     fd = open(con->filename, O_RDONLY);
-  else
-    fd = open("/dev/null", O_RDONLY);
 
-  if (fd < 0)
-  {
-    cupsdLogMessage(CUPSD_LOG_ERROR,
-                    "cupsdSendCommand: %d Unable to open \"%s\" for reading: %s",
-                    con->http.fd, con->filename ? con->filename : "/dev/null",
-                   strerror(errno));
-    return (0);
-  }
+    if (fd < 0)
+    {
+      cupsdLogMessage(CUPSD_LOG_ERROR,
+                      "cupsdSendCommand: %d Unable to open \"%s\" for reading: %s",
+                      con->http.fd, con->filename ? con->filename : "/dev/null",
+                     strerror(errno));
+      return (0);
+    }
 
-  fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
+    fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
+  }
+  else
+    fd = -1;
 
   con->pipe_pid = pipe_command(con, fd, &(con->file), command, options, root);
 
-  close(fd);
+  if (fd >= 0)
+    close(fd);
 
   cupsdLogMessage(CUPSD_LOG_INFO, "Started \"%s\" (pid=%d)", command,
                   con->pipe_pid);
@@ -2659,7 +2667,7 @@ encrypt_client(cupsd_client_t *con)       /* I - Client to encrypt */
     error = SSLSetIOFuncs(conn->session, _httpReadCDSA, _httpWriteCDSA);
 
   if (!error)
-    error = SSLSetProtocolVersion(conn->session, kSSLProtocol3);
+    error = SSLSetProtocolVersionEnabled(conn->session, kSSLProtocol2, false);
 
   if (!error)
   {
@@ -2697,8 +2705,8 @@ encrypt_client(cupsd_client_t *con)       /* I - Client to encrypt */
                     "encrypt_client: Unable to encrypt connection from %s!",
                     con->http.hostname);
 
-    cupsdLogMessage(CUPSD_LOG_ERROR,
-                    "encrypt_client: CDSA error code is %d", (int)error);
+    cupsdLogMessage(CUPSD_LOG_ERROR, "encrypt_client: %s (%d)",
+                    cssmErrorString(error), (int)error);
 
     con->http.error  = error;
     con->http.status = HTTP_ERROR;
index 10677426ff26f511758aba84e9c95a18632d97c4..458a9ba87726339018a16251e733202a675051e1 100644 (file)
@@ -289,6 +289,11 @@ cupsdReadConfiguration(void)
   cupsdSetString(&ServerHeader, "CUPS/1.2");
   cupsdSetString(&StateDir, CUPS_STATEDIR);
 
+  if (!strcmp(CUPS_DEFAULT_PRINTCAP, "/etc/printers.conf"))
+    PrintcapFormat = PRINTCAP_SOLARIS;
+  else
+    PrintcapFormat = PRINTCAP_BSD;
+
   strlcpy(temp, ConfigurationFile, sizeof(temp));
   if ((slash = strrchr(temp, '/')) != NULL)
     *slash = '\0';
@@ -1277,33 +1282,14 @@ get_addr_and_mask(const char *value,    /* I - String from config file */
   const char   *maskval,               /* Pointer to start of mask value */
                *ptr,                   /* Pointer into value */
                *ptr2;                  /* ... */
-  static unsigned netmasks[4][4] =     /* Standard IPv4 netmasks... */
-  {
-    { 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000 },
-    { 0xffffffff, 0xffffffff, 0xffffffff, 0xffff0000 },
-    { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffff00 },
-    { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
-  };
-#ifdef AF_INET6
-  static unsigned netmasks6[8][4] =    /* Standard IPv6 netmasks... */
-  {
-    { 0xffff0000, 0x00000000, 0x00000000, 0x00000000 },
-    { 0xffffffff, 0x00000000, 0x00000000, 0x00000000 },
-    { 0xffffffff, 0xffff0000, 0x00000000, 0x00000000 },
-    { 0xffffffff, 0xffffffff, 0x00000000, 0x00000000 },
-    { 0xffffffff, 0xffffffff, 0xffff0000, 0x00000000 },
-    { 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000 },
-    { 0xffffffff, 0xffffffff, 0xffffffff, 0xffff0000 },
-    { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
-  };
-#endif /* AF_INET6 */
 
 
  /*
   * Get the address...
   */
 
-  memset(ip, 0, sizeof(unsigned) * 4);
+  ip[0]   = ip[1]   = ip[2]   = ip[2]   = 0x00000000;
+  mask[0] = mask[1] = mask[2] = mask[3] = 0xffffffff;
 
   if ((maskval = strchr(value, '/')) != NULL)
     maskval ++;
@@ -1334,6 +1320,7 @@ get_addr_and_mask(const char *value,      /* I - String from config file */
             ptr2 = strchr(ptr2 + 1, ':'), j ++);
 
         i = 7 - j;
+       ptr ++;
       }
       else if (isxdigit(*ptr & 255))
       {
@@ -1343,9 +1330,9 @@ get_addr_and_mask(const char *value,      /* I - String from config file */
          return (0);
 
         if (i & 1)
-          ip[i] |= ipval;
+          ip[i / 2] |= ipval;
        else
-          ip[i] |= ipval << 16;
+          ip[i / 2] |= ipval << 16;
       }
       else
         return (0);
@@ -1354,7 +1341,10 @@ get_addr_and_mask(const char *value,     /* I - String from config file */
         ptr ++;
     }
 
-    ipcount = i;
+    if (*ptr != ']')
+      return (0);
+
+    ptr ++;
 
     if (*ptr && *ptr != '/')
       return (0);
@@ -1366,70 +1356,55 @@ get_addr_and_mask(const char *value,    /* I - String from config file */
     * Parse dotted-decimal IPv4 address...
     */
 
-    family  = AF_INET;
-    ipcount = sscanf(value, "%u.%u.%u.%u", ip + 0, ip + 1, ip + 2, ip + 3);
+    unsigned val[4];                   /* IPv4 address values */
 
-    ip[3] |= ((((ip[0] << 8) | ip[1]) << 8) | ip[2]) << 8;
-    ip[0] = ip[1] = ip[2] = 0;
-  }
 
-  if (*maskval)
-  {
+    family  = AF_INET;
+    ipcount = sscanf(value, "%u.%u.%u.%u", val + 0, val + 1, val + 2, val + 3);
+
    /*
-    * Get the netmask value(s)...
+    * Range check the IP numbers...
     */
 
-    memset(mask, 0, sizeof(unsigned) * 4);
+    for (i = 0; i < ipcount; i ++)
+      if (val[i] > 255)
+        return (0);
 
-#ifdef AF_INET6
-    if (*maskval == '[')
-    {
-     /*
-      * Get hexadecimal mask value...
-      */
+   /*
+    * Make sure the trailing values are zeroed, as some C libraries like
+    * glibc apparently like to fill the unused arguments with garbage...
+    */
 
-      for (i = 0, ptr = maskval + 1; *ptr && i < 8; i ++)
-      {
-       if (*ptr == ']')
-         break;
-       else if (!strncmp(ptr, "::", 2))
-       {
-          for (ptr2 = strchr(ptr + 2, ':'), j = 0;
-              ptr2;
-              ptr2 = strchr(ptr2 + 1, ':'), j ++);
+    for (i = ipcount; i < 4; i ++)
+      val[i] = 0;
 
-          i = 7 - j;
-       }
-       else if (isxdigit(*ptr & 255))
-       {
-          ipval = strtoul(ptr, (char **)&ptr, 16);
+   /*
+    * Merge everything into a 32-bit IPv4 address in ip[3]...
+    */
 
-         if (ipval > 0xffff)
-           return (0);
+    ip[3] = (((((val[0] << 8) | val[1]) << 8) | val[2]) << 8) | val[3];
 
-          if (i & 1)
-            mask[i] |= ipval;
-         else
-            mask[i] |= ipval << 16;
-       }
-       else
-          return (0);
+    if (ipcount < 4)
+      mask[3] = (0xffffffff << (32 - 8 * ipcount)) & 0xffffffff;
+  }
 
-        while (*ptr == ':')
-          ptr ++;
-      }
+  if (*maskval)
+  {
+   /*
+    * Get the netmask value(s)...
+    */
+
+    memset(mask, 0, sizeof(unsigned) * 4);
 
-      if (*ptr)
-       return (0);
-    }
-    else
-#endif /* AF_INET6 */
     if (strchr(maskval, '.'))
     {
      /*
       * Get dotted-decimal mask...
       */
 
+      if (family != AF_INET)
+        return (0);
+
       if (sscanf(maskval, "%u.%u.%u.%u", mask + 0, mask + 1, mask + 2, mask + 3) != 4)
         return (0);
 
@@ -1447,6 +1422,9 @@ get_addr_and_mask(const char *value,      /* I - String from config file */
 #ifdef AF_INET6
       if (family == AF_INET6)
       {
+        if (i > 128)
+         return (0);
+
         i = 128 - i;
 
        if (i <= 96)
@@ -1478,25 +1456,20 @@ get_addr_and_mask(const char *value,    /* I - String from config file */
       else
 #endif /* AF_INET6 */
       {
-        i = 32 - i;
+        if (i > 32)
+         return (0);
 
         mask[0] = 0xffffffff;
         mask[1] = 0xffffffff;
         mask[2] = 0xffffffff;
 
-       if (i > 0)
-          mask[3] = (0xffffffff << i) & 0xffffffff;
+       if (i < 32)
+          mask[3] = (0xffffffff << (32 - i)) & 0xffffffff;
        else
          mask[3] = 0xffffffff;
       }
     }
   }
-#ifdef AF_INET6
-  else if (family == AF_INET6)
-    memcpy(mask, netmasks6[ipcount - 1], sizeof(unsigned) * 4);
-#endif /* AF_INET6 */
-  else
-    memcpy(mask, netmasks[ipcount - 1], sizeof(unsigned) * 4);
 
   cupsdLogMessage(CUPSD_LOG_DEBUG2,
                   "get_addr_and_mask(value=\"%s\", "
@@ -1634,7 +1607,12 @@ parse_aaa(cupsd_location_t *loc, /* I - Location */
       else
        cupsdDenyIP(loc, ones, zeros);
     }
+#ifdef AF_INET6
+    else if (value[0] == '*' || value[0] == '.' || 
+             (!isdigit(value[0] & 255) && value[0] != '['))
+#else
     else if (value[0] == '*' || value[0] == '.' || !isdigit(value[0] & 255))
+#endif /* AF_INET6 */
     {
      /*
       * Host or domain name...
@@ -2406,7 +2384,12 @@ read_configuration(cups_file_t *fp)      /* I - File to read from */
          else
            cupsdDenyIP(location, ones, zeros);
        }
-       else if (value[0] == '*' || value[0] == '.' || !isdigit(value[0]))
+#ifdef AF_INET6
+       else if (value[0] == '*' || value[0] == '.' || 
+                (!isdigit(value[0] & 255) && value[0] != '['))
+#else
+       else if (value[0] == '*' || value[0] == '.' || !isdigit(value[0] & 255))
+#endif /* AF_INET6 */
        {
         /*
           * Host or domain name...
@@ -2490,7 +2473,12 @@ read_configuration(cups_file_t *fp)      /* I - File to read from */
       *    nnn.nnn.nnn.nnn/mmm.mmm.mmm.mmm
       */
 
-      if (value[0] == '*' || value[0] == '.' || !isdigit(value[0]))
+#ifdef AF_INET6
+      if (value[0] == '*' || value[0] == '.' || 
+          (!isdigit(value[0] & 255) && value[0] != '['))
+#else
+      if (value[0] == '*' || value[0] == '.' || !isdigit(value[0] & 255))
+#endif /* AF_INET6 */
       {
        /*
         * Host or domain name...
index ddc99b2594dae795f681b9d3765e7dbe222c7502..900f135380ddddcd731247cbb2acebe66a20d851 100644 (file)
@@ -36,6 +36,7 @@
  *   cupsdStopPolling()            - Stop polling servers as needed.
  *   cupsdUpdateCUPSBrowse()       - Update the browse lists using the CUPS
  *                                   protocol.
+ *   cupsdUpdateLDAPBrowse()       - Scan for new printers via LDAP...
  *   cupsdUpdatePolling()          - Read status messages from the poll daemons.
  *   cupsdUpdateSLPBrowse()        - Get browsing information via SLP.
  *   dequote()                     - Remote quotes from a string.
@@ -1526,39 +1527,57 @@ cupsdUpdateLDAPBrowse(void)
   * Loop through the available printers...
   */
 
-  if ((e = ldap_first_entry(BrowseLDAPHandle, res)) == NULL)
+  for (e = ldap_first_entry(BrowseLDAPHandle, res);
+       e;
+       e = ldap_next_entry(BrowseLDAPHandle, e))
   {
-    cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to get LDAP printer entry!");
-    return;
-  }
+   /*
+    * Get the required values from this entry...
+    */
+
+    if ((value = ldap_get_values(BrowseLDAPHandle, e,
+                                 "printerDescription")) == NULL)
+      continue;
 
-  while (e)
-  {
-    value = ldap_get_values(BrowseLDAPHandle, e, "printerDescription");
     strlcpy(info, *value, sizeof(info));
     ldap_value_free(value);
 
-    value = ldap_get_values(BrowseLDAPHandle, e, "printerLocation");
+    if ((value = ldap_get_values(BrowseLDAPHandle, e,
+                                 "printerLocation")) == NULL)
+      continue;
+
     strlcpy(location, *value, sizeof(location));
     ldap_value_free(value);
 
-    value = ldap_get_values(BrowseLDAPHandle, e, "printerMakeAndModel");
+    if ((value = ldap_get_values(BrowseLDAPHandle, e,
+                                 "printerMakeAndModel")) == NULL)
+      continue;
+
     strlcpy(make_model, *value, sizeof(make_model));
     ldap_value_free(value);
 
-    value = ldap_get_values(BrowseLDAPHandle, e, "printerType");
+    if ((value = ldap_get_values(BrowseLDAPHandle, e,
+                                 "printerType")) == NULL)
+      continue;
+
     type = atoi(*value);
     ldap_value_free(value);
 
-    value = ldap_get_values(BrowseLDAPHandle, e, "printerURI");
+    if ((value = ldap_get_values(BrowseLDAPHandle, e,
+                                 "printerURI")) == NULL)
+      continue;
+
     strlcpy(uri, *value, sizeof(uri));
     ldap_value_free(value);
 
+   /*
+    * Process the entry as browse data...
+    */
+
     if (!is_local_queue(uri, host, sizeof(host), resource, sizeof(resource)))
       process_browse_data(uri, host, resource, type, IPP_PRINTER_IDLE,
                           location, info, make_model, 0, NULL);
 
-    e = ldap_next_entry(BrowseLDAPHandle, e);
   }
 }
 #endif /* HAVE_OPENLDAP */
@@ -2521,7 +2540,7 @@ send_cups_browse(cupsd_printer_t *p)      /* I - Printer to send */
 
          httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
                           iface->hostname, iface->port,
-                          (p->type & CUPS_PRINTER_CLASS) ? "/classes/%s%s" :
+                          (p->type & CUPS_PRINTER_CLASS) ? "/classes/%s" :
                                                            "/printers/%s",
                           p->name);
          snprintf(packet, sizeof(packet), "%x %x %s \"%s\" \"%s\" \"%s\" %s\n",
@@ -2660,13 +2679,13 @@ send_ldap_browse(cupsd_printer_t *p)    /* I - Printer to register */
 
   sprintf(typestring, "%u", p->type);
 
-  cn_value[0]   = p->info;
+  cn_value[0]   = p->name;
   cn_value[1]   = NULL;
-  info[0]       = p->info;
+  info[0]       = p->info ? p->info : "Unknown";
   info[1]       = NULL;
-  location[0]   = p->location;
+  location[0]   = p->location ? p->location : "Unknown";
   location[1]   = NULL;
-  make_model[0] = p->make_model;
+  make_model[0] = p->make_model ? p->make_model : "Unknown";
   make_model[1] = NULL;
   type[0]       = typestring;
   type[1]       = NULL;
@@ -2674,7 +2693,7 @@ send_ldap_browse(cupsd_printer_t *p)      /* I - Printer to register */
   uri[1]        = NULL;
 
   snprintf(filter, sizeof(filter),
-           "(&(objectclass=cupsPrinter)(printerDescription~=%s))", p->info);
+           "(&(objectclass=cupsPrinter)(printerURI=%s))", p->uri);
 
   ldap_search_s(BrowseLDAPHandle, BrowseLDAPDN, LDAP_SCOPE_SUBTREE,
                 filter, (char **)ldap_attrs, 0, &res);
@@ -2696,7 +2715,7 @@ send_ldap_browse(cupsd_printer_t *p)      /* I - Printer to register */
   mods[6].mod_type = "objectClass";
   mods[6].mod_values = (char **)objectClass_values;
 
-  snprintf(dn, sizeof(dn), "cn=%s,ou=printers,%s", p->info, BrowseLDAPDN);
+  snprintf(dn, sizeof(dn), "cn=%s,ou=printers,%s", p->name, BrowseLDAPDN);
   cupsdLogMessage(CUPSD_LOG_DEBUG2, "send_ldap_browse: dn=\"%s\"", dn);
 
   if (ldap_count_entries(BrowseLDAPHandle, res) > 0)
@@ -2724,7 +2743,7 @@ send_ldap_browse(cupsd_printer_t *p)      /* I - Printer to register */
   else 
   {
    /*
-    * Printer has already been registered, modify the current
+    * Printer has never been registered, add the current
     * registration...
     */
 
@@ -2734,11 +2753,11 @@ send_ldap_browse(cupsd_printer_t *p)    /* I - Printer to register */
     for (i = 0; i < 7; i ++)
     {
       pmods[i]         = mods + i;
-      pmods[i]->mod_op = LDAP_MOD_REPLACE;
+      pmods[i]->mod_op = LDAP_MOD_ADD;
     }
     pmods[i] = NULL;
 
-    if ((rc = ldap_modify_s(BrowseLDAPHandle, dn, pmods)) != LDAP_SUCCESS)
+    if ((rc = ldap_add_s(BrowseLDAPHandle, dn, pmods)) != LDAP_SUCCESS)
       cupsdLogMessage(CUPSD_LOG_ERROR,
                       "LDAP add for %s failed with status %d: %s",
                       p->name, rc, ldap_err2string(rc));
index e97e2541bb2fe26fedece6847205c227d315b08c..d3dd6230dd15d052285932d9d90a61670a30ad90 100644 (file)
@@ -346,6 +346,8 @@ find_filters(mime_t           *mime,        /* I - MIME database */
     * any...)
     */
 
+    tempcost += current->cost;
+
     if (tempcost < mincost)
     {
       cupsArrayDelete(mintemp);
@@ -356,7 +358,7 @@ find_filters(mime_t           *mime,        /* I - MIME database */
       */
 
       mintemp = temp;
-      mincost = tempcost + current->cost;
+      mincost = tempcost;
       cupsArrayInsert(mintemp, current);
     }
     else
index 929654951ad87b9d7ac6b419d0eb598df2a59c2b..2d09ea1bfe56c50b1ab411770bbcd651764f0bdc 100644 (file)
@@ -126,8 +126,7 @@ static void accept_jobs(cupsd_client_t *con, ipp_attribute_t *uri);
 static void    add_class(cupsd_client_t *con, ipp_attribute_t *uri);
 static int     add_file(cupsd_client_t *con, cupsd_job_t *job,
                         mime_type_t *filetype, int compression);
-static cupsd_job_t *add_job(cupsd_client_t *con, ipp_attribute_t *uri,
-                           cupsd_printer_t **dprinter,
+static cupsd_job_t *add_job(cupsd_client_t *con, cupsd_printer_t *printer,
                            mime_type_t *filetype);
 static void    add_job_state_reasons(cupsd_client_t *con, cupsd_job_t *job);
 static void    add_job_subscriptions(cupsd_client_t *con, cupsd_job_t *job);
@@ -700,12 +699,6 @@ accept_jobs(cupsd_client_t  *con,  /* I - Client connection */
 {
   http_status_t        status;                 /* Policy status */
   cups_ptype_t dtype;                  /* Destination type (printer or class) */
-  char         method[HTTP_MAX_URI],   /* Method portion of URI */
-               username[HTTP_MAX_URI], /* Username portion of URI */
-               host[HTTP_MAX_URI],     /* Host portion of URI */
-               resource[HTTP_MAX_URI]; /* Resource portion of URI */
-  int          port;                   /* Port portion of URI */
-  const char   *name;                  /* Printer name */
   cupsd_printer_t *printer;            /* Printer data */
 
 
@@ -716,11 +709,7 @@ accept_jobs(cupsd_client_t  *con,  /* I - Client connection */
   * Is the destination valid?
   */
 
-  httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text, method,
-                  sizeof(method), username, sizeof(username), host,
-                 sizeof(host), &port, resource, sizeof(resource));
-
-  if ((name = cupsdValidateDest(host, resource, &dtype, &printer)) == NULL)
+  if (!cupsdValidateDest(uri->values[0].string.text, &dtype, &printer))
   {
    /*
     * Bad URI...
@@ -751,12 +740,19 @@ accept_jobs(cupsd_client_t  *con, /* I - Client connection */
   cupsdAddPrinterHistory(printer);
 
   if (dtype & CUPS_PRINTER_CLASS)
+  {
     cupsdSaveAllClasses();
+
+    cupsdLogMessage(CUPSD_LOG_INFO, "Class \"%s\" now accepting jobs (\"%s\").",
+                    printer->name, get_username(con));
+  }
   else
+  {
     cupsdSaveAllPrinters();
 
-  cupsdLogMessage(CUPSD_LOG_INFO, "Printer \"%s\" now accepting jobs (\"%s\").", name,
-                  get_username(con));
+    cupsdLogMessage(CUPSD_LOG_INFO, "Printer \"%s\" now accepting jobs (\"%s\").",
+                    printer->name, get_username(con));
+  }
 
  /*
   * Everything was ok, so return OK status...
@@ -784,7 +780,6 @@ add_class(cupsd_client_t  *con,             /* I - Client connection */
   cupsd_printer_t *pclass,             /* Class */
                *member;                /* Member printer/class */
   cups_ptype_t dtype;                  /* Destination type */
-  const char   *dest;                  /* Printer or class name */
   ipp_attribute_t *attr;               /* Printer attribute */
   int          modify;                 /* Non-zero if we just modified */
   char         newname[IPP_MAX_NAME];  /* New class name */
@@ -1003,11 +998,7 @@ add_class(cupsd_client_t  *con,           /* I - Client connection */
       * Search for the printer or class URI...
       */
 
-      httpSeparateURI(HTTP_URI_CODING_ALL, attr->values[i].string.text, method,
-                      sizeof(method), username, sizeof(username), host,
-                     sizeof(host), &port, resource, sizeof(resource));
-
-      if ((dest = cupsdValidateDest(host, resource, &dtype, &member)) == NULL)
+      if (!cupsdValidateDest(attr->values[i].string.text, &dtype, &member))
       {
        /*
        * Bad URI...
@@ -1144,54 +1135,24 @@ add_file(cupsd_client_t *con,           /* I - Connection to client */
 
 static cupsd_job_t *                   /* O - Job object */
 add_job(cupsd_client_t  *con,          /* I - Client connection */
-        ipp_attribute_t *uri,          /* I - printer-uri */
-       cupsd_printer_t **dprinter,     /* I - Destination printer */
+       cupsd_printer_t *printer,       /* I - Destination printer */
        mime_type_t     *filetype)      /* I - First print file type, if any */
 {
   http_status_t        status;                 /* Policy status */
   ipp_attribute_t *attr;               /* Current attribute */
-  const char   *dest;                  /* Destination */
-  cups_ptype_t dtype;                  /* Destination type (printer or class) */
   const char   *val;                   /* Default option value */
   int          priority;               /* Job priority */
   char         *title;                 /* Job name/title */
   cupsd_job_t  *job;                   /* Current job */
-  char         job_uri[HTTP_MAX_URI],  /* Job URI */
-               method[HTTP_MAX_URI],   /* Method portion of URI */
-               username[HTTP_MAX_URI], /* Username portion of URI */
-               host[HTTP_MAX_URI],     /* Host portion of URI */
-               resource[HTTP_MAX_URI]; /* Resource portion of URI */
-  int          port;                   /* Port portion of URI */
-  cupsd_printer_t *printer;            /* Printer data */
+  char         job_uri[HTTP_MAX_URI];  /* Job URI */
   int          kbytes;                 /* Size of print file */
   int          i;                      /* Looping var */
   int          lowerpagerange;         /* Page range bound */
 
 
-  cupsdLogMessage(CUPSD_LOG_DEBUG2, "add_job(%p[%d], %s)", con,
-                  con->http.fd, uri->values[0].string.text);
-
- /*
-  * Is the destination valid?
-  */
-
-  httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text, method,
-                  sizeof(method), username, sizeof(username), host,
-                 sizeof(host), &port, resource, sizeof(resource));
-
-  if ((dest = cupsdValidateDest(host, resource, &dtype, &printer)) == NULL)
-  {
-   /*
-    * Bad URI...
-    */
-
-    send_ipp_status(con, IPP_NOT_FOUND,
-                    _("The printer or class was not found."));
-    return (NULL);
-  }
-
-  if (dprinter)
-    *dprinter = printer;
+  cupsdLogMessage(CUPSD_LOG_DEBUG2, "add_job(%p[%d], %p(%s), %p(%s/%s))",
+                  con, con->http.fd, printer, printer->name,
+                 filetype, filetype->super, filetype->type);
 
  /*
   * Check remote printing to non-shared printer...
@@ -1229,7 +1190,7 @@ add_job(cupsd_client_t  *con,             /* I - Client connection */
   {
     send_ipp_status(con, IPP_NOT_ACCEPTING,
                     _("Destination \"%s\" is not accepting jobs."),
-                    dest);
+                    printer->name);
     return (NULL);
   }
 
@@ -1296,7 +1257,7 @@ add_job(cupsd_client_t  *con,             /* I - Client connection */
   if (MaxJobs && cupsArrayCount(Jobs) >= MaxJobs)
     cupsdCleanJobs();
 
-  if (cupsArrayCount(Jobs) >= MaxJobs && MaxJobs)
+  if (MaxJobs && cupsArrayCount(Jobs) >= MaxJobs)
   {
     send_ipp_status(con, IPP_NOT_POSSIBLE,
                     _("Too many active jobs."));
@@ -1338,11 +1299,13 @@ add_job(cupsd_client_t  *con,           /* I - Client connection */
   if ((job = cupsdAddJob(priority, printer->name)) == NULL)
   {
     send_ipp_status(con, IPP_INTERNAL_ERROR,
-                    _("Unable to add job for destination \"%s\"!"), dest);
+                    _("Unable to add job for destination \"%s\"!"),
+                   printer->name);
     return (NULL);
   }
 
-  job->dtype   = dtype;
+  job->dtype   = printer->type & (CUPS_PRINTER_CLASS | CUPS_PRINTER_IMPLICIT |
+                                  CUPS_PRINTER_REMOTE);
   job->attrs   = con->request;
   con->request = NULL;
 
@@ -2767,11 +2730,10 @@ cancel_all_jobs(cupsd_client_t  *con,   /* I - Client connection */
                ipp_attribute_t *uri)   /* I - Job or Printer URI */
 {
   http_status_t        status;                 /* Policy status */
-  const char   *dest;                  /* Destination */
   cups_ptype_t dtype;                  /* Destination type */
-  char         method[HTTP_MAX_URI],   /* Method portion of URI */
+  char         scheme[HTTP_MAX_URI],   /* Scheme portion of URI */
                userpass[HTTP_MAX_URI], /* Username portion of URI */
-               host[HTTP_MAX_URI],     /* Host portion of URI */
+               hostname[HTTP_MAX_URI], /* Host portion of URI */
                resource[HTTP_MAX_URI]; /* Resource portion of URI */
   int          port;                   /* Port portion of URI */
   ipp_attribute_t *attr;               /* Attribute in request */
@@ -2830,16 +2792,17 @@ cancel_all_jobs(cupsd_client_t  *con,   /* I - Client connection */
   * And if the destination is valid...
   */
 
-  httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text, method,
-                  sizeof(method), userpass, sizeof(userpass), host,
-                 sizeof(host), &port, resource, sizeof(resource));
-
-  if ((dest = cupsdValidateDest(host, resource, &dtype, &printer)) == NULL)
+  if (!cupsdValidateDest(uri->values[0].string.text, &dtype, &printer))
   {
    /*
     * Bad URI?
     */
 
+    httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text,
+                    scheme, sizeof(scheme), userpass, sizeof(userpass),
+                   hostname, sizeof(hostname), &port,
+                   resource, sizeof(resource));
+
     if ((!strncmp(resource, "/printers/", 10) && resource[10]) ||
         (!strncmp(resource, "/classes/", 9) && resource[9]))
     {
@@ -2847,13 +2810,6 @@ cancel_all_jobs(cupsd_client_t  *con,    /* I - Client connection */
                       _("The printer or class was not found."));
       return;
     }
-    else if (strcmp(resource, "/printers/"))
-    {
-      send_ipp_status(con, IPP_NOT_FOUND,
-                      _("The printer-uri \"%s\" is not valid."),
-                     uri->values[0].string.text);
-      return;
-    }
 
    /*
     * Check policy...
@@ -2880,7 +2836,8 @@ cancel_all_jobs(cupsd_client_t  *con,     /* I - Client connection */
     * Check policy...
     */
 
-    if ((status = cupsdCheckPolicy(printer->op_policy_ptr, con, NULL)) != HTTP_OK)
+    if ((status = cupsdCheckPolicy(printer->op_policy_ptr, con,
+                                   NULL)) != HTTP_OK)
     {
       send_http_error(con, status);
       return;
@@ -2890,10 +2847,11 @@ cancel_all_jobs(cupsd_client_t  *con,   /* I - Client connection */
     * Cancel all of the jobs on the named printer...
     */
 
-    cupsdCancelJobs(dest, username, purge);
+    cupsdCancelJobs(printer->name, username, purge);
 
     cupsdLogMessage(CUPSD_LOG_INFO, "All jobs on \"%s\" were %s by \"%s\".",
-                    dest, purge ? "purged" : "cancelled", get_username(con));
+                    printer->name, purge ? "purged" : "cancelled",
+                   get_username(con));
   }
 
   con->response->request.status.status_code = IPP_OK;
@@ -2910,13 +2868,12 @@ cancel_job(cupsd_client_t  *con,        /* I - Client connection */
 {
   ipp_attribute_t *attr;               /* Current attribute */
   int          jobid;                  /* Job ID */
-  char         method[HTTP_MAX_URI],   /* Method portion of URI */
+  char         scheme[HTTP_MAX_URI],   /* Scheme portion of URI */
                username[HTTP_MAX_URI], /* Username portion of URI */
                host[HTTP_MAX_URI],     /* Host portion of URI */
                resource[HTTP_MAX_URI]; /* Resource portion of URI */
   int          port;                   /* Port portion of URI */
   cupsd_job_t  *job;                   /* Job information */
-  const char   *dest;                  /* Destination */
   cups_ptype_t dtype;                  /* Destination type (printer or class) */
   cupsd_printer_t *printer;            /* Printer data */
 
@@ -2948,11 +2905,7 @@ cancel_job(cupsd_client_t  *con, /* I - Client connection */
       * Find the current job on the specified printer...
       */
 
-      httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text, method,
-                      sizeof(method), username, sizeof(username), host,
-                     sizeof(host), &port, resource, sizeof(resource));
-
-      if ((dest = cupsdValidateDest(host, resource, &dtype, &printer)) == NULL)
+      if (!cupsdValidateDest(uri->values[0].string.text, &dtype, &printer))
       {
        /*
        * Bad URI...
@@ -2979,7 +2932,7 @@ cancel_job(cupsd_client_t  *con,  /* I - Client connection */
             job;
             job = (cupsd_job_t *)cupsArrayNext(ActiveJobs))
          if (job->state_value <= IPP_JOB_PROCESSING &&
-             !strcasecmp(job->dest, dest))
+             !strcasecmp(job->dest, printer->name))
            break;
 
        if (job)
@@ -2987,7 +2940,7 @@ cancel_job(cupsd_client_t  *con,  /* I - Client connection */
        else
        {
          send_ipp_status(con, IPP_NOT_POSSIBLE, _("No active jobs on %s!"),
-                         dest);
+                         printer->name);
          return;
        }
       }
@@ -2999,8 +2952,8 @@ cancel_job(cupsd_client_t  *con,  /* I - Client connection */
     * Got a job URI; parse it to get the job ID...
     */
 
-    httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text, method,
-                    sizeof(method), username, sizeof(username), host,
+    httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text, scheme,
+                    sizeof(scheme), username, sizeof(username), host,
                    sizeof(host), &port, resource, sizeof(resource));
  
     if (strncmp(resource, "/jobs/", 6))
@@ -4459,17 +4412,33 @@ static void
 create_job(cupsd_client_t  *con,       /* I - Client connection */
           ipp_attribute_t *uri)        /* I - Printer URI */
 {
-  cupsd_job_t  *job;                   /* New job */
+  cupsd_printer_t      *printer;       /* Printer */
+  cupsd_job_t          *job;           /* New job */
 
 
   cupsdLogMessage(CUPSD_LOG_DEBUG2, "create_job(%p[%d], %s)", con,
                   con->http.fd, uri->values[0].string.text);
 
+ /*
+  * Is the destination valid?
+  */
+
+  if (!cupsdValidateDest(uri->values[0].string.text, NULL, &printer))
+  {
+   /*
+    * Bad URI...
+    */
+
+    send_ipp_status(con, IPP_NOT_FOUND,
+                    _("The printer or class was not found."));
+    return;
+  }
+
  /*
   * Create the job object...
   */
 
-  if ((job = add_job(con, uri, NULL, NULL)) == NULL)
+  if ((job = add_job(con, printer, NULL)) == NULL)
     return;
 
  /*
@@ -4677,8 +4646,8 @@ create_subscription(
   ipp_attribute_t      *attr;          /* Current attribute */
   const char           *dest;          /* Destination */
   cups_ptype_t         dtype;          /* Destination type (printer or class) */
-  char                 method[HTTP_MAX_URI],
-                                       /* Method portion of URI */
+  char                 scheme[HTTP_MAX_URI],
+                                       /* Scheme portion of URI */
                        userpass[HTTP_MAX_URI],
                                        /* Username portion of URI */
                        host[HTTP_MAX_URI],
@@ -4718,8 +4687,8 @@ create_subscription(
                   "cupsdCreateSubscription(con=%p(%d), uri=\"%s\")",
                   con, con->http.fd, uri->values[0].string.text);
 
-  httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text, method,
-                  sizeof(method), userpass, sizeof(userpass), host,
+  httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text, scheme,
+                  sizeof(scheme), userpass, sizeof(userpass), host,
                  sizeof(host), &port, resource, sizeof(resource));
 
   if (!strcmp(resource, "/"))
@@ -4740,7 +4709,8 @@ create_subscription(
     dtype   = CUPS_PRINTER_CLASS;
     printer = NULL;
   }
-  else if ((dest = cupsdValidateDest(host, resource, &dtype, &printer)) == NULL)
+  else if ((dest = cupsdValidateDest(uri->values[0].string.text, &dtype,
+                                     &printer)) == NULL)
   {
    /*
     * Bad URI...
@@ -4757,7 +4727,8 @@ create_subscription(
 
   if (printer)
   {
-    if ((status = cupsdCheckPolicy(printer->op_policy_ptr, con, NULL)) != HTTP_OK)
+    if ((status = cupsdCheckPolicy(printer->op_policy_ptr, con,
+                                   NULL)) != HTTP_OK)
     {
       send_http_error(con, status);
       return;
@@ -4811,10 +4782,54 @@ create_subscription(
     {
       if (!strcmp(attr->name, "notify-recipient") &&
           attr->value_tag == IPP_TAG_URI)
+      {
+       /*
+        * Validate the recipient scheme against the ServerBin/notifier
+       * directory...
+       */
+
+       char    notifier[1024];         /* Notifier filename */
+
+
         recipient = attr->values[0].string.text;
+
+       if (httpSeparateURI(HTTP_URI_CODING_ALL, recipient, scheme,
+                           sizeof(scheme), userpass, sizeof(userpass), host,
+                           sizeof(host), &port, resource, sizeof(resource)))
+        {
+          send_ipp_status(con, IPP_NOT_POSSIBLE,
+                         _("Bad notify-recipient URI \"%s\"!"), recipient);
+         ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_ENUM,
+                       "notify-status-code", IPP_URI_SCHEME);
+         return;
+       }
+
+        snprintf(notifier, sizeof(notifier), "%s/notifier/%s", ServerBin,
+                scheme);
+        if (access(notifier, X_OK))
+       {
+          send_ipp_status(con, IPP_NOT_POSSIBLE,
+                         _("notify-recipient URI \"%s\" uses unknown scheme!"),
+                         recipient);
+         ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_ENUM,
+                       "notify-status-code", IPP_URI_SCHEME);
+         return;
+       }
+      }
       else if (!strcmp(attr->name, "notify-pull-method") &&
                attr->value_tag == IPP_TAG_KEYWORD)
+      {
         pullmethod = attr->values[0].string.text;
+
+        if (strcmp(pullmethod, "ippget"))
+       {
+          send_ipp_status(con, IPP_NOT_POSSIBLE,
+                         _("Bad notify-pull-method \"%s\"!"), pullmethod);
+         ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_ENUM,
+                       "notify-status-code", IPP_ATTRIBUTES);
+         return;
+       }
+      }
       else if (!strcmp(attr->name, "notify-charset") &&
                attr->value_tag == IPP_TAG_CHARSET &&
               strcmp(attr->values[0].string.text, "us-ascii") &&
@@ -4961,13 +4976,7 @@ delete_printer(cupsd_client_t  *con,     /* I - Client connection */
                ipp_attribute_t *uri)   /* I - URI of printer or class */
 {
   http_status_t        status;                 /* Policy status */
-  const char   *dest;                  /* Destination */
   cups_ptype_t dtype;                  /* Destination type (printer or class) */
-  char         method[HTTP_MAX_URI],   /* Method portion of URI */
-               username[HTTP_MAX_URI], /* Username portion of URI */
-               host[HTTP_MAX_URI],     /* Host portion of URI */
-               resource[HTTP_MAX_URI]; /* Resource portion of URI */
-  int          port;                   /* Port portion of URI */
   cupsd_printer_t *printer;            /* Printer/class */
   char         filename[1024];         /* Script/PPD filename */
 
@@ -4979,11 +4988,7 @@ delete_printer(cupsd_client_t  *con,     /* I - Client connection */
   * Do we have a valid URI?
   */
 
-  httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text, method,
-                  sizeof(method), username, sizeof(username), host,
-                 sizeof(host), &port, resource, sizeof(resource));
-
-  if ((dest = cupsdValidateDest(host, resource, &dtype, &printer)) == NULL)
+  if (!cupsdValidateDest(uri->values[0].string.text, &dtype, &printer))
   {
    /*
     * Bad URI...
@@ -5008,7 +5013,7 @@ delete_printer(cupsd_client_t  *con,      /* I - Client connection */
   * Remove old jobs...
   */
 
-  cupsdCancelJobs(dest, NULL, 1);
+  cupsdCancelJobs(printer->name, NULL, 1);
 
  /*
   * Remove old subscriptions and send a "deleted printer" event...
@@ -5017,7 +5022,7 @@ delete_printer(cupsd_client_t  *con,      /* I - Client connection */
   cupsdAddEvent(CUPSD_EVENT_PRINTER_DELETED, printer, NULL,
                 "%s \"%s\" deleted by \"%s\".",
                (dtype & CUPS_PRINTER_CLASS) ? "Class" : "Printer",
-               dest, get_username(con));
+               printer->name, get_username(con));
 
   cupsdExpireSubscriptions(printer, NULL);
  
@@ -5025,24 +5030,26 @@ delete_printer(cupsd_client_t  *con,    /* I - Client connection */
   * Remove any old PPD or script files...
   */
 
-  snprintf(filename, sizeof(filename), "%s/interfaces/%s", ServerRoot, dest);
+  snprintf(filename, sizeof(filename), "%s/interfaces/%s", ServerRoot,
+           printer->name);
   unlink(filename);
 
-  snprintf(filename, sizeof(filename), "%s/ppd/%s.ppd", ServerRoot, dest);
+  snprintf(filename, sizeof(filename), "%s/ppd/%s.ppd", ServerRoot,
+           printer->name);
   unlink(filename);
 
   if (dtype & CUPS_PRINTER_CLASS)
   {
-    cupsdLogMessage(CUPSD_LOG_INFO, "Class \"%s\" deleted by \"%s\".", dest,
-                    get_username(con));
+    cupsdLogMessage(CUPSD_LOG_INFO, "Class \"%s\" deleted by \"%s\".",
+                    printer->name, get_username(con));
 
     cupsdDeletePrinter(printer, 0);
     cupsdSaveAllClasses();
   }
   else
   {
-    cupsdLogMessage(CUPSD_LOG_INFO, "Printer \"%s\" deleted by \"%s\".", dest,
-                    get_username(con));
+    cupsdLogMessage(CUPSD_LOG_INFO, "Printer \"%s\" deleted by \"%s\".",
+                    printer->name, get_username(con));
 
     cupsdDeletePrinter(printer, 0);
     cupsdSaveAllPrinters();
@@ -5285,7 +5292,7 @@ get_jobs(cupsd_client_t  *con,            /* I - Client connection */
   const char   *dest;                  /* Destination */
   cups_ptype_t dtype;                  /* Destination type (printer or class) */
   cups_ptype_t dmask;                  /* Destination type mask */
-  char         method[HTTP_MAX_URI],   /* Method portion of URI */
+  char         scheme[HTTP_MAX_URI],   /* Scheme portion of URI */
                username[HTTP_MAX_URI], /* Username portion of URI */
                host[HTTP_MAX_URI],     /* Host portion of URI */
                resource[HTTP_MAX_URI]; /* Resource portion of URI */
@@ -5307,8 +5314,8 @@ get_jobs(cupsd_client_t  *con,            /* I - Client connection */
   * Is the destination valid?
   */
 
-  httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text, method,
-                  sizeof(method), username, sizeof(username), host,
+  httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text, scheme,
+                  sizeof(scheme), username, sizeof(username), host,
                  sizeof(host), &port, resource, sizeof(resource));
 
   if (!strcmp(resource, "/") ||
@@ -5333,7 +5340,8 @@ get_jobs(cupsd_client_t  *con,            /* I - Client connection */
     dmask   = CUPS_PRINTER_CLASS;
     printer = NULL;
   }
-  else if ((dest = cupsdValidateDest(host, resource, &dtype, &printer)) == NULL)
+  else if ((dest = cupsdValidateDest(uri->values[0].string.text, &dtype,
+                                     &printer)) == NULL)
   {
    /*
     * Bad URI...
@@ -5352,7 +5360,8 @@ get_jobs(cupsd_client_t  *con,            /* I - Client connection */
 
   if (printer)
   {
-    if ((status = cupsdCheckPolicy(printer->op_policy_ptr, con, NULL)) != HTTP_OK)
+    if ((status = cupsdCheckPolicy(printer->op_policy_ptr, con,
+                                   NULL)) != HTTP_OK)
     {
       send_http_error(con, status);
       return;
@@ -5688,17 +5697,7 @@ get_printer_attrs(cupsd_client_t  *con,  /* I - Client connection */
                  ipp_attribute_t *uri) /* I - Printer URI */
 {
   http_status_t                status;         /* Policy status */
-  const char           *dest;          /* Destination */
   cups_ptype_t         dtype;          /* Destination type (printer or class) */
-  char                 method[HTTP_MAX_URI],
-                                       /* Method portion of URI */
-                       username[HTTP_MAX_URI],
-                                       /* Username portion of URI */
-                       host[HTTP_MAX_URI],
-                                       /* Host portion of URI */
-                       resource[HTTP_MAX_URI];
-                                       /* Resource portion of URI */
-  int                  port;           /* Port portion of URI */
   cupsd_printer_t      *printer;       /* Printer/class */
   cups_array_t         *ra;            /* Requested attributes array */
 
@@ -5710,11 +5709,7 @@ get_printer_attrs(cupsd_client_t  *con,  /* I - Client connection */
   * Is the destination valid?
   */
 
-  httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text, method,
-                  sizeof(method), username, sizeof(username), host,
-                 sizeof(host), &port, resource, sizeof(resource));
-
-  if ((dest = cupsdValidateDest(host, resource, &dtype, &printer)) == NULL)
+  if (!cupsdValidateDest(uri->values[0].string.text, &dtype, &printer))
   {
    /*
     * Bad URI...
@@ -5977,8 +5972,8 @@ get_subscriptions(cupsd_client_t  *con,   /* I - Client connection */
   cups_array_t         *ra;            /* Requested attributes array */
   ipp_attribute_t      *attr;          /* Attribute */
   cups_ptype_t         dtype;          /* Destination type (printer or class) */
-  char                 method[HTTP_MAX_URI],
-                                       /* Method portion of URI */
+  char                 scheme[HTTP_MAX_URI],
+                                       /* Scheme portion of URI */
                        username[HTTP_MAX_URI],
                                        /* Username portion of URI */
                        host[HTTP_MAX_URI],
@@ -5998,8 +5993,8 @@ get_subscriptions(cupsd_client_t  *con,   /* I - Client connection */
   * Is the destination valid?
   */
 
-  httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text, method,
-                  sizeof(method), username, sizeof(username), host,
+  httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text, scheme,
+                  sizeof(scheme), username, sizeof(username), host,
                  sizeof(host), &port, resource, sizeof(resource));
 
   if (!strcmp(resource, "/") ||
@@ -6022,7 +6017,7 @@ get_subscriptions(cupsd_client_t  *con,   /* I - Client connection */
       return;
     }
   }
-  else if (!cupsdValidateDest(host, resource, &dtype, &printer))
+  else if (!cupsdValidateDest(uri->values[0].string.text, &dtype, &printer))
   {
    /*
     * Bad URI...
@@ -6281,7 +6276,7 @@ move_job(cupsd_client_t  *con,            /* I - Client connection */
                *dest;                  /* Destination */
   cups_ptype_t stype,                  /* Source type (printer or class) */
                dtype;                  /* Destination type (printer or class) */
-  char         method[HTTP_MAX_URI],   /* Method portion of URI */
+  char         scheme[HTTP_MAX_URI],   /* Scheme portion of URI */
                username[HTTP_MAX_URI], /* Username portion of URI */
                host[HTTP_MAX_URI],     /* Host portion of URI */
                resource[HTTP_MAX_URI]; /* Resource portion of URI */
@@ -6309,11 +6304,8 @@ move_job(cupsd_client_t  *con,           /* I - Client connection */
     return;
   }
     
-  httpSeparateURI(HTTP_URI_CODING_ALL, attr->values[0].string.text, method,
-                  sizeof(method), username, sizeof(username), host,
-                 sizeof(host), &port, resource, sizeof(resource));
-
-  if ((dest = cupsdValidateDest(host, resource, &dtype, &dprinter)) == NULL)
+  if ((dest = cupsdValidateDest(attr->values[0].string.text, &dtype,
+                                &dprinter)) == NULL)
   {
    /*
     * Bad URI...
@@ -6328,7 +6320,8 @@ move_job(cupsd_client_t  *con,            /* I - Client connection */
   * Check policy...
   */
 
-  if ((status = cupsdCheckPolicy(dprinter->op_policy_ptr, con, NULL)) != HTTP_OK)
+  if ((status = cupsdCheckPolicy(dprinter->op_policy_ptr, con,
+                                 NULL)) != HTTP_OK)
   {
     send_http_error(con, status);
     return;
@@ -6338,8 +6331,8 @@ move_job(cupsd_client_t  *con,            /* I - Client connection */
   * See if we have a job URI or a printer URI...
   */
 
-  httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text, method,
-                  sizeof(method), username, sizeof(username), host,
+  httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text, scheme,
+                  sizeof(scheme), username, sizeof(username), host,
                  sizeof(host), &port, resource, sizeof(resource));
 
   if (!strcmp(uri->name, "printer-uri"))
@@ -6355,7 +6348,8 @@ move_job(cupsd_client_t  *con,            /* I - Client connection */
       * Move all jobs...
       */
 
-      if ((src = cupsdValidateDest(host, resource, &stype, &sprinter)) == NULL)
+      if ((src = cupsdValidateDest(uri->values[0].string.text, &stype,
+                                   &sprinter)) == NULL)
       {
        /*
        * Bad URI...
@@ -6653,6 +6647,7 @@ print_job(cupsd_client_t  *con,           /* I - Client connection */
 {
   ipp_attribute_t *attr;               /* Current attribute */
   ipp_attribute_t *format;             /* Document-format attribute */
+  const char   *default_format;        /* document-format-default value */
   cupsd_job_t  *job;                   /* New job */
   char         filename[1024];         /* Job filename */
   mime_type_t  *filetype;              /* Type of file */
@@ -6709,6 +6704,21 @@ print_job(cupsd_client_t  *con,          /* I - Client connection */
     return;
   }
 
+ /*
+  * Is the destination valid?
+  */
+
+  if (!cupsdValidateDest(uri->values[0].string.text, NULL, &printer))
+  {
+   /*
+    * Bad URI...
+    */
+
+    send_ipp_status(con, IPP_NOT_FOUND,
+                    _("The printer or class was not found."));
+    return;
+  }
+
  /*
   * Is it a format we support?
   */
@@ -6720,7 +6730,8 @@ print_job(cupsd_client_t  *con,           /* I - Client connection */
     * Grab format from client...
     */
 
-    if (sscanf(format->values[0].string.text, "%15[^/]/%31[^;]", super, type) != 2)
+    if (sscanf(format->values[0].string.text, "%15[^/]/%31[^;]", super,
+               type) != 2)
     {
       send_ipp_status(con, IPP_BAD_REQUEST,
                       _("Could not scan type \"%s\"!"),
@@ -6728,10 +6739,26 @@ print_job(cupsd_client_t  *con,         /* I - Client connection */
       return;
     }
   }
+  else if ((default_format = cupsGetOption("document-format",
+                                           printer->num_options,
+                                          printer->options)) != NULL)
+  {
+   /*
+    * Use default document format...
+    */
+
+    if (sscanf(default_format, "%15[^/]/%31[^;]", super, type) != 2)
+    {
+      send_ipp_status(con, IPP_BAD_REQUEST,
+                      _("Could not scan type \"%s\"!"),
+                     default_format);
+      return;
+    }
+  }
   else
   {
    /*
-    * No document format attribute?  Auto-type it!
+    * Auto-type it!
     */
 
     strcpy(super, "application");
@@ -6754,32 +6781,35 @@ print_job(cupsd_client_t  *con,         /* I - Client connection */
                             doc_name ? doc_name->values[0].string.text : NULL,
                            &compression);
 
-    if (filetype)
-    {
-     /*
-      * Replace the document-format attribute value with the auto-typed one.
-      */
+    if (!filetype)
+      filetype = mimeType(MimeDatabase, super, type);
+  }
+  else
+    filetype = mimeType(MimeDatabase, super, type);
 
-      snprintf(mimetype, sizeof(mimetype), "%s/%s", filetype->super,
-               filetype->type);
+  if (filetype &&
+      (!format ||
+       (!strcmp(super, "application") && !strcmp(type, "octet-stream"))))
+  {
+   /*
+    * Replace the document-format attribute value with the auto-typed or
+    * default one.
+    */
 
-      if (format)
-      {
-         _cupsStrFree(format->values[0].string.text);
+    snprintf(mimetype, sizeof(mimetype), "%s/%s", filetype->super,
+             filetype->type);
 
-       format->values[0].string.text = _cupsStrAlloc(mimetype);
-      }
-      else
-        ippAddString(con->request, IPP_TAG_JOB, IPP_TAG_MIMETYPE,
-                    "document-format", NULL, mimetype);
+    if (format)
+    {
+      _cupsStrFree(format->values[0].string.text);
+
+      format->values[0].string.text = _cupsStrAlloc(mimetype);
     }
     else
-      filetype = mimeType(MimeDatabase, super, type);
+      ippAddString(con->request, IPP_TAG_JOB, IPP_TAG_MIMETYPE,
+                  "document-format", NULL, mimetype);
   }
-  else
-    filetype = mimeType(MimeDatabase, super, type);
-
-  if (!filetype)
+  else if (!filetype)
   {
     send_ipp_status(con, IPP_DOCUMENT_FORMAT,
                     _("Unsupported format \'%s/%s\'!"), super, type);
@@ -6808,7 +6838,7 @@ print_job(cupsd_client_t  *con,           /* I - Client connection */
   * Create the job object...
   */
 
-  if ((job = add_job(con, uri, &printer, filetype)) == NULL)
+  if ((job = add_job(con, printer, filetype)) == NULL)
     return;
 
  /*
@@ -7073,12 +7103,6 @@ reject_jobs(cupsd_client_t  *con,        /* I - Client connection */
 {
   http_status_t        status;                 /* Policy status */
   cups_ptype_t dtype;                  /* Destination type (printer or class) */
-  char         method[HTTP_MAX_URI],   /* Method portion of URI */
-               username[HTTP_MAX_URI], /* Username portion of URI */
-               host[HTTP_MAX_URI],     /* Host portion of URI */
-               resource[HTTP_MAX_URI]; /* Resource portion of URI */
-  int          port;                   /* Port portion of URI */
-  const char   *name;                  /* Printer name */
   cupsd_printer_t *printer;            /* Printer data */
   ipp_attribute_t *attr;               /* printer-state-message text */
 
@@ -7090,11 +7114,7 @@ reject_jobs(cupsd_client_t  *con,        /* I - Client connection */
   * Is the destination valid?
   */
 
-  httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text, method,
-                  sizeof(method), username, sizeof(username), host,
-                 sizeof(host), &port, resource, sizeof(resource));
-
-  if ((name = cupsdValidateDest(host, resource, &dtype, &printer)) == NULL)
+  if (!cupsdValidateDest(uri->values[0].string.text, &dtype, &printer))
   {
    /*
     * Bad URI...
@@ -7135,14 +7155,14 @@ reject_jobs(cupsd_client_t  *con,       /* I - Client connection */
     cupsdSaveAllClasses();
 
     cupsdLogMessage(CUPSD_LOG_INFO, "Class \"%s\" rejecting jobs (\"%s\").",
-                    name, get_username(con));
+                    printer->name, get_username(con));
   }
   else
   {
     cupsdSaveAllPrinters();
 
     cupsdLogMessage(CUPSD_LOG_INFO, "Printer \"%s\" rejecting jobs (\"%s\").",
-                    name, get_username(con));
+                    printer->name, get_username(con));
   }
 
  /*
@@ -7598,6 +7618,7 @@ send_document(cupsd_client_t  *con,       /* I - Client connection */
 {
   ipp_attribute_t      *attr;          /* Current attribute */
   ipp_attribute_t      *format;        /* Document-format attribute */
+  const char           *default_format;/* document-format-default value */
   int                  jobid;          /* Job ID number */
   cupsd_job_t          *job;           /* Current job */
   char                 job_uri[HTTP_MAX_URI],
@@ -7756,6 +7777,22 @@ send_document(cupsd_client_t  *con,      /* I - Client connection */
       return;
     }
   }
+  else if ((default_format = cupsGetOption("document-format",
+                                           printer->num_options,
+                                          printer->options)) != NULL)
+  {
+   /*
+    * Use default document format...
+    */
+
+    if (sscanf(default_format, "%15[^/]/%31[^;]", super, type) != 2)
+    {
+      send_ipp_status(con, IPP_BAD_REQUEST,
+                      _("Could not scan type \"%s\"!"),
+                     default_format);
+      return;
+    }
+  }
   else
   {
    /*
@@ -7782,31 +7819,35 @@ send_document(cupsd_client_t  *con,     /* I - Client connection */
                             doc_name ? doc_name->values[0].string.text : NULL,
                            &compression);
 
-    if (filetype)
-    {
-     /*
-      * Replace the document-format attribute value with the auto-typed one.
-      */
-
-      snprintf(mimetype, sizeof(mimetype), "%s/%s", filetype->super,
-               filetype->type);
-
-      if (format)
-      {
-       _cupsStrFree(format->values[0].string.text);
-       format->values[0].string.text = _cupsStrAlloc(mimetype);
-      }
-      else
-        ippAddString(con->request, IPP_TAG_JOB, IPP_TAG_MIMETYPE,
-                    "document-format", NULL, mimetype);
-    }
-    else
+    if (!filetype)
       filetype = mimeType(MimeDatabase, super, type);
   }
   else
     filetype = mimeType(MimeDatabase, super, type);
 
-  if (!filetype)
+  if (filetype &&
+      (!format ||
+       (!strcmp(super, "application") && !strcmp(type, "octet-stream"))))
+  {
+   /*
+    * Replace the document-format attribute value with the auto-typed or
+    * default one.
+    */
+
+    snprintf(mimetype, sizeof(mimetype), "%s/%s", filetype->super,
+             filetype->type);
+
+    if (format)
+    {
+      _cupsStrFree(format->values[0].string.text);
+
+      format->values[0].string.text = _cupsStrAlloc(mimetype);
+    }
+    else
+      ippAddString(con->request, IPP_TAG_JOB, IPP_TAG_MIMETYPE,
+                  "document-format", NULL, mimetype);
+  }
+  else if (!filetype)
   {
     send_ipp_status(con, IPP_DOCUMENT_FORMAT,
                     _("Unsupported format \'%s/%s\'!"), super, type);
@@ -8046,16 +8087,6 @@ set_default(cupsd_client_t  *con,        /* I - Client connection */
 {
   http_status_t                status;         /* Policy status */
   cups_ptype_t         dtype;          /* Destination type (printer or class) */
-  char                 method[HTTP_MAX_URI],
-                                       /* Method portion of URI */
-                       username[HTTP_MAX_URI],
-                                       /* Username portion of URI */
-                       host[HTTP_MAX_URI],
-                                       /* Host portion of URI */
-                       resource[HTTP_MAX_URI];
-                                       /* Resource portion of URI */
-  int                  port;           /* Port portion of URI */
-  const char           *name;          /* Printer name */
   cupsd_printer_t      *printer;       /* Printer */
 
 
@@ -8066,11 +8097,7 @@ set_default(cupsd_client_t  *con,        /* I - Client connection */
   * Is the destination valid?
   */
 
-  httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text, method,
-                  sizeof(method), username, sizeof(username), host,
-                 sizeof(host), &port, resource, sizeof(resource));
-
-  if ((name = cupsdValidateDest(host, resource, &dtype, &printer)) == NULL)
+  if (!cupsdValidateDest(uri->values[0].string.text, &dtype, &printer))
   {
    /*
     * Bad URI...
@@ -8103,8 +8130,8 @@ set_default(cupsd_client_t  *con, /* I - Client connection */
   cupsdWritePrintcap();
 
   cupsdLogMessage(CUPSD_LOG_INFO,
-                  "Default destination set to \"%s\" by \"%s\".", name,
-                  get_username(con));
+                  "Default destination set to \"%s\" by \"%s\".",
+                 printer->name, get_username(con));
 
  /*
   * Everything was ok, so return OK status...
@@ -8606,8 +8633,7 @@ set_printer_defaults(
                       attr->values[0].string.text);
       cupsdSetString(&printer->error_policy, attr->values[0].string.text);
     }
-    else if (!strcmp(attr->name, "document-format-default") ||
-             !strcmp(attr->name, "notify-lease-duration-default") ||
+    else if (!strcmp(attr->name, "notify-lease-duration-default") ||
              !strcmp(attr->name, "notify-events-default"))
       continue;
 
@@ -8710,16 +8736,6 @@ start_printer(cupsd_client_t  *con,      /* I - Client connection */
 {
   http_status_t                status;         /* Policy status */
   cups_ptype_t         dtype;          /* Destination type (printer or class) */
-  char                 method[HTTP_MAX_URI],
-                                       /* Method portion of URI */
-                       username[HTTP_MAX_URI],
-                                       /* Username portion of URI */
-                       host[HTTP_MAX_URI],
-                                       /* Host portion of URI */
-                       resource[HTTP_MAX_URI];
-                                       /* Resource portion of URI */
-  int                  port;           /* Port portion of URI */
-  const char           *name;          /* Printer name */
   cupsd_printer_t      *printer;       /* Printer data */
 
 
@@ -8730,11 +8746,7 @@ start_printer(cupsd_client_t  *con,      /* I - Client connection */
   * Is the destination valid?
   */
 
-  httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text, method,
-                  sizeof(method), username, sizeof(username), host,
-                 sizeof(host), &port, resource, sizeof(resource));
-
-  if ((name = cupsdValidateDest(host, resource, &dtype, &printer)) == NULL)
+  if (!cupsdValidateDest(uri->values[0].string.text, &dtype, &printer))
   {
    /*
     * Bad URI...
@@ -8765,17 +8777,19 @@ start_printer(cupsd_client_t  *con,     /* I - Client connection */
 
   if (dtype & CUPS_PRINTER_CLASS)
   {
-    cupsdLogMessage(CUPSD_LOG_INFO, "Class \"%s\" started by \"%s\".", name,
-                    get_username(con));
+    cupsdLogMessage(CUPSD_LOG_INFO, "Class \"%s\" started by \"%s\".",
+                    printer->name, get_username(con));
     cupsdAddEvent(CUPSD_EVENT_PRINTER_MODIFIED, printer, NULL,
-                  "Class \"%s\" started by \"%s\".", name, get_username(con));
+                  "Class \"%s\" started by \"%s\".", printer->name,
+                 get_username(con));
   }
   else
   {
-    cupsdLogMessage(CUPSD_LOG_INFO, "Printer \"%s\" started by \"%s\".", name,
-                    get_username(con));
+    cupsdLogMessage(CUPSD_LOG_INFO, "Printer \"%s\" started by \"%s\".",
+                    printer->name, get_username(con));
     cupsdAddEvent(CUPSD_EVENT_PRINTER_MODIFIED, printer, NULL,
-                  "Printer \"%s\" started by \"%s\".", name, get_username(con));
+                  "Printer \"%s\" started by \"%s\".", printer->name,
+                 get_username(con));
   }
 
   cupsdCheckJobs();
@@ -8798,16 +8812,6 @@ stop_printer(cupsd_client_t  *con,       /* I - Client connection */
 {
   http_status_t                status;         /* Policy status */
   cups_ptype_t         dtype;          /* Destination type (printer or class) */
-  char                 method[HTTP_MAX_URI],
-                                       /* Method portion of URI */
-                       username[HTTP_MAX_URI],
-                                       /* Username portion of URI */
-                       host[HTTP_MAX_URI],
-                                       /* Host portion of URI */
-                       resource[HTTP_MAX_URI];
-                                       /* Resource portion of URI */
-  int                  port;           /* Port portion of URI */
-  const char           *name;          /* Printer name */
   cupsd_printer_t      *printer;       /* Printer data */
   ipp_attribute_t      *attr;          /* printer-state-message attribute */
 
@@ -8819,11 +8823,7 @@ stop_printer(cupsd_client_t  *con,       /* I - Client connection */
   * Is the destination valid?
   */
 
-  httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text, method,
-                  sizeof(method), username, sizeof(username), host,
-                 sizeof(host), &port, resource, sizeof(resource));
-
-  if ((name = cupsdValidateDest(host, resource, &dtype, &printer)) == NULL)
+  if (!cupsdValidateDest(uri->values[0].string.text, &dtype, &printer))
   {
    /*
     * Bad URI...
@@ -8861,17 +8861,19 @@ stop_printer(cupsd_client_t  *con,      /* I - Client connection */
 
   if (dtype & CUPS_PRINTER_CLASS)
   {
-    cupsdLogMessage(CUPSD_LOG_INFO, "Class \"%s\" stopped by \"%s\".", name,
-                    get_username(con));
+    cupsdLogMessage(CUPSD_LOG_INFO, "Class \"%s\" stopped by \"%s\".",
+                    printer->name, get_username(con));
     cupsdAddEvent(CUPSD_EVENT_PRINTER_MODIFIED, printer, NULL,
-                  "Class \"%s\" stopped by \"%s\".", name, get_username(con));
+                  "Class \"%s\" stopped by \"%s\".", printer->name,
+                 get_username(con));
   }
   else
   {
-    cupsdLogMessage(CUPSD_LOG_INFO, "Printer \"%s\" stopped by \"%s\".", name,
-                    get_username(con));
+    cupsdLogMessage(CUPSD_LOG_INFO, "Printer \"%s\" stopped by \"%s\".",
+                    printer->name, get_username(con));
     cupsdAddEvent(CUPSD_EVENT_PRINTER_MODIFIED, printer, NULL,
-                  "Printer \"%s\" stopped by \"%s\".", name, get_username(con));
+                  "Printer \"%s\" stopped by \"%s\".", printer->name,
+                 get_username(con));
   }
 
  /*
@@ -8998,15 +9000,6 @@ validate_job(cupsd_client_t  *con,       /* I - Client connection */
   ipp_attribute_t      *attr;          /* Current attribute */
   ipp_attribute_t      *format;        /* Document-format attribute */
   cups_ptype_t         dtype;          /* Destination type (printer or class) */
-  char                 method[HTTP_MAX_URI],
-                                       /* Method portion of URI */
-                       username[HTTP_MAX_URI],
-                                       /* Username portion of URI */
-                       host[HTTP_MAX_URI],
-                                       /* Host portion of URI */
-                       resource[HTTP_MAX_URI];
-                                       /* Resource portion of URI */
-  int                  port;           /* Port portion of URI */
   char                 super[MIME_MAX_SUPER],
                                        /* Supertype of file */
                        type[MIME_MAX_TYPE];
@@ -9066,11 +9059,7 @@ validate_job(cupsd_client_t  *con,       /* I - Client connection */
   * Is the destination valid?
   */
 
-  httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text, method,
-                  sizeof(method), username, sizeof(username), host,
-                 sizeof(host), &port, resource, sizeof(resource));
-
-  if (cupsdValidateDest(host, resource, &dtype, &printer) == NULL)
+  if (!cupsdValidateDest(uri->values[0].string.text, &dtype, &printer))
   {
    /*
     * Bad URI...
index 9c04db1619548c4ffa0491325f9565e4b360812d..1029051190264f018e368d6e2e33417928a5a507 100644 (file)
@@ -506,8 +506,19 @@ cupsdFinishJob(cupsd_job_t *job)   /* I - Job */
          */
 
          cupsdStopJob(job, 0);
-         job->state->values[0].integer = IPP_JOB_PENDING;
-         job->state_value              = IPP_JOB_PENDING;
+
+          if (!(printer->type & CUPS_PRINTER_REMOTE) ||
+             (printer->type & CUPS_PRINTER_IMPLICIT))
+         {
+          /*
+           * Mark the job as pending again - we'll retry on another
+           * printer...
+           */
+
+           job->state->values[0].integer = IPP_JOB_PENDING;
+           job->state_value              = IPP_JOB_PENDING;
+          }
+
          cupsdSaveJob(job);
 
         /*
@@ -865,13 +876,6 @@ cupsdLoadJob(cupsd_job_t *job)             /* I - Job */
   cups_file_t          *fp;            /* Job file */
   int                  fileid;         /* Current file ID */
   ipp_attribute_t      *attr;          /* Job attribute */
-  char                 scheme[32],     /* Scheme portion of URI */
-                       username[64],   /* Username portion of URI */
-                       host[HTTP_MAX_HOST],
-                                       /* Host portion of URI */
-                       resource[HTTP_MAX_URI];
-                                       /* Resource portion of URI */
-  int                  port;           /* Port portion of URI */
   const char           *dest;          /* Destination */
   mime_type_t          **filetypes;    /* New filetypes array */
   int                  *compressions;  /* New compressions array */
@@ -955,11 +959,7 @@ cupsdLoadJob(cupsd_job_t *job)             /* I - Job */
       return;
     }
 
-    httpSeparateURI(HTTP_URI_CODING_ALL, attr->values[0].string.text, scheme,
-                    sizeof(scheme), username, sizeof(username), host,
-                   sizeof(host), &port, resource, sizeof(resource));
-
-    if ((dest = cupsdValidateDest(host, resource, &(job->dtype),
+    if ((dest = cupsdValidateDest(attr->values[0].string.text, &(job->dtype),
                                   NULL)) == NULL)
     {
       cupsdLogMessage(CUPSD_LOG_ERROR,
@@ -3090,28 +3090,6 @@ start_job(cupsd_job_t     *job,          /* I - Job ID */
   job->status = 0;
   memset(job->filters, 0, sizeof(job->filters));
 
-  filterfds[1][0] = open("/dev/null", O_RDONLY);
-
-  if (filterfds[1][0] < 0)
-  {
-    cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to open \"/dev/null\" - %s.",
-                    strerror(errno));
-    snprintf(printer->state_message, sizeof(printer->state_message),
-             "Unable to open \"/dev/null\" - %s.", strerror(errno));
-
-    cupsdAddPrinterHistory(printer);
-
-    cupsdAddEvent(CUPSD_EVENT_JOB_COMPLETED, job->printer, job,
-                  "Job canceled because the server could not open /dev/null.");
-
-    goto abort_job;
-  }
-
-  fcntl(filterfds[1][0], F_SETFD, fcntl(filterfds[1][0], F_GETFD) | FD_CLOEXEC);
-
-  cupsdLogMessage(CUPSD_LOG_DEBUG2, "start_job: filterfds[%d] = [ %d %d ]",
-                  1, filterfds[1][0], filterfds[1][1]);
-
   for (i = 0, slot = 0, filter = (mime_filter_t *)cupsArrayFirst(filters);
        filter;
        i ++, filter = (mime_filter_t *)cupsArrayNext(filters))
@@ -3165,36 +3143,43 @@ start_job(cupsd_job_t     *job,         /* I - Job ID */
        else
        {
          job->print_pipes[0] = -1;
-         if (!strncmp(printer->device_uri, "file:/dev/", 10) &&
-             strcmp(printer->device_uri, "file:/dev/null"))
-           job->print_pipes[1] = open(printer->device_uri + 5,
-                                      O_WRONLY | O_EXCL);
-         else if (!strncmp(printer->device_uri, "file:///dev/", 12) &&
-                  strcmp(printer->device_uri, "file:///dev/null"))
-           job->print_pipes[1] = open(printer->device_uri + 7,
-                                      O_WRONLY | O_EXCL);
+         if (!strcmp(printer->device_uri, "file:/dev/null") ||
+             !strcmp(printer->device_uri, "file:///dev/null"))
+           job->print_pipes[1] = -1;
          else
-           job->print_pipes[1] = open(printer->device_uri + 5,
-                                      O_WRONLY | O_CREAT | O_TRUNC, 0600);
-
-         if (job->print_pipes[1] < 0)
          {
-            cupsdLogMessage(CUPSD_LOG_ERROR,
-                           "Unable to open output file \"%s\" - %s.",
-                           printer->device_uri, strerror(errno));
-            snprintf(printer->state_message, sizeof(printer->state_message),
-                    "Unable to open output file \"%s\" - %s.",
-                    printer->device_uri, strerror(errno));
-
-           cupsdAddEvent(CUPSD_EVENT_JOB_COMPLETED, job->printer, job,
-                         "Job canceled because the server could not open the "
-                         "output file.");
+           if (!strncmp(printer->device_uri, "file:/dev/", 10))
+             job->print_pipes[1] = open(printer->device_uri + 5,
+                                        O_WRONLY | O_EXCL);
+           else if (!strncmp(printer->device_uri, "file:///dev/", 12))
+             job->print_pipes[1] = open(printer->device_uri + 7,
+                                        O_WRONLY | O_EXCL);
+           else if (!strncmp(printer->device_uri, "file:///", 8))
+             job->print_pipes[1] = open(printer->device_uri + 7,
+                                        O_WRONLY | O_CREAT | O_TRUNC, 0600);
+           else
+             job->print_pipes[1] = open(printer->device_uri + 5,
+                                        O_WRONLY | O_CREAT | O_TRUNC, 0600);
 
-            goto abort_job;
-         }
+           if (job->print_pipes[1] < 0)
+           {
+              cupsdLogMessage(CUPSD_LOG_ERROR,
+                             "Unable to open output file \"%s\" - %s.",
+                             printer->device_uri, strerror(errno));
+              snprintf(printer->state_message, sizeof(printer->state_message),
+                      "Unable to open output file \"%s\" - %s.",
+                      printer->device_uri, strerror(errno));
+
+             cupsdAddEvent(CUPSD_EVENT_JOB_COMPLETED, job->printer, job,
+                           "Job canceled because the server could not open the "
+                           "output file.");
+
+              goto abort_job;
+           }
 
-         fcntl(job->print_pipes[1], F_SETFD,
-               fcntl(job->print_pipes[1], F_GETFD) | FD_CLOEXEC);
+           fcntl(job->print_pipes[1], F_SETFD,
+                 fcntl(job->print_pipes[1], F_GETFD) | FD_CLOEXEC);
+          }
        }
 
        cupsdLogMessage(CUPSD_LOG_DEBUG2,
@@ -3274,25 +3259,7 @@ start_job(cupsd_job_t     *job,          /* I - Job ID */
       argv[0] = sani_uri;
 
       filterfds[slot][0] = -1;
-      filterfds[slot][1] = open("/dev/null", O_WRONLY);
-
-      if (filterfds[slot][1] < 0)
-      {
-       cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to open \"/dev/null\" - %s.",
-                       strerror(errno));
-       snprintf(printer->state_message, sizeof(printer->state_message),
-                "Unable to open \"/dev/null\" - %s.", strerror(errno));
-
-       cupsdAddPrinterHistory(printer);
-
-       cupsdAddEvent(CUPSD_EVENT_JOB_COMPLETED, job->printer, job,
-                      "Job canceled because the server could not open a file.");
-
-        goto abort_job;
-      }
-
-      fcntl(filterfds[slot][1], F_SETFD,
-            fcntl(filterfds[slot][1], F_GETFD) | FD_CLOEXEC);
+      filterfds[slot][1] = -1;
 
       cupsdLogMessage(CUPSD_LOG_DEBUG2, "start_job: backend=\"%s\"",
                       command);
index 0aa3d92e1aad5fb87e6bd84bbb74b7360e8c33a4..da82e4390c33e96046f88578358394dc3faf719b 100644 (file)
@@ -51,6 +51,7 @@
 #include <stdlib.h>
 #include <ctype.h>
 
+#include <cups/debug.h>
 #include <cups/dir.h>
 #include <cups/string.h>
 #include "mime.h"
@@ -486,6 +487,8 @@ load_convs(mime_t       *mime,              /* I - MIME database */
   if ((fp = cupsFileOpen(filename, "r")) == NULL)
     return;
 
+  DEBUG_printf(("\"%s\":\n", filename));
+
  /*
   * Then read each line from the file, skipping any comments in the file...
   */
@@ -496,6 +499,8 @@ load_convs(mime_t       *mime,              /* I - MIME database */
     * Skip blank lines and lines starting with a #...
     */
 
+    DEBUG_puts(line);
+
     if (!line[0] || line[0] == '#')
       continue;
 
@@ -544,7 +549,10 @@ load_convs(mime_t       *mime,             /* I - MIME database */
       continue;
 
     if ((dsttype = mimeType(mime, super, type)) == NULL)
+    {
+      DEBUG_printf(("    Destination type %s/%s not found!\n", super, type));
       continue;
+    }
 
    /*
     * Then get the cost and filter program...
@@ -575,7 +583,10 @@ load_convs(mime_t       *mime,             /* I - MIME database */
       */
 
       if (!add_fcache(filtercache, filter, filterpath))
+      {
+        DEBUG_printf(("    Filter %s not found in %s!\n", filter, filterpath)); 
         continue;
+      }
     }
 
    /*
@@ -655,6 +666,8 @@ load_types(mime_t     *mime,                /* I - MIME database */
   if ((fp = cupsFileOpen(filename, "r")) == NULL)
     return;
 
+  DEBUG_printf(("\"%s\":\n", filename));
+
  /*
   * Then read each line from the file, skipping any comments in the file...
   */
@@ -665,6 +678,8 @@ load_types(mime_t     *mime,                /* I - MIME database */
     * Skip blank lines and lines starting with a #...
     */
 
+    DEBUG_puts(line);
+
     if (!line[0] || line[0] == '#')
       continue;
 
diff --git a/scheduler/newselect.txt b/scheduler/newselect.txt
new file mode 100644 (file)
index 0000000..5cb9ab4
--- /dev/null
@@ -0,0 +1,115 @@
+Design Notes for New Poll/Select API in CUPSD - 2006-06-06
+----------------------------------------------------------
+
+SUPPORTED APIS
+
+    OS              select  poll    epoll   kqueue  /dev/poll
+    --------------  ------  ------  ------  ------  ---------
+    AIX             YES     YES     NO      NO      NO
+    FreeBSD         YES     YES     NO      YES     NO
+    HP-UX           YES     YES     NO      NO      NO
+    IRIX            YES     YES     NO      NO      NO
+    Linux           YES     YES     YES     NO      NO
+    MacOS X         YES     YES     NO      YES     NO
+    NetBSD          YES     YES     NO      YES     NO
+    OpenBSD         YES     YES     NO      YES     NO
+    Solaris         YES     YES     NO      NO      YES
+    Tru64           YES     YES     NO      NO      NO
+    Windows         YES     NO      NO      NO      NO
+
+
+HIGH-LEVEL API
+
+    typedef void (*cupsd_selfunc_t)(void *data);
+
+    void cupsdStartSelect(void);
+    void cupsdStopSelect(void);
+    void cupsdAddSelect(int fd, cupsd_selfunc_t read_cb,
+                        cupsd_selfunc_t write_cb, void *data);
+    void cupsdRemoveSelect(int fd);
+    int cupsdDoSelect(int timeout);
+
+
+IMPLEMENTATION STRATEGY
+
+    0. Common Stuff
+       a. CUPS array of file descriptor to callback functions
+           and data.
+        b. cupsdStartSelect() creates the array
+       c. cupsdStopSelect() destroys the array and all elements.
+       d. cupsdAddSelect() adds to the array and allocates a
+          new callback element.
+       e. cupsdRemoveSelect() removes from the array and frees
+          the callback element.
+
+    1. select()
+       a. Input/Output fd_set variables, copied to working
+          copies and then used with select().
+       b. Loop through CUPS array, using FD_ISSET and calling
+          the read/ write callbacks as needed.
+       c. cupsdRemoveSelect() clears fd_set bit from main and
+          working sets.
+       d. cupsdStopSelect() frees all of the memory used by the
+          CUPS array and fd_set's.
+
+    2. poll()
+       a. Regular array of pollfd, sorted the same as the CUPS
+          array.
+       b. Loop through pollfd array, call the corresponding
+          read/write callbacks as needed.
+       c. cupsdAddSelect() adds first to CUPS array, then uses
+          current index to determine insertion point for pollfd
+          array.
+       d. cupsdRemoveSelect() needs to update cupsdDoSelect()
+          loop counter if <= current index.
+       e. cupsdStopSelect() frees all of the memory used by the
+          CUPS array and pollfd array.
+
+    3. epoll()
+       a. cupsdStartSelect() creates epoll file descriptor using
+          epoll_create() with the maximum fd count, and
+          allocates an events buffer for the maximum fd count.
+       b. cupsdAdd/RemoveSelect() uses epoll_ctl() to add
+          (EPOLL_CTL_ADD) or remove (EPOLL_CTL_DEL) a single
+          event using the level-triggered semantics. The event
+          user data field is a pointer to the new callback array
+          element.
+        c. cupsdDoSelect() uses epoll_wait() with the global event
+          buffer allocated in cupsdStartSelect() and then loops
+          through the events, using the user data field to find
+          the callback record.
+        d. cupsdStopSelect() closes the epoll file descriptor and
+          frees all of the memory used by the event buffer.
+
+    4. kqueue()
+       b. cupsdStartSelect() creates kqueue file descriptor
+          using kqyeue() function and allocates a global event
+          buffer.
+       c. cupsdAdd/RemoveSelect() uses EV_SET and kevent() to
+          register the changes. The event user data field is a
+          pointer to the new callback array element.
+       d. cupsdDoSelect() uses kevent() to poll for events and
+          loops through the events, using the user data field to
+          find the callback record.
+       e. cupsdStopSelect() closes the kqyeye() file descriptor
+          and frees all of the memory used by the event buffer.
+
+    5. /dev/poll
+       a. cupsdStartSelect() opens /dev/poll and allocates an
+          array of pollfd structs; on failure to open /dev/poll,
+          revert to poll() system call.
+       b. cupsdAddSelect() writes a single pollfd struct to
+          /dev/poll with the new file descriptor and the
+          POLLIN/POLLOUT flags.
+       c. cupsdRemoveSelect() writes a single pollfd struct to
+          /dev/poll with the file descriptor and the POLLREMOVE
+          flag.
+       d. cupsdDoSelect() uses the DP_POLL ioctl to retrieve
+          events from /dev/poll and then loops through the
+          returned pollfd array, looking up the file descriptors
+          as needed.
+       e. cupsdStopSelect() closes /dev/poll and frees the
+          pollfd array.
+       f. Need to benchmark to see if it is more efficient than
+          using poll() - this is the only mechanism that is O(n
+          log n), all of the others are O(n)...
index f6d939a41fb264958a9df686e5ac1748544f480e..4c373658c22ccd3bdb779f45e80dac59c4865bd7 100644 (file)
@@ -62,6 +62,7 @@
  */
 
 #include "cupsd.h"
+#include <cups/dir.h>
 
 
 /*
@@ -257,6 +258,11 @@ cupsdCreateCommonData(void)
 {
   int                  i;              /* Looping var */
   ipp_attribute_t      *attr;          /* Attribute data */
+  cups_dir_t           *dir;           /* Notifier directory */
+  cups_dentry_t                *dent;          /* Notifier directory entry */
+  cups_array_t         *notifiers;     /* Notifier array */
+  char                 filename[1024], /* Filename */
+                       *notifier;      /* Current notifier */
   static const int nups[] =            /* number-up-supported values */
                { 1, 2, 4, 6, 9, 16 };
   static const ipp_orient_t orients[4] =/* orientation-requested-supported values */
@@ -406,10 +412,6 @@ cupsdCreateCommonData(void)
   /* copies-supported */
   ippAddRange(CommonData, IPP_TAG_PRINTER, "copies-supported", 1, MaxCopies);
 
-  /* document-format-default */
-  ippAddString(CommonData, IPP_TAG_PRINTER, IPP_TAG_MIMETYPE,
-               "document-format-default", NULL, "application/octet-stream");
-
   /* generated-natural-language-supported */
   ippAddString(CommonData, IPP_TAG_PRINTER, IPP_TAG_LANGUAGE,
                "generated-natural-language-supported", NULL, DefaultLanguage);
@@ -502,11 +504,11 @@ cupsdCreateCommonData(void)
   ippAddInteger(CommonData, IPP_TAG_PRINTER, IPP_TAG_INTEGER,
                "notify-max-events-supported", MaxEvents);
 
-  /* notify-notify-events-default */
+  /* notify-events-default */
   ippAddString(CommonData, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
                "notify-events-default", NULL, "job-completed");
 
-  /* notify-notify-events-supported */
+  /* notify-events-supported */
   ippAddStrings(CommonData, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
                 "notify-events-supported",
                (int)(sizeof(notify_events) / sizeof(notify_events[0])),
@@ -516,10 +518,31 @@ cupsdCreateCommonData(void)
   ippAddString(CommonData, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
                "notify-pull-method-supported", NULL, "ippget");
 
-  /* TODO: scan notifier directory */
   /* notify-schemes-supported */
-  ippAddString(CommonData, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
-               "notify-schemes-supported", NULL, "mailto");
+  snprintf(filename, sizeof(filename), "%s/notifier", ServerBin);
+  if ((dir = cupsDirOpen(filename)) != NULL)
+  {
+    notifiers = cupsArrayNew((cups_array_func_t)strcmp, NULL);
+
+    while ((dent = cupsDirRead(dir)) != NULL)
+      if (S_ISREG(dent->fileinfo.st_mode) &&
+          (dent->fileinfo.st_mode & S_IXOTH) != 0)
+        cupsArrayAdd(notifiers, _cupsStrAlloc(dent->filename));
+
+    if (cupsArrayCount(notifiers) > 0)
+    {
+      attr = ippAddStrings(CommonData, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
+                          "notify-schemes-supported",
+                          cupsArrayCount(notifiers), NULL, NULL);
+
+      for (i = 0, notifier = (char *)cupsArrayFirst(notifiers);
+           notifier;
+          i ++, notifier = (char *)cupsArrayNext(notifiers))
+       attr->values[i].string.text = notifier;
+    }
+
+    cupsArrayDelete(notifiers);
+  }
 
   /* number-up-supported */
   ippAddIntegers(CommonData, IPP_TAG_PRINTER, IPP_TAG_INTEGER,
@@ -665,7 +688,7 @@ cupsdDeletePrinter(
           dp = (cupsd_printer_t *)cupsArrayNext(Printers))
        if (dp != p && (dp->type & CUPS_PRINTER_DEFAULT))
        {
-         DefaultPrinter = p;
+         DefaultPrinter = dp;
          break;
        }
     }
@@ -2404,18 +2427,25 @@ cupsdUpdatePrinters(void)
 
 const char *                           /* O - Printer or class name */
 cupsdValidateDest(
-    const char      *hostname,         /* I - Host name */
-    const char      *resource,         /* I - Resource name */
+    const char      *uri,              /* I - Printer URI */
     cups_ptype_t    *dtype,            /* O - Type (printer or class) */
     cupsd_printer_t **printer)         /* O - Printer pointer */
 {
   cupsd_printer_t      *p;             /* Current printer */
   char                 localname[1024],/* Localized hostname */
                        *lptr,          /* Pointer into localized hostname */
-                       *sptr;          /* Pointer into server name */
-
-
-  DEBUG_printf(("cupsdValidateDest(\"%s\", \"%s\", %p, %p)\n", hostname, resource,
+                       *sptr,          /* Pointer into server name */
+                       *rptr,          /* Pointer into resource */
+                       scheme[32],     /* Scheme portion of URI */
+                       username[64],   /* Username portion of URI */
+                       hostname[HTTP_MAX_HOST],
+                                       /* Host portion of URI */
+                       resource[HTTP_MAX_URI];
+                                       /* Resource portion of URI */
+  int                  port;           /* Port portion of URI */
+
+
+  DEBUG_printf(("cupsdValidateDest(uri=\"%s\", dtype=%p, printer=%p)\n", uri,
                 dtype, printer));
 
  /*
@@ -2425,7 +2455,16 @@ cupsdValidateDest(
   if (printer)
     *printer = NULL;
 
-  *dtype = (cups_ptype_t)0;
+  if (dtype)
+    *dtype = (cups_ptype_t)0;
+
+ /*
+  * Pull the hostname and resource from the URI...
+  */
+
+  httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme),
+                  username, sizeof(username), hostname, sizeof(hostname),
+                 &port, resource, sizeof(resource));
 
  /*
   * See if the resource is a class or printer...
@@ -2437,7 +2476,7 @@ cupsdValidateDest(
     * Class...
     */
 
-    resource += 9;
+    rptr = resource + 9;
   }
   else if (!strncmp(resource, "/printers/", 10))
   {
@@ -2445,7 +2484,7 @@ cupsdValidateDest(
     * Printer...
     */
 
-    resource += 10;
+    rptr = resource + 10;
   }
   else
   {
@@ -2460,17 +2499,19 @@ cupsdValidateDest(
   * See if the printer or class name exists...
   */
 
-  p = cupsdFindDest(resource);
+  p = cupsdFindDest(rptr);
 
-  if (p == NULL && strchr(resource, '@') == NULL)
+  if (p == NULL && strchr(rptr, '@') == NULL)
     return (NULL);
   else if (p != NULL)
   {
     if (printer)
       *printer = p;
 
-    *dtype = p->type & (CUPS_PRINTER_CLASS | CUPS_PRINTER_IMPLICIT |
-                        CUPS_PRINTER_REMOTE);
+    if (dtype)
+      *dtype = p->type & (CUPS_PRINTER_CLASS | CUPS_PRINTER_IMPLICIT |
+                          CUPS_PRINTER_REMOTE);
+
     return (p->name);
   }
 
@@ -2479,7 +2520,7 @@ cupsdValidateDest(
   */
 
   if (!strcasecmp(hostname, "localhost"))
-    hostname = ServerName;
+    strlcpy(hostname, ServerName, sizeof(hostname));
 
   strlcpy(localname, hostname, sizeof(localname));
 
@@ -2521,13 +2562,15 @@ cupsdValidateDest(
        p;
        p = (cupsd_printer_t *)cupsArrayNext(Printers))
     if (!strcasecmp(p->hostname, localname) &&
-        !strcasecmp(p->name, resource))
+        !strcasecmp(p->name, rptr))
     {
       if (printer)
         *printer = p;
 
-      *dtype = p->type & (CUPS_PRINTER_CLASS | CUPS_PRINTER_IMPLICIT |
-                          CUPS_PRINTER_REMOTE);
+      if (dtype)
+       *dtype = p->type & (CUPS_PRINTER_CLASS | CUPS_PRINTER_IMPLICIT |
+                            CUPS_PRINTER_REMOTE);
+
       return (p->name);
     }
 
@@ -2776,6 +2819,10 @@ add_printer_defaults(cupsd_printer_t *p)/* I - Printer */
     ippAddInteger(p->attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER, "copies-default",
                   1);
 
+  if (!cupsGetOption("document-format", p->num_options, p->options))
+    ippAddString(CommonData, IPP_TAG_PRINTER, IPP_TAG_MIMETYPE,
+                "document-format-default", NULL, "application/octet-stream");
+
   if (!cupsGetOption("job-hold-until", p->num_options, p->options))
     ippAddString(p->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
                  "job-hold-until-default", NULL, "no-hold");
index 4b16290981643dd84575faf90f7febf5af59764a..b25af075f32406bdf8fe8616aaf10f148c7526bd 100644 (file)
@@ -135,8 +135,7 @@ extern void         cupsdStopPrinter(cupsd_printer_t *p, int update);
 extern void            cupsdUpdatePrinters(void);
 extern cupsd_quota_t   *cupsdUpdateQuota(cupsd_printer_t *p, const char *username,
                                          int pages, int k);
-extern const char      *cupsdValidateDest(const char *hostname,
-                                          const char *resource,
+extern const char      *cupsdValidateDest(const char *uri,
                                           cups_ptype_t *dtype,
                                           cupsd_printer_t **printer);
 extern void            cupsdWritePrintcap(void);
index 56f21d1d6b7e23f303bfdf3b460fba82755b4838..81dd255ac3d4f2f7661ff4fbee2fec82e5f9071e 100644 (file)
@@ -36,7 +36,6 @@
  *   cupsdStopAllNotifiers()       - Stop all notifier processes.
  *   cupsdUpdateNotifierStatus()   - Read messages from notifiers.
  *   cupsd_compare_subscriptions() - Compare two subscriptions.
- *   cupsd_delete_all_events()     - Delete all cached events.
  *   cupsd_delete_event()          - Delete a single event...
  *   cupsd_send_dbus()             - Send a DBUS notification...
  *   cupsd_send_notification()     - Send a notification for the specified
@@ -61,7 +60,6 @@
 static int     cupsd_compare_subscriptions(cupsd_subscription_t *first,
                                            cupsd_subscription_t *second,
                                            void *unused);
-static void    cupsd_delete_all_events(void);
 static void    cupsd_delete_event(cupsd_event_t *event);
 #ifdef HAVE_DBUS
 static void    cupsd_send_dbus(cupsd_eventmask_t event, cupsd_printer_t *dest,
@@ -113,30 +111,12 @@ cupsdAddEvent(
     return;
   }
 
- /*
-  * Allocate memory for the event cache as needed...
-  */
-
-  if (!Events)
-  {
-    Events    = calloc(MaxEvents, sizeof(cupsd_event_t *));
-    NumEvents = 0;
-
-    if (!Events)
-    {
-      cupsdLogMessage(CUPSD_LOG_CRIT,
-                      "Unable to allocate memory for event cache - %s",
-                     strerror(errno));
-      return;
-    }
-  }
-
  /*
   * Then loop through the subscriptions and add the event to the corresponding
   * caches...
   */
 
-  for (sub = (cupsd_subscription_t *)cupsArrayFirst(Subscriptions), temp = NULL;
+  for (temp = NULL, sub = (cupsd_subscription_t *)cupsArrayFirst(Subscriptions);
        sub;
        sub = (cupsd_subscription_t *)cupsArrayNext(Subscriptions))
   {
@@ -149,185 +129,168 @@ cupsdAddEvent(
        (sub->job == job || !sub->job))
     {
      /*
-      * Need this event...
+      * Need this event, so create a new event record...
       */
 
-      if (!temp)
+      if ((temp = (cupsd_event_t *)calloc(1, sizeof(cupsd_event_t))) == NULL)
       {
-       /*
-       * Create the new event record...
-       */
+       cupsdLogMessage(CUPSD_LOG_CRIT,
+                       "Unable to allocate memory for event - %s",
+                       strerror(errno));
+       return;
+      }
 
-       if ((temp = (cupsd_event_t *)calloc(1, sizeof(cupsd_event_t))) == NULL)
-       {
-         cupsdLogMessage(CUPSD_LOG_CRIT,
-                         "Unable to allocate memory for event - %s",
-                         strerror(errno));
-         return;
-       }
+      temp->event = event;
+      temp->time  = time(NULL);
+      temp->attrs = ippNew();
+      temp->job   = job;
+      temp->dest  = dest;
 
-       temp->event = event;
-       temp->time  = time(NULL);
-       temp->attrs = ippNew();
-       temp->job   = job;
-       temp->dest  = dest;
+     /*
+      * Add common event notification attributes...
+      */
 
-       /*
-        * Add common event notification attributes...
-       */
+      ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_CHARSET,
+                   "notify-charset", NULL, "utf-8");
 
-        ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_INTEGER,
-                     "notify-subscription-id", sub->id);
+      ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_LANGUAGE,
+                   "notify-natural-langugage", NULL, "en-US");
 
-       ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_KEYWORD,
-                    "notify-subscribed-event", NULL, cupsdEventName(event));
+      ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_INTEGER,
+                   "notify-subscription-id", sub->id);
 
-        ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_INTEGER,
-                     "printer-up-time", time(NULL));
+      ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_INTEGER,
+                   "notify-sequence-number", sub->next_event_id);
 
-        va_start(ap, text);
-       vsnprintf(ftext, sizeof(ftext), text, ap);
-       va_end(ap);
+      ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_KEYWORD,
+                  "notify-subscribed-event", NULL, cupsdEventName(event));
 
-       ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_TEXT,
-                    "notify-text", NULL, ftext);
+      if (sub->user_data_len > 0)
+        ippAddOctetString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
+                         "notify-user-data", sub->user_data,
+                         sub->user_data_len);
 
-        if (dest)
-       {
-        /*
-         * Add printer attributes...
-         */
+      ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_INTEGER,
+                   "printer-up-time", time(NULL));
 
-         ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_URI,
-                      "notify-printer-uri", NULL, dest->uri);
+      va_start(ap, text);
+      vsnprintf(ftext, sizeof(ftext), text, ap);
+      va_end(ap);
 
-         ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_NAME,
-                      "printer-name", NULL, dest->name);
+      ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_TEXT,
+                  "notify-text", NULL, ftext);
 
-         ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_ENUM,
-                       "printer-state", dest->state);
+      if (dest)
+      {
+       /*
+       * Add printer attributes...
+       */
 
-         if (dest->num_reasons == 0)
-           ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
-                        IPP_TAG_KEYWORD, "printer-state-reasons", NULL,
-                        dest->state == IPP_PRINTER_STOPPED ? "paused" : "none");
-         else
-           ippAddStrings(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
-                         IPP_TAG_KEYWORD, "printer-state-reasons",
-                         dest->num_reasons, NULL,
-                         (const char * const *)dest->reasons);
+       ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_URI,
+                    "notify-printer-uri", NULL, dest->uri);
 
-         ippAddBoolean(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
-                       "printer-is-accepting-jobs", dest->accepting);
-        }
+       ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_NAME,
+                    "printer-name", NULL, dest->name);
 
-        if (job)
-       {
-        /*
-         * Add job attributes...
-         */
+       ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_ENUM,
+                     "printer-state", dest->state);
 
-         ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_INTEGER,
-                       "notify-job-id", job->id);
-         ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_ENUM,
-                       "job-state", job->state_value);
+       if (dest->num_reasons == 0)
+         ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
+                      IPP_TAG_KEYWORD, "printer-state-reasons", NULL,
+                      dest->state == IPP_PRINTER_STOPPED ? "paused" : "none");
+       else
+         ippAddStrings(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
+                       IPP_TAG_KEYWORD, "printer-state-reasons",
+                       dest->num_reasons, NULL,
+                       (const char * const *)dest->reasons);
 
-          if ((attr = ippFindAttribute(job->attrs, "job-name",
-                                      IPP_TAG_NAME)) != NULL)
-           ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_NAME,
-                        "job-name", NULL, attr->values[0].string.text);
+       ippAddBoolean(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
+                     "printer-is-accepting-jobs", dest->accepting);
+      }
 
-         switch (job->state_value)
-         {
-           case IPP_JOB_PENDING :
-               if (dest && dest->state == IPP_PRINTER_STOPPED)
-                 ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
-                              IPP_TAG_KEYWORD, "job-state-reasons", NULL,
-                              "printer-stopped");
-               else
-                 ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
-                              IPP_TAG_KEYWORD, "job-state-reasons", NULL,
-                              "none");
-               break;
-
-           case IPP_JOB_HELD :
-               if (ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_KEYWORD) != NULL ||
-                   ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_NAME) != NULL)
-                 ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
-                              IPP_TAG_KEYWORD, "job-state-reasons", NULL,
-                              "job-hold-until-specified");
-               else
-                 ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
-                              IPP_TAG_KEYWORD, "job-state-reasons", NULL,
-                              "job-incoming");
-               break;
-
-           case IPP_JOB_PROCESSING :
-               ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
-                            IPP_TAG_KEYWORD, "job-state-reasons", NULL,
-                            "job-printing");
-               break;
+      if (job)
+      {
+       /*
+       * Add job attributes...
+       */
 
-           case IPP_JOB_STOPPED :
+       ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_INTEGER,
+                     "notify-job-id", job->id);
+       ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_ENUM,
+                     "job-state", job->state_value);
+
+        if ((attr = ippFindAttribute(job->attrs, "job-name",
+                                    IPP_TAG_NAME)) != NULL)
+         ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_NAME,
+                      "job-name", NULL, attr->values[0].string.text);
+
+       switch (job->state_value)
+       {
+         case IPP_JOB_PENDING :
+              if (dest && dest->state == IPP_PRINTER_STOPPED)
                ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
                             IPP_TAG_KEYWORD, "job-state-reasons", NULL,
-                            "job-stopped");
-               break;
-
-           case IPP_JOB_CANCELLED :
+                            "printer-stopped");
+              else
                ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
                             IPP_TAG_KEYWORD, "job-state-reasons", NULL,
-                            "job-canceled-by-user");
-               break;
+                            "none");
+              break;
 
-           case IPP_JOB_ABORTED :
+         case IPP_JOB_HELD :
+              if (ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_KEYWORD) != NULL ||
+                 ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_NAME) != NULL)
                ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
                             IPP_TAG_KEYWORD, "job-state-reasons", NULL,
-                            "aborted-by-system");
-               break;
-
-           case IPP_JOB_COMPLETED :
+                            "job-hold-until-specified");
+              else
                ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
                             IPP_TAG_KEYWORD, "job-state-reasons", NULL,
-                            "job-completed-successfully");
-               break;
-         }
-
-         ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_INTEGER,
-                       "job-impressions-completed",
-                       job->sheets ? job->sheets->values[0].integer : 0);
+                            "job-incoming");
+              break;
+
+         case IPP_JOB_PROCESSING :
+              ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
+                          IPP_TAG_KEYWORD, "job-state-reasons", NULL,
+                          "job-printing");
+              break;
+
+         case IPP_JOB_STOPPED :
+              ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
+                          IPP_TAG_KEYWORD, "job-state-reasons", NULL,
+                          "job-stopped");
+              break;
+
+         case IPP_JOB_CANCELLED :
+              ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
+                          IPP_TAG_KEYWORD, "job-state-reasons", NULL,
+                          "job-canceled-by-user");
+              break;
+
+         case IPP_JOB_ABORTED :
+              ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
+                          IPP_TAG_KEYWORD, "job-state-reasons", NULL,
+                          "aborted-by-system");
+              break;
+
+         case IPP_JOB_COMPLETED :
+              ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
+                          IPP_TAG_KEYWORD, "job-state-reasons", NULL,
+                          "job-completed-successfully");
+              break;
        }
 
-       /*
-       * Purge an old event as needed...
-       */
-
-       if (NumEvents >= MaxEvents)
-       {
-        /*
-         * Purge the oldest event in the cache...
-         */
-
-         cupsd_delete_event(Events[0]);
-
-         NumEvents --;
-
-         memmove(Events, Events + 1, NumEvents * sizeof(cupsd_event_t *));
-       }
+       ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_INTEGER,
+                     "job-impressions-completed",
+                     job->sheets ? job->sheets->values[0].integer : 0);
 
        /*
-       * Add the new event to the main cache...
+       * Send the notification for this subscription...
        */
 
-       Events[NumEvents] = temp;
-       NumEvents ++;
+       cupsd_send_notification(sub, temp);
       }
-
-     /*
-      * Send the notification for this subscription...
-      */
-
-      cupsd_send_notification(sub, temp);
     }
   }
 
@@ -438,8 +401,6 @@ cupsdDeleteAllSubscriptions(void)
   cupsd_subscription_t *sub;           /* Subscription */
 
 
-  cupsd_delete_all_events();
-
   if (!Subscriptions)
     return;
 
@@ -462,6 +423,9 @@ cupsdDeleteSubscription(
     cupsd_subscription_t *sub,         /* I - Subscription object */
     int                  update)       /* I - 1 = update subscriptions.conf */
 {
+  int  i;                              /* Looping var */
+
+
  /*
   * Close the pipe to the notifier as needed...
   */
@@ -483,7 +447,12 @@ cupsdDeleteSubscription(
   cupsdClearString(&(sub->recipient));
 
   if (sub->events)
+  {
+    for (i = 0; i < sub->num_events; i ++)
+      cupsd_delete_event(sub->events[i]);
+
     free(sub->events);
+  }
 
   free(sub);
 
@@ -1299,27 +1268,6 @@ cupsd_compare_subscriptions(
 }
 
 
-/*
- * 'cupsd_delete_all_events()' - Delete all cached events.
- */
-
-static void
-cupsd_delete_all_events(void)
-{
-  int  i;                              /* Looping var */
-
-
-  if (MaxEvents <= 0 || !Events)
-    return;
-
-  for (i = 0; i < NumEvents; i ++)
-    cupsd_delete_event(Events[i]);
-
-  free(Events);
-  Events = NULL;
-}
-
-
 /*
  * 'cupsd_delete_event()' - Delete a single event...
  *
@@ -1330,43 +1278,6 @@ cupsd_delete_all_events(void)
 static void
 cupsd_delete_event(cupsd_event_t *event)/* I - Event to delete */
 {
-  cupsd_subscription_t *sub;           /* Current subscription */
-
-
- /*
-  * Loop through the subscriptions and look for the event in the cache...
-  */
-
-  for (sub = (cupsd_subscription_t *)cupsArrayFirst(Subscriptions);
-       sub;
-       sub = (cupsd_subscription_t *)cupsArrayNext(Subscriptions))
-  {
-   /*
-    * Only check the first event in the subscription cache, since the
-    * caller will only delete the oldest event in the cache...
-    */
-
-    if (sub->num_events > 0 && sub->events[0] == event)
-    {
-     /*
-      * Remove this event...
-      */
-
-      sub->num_events --;
-      sub->first_event_id ++;
-
-      if (sub->num_events > 0)
-      {
-       /*
-        * Shift other events upward in cache...
-       */
-
-        memmove(sub->events, sub->events + 1,
-               sub->num_events * sizeof(cupsd_event_t *));
-      }
-    }
-  }
-
  /*
   * Free memory...
   */
@@ -1489,6 +1400,25 @@ cupsd_send_notification(
     }
   }
 
+ /*
+  * Purge an old event as needed...
+  */
+
+  if (sub->num_events >= MaxEvents)
+  {
+   /*
+    * Purge the oldest event in the cache...
+    */
+
+    cupsd_delete_event(sub->events[0]);
+
+    sub->num_events --;
+    sub->first_event_id ++;
+
+    memmove(sub->events, sub->events + 1,
+           sub->num_events * sizeof(cupsd_event_t *));
+  }
+
  /*
   * Add the event to the subscription.  Since the events array is
   * always MaxEvents in length, and since we will have already
index 8f98199ca907000daef9b797480227d8ea2baee1..f9243f16e181dd4fcbeaa4004db3996fb20f7be6 100644 (file)
@@ -131,11 +131,9 @@ VAR int            MaxSubscriptions VALUE(100),
 VAR cups_array_t *Subscriptions VALUE(NULL);
                                        /* Active subscriptions */
 
-VAR int                MaxEvents VALUE(100),   /* Maximum number of events */
-               NumEvents VALUE(0);     /* Number of active events */
-VAR cupsd_event_t **Events VALUE(NULL);        /* Active events */
+VAR int                MaxEvents VALUE(100);   /* Maximum number of events */
 
-VAR unsigned   LastEvent VALUE(0);     /* Last events processed */
+VAR unsigned   LastEvent VALUE(0);     /* Last event(s) processed */
 VAR int                NotifierPipes[2] VALUE2(-1, -1);
                                        /* Pipes for notifier error/debug output */
 VAR cupsd_statbuf_t *NotifierStatusBuffer VALUE(NULL);
index 196d1211f50f63282aa144256394f0eebc1e1619..ccba4d59c0d3ff910ed75adc08fa3f015d09a23d 100644 (file)
@@ -71,7 +71,7 @@ main(int  argc,                               /* I - Number of command-line args */
   mime        = NULL;
   src         = NULL;
   dst         = NULL;
-  filter_path = "../filter:../pdftops";
+  filter_path = "../filter:../pdftops:" CUPS_SERVERBIN "/filter";
 
   for (i = 1; i < argc; i ++)
     if (!strcmp(argv[i], "-d"))
diff --git a/standards/papi-1.0.pdf b/standards/papi-1.0.pdf
new file mode 100644 (file)
index 0000000..bea5be8
Binary files /dev/null and b/standards/papi-1.0.pdf differ
index bd7546d96e22086b5065485b94b718b4830a6404..af5ef1af7197557256c6a6aba11d140a85ebd8c2 100644 (file)
@@ -78,7 +78,7 @@ install:      all
        $(INSTALL_BIN) lp $(BINDIR)
        $(INSTALL_BIN) lpoptions $(BINDIR)
        $(INSTALL_BIN) lpstat $(BINDIR)
-       $(INSTALL_BIN) -m 4755 -o $(CUPS_USER) -g $(CUPS_GROUP) lppasswd $(BINDIR) || $(INSTALL_BIN) lppasswd $(BINDIR)
+       $(INSTALL_BIN) -m 4755 -o root lppasswd $(BINDIR) || $(INSTALL_BIN) lppasswd $(BINDIR)
 
 
 #
index ef1b3e7a371b61f542e2c0f24d2f5277f68df2f5..395c17d4caa1a4ec11aa04b537c7eb8e6325491a 100644 (file)
@@ -42,6 +42,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
+#include <cups/http-private.h>
 #include <cups/string.h>
 #include <cups/cups.h>
 #include <cups/i18n.h>
@@ -70,26 +71,59 @@ static void show_scheduler(http_t *);
  */
 
 int
-main(int  argc,                        /* I - Number of command-line arguments */
-     char *argv[])             /* I - Command-line arguments */
+main(int  argc,                                /* I - Number of command-line arguments */
+     char *argv[])                     /* I - Command-line arguments */
 {
-  int          i,              /* Looping var */
-               status;         /* Exit status */
-  http_t       *http;          /* Connection to server */
-  int          num_dests;      /* Number of user destinations */
-  cups_dest_t  *dests;         /* User destinations */
-  int          long_status;    /* Long status report? */
-  int          ranking;        /* Show job ranking? */
-  const char   *which;         /* Which jobs to show? */
-  char         op;             /* Last operation on command-line */
+  int          i,                      /* Looping var */
+               status;                 /* Exit status */
+  http_t       *http;                  /* Connection to server */
+  int          num_dests;              /* Number of user destinations */
+  cups_dest_t  *dests;                 /* User destinations */
+  int          long_status;            /* Long status report? */
+  int          ranking;                /* Show job ranking? */
+  const char   *which;                 /* Which jobs to show? */
+  char         op;                     /* Last operation on command-line */
 
 
  /*
   * Set the locale so that times, etc. are displayed properly.
+  *
+  * Unfortunately, while we need the localized time value, we *don't*
+  * want to use the localized charset for the time value, so we need
+  * to set LC_TIME to the locale name with .UTF-8 on the end (if
+  * the locale includes a character set specifier...)
   */
 
   setlocale(LC_ALL, "");
 
+#ifdef LC_TIME
+  {
+    const char *lc_time;               /* Current LC_TIME value */
+    char       new_lc_time[255],       /* New LC_TIME value */
+               *charset;               /* Pointer to character set */
+
+    if ((lc_time = setlocale(LC_TIME, NULL)) == NULL)
+      lc_time = setlocale(LC_ALL, NULL);
+
+    if (lc_time)
+    {
+      strlcpy(new_lc_time, lc_time, sizeof(new_lc_time));
+      if ((charset = strchr(new_lc_time, '.')) == NULL)
+        charset = new_lc_time + strlen(new_lc_time);
+
+      strlcpy(charset, ".UTF-8", sizeof(new_lc_time) - (charset - new_lc_time));
+    }
+    else
+      strcpy(new_lc_time, "C");
+
+    setlocale(LC_TIME, new_lc_time);
+  }
+#endif /* LC_TIME */
+  
+ /*
+  * Parse command-line options...
+  */
+
   http        = NULL;
   num_dests   = 0;
   dests       = NULL;
index 2c16f8977d2f62cc1715c13e691a2706b6e56915..ba629947d7360934baa742ea62f75ec4bf1936a6 100644 (file)
@@ -118,11 +118,13 @@ depend:
 # Install files...
 #
 
-install: all
+install: all $(INSTALL_LANGUAGES)
        $(INSTALL_DIR) -m 755 $(DATADIR)/templates
        for file in $(FILES); do \
                $(INSTALL_DATA) $$file $(DATADIR)/templates; \
        done
+
+install-languages:
        for lang in $(LANGUAGES); do \
                $(INSTALL_DIR) -m 755 $(DATADIR)/templates/$$lang; \
                for file in $(FILES); do \
@@ -137,17 +139,19 @@ install: all
 # Uninstall files...
 #
 
-uninstall:
+uninstall: $(UNINSTALL_LANGUAGES)
        for file in $(FILES); do \
                $(RM) $(DATADIR)/templates/$$file; \
        done
+       -$(RMDIR) $(DATADIR)/templates
+
+uninstall-languages:
        for lang in $(LANGUAGES); do \
                for file in $(FILES); do \
                        $(RM) $(DATADIR)/templates/$$lang/$$file; \
                done \
                $(RMDIR) $(DATADIR)/templates/$$lang; \
        done
-       -$(RMDIR) $(DATADIR)/templates
 
 
 #
index 35b241b06bbe2eac8c79bd0ca900b461734a237e..ba62bd7f3d16ecbddfc8893e752e7bc22e786fc7 100644 (file)
@@ -15,6 +15,7 @@
        ATTR charset attributes-charset utf-8
        ATTR language attributes-natural-language en
        ATTR uri job-uri $uri
+#      ATTR keyword requested-attributes job-media-sheets-completed,job-state
 
        # What statuses are OK?
        #STATUS ok
@@ -23,5 +24,4 @@
        # What attributes do we expect?
        EXPECT job-uri
        EXPECT job-state
-       EXPECT bogus-attribute
 }
diff --git a/test/get-jobs.test b/test/get-jobs.test
new file mode 100644 (file)
index 0000000..2d2e5a7
--- /dev/null
@@ -0,0 +1,21 @@
+# Get list of jobs
+{
+       # The name of the test...
+       NAME "Get-Jobs"
+
+       # The resource to use for the POST
+       # RESOURCE /admin
+
+       # The operation to use
+       OPERATION Get-Jobs
+
+       # Attributes, starting in the operation group...
+       GROUP operation
+       ATTR charset attributes-charset utf-8
+       ATTR language attributes-natural-language en
+       ATTR uri printer-uri $uri
+       ATTR keyword which-jobs completed
+
+       # What statuses are OK?
+       STATUS successful-ok
+}
index 70368c8b8debce079844b3b9fca98d0a6e100434..aaf200643e42ce35df2fc0cd1f88b6a2550d0cd6 100755 (executable)
@@ -18,9 +18,9 @@ if test $# = 0; then
        echo Updating for snapshot...
        svn up
        rev=`svnversion . | sed -e '1,$s/[a-zA-Z]//g'`
-       version="1.2svn"
+       version="1.3svn"
        revision="-r$rev"
-       fileversion="1.2svn-r$rev"
+       fileversion="1.3svn-r$rev"
        fileurl="ftp://ftp.easysw.com/pub/cups/test/cups-$fileversion-source.tar."
        url="."
 else
@@ -32,7 +32,7 @@ else
        fileurl="ftp://ftp.easysw.com/pub/cups/$version/cups-$fileversion-source.tar."
        url="https://svn.easysw.com/public/cups/tags/release-$version"
 
-       svn copy https://svn.easysw.com/public/cups/branches/branch-1.2 "$url" \
+       svn copy https://svn.easysw.com/public/cups/trunk "$url" \
                -m "Tag $version" || exit 1
 fi
 
index 655853a3b38fa042abcca39620f091d352f9b826..4bc74b58042cbbace7b60aab3a00a072447716f9 100755 (executable)
@@ -12,7 +12,7 @@ fi
 rev=`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[a-zA-Z]*//g'`
 
 if test $# = 0; then
-       version="1.2svn-r$rev"
+       version="1.3svn-r$rev"
 else
        version=$1
 fi
@@ -69,7 +69,7 @@ for file in packaging/cups-desc.plist packaging/cups-info.plist \
        echo Updating $file...
        sed -e '1,$s/@CUPS_VERSION@/'$version'/g' \
                -e '1,$s/@CUPS_REVISION@//g' \
-               -e '1,$s/@CUPS_RELEASE@/1.2.'$rev'/g' \
+               -e '1,$s/@CUPS_RELEASE@/1.3.'$rev'/g' \
                <$file.in >$file
 done