From ed4869111296da3b8514751fab9dffaa3146cb87 Mon Sep 17 00:00:00 2001 From: jlovell Date: Thu, 22 Jun 2006 20:01:18 +0000 Subject: [PATCH] Load cups into easysw/current. git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@181 a1ca3aef-8c08-0410-bb20-df032aa958be --- CHANGES-1.2.txt | 701 ++++++++++++++++++ CHANGES.txt | 644 +--------------- INSTALL.txt | 4 +- Makedefs.in | 6 +- README.txt | 4 +- backend/Dependencies | 39 +- backend/Makefile | 36 +- backend/backend-private.h | 73 ++ backend/ieee1284.c | 73 +- backend/ipp.c | 3 +- backend/parallel.c | 203 +---- backend/runloop.c | 218 ++++++ backend/serial.c | 289 +++++--- backend/snmp.c | 25 +- backend/socket.c | 295 +++----- backend/test1284.c | 5 +- backend/usb-darwin.c | 2 +- backend/usb-unix.c | 228 ++---- backend/usb.c | 21 +- berkeley/Dependencies | 10 +- berkeley/lpq.c | 2 - cgi-bin/Dependencies | 24 +- cgi-bin/admin.c | 2 - cgi-bin/help-index.c | 2 +- config-scripts/cups-common.m4 | 2 +- config-scripts/cups-compiler.m4 | 57 +- config-scripts/cups-defaults.m4 | 36 +- config-scripts/cups-image.m4 | 20 +- config-scripts/cups-sharedlibs.m4 | 44 +- config-scripts/cups-ssl.m4 | 1 + config.h.in | 7 + configure.in | 7 + cups-config.in | 4 +- cups/Dependencies | 249 ++++--- cups/Makefile | 6 +- cups/adminutil.c | 13 +- cups/cups.h | 4 +- cups/encode.c | 2 + cups/getputfile.c | 2 +- cups/globals.h | 1 + cups/http-addrlist.c | 16 +- cups/http-private.h | 49 ++ cups/http.c | 21 +- cups/http.h | 47 +- cups/ipp.c | 4 +- cups/testhttp.c | 18 +- cups/testppd.c | 53 +- cups/util.c | 25 +- doc/Makefile | 15 +- doc/help/spec-pdf.html | 21 + doc/help/spec-postscript.html | 120 +++ doc/help/spec-raster.html | 32 +- doc/pl/images/button-accept-jobs.gif | Bin 627 -> 691 bytes doc/pl/images/button-add-class.gif | Bin 536 -> 528 bytes doc/pl/images/button-add-printer.gif | Bin 571 -> 579 bytes doc/pl/images/button-add-this-printer.gif | Bin 608 -> 648 bytes doc/pl/images/button-cancel-all-jobs.gif | Bin 797 -> 768 bytes doc/pl/images/button-cancel-job.gif | Bin 531 -> 524 bytes doc/pl/images/button-change-settings.gif | Bin 580 -> 624 bytes doc/pl/images/button-clean-print-heads.gif | Bin 878 -> 943 bytes doc/pl/images/button-clear.gif | Bin 469 -> 480 bytes doc/pl/images/button-continue.gif | Bin 339 -> 447 bytes doc/pl/images/button-delete-class.gif | Bin 463 -> 477 bytes doc/pl/images/button-delete-printer.gif | Bin 513 -> 533 bytes .../images/button-edit-configuration-file.gif | Bin 673 -> 734 bytes doc/pl/images/button-export-samba.gif | Bin 657 -> 977 bytes doc/pl/images/button-help.gif | Bin 363 -> 380 bytes doc/pl/images/button-hold-job.gif | Bin 649 -> 709 bytes doc/pl/images/button-manage-classes.gif | Bin 605 -> 640 bytes doc/pl/images/button-manage-jobs.gif | Bin 697 -> 669 bytes doc/pl/images/button-manage-printers.gif | Bin 643 -> 717 bytes doc/pl/images/button-manage-server.gif | Bin 669 -> 689 bytes doc/pl/images/button-modify-class.gif | Bin 592 -> 647 bytes doc/pl/images/button-modify-printer.gif | Bin 659 -> 702 bytes doc/pl/images/button-move-job.gif | Bin 608 -> 604 bytes doc/pl/images/button-move-jobs.gif | Bin 843 -> 837 bytes doc/pl/images/button-print-self-test-page.gif | Bin 711 -> 1074 bytes doc/pl/images/button-print-test-page.gif | Bin 709 -> 788 bytes doc/pl/images/button-publish-printer.gif | Bin 579 -> 662 bytes doc/pl/images/button-reject-jobs.gif | Bin 638 -> 582 bytes doc/pl/images/button-release-job.gif | Bin 613 -> 605 bytes doc/pl/images/button-restart-job.gif | Bin 653 -> 827 bytes doc/pl/images/button-save-changes.gif | Bin 536 -> 565 bytes doc/pl/images/button-search.gif | Bin 381 -> 505 bytes doc/pl/images/button-set-allowed-users.gif | Bin 909 -> 985 bytes doc/pl/images/button-set-as-default.gif | Bin 706 -> 729 bytes doc/pl/images/button-set-printer-options.gif | Bin 691 -> 709 bytes doc/pl/images/button-show-active.gif | Bin 764 -> 866 bytes doc/pl/images/button-show-all.gif | Bin 813 -> 891 bytes doc/pl/images/button-show-completed.gif | Bin 809 -> 923 bytes doc/pl/images/button-show-next.gif | Bin 605 -> 702 bytes doc/pl/images/button-show-previous.gif | Bin 568 -> 742 bytes doc/pl/images/button-sort-ascending.gif | Bin 648 -> 576 bytes doc/pl/images/button-sort-descending.gif | Bin 673 -> 627 bytes doc/pl/images/button-start-class.gif | Bin 544 -> 579 bytes doc/pl/images/button-start-printer.gif | Bin 606 -> 636 bytes doc/pl/images/button-stop-class.gif | Bin 573 -> 624 bytes doc/pl/images/button-stop-printer.gif | Bin 638 -> 696 bytes doc/pl/images/button-unpublish-printer.gif | Bin 613 -> 694 bytes doc/pl/images/button-use-default-config.gif | Bin 930 -> 1007 bytes doc/pl/images/button-view-access-log.gif | Bin 711 -> 888 bytes doc/pl/images/button-view-error-log.gif | Bin 717 -> 893 bytes doc/pl/images/button-view-page-log.gif | Bin 793 -> 812 bytes .../images/button-view-printable-version.gif | Bin 819 -> 939 bytes filter/Makefile | 16 +- filter/pstops.c | 91 ++- filter/raster.c | 619 ++++++++++------ filter/raster.h | 10 +- filter/rasterbench.c | 355 +++++++++ filter/rastertolabel.c | 298 +++++++- locale/Makefile | 10 +- locale/cups.pot | 2 +- locale/cups_es.po | 482 ++++-------- locale/cups_ja.po | 2 +- locale/cups_pl.po | 2 +- locale/cups_sv.po | 2 +- man/cupsaddsmb.man.in | 17 +- man/cupsd.conf.man.in | 6 +- notifier/Dependencies | 2 +- packaging/WELCOME.rtf | 2 +- packaging/cups.list.in | 4 +- packaging/cups.readme | 170 ++++- packaging/cups.spec.in | 2 +- pdftops/Dependencies | 45 -- ppd/intelbar.ppd | 219 ++++++ scheduler/Dependencies | 154 ++-- scheduler/auth.c | 5 +- scheduler/client.c | 38 +- scheduler/conf.c | 150 ++-- scheduler/dirsvc.c | 63 +- scheduler/filter.c | 4 +- scheduler/ipp.c | 553 +++++++------- scheduler/job.c | 129 ++-- scheduler/mime.c | 15 + scheduler/newselect.txt | 115 +++ scheduler/printers.c | 101 ++- scheduler/printers.h | 3 +- scheduler/subscriptions.c | 374 ++++------ scheduler/subscriptions.h | 6 +- scheduler/testmime.c | 2 +- standards/papi-1.0.pdf | Bin 0 -> 503784 bytes systemv/Makefile | 2 +- systemv/lpstat.c | 56 +- templates/Makefile | 10 +- test/get-job-attributes.test | 2 +- test/get-jobs.test | 21 + tools/makesrcdist | 6 +- tools/testosx | 4 +- 148 files changed, 4781 insertions(+), 3173 deletions(-) create mode 100644 CHANGES-1.2.txt create mode 100644 backend/backend-private.h create mode 100644 backend/runloop.c create mode 100644 doc/help/spec-pdf.html create mode 100644 doc/help/spec-postscript.html create mode 100644 filter/rasterbench.c create mode 100644 ppd/intelbar.ppd create mode 100644 scheduler/newselect.txt create mode 100644 standards/papi-1.0.pdf create mode 100644 test/get-jobs.test diff --git a/CHANGES-1.2.txt b/CHANGES-1.2.txt new file mode 100644 index 000000000..a12e03065 --- /dev/null +++ b/CHANGES-1.2.txt @@ -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. diff --git a/CHANGES.txt b/CHANGES.txt index 87691a8c7..e78abe1a3 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,639 +1,11 @@ -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. diff --git a/INSTALL.txt b/INSTALL.txt index df6022b46..329409b37 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -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 diff --git a/Makedefs.in b/Makedefs.in index e1bd9f381..961a5e957 100644 --- a/Makedefs.in +++ b/Makedefs.in @@ -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@ diff --git a/README.txt b/README.txt index 4595be8c4..fc0a146b4 100644 --- a/README.txt +++ b/README.txt @@ -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... diff --git a/backend/Dependencies b/backend/Dependencies index aed436425..068343821 100644 --- a/backend/Dependencies +++ b/backend/Dependencies @@ -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 diff --git a/backend/Makefile b/backend/Makefile index 62b44d37e..e3ba7dc28 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -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 index 000000000..bdbe42783 --- /dev/null +++ b/backend/backend-private.h @@ -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 +# include +# include +# include +# include +# include +# include + + +/* + * 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 $". + */ diff --git a/backend/ieee1284.c b/backend/ieee1284.c index 03720bf72..d623b293d 100644 --- a/backend/ieee1284.c +++ b/backend/ieee1284.c @@ -25,51 +25,41 @@ * * 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 +#include "backend-private.h" +#ifdef __linux +# include +# include +# 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 +# else +# include +# include +# 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 -# include -# 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 -# else -# include -# include -# 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); } diff --git a/backend/ipp.c b/backend/ipp.c index f1b22cdf8..4943dbbdb 100644 --- a/backend/ipp.c +++ b/backend/ipp.c @@ -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... diff --git a/backend/parallel.c b/backend/parallel.c index 539fec755..e5c92ef4d 100644 --- a/backend/parallel.c +++ b/backend/parallel.c @@ -33,14 +33,7 @@ * Include necessary headers. */ -#include -#include -#include -#include -#include -#include -#include -#include "ieee1284.c" +#include "backend-private.h" #ifdef __hpux # include @@ -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 index 000000000..4d247f1ed --- /dev/null +++ b/backend/runloop.c @@ -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 + + +/* + * '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 $". + */ diff --git a/backend/serial.c b/backend/serial.c index 24533d5e1..0e613b490 100644 --- a/backend/serial.c +++ b/backend/serial.c @@ -33,13 +33,7 @@ * Include necessary headers. */ -#include -#include -#include -#include -#include -#include -#include +#include "backend-private.h" #ifdef __hpux # include @@ -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); } diff --git a/backend/snmp.c b/backend/snmp.c index 701e3f460..502f5514a 100644 --- a/backend/snmp.c +++ b/backend/snmp.c @@ -77,17 +77,10 @@ * Include necessary headers. */ -#include #include -#include -#include +#include "backend-private.h" #include #include -#include -#include - -#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 { diff --git a/backend/socket.c b/backend/socket.c index d09509cb8..93a5f76bf 100644 --- a/backend/socket.c +++ b/backend/socket.c @@ -32,17 +32,11 @@ * Include necessary headers. */ -#include #include -#include -#include -#include +#include "backend-private.h" #include -#include -#include #include #include -#include #ifdef WIN32 # include @@ -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); } diff --git a/backend/test1284.c b/backend/test1284.c index 8491fd0ce..4d77cc68f 100644 --- a/backend/test1284.c +++ b/backend/test1284.c @@ -41,6 +41,7 @@ # include # include #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); diff --git a/backend/usb-darwin.c b/backend/usb-darwin.c index b1f283b1f..093535054 100644 --- a/backend/usb-darwin.c +++ b/backend/usb-darwin.c @@ -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 ) { diff --git a/backend/usb-unix.c b/backend/usb-unix.c index 3ca30c965..6c635b476 100644 --- a/backend/usb-unix.c +++ b/backend/usb-unix.c @@ -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 { /* diff --git a/backend/usb.c b/backend/usb.c index 9e81f8f12..eb9a0540c 100644 --- a/backend/usb.c +++ b/backend/usb.c @@ -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); } diff --git a/berkeley/Dependencies b/berkeley/Dependencies index d8db9344a..767d33e1c 100644 --- a/berkeley/Dependencies +++ b/berkeley/Dependencies @@ -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 diff --git a/berkeley/lpq.c b/berkeley/lpq.c index 59bb3187a..835109fa4 100644 --- a/berkeley/lpq.c +++ b/berkeley/lpq.c @@ -79,8 +79,6 @@ main(int argc, /* I - Number of command-line arguments */ cups_lang_t *language; /* Language */ - - /* * Check for command-line options... */ diff --git a/cgi-bin/Dependencies b/cgi-bin/Dependencies index a1e09d398..7e976859d 100644 --- a/cgi-bin/Dependencies +++ b/cgi-bin/Dependencies @@ -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 diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c index 2ca121433..0fae09508 100644 --- a/cgi-bin/admin.c +++ b/cgi-bin/admin.c @@ -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); diff --git a/cgi-bin/help-index.c b/cgi-bin/help-index.c index 8f148c471..b27ca0666 100644 --- a/cgi-bin/help-index.c +++ b/cgi-bin/help-index.c @@ -842,7 +842,7 @@ help_load_file( if (isspace(*ptr & 255)) { while (isspace(*ptr & 255)) - *ptr ++; + ptr ++; *text++ = ' '; } diff --git a/config-scripts/cups-common.m4 b/config-scripts/cups-common.m4 index a2340d2bc..d400d18ff 100644 --- a/config-scripts/cups-common.m4 +++ b/config-scripts/cups-common.m4 @@ -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'`" diff --git a/config-scripts/cups-compiler.m4 b/config-scripts/cups-compiler.m4 index 318df2103..403293135 100644 --- a/config-scripts/cups-compiler.m4 +++ b/config-scripts/cups-compiler.m4 @@ -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 ;; diff --git a/config-scripts/cups-defaults.m4 b/config-scripts/cups-defaults.m4 index 4c6425af5..c23cf3947 100644 --- a/config-scripts/cups-defaults.m4 +++ b/config-scripts/cups-defaults.m4 @@ -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="" diff --git a/config-scripts/cups-image.m4 b/config-scripts/cups-image.m4 index 64a55f98a..d2cc19a2a 100644 --- a/config-scripts/cups-image.m4 +++ b/config-scripts/cups-image.m4 @@ -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, diff --git a/config-scripts/cups-sharedlibs.m4 b/config-scripts/cups-sharedlibs.m4 index 8aa54d74f..556e1e2fc 100644 --- a/config-scripts/cups-sharedlibs.m4 +++ b/config-scripts/cups-sharedlibs.m4 @@ -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) diff --git a/config-scripts/cups-ssl.m4 b/config-scripts/cups-ssl.m4 index 156c72529..294f2cd97 100644 --- a/config-scripts/cups-ssl.m4 +++ b/config-scripts/cups-ssl.m4 @@ -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 diff --git a/config.h.in b/config.h.in index 4bc361995..60b3beab9 100644 --- a/config.h.in +++ b/config.h.in @@ -260,6 +260,13 @@ #undef HAVE_SSL +/* + * Do we have ? + */ + +#undef HAVE_SECBASEPRIV_H + + /* * Do we have the SLP library? */ diff --git a/configure.in b/configure.in index 9969eb617..2b406cfab 100644 --- a/configure.in +++ b/configure.in @@ -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 diff --git a/cups-config.in b/cups-config.in index 33fe5c41d..0f6d5041b 100755 --- a/cups-config.in +++ b/cups-config.in @@ -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 diff --git a/cups/Dependencies b/cups/Dependencies index 4cb7cb37f..012ef0b3b 100644 --- a/cups/Dependencies +++ b/cups/Dependencies @@ -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 diff --git a/cups/Makefile b/cups/Makefile index b4bd58313..648798688 100644 --- a/cups/Makefile +++ b/cups/Makefile @@ -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 # diff --git a/cups/adminutil.c b/cups/adminutil.c index 548deafa0..4702dd630 100644 --- a/cups/adminutil.c +++ b/cups/adminutil.c @@ -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); diff --git a/cups/cups.h b/cups/cups.h index 3085d5da5..f503957a1 100644 --- a/cups/cups.h +++ b/cups/cups.h @@ -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 diff --git a/cups/encode.c b/cups/encode.c index f0a4c7681..47a6e50dd 100644 --- a/cups/encode.c +++ b/cups/encode.c @@ -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 }, diff --git a/cups/getputfile.c b/cups/getputfile.c index 9e4056746..c2c8d15a3 100644 --- a/cups/getputfile.c +++ b/cups/getputfile.c @@ -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" diff --git a/cups/globals.h b/cups/globals.h index a69e1726d..7c3e37aaa 100644 --- a/cups/globals.h +++ b/cups/globals.h @@ -32,6 +32,7 @@ */ # include "string.h" +# include "http-private.h" # include "cups.h" # include "i18n.h" diff --git a/cups/http-addrlist.c b/cups/http-addrlist.c index 71f4d18f2..2d814fbc6 100644 --- a/cups/http-addrlist.c +++ b/cups/http-addrlist.c @@ -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 diff --git a/cups/http-private.h b/cups/http-private.h index 78072dbf7..ee2f94851 100644 --- a/cups/http-private.h +++ b/cups/http-private.h @@ -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... */ diff --git a/cups/http.c b/cups/http.c index 1f90be5b4..07381616d 100644 --- a/cups/http.c +++ b/cups/http.c @@ -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) diff --git a/cups/http.h b/cups/http.h index a85971fcd..40ba98235 100644 --- a/cups/http.h +++ b/cups/http.h @@ -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 ****/ /* diff --git a/cups/ipp.c b/cups/ipp.c index 96bf89114..cc22e2bf5 100644 --- a/cups/ipp.c +++ b/cups/ipp.c @@ -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... diff --git a/cups/testhttp.c b/cups/testhttp.c index a7fde7124..c6b173a82 100644 --- a/cups/testhttp.c +++ b/cups/testhttp.c @@ -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 diff --git a/cups/testppd.c b/cups/testppd.c index 0610de296..4d1ee2da0 100644 --- a/cups/testppd.c +++ b/cups/testppd.c @@ -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); diff --git a/cups/util.c b/cups/util.c index 3bd960b6d..0d3cd0328 100644 --- a/cups/util.c +++ b/cups/util.c @@ -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) diff --git a/doc/Makefile b/doc/Makefile index f3e0a30fa..ff1f1d249 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -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 index 000000000..862eb0cb6 --- /dev/null +++ b/doc/help/spec-pdf.html @@ -0,0 +1,21 @@ + + + + CUPS PDF Format + + + + +

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 pdftopdf 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 pdftops filter.

+ +

More information will be posted here as the PDF workflow +filters are added to CUPS.

+ + + diff --git a/doc/help/spec-postscript.html b/doc/help/spec-postscript.html new file mode 100644 index 000000000..7e9f9a802 --- /dev/null +++ b/doc/help/spec-postscript.html @@ -0,0 +1,120 @@ + + + + + Generating PostScript for CUPS + + + + + + +

Introduction

+ +

This document describes how to generate PostScript output for +CUPS and is largely based on the +Adobe TechNote #5001: PostScript Language Document Structuring +Conventions Specification Version 3.0. 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.

+ +
Note: 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.
+ +

Anatomy of a PostScript File

+ +

PostScript files are ASCII text files starting with a header +line (%!PS-Adobe-3.0) followed by a combination of +comment lines starting with two percent signs (%%) 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:

+ +
+%!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
+
+ + + + +

Embedding Printer Options

+ + +

Embedding Fonts and Text

+ + +

Embedding Images

+ + +
Note: 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.
+ + + + + diff --git a/doc/help/spec-raster.html b/doc/help/spec-raster.html index b3a44a4f9..a0d6b895f 100644 --- a/doc/help/spec-raster.html +++ b/doc/help/spec-raster.html @@ -14,9 +14,10 @@ RIPs to device-dependent filters that convert the raster data to a printable format.

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.

+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.

The registered MIME media type for CUPS raster files is application/vnd.cups-raster.

@@ -485,6 +486,22 @@ colors are encoded using an initial byte of "257 - count" followed by the color value bytes.

+

Version 3 Raster File Format

+ +

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.

+ +

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.

+ +

Pixel Value Coding

The following sections describe the encoding and decoding of @@ -673,6 +690,15 @@ accuracy.

Change History

+

Changes in CUPS 1.2.2

+ +
    + +
  • Added version 3 (uncompressed) format.
  • + +
+ +

Changes in CUPS 1.2.1