From 178cb7369d104b95acb92929f36956a38765c84c Mon Sep 17 00:00:00 2001 From: msweet Date: Wed, 13 May 2009 22:29:41 +0000 Subject: [PATCH] Merge changes from CUPS 1.4svn-r8628. git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@1495 a1ca3aef-8c08-0410-bb20-df032aa958be --- CHANGES.txt | 10 +- Makefile | 33 ++- backend/usb-darwin.c | 40 +++- cgi-bin/admin.c | 2 + cgi-bin/api-cgi.header | 34 +++ cgi-bin/api-cgi.shtml | 17 ++ cgi-bin/makedocset.c | 4 +- config-scripts/cups-common.m4 | 3 + config.h.in | 7 + cups/api-array.header | 4 +- cups/api-cups.header | 4 +- cups/api-filedir.header | 4 +- cups/api-filter.header | 4 +- cups/api-filter.shtml | 25 +- cups/api-httpipp.header | 4 +- cups/api-overview.header | 4 +- cups/api-ppd.header | 4 +- cups/backend.c | 4 +- cups/conflicts.c | 6 +- cups/cups.h | 8 +- cups/dest.c | 2 +- cups/emit.c | 6 +- cups/file.c | 2 +- cups/getdevices.c | 2 +- cups/http.c | 7 +- cups/ipp-support.c | 4 +- cups/ipp.h | 4 +- cups/localize.c | 6 +- cups/page.c | 2 +- cups/ppd.h | 2 +- cups/request.c | 8 +- cups/sidechannel.c | 4 +- cups/sidechannel.h | 4 +- cups/usersys.c | 4 +- cups/util.c | 10 +- doc/Makefile | 1 + doc/cups-printable.css | 7 +- doc/cups.css | 4 + doc/help/accounting.html | 3 + doc/help/api-array.html | 13 +- doc/help/api-cgi.html | 60 ++++- doc/help/api-cups.html | 37 +-- doc/help/api-driver.html | 61 ++++- doc/help/api-filedir.html | 15 +- doc/help/api-filter.html | 49 +++- doc/help/api-httpipp.html | 29 ++- doc/help/api-mime.html | 60 ++++- doc/help/api-overview.html | 11 +- doc/help/api-ppd.html | 23 +- doc/help/api-ppdc.html | 61 ++++- doc/help/api-raster.html | 11 +- doc/help/cgi.html | 3 + doc/help/glossary.html | 3 + doc/help/kerberos.html | 3 + doc/help/license.html | 3 + doc/help/network.html | 3 + doc/help/options.html | 3 + doc/help/overview.html | 10 +- doc/help/policies.html | 3 + doc/help/postscript-driver.html | 37 ++- doc/help/ppd-compiler.html | 9 +- doc/help/raster-driver.html | 46 +++- doc/help/ref-access_log.html | 3 + doc/help/ref-classes-conf.html | 3 + doc/help/ref-client-conf.html | 3 + doc/help/ref-cupsd-conf.html.in | 51 +++++ doc/help/ref-error_log.html | 3 + doc/help/ref-mailto-conf.html | 3 + doc/help/ref-page_log.html | 3 + doc/help/ref-ppdcfile.html | 3 + doc/help/ref-printers-conf.html | 3 + doc/help/ref-snmp-conf.html | 3 + doc/help/ref-subscriptions-conf.html | 3 + doc/help/security.html | 5 +- doc/help/sharing.html | 7 +- doc/help/spec-banner.html | 6 +- doc/help/spec-browsing.html | 3 + doc/help/spec-cmp.html | 9 +- doc/help/spec-command.html | 6 +- doc/help/spec-design.html | 326 +++++---------------------- doc/help/spec-ipp.html | 3 + doc/help/spec-pdf.html | 4 +- doc/help/spec-postscript.html | 4 +- doc/help/spec-ppd.html | 14 +- doc/help/spec-raster.html | 6 +- doc/help/spec-stp.html | 6 +- doc/help/standard.html.in | 5 +- doc/help/translation.html | 4 + doc/help/whatsnew.html | 13 +- driver/api-driver.header | 34 +++ driver/api-driver.shtml | 18 ++ filter/api-raster.header | 4 +- filter/postscript-driver.header | 4 +- filter/postscript-driver.shtml | 25 +- filter/ppd-compiler.header | 2 + filter/raster-driver.header | 4 +- filter/raster-driver.shtml | 34 ++- filter/rastertoepson.c | 43 ++-- init/org.cups.cupsd.plist | 4 + locale/cups_zh.po | 4 +- man/Makefile | 5 +- man/backend.man | 16 +- man/commandtoescpx.man | 33 --- man/commandtopclx.man | 33 --- man/cupsd.conf.man.in | 5 + man/filter.man | 23 +- man/mantohtml.c | 17 +- man/rastertoescpx.man | 35 --- man/rastertopclx.man | 35 --- packaging/cups.list.in | 9 +- packaging/cups.spec.in | 3 +- ppdc/api-ppdc.header | 34 +++ ppdc/api-ppdc.shtml | 18 ++ scheduler/api-mime.header | 34 +++ scheduler/api-mime.shtml | 17 ++ scheduler/conf.c | 2 + scheduler/conf.h | 2 + scheduler/cups-driverd.cxx | 53 ++++- scheduler/dirsvc.c | 125 +++++++--- scheduler/job.c | 155 ++++++++++++- scheduler/job.h | 9 +- scheduler/log.c | 55 ++++- scheduler/printers.c | 127 ++++------- scheduler/sysman.c | 16 ++ standards/Makefile | 13 +- standards/rfctohtml.c | 36 +-- templates/de/help-printable.tmpl | 2 - templates/es/help-printable.tmpl | 2 - templates/help-printable.tmpl | 2 - templates/ja/help-printable.tmpl | 2 - templates/pl/help-printable.tmpl | 2 - templates/ru/help-printable.tmpl | 2 - 132 files changed, 1635 insertions(+), 821 deletions(-) create mode 100644 cgi-bin/api-cgi.header create mode 100644 cgi-bin/api-cgi.shtml delete mode 100644 man/commandtoescpx.man delete mode 100644 man/commandtopclx.man delete mode 100644 man/rastertoescpx.man delete mode 100644 man/rastertopclx.man create mode 100644 ppdc/api-ppdc.header create mode 100644 ppdc/api-ppdc.shtml create mode 100644 scheduler/api-mime.header create mode 100644 scheduler/api-mime.shtml diff --git a/CHANGES.txt b/CHANGES.txt index dcf311820..dc4ea588c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,13 +1,19 @@ -CHANGES.txt - 2009-05-08 +CHANGES.txt - 2009-05-13 ------------------------ CHANGES IN CUPS V1.4b3 - - Documentation fixes (STR #3044, STR #3057) + - Documentation fixes (STR #3044, STR #3057, STR #3153) - Added complete localizations for German, Japanese, Polish, and Russian and partial localizations for Chinese, Danish, Finnish, French, Italian, Korean, Norwegian, Portuguese, and Swedish (STR #3096, STR #3098, STR #3109, STR #3111, STR #3141) + - The cups-driverd program did not detect symlink loops (STR #3185) + - The EPSON 24-pin series driver should now feed the correct amount + (STR #2624) + - The scheduler now automatically logs the last N debug messages for + failed print jobs. + - You can now modify a raw print queue (STR #3133) - Fixed a number of ppdi issues and added a unit test to validate that ppdc + ppdi can generate and import the same data (STR #3152) - Moving jobs in the web interface now shows an error if you only have diff --git a/Makefile b/Makefile index 5a1f8b4a0..0fedbbdb4 100644 --- a/Makefile +++ b/Makefile @@ -316,17 +316,30 @@ uninstall: fi \ $(RMDIR) $(BUILDROOT)$(INITDDIR); \ fi + if test "x$(SMFMANIFESTDIR)" != x; then \ + echo Uninstalling SMF manifest in $(SMFMANIFESTDIR)...;\ + $(RM) $(BUILDROOT)$(SMFMANIFESTDIR)/cups.xml; \ + fi if test "x$(DBUSDIR)" != x; then \ echo Uninstalling cups.conf in $(DBUSDIR)...;\ $(RM) $(BUILDROOT)$(DBUSDIR)/cups.conf; \ $(RMDIR) $(BUILDROOT)$(DBUSDIR); \ fi - $(RM) $(BUILDROOT)/etc/xinetd.d/cups-lpd - $(RM) $(BUILDROOT)/usr/share/applications/cups.desktop - $(RM) $(BUILDROOT)/usr/share/icons/hicolor/16x16/apps/cups.png - $(RM) $(BUILDROOT)/usr/share/icons/hicolor/32x32/apps/cups.png - $(RM) $(BUILDROOT)/usr/share/icons/hicolor/64x64/apps/cups.png - $(RM) $(BUILDROOT)/usr/share/icons/hicolor/128x128/apps/cups.png + if test "x$(XINETD)" != x; then \ + echo Uninstalling xinetd configuration file for cups-lpd...; \ + $(RM) $(BUILDROOT)$(XINETD)/cups-lpd; \ + fi + if test "x$(MENUDIR)" != x; then \ + echo Uninstalling desktop menu...; \ + $(RM) $(BUILDROOT)$(MENUDIR)/cups.desktop; \ + fi + if test "x$(ICONDIR)" != x; then \ + echo Uninstalling desktop icons...; \ + $(RM) $(BUILDROOT)$(ICONDIR)/hicolor/16x16/apps/cups.png; \ + $(RM) $(BUILDROOT)$(ICONDIR)/hicolor/32x32/apps/cups.png; \ + $(RM) $(BUILDROOT)$(ICONDIR)/hicolor/64x64/apps/cups.png; \ + $(RM) $(BUILDROOT)$(ICONDIR)/hicolor/128x128/apps/cups.png; \ + fi # @@ -344,7 +357,7 @@ check: all unittests # -# Create an Xcode docset... +# Create HTML documentation... # apihelp: @@ -359,11 +372,17 @@ framedhelp: (cd $$dir; $(MAKE) $(MFLAGS) framedhelp) || exit 1;\ done + +# +# Create an Xcode docset... +# + docset: apihelp echo Generating docset directory tree... $(RM) -r org.cups.docset mkdir -p org.cups.docset/Contents/Resources/Documentation/help mkdir -p org.cups.docset/Contents/Resources/Documentation/images + cd man; $(MAKE) $(MFLAGS) html cd doc; $(MAKE) $(MFLAGS) docset cd cgi-bin; $(MAKE) $(MFLAGS) makedocset cgi-bin/makedocset org.cups.docset \ diff --git a/backend/usb-darwin.c b/backend/usb-darwin.c index 8d3fe4f81..9dcd2c6ee 100644 --- a/backend/usb-darwin.c +++ b/backend/usb-darwin.c @@ -318,6 +318,8 @@ print_device(const char *uri, /* I - Device URI */ { char serial[1024]; /* Serial number buffer */ OSStatus status; /* Function results */ + IOReturn iostatus, /* Current IO status */ + prev_iostatus = 0; /* Previous IO status */ pthread_t read_thread_id, /* Read thread */ sidechannel_thread_id;/* Side-channel thread */ int have_sidechannel = 0; /* Was the side-channel thread started? */ @@ -646,28 +648,48 @@ print_device(const char *uri, /* I - Device URI */ { bytes = g.print_bytes; - status = (*g.classdriver)->WritePipe(g.classdriver, (UInt8*)print_ptr, &bytes, 0); + iostatus = (*g.classdriver)->WritePipe(g.classdriver, (UInt8*)print_ptr, &bytes, 0); /* * Ignore timeout errors, but retain the number of bytes written to * avoid sending duplicate data ()... */ - if (status == kIOUSBTransactionTimeout) - status = 0; + if (iostatus == kIOUSBTransactionTimeout) + iostatus = 0; - if (status || bytes < 0) + /* + * Ignore stall errors, since we clear any stalls in the class driver... + */ + + if (iostatus == kIOUSBPipeStalled) + iostatus = 0; + + /* + * Ignore the first "aborted" status we get, since we might have + * received a signal ()... + */ + + if (iostatus == kIOReturnAborted && prev_iostatus != kIOReturnAborted) + { + prev_iostatus = iostatus; + iostatus = 0; + } + else + prev_iostatus = iostatus; + + if (iostatus || bytes < 0) { /* * Write error - bail if we don't see an error we can retry... */ - OSStatus err = (*g.classdriver)->Abort(g.classdriver); + IOReturn err = (*g.classdriver)->Abort(g.classdriver); _cupsLangPuts(stderr, _("ERROR: Unable to send print data!\n")); - fprintf(stderr, "DEBUG: USB class driver WritePipe returned %ld\n", - (long)status); - fprintf(stderr, "DEBUG: USB class driver Abort returned %ld\n", - (long)err); + fprintf(stderr, "DEBUG: USB class driver WritePipe returned %x\n", + iostatus); + fprintf(stderr, "DEBUG: USB class driver Abort returned %x\n", + err); status = job_canceled ? CUPS_BACKEND_FAILED : CUPS_BACKEND_STOP; break; } diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c index 9c3e67a8a..f0812c81a 100644 --- a/cgi-bin/admin.c +++ b/cgi-bin/admin.c @@ -1084,6 +1084,8 @@ do_am_printer(http_t *http, /* I - HTTP connection */ if (get_status != HTTP_OK) { + httpFlush(http); + fprintf(stderr, "ERROR: Unable to get PPD file %s: %d - %s\n", uri, get_status, httpStatus(get_status)); } diff --git a/cgi-bin/api-cgi.header b/cgi-bin/api-cgi.header new file mode 100644 index 000000000..e3355a6b9 --- /dev/null +++ b/cgi-bin/api-cgi.header @@ -0,0 +1,34 @@ + + +

CGI API

+ +
+ + + + + + + + + + + + + + + + +
Headercups/cgi.h
Library-lcupscgi
See AlsoProgramming: Introduction to CUPS Programming
diff --git a/cgi-bin/api-cgi.shtml b/cgi-bin/api-cgi.shtml new file mode 100644 index 000000000..cf0413a5e --- /dev/null +++ b/cgi-bin/api-cgi.shtml @@ -0,0 +1,17 @@ + + +

Overview

+ +

The CGI API provides Common Gateway Interface functions for CUPS.

diff --git a/cgi-bin/makedocset.c b/cgi-bin/makedocset.c index 807c1f60f..501b1f499 100644 --- a/cgi-bin/makedocset.c +++ b/cgi-bin/makedocset.c @@ -317,10 +317,10 @@ write_index(const char *path, /* I - File to write */ "\n" "CUPS Documentation\n" "\n" + "href='cups-printable.css'>\n" "\n" "\n" - "

CUPS Documentation

\n" + "

CUPS Documentation

\n" "\n" "\n"); diff --git a/config-scripts/cups-common.m4 b/config-scripts/cups-common.m4 index 7ab5f0ebf..9ad554d32 100644 --- a/config-scripts/cups-common.m4 +++ b/config-scripts/cups-common.m4 @@ -307,6 +307,9 @@ case $uname in AC_CHECK_HEADER(membershipPriv.h,AC_DEFINE(HAVE_MEMBERSHIPPRIV_H)) AC_CHECK_FUNCS(mbr_uid_to_uuid) + dnl Check for the vproc_transaction_begin/end stuff... + AC_CHECK_FUNCS(vproc_transaction_begin) + dnl Need header... AC_CHECK_HEADER(dlfcn.h,AC_DEFINE(HAVE_DLFCN_H)) diff --git a/config.h.in b/config.h.in index b17968927..da096f59c 100644 --- a/config.h.in +++ b/config.h.in @@ -606,6 +606,13 @@ #undef HAVE_LRAND48 +/* + * Do we have vproc_transaction_begin/end? + */ + +#undef HAVE_VPROC_TRANSACTION_BEGIN + + /* * Do we have libusb? */ diff --git a/cups/api-array.header b/cups/api-array.header index 825b40754..0f929c8e4 100644 --- a/cups/api-array.header +++ b/cups/api-array.header @@ -3,7 +3,7 @@ Array API header for the Common UNIX Printing System (CUPS). - Copyright 2008 by Apple Inc. + Copyright 2008-2009 by Apple Inc. These coded instructions, statements, and computer programs are the property of Apple Inc. and are protected by Federal copyright @@ -12,6 +12,8 @@ file is missing or damaged, see the license at "http://www.cups.org/". --> +

Array API

+
diff --git a/cups/api-cups.header b/cups/api-cups.header index cc4dd408b..30b34785c 100644 --- a/cups/api-cups.header +++ b/cups/api-cups.header @@ -3,7 +3,7 @@ CUPS API header for the Common UNIX Printing System (CUPS). - Copyright 2008 by Apple Inc. + Copyright 2008-2009 by Apple Inc. These coded instructions, statements, and computer programs are the property of Apple Inc. and are protected by Federal copyright @@ -12,6 +12,8 @@ file is missing or damaged, see the license at "http://www.cups.org/". --> +

CUPS API

+
diff --git a/cups/api-filedir.header b/cups/api-filedir.header index 2a46a6771..437e079b5 100644 --- a/cups/api-filedir.header +++ b/cups/api-filedir.header @@ -3,7 +3,7 @@ File and Directory API header for the Common UNIX Printing System (CUPS). - Copyright 2008 by Apple Inc. + Copyright 2008-2009 by Apple Inc. These coded instructions, statements, and computer programs are the property of Apple Inc. and are protected by Federal copyright @@ -12,6 +12,8 @@ file is missing or damaged, see the license at "http://www.cups.org/". --> +

File and Directory APIs

+
diff --git a/cups/api-filter.header b/cups/api-filter.header index 8f12ebcfa..ebcd368e2 100644 --- a/cups/api-filter.header +++ b/cups/api-filter.header @@ -4,7 +4,7 @@ Filter and backend programming header for the Common UNIX Printing System (CUPS). - Copyright 2008 by Apple Inc. + Copyright 2008-2009 by Apple Inc. These coded instructions, statements, and computer programs are the property of Apple Inc. and are protected by Federal copyright @@ -13,6 +13,8 @@ file is missing or damaged, see the license at "http://www.cups.org/". --> +

Filter and Backend Programming

+
diff --git a/cups/api-filter.shtml b/cups/api-filter.shtml index 7d2b46973..49bf24be3 100644 --- a/cups/api-filter.shtml +++ b/cups/api-filter.shtml @@ -4,7 +4,7 @@ Filter and backend programming introduction for the Common UNIX Printing System (CUPS). - Copyright 2007-2008 by Apple Inc. + Copyright 2007-2009 by Apple Inc. Copyright 1997-2006 by Easy Software Products, all rights reserved. These coded instructions, statements, and computer programs are the @@ -49,6 +49,12 @@ the remaining filters read from the standard input and write to the standard output. The backend is the last filter in the chain and writes to the device.

+

Filters are always run as a non-privileged user, typically "lp", with no +connection to the user's desktop. Backends are run either as a non-privileged +user or as root if the file permissions do not allow user or group execution. +The file permissions section talks about this in +more detail.

+

Security Considerations

It is always important to use security programming practices. Filters and @@ -61,7 +67,7 @@ specify an arbitrary file path to a separator page, template, or other file used by the filter since that can lead to an unauthorized disclosure of information. Always treat input as suspect and validate it!

-

If you are developing a backend that runs as root, make sure to check for +

If you are developing a backend that runs as root , make sure to check for potential buffer overflows, integer under/overflow conditions, and file accesses since these can lead to privilege escalations. When writing files, always validate the file path and never allow a user to determine @@ -75,10 +81,23 @@ user may not be the same as the local user and/or there may not be a local home directory to write to.

In addition, some operating systems provide additional security mechanisms -that further limit file system access, even for backends running as root. On +that further limit file system access, even for backends running as root. On Mac OS X, for example, no backend may write to a user's home directory.

+

File Permissions

+ +

For security reasons, CUPS will only run filters and backends that are owned +by root and do not have world write permissions. The recommended permissions for +filters and backends are 0555 - read and execute but no write. Backends that +must run as root should use permissions of 0500 - read and execute by root, no +access for other users. Write permissions can be enabled for the root user +only.

+ +

To avoid a warning message, the directory containing your filter(s) must also +be owned by root and have world write disabled - permissions of 0755 or 0555 are +strongly encouraged.

+

Temporary Files

Temporary files should be created in the directory specified by the diff --git a/cups/api-httpipp.header b/cups/api-httpipp.header index df069fb59..af0874024 100644 --- a/cups/api-httpipp.header +++ b/cups/api-httpipp.header @@ -3,7 +3,7 @@ HTTP and IPP API header for the Common UNIX Printing System (CUPS). - Copyright 2007-2008 by Apple Inc. + Copyright 2007-2009 by Apple Inc. Copyright 1997-2006 by Easy Software Products, all rights reserved. These coded instructions, statements, and computer programs are the @@ -13,6 +13,8 @@ file is missing or damaged, see the license at "http://www.cups.org/". --> +

HTTP and IPP APIs

+
diff --git a/cups/api-overview.header b/cups/api-overview.header index 23cdd4fee..892ed1c7e 100644 --- a/cups/api-overview.header +++ b/cups/api-overview.header @@ -4,7 +4,7 @@ Introduction to CUPS programming header for the Common UNIX Printing System (CUPS). - Copyright 2008 by Apple Inc. + Copyright 2008-2009 by Apple Inc. These coded instructions, statements, and computer programs are the property of Apple Inc. and are protected by Federal copyright @@ -13,6 +13,8 @@ file is missing or damaged, see the license at "http://www.cups.org/". --> +

Introduction to CUPS Programming

+
diff --git a/cups/api-ppd.header b/cups/api-ppd.header index 5c74e16d1..8763d9996 100644 --- a/cups/api-ppd.header +++ b/cups/api-ppd.header @@ -3,7 +3,7 @@ PPD API header for the Common UNIX Printing System (CUPS). - Copyright 2008 by Apple Inc. + Copyright 2008-2009 by Apple Inc. These coded instructions, statements, and computer programs are the property of Apple Inc. and are protected by Federal copyright @@ -12,6 +12,8 @@ file is missing or damaged, see the license at "http://www.cups.org/". --> +

PPD API

+
diff --git a/cups/backend.c b/cups/backend.c index fa7d05645..2df7b697d 100644 --- a/cups/backend.c +++ b/cups/backend.c @@ -3,7 +3,7 @@ * * Backend functions for the Common UNIX Printing System (CUPS). * - * Copyright 2007-2008 by Apple Inc. + * Copyright 2007-2009 by Apple Inc. * Copyright 2006 by Easy Software Products. * * These coded instructions, statements, and computer programs are the @@ -75,7 +75,7 @@ cupsBackendDeviceURI(char **argv) /* I - Command-line arguments */ * It handles quoting of special characters in the device-make-and-model, * device-info, device-id, and device-location strings. * - * @since CUPS 1.4@ + * @since CUPS 1.4/Mac OS X 10.6@ */ void diff --git a/cups/conflicts.c b/cups/conflicts.c index d6de5a39b..11cbb5acd 100644 --- a/cups/conflicts.c +++ b/cups/conflicts.c @@ -80,7 +80,7 @@ static cups_array_t *ppd_test_constraints(ppd_file_t *ppd, * the conflicting options. The returned option array must be freed using * @link cupsFreeOptions@. * - * @since CUPS 1.4@ + * @since CUPS 1.4/Mac OS X 10.6@ */ int /* O - Number of conflicting options */ @@ -170,7 +170,7 @@ cupsGetConflicts( * choice for the conflicting option, then iterating over all possible choices * until a non-conflicting option choice is found. * - * @since CUPS 1.4@ + * @since CUPS 1.4/Mac OS X 10.6@ */ int /* O - 1 on success, 0 on failure */ @@ -617,7 +617,7 @@ ppdConflicts(ppd_file_t *ppd) /* I - PPD to check */ * This function tests whether a particular option choice is available based * on constraints against options in the "InstallableOptions" group. * - * @since CUPS 1.4@ + * @since CUPS 1.4/Mac OS X 10.6@ */ int /* O - 1 if conflicting, 0 if not conflicting */ diff --git a/cups/cups.h b/cups/cups.h index a4f92e877..6502d95a5 100644 --- a/cups/cups.h +++ b/cups/cups.h @@ -117,8 +117,8 @@ enum cups_ptype_e /**** Printer type/capability bit constants ****/ CUPS_PRINTER_AUTHENTICATED = 0x400000,/* Printer requires authentication @since CUPS 1.2/Mac OS X 10.5@ */ CUPS_PRINTER_COMMANDS = 0x800000, /* Printer supports maintenance commands @since CUPS 1.2/Mac OS X 10.5@ */ CUPS_PRINTER_DISCOVERED = 0x1000000, /* Printer was automatically discovered and added @since CUPS 1.3/Mac OS X 10.5@ */ - CUPS_PRINTER_SCANNER = 0x2000000, /* Scanner-only device @since CUPS 1.4@ */ - CUPS_PRINTER_MFP = 0x4000000, /* Printer with scanning capabilities @since CUPS 1.4@ */ + CUPS_PRINTER_SCANNER = 0x2000000, /* Scanner-only device @since CUPS 1.4/Mac OS X 10.6@ */ + CUPS_PRINTER_MFP = 0x4000000, /* Printer with scanning capabilities @since CUPS 1.4/Mac OS X 10.6@ */ CUPS_PRINTER_OPTIONS = 0x6fffc /* ~(CLASS | REMOTE | IMPLICIT | DEFAULT | FAX | REJECTING | DELETE | NOT_SHARED | AUTHENTICATED | COMMANDS | DISCOVERED) @private@ */ }; @@ -129,14 +129,14 @@ typedef const char *(*cups_password_cb2_t)(const char *prompt, http_t *http, const char *method, const char *resource, void *user_data); - /**** New password callback @since CUPS 1.4@ ****/ + /**** New password callback @since CUPS 1.4/Mac OS X 10.6@ ****/ typedef void (*cups_device_cb_t)(const char *device_class, const char *device_id, const char *device_info, const char *device_make_and_model, const char *device_uri, const char *device_location, void *user_data); - /**** Device callback @since CUPS 1.4@ ****/ + /**** Device callback @since CUPS 1.4/Mac OS X 10.6@ ****/ typedef struct cups_option_s /**** Printer Options ****/ { diff --git a/cups/dest.c b/cups/dest.c index f65e3152d..4aedcb216 100644 --- a/cups/dest.c +++ b/cups/dest.c @@ -478,7 +478,7 @@ cupsGetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_ * The returned destination must be freed using @link cupsFreeDests@ with a * "num_dests" value of 1. * - * @since CUPS 1.4@ + * @since CUPS 1.4/Mac OS X 10.6@ */ cups_dest_t * /* O - Destination or @code NULL@ */ diff --git a/cups/emit.c b/cups/emit.c index 82c07f66e..bfae5d6f3 100644 --- a/cups/emit.c +++ b/cups/emit.c @@ -1156,7 +1156,8 @@ ppd_handle_media(ppd_file_t *ppd) /* I - PPD file */ if (!strcasecmp(size->name, "Custom") || (!manual_feed && !input_slot) || (manual_feed && !strcasecmp(manual_feed->choice, "False") && - (!input_slot || (input_slot->code && !input_slot->code[0])))) + (!input_slot || (input_slot->code && !input_slot->code[0]))) || + (!rpr && ppd->num_filters > 0)) { /* * Use PageSize code... @@ -1164,8 +1165,7 @@ ppd_handle_media(ppd_file_t *ppd) /* I - PPD file */ ppdMarkOption(ppd, "PageSize", size->name); } - else if ((rpr && rpr->value && !strcasecmp(rpr->value, "True")) || - (!rpr && ppd->num_filters > 0)) + else if (rpr && rpr->value && !strcasecmp(rpr->value, "True")) { /* * Use PageRegion code... diff --git a/cups/file.c b/cups/file.c index 4b9d65e79..68e854de3 100644 --- a/cups/file.c +++ b/cups/file.c @@ -1196,7 +1196,7 @@ cupsFilePutChar(cups_file_t *fp, /* I - CUPS file */ * * This function handles any comment escaping of the value. * - * @since CUPS 1.4@ + * @since CUPS 1.4/Mac OS X 10.6@ */ ssize_t /* O - Number of bytes written or -1 on error */ diff --git a/cups/getdevices.c b/cups/getdevices.c index 81f885912..6c9dbc843 100644 --- a/cups/getdevices.c +++ b/cups/getdevices.c @@ -35,7 +35,7 @@ * parameters provide comma-delimited lists of backends to include or omit from * the request respectively. * - * @since CUPS 1.4@ + * @since CUPS 1.4/Mac OS X 10.6@ */ ipp_status_t /* O - Request status - @code IPP_OK@ on success. */ diff --git a/cups/http.c b/cups/http.c index a717f80c0..ddb2f3a83 100644 --- a/cups/http.c +++ b/cups/http.c @@ -1893,7 +1893,9 @@ httpSetField(http_t *http, /* I - Connection to server */ * need to bracket IPv6 numeric addresses. */ - if (strchr(value, ':')) + char *ptr = strchr(value, ':'); + + if (value[0] != '[' && ptr && strchr(ptr + 1, ':')) { /* * Bracket IPv6 numeric addresses... @@ -1911,8 +1913,7 @@ httpSetField(http_t *http, /* I - Connection to server */ * Check for a trailing dot on the hostname... */ - char *ptr = http->fields[HTTP_FIELD_HOST]; - /* Pointer into Host: field */ + ptr = http->fields[HTTP_FIELD_HOST]; if (*ptr) { diff --git a/cups/ipp-support.c b/cups/ipp-support.c index c8c239c0f..82200ae7d 100644 --- a/cups/ipp-support.c +++ b/cups/ipp-support.c @@ -423,7 +423,7 @@ ippSetPort(int p) /* I - Port number to use */ * * The returned names are defined in RFC 2911 and 3382. * - * @since CUPS 1.4@ + * @since CUPS 1.4/Mac OS X 10.6@ */ const char * /* O - Tag name */ @@ -443,7 +443,7 @@ ippTagString(ipp_tag_t tag) /* I - Tag value */ * * The tag names are defined in RFC 2911 and 3382. * - * @since CUPS 1.4@ + * @since CUPS 1.4/Mac OS X 10.6@ */ ipp_tag_t /* O - Tag value */ diff --git a/cups/ipp.h b/cups/ipp.h index 6d182bd47..42c5ced26 100644 --- a/cups/ipp.h +++ b/cups/ipp.h @@ -4,7 +4,7 @@ * Internet Printing Protocol definitions for the Common UNIX Printing * System (CUPS). * - * Copyright 2007-2008 by Apple Inc. + * Copyright 2007-2009 by Apple Inc. * Copyright 1997-2006 by Easy Software Products. * * These coded instructions, statements, and computer programs are the @@ -248,7 +248,7 @@ typedef enum ipp_op_e /**** IPP operations... ****/ CUPS_MOVE_JOB, /* Move a job to a different printer */ CUPS_AUTHENTICATE_JOB, /* Authenticate a job @since CUPS 1.2/Mac OS X 10.5@ */ CUPS_GET_PPD, /* Get a PPD file @since CUPS 1.3/Mac OS X 10.5@ */ - CUPS_GET_DOCUMENT = 0x4027 /* Get a document file @since CUPS 1.4@ */ + CUPS_GET_DOCUMENT = 0x4027 /* Get a document file @since CUPS 1.4/Mac OS X 10.6@ */ } ipp_op_t; /* Old names for the operations */ diff --git a/cups/localize.c b/cups/localize.c index 8520e9310..94a3ffc7a 100644 --- a/cups/localize.c +++ b/cups/localize.c @@ -308,9 +308,7 @@ ppdLocalizeIPPReason( message = _("Media tray needs to be filled."); else if (!strncmp(reason, "media-jam", 9)) message = _("Media jam!"); - else if (!strncmp(reason, "moving-to-paused", 16) || - !strncmp(reason, "offline", 7) || - !strncmp(reason, "paused", 6) || + else if (!strncmp(reason, "offline", 7) || !strncmp(reason, "shutdown", 8)) message = _("Printer offline."); else if (!strncmp(reason, "toner-low", 9)) @@ -503,7 +501,7 @@ ppdLocalizeIPPReason( * text from the attribute value. If no localized text for the requested * name can be found, @code NULL@ is returned. * - * @since CUPS 1.4@ + * @since CUPS 1.4/Mac OS X 10.6@ */ const char * /* O - Value or @code NULL@ if not found */ diff --git a/cups/page.c b/cups/page.c index 8616c25e0..04c6357dc 100644 --- a/cups/page.c +++ b/cups/page.c @@ -196,7 +196,7 @@ ppdPageSize(ppd_file_t *ppd, /* I - PPD file record */ * If the specified PPD file does not support custom page sizes, both * "minimum" and "maximum" are filled with zeroes. * - * @since CUPS 1.4@ + * @since CUPS 1.4/Mac OS X 10.6@ */ int /* O - 1 if custom sizes are supported, 0 otherwise */ diff --git a/cups/ppd.h b/cups/ppd.h index 1a5f34db1..6f3940eac 100644 --- a/cups/ppd.h +++ b/cups/ppd.h @@ -330,7 +330,7 @@ typedef struct ppd_file_s /**** PPD File ****/ cups_array_t *marked; /* Marked choices @since CUPS 1.3/Mac OS X 10.5@ @private@ */ /**** New in CUPS 1.4 ****/ - cups_array_t *cups_uiconstraints; /* cupsUIConstraints @since CUPS 1.4@ @private@ */ + cups_array_t *cups_uiconstraints; /* cupsUIConstraints @since CUPS 1.4/Mac OS X 10.6@ @private@ */ } ppd_file_t; diff --git a/cups/request.c b/cups/request.c index 615ef22a2..2d1107676 100644 --- a/cups/request.c +++ b/cups/request.c @@ -335,7 +335,7 @@ cupsDoRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP_ * cupsSendDocument() or cupsSendRequest(). For requests that return * additional data, use httpRead() after getting a successful response. * - * @since CUPS 1.4@ + * @since CUPS 1.4/Mac OS X 10.6@ */ ipp_t * /* O - Response or @code NULL@ on HTTP error */ @@ -483,7 +483,7 @@ cupsGetResponse(http_t *http, /* I - Connection to server or @code CUPS_HTTP * This function is used after cupsGetResponse() to read the PPD or document * files for CUPS_GET_PPD and CUPS_GET_DOCUMENT requests, respectively. * - * @since CUPS 1.4@ + * @since CUPS 1.4/Mac OS X 10.6@ */ ssize_t /* O - Bytes read, 0 on EOF, -1 on error */ @@ -530,7 +530,7 @@ cupsReadResponseData( * Unlike cupsDoFileRequest(), cupsDoIORequest(), and cupsDoRequest(), the * request is not freed. * - * @since CUPS 1.4@ + * @since CUPS 1.4/Mac OS X 10.6@ */ http_status_t /* O - Initial HTTP status */ @@ -746,7 +746,7 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP * This function is used after @link cupsSendRequest@ to provide a PPD and * after @link cupsStartDocument@ to provide a document file. * - * @since CUPS 1.4@ + * @since CUPS 1.4/Mac OS X 10.6@ */ http_status_t /* O - @code HTTP_CONTINUE@ if OK or HTTP status on error */ diff --git a/cups/sidechannel.c b/cups/sidechannel.c index 41db25e67..92aeb9d9b 100644 --- a/cups/sidechannel.c +++ b/cups/sidechannel.c @@ -266,7 +266,7 @@ cupsSideChannelRead( * support SNMP queries. @code CUPS_SC_STATUS_NO_RESPONSE@ is returned when * the printer does not respond to the SNMP query. * - * @since CUPS 1.4@ + * @since CUPS 1.4/Mac OS X 10.6@ */ cups_sc_status_t /* O - Query status */ @@ -358,7 +358,7 @@ cupsSideChannelSNMPGet( * support SNMP queries. @code CUPS_SC_STATUS_NO_RESPONSE@ is returned when * the printer does not respond to the first SNMP query. * - * @since CUPS 1.4@ + * @since CUPS 1.4/Mac OS X 10.6@ */ cups_sc_status_t /* O - Status of first query of @code CUPS_SC_STATUS_OK@ on success */ diff --git a/cups/sidechannel.h b/cups/sidechannel.h index f69259ebe..8242247cb 100644 --- a/cups/sidechannel.h +++ b/cups/sidechannel.h @@ -60,8 +60,8 @@ enum cups_sc_command_e /**** Request command codes ****/ CUPS_SC_CMD_GET_BIDI = 3, /* Return bidirectional capabilities */ CUPS_SC_CMD_GET_DEVICE_ID = 4, /* Return the IEEE-1284 device ID */ CUPS_SC_CMD_GET_STATE = 5, /* Return the device state */ - CUPS_SC_CMD_SNMP_GET = 6, /* Query an SNMP OID @since CUPS 1.4@ */ - CUPS_SC_CMD_SNMP_GET_NEXT = 7 /* Query the next SNMP OID @since CUPS 1.4@ */ + CUPS_SC_CMD_SNMP_GET = 6, /* Query an SNMP OID @since CUPS 1.4/Mac OS X 10.6@ */ + CUPS_SC_CMD_SNMP_GET_NEXT = 7 /* Query the next SNMP OID @since CUPS 1.4/Mac OS X 10.6@ */ }; typedef enum cups_sc_command_e cups_sc_command_t; /**** Request command codes ****/ diff --git a/cups/usersys.c b/cups/usersys.c index be69e2652..48d932703 100644 --- a/cups/usersys.c +++ b/cups/usersys.c @@ -102,7 +102,7 @@ cupsGetPassword(const char *prompt) /* I - Prompt string */ * Uses the current password callback function. Returns @code NULL@ if the * user does not provide a password. * - * @since CUPS 1.4@ + * @since CUPS 1.4/Mac OS X 10.6@ */ const char * /* O - Password */ @@ -184,7 +184,7 @@ cupsSetPasswordCB(cups_password_cb_t cb)/* I - Callback function */ * * Pass @code NULL@ to restore the default (console) password callback. * - * @since CUPS 1.4@ + * @since CUPS 1.4/Mac OS X 10.6@ */ void diff --git a/cups/util.c b/cups/util.c index b3a51af1b..fb815ceed 100644 --- a/cups/util.c +++ b/cups/util.c @@ -112,7 +112,7 @@ cupsCancelJob(const char *name, /* I - Name of printer or class */ * Use the @link cupsLastError@ and @link cupsLastErrorString@ functions to get * the cause of any failure. * - * @since CUPS 1.4@ + * @since CUPS 1.4/Mac OS X 10.6@ */ ipp_status_t /* O - IPP status */ @@ -200,7 +200,7 @@ cupsCancelJob2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_ * print, use the @link cupsPrintFile2@ or @link cupsPrintFiles2@ function * instead. * - * @since CUPS 1.4@ + * @since CUPS 1.4/Mac OS X 10.6@ */ int /* O - Job ID or 0 on error */ @@ -280,7 +280,7 @@ cupsCreateJob( * * The document must have been started using @link cupsStartDocument@. * - * @since CUPS 1.4@ + * @since CUPS 1.4/Mac OS X 10.6@ */ ipp_status_t /* O - Status of document submission */ @@ -882,7 +882,7 @@ cupsGetPPD2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DE * For classes, @code cupsGetPPD3@ returns the PPD file for the first printer * in the class. * - * @since CUPS 1.4@ + * @since CUPS 1.4/Mac OS X 10.6@ */ http_status_t /* O - HTTP status */ @@ -1543,7 +1543,7 @@ cupsPrintFiles2( * @code CUPS_FORMAT_TEXT@ are provided for the "format" argument, although * any supported MIME type string can be supplied. * - * @since CUPS 1.4@ + * @since CUPS 1.4/Mac OS X 10.6@ */ http_status_t /* O - HTTP status of request */ diff --git a/doc/Makefile b/doc/Makefile index f86f11070..78d48756b 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -84,6 +84,7 @@ HELPFILES = \ help/man-lpstat.html \ help/man-mime.convs.html \ help/man-mime.types.html \ + help/man-notifier.html \ help/man-ppdc.html \ help/man-ppdhtml.html \ help/man-ppdi.html \ diff --git a/doc/cups-printable.css b/doc/cups-printable.css index a65dd8355..cc11262fd 100644 --- a/doc/cups-printable.css +++ b/doc/cups-printable.css @@ -32,7 +32,7 @@ PRE.example { background: #eeeeee; border: dotted thin #999999; margin-left: 36pt; - padding: 10px; + padding: 10pt; } PRE.command EM, PRE.example EM { @@ -50,7 +50,7 @@ P.formula { } BLOCKQUOTE { - background: #cccccc; + background: #eeeeee; border: solid thin #999999; padding: 10pt; } @@ -162,6 +162,9 @@ H2 SPAN.info, H3 SPAN.info, H4 SPAN.info { font-size: 100%; } +H1.title { +} + H2.title, H3.title { border-bottom: solid 2pt #000000; } diff --git a/doc/cups.css b/doc/cups.css index a12db9ca8..5b78171af 100644 --- a/doc/cups.css +++ b/doc/cups.css @@ -238,6 +238,10 @@ H2 SPAN.info, H3 SPAN.info, H4 SPAN.info { color: white; } +H1.title { + display: none; +} + H2.title, H3.title { border-bottom: solid 1pt #999999; } diff --git a/doc/help/accounting.html b/doc/help/accounting.html index 5860fe223..fe995956f 100644 --- a/doc/help/accounting.html +++ b/doc/help/accounting.html @@ -2,9 +2,12 @@ Printer Accounting Basics + +

Printer Accounting Basics

+

CUPS supports a variety of printer accounting schemes. Aside from the built-in quota and page logging support, there are several third-party solutions that can be found on diff --git a/doc/help/api-array.html b/doc/help/api-array.html index 95b308006..3ee3a12b4 100644 --- a/doc/help/api-array.html +++ b/doc/help/api-array.html @@ -40,7 +40,7 @@ PRE.example { background: #eeeeee; border: dotted thin #999999; margin-left: 36pt; - padding: 10px; + padding: 10pt; } PRE.command EM, PRE.example EM { @@ -58,7 +58,7 @@ P.formula { } BLOCKQUOTE { - background: #cccccc; + background: #eeeeee; border: solid thin #999999; padding: 10pt; } @@ -170,6 +170,9 @@ H2 SPAN.info, H3 SPAN.info, H4 SPAN.info { font-size: 100%; } +H1.title { +} + H2.title, H3.title { border-bottom: solid 2pt #000000; } @@ -335,11 +338,11 @@ div.contents ul.subcontents li {

+

Array API

+
diff --git a/doc/help/api-cgi.html b/doc/help/api-cgi.html index 756294840..0951f4d7a 100644 --- a/doc/help/api-cgi.html +++ b/doc/help/api-cgi.html @@ -40,7 +40,7 @@ PRE.example { background: #eeeeee; border: dotted thin #999999; margin-left: 36pt; - padding: 10px; + padding: 10pt; } PRE.command EM, PRE.example EM { @@ -58,7 +58,7 @@ P.formula { } BLOCKQUOTE { - background: #cccccc; + background: #eeeeee; border: solid thin #999999; padding: 10pt; } @@ -170,6 +170,9 @@ H2 SPAN.info, H3 SPAN.info, H4 SPAN.info { font-size: 100%; } +H1.title { +} + H2.title, H3.title { border-bottom: solid 2pt #000000; } @@ -334,8 +337,44 @@ div.contents ul.subcontents li {
+ + +

CGI API

+ +
+ + + + + + + + + + + + + + + + +
Headercups/cgi.h
Library-lcupscgi
See AlsoProgramming: Introduction to CUPS Programming

Contents

    +
      +
    • Overview
    • Functions
    • + + +

      Overview

      + +

      The CGI API provides Common Gateway Interface functions for CUPS.

      Functions

      cgiCheckVariables

      Check for the presence of "required" variables.

      diff --git a/doc/help/api-cups.html b/doc/help/api-cups.html index dcfa36fa1..c633e8d02 100644 --- a/doc/help/api-cups.html +++ b/doc/help/api-cups.html @@ -40,7 +40,7 @@ PRE.example { background: #eeeeee; border: dotted thin #999999; margin-left: 36pt; - padding: 10px; + padding: 10pt; } PRE.command EM, PRE.example EM { @@ -58,7 +58,7 @@ P.formula { } BLOCKQUOTE { - background: #cccccc; + background: #eeeeee; border: solid thin #999999; padding: 10pt; } @@ -170,6 +170,9 @@ H2 SPAN.info, H3 SPAN.info, H4 SPAN.info { font-size: 100%; } +H1.title { +} + H2.title, H3.title { border-bottom: solid 2pt #000000; } @@ -335,11 +338,11 @@ div.contents ul.subcontents li {
      +

      CUPS API

      +
      @@ -1085,7 +1090,7 @@ to cancel the current job on the named destination.

      Use the cupsLastError and cupsLastErrorString functions to get the cause of any failure.

      -

       CUPS 1.4 cupsCancelJob2

      +

       CUPS 1.4/Mac OS X 10.6 cupsCancelJob2

      Cancel or purge a print job.

      ipp_status_t cupsCancelJob2 (
      @@ -1118,7 +1123,7 @@ Use the cupsLastError and  CUPS 1.4 cupsCreateJob +

       CUPS 1.4/Mac OS X 10.6 cupsCreateJob

      Create an empty job for streaming.

      int cupsCreateJob (
      @@ -1162,7 +1167,7 @@ http_encryption_t cupsEncryption (void);

      environment variable, then the ~/.cups/client.conf file, and finally the /etc/cups/client.conf file. If not set, the default is HTTP_ENCRYPT_IF_REQUESTED.

      -

       CUPS 1.4 cupsFinishDocument

      +

       CUPS 1.4/Mac OS X 10.6 cupsFinishDocument

      Finish sending a document.

      ipp_status_t cupsFinishDocument (
      @@ -1413,7 +1418,7 @@ pending, processing, or held and CUPS_WHICHJOBS_COMPLETED returns jobs that are stopped, canceled, aborted, or completed.

      -

       CUPS 1.4 cupsGetNamedDest

      +

       CUPS 1.4/Mac OS X 10.6 cupsGetNamedDest

      Get options for the named destination.

      cups_dest_t *cupsGetNamedDest (
      @@ -1511,7 +1516,7 @@ The returned filename is stored in a static buffer and is overwritten with each call to cupsGetPPD or cupsGetPPD2.

      -

       CUPS 1.4 cupsGetPPD3

      +

       CUPS 1.4/Mac OS X 10.6 cupsGetPPD3

      Get the PPD file for a printer on the specified server if it has changed.

      @@ -1570,7 +1575,7 @@ const char *cupsGetPassword (

      Discussion

      Uses the current password callback function. Returns NULL if the user does not provide a password.

      -

       CUPS 1.4 cupsGetPassword2

      +

       CUPS 1.4/Mac OS X 10.6 cupsGetPassword2

      Get a password from the user using the advanced callback.

      @@ -2026,7 +2031,7 @@ void cupsSetPasswordCB (

      Discussion

      Pass NULL to restore the default (console) password callback.

      -

       CUPS 1.4 cupsSetPasswordCB2

      +

       CUPS 1.4/Mac OS X 10.6 cupsSetPasswordCB2

      Set the advanced password callback for CUPS.

      void cupsSetPasswordCB2 (
      @@ -2072,7 +2077,7 @@ void cupsSetUser (

      Discussion

      Pass NULL to restore the default user name.

      -

       CUPS 1.4 cupsStartDocument

      +

       CUPS 1.4/Mac OS X 10.6 cupsStartDocument

      Add a document to a job created with cupsCreateJob().

      http_status_t cupsStartDocument (
      @@ -2184,7 +2189,7 @@ const char *cupsUser (void);

      typedef struct cups_dest_s cups_dest_t;

      -

       CUPS 1.4 cups_device_cb_t

      +

       CUPS 1.4/Mac OS X 10.6 cups_device_cb_t

      Device callback

      typedef void (*cups_device_cb_t)(const char *device_class, const char *device_id, const char *device_info, const char *device_make_and_model, const char *device_uri, const char *device_location, void *user_data); @@ -2199,7 +2204,7 @@ typedef struct cups_job_s cups_job_t;

      typedef struct cups_option_s cups_option_t;

      -

       CUPS 1.4 cups_password_cb2_t

      +

       CUPS 1.4/Mac OS X 10.6 cups_password_cb2_t

      New password callback

      typedef const char *(*cups_password_cb2_t)(const char *prompt, http_t *http, const char *method, const char *resource, void *user_data); @@ -2328,7 +2333,7 @@ typedef unsigned cups_ptype_t;

      Local printer or class
      CUPS_PRINTER_MEDIUM
      Can do Tabloid/B/C/A3/A2
      -
      CUPS_PRINTER_MFP  CUPS 1.4 
      +
      CUPS_PRINTER_MFP  CUPS 1.4/Mac OS X 10.6 
      Printer with scanning capabilities
      CUPS_PRINTER_NOT_SHARED  CUPS 1.2/Mac OS X 10.5 
      Printer is not shared
      @@ -2338,7 +2343,7 @@ typedef unsigned cups_ptype_t;
      Printer is rejecting jobs
      CUPS_PRINTER_REMOTE
      Remote printer or class
      -
      CUPS_PRINTER_SCANNER  CUPS 1.4 
      +
      CUPS_PRINTER_SCANNER  CUPS 1.4/Mac OS X 10.6 
      Scanner-only device
      CUPS_PRINTER_SMALL
      Can do Letter/Legal/A4
      diff --git a/doc/help/api-driver.html b/doc/help/api-driver.html index 7278a8038..7f73c547c 100644 --- a/doc/help/api-driver.html +++ b/doc/help/api-driver.html @@ -40,7 +40,7 @@ PRE.example { background: #eeeeee; border: dotted thin #999999; margin-left: 36pt; - padding: 10px; + padding: 10pt; } PRE.command EM, PRE.example EM { @@ -58,7 +58,7 @@ P.formula { } BLOCKQUOTE { - background: #cccccc; + background: #eeeeee; border: solid thin #999999; padding: 10pt; } @@ -170,6 +170,9 @@ H2 SPAN.info, H3 SPAN.info, H4 SPAN.info { font-size: 100%; } +H1.title { +} + H2.title, H3.title { border-bottom: solid 2pt #000000; } @@ -334,8 +337,44 @@ div.contents ul.subcontents li {
      + + +

      Driver API

      + +
      + + + + + + + + + + + + + + + + +
      Headercups/driver.h
      Library-lcupsdriver
      See AlsoProgramming: Introduction to CUPS Programming

      Contents

        +
          +
        • Overview
        • Functions
        • + + +

          Overview

          + +

          The driver API provides common dithering, color conversion, and utility +functions for CUPS drivers.

          Functions

          cupsCMYKDelete

          Delete a color separation.

          diff --git a/doc/help/api-filedir.html b/doc/help/api-filedir.html index a91c7d273..a3e625db9 100644 --- a/doc/help/api-filedir.html +++ b/doc/help/api-filedir.html @@ -40,7 +40,7 @@ PRE.example { background: #eeeeee; border: dotted thin #999999; margin-left: 36pt; - padding: 10px; + padding: 10pt; } PRE.command EM, PRE.example EM { @@ -58,7 +58,7 @@ P.formula { } BLOCKQUOTE { - background: #cccccc; + background: #eeeeee; border: solid thin #999999; padding: 10pt; } @@ -170,6 +170,9 @@ H2 SPAN.info, H3 SPAN.info, H4 SPAN.info { font-size: 100%; } +H1.title { +} + H2.title, H3.title { border-bottom: solid 2pt #000000; } @@ -335,11 +338,11 @@ div.contents ul.subcontents li {
          +

          File and Directory APIs

          +
          @@ -797,7 +802,7 @@ int cupsFilePutChar (

          Return Value

          0 on success, -1 on error

          -

           CUPS 1.4 cupsFilePutConf

          +

           CUPS 1.4/Mac OS X 10.6 cupsFilePutConf

          Write a configuration line.

          ssize_t cupsFilePutConf (
          diff --git a/doc/help/api-filter.html b/doc/help/api-filter.html index 29347b08a..e7686298e 100644 --- a/doc/help/api-filter.html +++ b/doc/help/api-filter.html @@ -40,7 +40,7 @@ PRE.example { background: #eeeeee; border: dotted thin #999999; margin-left: 36pt; - padding: 10px; + padding: 10pt; } PRE.command EM, PRE.example EM { @@ -58,7 +58,7 @@ P.formula { } BLOCKQUOTE { - background: #cccccc; + background: #eeeeee; border: solid thin #999999; padding: 10pt; } @@ -170,6 +170,9 @@ H2 SPAN.info, H3 SPAN.info, H4 SPAN.info { font-size: 100%; } +H1.title { +} + H2.title, H3.title { border-bottom: solid 2pt #000000; } @@ -335,12 +338,12 @@ div.contents ul.subcontents li {

          +

          Filter and Backend Programming

          +
          @@ -377,6 +382,7 @@ div.contents ul.subcontents li {
          • Overview
            • Security Considerations
            • +
            • File Permissions
            • Temporary Files
            • Copy Generation
            • Exit Codes
            • @@ -418,7 +424,7 @@ div.contents ul.subcontents li { Filter and backend programming introduction for the Common UNIX Printing System (CUPS). - Copyright 2007-2008 by Apple Inc. + Copyright 2007-2009 by Apple Inc. Copyright 1997-2006 by Easy Software Products, all rights reserved. These coded instructions, statements, and computer programs are the @@ -463,6 +469,12 @@ the remaining filters read from the standard input and write to the standard output. The backend is the last filter in the chain and writes to the device.

              +

              Filters are always run as a non-privileged user, typically "lp", with no +connection to the user's desktop. Backends are run either as a non-privileged +user or as root if the file permissions do not allow user or group execution. +The file permissions section talks about this in +more detail.

              +

              Security Considerations

              It is always important to use security programming practices. Filters and @@ -475,7 +487,7 @@ specify an arbitrary file path to a separator page, template, or other file used by the filter since that can lead to an unauthorized disclosure of information. Always treat input as suspect and validate it!

              -

              If you are developing a backend that runs as root, make sure to check for +

              If you are developing a backend that runs as root , make sure to check for potential buffer overflows, integer under/overflow conditions, and file accesses since these can lead to privilege escalations. When writing files, always validate the file path and never allow a user to determine @@ -489,10 +501,23 @@ user may not be the same as the local user and/or there may not be a local home directory to write to.

              In addition, some operating systems provide additional security mechanisms -that further limit file system access, even for backends running as root. On +that further limit file system access, even for backends running as root. On Mac OS X, for example, no backend may write to a user's home directory.

              +

              File Permissions

              + +

              For security reasons, CUPS will only run filters and backends that are owned +by root and do not have world write permissions. The recommended permissions for +filters and backends are 0555 - read and execute but no write. Backends that +must run as root should use permissions of 0500 - read and execute by root, no +access for other users. Write permissions can be enabled for the root user +only.

              + +

              To avoid a warning message, the directory containing your filter(s) must also +be owned by root and have world write disabled - permissions of 0755 or 0555 are +strongly encouraged.

              +

              Temporary Files

              Temporary files should be created in the directory specified by the @@ -1042,7 +1067,7 @@ variable or the device URI passed in argv[0], whichever is found first.

              -

               CUPS 1.4 cupsBackendReport

              +

               CUPS 1.4/Mac OS X 10.6 cupsBackendReport

              Write a device line from a backend.

              void cupsBackendReport (
              @@ -1144,7 +1169,7 @@ pointed to by the "data" parameter. cupsSideChannelDoRequest() will update the value to contain the number of data bytes in the buffer.

              -

               CUPS 1.4 cupsSideChannelSNMPGet

              +

               CUPS 1.4/Mac OS X 10.6 cupsSideChannelSNMPGet

              Query a SNMP OID's value.

              cups_sc_status_t cupsSideChannelSNMPGet (
              @@ -1185,7 +1210,7 @@ support SNMP queries. CUPS_SC_STATUS_NO_RESPONSE is returned when the printer does not respond to the SNMP query.

              -

               CUPS 1.4 cupsSideChannelSNMPWalk

              +

               CUPS 1.4/Mac OS X 10.6 cupsSideChannelSNMPWalk

              Query multiple SNMP OID values.

              cups_sc_status_t cupsSideChannelSNMPWalk (
              @@ -1331,9 +1356,9 @@ typedef void (*cups_sc_walk_func_t)(const char *oid, const char *data, int datal

              Return the IEEE-1284 device ID
              CUPS_SC_CMD_GET_STATE
              Return the device state
              -
              CUPS_SC_CMD_SNMP_GET  CUPS 1.4 
              +
              CUPS_SC_CMD_SNMP_GET  CUPS 1.4/Mac OS X 10.6 
              Query an SNMP OID
              -
              CUPS_SC_CMD_SNMP_GET_NEXT  CUPS 1.4 
              +
              CUPS_SC_CMD_SNMP_GET_NEXT  CUPS 1.4/Mac OS X 10.6 
              Query the next SNMP OID
              CUPS_SC_CMD_SOFT_RESET
              Do a soft reset
              diff --git a/doc/help/api-httpipp.html b/doc/help/api-httpipp.html index 444fe5870..9b3096b59 100644 --- a/doc/help/api-httpipp.html +++ b/doc/help/api-httpipp.html @@ -40,7 +40,7 @@ PRE.example { background: #eeeeee; border: dotted thin #999999; margin-left: 36pt; - padding: 10px; + padding: 10pt; } PRE.command EM, PRE.example EM { @@ -58,7 +58,7 @@ P.formula { } BLOCKQUOTE { - background: #cccccc; + background: #eeeeee; border: solid thin #999999; padding: 10pt; } @@ -170,6 +170,9 @@ H2 SPAN.info, H3 SPAN.info, H4 SPAN.info { font-size: 100%; } +H1.title { +} + H2.title, H3.title { border-bottom: solid 2pt #000000; } @@ -335,11 +338,11 @@ div.contents ul.subcontents li {
              +

              HTTP and IPP APIs

              +
          @@ -1063,7 +1068,7 @@ function multiple times for each group, or use cupsEncodeOptions() to add the standard groups.

          -

           CUPS 1.4 cupsGetDevices

          +

           CUPS 1.4/Mac OS X 10.6 cupsGetDevices

          Get available printer devices.

          ipp_status_t cupsGetDevices (
          @@ -1145,7 +1150,7 @@ the request respectively.

          This function returns HTTP_OK when the file is successfully retrieved.

          -

           CUPS 1.4 cupsGetResponse

          +

           CUPS 1.4/Mac OS X 10.6 cupsGetResponse

          Get a response to an IPP request.

          ipp_t *cupsGetResponse (
          @@ -1215,7 +1220,7 @@ successfully. successfully.

          -

           CUPS 1.4 cupsReadResponseData

          +

           CUPS 1.4/Mac OS X 10.6 cupsReadResponseData

          Read additional data after the IPP response.

          ssize_t cupsReadResponseData (
          @@ -1239,7 +1244,7 @@ ssize_t cupsReadResponseData (
          files for CUPS_GET_PPD and CUPS_GET_DOCUMENT requests, respectively.

          -

           CUPS 1.4 cupsSendRequest

          +

           CUPS 1.4/Mac OS X 10.6 cupsSendRequest

          Send an IPP request.

          http_status_t cupsSendRequest (
          @@ -1271,7 +1276,7 @@ Unlike cupsDoFileRequest(), cupsDoIORequest(), and cupsDoRequest(), the request is not freed.

          -

           CUPS 1.4 cupsWriteRequestData

          +

           CUPS 1.4/Mac OS X 10.6 cupsWriteRequestData

          Write additional data after an IPP request.

          http_status_t cupsWriteRequestData (
          @@ -3136,7 +3141,7 @@ void ippSetPort (

          p
          Port number to use
          -

           CUPS 1.4 ippTagString

          +

           CUPS 1.4/Mac OS X 10.6 ippTagString

          Return the tag name corresponding to a tag value.

          const char *ippTagString (
          @@ -3153,7 +3158,7 @@ const char *ippTagString (

          The returned names are defined in RFC 2911 and 3382.

          -

           CUPS 1.4 ippTagValue

          +

           CUPS 1.4/Mac OS X 10.6 ippTagValue

          Return the tag value corresponding to a tag name.

          ipp_tag_t ippTagValue (
          @@ -3882,7 +3887,7 @@ are server-oriented...

          Get the default printer
          CUPS_GET_DEVICES
          Get a list of supported devices
          -
          CUPS_GET_DOCUMENT  CUPS 1.4 
          +
          CUPS_GET_DOCUMENT  CUPS 1.4/Mac OS X 10.6 
          Get a document file
          CUPS_GET_PPD  CUPS 1.3/Mac OS X 10.5 
          Get a PPD file
          diff --git a/doc/help/api-mime.html b/doc/help/api-mime.html index 7d759781f..476916f57 100644 --- a/doc/help/api-mime.html +++ b/doc/help/api-mime.html @@ -40,7 +40,7 @@ PRE.example { background: #eeeeee; border: dotted thin #999999; margin-left: 36pt; - padding: 10px; + padding: 10pt; } PRE.command EM, PRE.example EM { @@ -58,7 +58,7 @@ P.formula { } BLOCKQUOTE { - background: #cccccc; + background: #eeeeee; border: solid thin #999999; padding: 10pt; } @@ -170,6 +170,9 @@ H2 SPAN.info, H3 SPAN.info, H4 SPAN.info { font-size: 100%; } +H1.title { +} + H2.title, H3.title { border-bottom: solid 2pt #000000; } @@ -334,8 +337,44 @@ div.contents ul.subcontents li {
          + + +

          MIME API

          + +
          + + + + + + + + + + + + + + + + +
          Headercups/mime.h
          Library-lcupsmime
          See AlsoProgramming: Introduction to CUPS Programming

          Contents

            +
              +
            • Overview
            • Functions
            • + + +

              Overview

              + +

              The MIME API provides file typing and conversion services for CUPS.

              Functions

              mimeAddFilter

              Add a filter to the current MIME database.

              diff --git a/doc/help/api-overview.html b/doc/help/api-overview.html index b6e07808c..8db93b456 100644 --- a/doc/help/api-overview.html +++ b/doc/help/api-overview.html @@ -40,7 +40,7 @@ PRE.example { background: #eeeeee; border: dotted thin #999999; margin-left: 36pt; - padding: 10px; + padding: 10pt; } PRE.command EM, PRE.example EM { @@ -58,7 +58,7 @@ P.formula { } BLOCKQUOTE { - background: #cccccc; + background: #eeeeee; border: solid thin #999999; padding: 10pt; } @@ -170,6 +170,9 @@ H2 SPAN.info, H3 SPAN.info, H4 SPAN.info { font-size: 100%; } +H1.title { +} + H2.title, H3.title { border-bottom: solid 2pt #000000; } @@ -340,7 +343,7 @@ div.contents ul.subcontents li { Introduction to CUPS programming header for the Common UNIX Printing System (CUPS). - Copyright 2008 by Apple Inc. + Copyright 2008-2009 by Apple Inc. These coded instructions, statements, and computer programs are the property of Apple Inc. and are protected by Federal copyright @@ -349,6 +352,8 @@ div.contents ul.subcontents li { file is missing or damaged, see the license at "http://www.cups.org/". --> +

              Introduction to CUPS Programming

              +
              diff --git a/doc/help/api-ppd.html b/doc/help/api-ppd.html index 56cd2abd0..db8433006 100644 --- a/doc/help/api-ppd.html +++ b/doc/help/api-ppd.html @@ -40,7 +40,7 @@ PRE.example { background: #eeeeee; border: dotted thin #999999; margin-left: 36pt; - padding: 10px; + padding: 10pt; } PRE.command EM, PRE.example EM { @@ -58,7 +58,7 @@ P.formula { } BLOCKQUOTE { - background: #cccccc; + background: #eeeeee; border: solid thin #999999; padding: 10pt; } @@ -170,6 +170,9 @@ H2 SPAN.info, H3 SPAN.info, H4 SPAN.info { font-size: 100%; } +H1.title { +} + H2.title, H3.title { border-bottom: solid 2pt #000000; } @@ -335,11 +338,11 @@ div.contents ul.subcontents li {
              +

              PPD API

              +
              @@ -694,7 +699,7 @@ for (attr = ppdFindAttr(ppd, "Product", NULL); puts(attr->value);

              Functions

              -

               CUPS 1.4 cupsGetConflicts

              +

               CUPS 1.4/Mac OS X 10.6 cupsGetConflicts

              Get a list of conflicting options in a marked PPD.

              int cupsGetConflicts (
              @@ -750,7 +755,7 @@ int cupsMarkOptions (

              This function maps the IPP "finishings", "media", "mirror", "multiple-document-handling", "output-bin", "printer-resolution", and "sides" attributes to their corresponding PPD options and choices.

              -

               CUPS 1.4 cupsResolveConflicts

              +

               CUPS 1.4/Mac OS X 10.6 cupsResolveConflicts

              Resolve conflicts in a marked PPD.

              int cupsResolveConflicts (
              @@ -1187,7 +1192,7 @@ const char *ppdErrorString (

              Options are returned from all groups in ascending alphanumeric order.

              -

               CUPS 1.4 ppdInstallableConflict

              +

               CUPS 1.4/Mac OS X 10.6 ppdInstallableConflict

              Test whether an option choice conflicts with an installable option.

              @@ -1321,7 +1326,7 @@ string or attribute value. Otherwise the corresponding URI is returned.
              If no value of the requested scheme can be found, NULL is returned.

              -

               CUPS 1.4 ppdLocalizeMarkerName

              +

               CUPS 1.4/Mac OS X 10.6 ppdLocalizeMarkerName

              Get the localized version of a marker-names attribute value.

              @@ -1489,7 +1494,7 @@ float ppdPageLength (

              Return Value

              Size record for page or NULL

              -

               CUPS 1.4 ppdPageSizeLimits

              +

               CUPS 1.4/Mac OS X 10.6 ppdPageSizeLimits

              Return the custom page size limits.

              int ppdPageSizeLimits (
              diff --git a/doc/help/api-ppdc.html b/doc/help/api-ppdc.html index 335626929..941e7033a 100644 --- a/doc/help/api-ppdc.html +++ b/doc/help/api-ppdc.html @@ -40,7 +40,7 @@ PRE.example { background: #eeeeee; border: dotted thin #999999; margin-left: 36pt; - padding: 10px; + padding: 10pt; } PRE.command EM, PRE.example EM { @@ -58,7 +58,7 @@ P.formula { } BLOCKQUOTE { - background: #cccccc; + background: #eeeeee; border: solid thin #999999; padding: 10pt; } @@ -170,6 +170,9 @@ H2 SPAN.info, H3 SPAN.info, H4 SPAN.info { font-size: 100%; } +H1.title { +} + H2.title, H3.title { border-bottom: solid 2pt #000000; } @@ -334,8 +337,44 @@ div.contents ul.subcontents li {

              + + +

              PPD Compiler API

              + +
              + + + + + + + + + + + + + + + + +
              Headercups/ppdc.h
              Library-lcupsppdc
              See AlsoProgramming: Introduction to CUPS Programming

              Contents

                +
                  +
                • Overview
                • Classes
                • + + +

                  Overview

                  + +

                  The PPD Compiler API provides access to CUPS driver information files and +methods for generating and importing PPD files.

                  Classes

                  ppdcArray

                  // Shared Array

                  diff --git a/doc/help/api-raster.html b/doc/help/api-raster.html index 67d3920de..93c816b88 100644 --- a/doc/help/api-raster.html +++ b/doc/help/api-raster.html @@ -40,7 +40,7 @@ PRE.example { background: #eeeeee; border: dotted thin #999999; margin-left: 36pt; - padding: 10px; + padding: 10pt; } PRE.command EM, PRE.example EM { @@ -58,7 +58,7 @@ P.formula { } BLOCKQUOTE { - background: #cccccc; + background: #eeeeee; border: solid thin #999999; padding: 10pt; } @@ -170,6 +170,9 @@ H2 SPAN.info, H3 SPAN.info, H4 SPAN.info { font-size: 100%; } +H1.title { +} + H2.title, H3.title { border-bottom: solid 2pt #000000; } @@ -339,7 +342,7 @@ div.contents ul.subcontents li { Raster API header for the Common UNIX Printing System (CUPS). - Copyright 2008 by Apple Inc. + Copyright 2008-2009 by Apple Inc. These coded instructions, statements, and computer programs are the property of Apple Inc. and are protected by Federal copyright @@ -348,6 +351,8 @@ div.contents ul.subcontents li { file is missing or damaged, see the license at "http://www.cups.org/". --> +

                  Raster API

                  +
                  diff --git a/doc/help/cgi.html b/doc/help/cgi.html index b96084e00..c50a2a501 100644 --- a/doc/help/cgi.html +++ b/doc/help/cgi.html @@ -2,9 +2,12 @@ Using CGI Programs + +

                  Using CGI Programs

                  +

                  CUPS provides a dynamic web interface through dedicated CGI programs that are executed when users open special directories on the CUPS server. Each CGI performs administration, class, help, job, and printer functions as directed by diff --git a/doc/help/glossary.html b/doc/help/glossary.html index dea7a73cc..c6898dc7d 100644 --- a/doc/help/glossary.html +++ b/doc/help/glossary.html @@ -2,9 +2,12 @@ Glossary + +

                  Glossary

                  +

                  A

                  diff --git a/doc/help/kerberos.html b/doc/help/kerberos.html index d30758118..dbac3f14f 100644 --- a/doc/help/kerberos.html +++ b/doc/help/kerberos.html @@ -2,9 +2,12 @@ Using Kerberos Authentication + +

                  Using Kerberos Authentication

                  +

                  CUPS allows you to use a Key Distribution Center (KDC) for authentication on your local CUPS server and when printing to a remote authenticated queue. This document describes how to configure CUPS to use Kerberos authentication diff --git a/doc/help/license.html b/doc/help/license.html index 53cfb5d01..a86babdd5 100644 --- a/doc/help/license.html +++ b/doc/help/license.html @@ -2,9 +2,12 @@ Software License Agreement + +

                  Software License Agreement

                  +

                  Copyright 2007-2009 by Apple Inc.
                  1 Infinite Loop
                  Cupertino, CA 95014 USA
                  diff --git a/doc/help/network.html b/doc/help/network.html index 58c078411..6b2381088 100644 --- a/doc/help/network.html +++ b/doc/help/network.html @@ -2,9 +2,12 @@ Using Network Printers + +

                  Using Network Printers

                  +

                  This help document describes how to discover, configure, and use TCP/IP network printers with CUPS.

                  Getting the IP Address

                  diff --git a/doc/help/options.html b/doc/help/options.html index f32e1b9dd..e3b5820be 100644 --- a/doc/help/options.html +++ b/doc/help/options.html @@ -2,9 +2,12 @@ Command-Line Printing and Options + +

                  Command-Line Printing and Options

                  +

                  CUPS provides both the System V (lp(1)) and Berkeley (lpr(1)) printing commands for printing diff --git a/doc/help/overview.html b/doc/help/overview.html index 946fadb3d..59a2ac067 100644 --- a/doc/help/overview.html +++ b/doc/help/overview.html @@ -2,9 +2,12 @@ Overview of CUPS + +

                  Overview of CUPS

                  +

                  CUPS is the software you use to print from applications like the web browser you are using to read this page. It converts the page descriptions produced by your application (put a paragraph here, draw a line there, and so @@ -44,8 +47,9 @@ different ways.

                  Where Do I Begin?

                  -

                  Click on the Administration tab at the top of this page. -Click on the Add Printer button and follow the prompts.

                  +

                  Click on the Administration tab at +the top of this page. Click on the Add Printer button and follow the +prompts.

                  When you are asked for a username and password, enter your login username and password or the "root" username and password. On MacOS X, the login @@ -56,7 +60,7 @@ lowercase.
                  options (paper size, output mode, etc.) for the printer. Make any changes as needed and then click on the Set Default Options button to save them. Some printers also support auto-configuration - click on the Query -Printer for Default Options button to update the options automaticaly.

                  +Printer for Default Options button to update the options automatically.

                  Once you have added the printer, you can print to it from any application. You can also choose Print Test Page from the maintenance menu to print diff --git a/doc/help/policies.html b/doc/help/policies.html index 37ab489ef..485a85705 100644 --- a/doc/help/policies.html +++ b/doc/help/policies.html @@ -2,9 +2,12 @@ Managing Operation Policies + +

                  Managing Operation Policies

                  +

                  Operation policies are the rules used for each IPP operation in CUPS. These rules include things like "user must provide a password", "user must be in the system group", "allow only from diff --git a/doc/help/postscript-driver.html b/doc/help/postscript-driver.html index adc182816..c6ec8b2e1 100644 --- a/doc/help/postscript-driver.html +++ b/doc/help/postscript-driver.html @@ -40,7 +40,7 @@ PRE.example { background: #eeeeee; border: dotted thin #999999; margin-left: 36pt; - padding: 10px; + padding: 10pt; } PRE.command EM, PRE.example EM { @@ -58,7 +58,7 @@ P.formula { } BLOCKQUOTE { - background: #cccccc; + background: #eeeeee; border: solid thin #999999; padding: 10pt; } @@ -170,6 +170,9 @@ H2 SPAN.info, H3 SPAN.info, H4 SPAN.info { font-size: 100%; } +H1.title { +} + H2.title, H3.title { border-bottom: solid 2pt #000000; } @@ -334,7 +337,9 @@ div.contents ul.subcontents li {

                  -

                  This document describes how to develop printer drivers for PostScript printers. Topics include: printer driver basics, creating new PPD files, importing existing PPD files, using custom filters, implementing color management, adding Mac OS X features, and deploying your driver.

                  +

                  Developing PostScript Printer Drivers

                  + +

                  This document describes how to develop printer drivers for PostScript printers. Topics include: printer driver basics, creating new PPD files, importing existing PPD files, using custom filters, implementing color management, and adding Mac OS X features.

                  @@ -359,7 +364,6 @@ div.contents ul.subcontents li {
                • Using Custom Filters
                • Implementing Color Management
                • Adding Mac OS X Features
                • -
                • Deploying Your Driver
                • Printer Driver Basics

                  A CUPS PostScript printer driver consists of a PostScript Printer Description (PPD) file that describes the features and capabilities of the device, zero or more filter programs that prepare print data for the device, and zero or more support files for color management, online help, and so forth. The PPD file includes references to all of the filters and support files used by the driver.

                  @@ -610,17 +614,32 @@ information file.

                  Implementing Color Management

                  -

                  Talk about ICC color profiles and sRGB as two best options.

                  +

                  CUPS uses ICC color profiles to provide more accurate color reproduction. The cupsICCProfile attribute defines the color profiles that are available for a given printer, for example:

                  +
                  +Attribute cupsICCProfile "ColorModel.MediaType.Resolution/Description" /path/to/ICC/profile
                  +
                  -

                  Adding Mac OS X Features

                  +

                  where "ColorModel.MediaType.Resolution" defines a selector based on the corresponding option selections. A simple driver might only define profiles for the color models that are supported, for example a printer supporting Gray and RGB might use:

                  + +
                  +Attribute cupsICCProfile "Gray../Grayscale Profile" /path/to/ICC/gray-profile
                  +Attribute cupsICCProfile "RGB../Full Color Profile" /path/to/ICC/rgb-profile
                  +
                  -

                  Talk about help books, icons, and PDEs.

                  +

                  The options used for profile selection can be customized using the cupsICCQualifier2 and cupsICCQualifier3 attributes.

                  -

                  Deploying Your Driver

                  +

                  Adding Mac OS X Features

                  + +

                  Mac OS X printer drivers can provide additional attributes to specify additional option panes in the print dialog, an image of the printer, a help book, and option presets for the driver software:

                  -

                  Talk about install locations, etc.

                  +
                  +Attribute APDialogExtension "" /Library/Printers/Vendor/filename.plugin
                  +Attribute APHelpBook "" /Library/Printers/Vendor/filename.bundle
                  +Attribute APPrinterIconPath "" /Library/Printers/Vendor/filename.icns
                  +Attribute APPrinterPreset "name/text" "*option choice ..."
                  +
                  diff --git a/doc/help/ppd-compiler.html b/doc/help/ppd-compiler.html index 3c29567d8..6c5ddd23b 100644 --- a/doc/help/ppd-compiler.html +++ b/doc/help/ppd-compiler.html @@ -40,7 +40,7 @@ PRE.example { background: #eeeeee; border: dotted thin #999999; margin-left: 36pt; - padding: 10px; + padding: 10pt; } PRE.command EM, PRE.example EM { @@ -58,7 +58,7 @@ P.formula { } BLOCKQUOTE { - background: #cccccc; + background: #eeeeee; border: solid thin #999999; padding: 10pt; } @@ -170,6 +170,9 @@ H2 SPAN.info, H3 SPAN.info, H4 SPAN.info { font-size: 100%; } +H1.title { +} + H2.title, H3.title { border-bottom: solid 2pt #000000; } @@ -334,6 +337,8 @@ div.contents ul.subcontents li {
                  +

                  Introduction to the PPD Compiler

                  +

                  This document describes how to use the CUPS PostScript Printer Description (PPD) file compiler. The PPD compiler generates PPD files from simple text files that describe the features and capabilities of one or more printers.

                  diff --git a/doc/help/raster-driver.html b/doc/help/raster-driver.html index 94aab64c4..9d0c89e4e 100644 --- a/doc/help/raster-driver.html +++ b/doc/help/raster-driver.html @@ -40,7 +40,7 @@ PRE.example { background: #eeeeee; border: dotted thin #999999; margin-left: 36pt; - padding: 10px; + padding: 10pt; } PRE.command EM, PRE.example EM { @@ -58,7 +58,7 @@ P.formula { } BLOCKQUOTE { - background: #cccccc; + background: #eeeeee; border: solid thin #999999; padding: 10pt; } @@ -170,6 +170,9 @@ H2 SPAN.info, H3 SPAN.info, H4 SPAN.info { font-size: 100%; } +H1.title { +} + H2.title, H3.title { border-bottom: solid 2pt #000000; } @@ -334,7 +337,9 @@ div.contents ul.subcontents li {
                  -

                  This document describes how to develop printer drivers for raster printers. Topics include: printer driver basics, creating new PPD files, using filters, implementing color management, adding Mac OS X features, and deploying your driver.

                  +

                  Developing Raster Printer Drivers

                  + +

                  This document describes how to develop printer drivers for raster printers. Topics include: printer driver basics, creating new PPD files, using filters, implementing color management, and adding Mac OS X features.

                  @@ -357,7 +362,6 @@ div.contents ul.subcontents li {
                • Using Filters
                • Implementing Color Management
                • Adding Mac OS X Features
                • -
                • Deploying Your Driver
                • Printer Driver Basics

                  A CUPS raster printer driver consists of a PostScript Printer Description (PPD) file that describes the features and capabilities of the device, one or more filter programs that prepare print data for the device, and zero or more support files for color management, online help, and so forth. The PPD file includes references to all of the filters and support files used by the driver.

                  @@ -517,17 +521,41 @@ div.contents ul.subcontents li {

                  Implementing Color Management

                  -

                  Talk about ICC color profiles and sRGB as two best options.

                  +

                  CUPS uses ICC color profiles to provide more accurate color reproduction. The cupsICCProfile attribute defines the color profiles that are available for a given printer, for example:

                  +
                  +Attribute cupsICCProfile "ColorModel.MediaType.Resolution/Description" /path/to/ICC/profile
                  +
                  -

                  Adding Mac OS X Features

                  +

                  where "ColorModel.MediaType.Resolution" defines a selector based on the corresponding option selections. A simple driver might only define profiles for the color models that are supported, for example a printer supporting Gray and RGB might use:

                  + +
                  +Attribute cupsICCProfile "Gray../Grayscale Profile" /path/to/ICC/gray-profile
                  +Attribute cupsICCProfile "RGB../Full Color Profile" /path/to/ICC/rgb-profile
                  +
                  + +

                  The options used for profile selection can be customized using the cupsICCQualifier2 and cupsICCQualifier3 attributes.

                  -

                  Talk about help books, icons, and PDEs.

                  +

                  Since Mac OS X 10.5Custom Color Matching Support

                  +

                  Mac OS X printer drivers that are based on an existing standard RGB colorspace can tell the system to use the corresponding colorspace instead of an arbitrary ICC color profile when doing color management. The APSupportsCustomColorMatching and APDefaultCustomColorMatchingProfile attributes can be used to enable this mode:

                  + +
                  +Attribute APSupportsCustomColorMatching "" true
                  +Attribute APDefaultCustomColorMatchingProfile "" sRGB
                  +
                  -

                  Deploying Your Driver

                  -

                  Talk about install locations, etc.

                  +

                  Adding Mac OS X Features

                  + +

                  Mac OS X printer drivers can provide additional attributes to specify additional option panes in the print dialog, an image of the printer, a help book, and option presets for the driver software:

                  + +
                  +Attribute APDialogExtension "" /Library/Printers/Vendor/filename.plugin
                  +Attribute APHelpBook "" /Library/Printers/Vendor/filename.bundle
                  +Attribute APPrinterIconPath "" /Library/Printers/Vendor/filename.icns
                  +Attribute APPrinterPreset "name/text" "*option choice ..."
                  +
                  diff --git a/doc/help/ref-access_log.html b/doc/help/ref-access_log.html index 5ed47821b..015ea17bd 100644 --- a/doc/help/ref-access_log.html +++ b/doc/help/ref-access_log.html @@ -2,9 +2,12 @@ access_log + +

                  access_log

                  +

                  The access_log file lists each HTTP resource that is accessed by a web browser or client. Each line is in an extended version of the so-called "Common Log Format" used by diff --git a/doc/help/ref-classes-conf.html b/doc/help/ref-classes-conf.html index 7b1e6cacd..9224c5a60 100644 --- a/doc/help/ref-classes-conf.html +++ b/doc/help/ref-classes-conf.html @@ -2,9 +2,12 @@ classes.conf + +

                  classes.conf

                  +

                  The CUPS scheduler (cupsd) uses the /etc/cups/classes.conf file to store the list of available classes. This file contains only locally defined diff --git a/doc/help/ref-client-conf.html b/doc/help/ref-client-conf.html index 90207ba72..0229b0040 100644 --- a/doc/help/ref-client-conf.html +++ b/doc/help/ref-client-conf.html @@ -2,9 +2,12 @@ client.conf + +

                  client.conf

                  +

                  The /etc/cups/client.conf and ~/.cups/client.conf files contain up to two directives that determine how the client behaves. Each directive is listed diff --git a/doc/help/ref-cupsd-conf.html.in b/doc/help/ref-cupsd-conf.html.in index 64029b94c..b22d3a304 100644 --- a/doc/help/ref-cupsd-conf.html.in +++ b/doc/help/ref-cupsd-conf.html.in @@ -2,9 +2,11 @@ cupsd.conf + +

                  cupsd.conf

                  The /etc/cups/cupsd.conf file contains configuration directives that control how the server @@ -1964,6 +1966,24 @@ Directives inside /printers will override ones from

                  +

                  LogDebugHistory

                  + +

                  Examples

                  + +
                  +LogDebugHistory 0
                  +LogDebugHistory 200
                  +
                  + +

                  Description

                  + +

                  When LogLevel is not set to +debug or debug2, the LogDebugHistory +directive specifies the number of debugging messages that are logged when an +error occurs during printing. The default is 200 messages. A value of 0 +disables debugging history entirely and is not recommended.

                  + +

                  CUPS 1.1.15LogFilePerm

                  Examples

                  @@ -2712,6 +2732,37 @@ administrator email address is root@server, where HREF="#ServerName">ServerName.

                  +

                  CUPS 1.3.10ServerAlias

                  + +

                  Examples

                  + +
                  +ServerAlias althost
                  +ServerAlias althost.foo.com
                  +ServerAlias althost.bar.com
                  +ServerAlias *
                  +
                  + +

                  Description

                  + +

                  The ServerAlias directive specifies alternate names that the +server is known by. By default it contains a list of all aliases associated +with the ServerName. The special name +"*" can be used to allow any hostname when accessing CUPS via an external +network interfaces.

                  + +
                  Note + +

                  The ServerAlias directive is used for HTTP Host header +validation when clients connect to the scheduler from external interfaces. +Using the special name "*" can expose your system to known browser-based +DNS rebinding attacks, even when accessing sites through a firewall. If the +auto-discovery of alternate names does not work, we recommend listing each +alternate name with a ServerAlias directive instead of using "*".

                  + +
                  + +

                  ServerBin

                  Examples

                  diff --git a/doc/help/ref-error_log.html b/doc/help/ref-error_log.html index e40987f19..010927802 100644 --- a/doc/help/ref-error_log.html +++ b/doc/help/ref-error_log.html @@ -2,9 +2,12 @@ error_log + +

                  error_log

                  +

                  The error_log file lists messages from the scheduler - errors, warnings, etc. The LogLevel diff --git a/doc/help/ref-mailto-conf.html b/doc/help/ref-mailto-conf.html index 031700df9..16e8b409a 100644 --- a/doc/help/ref-mailto-conf.html +++ b/doc/help/ref-mailto-conf.html @@ -2,9 +2,12 @@ mailto.conf + +

                  mailto.conf

                  +

                  The /etc/cups/mailto.conf file contains several directives that defines the local mail server and email notification preferences for CUPS. Each directive is listed on a diff --git a/doc/help/ref-page_log.html b/doc/help/ref-page_log.html index fa2bd1dc1..a0ec7a0e2 100644 --- a/doc/help/ref-page_log.html +++ b/doc/help/ref-page_log.html @@ -2,9 +2,12 @@ page_log + +

                  page_log

                  +

                  The page_log file lists each page that is sent to a printer. By default, each line contains the following information:

                  diff --git a/doc/help/ref-ppdcfile.html b/doc/help/ref-ppdcfile.html index 4549586b6..a4fa56c9d 100644 --- a/doc/help/ref-ppdcfile.html +++ b/doc/help/ref-ppdcfile.html @@ -2,9 +2,12 @@ PPD Compiler Driver Information File Reference + +

                  PPD Compiler Driver Information File Reference

                  +

                  The CUPS PPD compiler reads meta files that contain descriptions of one or more PPD files to be generated by ppdc(1) or the corresponding driver interface diff --git a/doc/help/ref-printers-conf.html b/doc/help/ref-printers-conf.html index e3fb07840..3539f8cfe 100644 --- a/doc/help/ref-printers-conf.html +++ b/doc/help/ref-printers-conf.html @@ -2,9 +2,12 @@ printers.conf + +

                  printers.conf

                  +

                  The CUPS scheduler (cupsd) uses the /etc/cups/printers.conf file to store the list of available printers. This file contains only locally defined diff --git a/doc/help/ref-snmp-conf.html b/doc/help/ref-snmp-conf.html index 71e18d6d6..be7f11c6a 100644 --- a/doc/help/ref-snmp-conf.html +++ b/doc/help/ref-snmp-conf.html @@ -2,9 +2,12 @@ snmp.conf + +

                  snmp.conf

                  +

                  The /etc/cups/snmp.conf file contains several directives that determine how the SNMP printer discovery backend behaves. Each directive is listed on a line by itself followed diff --git a/doc/help/ref-subscriptions-conf.html b/doc/help/ref-subscriptions-conf.html index 20c31e187..d4f4defc3 100644 --- a/doc/help/ref-subscriptions-conf.html +++ b/doc/help/ref-subscriptions-conf.html @@ -2,9 +2,12 @@ subscriptions.conf + +

                  subscriptions.conf

                  +

                  The CUPS scheduler (cupsd) uses the /etc/cups/subscriptions.conf file to store the list of active subscriptions. Each directive is listed on a line by diff --git a/doc/help/security.html b/doc/help/security.html index c5956ef06..38fb42cc0 100644 --- a/doc/help/security.html +++ b/doc/help/security.html @@ -2,9 +2,12 @@ Server Security + +

                  Server Security

                  +

                  In the default "standalone" configuration, there are few potential security risks - the CUPS server does not accept remote connections, and only accepts shared printer information from the @@ -18,7 +21,7 @@ server.

                  When you enable remote administration, the server will use Basic authentication for adminstration tasks. The current CUPS -server supports Basic, Digest, and local certificate +server supports Basic, Digest, Kerberos, and local certificate authentication:

                    diff --git a/doc/help/sharing.html b/doc/help/sharing.html index 29bb757ad..00ccb6fe8 100644 --- a/doc/help/sharing.html +++ b/doc/help/sharing.html @@ -2,8 +2,11 @@ Printer Sharing - - + + + + +

                    Printer Sharing

                    This document discusses several ways to configure printer sharing.

                    diff --git a/doc/help/spec-banner.html b/doc/help/spec-banner.html index 1c16700be..9cdc5af82 100644 --- a/doc/help/spec-banner.html +++ b/doc/help/spec-banner.html @@ -4,7 +4,7 @@ CUPS Banner File Format - + +

                    CUPS Banner File Format

                    +

                    Introduction

                    This specification describes the CUPS banner file format diff --git a/doc/help/spec-browsing.html b/doc/help/spec-browsing.html index 12d3087f2..62f1f19b6 100644 --- a/doc/help/spec-browsing.html +++ b/doc/help/spec-browsing.html @@ -4,6 +4,7 @@ CUPS Browse Protocol + +

                    CUPS Browse Protocol

                    +

                    Introduction

                    This specification describes the CUPS browsing protocol which is used for diff --git a/doc/help/spec-cmp.html b/doc/help/spec-cmp.html index 415c194cf..23e229407 100644 --- a/doc/help/spec-cmp.html +++ b/doc/help/spec-cmp.html @@ -3,14 +3,13 @@ CUPS Developer Guide + -

                    This developer guide documents the guidelines and processes we -use when developing and maintaining the Common UNIX Printing -System ("CUPS") and related software. Our goal is to provide -reliable and efficient software and documentation that addresses -the needs of our users.

                    +

                    CUPS Developer Guide

                    + +

                    This developer guide documents the guidelines and processes we use when developing and maintaining CUPS and related software. Our goal is to provide reliable and efficient software and documentation that addresses the needs of our users.

                    Communication

                    diff --git a/doc/help/spec-command.html b/doc/help/spec-command.html index ff58d1db3..63170e005 100644 --- a/doc/help/spec-command.html +++ b/doc/help/spec-command.html @@ -4,7 +4,7 @@ CUPS Command File Format - + +

                    CUPS Command File Format

                    +

                    Introduction

                    This specification describes the CUPS command file format diff --git a/doc/help/spec-design.html b/doc/help/spec-design.html index 928d6a1e7..a9472c4f9 100644 --- a/doc/help/spec-design.html +++ b/doc/help/spec-design.html @@ -3,191 +3,86 @@ CUPS Design Description + -

                    This document is still being updated for CUPS 1.4...

                    +

                    CUPS Design Description

                    -

                    This design description documents the overall organization of CUPS. The -purpose is not to provide a line-by-line description of the CUPS source code, -but rather to describe the overall architecture and location of key pieces so -that developers can more easily understand the underlying operation of CUPS.

                    +

                    This design description documents the overall organization of CUPS. The purpose is not to provide a line-by-line description of the CUPS source code, but rather to describe the overall architecture and location of key pieces so that developers can more easily understand the underlying operation of CUPS.

                    Introduction

                    -

                    Like most printing systems, CUPS is designed around a central -print scheduling process that dispatches print jobs, processes -administrative commands, provides printer status information to -local and remote programs, and informs users as needed. Figure 1 shows the basic organization of -CUPS.

                    +

                    Like most printing systems, CUPS is designed around a central print scheduling process that dispatches print jobs, processes administrative commands, provides printer status information to local and remote programs, and informs users as needed. Figure 1 shows the basic organization of CUPS.

                    Scheduler

                    -

                    The scheduler is a HTTP/1.1 and IPP/1.1 server application -manages HTTP and IPP requests, printers, classes, jobs, -subscriptions, and notifications on the system. HTTP is used for -normal web browser services as well as IPP operation messages -passed via HTTP POST requests with the -application/ipp content type. The scheduler uses a -series of helper Common Gateway Interface ("CGI") applications to -provide dynamic web interfaces, and can be configured to run -additional, site-specific programs or scripts for the web -interface.

                    - -

                    The scheduler is designed as a traditional monolithic, -single-threaded server process which runs external processes to -do longer-term operations such as printing, notification, -device/driver enumeration, and remote printer monitoring. While -this design does limit the maximum number of simultaneous clients -that can be supported on a typical system, it also keep resource -utilization to a minimum and greatly simplifies the scheduler's -logic.

                    +

                    The scheduler is a HTTP/1.1 and IPP/2.1 server application that manages HTTP and IPP requests, printers, classes, jobs, subscriptions, and notifications on the system. HTTP is used for normal web browser services as well as IPP operation messages passed via HTTP POST requests with the application/ipp content type. The scheduler uses a series of helper applications based on the Common Gateway Interface ("CGI") to provide dynamic web interfaces and can be configured to run additional site-specific programs or scripts for the web interface.

                    + +

                    The scheduler is designed as a traditional single-threaded server process which runs external processes to do longer-term operations such as printing, notification, device/driver enumeration, and remote printer monitoring. External processes are normally run as a non-privileged account ("lp") and, on some platforms, with additional restrictions that limit what the processes are allowed to do.

                    + +

                    The maximum number of simultaneous clients and print jobs that can be supported is primarily limited by the available server memory, file descriptors, and CPU - the scheduler itself imposes no hard limits.

                    +WIDTH="768" HEIGHT="768" ALT="CUPS Block Diagram">
                    Figure 1: CUPS Block Diagram
                    CUPS Block Diagram
                    +

                    Config Files

                    + +

                    The scheduler uses several configuration files to store the server settings (cupsd.conf), available classes (classes.conf), available printers (printers.conf), current notification subscriptions (subscriptions.conf), and supported file types and filters (mime.types, mime.convs). In addition, PostScript Printer Description ("PPD") files or interface scripts are associated with each printer, and the scheduler has cache files for remote printers, PPD files, and current jobs to optimize the scheduler's startup speed and availability.

                    +

                    Job Files

                    -

                    The scheduler stores job files in a spool directory, -typically /var/spool/cups. Two types of files will be -found in the spool directory: control files starting -with the letter "c" ("c00001", "c99999", "c100000", etc.) and -data files starting with the letter "d" ("d00001-001", -"d99999-001", "d100000-001", etc.) Control files are IPP messages -based on the original IPP Print-Job or Create-Job messages, while -data files are the original print files that were submitted for -printing. There is one control file for every job known to the -system and 0 or more data files for each job. Data files are -normally removed after a job has successfully printed, however -this behavior can be configured.

                    +

                    The scheduler stores job files in a spool directory, typically /var/spool/cups. Two types of files will be found in the spool directory: control files starting with the letter "c" ("c00001", "c99999", "c100000", etc.) and data files starting with the letter "d" ("d00001-001", "d99999-001", "d100000-001", etc.) Control files are IPP messages based on the original IPP Print-Job or Create-Job messages, while data files are the original print files that were submitted for printing. There is one control file for every job known to the system and 0 or more data files for each job. -

                    Log Files

                    +

                    Control files are normally cleaned out after the 500th job is submitted, while data files are removed immediately after a job has successfully printed. Both behaviors can be configured.

                    -

                    The scheduler keeps three kinds of log files which are -normally stored in the /var/log/cups directory. The access_log file lists every HTTP -and IPP request that is processed by the scheduler. The error_log file contains messages -from the scheduler and its helper applications that can be used -to track down problems. The page_log file lists every page that -is printed, allowing for simple print accounting.

                    - -

                    Log files are rotated automatically by the scheduler when they -reach the configured size limit, by default 1MB. If the limit is -set to 0 then no rotation is performed in the scheduler - this -mode is often used by Linux distributions so they can use the -logrotated(8) program to rotate them instead.

                    +

                    Log Files

                    -

                    Config Files

                    +

                    The scheduler keeps three kinds of log files which are normally stored in the /var/log/cups directory. The access_log file lists every HTTP and IPP request that is processed by the scheduler. The error_log file contains messages from the scheduler and its helper applications that can be used +to track down problems. The page_log file lists every page that is printed, allowing for simple print accounting.

                    -

                    The scheduler uses several configuration files to store the -server settings (cupsd.conf), -available classes (classes.conf), available -printers (printers.conf), -current notification subscriptions (subscriptions.conf), and -supported file types and filters (mime.types, mime.convs). In addition, -PostScript Printer Description ("PPD") files or interface scripts -are associated with each printer, and the scheduler has cache -files for remote printers, PPD files, and current jobs to -optimize the scheduler's startup speed and availability.

                    +

                    Log files are rotated automatically by the scheduler when they reach the configured size limit, by default 1MB. If the limit is set to 0 then no rotation is performed in the scheduler - this mode is often used by Linux distributions so they can use the logrotated(8) program to rotate them instead.

                    Berkeley Commands

                    -

                    CUPS provides the Berkeley lpc(8), -lpq(1), lpr(1), and lprm(1) commands. In general, they -function identically to the original Berkeley commands with the -following exceptions:

                    +

                    CUPS provides the Berkeley lpc(8), lpq(1), lpr(1), and lprm(1) commands. In general, they function identically to the original Berkeley commands with the following exceptions:

                      -
                    1. The lpc command currently only supports the - "status" sub-command.
                    2. +
                    3. The lpc command currently only supports the "status" sub-command.
                    4. -
                    5. The lpr command does not support the format - modifier options "1" (TROFF font set 1), "2" (TROFF font - set 2), "3" (TROFF font set 3), "4" (TROFF font set 4), - "c" (CIFPLOT), "d" (DVI), "f" (FORTRAN), "g" (GNU plot), - "i" (indentation), "n" (Ditroff), "r" (Sun raster), "t" - (Troff), or "w" (width), as they do not map to the IPP - MIME media type based document formats.
                    6. +
                    7. The lpr command does not support the format modifier options "1" (TROFF font set 1), "2" (TROFF font set 2), "3" (TROFF font set 3), "4" (TROFF font set 4), "c" (CIFPLOT), "d" (DVI), "f" (FORTRAN), "g" (GNU plot), "i" (indentation), "n" (Ditroff), "r" (Sun raster), "t" (Troff), or "w" (width), as they do not map to the IPP MIME media type based document formats.

                    System V Commands

                    -

                    CUPS provides the System V accept(8), cancel(1), lp(1), lpadmin(8), lpmove(8), lpstat(1), and reject(8) commands. In general, they -function identically to the original System V commands with the -following exceptions:

                    +

                    CUPS provides the System V cancel(1), lp(1), lpadmin(8), lpmove(8), and lpstat(1) commands. In general, they function identically to the original System V commands with the following exceptions:

                      -
                    1. All commands may ask for a password; the System V - print spooler requires root access to perform - administration tasks, while CUPS allows for more flexible - configurations.
                    2. +
                    3. All commands may ask for a password; the System V print spooler requires root access to perform administration tasks, while CUPS allows for more flexible configurations.
                    4. -
                    5. The lpadmin command does not implement the - Solaris "-A" (alert), "-F" (fault recovery), "-M" (mount - form/wheel), "-P" (paper list), "-S" (print wheels), "-T" - (type list), "-U" (dialer info), "-W" (wait), "-f" (form - name), "-l" (content-type list), "-s" (remote printer), - or "-t" (number of trays) options.
                    6. +
                    7. The lpadmin command does not implement the Solaris "-A" (alert), "-F" (fault recovery), "-M" (mount form/wheel), "-P" (paper list), "-S" (print wheels), "-T" (type list), "-U" (dialer info), "-W" (wait), "-f" (form name), "-l" (content-type list), "-s" (remote printer), or "-t" (number of trays) options.

                    CUPS Commands

                    -

                    CUPS provides the cupsaddsmb(8), cupsdisable(8), cupsenable(8), cupstestppd(1), lpinfo(8), and lppasswd(1) commands. The -cupsdisable and cupsenable commands correspond to -the System V disable and enable commands but have -been renamed to avoid conflicts with the bash(1) internal -commands of the same name.

                    +

                    CUPS provides the cupsaccept(8), cupsaddsmb(8), cupsdisable(8), cupsenable(8), cupsreject(8), cupstestppd(1), lpinfo(8), and lppasswd(1) commands. The cupsaccept, cupsdisable, cupsenable, and cupsreject commands correspond to the System V accept, disable, enable, and reject commands but have been renamed to avoid confusion and conflicts with the bash(1) internal enable command of the same name.

                    LPD Support

                    -

                    LPD client support is provided via the cups-lpd(8) program. Incoming LPD -requests are accepted on TCP port 515 by the local -inetd(8), launchd(8), or xinetd(8) process -and forwarded to the cups-lpd program for conversion to -the corresponding IPP request(s).

                    - -

                    The cups-lpd program conforms, for the most part, to -RFC 1179: Line Printer Daemon Protocol, but does not enforce the -privileged source port restriction specified in that document. In -addition, the banner page and output format options are usually -overridden via command-line options to the cups-lpd -program when it is invoked by the corresponding super-daemon -program.

                    +

                    LPD client support is provided via the cups-lpd(8) program. Incoming LPD requests are accepted on TCP port 515 by the local inetd(8), launchd(8), or xinetd(8) process and forwarded to the cups-lpd program for conversion to the corresponding IPP request(s).

                    + +

                    The cups-lpd program conforms, for the most part, to RFC 1179: Line Printer Daemon Protocol, but does not enforce the privileged source port restriction specified in that document. In addition, the banner page and output format options are usually overridden via command-line options to the cups-lpd program when it is invoked by the corresponding super-daemon program.

                    Web Interface

                    -

                    The web interface is supported by five CGI programs. Table 1 -describes the purpose of each of the programs.

                    +

                    The web interface is supported by five CGI programs. Table 1 describes the purpose of each of the programs.

                    @@ -212,7 +107,7 @@ describes the purpose of each of the programs.

                    - + @@ -229,166 +124,61 @@ describes the purpose of each of the programs.

                    Notifiers

                    -

                    Notifiers provide the means for sending event notifications -from the scheduler. Notifiers are executed with the recipient -information on the command-line and the event data on the -standard input.

                    +

                    Notifiers (notifier(7)) provide the means for sending asynchronous event notifications from the scheduler. Notifiers are executed with the recipient information on the command-line and the event data on the standard input. For example:

                    + +
                    +CUPS_SERVERBIN/notifier/foo recipient user-data
                    +
                    -

                    The mailto notifier is the only notifier included with -CUPS 1.2 and handles email notifications for the scheduler. -Additional notifiers can be added as needed without additional -configuration.

                    +

                    CUPS includes two notifiers: mailto to provide SMTP-based email notifications and rss to provide Really Simple Syndication ("RSS") notifications from the scheduler. Additional notifiers can be installed in the notifier directory as needed to support other methods.

                    Filters

                    -

                    Filters convert job files into a printable format. Multiple -filters are run, as needed, to convert from the job file format -to the printable format. A filter program reads from the standard -input or from a file if a filename is supplied. All filters must -support a common set of options including printer name, job ID, -username, job title, number of copies, and job options. All -output is sent to the standard output.

                    +

                    Filters (filter(7)) convert job files into a printable format. Multiple filters are run, as needed, to convert from the job file format to the printable format. A filter program reads from the standard input or from a file if a filename is supplied. All filters must support a common set of options including printer name, job ID, username, job title, number of copies, and job options. All output is sent to the standard output.

                    -

                    CUPS provides filters for printing text, PostScript, PDF, -HP-GL/2, and many types of image files. CUPS also provides -printer driver filters for HP-PCL, ESC/P, and several types of -label printers. Additional filters can be added through the use -of mime.convs and PPD files.

                    +

                    CUPS provides filters for printing text, PostScript, PDF, HP-GL/2, and many types of image files. CUPS also provides printer driver filters for HP-PCL, ESC/P, and several types of label printers. Additional filters can be registered with CUPS via mime.convs and PPD files.

                    Port Monitors

                    -

                    Port monitors handle the device- and channel-specific data -formatting for a printer. Port monitors use the same interface as -filters.

                    +

                    Port monitors handle the device- and channel-specific data formatting for a printer. Port monitors use the same interface as filters.

                    -

                    CUPS includes two port monitors: the bcp port monitor -which supports the PostScript Binary Communications Protocol -("BCP") and the tbcp port monitor which supports the -PostScript Tagged Binary Communications Protocol ("TBCP"). -Additional port monitors can be added through PPD files.

                    +

                    CUPS includes two port monitors: the bcp port monitor which supports the PostScript Binary Communications Protocol ("BCP") and the tbcp port monitor which supports the PostScript Tagged Binary Communications Protocol ("TBCP"). Additional port monitors can be registered in PPD files.

                    Backends

                    -

                    Backends send print data to the printer and enumerate -available printers/devices as needed. Backends use the same -interface as filters.

                    +

                    Backends (backend(7)) send print data to the printer and enumerate available printers/devices as needed. Backends use the same interface as filters.

                    -

                    CUPS includes backends for parallel, serial, SCSI, USB, LPD, -IPP, and AppSocket (JetDirect) connections. Additional backends -can be added as needed without additional configuration.

                    - -

                    Programming Interfaces

                    +

                    CUPS includes backends for AppSocket (JetDirect), IPP, LPD, parallel, SCSI, serial, and USB connections. Additional backends can be added as needed without additional configuration.

                    -

                    CUPS makes use of two general-purpose libraries to provide its -printing services. The CUPS library provides the general -communications and management infrastructure while the CUPS -imaging library provides the image file and raster data -support.

                    - -

                    CUPS Libary

                    - -

                    The CUPS library contains CUPS-specific convenience functions -for queuing print jobs, getting printer information, accessing -resources via HTTP and IPP, and manipulating PPD files. Unlike -the rest of CUPS, the CUPS API is provided under the terms of the -GNU LGPL so it may be used by non-GPL applications.

                    - -

                    CUPS Imaging Library

                    - -

                    The CUPS imaging library provides functions for managing large -images, doing colorspace conversion and color management, scaling -images for printing, and managing raster page streams. It is used -by the CUPS image file filters, the PostScript RIP, and all -raster printers drivers.

                    - - diff --git a/doc/help/spec-ipp.html b/doc/help/spec-ipp.html index 39839068b..525e49d5f 100644 --- a/doc/help/spec-ipp.html +++ b/doc/help/spec-ipp.html @@ -4,6 +4,7 @@ CUPS Implementation of IPP + +

                    CUPS Implementation of IPP

                    +

                    Introduction

                    CUPS implements IPP/1.1 and the operations and attributes diff --git a/doc/help/spec-pdf.html b/doc/help/spec-pdf.html index bb7164472..407f47887 100644 --- a/doc/help/spec-pdf.html +++ b/doc/help/spec-pdf.html @@ -3,10 +3,12 @@ CUPS PDF Format - + +

                    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 diff --git a/doc/help/spec-postscript.html b/doc/help/spec-postscript.html index 461e225f8..b13a1894e 100644 --- a/doc/help/spec-postscript.html +++ b/doc/help/spec-postscript.html @@ -4,7 +4,7 @@ Generating PostScript for CUPS - + +

                    Generating PostScript for CUPS

                    +

                    Introduction

                    This document describes how to generate PostScript output for diff --git a/doc/help/spec-ppd.html b/doc/help/spec-ppd.html index fe4b0cfd8..6753cd48e 100644 --- a/doc/help/spec-ppd.html +++ b/doc/help/spec-ppd.html @@ -22,6 +22,8 @@ file is missing or damaged, see the license at "http://www.cups.org/". --> +

                    CUPS PPD Extensions

                    +

                    Introduction

                    This specification describes the attributes and extensions @@ -297,9 +299,9 @@ equivalent.

                    *APCustomColorMatchingProfile: name

                    This attribute defines a supported RGB color profile that can be used -when doing custom color matching. Currently only sRGB and -AdobeRGB are supported. If not specified, RGB data will use the -Generic RGB colorspace.

                    +when doing custom color matching. Currently only sRGB, +AdobeRGB, and GenericRGB are supported. If not specified, RGB +data will use the GenericRGB colorspace.

                    Note: @@ -326,8 +328,8 @@ Add the named profile to the print settings using the key

                    *APDefaultCustomColorMatchingProfile: name

                    This attribute defines the default RGB color profile that will be used -when doing custom color matching. Currently only sRGB and -AdobeRGB are supported.

                    +when doing custom color matching. Currently only sRGB, +AdobeRGB, and GenericRGB are supported.

                    Examples:

                    @@ -343,7 +345,7 @@ when doing custom color matching. Currently only sRGB and

                    This attribute specifies that the driver provides its own custom color matching. When true, the default hand-off colorspace will be -Generic Gray, Generic RGB, or Generic CMYK depending on the number of +GenericGray, GenericRGB, or GenericCMYK depending on the number of components the driver requests. The APDefaultCustomColorMatchingProfile attribute can be used to override the default 3-component (RGB) colorspace.

                    diff --git a/doc/help/spec-raster.html b/doc/help/spec-raster.html index 79a93a4c5..de5b7b50e 100644 --- a/doc/help/spec-raster.html +++ b/doc/help/spec-raster.html @@ -3,10 +3,12 @@ CUPS Raster Format - + +

                    CUPS Raster Format

                    +

                    CUPS raster files are device-dependent raster image files that contain a PostScript page device dictionary and device-dependent raster imagery for each page in the document. These files are @@ -15,7 +17,7 @@ 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 version 2 (compressed) and version 3 (uncompressed) +introduced 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.

                    diff --git a/doc/help/spec-stp.html b/doc/help/spec-stp.html index fd46937f8..fd04da647 100644 --- a/doc/help/spec-stp.html +++ b/doc/help/spec-stp.html @@ -3,12 +3,14 @@ CUPS Software Test Plan + +

                    CUPS Software Test Plan

                    +

                    This software test plan provides detailed tests that are used -to evaluate the stability and compliance of the Common UNIX -Printing System ("CUPS") Version 1.2.

                    +to evaluate the stability and compliance of CUPS.

                    Test Procedure

                    diff --git a/doc/help/standard.html.in b/doc/help/standard.html.in index 9005c6281..f957fe249 100644 --- a/doc/help/standard.html.in +++ b/doc/help/standard.html.in @@ -2,9 +2,12 @@ Standard Configuration + +

                    Standard Configuration

                    +

                    This document describes the standard configuration for this CUPS server.

                    @@ -14,7 +17,7 @@ server.

                    if you make any changes to the standard CUPS distribution that are not automatically updated by the configure script. -->

                    This file reflects the standard CUPS configuration as distributed -by Easy Software Products, the creator of CUPS.

                    +by Apple Inc, the developer of CUPS.

                    diff --git a/doc/help/translation.html b/doc/help/translation.html index abc4bbb65..8fa6efe23 100644 --- a/doc/help/translation.html +++ b/doc/help/translation.html @@ -2,14 +2,18 @@ Translating and Customizing CUPS + +

                    Translating and Customizing CUPS

                    +

                    Thanks to its extensive use of templates, images, and message catalogs, CUPS can be easily translated (or customized!) to suit your needs. This help file will guide you through the CUPS localization files so you can get the most out of it.

                    +

                    Getting Started

                    Start by downloading the CUPS source code from What's New in CUPS 1.4 + -

                    CUPS 1.4 adds over 65 changes and new features to CUPS 1.3.x. This page provides a high-level outline of these changes. If you have never used CUPS before, read the "Overview of CUPS" document instead.

                    +

                    What's New in CUPS 1.4

                    + +

                    CUPS 1.4 adds over 67 changes and new features to CUPS 1.3.x. This page provides a high-level outline of these changes. If you have never used CUPS before, read the "Overview of CUPS" document instead.

                    Commands

                    @@ -101,6 +104,8 @@
                  1. Default LogLevel; the default LogLevel is now "warn" instead of "info".
                  2. +
                  3. Automatic debug logging; the scheduler now records up to the last N (default 200) debug messages for failed print jobs.
                  4. +
                  5. Default paper size; the scheduler now supports a DefaultPaperSize directive to override the default paper size defined by the locale or libpaper configuration.
                  6. Encryption support; the scheduler now supports a SSLOptions directive to optionally support Windows clients in "FIPS" mode. It also now loads both the server and CA certificates (if present) from the ServerCertificate file.
                  7. @@ -140,7 +145,7 @@

                    Printer Drivers

                    -
                      +
                      1. Device discovery; the cups-deviced helper now runs backends in parallel for faster discovery and streams the results of discovery as the backends provide them.
                      2. @@ -165,7 +170,7 @@

                        Print Filters

                        -
                          +
                          1. Banner filter; the bundled banner ("job-sheets") pages are now generated using a new banner filter provides easier customization and better support for UTF-8 text.
                          2. @@ -178,7 +183,7 @@

                            CUPS API

                            -
                              +
                              1. Backend API; a new cupsBackendReport function is provided to report a device from a backend and handles any needed quoting of the make-and-model, info, device-id, and location strings.
                              2. diff --git a/driver/api-driver.header b/driver/api-driver.header index e69de29bb..0f3937bc1 100644 --- a/driver/api-driver.header +++ b/driver/api-driver.header @@ -0,0 +1,34 @@ + + +

                                Driver API

                                + +
                    Table 1: CGI Programs
                    help.cgi /helpProvides access to on-line help documentsProvides access to online help documents
                    jobs.cgi
                    + + + + + + + + + + + + + + + + +
                    Headercups/driver.h
                    Library-lcupsdriver
                    See AlsoProgramming: Introduction to CUPS Programming
                    diff --git a/driver/api-driver.shtml b/driver/api-driver.shtml index e69de29bb..0e8bcff27 100644 --- a/driver/api-driver.shtml +++ b/driver/api-driver.shtml @@ -0,0 +1,18 @@ + + +

                    Overview

                    + +

                    The driver API provides common dithering, color conversion, and utility +functions for CUPS drivers.

                    diff --git a/filter/api-raster.header b/filter/api-raster.header index 8b54f004f..8e26fbf3e 100644 --- a/filter/api-raster.header +++ b/filter/api-raster.header @@ -3,7 +3,7 @@ Raster API header for the Common UNIX Printing System (CUPS). - Copyright 2008 by Apple Inc. + Copyright 2008-2009 by Apple Inc. These coded instructions, statements, and computer programs are the property of Apple Inc. and are protected by Federal copyright @@ -12,6 +12,8 @@ file is missing or damaged, see the license at "http://www.cups.org/". --> +

                    Raster API

                    +
                    diff --git a/filter/postscript-driver.header b/filter/postscript-driver.header index 5eb2dd15b..1f717ba09 100644 --- a/filter/postscript-driver.header +++ b/filter/postscript-driver.header @@ -1,4 +1,6 @@ -

                    This document describes how to develop printer drivers for PostScript printers. Topics include: printer driver basics, creating new PPD files, importing existing PPD files, using custom filters, implementing color management, adding Mac OS X features, and deploying your driver.

                    +

                    Developing PostScript Printer Drivers

                    + +

                    This document describes how to develop printer drivers for PostScript printers. Topics include: printer driver basics, creating new PPD files, importing existing PPD files, using custom filters, implementing color management, and adding Mac OS X features.

                    diff --git a/filter/postscript-driver.shtml b/filter/postscript-driver.shtml index 4729d5e25..a21086d92 100644 --- a/filter/postscript-driver.shtml +++ b/filter/postscript-driver.shtml @@ -248,14 +248,29 @@ information file.

                    Implementing Color Management

                    -

                    Talk about ICC color profiles and sRGB as two best options.

                    +

                    CUPS uses ICC color profiles to provide more accurate color reproduction. The cupsICCProfile attribute defines the color profiles that are available for a given printer, for example:

                    +
                    +Attribute cupsICCProfile "ColorModel.MediaType.Resolution/Description" /path/to/ICC/profile
                    +
                    -

                    Adding Mac OS X Features

                    +

                    where "ColorModel.MediaType.Resolution" defines a selector based on the corresponding option selections. A simple driver might only define profiles for the color models that are supported, for example a printer supporting Gray and RGB might use:

                    + +
                    +Attribute cupsICCProfile "Gray../Grayscale Profile" /path/to/ICC/gray-profile
                    +Attribute cupsICCProfile "RGB../Full Color Profile" /path/to/ICC/rgb-profile
                    +
                    + +

                    The options used for profile selection can be customized using the cupsICCQualifier2 and cupsICCQualifier3 attributes.

                    -

                    Talk about help books, icons, and PDEs.

                    +

                    Adding Mac OS X Features

                    -

                    Deploying Your Driver

                    +

                    Mac OS X printer drivers can provide additional attributes to specify additional option panes in the print dialog, an image of the printer, a help book, and option presets for the driver software:

                    -

                    Talk about install locations, etc.

                    +
                    +Attribute APDialogExtension "" /Library/Printers/Vendor/filename.plugin
                    +Attribute APHelpBook "" /Library/Printers/Vendor/filename.bundle
                    +Attribute APPrinterIconPath "" /Library/Printers/Vendor/filename.icns
                    +Attribute APPrinterPreset "name/text" "*option choice ..."
                    +
                    diff --git a/filter/ppd-compiler.header b/filter/ppd-compiler.header index b975c92cc..6afe1b4f0 100644 --- a/filter/ppd-compiler.header +++ b/filter/ppd-compiler.header @@ -1,3 +1,5 @@ +

                    Introduction to the PPD Compiler

                    +

                    This document describes how to use the CUPS PostScript Printer Description (PPD) file compiler. The PPD compiler generates PPD files from simple text files that describe the features and capabilities of one or more printers.

                    diff --git a/filter/raster-driver.header b/filter/raster-driver.header index a90c2e328..5ba1fb614 100644 --- a/filter/raster-driver.header +++ b/filter/raster-driver.header @@ -1,4 +1,6 @@ -

                    This document describes how to develop printer drivers for raster printers. Topics include: printer driver basics, creating new PPD files, using filters, implementing color management, adding Mac OS X features, and deploying your driver.

                    +

                    Developing Raster Printer Drivers

                    + +

                    This document describes how to develop printer drivers for raster printers. Topics include: printer driver basics, creating new PPD files, using filters, implementing color management, and adding Mac OS X features.

                    diff --git a/filter/raster-driver.shtml b/filter/raster-driver.shtml index 824ef3779..3a260f008 100644 --- a/filter/raster-driver.shtml +++ b/filter/raster-driver.shtml @@ -157,14 +157,38 @@

                    Implementing Color Management

                    -

                    Talk about ICC color profiles and sRGB as two best options.

                    +

                    CUPS uses ICC color profiles to provide more accurate color reproduction. The cupsICCProfile attribute defines the color profiles that are available for a given printer, for example:

                    +
                    +Attribute cupsICCProfile "ColorModel.MediaType.Resolution/Description" /path/to/ICC/profile
                    +
                    -

                    Adding Mac OS X Features

                    +

                    where "ColorModel.MediaType.Resolution" defines a selector based on the corresponding option selections. A simple driver might only define profiles for the color models that are supported, for example a printer supporting Gray and RGB might use:

                    + +
                    +Attribute cupsICCProfile "Gray../Grayscale Profile" /path/to/ICC/gray-profile
                    +Attribute cupsICCProfile "RGB../Full Color Profile" /path/to/ICC/rgb-profile
                    +
                    -

                    Talk about help books, icons, and PDEs.

                    +

                    The options used for profile selection can be customized using the cupsICCQualifier2 and cupsICCQualifier3 attributes.

                    +

                    Since Mac OS X 10.5Custom Color Matching Support

                    -

                    Deploying Your Driver

                    +

                    Mac OS X printer drivers that are based on an existing standard RGB colorspace can tell the system to use the corresponding colorspace instead of an arbitrary ICC color profile when doing color management. The APSupportsCustomColorMatching and APDefaultCustomColorMatchingProfile attributes can be used to enable this mode:

                    -

                    Talk about install locations, etc.

                    +
                    +Attribute APSupportsCustomColorMatching "" true
                    +Attribute APDefaultCustomColorMatchingProfile "" sRGB
                    +
                    + + +

                    Adding Mac OS X Features

                    + +

                    Mac OS X printer drivers can provide additional attributes to specify additional option panes in the print dialog, an image of the printer, a help book, and option presets for the driver software:

                    + +
                    +Attribute APDialogExtension "" /Library/Printers/Vendor/filename.plugin
                    +Attribute APHelpBook "" /Library/Printers/Vendor/filename.bundle
                    +Attribute APPrinterIconPath "" /Library/Printers/Vendor/filename.icns
                    +Attribute APPrinterPreset "name/text" "*option choice ..."
                    +
                    diff --git a/filter/rastertoepson.c b/filter/rastertoepson.c index 5a54687d2..141cd2b22 100644 --- a/filter/rastertoepson.c +++ b/filter/rastertoepson.c @@ -4,7 +4,7 @@ * EPSON ESC/P and ESC/P2 filter for the Common UNIX Printing System * (CUPS). * - * Copyright 2007-2008 by Apple Inc. + * Copyright 2007-2009 by Apple Inc. * Copyright 1993-2007 by Easy Software Products. * * These coded instructions, statements, and computer programs are the @@ -105,7 +105,7 @@ void OutputRows(const cups_page_header2_t *header, int row); void Setup(void) { - const char *device_uri; /* The device for the printer... */ + const char *device_uri; /* The device for the printer... */ /* @@ -124,11 +124,12 @@ Setup(void) */ void -StartPage(const ppd_file_t *ppd, /* I - PPD file */ - const cups_page_header2_t *header) /* I - Page header */ +StartPage( + const ppd_file_t *ppd, /* I - PPD file */ + const cups_page_header2_t *header) /* I - Page header */ { - int n, t; /* Numbers */ - int plane; /* Looping var */ + int n, t; /* Numbers */ + int plane; /* Looping var */ /* @@ -144,8 +145,6 @@ StartPage(const ppd_file_t *ppd, /* I - PPD file */ * See which type of printer we are using... */ - EjectPage = header->Margins[0] || header->Margins[1]; - switch (Model) { case EPSON_9PIN : @@ -165,8 +164,8 @@ StartPage(const ppd_file_t *ppd, /* I - PPD file */ printf("\033l%c\033Q%c", 0, /* Side margins */ (int)(10.0 * header->PageSize[0] / 72.0 + 0.5)); - printf("\033C%c%c", 0, /* Page length */ - (int)(header->PageSize[1] / 72.0 + 0.5)); + printf("\033\062\033C%c", /* Page length in 1/6th inches */ + (int)(header->PageSize[1] / 12.0 + 0.5)); printf("\033N%c", 0); /* Bottom margin */ printf("\033O"); /* No perforation skip */ @@ -321,7 +320,8 @@ StartPage(const ppd_file_t *ppd, /* I - PPD file */ */ void -EndPage(const cups_page_header2_t *header) /* I - Page header */ +EndPage( + const cups_page_header2_t *header) /* I - Page header */ { if (DotBytes && header) { @@ -350,8 +350,7 @@ EndPage(const cups_page_header2_t *header) /* I - Page header */ * Eject the current page... */ - if (EjectPage) - putchar(12); /* Form feed */ + putchar(12); /* Form feed */ fflush(stdout); /* @@ -609,7 +608,8 @@ CompressData(const unsigned char *line, /* I - Data to compress */ */ void -OutputLine(const cups_page_header2_t *header) /* I - Page header */ +OutputLine( + const cups_page_header2_t *header) /* I - Page header */ { if (header->cupsRowCount) { @@ -777,14 +777,15 @@ OutputLine(const cups_page_header2_t *header) /* I - Page header */ */ void -OutputRows(const cups_page_header2_t *header, /* I - Page image header */ - int row) /* I - Row number (0 or 1) */ +OutputRows( + const cups_page_header2_t *header, /* I - Page image header */ + int row) /* I - Row number (0 or 1) */ { - unsigned i, n; /* Looping vars */ - int dot_count, /* Number of bytes to print */ - dot_min; /* Minimum number of bytes */ - unsigned char *dot_ptr, /* Pointer to print data */ - *ptr; /* Current data */ + unsigned i, n; /* Looping vars */ + int dot_count, /* Number of bytes to print */ + dot_min; /* Minimum number of bytes */ + unsigned char *dot_ptr, /* Pointer to print data */ + *ptr; /* Current data */ dot_min = DotBytes * DotColumns; diff --git a/init/org.cups.cupsd.plist b/init/org.cups.cupsd.plist index 74bcce6c3..2b9a7df9d 100644 --- a/init/org.cups.cupsd.plist +++ b/init/org.cups.cupsd.plist @@ -4,6 +4,10 @@ Label org.cups.cupsd + EnableTransactions + + ExitTimeOut + 60 KeepAlive PathState diff --git a/locale/cups_zh.po b/locale/cups_zh.po index de7a5b814..7a78b197b 100644 --- a/locale/cups_zh.po +++ b/locale/cups_zh.po @@ -2116,7 +2116,7 @@ msgid "Billing Information: " msgstr "帐单信息:" msgid "Bond Paper" -msgstr "证券纸" +msgstr "半透明纸" msgid "C0 Envelope" msgstr "C0 信封" @@ -3715,7 +3715,7 @@ msgid "Print and Tear" msgstr "打印和撕纸" msgid "Printed For: " -msgstr "打印用于:" +msgstr "打印人:" msgid "Printed From: " msgstr "打印自:" diff --git a/man/Makefile b/man/Makefile index d1a4e8c1c..b12c39a65 100644 --- a/man/Makefile +++ b/man/Makefile @@ -47,12 +47,9 @@ MAN5 = classes.conf.$(MAN5EXT) \ printers.conf.$(MAN5EXT) \ subscriptions.conf.$(MAN5EXT) MAN7 = backend.$(MAN7EXT) \ - commandtoescpx.$(MAN7EXT) \ - commandtopclx.$(MAN7EXT) \ drv.$(MAN7EXT) \ filter.$(MAN7EXT) \ - rastertoescpx.$(MAN7EXT) \ - rastertopclx.$(MAN7EXT) + notifier.$(MAN7EXT) MAN8 = cupsaccept.$(MAN8EXT) \ cupsaddsmb.$(MAN8EXT) \ cupsctl.$(MAN8EXT) \ diff --git a/man/backend.man b/man/backend.man index 7c828af14..e62f94e22 100644 --- a/man/backend.man +++ b/man/backend.man @@ -12,7 +12,7 @@ .\" which should have been included with this file. If this file is .\" file is missing or damaged, see the license at "http://www.cups.org/". .\" -.TH backend 7 "CUPS" "28 July 2008" "Apple Inc." +.TH backend 7 "CUPS" "12 May 2009" "Apple Inc." .SH NAME backend \- cups backend transmission interfaces @@ -36,13 +36,11 @@ standard input to a temporary file as required by the physical interface. .LP -The command name (argv[0]) is set to the device URI of the -destination printer. Starting with CUPS 1.1.22, any -authentication information in argv[0] is removed, so -backend developers are urged to use the DEVICE_URI environment -variable whenever authentication information is required. The -CUPS API includes a \fIcupsBackendDeviceURI\fR function for -retrieving the correct device URI. +The command name (argv[0]) is set to the device URI of the destination printer. +Starting with CUPS 1.1.22, any authentication information in argv[0] is removed, +so backend developers are urged to use the DEVICE_URI environment variable +whenever authentication information is required. The CUPS API includes a +\fIcupsBackendDeviceURI\fR function for retrieving the correct device URI. .LP Back-channel data from the device should be relayed to the job @@ -174,7 +172,7 @@ this by canceling the job. All other exit code values are reserved. .SH SEE ALSO -\fIcupsd(8)\fR, \fIcupsd.conf(5)\fR, \fIfilter(7)\fR +\fIcupsd(8)\fR, \fIcupsd.conf(5)\fR, \fIfilter(7)\fR, .br http://localhost:631/help diff --git a/man/commandtoescpx.man b/man/commandtoescpx.man deleted file mode 100644 index 8d4209abf..000000000 --- a/man/commandtoescpx.man +++ /dev/null @@ -1,33 +0,0 @@ -.\" -.\" "$Id: commandtoescpx.man 7600 2008-05-20 21:06:23Z mike $" -.\" -.\" commandtoescpx man page for the CUPS Driver Development Kit. -.\" -.\" Copyright 2007-2009 by Apple Inc. -.\" Copyright 1997-2007 by Easy Software Products. -.\" -.\" These coded instructions, statements, and computer programs are the -.\" property of Apple Inc. and are protected by Federal copyright -.\" law. Distribution and use rights are outlined in the file "LICENSE.txt" -.\" which should have been included with this file. If this file is -.\" file is missing or damaged, see the license at "http://www.cups.org/". -.\" -.TH commandtoescpx 1 "CUPS" "9 March 2009" "Apple Inc." -.SH NAME -commandtoescpx \- enhanced esc/p command filter for cups -.SH SYNOPSIS -.B commandtoescpx -jobid user title copies options [ -.I filename.ras -] -.SH DESCRIPTION -\fIcommandtoescpx\fR converts a CUPS command file to ESC/P or -ESC/P2. It is used to support printing to a variety of EPSON and -EPSON-compatible printers and plotters. -.SH SEE ALSO -ppdc(1), ppdhtml(1), ppdi(1), ppdmerge(1), ppdpo(1), ppdcfile(5), CUPS Driver Developer Kit Manual. -.SH COPYRIGHT -Copyright 2007-2009 by Apple Inc. -.\" -.\" End of "$Id: commandtoescpx.man 7600 2008-05-20 21:06:23Z mike $". -.\" diff --git a/man/commandtopclx.man b/man/commandtopclx.man deleted file mode 100644 index 9288ad210..000000000 --- a/man/commandtopclx.man +++ /dev/null @@ -1,33 +0,0 @@ -.\" -.\" "$Id: commandtopclx.man 7600 2008-05-20 21:06:23Z mike $" -.\" -.\" commandtopclx man page for the CUPS Driver Development Kit. -.\" -.\" Copyright 2007-2009 by Apple Inc. -.\" Copyright 1997-2007 by Easy Software Products. -.\" -.\" These coded instructions, statements, and computer programs are the -.\" property of Apple Inc. and are protected by Federal copyright -.\" law. Distribution and use rights are outlined in the file "LICENSE.txt" -.\" which should have been included with this file. If this file is -.\" file is missing or damaged, see the license at "http://www.cups.org/". -.\" -.TH commandtopclx 1 "CUPS" "9 March 2009" "Apple Inc." -.SH NAME -commandtopclx \- enhanced pcl command filter for cups -.SH SYNOPSIS -.B commandtopclx -jobid user title copies options [ -.I filename.ras -] -.SH DESCRIPTION -\fIcommandtopclx\fR converts a CUPS command file to HP-PCL. It is -used to support printing to a variety of HP and HP-compatible -printers and plotters. -.SH SEE ALSO -ppdc(1), ppdhtml(1), ppdi(1), ppdmerge(1), ppdpo(1), ppdcfile(5), CUPS Driver Developer Kit Manual. -.SH COPYRIGHT -Copyright 2007-2009 by Apple Inc. -.\" -.\" End of "$Id: commandtopclx.man 7600 2008-05-20 21:06:23Z mike $". -.\" diff --git a/man/cupsd.conf.man.in b/man/cupsd.conf.man.in index a2153b9a6..430df4c87 100644 --- a/man/cupsd.conf.man.in +++ b/man/cupsd.conf.man.in @@ -442,6 +442,11 @@ Listens to the specified address and port or domain socket path. .br Specifies access control for the named location. .TP 5 +LogDebugHistory #-messages +.br +Specifies the number of debugging messages that are logged when an error +occurs in a print job. +.TP 5 LogFilePerm mode .br Specifies the permissions for all log files that the scheduler writes. diff --git a/man/filter.man b/man/filter.man index 4d8bec9dd..a66e05562 100644 --- a/man/filter.man +++ b/man/filter.man @@ -12,7 +12,7 @@ .\" which should have been included with this file. If this file is .\" file is missing or damaged, see the license at "http://www.cups.org/". .\" -.TH filter 7 "CUPS" "18 September 2008" "Apple Inc." +.TH filter 7 "CUPS" "13 May 2009" "Apple Inc." .SH NAME filter \- cups file conversion filter interface .SH SYNOPSIS @@ -31,7 +31,24 @@ or from the standard input, copying the standard input to a temporary file as required by the file format. All output \fBmust\fR be sent to the standard output. .LP -The command name (argv[0]) is set to the name of the destination printer. +The command name (argv[0]) is set to the name of the destination printer but is +also available in the PRINTER environment variable. + +.SH OPTIONS +Options passed on the command-line typically do not include the default choices +the printer's PPD file. In addition, some options may be specified in multiple +ways - "landscape" is a synonym for "orientation-requested=4", "media" is a +synonym for "PageSize", "PageRegion", "InputSlot", and "MediaType", and "sides" +is a synonym for the various "Duplex" options. Non-raster filters \fBmust\fR +support both explicit and implicit specification of PPD options - use the +ppdMarkDefaults and cupsMarkOptions functions in the CUPS library to use the +correct mapping, and ppdFindMarkedChoice to get the user-selected choice. +.LP +Raster filters should use option choices set through the raster page header, as +those reflect the options in effect for a given page. Options specified on the +command-line determine the default values for the entire job, which can be +overridden on a per-page basis. + .SH LOG MESSAGES Messages sent to stderr are generally logged to printer-state-message attribute and the current \fIErrorLog\fR. @@ -229,7 +246,7 @@ scripts, it will only work with the System V interface script as the only filter. Typically the interface script will be provided via the \fIlpadmin(8)\fR command using the \fI-i\fR option. .SH SEE ALSO -\fIbackend(1)\fR, \fIcupsd(8)\fR, +\fIbackend(7)\fR, \fIcupsd(8)\fR, .br http://localhost:631/help .SH COPYRIGHT diff --git a/man/mantohtml.c b/man/mantohtml.c index ff9c67501..dd672d507 100644 --- a/man/mantohtml.c +++ b/man/mantohtml.c @@ -109,12 +109,8 @@ main(int argc, /* I - Number of command-line args */ "\n" "\n" "\n" - "\t\n", outfile); + "\t\n", outfile); blist = 0; font = 0; @@ -153,8 +149,9 @@ main(int argc, /* I - Number of command-line args */ "\t%s(%d)\n" "\n" "\n" + "

                    %s(%d)

                    \n" "%s", - name, section, start_fonts[font]); + name, section, name, section, start_fonts[font]); } else if (section < 0) continue; @@ -188,9 +185,9 @@ main(int argc, /* I - Number of command-line args */ line[strlen(line) - 1] = '\0'; /* Strip LF */ if (line[2] == 'H') - fputs("

                    ", outfile); + fputs("\">", outfile); for (lineptr = line + 4; *lineptr; lineptr ++) if (*lineptr == '\"') diff --git a/man/rastertoescpx.man b/man/rastertoescpx.man deleted file mode 100644 index 042ce66be..000000000 --- a/man/rastertoescpx.man +++ /dev/null @@ -1,35 +0,0 @@ -.\" -.\" "$Id: rastertoescpx.man 7600 2008-05-20 21:06:23Z mike $" -.\" -.\" rastertoescpx man page for the Common UNIX Printing System. -.\" -.\" Copyright 2007-2009 by Apple Inc. -.\" Copyright 1997-2007 by Easy Software Products. -.\" -.\" These coded instructions, statements, and computer programs are the -.\" property of Apple Inc. and are protected by Federal copyright -.\" law. Distribution and use rights are outlined in the file "LICENSE.txt" -.\" which should have been included with this file. If this file is -.\" file is missing or damaged, see the license at "http://www.cups.org/". -.\" -.TH rastertoescpx 1 "CUPS" "20 May 2008" "Apple Inc." -.SH NAME -rastertoescpx \- enhanced esc/p raster driver for cups -.SH SYNOPSIS -.B rastertoescpx -jobid user title copies options [ -.I filename.ras -] -.SH DESCRIPTION -\fIrastertoescpx\fR converts a CUPS raster stream to ESC/P or -ESC/P2. It is used to support printing to a variety of EPSON and -EPSON-compatible printers and plotters. -.SH SEE ALSO -ppdc(1), ppdhtml(1), ppdi(1), ppdmerge(1), ppdpo(1), ppdcfile(5) -.br -http://localhost:631/help -.SH COPYRIGHT -Copyright 2007-2009 by Apple Inc. -.\" -.\" End of "$Id: rastertoescpx.man 7600 2008-05-20 21:06:23Z mike $". -.\" diff --git a/man/rastertopclx.man b/man/rastertopclx.man deleted file mode 100644 index aa9ee567e..000000000 --- a/man/rastertopclx.man +++ /dev/null @@ -1,35 +0,0 @@ -.\" -.\" "$Id: rastertopclx.man 7600 2008-05-20 21:06:23Z mike $" -.\" -.\" rastertopclx man page for the Common UNIX Printing System. -.\" -.\" Copyright 2007-2009 by Apple Inc. -.\" Copyright 1997-2007 by Easy Software Products. -.\" -.\" These coded instructions, statements, and computer programs are the -.\" property of Apple Inc. and are protected by Federal copyright -.\" law. Distribution and use rights are outlined in the file "LICENSE.txt" -.\" which should have been included with this file. If this file is -.\" file is missing or damaged, see the license at "http://www.cups.org/". -.\" -.TH rastertopclx 1 "CUPS" "20 May 2008" "Apple Inc." -.SH NAME -rastertopclx \- enhanced pcl raster driver for cups -.SH SYNOPSIS -.B rastertopclx -jobid user title copies options [ -.I filename.ras -] -.SH DESCRIPTION -\fIrastertopclx\fR converts a CUPS raster stream to HP-PCL and HP-RTL. It is -used to support printing to a variety of HP and HP-compatible -printers and plotters. -.SH SEE ALSO -ppdc(1), ppdhtml(1), ppdi(1), ppdmerge(1), ppdpo(1), ppdcfile(5) -.br -http://localhost:631/help -.SH COPYRIGHT -Copyright 2007-2009 by Apple Inc. -.\" -.\" End of "$Id: rastertopclx.man 7600 2008-05-20 21:06:23Z mike $". -.\" diff --git a/packaging/cups.list.in b/packaging/cups.list.in index 0fa0917fe..5c441247f 100644 --- a/packaging/cups.list.in +++ b/packaging/cups.list.in @@ -700,13 +700,7 @@ f 0644 root sys $MANDIR/man5/mime.convs.$MAN5EXT man/mime.convs.$MAN5EXT f 0644 root sys $MANDIR/man5/mime.types.$MAN5EXT man/mime.types.$MAN5EXT f 0644 root sys $MANDIR/man5/printers.conf.$MAN5EXT man/printers.conf.$MAN5EXT -f 0644 root sys $MANDIR/man7/backend.$MAN7EXT man/backend.$MAN7EXT -f 0644 root sys $MANDIR/man7/commandtoescpx.$MAN7EXT man/commandtoescpx.$MAN7EXT -f 0644 root sys $MANDIR/man7/commandtopclx.$MAN7EXT man/commandtopclx.$MAN7EXT f 0644 root sys $MANDIR/man7/drv.$MAN7EXT man/drv.$MAN7EXT -f 0644 root sys $MANDIR/man7/filter.$MAN7EXT man/filter.$MAN7EXT -f 0644 root sys $MANDIR/man7/rastertoescpx.$MAN7EXT man/rastertoescpx.$MAN7EXT -f 0644 root sys $MANDIR/man7/rastertopclx.$MAN7EXT man/rastertopclx.$MAN7EXT l 0644 root sys $AMANDIR/man$MAN8DIR/accept.$MAN8EXT cupsaccept.$MAN8EXT f 0644 root sys $AMANDIR/man$MAN8DIR/cupsaccept.$MAN8EXT man/cupsaccept.$MAN8EXT @@ -730,6 +724,9 @@ l 0644 root sys $AMANDIR/man$MAN8DIR/reject.$MAN8EXT cupsaccept.$MAN8EXT f 0644 root sys $MANDIR/man1/cups-config.$MAN1EXT man/cups-config.$MAN1EXT f 0644 root sys $MANDIR/man1/ man/ppd*.$MAN1EXT f 0644 root sys $MANDIR/man5/ppdcfile.$MAN5EXT man/ppdcfile.$MAN5EXT +f 0644 root sys $MANDIR/man7/backend.$MAN7EXT man/backend.$MAN7EXT +f 0644 root sys $MANDIR/man7/filter.$MAN7EXT man/filter.$MAN7EXT +f 0644 root sys $MANDIR/man7/notifier.$MAN7EXT man/notifier.$MAN7EXT %subpackage lpd d 0755 root sys $AMANDIR/man$MAN8DIR - diff --git a/packaging/cups.spec.in b/packaging/cups.spec.in index 09ab796f3..002393bd2 100644 --- a/packaging/cups.spec.in +++ b/packaging/cups.spec.in @@ -280,9 +280,7 @@ rm -rf $RPM_BUILD_ROOT /usr/share/man/man5/*.conf.5.gz /usr/share/man/man5/mime.*.5.gz %dir /usr/share/man/man7 -/usr/share/man/man7/commandto* /usr/share/man/man7/drv* -/usr/share/man/man7/rasterto* %dir /usr/share/man/man8 /usr/share/man/man8/accept.8.gz /usr/share/man/man8/cupsaddsmb.8.gz @@ -325,6 +323,7 @@ rm -rf $RPM_BUILD_ROOT /usr/share/man/man5/ppdcfile.5.gz /usr/share/man/man7/backend.7.gz /usr/share/man/man7/filter.7.gz +/usr/share/man/man7/notifier.7.gz /usr/bin/cups-config /usr/bin/ppd* diff --git a/ppdc/api-ppdc.header b/ppdc/api-ppdc.header new file mode 100644 index 000000000..418686560 --- /dev/null +++ b/ppdc/api-ppdc.header @@ -0,0 +1,34 @@ + + +

                    PPD Compiler API

                    + +

                    + + + + + + + + + + + + + + + + +
                    Headercups/ppdc.h
                    Library-lcupsppdc
                    See AlsoProgramming: Introduction to CUPS Programming
                    diff --git a/ppdc/api-ppdc.shtml b/ppdc/api-ppdc.shtml new file mode 100644 index 000000000..e305dcb9d --- /dev/null +++ b/ppdc/api-ppdc.shtml @@ -0,0 +1,18 @@ + + +

                    Overview

                    + +

                    The PPD Compiler API provides access to CUPS driver information files and +methods for generating and importing PPD files.

                    diff --git a/scheduler/api-mime.header b/scheduler/api-mime.header new file mode 100644 index 000000000..8d5db2ad6 --- /dev/null +++ b/scheduler/api-mime.header @@ -0,0 +1,34 @@ + + +

                    MIME API

                    + +
                    + + + + + + + + + + + + + + + + +
                    Headercups/mime.h
                    Library-lcupsmime
                    See AlsoProgramming: Introduction to CUPS Programming
                    diff --git a/scheduler/api-mime.shtml b/scheduler/api-mime.shtml new file mode 100644 index 000000000..7d3125fad --- /dev/null +++ b/scheduler/api-mime.shtml @@ -0,0 +1,17 @@ + + +

                    Overview

                    + +

                    The MIME API provides file typing and conversion services for CUPS.

                    diff --git a/scheduler/conf.c b/scheduler/conf.c index efc3a6b84..0e915b4f7 100644 --- a/scheduler/conf.c +++ b/scheduler/conf.c @@ -132,6 +132,7 @@ static const cupsd_var_t variables[] = #endif /* HAVE_LAUNCHD */ { "LimitRequestBody", &MaxRequestSize, CUPSD_VARTYPE_INTEGER }, { "ListenBackLog", &ListenBackLog, CUPSD_VARTYPE_INTEGER }, + { "LogDebugHistory", &LogDebugHistory, CUPSD_VARTYPE_INTEGER }, { "LogFilePerm", &LogFilePerm, CUPSD_VARTYPE_INTEGER }, { "LPDConfigFile", &LPDConfigFile, CUPSD_VARTYPE_STRING }, { "MaxActiveJobs", &MaxActiveJobs, CUPSD_VARTYPE_INTEGER }, @@ -619,6 +620,7 @@ cupsdReadConfiguration(void) KeepAlive = TRUE; KeepAliveTimeout = DEFAULT_KEEPALIVE; ListenBackLog = SOMAXCONN; + LogDebugHistory = 200; LogFilePerm = CUPS_DEFAULT_LOG_FILE_PERM; LogLevel = CUPSD_LOG_WARN; LogTimeFormat = CUPSD_TIME_STANDARD; diff --git a/scheduler/conf.h b/scheduler/conf.h index 582a152c2..c30f97a5e 100644 --- a/scheduler/conf.h +++ b/scheduler/conf.h @@ -168,6 +168,8 @@ VAR int ClassifyOverride VALUE(0), /* Allow overrides? */ ConfigFilePerm VALUE(0640), /* Permissions for config files */ + LogDebugHistory VALUE(200), + /* Amount of automatic debug history */ FatalErrors VALUE(CUPSD_FATAL_CONFIG), /* Which errors are fatal? */ LogFilePerm VALUE(0644); diff --git a/scheduler/cups-driverd.cxx b/scheduler/cups-driverd.cxx index a7498b5d2..7383145cc 100644 --- a/scheduler/cups-driverd.cxx +++ b/scheduler/cups-driverd.cxx @@ -23,6 +23,7 @@ * cat_drv() - Generate a PPD from a driver info file. * cat_ppd() - Copy a PPD file to stdout. * copy_static() - Copy a static PPD file to stdout. + * compare_inodes() - Compare two inodes. * compare_matches() - Compare PPD match scores for sorting. * compare_names() - Compare PPD filenames for sorting. * compare_ppds() - Compare PPD file make and model names for sorting. @@ -114,7 +115,8 @@ typedef struct /**** In-memory record ****/ * Globals... */ -cups_array_t *PPDsByName = NULL, /* PPD files sorted by filename and name */ +cups_array_t *Inodes = NULL, /* Inodes of directories we've visited */ + *PPDsByName = NULL, /* PPD files sorted by filename and name */ *PPDsByMakeModel = NULL;/* PPD files sorted by make and model */ int ChangedPPD; /* Did we change the PPD database? */ @@ -133,6 +135,7 @@ static ppd_info_t *add_ppd(const char *filename, const char *name, static int cat_drv(const char *name, int request_id); static int cat_ppd(const char *name, int request_id); static int cat_static(const char *name, int request_id); +static int compare_inodes(struct stat *a, struct stat *b); static int compare_matches(const ppd_info_t *p0, const ppd_info_t *p1); static int compare_names(const ppd_info_t *p0, @@ -660,6 +663,21 @@ cat_static(const char *name, /* I - PPD name */ } +/* + * 'compare_inodes()' - Compare two inodes. + */ + +static int /* O - Result of comparison */ +compare_inodes(struct stat *a, /* I - First inode */ + struct stat *b) /* I - Second inode */ +{ + if (a->st_dev != b->st_dev) + return (a->st_dev - b->st_dev); + else + return (a->st_ino - b->st_ino); +} + + /* * 'compare_matches()' - Compare PPD match scores for sorting. */ @@ -839,6 +857,8 @@ list_ppds(int request_id, /* I - Request ID */ if ((cups_datadir = getenv("CUPS_DATADIR")) == NULL) cups_datadir = CUPS_DATADIR; + Inodes = cupsArrayNew((cups_array_func_t)compare_inodes, NULL); + snprintf(model, sizeof(model), "%s/model", cups_datadir); load_ppds(model, "", 1); @@ -1323,6 +1343,8 @@ load_ppds(const char *d, /* I - Actual directory */ const char *p, /* I - Virtual path in name */ int descend) /* I - Descend into directories? */ { + struct stat dinfo, /* Directory information */ + *dinfoptr; /* Pointer to match */ int i; /* Looping var */ cups_file_t *fp; /* Pointer to file */ cups_dir_t *dir; /* Directory pointer */ @@ -1382,7 +1404,32 @@ load_ppds(const char *d, /* I - Actual directory */ }; - fprintf(stderr, "DEBUG: [cups-driverd] Loading \"%s\"...\n", d); + /* + * See if we've loaded this directory before... + */ + + if (stat(d, &dinfo)) + { + if (errno != ENOENT) + fprintf(stderr, "ERROR: [cups-driverd] Unable to stat \"%s\": %s\n", d, + strerror(errno)); + + return (0); + } + else if (cupsArrayFind(Inodes, &dinfo)) + { + fprintf(stderr, "ERROR: [cups-driverd] Skipping \"%s\": loop detected!\n", + d); + return (0); + } + + /* + * Nope, add it to the Inodes array and continue... + */ + + dinfoptr = (struct stat *)malloc(sizeof(struct stat)); + memcpy(dinfoptr, &dinfo, sizeof(struct stat)); + cupsArrayAdd(Inodes, dinfoptr); if ((dir = cupsDirOpen(d)) == NULL) { @@ -1394,6 +1441,8 @@ load_ppds(const char *d, /* I - Actual directory */ return (0); } + fprintf(stderr, "DEBUG: [cups-driverd] Loading \"%s\"...\n", d); + while ((dent = cupsDirRead(dir)) != NULL) { /* diff --git a/scheduler/dirsvc.c b/scheduler/dirsvc.c index 11be5585e..29ff94743 100644 --- a/scheduler/dirsvc.c +++ b/scheduler/dirsvc.c @@ -102,6 +102,8 @@ */ static char *dequote(char *d, const char *s, int dlen); +static char *get_auth_info_required(cupsd_printer_t *p, char *buffer, + size_t bufsize); #ifdef __APPLE__ static int get_hostconfig(const char *name); #endif /* __APPLE__ */ @@ -2304,13 +2306,12 @@ dnssdBuildTxtRecord( cupsd_printer_t *p, /* I - Printer information */ int for_lpd) /* I - 1 = LPD, 0 = IPP */ { - int i, j; /* Looping vars */ + int i; /* Looping var */ char type_str[32], /* Type to string buffer */ state_str[32], /* State to string buffer */ rp_str[1024], /* Queue name string buffer */ air_str[1024], /* auth-info-required string buffer */ *keyvalue[32][2]; /* Table of key/value pairs */ - ipp_attribute_t *air_attr; /* auth-info-required attribute */ /* @@ -2420,26 +2421,8 @@ dnssdBuildTxtRecord( keyvalue[i ][0] = "pdl"; keyvalue[i++][1] = p->pdl ? p->pdl : "application/postscript"; - if ((air_attr = ippFindAttribute(p->attrs, "auth-info-required", - IPP_TAG_KEYWORD)) != NULL && - strcmp(air_attr->values[0].string.text, "none")) + if (get_auth_info_required(p, air_str, sizeof(air_str))) { - char *air = air_str; /* Pointer into string */ - - - for (j = 0; j < air_attr->num_values; j ++) - { - if (air >= (air_str + sizeof(air_str) - 2)) - break; - - if (j) - *air++ = ','; - - strlcpy(air, air_attr->values[j].string.text, - sizeof(air_str) - (air - air_str)); - air += strlen(air); - } - keyvalue[i ][0] = "air"; keyvalue[i++][1] = air_str; } @@ -2927,6 +2910,85 @@ dnssdUpdate(void) #endif /* HAVE_DNSSD */ +/* + * 'get_auth_info_required()' - Get the auth-info-required value to advertise. + */ + +static char * /* O - String or NULL if none */ +get_auth_info_required( + cupsd_printer_t *p, /* I - Printer */ + char *buffer, /* I - Value buffer */ + size_t bufsize) /* I - Size of value buffer */ +{ + cupsd_location_t *auth; /* Pointer to authentication element */ + char resource[1024]; /* Printer/class resource path */ + + + /* + * If auth-info-required is set for this printer, return that... + */ + + if (p->num_auth_info_required > 0 && strcmp(p->auth_info_required[0], "none")) + { + int i; /* Looping var */ + char *bufptr; /* Pointer into buffer */ + + for (i = 0, bufptr = buffer; i < p->num_auth_info_required; i ++) + { + if (bufptr >= (buffer + bufsize - 2)) + break; + + if (i) + *bufptr++ = ','; + + strlcpy(bufptr, p->auth_info_required[i], bufsize - (bufptr - buffer)); + bufptr += strlen(bufptr); + } + + return (buffer); + } + + /* + * Figure out the authentication data requirements to advertise... + */ + + if (p->type & CUPS_PRINTER_CLASS) + snprintf(resource, sizeof(resource), "/classes/%s", p->name); + else + snprintf(resource, sizeof(resource), "/printers/%s", p->name); + + if ((auth = cupsdFindBest(resource, HTTP_POST)) == NULL || + auth->type == CUPSD_AUTH_NONE) + auth = cupsdFindPolicyOp(p->op_policy_ptr, IPP_PRINT_JOB); + + if (auth) + { + int auth_type; /* Authentication type */ + + if ((auth_type = auth->type) == CUPSD_AUTH_DEFAULT) + auth_type = DefaultAuthType; + + switch (auth_type) + { + case CUPSD_AUTH_NONE : + return (NULL); + + case CUPSD_AUTH_NEGOTIATE : + strlcpy(buffer, "negotiate", bufsize); + break; + + default : + strlcpy(buffer, "username,password", bufsize); + break; + } + + return (buffer); + } + + return (NULL); +} + + #ifdef __APPLE__ /* * 'get_hostconfig()' - Get an /etc/hostconfig service setting. @@ -3687,8 +3749,9 @@ send_cups_browse(cupsd_printer_t *p) /* I - Printer to send */ uri[1024], /* Printer URI */ location[1024], /* printer-location */ info[1024], /* printer-info */ - make_model[1024]; + make_model[1024], /* printer-make-and-model */ + air[1024]; /* auth-info-required */ cupsd_netif_t *iface; /* Network interface */ @@ -3726,6 +3789,11 @@ send_cups_browse(cupsd_printer_t *p) /* I - Printer to send */ else strlcpy(make_model, "Local System V Printer", sizeof(make_model)); + if (get_auth_info_required(p, packet, sizeof(packet))) + snprintf(air, sizeof(air), " auth-info-required=%s", packet); + else + air[0] = '\0'; + /* * Send a packet to each browse address... */ @@ -3762,9 +3830,9 @@ send_cups_browse(cupsd_printer_t *p) /* I - Printer to send */ (p->type & CUPS_PRINTER_CLASS) ? "/classes/%s" : "/printers/%s", p->name); - snprintf(packet, sizeof(packet), "%x %x %s \"%s\" \"%s\" \"%s\" %s\n", + snprintf(packet, sizeof(packet), "%x %x %s \"%s\" \"%s\" \"%s\" %s%s\n", type, p->state, uri, location, info, make_model, - p->browse_attrs ? p->browse_attrs : ""); + p->browse_attrs ? p->browse_attrs : "", air); bytes = strlen(packet); @@ -3803,9 +3871,10 @@ send_cups_browse(cupsd_printer_t *p) /* I - Printer to send */ (p->type & CUPS_PRINTER_CLASS) ? "/classes/%s" : "/printers/%s", p->name); - snprintf(packet, sizeof(packet), "%x %x %s \"%s\" \"%s\" \"%s\" %s\n", + snprintf(packet, sizeof(packet), + "%x %x %s \"%s\" \"%s\" \"%s\" %s%s\n", type, p->state, uri, location, info, make_model, - p->browse_attrs ? p->browse_attrs : ""); + p->browse_attrs ? p->browse_attrs : "", air); bytes = strlen(packet); @@ -3828,9 +3897,9 @@ send_cups_browse(cupsd_printer_t *p) /* I - Printer to send */ * the default server name... */ - snprintf(packet, sizeof(packet), "%x %x %s \"%s\" \"%s\" \"%s\" %s\n", + snprintf(packet, sizeof(packet), "%x %x %s \"%s\" \"%s\" \"%s\" %s%s\n", type, p->state, p->uri, location, info, make_model, - p->browse_attrs ? p->browse_attrs : ""); + p->browse_attrs ? p->browse_attrs : "", air); bytes = strlen(packet); cupsdLogMessage(CUPSD_LOG_DEBUG2, diff --git a/scheduler/job.c b/scheduler/job.c index 19e0af1aa..7f3fa355f 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -45,6 +45,8 @@ * compare_active_jobs() - Compare the job IDs and priorities of two * jobs. * compare_jobs() - Compare the job IDs of two jobs. + * dump_job_history() - Dump any debug messages for a job. + * free_job_history() - Free any log history. * finalize_job() - Cleanup after job filter processes and support * data. * get_options() - Get a string containing the job options. @@ -165,7 +167,9 @@ static mime_filter_t gziptoany_filter = static int compare_active_jobs(void *first, void *second, void *data); static int compare_jobs(void *first, void *second, void *data); +static void dump_job_history(cupsd_job_t *job); static void finalize_job(cupsd_job_t *job); +static void free_job_history(cupsd_job_t *job); static char *get_options(cupsd_job_t *job, int banner_page, char *copies, size_t copies_size, char *title, size_t title_size); @@ -1206,6 +1210,9 @@ cupsdContinueJob(cupsd_job_t *job) /* I - Job */ cupsdSetPrinterState(job->printer, IPP_PRINTER_IDLE, 0); update_job_attrs(job, 0); + if (job->history) + free_job_history(job); + cupsArrayRemove(PrintingJobs, job); /* @@ -1269,6 +1276,9 @@ cupsdDeleteJob(cupsd_job_t *job, /* I - Job */ job->num_files = 0; } + if (job->history) + free_job_history(job); + unload_job(job); cupsArrayRemove(Jobs, job); @@ -2477,6 +2487,140 @@ compare_jobs(void *first, /* I - First job */ } +/* + * 'dump_job_history()' - Dump any debug messages for a job. + */ + +static void +dump_job_history(cupsd_job_t *job) /* I - Job */ +{ + int i, /* Looping var */ + oldsize; /* Current MaxLogSize */ + struct tm *date; /* Date/time value */ + cupsd_joblog_t *message; /* Current message */ + char temp[2048], /* Log message */ + *ptr, /* Pointer into log message */ + start[256], /* Start time */ + end[256]; /* End time */ + cupsd_printer_t *printer; /* Printer for job */ + + + /* + * See if we have anything to dump... + */ + + if (!job->history) + return; + + /* + * Disable log rotation temporarily... + */ + + oldsize = MaxLogSize; + MaxLogSize = 0; + + /* + * Copy the debug messages to the log... + */ + + message = (cupsd_joblog_t *)cupsArrayFirst(job->history); + date = localtime(&(message->time)); + strftime(start, sizeof(start), "%X", date); + + message = (cupsd_joblog_t *)cupsArrayLast(job->history); + date = localtime(&(message->time)); + strftime(end, sizeof(end), "%X", date); + + snprintf(temp, sizeof(temp), + "[Job %d] The following messages were recorded from %s to %s", + job->id, start, end); + cupsdWriteErrorLog(CUPSD_LOG_DEBUG, temp); + + for (message = (cupsd_joblog_t *)cupsArrayFirst(job->history); + message; + message = (cupsd_joblog_t *)cupsArrayNext(job->history)) + cupsdWriteErrorLog(CUPSD_LOG_DEBUG, message->message); + + snprintf(temp, sizeof(temp), "[Job %d] End of messages", job->id); + cupsdWriteErrorLog(CUPSD_LOG_DEBUG, temp); + + /* + * Log the printer state values... + */ + + if ((printer = job->printer) == NULL) + printer = cupsdFindDest(job->dest); + + if (printer) + { + snprintf(temp, sizeof(temp), "[Job %d] printer-state=%d(%s)", job->id, + printer->state, + printer->state == IPP_PRINTER_IDLE ? "idle" : + printer->state == IPP_PRINTER_PROCESSING ? "processing" : + "stopped"); + cupsdWriteErrorLog(CUPSD_LOG_DEBUG, temp); + + snprintf(temp, sizeof(temp), "[Job %d] printer-state-message=\"%s\"", + job->id, printer->state_message); + cupsdWriteErrorLog(CUPSD_LOG_DEBUG, temp); + + snprintf(temp, sizeof(temp), "[Job %d] printer-state-reasons=", job->id); + ptr = temp + strlen(temp); + if (printer->num_reasons == 0) + strlcpy(ptr, "none", sizeof(temp) - (ptr - temp)); + else + { + for (i = 0; + i < printer->num_reasons && ptr < (temp + sizeof(temp) - 2); + i ++) + { + if (i) + *ptr++ = ','; + + strlcpy(ptr, printer->reasons[i], sizeof(temp) - (ptr - temp)); + ptr += strlen(ptr); + } + } + cupsdWriteErrorLog(CUPSD_LOG_DEBUG, temp); + } + + /* + * Restore log file rotation... + */ + + MaxLogSize = oldsize; + + /* + * Free all messages... + */ + + free_job_history(job); +} + + +/* + * 'free_job_history()' - Free any log history. + */ + +static void +free_job_history(cupsd_job_t *job) /* I - Job */ +{ + char *message; /* Current message */ + + + if (!job->history) + return; + + for (message = (char *)cupsArrayFirst(job->history); + message; + message = (char *)cupsArrayNext(job->history)) + free(message); + + cupsArrayDelete(job->history); + job->history = NULL; +} + + /* * 'finalize_job()' - Cleanup after job filter processes and support data. */ @@ -2772,6 +2916,14 @@ finalize_job(cupsd_job_t *job) /* I - Job */ printer_state == IPP_PRINTER_STOPPED); update_job_attrs(job, 0); + if (job->history) + { + if (job->status) + dump_job_history(job); + else + free_job_history(job); + } + cupsArrayRemove(PrintingJobs, job); /* @@ -3767,7 +3919,8 @@ update_job(cupsd_job_t *job) /* I - Job to check */ { int i; /* Looping var */ int copies; /* Number of copies printed */ - char message[1024], /* Message text */ + char message[CUPSD_SB_BUFFER_SIZE], + /* Message text */ *ptr; /* Pointer update... */ int loglevel, /* Log level for message */ event = 0; /* Events? */ diff --git a/scheduler/job.h b/scheduler/job.h index 5d47056f8..16dd09ff7 100644 --- a/scheduler/job.h +++ b/scheduler/job.h @@ -29,7 +29,7 @@ typedef enum cupsd_jobaction_e /**** Actions for state changes ****/ * Job request structure... */ -struct cupsd_job_s +struct cupsd_job_s /**** Job request ****/ { int id, /* Job ID */ priority, /* Job priority */ @@ -77,6 +77,7 @@ struct cupsd_job_s *auth_password; /* AUTH_PASSWORD environment variable, * if any */ void *profile; /* Security profile */ + cups_array_t *history; /* Debug log history */ int progress; /* Printing progress */ #ifdef HAVE_GSSAPI krb5_ccache ccache; /* Kerberos credential cache */ @@ -84,6 +85,12 @@ struct cupsd_job_s #endif /* HAVE_GSSAPI */ }; +typedef struct cupsd_joblog_s /**** Job log message ****/ +{ + time_t time; /* Time of message */ + char message[1]; /* Message string */ +} cupsd_joblog_t; + /* * Globals... diff --git a/scheduler/log.c b/scheduler/log.c index a6ac179aa..15fcf972f 100644 --- a/scheduler/log.c +++ b/scheduler/log.c @@ -203,8 +203,9 @@ cupsdLogJob(cupsd_job_t *job, /* I - Job */ if (TestConfigFile || !ErrorLog) return (1); - if (level > LogLevel || - (level == CUPSD_LOG_INFO && LogLevel < CUPSD_LOG_DEBUG)) + if ((level > LogLevel || + (level == CUPSD_LOG_INFO && LogLevel < CUPSD_LOG_DEBUG)) && + LogDebugHistory <= 0) return (1); /* @@ -220,9 +221,55 @@ cupsdLogJob(cupsd_job_t *job, /* I - Job */ va_end(ap); } while (status == 0); - + if (status > 0) - return (cupsdWriteErrorLog(level, log_line)); + { + if ((level > LogLevel || + (level == CUPSD_LOG_INFO && LogLevel < CUPSD_LOG_DEBUG)) && + LogDebugHistory > 0) + { + /* + * Add message to the job history... + */ + + cupsd_joblog_t *temp; /* Copy of log message */ + + + if ((temp = malloc(sizeof(cupsd_joblog_t) + strlen(log_line))) != NULL) + { + temp->time = time(NULL); + strcpy(temp->message, log_line); + } + + if (!job->history) + job->history = cupsArrayNew(NULL, NULL); + + if (job->history && temp) + { + cupsArrayAdd(job->history, temp); + + if (cupsArrayCount(job->history) > LogDebugHistory) + { + /* + * Remove excess messages... + */ + + temp = cupsArrayFirst(job->history); + cupsArrayRemove(job->history, temp); + free(temp); + } + } + else if (temp) + free(temp); + + return (1); + } + else if (level <= LogLevel && + (level != CUPSD_LOG_INFO || LogLevel >= CUPSD_LOG_DEBUG)) + return (cupsdWriteErrorLog(level, log_line)); + else + return (1); + } else return (cupsdWriteErrorLog(CUPSD_LOG_ERROR, "Unable to allocate memory for log line!")); diff --git a/scheduler/printers.c b/scheduler/printers.c index ba1be9b03..c5008eec8 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -2137,21 +2137,15 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */ ipp_attribute_t *attr; /* Attribute data */ cups_option_t *option; /* Current printer option */ char *filter; /* Current filter */ + static const char * const air_none[] = + { /* No authentication */ + "none" + }; static const char * const air_userpass[] = { /* Basic/Digest authentication */ "username", "password" }; -#ifdef HAVE_GSSAPI - static const char * const air_negotiate[] = - { /* Kerberos authentication */ - "negotiate" - }; -#endif /* HAVE_GSSAPI */ - static const char * const air_none[] = - { /* No authentication */ - "none" - }; DEBUG_printf(("cupsdSetPrinterAttrs: entering name = %s, type = %x\n", p->name, @@ -2182,65 +2176,50 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */ { num_air = p->num_auth_info_required; air = p->auth_info_required; - - if (!strcmp(air[0], "username")) - auth_supported = "basic"; - else - auth_supported = "negotiate"; } - else if (!(p->type & CUPS_PRINTER_DISCOVERED)) + else if ((p->type & CUPS_PRINTER_AUTHENTICATED) && + (p->type & CUPS_PRINTER_DISCOVERED)) { - if (p->type & CUPS_PRINTER_CLASS) - snprintf(resource, sizeof(resource), "/classes/%s", p->name); - else - snprintf(resource, sizeof(resource), "/printers/%s", p->name); + num_air = 2; + air = air_userpass; + } - if ((auth = cupsdFindBest(resource, HTTP_POST)) == NULL || - auth->type == CUPSD_AUTH_NONE) - auth = cupsdFindPolicyOp(p->op_policy_ptr, IPP_PRINT_JOB); + if (p->type & CUPS_PRINTER_CLASS) + snprintf(resource, sizeof(resource), "/classes/%s", p->name); + else + snprintf(resource, sizeof(resource), "/printers/%s", p->name); - if (auth) - { - int auth_type; /* Authentication type */ + if ((auth = cupsdFindBest(resource, HTTP_POST)) == NULL || + auth->type == CUPSD_AUTH_NONE) + auth = cupsdFindPolicyOp(p->op_policy_ptr, IPP_PRINT_JOB); + if (auth) + { + int auth_type; /* Authentication type */ - if ((auth_type = auth->type) == CUPSD_AUTH_DEFAULT) - auth_type = DefaultAuthType; - if (auth_type == CUPSD_AUTH_BASIC || auth_type == CUPSD_AUTH_BASICDIGEST) - { - auth_supported = "basic"; - num_air = 2; - air = air_userpass; - } - else if (auth_type == CUPSD_AUTH_DIGEST) - { - auth_supported = "digest"; - num_air = 2; - air = air_userpass; - } + if ((auth_type = auth->type) == CUPSD_AUTH_DEFAULT) + auth_type = DefaultAuthType; + + if (auth_type == CUPSD_AUTH_BASIC || auth_type == CUPSD_AUTH_BASICDIGEST) + auth_supported = "basic"; + else if (auth_type == CUPSD_AUTH_DIGEST) + auth_supported = "digest"; #ifdef HAVE_GSSAPI - else if (auth_type == CUPSD_AUTH_NEGOTIATE) - { - auth_supported = "negotiate"; - num_air = 1; - air = air_negotiate; - } + else if (auth_type == CUPSD_AUTH_NEGOTIATE) + auth_supported = "negotiate"; #endif /* HAVE_GSSAPI */ + if (!(p->type & CUPS_PRINTER_DISCOVERED)) + { if (auth_type != CUPSD_AUTH_NONE) - p->type |= CUPS_PRINTER_AUTHENTICATED; + p->type |= CUPS_PRINTER_AUTHENTICATED; else - p->type &= ~CUPS_PRINTER_AUTHENTICATED; + p->type &= ~CUPS_PRINTER_AUTHENTICATED; } - else - p->type &= ~CUPS_PRINTER_AUTHENTICATED; - } - else if (p->type & CUPS_PRINTER_AUTHENTICATED) - { - num_air = 2; - air = air_userpass; } + else if (!(p->type & CUPS_PRINTER_DISCOVERED)) + p->type &= ~CUPS_PRINTER_AUTHENTICATED; /* * Create the required IPP attributes for a printer... @@ -2550,14 +2529,6 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */ if (BrowseLocalOptions) length += 12 + strlen(BrowseLocalOptions); - if (p->num_auth_info_required > 0) - { - length += 18; /* auth-info-required */ - - for (i = 0; i < p->num_auth_info_required; i ++) - length += strlen(p->auth_info_required[i]) + 1; - } - /* * Allocate the new string... */ @@ -2603,21 +2574,6 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */ } } } - - if (p->num_auth_info_required > 0) - { - strcpy(attrptr, "auth-info-required"); - attrptr += 18; - - for (i = 0; i < p->num_auth_info_required; i ++) - { - *attrptr++ = i ? ',' : '='; - strcpy(attrptr, p->auth_info_required[i]); - attrptr += strlen(attrptr); - } - } - else - *attrptr = '\0'; } } @@ -2750,11 +2706,12 @@ cupsdSetPrinterReasons( cupsdSetPrinterState(p, IPP_PRINTER_IDLE, 1); if (strcmp(reason, "connecting-to-device")) + { cupsdMarkDirty(CUPSD_DIRTY_PRINTERS); - if (PrintcapFormat == PRINTCAP_PLIST) - cupsdMarkDirty(CUPSD_DIRTY_PRINTCAP); - + if (PrintcapFormat == PRINTCAP_PLIST) + cupsdMarkDirty(CUPSD_DIRTY_PRINTCAP); + } break; } } @@ -2786,10 +2743,12 @@ cupsdSetPrinterReasons( cupsdSetPrinterState(p, IPP_PRINTER_STOPPED, 1); if (strcmp(reason, "connecting-to-device")) + { cupsdMarkDirty(CUPSD_DIRTY_PRINTERS); - if (PrintcapFormat == PRINTCAP_PLIST) - cupsdMarkDirty(CUPSD_DIRTY_PRINTCAP); + if (PrintcapFormat == PRINTCAP_PLIST) + cupsdMarkDirty(CUPSD_DIRTY_PRINTCAP); + } } } } @@ -4171,7 +4130,7 @@ load_ppd(cupsd_printer_t *p) /* I - Printer */ } ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, - "output-bin-default", NULL, output_bin->defchoice); + "output-bin-default", NULL, output_bin->defchoice); } /* diff --git a/scheduler/sysman.c b/scheduler/sysman.c index 74f1a0342..212f0fdd3 100644 --- a/scheduler/sysman.c +++ b/scheduler/sysman.c @@ -37,6 +37,9 @@ */ #include "cupsd.h" +#ifdef HAVE_VPROC_TRANSACTION_BEGIN +# include +#endif /* HAVE_VPROC_TRANSACTION_BEGIN */ /* @@ -138,6 +141,9 @@ cupsdSetBusyState(void) "Active clients and printing jobs", "Active clients, printing jobs, and dirty files" }; +#ifdef HAVE_VPROC_TRANSACTION_BEGIN + static vproc_transaction_t vtran = 0; /* Current busy transaction */ +#endif /* HAVE_VPROC_TRANSACTION_BEGIN */ newbusy = (DirtyCleanTime ? 1 : 0) | @@ -148,6 +154,16 @@ cupsdSetBusyState(void) { busy = newbusy; +#ifdef HAVE_VPROC_TRANSACTION_BEGIN + if (busy && !vtran) + vtran = vproc_transaction_begin(NULL); + else if (!busy && vtran) + { + vproc_transaction_end(NULL, vtran); + vtran = 0; + } +#endif /* HAVE_VPROC_TRANSACTION_BEGIN */ + cupsdLogMessage(CUPSD_LOG_DEBUG, "cupsdSetBusyState: %s", busy_text[busy]); } } diff --git a/standards/Makefile b/standards/Makefile index 9ae30e27b..53b2c1f98 100644 --- a/standards/Makefile +++ b/standards/Makefile @@ -21,7 +21,10 @@ include ../Makedefs # RFCS = \ + rfc1155.txt \ + rfc1157.txt \ rfc1179.txt \ + rfc1213.txt \ rfc1321.txt \ rfc2222.txt \ rfc2246.txt \ @@ -30,10 +33,12 @@ RFCS = \ rfc2567.txt \ rfc2568.txt \ rfc2569.txt \ + rfc2578.txt \ rfc2595.txt \ rfc2616.txt \ rfc2617.txt \ rfc2712.txt \ + rfc2790.txt \ rfc2817.txt \ rfc2818.txt \ rfc2821.txt \ @@ -49,11 +54,15 @@ RFCS = \ rfc3391.txt \ rfc3510.txt \ rfc3712.txt \ + rfc3805.txt \ + rfc3875.txt \ rfc3986.txt \ rfc3995.txt \ rfc3996.txt \ rfc3997.txt \ - rfc3998.txt + rfc3998.txt \ + rfc4122.txt \ + rfc4234.txt .SUFFIXES: .html .txt .txt.html: rfctohtml @@ -146,7 +155,7 @@ uninstall: rfctohtml: rfctohtml.o ../cups/libcups.a $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ rfctohtml.o ../cups/libcups.a \ - $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ) + $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ) # diff --git a/standards/rfctohtml.c b/standards/rfctohtml.c index 716b7d428..fc4daa2b3 100644 --- a/standards/rfctohtml.c +++ b/standards/rfctohtml.c @@ -48,6 +48,8 @@ main(int argc, /* I - Number of command-line args */ *outfile; /* Output file */ char line[1024], /* Line from file */ *lineptr, /* Pointer into line */ + title[2048], /* Title string */ + *titleptr, /* Pointer into title */ name[1024], /* Heading anchor name */ *nameptr; /* Pointer into anchor name */ int rfc, /* RFC # */ @@ -105,12 +107,8 @@ main(int argc, /* I - Number of command-line args */ "\n" "\n" "\n" - "\t\n"); + "\t\n"); /* * Skip the initial header stuff (working group ID, RFC #, authors, and @@ -152,7 +150,8 @@ main(int argc, /* I - Number of command-line args */ for (lineptr = line; isspace(*lineptr & 255); lineptr ++); - cupsFilePrintf(outfile, "RFC %d: %s", rfc, lineptr); + snprintf(title, sizeof(title), "RFC %d: %s", rfc, lineptr); + titleptr = title + strlen(title); while (cupsFileGets(infile, line, sizeof(line))) { @@ -163,13 +162,16 @@ main(int argc, /* I - Number of command-line args */ else { for (lineptr = line; isspace(*lineptr & 255); lineptr ++); - cupsFilePrintf(outfile, " %s", lineptr); + + snprintf(titleptr, sizeof(title) - (titleptr - title), " %s", lineptr); + titleptr += strlen(titleptr); } } - cupsFilePuts(outfile, "\n" - "\n" - "\n"); + cupsFilePrintf(outfile, "\t%s\n" + "\n" + "\n" + "

                    %s

                    \n", title, title); /* * Read the rest of the file... @@ -198,7 +200,7 @@ main(int argc, /* I - Number of command-line args */ if (inheading) { if (inheading < 0) - cupsFilePuts(outfile, "\n"); + cupsFilePuts(outfile, "\n"); else cupsFilePrintf(outfile, "\n", inheading); @@ -212,7 +214,7 @@ main(int argc, /* I - Number of command-line args */ if (inheading) { if (inheading < 0) - cupsFilePuts(outfile, "\n"); + cupsFilePuts(outfile, "\n"); else cupsFilePrintf(outfile, "\n", inheading); @@ -449,7 +451,12 @@ put_line(cups_file_t *fp, /* I - File */ { "MAY", "MUST", + "NEED", "NOT", + "OPTIONAL", + "OPTIONALLY", + "RECOMMENDED", + "REQUIRED", "SHALL", "SHOULD" }; @@ -469,7 +476,8 @@ put_line(cups_file_t *fp, /* I - File */ for (i = 0; i < (int)(sizeof(keywords) / sizeof(sizeof(keywords[0]))); i ++) { len = strlen(keywords[i]); - if (!strncmp(s, keywords[i], len) && (isspace(s[len] & 255) || !*s)) + if (!strncmp(s, keywords[i], len) && + (isspace(s[len] & 255) || ispunct(s[len] & 255) || !*s)) { cupsFilePrintf(fp, "%s", keywords[i]); s += len; diff --git a/templates/de/help-printable.tmpl b/templates/de/help-printable.tmpl index 08fff9ecd..2463c1630 100644 --- a/templates/de/help-printable.tmpl +++ b/templates/de/help-printable.tmpl @@ -7,5 +7,3 @@ - -

                    {HELPTITLE}

                    diff --git a/templates/es/help-printable.tmpl b/templates/es/help-printable.tmpl index 08fff9ecd..2463c1630 100644 --- a/templates/es/help-printable.tmpl +++ b/templates/es/help-printable.tmpl @@ -7,5 +7,3 @@ - -

                    {HELPTITLE}

                    diff --git a/templates/help-printable.tmpl b/templates/help-printable.tmpl index 08fff9ecd..2463c1630 100644 --- a/templates/help-printable.tmpl +++ b/templates/help-printable.tmpl @@ -7,5 +7,3 @@ - -

                    {HELPTITLE}

                    diff --git a/templates/ja/help-printable.tmpl b/templates/ja/help-printable.tmpl index 08fff9ecd..2463c1630 100644 --- a/templates/ja/help-printable.tmpl +++ b/templates/ja/help-printable.tmpl @@ -7,5 +7,3 @@ - -

                    {HELPTITLE}

                    diff --git a/templates/pl/help-printable.tmpl b/templates/pl/help-printable.tmpl index 08fff9ecd..2463c1630 100644 --- a/templates/pl/help-printable.tmpl +++ b/templates/pl/help-printable.tmpl @@ -7,5 +7,3 @@ - -

                    {HELPTITLE}

                    diff --git a/templates/ru/help-printable.tmpl b/templates/ru/help-printable.tmpl index 08fff9ecd..2463c1630 100644 --- a/templates/ru/help-printable.tmpl +++ b/templates/ru/help-printable.tmpl @@ -7,5 +7,3 @@ - -

                    {HELPTITLE}

                    -- 2.39.2