]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Merge changes from CUPS 1.4svn-r8679.
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Fri, 22 May 2009 21:50:50 +0000 (21:50 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Fri, 22 May 2009 21:50:50 +0000 (21:50 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@1531 a1ca3aef-8c08-0410-bb20-df032aa958be

34 files changed:
CHANGES-1.3.txt
CHANGES.txt
INSTALL.txt
README.txt
backend/usb-darwin.c
cgi-bin/websearch.c
conf/mime.convs.in
config-scripts/cups-common.m4
cups/api-filter.header
cups/conflicts.c
cups/cups.h
cups/http.h
cups/language.c
cups/page.c
cups/ppd.c
cups/ppd.h
cups/testlang.c
cups/testppd.c
doc/help/api-filter.html
doc/help/postscript-driver.html
doc/help/raster-driver.html
doc/help/ref-cupsd-conf.html.in
doc/help/ref-ppdcfile.html
doc/help/spec-ipp.html
doc/help/spec-ppd.html
filter/error.c
filter/interpret.c
filter/pdftops.c
filter/postscript-driver.shtml
filter/raster-driver.shtml
ppdc/ppdc-source.cxx
scheduler/cups-driverd.cxx
scheduler/ipp.c
tools/products.php [new file with mode: 0644]

index 1601f924ad01959eb83ace96e181884ad28570a0..d63ec681584e225a0e16d1a52237e83bc0c22e92 100644 (file)
@@ -3,6 +3,8 @@ CHANGES-1.3.txt
 
 CHANGES IN CUPS V1.3.11
 
+       - The pdftops filter did not print landscape PDF pages properly
+         (STR #2881)
        - The scheduler did not handle partial header lines properly from CGI
          programs (STR #3194)
        - The web interface could hang on OpenBSD (STR #3176, STR #3196)
index 70caf480035f0ee41acaed3e0941558495ad70e3..ffa97f5f2f11bd9cf6e6c422348090e8d138068e 100644 (file)
@@ -1,6 +1,24 @@
-CHANGES.txt - 2009-05-16
+CHANGES.txt - 2009-05-22
 ------------------------
 
+CHANGES IN CUPS V1.4rc1
+
+       - The PPD compiler now defines six variables: CUPS_VERSION,
+         CUPS_VERSION_MAJOR, CUPS_VERSION_MINOR, CUPS_VERSION_PATCH,
+         PLATFORM_NAME, and PLATFORM_ARCH (STR #3203)
+       - Fixed a whitespace skipping bug in cupsRasterInterpretPPD.
+       - The scheduler did not return HTTP 403 (Forbidden) for authenticated
+         users that were not authorized to do IPP operations (STR #3193)
+       - The scheduler did not report more than 8 Product strings from a PPD
+         file.  Some PPD files have as many as 24.
+       - ppdOpen*() could crash if a keyword had no value string (something
+         that cupstestppd looks for...)
+       - cupsLangDefault() did not return the correct language on Mac OS X.
+       - The Mac OS X USB backend did not handle aborted or stalled pipe
+         conditions properly, which prevented drivers from ejecting partial
+         pages when a job was canceled or held.
+
+
 CHANGES IN CUPS V1.4b3
 
        - Documentation fixes (STR #3044, STR #3057, STR #3153, STR #3158,
index ea7aba67e6466dd13dd896a3c5eb8f291c2a43e3..9bf6ecf6b133c19f131ee273592d861995e73660 100644 (file)
@@ -1,5 +1,5 @@
-INSTALL - CUPS v1.4b3 - 2009-04-20
-----------------------------------
+INSTALL - CUPS v1.4rc1 - 2009-05-22
+-----------------------------------
 
 This file describes how to compile and install CUPS from source code. For more
 information on CUPS see the file called "README.txt".  A complete change log can
index 98012921b81234c5e2574b9d9c31d4ab1d1809b5..6d4ed690da7ce41a84eef66d5677dd4b3e5d15e6 100644 (file)
@@ -1,18 +1,5 @@
-README - CUPS v1.4b3 - 2009-03-09
----------------------------------
-
-**********************************************************************
-**********************************************************************
-**********                                                  **********
-**********  THIS IS BETA-RELEASE SOFTWARE.  DO NOT USE ON   **********
-**********  PRODUCTION SYSTEMS!  REPORT PROBLEMS TO THE     **********
-**********  CUPS FORUMS OR BUG REPORTING PAGES:             **********
-**********                                                  **********
-**********    http://www.cups.org/newsgroups.php (FORUMS)   **********
-**********    http://www.cups.org/str.php        (BUGS)     **********
-**********                                                  **********
-**********************************************************************
-**********************************************************************
+README - CUPS v1.4rc1 - 2009-05-22
+----------------------------------
 
 Looking for compile instructions?  Read the file "INSTALL.txt"
 instead...
@@ -20,13 +7,13 @@ instead...
 
 INTRODUCTION
 
-    The Common UNIX Printing System ("CUPS") is a standards-based, open source
-    printing system developed by Apple Inc. for Mac OS® X and other UNIX®-like
-    operating systems.  CUPS uses the Internet Printing Protocol ("IPP") and
-    provides System V and Berkeley command-line interfaces, a web interface,
-    and a C API to manage printers and print jobs.  It supports printing to
-    both local (parallel, serial, USB) and networked printers, and printers can
-    be shared from one computer to another, even over the Internet!
+    CUPS is a standards-based, open source printing system developed by Apple
+    Inc. for Mac OS® X and other UNIX®-like operating systems.  CUPS uses the
+    Internet Printing Protocol ("IPP") and provides System V and Berkeley
+    command-line interfaces, a web interface, and a C API to manage printers and
+    print jobs.  It supports printing to both local (parallel, serial, USB) and
+    networked printers, and printers can be shared from one computer to another,
+    even over the Internet!
 
     Internally, CUPS uses PostScript Printer Description ("PPD") files to
     describe printer capabilities and features and a wide variety of generic
index 2fc7a27d38ebf93838ad0a144a869705efed8484..10b45f6b137a801b538e6ebdf1326bbf88862208 100644 (file)
@@ -656,27 +656,51 @@ print_device(const char *uri,             /* I - Device URI */
        */
 
        if (iostatus == kIOUSBTransactionTimeout)
+       {
+         fputs("DEBUG: Got USB transaction timeout during write!\n", stderr);
          iostatus = 0;
+       }
 
        /*
-        * Ignore stall errors, since we clear any stalls in the class driver...
+        * Ignore the first stall error we get since we try to clear any stalls
+       * in the class driver...
        */
 
-       if (iostatus == kIOUSBPipeStalled)
-         iostatus = 0;
+       else if (iostatus == kIOUSBPipeStalled)
+       {
+         fputs("DEBUG: Got USB pipe stalled during write!\n", stderr);
+
+          bytes = 0;
+
+         if (prev_iostatus != kIOUSBPipeStalled)
+         {
+           prev_iostatus = iostatus;
+           iostatus      = 0;
+         }
+       }
 
        /*
        * Ignore the first "aborted" status we get, since we might have
        * received a signal (<rdar://problem/6860126>)...
        */
 
-       if (iostatus == kIOReturnAborted && prev_iostatus != kIOReturnAborted)
+       else if (iostatus == kIOReturnAborted)
        {
-         prev_iostatus = iostatus;
-         iostatus      = 0;
-       }
+         fputs("DEBUG: Got return aborted during write!\n", stderr);
+
+         IOReturn err = (*g.classdriver)->Abort(g.classdriver);
+         fprintf(stderr, "DEBUG: USB class driver Abort returned %x\n", err);
+
+          bytes = 0;
+
+         if (prev_iostatus != kIOReturnAborted)
+         {
+           prev_iostatus = iostatus;
+           iostatus      = 0;
+         }
+        }
        else
-         prev_iostatus = iostatus;
+          prev_iostatus = iostatus;
 
        if (iostatus || bytes < 0)
        {
@@ -684,21 +708,25 @@ print_device(const char *uri,             /* I - Device URI */
          * Write error - bail if we don't see an error we can retry...
          */
 
-         IOReturn err = (*g.classdriver)->Abort(g.classdriver);
          _cupsLangPuts(stderr, _("ERROR: Unable to send print data!\n"));
          fprintf(stderr, "DEBUG: USB class driver WritePipe returned %x\n",
                  iostatus);
+
+         IOReturn err = (*g.classdriver)->Abort(g.classdriver);
          fprintf(stderr, "DEBUG: USB class driver Abort returned %x\n",
                  err);
+
          status = job_canceled ? CUPS_BACKEND_FAILED : CUPS_BACKEND_STOP;
          break;
        }
+       else if (bytes > 0)
+       {
+         fprintf(stderr, "DEBUG: Wrote %d bytes of print data...\n", (int)bytes);
 
-        fprintf(stderr, "DEBUG: Wrote %d bytes of print data...\n", (int)bytes);
-
-        g.print_bytes -= bytes;
-       print_ptr   += bytes;
-       total_bytes += bytes;
+         g.print_bytes -= bytes;
+         print_ptr   += bytes;
+         total_bytes += bytes;
+       }
       }
 
       if (print_fd != 0 && status == noErr)
@@ -844,6 +872,8 @@ static void *read_thread(void *reference)
     readstatus = (*g.classdriver)->ReadPipe(g.classdriver, readbuffer, &rbytes);
     if (readstatus == kIOReturnSuccess && rbytes > 0)
     {
+      fprintf(stderr, "DEBUG: Read %d bytes of back-channel data...\n",
+              (int)rbytes);
       cupsBackChannelWrite((char*)readbuffer, rbytes, 1.0);
 
       /* cntrl-d is echoed by the printer.
@@ -858,6 +888,12 @@ static void *read_thread(void *reference)
       parse_pserror(readbuffer, rbytes);
 #endif
     }
+    else if (readstatus == kIOUSBTransactionTimeout)
+      fputs("DEBUG: Got USB transaction timeout during write!\n", stderr);
+    else if (readstatus == kIOUSBPipeStalled)
+      fputs("DEBUG: Got USB pipe stalled during read!\n", stderr);
+    else if (readstatus == kIOReturnAborted)
+      fputs("DEBUG: Got return aborted during read!\n", stderr);
 
    /*
     * Make sure this loop executes no more than once every 250 miliseconds...
@@ -904,41 +940,83 @@ sidechannel_thread(void *reference)
     switch (command)
     {
       case CUPS_SC_CMD_SOFT_RESET:     /* Do a soft reset */
+         fputs("DEBUG: CUPS_SC_CMD_SOFT_RESET received from driver...\n",
+               stderr);
+
           if ((*g.classdriver)->SoftReset != NULL)
          {
            soft_reset();
            cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, NULL, 0, 1.0);
+           fputs("DEBUG: Returning status CUPS_STATUS_OK with no bytes...\n",
+                 stderr);
          }
          else
          {
            cupsSideChannelWrite(command, CUPS_SC_STATUS_NOT_IMPLEMENTED,
                                 NULL, 0, 1.0);
+           fputs("DEBUG: Returning status CUPS_STATUS_NOT_IMPLEMENTED with "
+                 "no bytes...\n", stderr);
          }
          break;
 
       case CUPS_SC_CMD_DRAIN_OUTPUT:   /* Drain all pending output */
+         fputs("DEBUG: CUPS_SC_CMD_DRAIN_OUTPUT received from driver...\n",
+               stderr);
+
          g.drain_output = 1;
          break;
 
       case CUPS_SC_CMD_GET_BIDI:               /* Is the connection bidirectional? */
+         fputs("DEBUG: CUPS_SC_CMD_GET_BIDI received from driver...\n",
+               stderr);
+
          data[0] = g.bidi_flag;
          cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, data, 1, 1.0);
+
+         fprintf(stderr,
+                 "DEBUG: Returned CUPS_SC_STATUS_OK with 1 byte (%02X)...\n",
+                 data[0]);
          break;
 
       case CUPS_SC_CMD_GET_DEVICE_ID:  /* Return IEEE-1284 device ID */
+         fputs("DEBUG: CUPS_SC_CMD_GET_DEVICE_ID received from driver...\n",
+               stderr);
+
          datalen = sizeof(data);
          get_device_id(&status, data, &datalen);
          cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, data, datalen, 1.0);
+
+          if (datalen < sizeof(data))
+           data[datalen] = '\0';
+         else
+           data[sizeof(data) - 1] = '\0';
+
+         fprintf(stderr,
+                 "DEBUG: Returning CUPS_SC_STATUS_OK with %d bytes (%s)...\n",
+                 datalen, data);
          break;
 
       case CUPS_SC_CMD_GET_STATE:              /* Return device state */
+         fputs("DEBUG: CUPS_SC_CMD_GET_STATE received from driver...\n",
+               stderr);
+
          data[0] = CUPS_SC_STATE_ONLINE;
          cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, data, 1, 1.0);
+
+         fprintf(stderr,
+                 "DEBUG: Returned CUPS_SC_STATUS_OK with 1 byte (%02X)...\n",
+                 data[0]);
          break;
 
       default:
+         fprintf(stderr, "DEBUG: Unknown side-channel command (%d) received "
+                         "from driver...\n", command);
+
          cupsSideChannelWrite(command, CUPS_SC_STATUS_NOT_IMPLEMENTED,
                               NULL, 0, 1.0);
+
+         fputs("DEBUG: Returned CUPS_SC_STATUS_NOT_IMPLEMENTED with no bytes...\n",
+               stderr);
          break;
     }
   }
@@ -1281,14 +1359,14 @@ static kern_return_t load_classdriver(CFStringRef           driverPath,
 
   if (stat(bundlestr, &bundleinfo))
   {
-    fprintf(stderr, "Unable to load class driver \"%s\": %s", bundlestr,
-           strerror(errno));
+    fprintf(stderr, "DEBUG: Unable to load class driver \"%s\": %s\n",
+           bundlestr, strerror(errno));
     return (kr);
   }
   else if (bundleinfo.st_mode & S_IWOTH)
   {
-    fprintf(stderr, "Unable to load class driver \"%s\": insecure file "
-                   "permissions (0%o)", bundlestr, bundleinfo.st_mode);
+    fprintf(stderr, "DEBUG: Unable to load class driver \"%s\": insecure file "
+                   "permissions (0%o)\n", bundlestr, bundleinfo.st_mode);
     return (kr);
   }
 
index 742c3238ed3b75475d4213895b1cc2ae4ed4df16..351f92db08a6dae2d07b02817ca8bb8308d4e49b 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   Web search program for www.cups.org.
  *
- *   Copyright 2007-2008 by Apple Inc.
+ *   Copyright 2007-2009 by Apple Inc.
  *   Copyright 1997-2007 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -33,7 +33,8 @@
  * Local functions...
  */
 
-static void    list_nodes(const char *title, cups_array_t *nodes);
+static void    list_nodes(help_index_t *hi, const char *title,
+                          cups_array_t *nodes);
 
 
 /*
@@ -69,7 +70,7 @@ main(int  argc,                               /* I - Number of command-line args */
   search = helpSearchIndex(hi, argv[2], NULL, NULL);
 
   if (search)
-    list_nodes(argv[1], search->sorted);
+    list_nodes(hi, argv[1], search->sorted);
 
  /*
   * Return with no errors...
@@ -84,10 +85,12 @@ main(int  argc,                             /* I - Number of command-line args */
  */
 
 static void
-list_nodes(const char   *title,                /* I - Title string */
+list_nodes(help_index_t *hi,           /* I - Help index */
+           const char   *title,                /* I - Title string */
           cups_array_t *nodes)         /* I - Nodes */
 {
-  help_node_t  *node;                  /* Current node */
+  help_node_t  *node,                  /* Current node */
+               *file;                  /* File node */
 
 
   printf("%d\n", cupsArrayCount(nodes));
@@ -96,10 +99,14 @@ list_nodes(const char   *title,             /* I - Title string */
        node = (help_node_t *)cupsArrayNext(nodes))
   {
     if (node->anchor)
-      printf("%d|%s#%s|%s\n", node->score, node->filename, node->anchor,
-             node->text);
+    {
+      file = helpFindNode(hi, node->filename, NULL);
+      printf("%d|%s#%s|%s|%s\n", node->score, node->filename, node->anchor,
+             node->text, file ? file->text : node->filename);
+    }
     else
-      printf("%d|%s|%s\n", node->score, node->filename, node->text);
+      printf("%d|%s|%s|%s\n", node->score, node->filename, node->text,
+             node->text);
   }
 }
 
index 9416b2de7d1504e7c87d397ca1c2a33b40d358d3..8cbba9d6287713f6c4a39401a7327999204ef3ce 100644 (file)
@@ -7,7 +7,7 @@
 #
 #   MIME converts file for the Common UNIX Printing System (CUPS).
 #
-#   Copyright 2007-2008 by Apple Inc.
+#   Copyright 2007-2009 by Apple Inc.
 #   Copyright 1997-2007 by Easy Software Products.
 #
 #   These coded instructions, statements, and computer programs are the
@@ -38,7 +38,7 @@
 # PostScript filters
 #
 
-application/pdf                        application/postscript          33      pdftops
+application/pdf                        application/vnd.cups-postscript 66      pdftops
 application/postscript         application/vnd.cups-postscript 66      pstops
 application/vnd.hp-HPGL                application/postscript          66      hpgltops
 application/x-cshell           application/postscript          33      texttops
index 9ad554d3280b167ab615d72e835e810a5fc096fc..39bdebc8ff34e1dbe05eb1ffa789e38b390342f0 100644 (file)
@@ -20,7 +20,7 @@ dnl Set the name of the config header file...
 AC_CONFIG_HEADER(config.h)
 
 dnl Version number information...
-CUPS_VERSION="1.4b3"
+CUPS_VERSION="1.4rc1"
 CUPS_REVISION=""
 #if test -z "$CUPS_REVISION" -a -d .svn; then
 #      CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
index ebcd368e2135da5720faf9775f7a183759f57c3b..fb65106f288c3abdcfeba15ec95855c4bb83a955 100644 (file)
@@ -34,6 +34,8 @@
        Programming: <a href='api-cups.html' target='_top'>CUPS API</a><br>
        Programming: <a href='api-ppd.html' target='_top'>PPD API</a><br>
        Programming: <a href='api-raster.html' target='_top'>Raster API</a><br>
+       Programming: <a href='postscript-driver.html' target='_top'>Developing PostScript Printer Drivers</a><br>
+       Programming: <a href='raster-driver.html' target='_top'>Developing Raster Printer Drivers</a><br>
        Specifications: <a href='spec-design' target='_top'>CUPS Design Description</a></td>
 </tr>
 </tbody>
index 11cbb5acde927c67ab65656bf53dc55cd71fe550..dcff52e5ef46b34187e762be3639fa348870c9f8 100644 (file)
@@ -182,6 +182,7 @@ cupsResolveConflicts(
     cups_option_t **options)           /* IO - Additional selected options */
 {
   int                  i,              /* Looping var */
+                       tries,          /* Number of tries */
                        num_newopts;    /* Number of new options */
   cups_option_t                *newopts;       /* New options */
   cups_array_t         *active,        /* Active constraints */
@@ -230,10 +231,14 @@ cupsResolveConflicts(
 
   resolvers = NULL;
   pass      = cupsArrayNew((cups_array_func_t)strcasecmp, NULL);
+  tries     = 0;
 
-  while ((active = ppd_test_constraints(ppd, NULL, NULL, num_newopts, newopts,
+  while (tries < 100 &&
+         (active = ppd_test_constraints(ppd, NULL, NULL, num_newopts, newopts,
                                         _PPD_ALL_CONSTRAINTS)) != NULL)
   {
+    tries ++;
+
     if (!resolvers)
       resolvers = cupsArrayNew((cups_array_func_t)strcasecmp, NULL);
 
@@ -489,8 +494,12 @@ cupsResolveConflicts(
 
     cupsArrayClear(pass);
     cupsArrayDelete(active);
+    active = NULL;
   }
 
+  if (tries >= 100)
+    goto error;
+
  /*
   * Free the caller's option array...
   */
index 6502d95a5f936b815e7c84e1c9b856ef9a1f2159..c3b7f2f8af6e1ad2c035cf3ba13eb2e37e1f8795 100644 (file)
@@ -62,7 +62,7 @@ extern "C" {
 #  define CUPS_VERSION         1.0400
 #  define CUPS_VERSION_MAJOR   1
 #  define CUPS_VERSION_MINOR   4
-#  define CUPS_VERSION_PATCH   -1
+#  define CUPS_VERSION_PATCH   0
 
 #  define CUPS_BC_FD           3       /* Back-channel file descriptor for select/poll */
 #  define CUPS_DATE_ANY                (time_t)-1
@@ -253,7 +253,7 @@ extern int          cupsPrintFiles2(http_t *http, const char *name,
 extern int             cupsSetDests2(http_t *http, int num_dests,
                                      cups_dest_t *dests) _CUPS_API_1_1_21;
 
-/**** New in CUPS 1.2 ****/
+/**** New in CUPS 1.2/Mac OS X 10.5 ****/
 extern ssize_t         cupsBackChannelRead(char *buffer, size_t bytes,
                                            double timeout) _CUPS_API_1_2;
 extern ssize_t         cupsBackChannelWrite(const char *buffer, size_t bytes,
@@ -268,7 +268,7 @@ extern int          cupsRemoveOption(const char *name, int num_options,
                                         cups_option_t **options) _CUPS_API_1_2;
 extern cups_file_t     *cupsTempFile2(char *filename, int len) _CUPS_API_1_2;
 
-/**** New in CUPS 1.3 ****/
+/**** New in CUPS 1.3/Mac OS X 10.5 ****/
 extern ipp_t           *cupsDoIORequest(http_t *http, ipp_t *request,
                                         const char *resource, int infile,
                                         int outfile) _CUPS_API_1_3;
@@ -281,7 +281,7 @@ extern void         cupsSetDefaultDest(const char *name,
                                           int num_dests,
                                           cups_dest_t *dests) _CUPS_API_1_3;
 
-/**** New in CUPS 1.4 ****/
+/**** New in CUPS 1.4/Mac OS X 10.6 ****/
 extern ipp_status_t    cupsCancelJob2(http_t *http, const char *name,
                                       int job_id, int purge) _CUPS_API_1_4;
 extern int             cupsCreateJob(http_t *http, const char *name,
index 70ffe4d3ab00e0148223f70d8726c7695bd556e7..90f086f805294fd7726b4405cf45a6b236c8621d 100644 (file)
@@ -387,7 +387,7 @@ extern void         httpSeparate2(const char *uri,
                                      char *host, int hostlen, int *port,
                                      char *resource, int resourcelen) _CUPS_DEPRECATED;
 
-/**** New in CUPS 1.2 ****/
+/**** New in CUPS 1.2/Mac OS X 10.5 ****/
 extern int             httpAddrAny(const http_addr_t *addr) _CUPS_API_1_2;
 extern http_addrlist_t *httpAddrConnect(http_addrlist_t *addrlist, int *sock) _CUPS_API_1_2;
 extern int             httpAddrEqual(const http_addr_t *addr1,
@@ -435,7 +435,7 @@ extern void         httpSetLength(http_t *http, size_t length) _CUPS_API_1_2;
 extern ssize_t         httpWrite2(http_t *http, const char *buffer,
                                   size_t length) _CUPS_API_1_2;
 
-/**** New in CUPS 1.3 ****/
+/**** New in CUPS 1.3/Mac OS X 10.5 ****/
 extern char            *httpGetAuthString(http_t *http) _CUPS_API_1_3;
 extern void            httpSetAuthString(http_t *http, const char *scheme,
                                          const char *data) _CUPS_API_1_3;
index e162bfe13daaecfa039c44c22d5a01db5a9ecad2..b10feedd3a8ff2f206fe9c4fc2fd34a05870877b 100644 (file)
@@ -445,7 +445,7 @@ cupsLangGet(const char *language)   /* I - Language or locale */
 
   if (!language)
   {
-    if ((language = getenv("LANG")) == NULL)
+    if (!getenv("SOFTWARE") || (language = getenv("LANG")) == NULL)
       language = appleLangDefault();
 
     DEBUG_printf(("4cupsLangGet: language=\"%s\"", language));
@@ -1121,13 +1121,15 @@ appleLangDefault(void)
                                        /* Pointer to library globals */
 
 
+  DEBUG_puts("2appleLangDefault()");
+
  /*
   * Only do the lookup and translation the first time.
   */
 
   if (!cg->language[0])
   {
-    if ((lang = getenv("LANG")))
+    if (getenv("SOFTWARE") != NULL && (lang = getenv("LANG")) != NULL)
     {
       strlcpy(cg->language, lang, sizeof(cg->language));
       return (cg->language);
index 04c6357dc04a0cc360e8add7624898b7293026d2..9d653fec02f101cc48f8f0d130f9577ddcb28f32 100644 (file)
  *
  * Contents:
  *
- *   ppdPageSize()   - Get the page size record for the given size.
- *   ppdPageWidth()  - Get the page width for the given size.
- *   ppdPageLength() - Get the page length for the given size.
+ *   ppdPageSize()       - Get the page size record for the given size.
+ *   ppdPageSizeLimits() - Return the custom page size limits.
+ *   ppdPageWidth()      - Get the page width for the given size.
+ *   ppdPageLength()     - Get the page length for the given size.
  */
 
 /*
index 4018d803b094e9c7765c8d87014dc316a5194283..2da53d5c001d6e7ce552fd7f0a5f7a624cd7192b 100644 (file)
@@ -942,7 +942,8 @@ ppdOpen2(cups_file_t *fp)           /* I - File to read from */
       * Get the parameter data...
       */
 
-      if (sscanf(string, "%d%32s%64s%64s", &corder, ctype, cminimum,
+      if (!string ||
+          sscanf(string, "%d%32s%64s%64s", &corder, ctype, cminimum,
                  cmaximum) != 4)
       {
         cg->ppd_status = PPD_BAD_CUSTOM_PARAM;
@@ -1615,6 +1616,12 @@ ppdOpen2(cups_file_t *fp)                /* I - File to read from */
     else if (!strcmp(keyword, "UIConstraints") ||
              !strcmp(keyword, "NonUIConstraints"))
     {
+      if (!string)
+      {
+       cg->ppd_status = PPD_BAD_UI_CONSTRAINTS;
+       goto error;
+      }
+
       if (ppd->num_consts == 0)
        constraint = calloc(2, sizeof(ppd_const_t));
       else
index 6f3940eacbdd007f39cf23b3c5faf4c3c71167c8..e1fc70dec974bc723af9ff843af1bbd27826e20e 100644 (file)
@@ -213,7 +213,7 @@ typedef struct ppd_profile_s                /**** sRGB Color Profiles ****/
   float                matrix[3][3];           /* Transform matrix */
 } ppd_profile_t;
 
-/**** New in CUPS 1.2 ****/
+/**** New in CUPS 1.2/Mac OS X 10.5 ****/
 typedef enum ppd_cptype_e              /**** Custom Parameter Type @since CUPS 1.2/Mac OS X 10.5@ ****/
 {
   PPD_CUSTOM_CURVE,                    /* Curve value for f(x) = x^value */
@@ -321,15 +321,15 @@ typedef struct ppd_file_s         /**** PPD File ****/
   int          cur_attr;               /* Current attribute @since CUPS 1.1.19/Mac OS X 10.3@ @private@ */
   ppd_attr_t   **attrs;                /* Attributes @since CUPS 1.1.19/Mac OS X 10.3@ @private@ */
 
-  /**** New in CUPS 1.2 ****/
+  /**** New in CUPS 1.2/Mac OS X 10.5 ****/
   cups_array_t *sorted_attrs;          /* Attribute lookup array @since CUPS 1.2/Mac OS X 10.5@ @private@ */
   cups_array_t *options;               /* Option lookup array @since CUPS 1.2/Mac OS X 10.5@ @private@ */
   cups_array_t *coptions;              /* Custom options array @since CUPS 1.2/Mac OS X 10.5@ @private@ */
 
-  /**** New in CUPS 1.3 ****/
+  /**** New in CUPS 1.3/Mac OS X 10.5 ****/
   cups_array_t *marked;                /* Marked choices @since CUPS 1.3/Mac OS X 10.5@ @private@ */
 
-  /**** New in CUPS 1.4 ****/
+  /**** New in CUPS 1.4/Mac OS X 10.6 ****/
   cups_array_t *cups_uiconstraints;    /* cupsUIConstraints @since CUPS 1.4/Mac OS X 10.6@ @private@ */
 } ppd_file_t;
 
index 374ad895266ed8bf82195db198dcf91af21e619d..fde1bb39cfcac301b8097078bd2bf97bd1f7bdc3 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   Localization test program for the Common UNIX Printing System (CUPS).
  *
- *   Copyright 2007 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
index 8b386e376a842210903cd8fcc85b49463e10453b..c9a8ece3839777e59763744b0bb75f5183782771 100644 (file)
@@ -166,6 +166,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
     }
 
     putenv("LOCALEDIR=locale");
+    putenv("SOFTWARE=CUPS");
 
    /*
     * Do tests with test.ppd...
index d7aa4445119d46a102b1faba848b8a95b37e4e22..da8a1373d10a09382d5038274b8af5cd19707c5f 100644 (file)
@@ -373,6 +373,8 @@ div.contents ul.subcontents li {
        Programming: <a href='api-cups.html' target='_top'>CUPS API</a><br>
        Programming: <a href='api-ppd.html' target='_top'>PPD API</a><br>
        Programming: <a href='api-raster.html' target='_top'>Raster API</a><br>
+       Programming: <a href='postscript-driver.html' target='_top'>Developing PostScript Printer Drivers</a><br>
+       Programming: <a href='raster-driver.html' target='_top'>Developing Raster Printer Drivers</a><br>
        Specifications: <a href='spec-design' target='_top'>CUPS Design Description</a></td>
 </tr>
 </tbody>
index c6ec8b2e10032f314379486fc7949209536034bd..40a7db7aaab270d3500ce03ccc875e6d0ecd79ca 100644 (file)
@@ -372,7 +372,7 @@ div.contents ul.subcontents li {
 
 <div class='figure'><table summary='PostScript Filter Chain'>
 <caption>Figure 1: <a name='FIGURE_1'>PostScript Filter Chain</a></caption>
-<tr><td><img src='/images/cups-postscript-chain.png' width='700' height='150' alt='PostScript Filter Chain'></td></tr>
+<tr><td><img src='../images/cups-postscript-chain.png' width='700' height='150' alt='PostScript Filter Chain'></td></tr>
 </table></div>
 
 <p>The optional PostScript filter can be provided to add printer-specific commands to the PostScript output that cannot be represented in the PPD file or to reorganize the output for special printer features. Typically this is used to support advanced job management or finishing functions on the printer. CUPS includes a generic PostScript filter that handles all PPD-defined commands.</p>
@@ -385,7 +385,7 @@ div.contents ul.subcontents li {
 
 <div class='figure'><table summary='Command Filter Chain'>
 <caption>Figure 2: <a name='FIGURE_2'>Command Filter Chain</a></caption>
-<tr><td><img src='/images/cups-command-chain.png' width='575' height='150' alt='Command Filter Chain'></td></tr>
+<tr><td><img src='../images/cups-command-chain.png' width='575' height='150' alt='Command Filter Chain'></td></tr>
 </table></div>
 
 <p>PostScript printer drivers typically do not require their own command filter since CUPS includes a generic PostScript command filter that supports all of the standard functions using PPD-defined commands.</p>
index 9d0c89e4e27af6feec9e2fc0ef4c652c7fc248c7..fc85337c4a40683563becae218b1068565b9ec4a 100644 (file)
@@ -370,7 +370,7 @@ div.contents ul.subcontents li {
 
 <div class='figure'><table summary='Raster Filter Chain'>
 <caption>Figure 1: <a name='FIGURE_1'>Raster Filter Chain</a></caption>
-<tr><td><img src='/images/cups-raster-chain.png' width='700' height='150' alt='Raster Filter Chain'></td></tr>
+<tr><td><img src='../images/cups-raster-chain.png' width='700' height='150' alt='Raster Filter Chain'></td></tr>
 </table></div>
 
 <p>The raster filter converts CUPS raster data into a format the printer understands, for example HP-PCL. CUPS includes several sample raster filters supporting standard page description languages (PDLs). <a href='#TABLE_1'>Table 1</a> shows the raster filters that are bundled with CUPS and the languages they support.</p>
@@ -397,7 +397,7 @@ div.contents ul.subcontents li {
 
 <div class='figure'><table summary='Command Filter Chain'>
 <caption>Figure 2: <a name='FIGURE_2'>Command Filter Chain</a></caption>
-<tr><td><img src='/images/cups-command-chain.png' width='575' height='150' alt='Command Filter Chain'></td></tr>
+<tr><td><img src='../images/cups-command-chain.png' width='575' height='150' alt='Command Filter Chain'></td></tr>
 </table></div>
 
 <p>Raster printer drivers must provide their own command filter.</p>
index b22d3a304f529ac6392638a513147f26e11373b4..f8bc10500ad5715830e5d4c4b4eee71893add8aa 100644 (file)
@@ -461,7 +461,7 @@ value. Otherwise printers and classes will disappear from client
 systems between updates.</P>
 
 
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="BrowseLDAPBindDN">BrowseLDAPBindDN</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="BrowseLDAPBindDN">BrowseLDAPBindDN</A></H2>
 
 <H3>Examples</H3>
 
@@ -476,7 +476,7 @@ domain name to use when listening for printer registrations. The
 default is undefined.</P>
 
 
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.4</SPAN><A NAME="BrowseLDAPCACertFile">BrowseLDAPCACertFile</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.4/Mac OS X 10.6</SPAN><A NAME="BrowseLDAPCACertFile">BrowseLDAPCACertFile</A></H2>
 
 <H3>Examples</H3>
 
@@ -490,7 +490,7 @@ BrowseLDAPCACertFile /etc/cups/ssl/certs
 authority file to use for LDAP + SSL. The default is undefined.</P>
 
 
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="BrowseLDAPDN">BrowseLDAPDN</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="BrowseLDAPDN">BrowseLDAPDN</A></H2>
 
 <H3>Examples</H3>
 
@@ -505,7 +505,7 @@ domain name to use when registering local shared printers. The
 default is undefined.</P>
 
 
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="BrowseLDAPPassword">BrowseLDAPPassword</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="BrowseLDAPPassword">BrowseLDAPPassword</A></H2>
 
 <H3>Examples</H3>
 
@@ -520,7 +520,7 @@ access password to use when connecting to the LDAP server. The
 default is undefined.</P>
 
 
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="BrowseLDAPServer">BrowseLDAPServer</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="BrowseLDAPServer">BrowseLDAPServer</A></H2>
 
 <H3>Examples</H3>
 
@@ -551,7 +551,7 @@ additional IPP backend options to advertise with local shared
 printers. The default is to not include any options.</P>
 
 
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="BrowseLocalProtocols">BrowseLocalProtocols</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="BrowseLocalProtocols">BrowseLocalProtocols</A></H2>
 
 <H3>Examples</H3>
 
@@ -734,7 +734,7 @@ the options replace any options specified by the remote server.
 The default is to not include any options.</P>
 
 
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="BrowseRemoteProtocols">BrowseRemoteProtocols</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="BrowseRemoteProtocols">BrowseRemoteProtocols</A></H2>
 
 <H3>Examples</H3>
 
@@ -920,7 +920,7 @@ DataDir /usr/share/cups
 for data files.</P>
 
 
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="DefaultAuthType">DefaultAuthType</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="DefaultAuthType">DefaultAuthType</A></H2>
 
 <H3>Examples</H3>
 
@@ -957,7 +957,7 @@ character set for the language specified by the client or the
 <CODE>DefaultLanguage</CODE> directive.</P>
 
 
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="DefaultEncryption">DefaultEncryption</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="DefaultEncryption">DefaultEncryption</A></H2>
 
 <H3>Examples</H3>
 
@@ -995,7 +995,7 @@ language localization file exists for it. The default language
 is "en" for English.</P>
 
 
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.4</SPAN><A NAME="DefaultPaperSize">DefaultPaperSize</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.4/Mac OS X 10.6</SPAN><A NAME="DefaultPaperSize">DefaultPaperSize</A></H2>
 
 <H3>Examples</H3>
 
@@ -1015,7 +1015,7 @@ of <CODE>None</CODE> tells the scheduler to not set the default paper
 size.</P>
 
 
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="DefaultPolicy">DefaultPolicy</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="DefaultPolicy">DefaultPolicy</A></H2>
 
 <H3>Examples</H3>
 
@@ -1031,7 +1031,7 @@ policy to use for IPP operation. The default is
 <CODE>default</CODE>.</P>
 
 
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="DefaultShared">DefaultShared</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="DefaultShared">DefaultShared</A></H2>
 
 <H3>Examples</H3>
 
@@ -1182,7 +1182,7 @@ default error log file is <VAR>@CUPS_LOGDIR@/error_log</VAR>.</P>
 information to the system log instead of a plain file.</P>
 
 
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.3</SPAN><A NAME="ErrorPolicy">ErrorPolicy</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.3/Mac OS X 10.5</SPAN><A NAME="ErrorPolicy">ErrorPolicy</A></H2>
 
 <H3>Examples</H3>
 
@@ -1221,7 +1221,7 @@ printer.</P>
 
 
 
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.4</SPAN><A NAME="FatalErrors">FatalErrors</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.4/Mac OS X 10.6</SPAN><A NAME="FatalErrors">FatalErrors</A></H2>
 
 <H3>Examples</H3>
 
@@ -1483,7 +1483,7 @@ the file is assumed to be relative to the <A
 HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory.</P>
 
 
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="JobRetryInterval">JobRetryInterval</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="JobRetryInterval">JobRetryInterval</A></H2>
 
 <H3>Examples</H3>
 
@@ -1501,7 +1501,7 @@ print queues whose error policy is <CODE>retry-job</CODE>. The
 default is 30 seconds.</P>
 
 
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.4</SPAN><A NAME="JobKillDelay">JobKillDelay</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.4/Mac OS X 10.6</SPAN><A NAME="JobKillDelay">JobKillDelay</A></H2>
 
 <H3>Examples</H3>
 
@@ -1517,7 +1517,7 @@ wait before killing the filters and backend associated with a canceled or held
 job. The default is 30 seconds.</P>
 
 
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="JobRetryLimit">JobRetryLimit</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="JobRetryLimit">JobRetryLimit</A></H2>
 
 <H3>Examples</H3>
 
@@ -1601,7 +1601,7 @@ The request type names are case-sensitive for compatibility with
 Apache.</P>
 
 
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="LimitIPP">Limit (Policy)</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="LimitIPP">Limit (Policy)</A></H2>
 
 <H3>Examples</H3>
 
@@ -2252,7 +2252,7 @@ HREF="#LimitRequestBody"><CODE>LimitRequestBody</CODE></A>
 directive instead.</P>
 
 
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.4</SPAN><A NAME="MultipleOperationTimeout">MultipleOperationTimeout</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.4/Mac OS X 10.6</SPAN><A NAME="MultipleOperationTimeout">MultipleOperationTimeout</A></H2>
 
 <H3>Examples</H3>
 
@@ -2371,7 +2371,7 @@ recognized:</P>
 <P>The default is "%p %j %u %T %P %C %{job-billing} %{job-originating-host-name} %{job-name} %{media} %{sides}".</P>
 
 
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="PassEnv">PassEnv</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="PassEnv">PassEnv</A></H2>
 
 <H3>Examples</H3>
 
@@ -2390,7 +2390,7 @@ scheduler only passes the <CODE>DYLD_LIBRARY_PATH</CODE>,
 environment variables to child processes.</P>
 
 
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="Policy">Policy</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="Policy">Policy</A></H2>
 
 <H3>Examples</H3>
 
@@ -2920,7 +2920,7 @@ the text that is returned. The default is
 </TABLE></DIV>
 
 
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="SetEnv">SetEnv</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="SetEnv">SetEnv</A></H2>
 
 <H3>Examples</H3>
 
@@ -3052,7 +3052,7 @@ to wait before an active HTTP or IPP request times out. The
 default timeout is 300 seconds.</P>
 
 
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2</SPAN><A NAME="UseNetworkDefault">UseNetworkDefault</A></H2>
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/Mac OS X 10.5</SPAN><A NAME="UseNetworkDefault">UseNetworkDefault</A></H2>
 
 <H3>Examples</H3>
 
index a4fa56c9deece9d380ea2825a40812c73f7f2058..48637abc7bc9ad9d85466378c32a8414f19d5bd5 100644 (file)
@@ -98,6 +98,34 @@ which can be later referenced using <code>$name</code>. The name is
 case-insensitive and can be any sequence of letters, numbers,
 and the underscore. The value can be any valid expression.</p>
 
+<h3>Predefined Names</h3>
+
+<p>The following <code>#define</code> names are set by the PPD compiler:</p>
+
+<ul>
+
+       <li><code>CUPS_VERSION</code> - The full CUPS version string, e.g.
+       "1.4.0"</li>
+
+       <li><code>CUPS_VERSION_MAJOR</code> - The major version number, e.g.
+       "1"</li>
+
+       <li><code>CUPS_VERSION_MINOR</code> - The minor version number, e.g.
+       "4"</li>
+
+       <li><code>CUPS_VERSION_PATCH</code> - The patch version number, e.g.
+       "0"</li>
+
+       <li><code>PLATFORM_NAME</code> - The operating system name used by the
+       current system as reported by "uname" ("Windows" on Microsoft
+       Windows)</li>
+
+       <li><code>PLATFORM_ARCH</code> - The processor architecture used by the
+       current system as reported by "uname -m" ("X86" or "X64" on Microsoft
+       Windows)</li>
+
+</ul>
+
 <h3>See Also</h3>
 
 <p><a href='#_include'><code>#include</code></a></p>
index bf9a6d36f1c235f0265a63f4ff032bfd1a2b7bd8..dc39388d8682fdebef1307aea6ac00cfe3ef278d 100644 (file)
@@ -365,7 +365,7 @@ Print-Job request:
 
 <dl>
 
-       <dt>"auth-info" (1setOf text(MAX)):<span class='info'>CUPS 1.3</span>
+       <dt>"auth-info" (1setOf text(MAX)):<span class='info'>CUPS 1.3/Mac OS X 10.5</span>
 
        <dd>The client OPTIONALLY supplies one or more authentication values as specified by the "auth-info-required" attribute.
 
@@ -472,7 +472,7 @@ Create-Job request:
 
 <dl>
 
-       <dt>"auth-info" (1setOf text(MAX)):<span class='info'>CUPS 1.3</span>
+       <dt>"auth-info" (1setOf text(MAX)):<span class='info'>CUPS 1.3/Mac OS X 10.5</span>
 
        <dd>The client OPTIONALLY supplies one or more authentication values as specified by the "auth-info-required" attribute.
 
@@ -577,7 +577,7 @@ Set-Job-Attributes request:
        <dd>The client MUST supply a URI for the specified printer and
        a job ID number, or the job URI.
 
-       <dt><span class="info">CUPS 1.4</span>"purge-job" (boolean):
+       <dt><span class="info">CUPS 1.4/Mac OS X 10.6</span>"purge-job" (boolean):
 
        <dd>The client OPTIONALLY supplies this attribute. When true,
        all job files (history and document) are purged. The default
@@ -632,7 +632,7 @@ Purge-Jobs request:
        <dd>The client MUST supply a URI for the specified printer or
        "ipp://.../printers" for all printers and classes.
 
-       <dt><span class="info">CUPS 1.2</span>"purge-jobs" (boolean):
+       <dt><span class="info">CUPS 1.2/Mac OS X 10.5</span>"purge-jobs" (boolean):
 
        <dd>The client OPTIONALLY supplies this attribute to specify
        whether the jobs are purged (true) or just canceled (false).
@@ -743,7 +743,7 @@ Response:
 
 </dl>
 
-<h3 class='title'><span class='info'>CUPS 1.2</span><a
+<h3 class='title'><span class='info'>CUPS 1.2/Mac OS X 10.5</span><a
 name='CREATE_PRINTER_SUBSCRIPTION'>Create-Printer-Subscription</a></h3>
 
 <p>The Create-Printer-Subscription operation (0x0016) creates a
@@ -915,7 +915,7 @@ CUPS-Get-Printers request:
        attributes as described in section 3.1.4.1 of the IPP Model and
        Semantics document.
 
-       <dt>"first-printer-name" (name(127)):<span class='info'>CUPS 1.2</span>
+       <dt>"first-printer-name" (name(127)):<span class='info'>CUPS 1.2/Mac OS X 10.5</span>
 
        <dd>The client OPTIONALLY supplies this attribute to
        select the first printer that is returned.
@@ -949,7 +949,7 @@ CUPS-Get-Printers request:
        responds as if this attribute had been supplied with a value of
        'all'.
 
-       <dt>"requested-user-name" (name(127)) : <span class='info'>CUPS 1.2</span>
+       <dt>"requested-user-name" (name(127)) : <span class='info'>CUPS 1.2/Mac OS X 10.5</span>
 
        <dd>The client OPTIONALLY supplies a user name that is used to filter
        the returned printers.
@@ -1016,7 +1016,7 @@ CUPS-Add-Modify-Printer request:
 
 <dl>
 
-       <dt>"auth-info-required" (1setOf type2 keyword):<span class='info'>CUPS 1.3</span>
+       <dt>"auth-info-required" (1setOf type2 keyword):<span class='info'>CUPS 1.3/Mac OS X 10.5</span>
 
        <dd>The client OPTIONALLY supplies one or more authentication keywords that are required to communicate with the printer/remote queue.
 
@@ -1179,7 +1179,7 @@ CUPS-Get-Classes request:
        attributes as described in section 3.1.4.1 of the IPP Model and
        Semantics document.
 
-       <dt>"first-printer-name" (name(127)):<span class='info'>CUPS 1.2</span>
+       <dt>"first-printer-name" (name(127)):<span class='info'>CUPS 1.2/Mac OS X 10.5</span>
 
        <dd>The client OPTIONALLY supplies this attribute to
        select the first printer that is returned.
@@ -1209,7 +1209,7 @@ CUPS-Get-Classes request:
        interested. If the client omits this attribute, the server responds as
        if this attribute had been supplied with a value of 'all'.
 
-       <dt>"requested-user-name" (name(127)) : <span class='info'>CUPS 1.2</span>
+       <dt>"requested-user-name" (name(127)) : <span class='info'>CUPS 1.2/Mac OS X 10.5</span>
 
        <dd>The client OPTIONALLY supplies a user name that is used to filter
        the returned printers.
@@ -1276,7 +1276,7 @@ CUPS-Add-Modify-Class request:
 
 <dl>
 
-       <dt>"auth-info-required" (1setOf type2 keyword):<span class='info'>CUPS 1.3</span>
+       <dt>"auth-info-required" (1setOf type2 keyword):<span class='info'>CUPS 1.3/Mac OS X 10.5</span>
 
        <dd>The client OPTIONALLY supplies one or more authentication keywords that are required to communicate with the printer/remote queue.
 
@@ -1575,14 +1575,14 @@ CUPS-Get-Devices request:
        <dd>The client OPTIONALLY supplies a device class keyword to select
        which devices are returned.
 
-       <dt>"exclude-schemes" (1setOf name) :<span class='info'>CUPS 1.4</span>
+       <dt>"exclude-schemes" (1setOf name) :<span class='info'>CUPS 1.4/Mac OS X 10.6</span>
 
        <dd>The client OPTIONALLY supplies a set of scheme names that the
        requestor does not want to discover. If the client omits this attribute,
        the server responds with devices of all schemes specified by
        the "include-schemes" attribute.
 
-       <dt>"include-schemes" (1setOf name) :<span class='info'>CUPS 1.4</span>
+       <dt>"include-schemes" (1setOf name) :<span class='info'>CUPS 1.4/Mac OS X 10.6</span>
 
        <dd>The client OPTIONALLY supplies a set of scheme names that the
        requestor wants to discover. If the client omits this attribute,
@@ -1601,7 +1601,7 @@ CUPS-Get-Devices request:
        the client omits this attribute, the server responds as if this
        attribute had been supplied with a value of 'all'.
 
-       <dt>"timeout" (integer (1:MAX)) :<span class='info'>CUPS 1.4</span>
+       <dt>"timeout" (integer (1:MAX)) :<span class='info'>CUPS 1.4/Mac OS X 10.6</span>
 
        <dd>The client OPTIONALLY supplies this attribute limiting the number of
        devices that are returned.
@@ -1658,14 +1658,14 @@ CUPS-Get-PPDs request:
        attributes as described in section 3.1.4.1 of the IPP Model and
        Semantics document.
 
-       <dt>"exclude-schemes" (1setOf name) :<span class='info'>CUPS 1.4</span>
+       <dt>"exclude-schemes" (1setOf name) :<span class='info'>CUPS 1.4/Mac OS X 10.6</span>
 
        <dd>The client OPTIONALLY supplies a set of scheme names that the
        requestor does not want to list. If the client omits this attribute,
        the server responds with PPDs of all schemes specified by the
        "include-schemes" attribute.
 
-       <dt>"include-schemes" (1setOf name) :<span class='info'>CUPS 1.4</span>
+       <dt>"include-schemes" (1setOf name) :<span class='info'>CUPS 1.4/Mac OS X 10.6</span>
 
        <dd>The client OPTIONALLY supplies a set of scheme names that the
        requestor wants to list. If the client omits this attribute, the server
@@ -1680,27 +1680,27 @@ CUPS-Get-PPDs request:
 
        <dd>The client OPTIONALLY supplies a printer manufacturer to select which PPDs are returned.
 
-       <dt>"ppd-make-and-model" (text(127)):<span class='info'>CUPS 1.3</span>
+       <dt>"ppd-make-and-model" (text(127)):<span class='info'>CUPS 1.3/Mac OS X 10.5</span>
 
        <dd>The client OPTIONALLY supplies a make and model to select which PPDs are returned.
 
-       <dt>"ppd-model-number" (integer):<span class='info'>CUPS 1.3</span>
+       <dt>"ppd-model-number" (integer):<span class='info'>CUPS 1.3/Mac OS X 10.5</span>
 
        <dd>The client OPTIONALLY supplies a model number to select which PPDs are returned.
 
-       <dt>"ppd-natural-language" (naturalLanguage):<span class='info'>CUPS 1.3</span>
+       <dt>"ppd-natural-language" (naturalLanguage):<span class='info'>CUPS 1.3/Mac OS X 10.5</span>
 
        <dd>The client OPTIONALLY supplies a language to select which PPDs are returned.
 
-       <dt>"ppd-product" (text(127)):<span class='info'>CUPS 1.3</span>
+       <dt>"ppd-product" (text(127)):<span class='info'>CUPS 1.3/Mac OS X 10.5</span>
 
        <dd>The client OPTIONALLY supplies a PostScript product string to select which PPDs are returned.
 
-       <dt>"ppd-psversion" (text(127)):<span class='info'>CUPS 1.3</span>
+       <dt>"ppd-psversion" (text(127)):<span class='info'>CUPS 1.3/Mac OS X 10.5</span>
 
        <dd>The client OPTIONALLY supplies a PostScript version string to select which PPDs are returned.
 
-       <dt>"ppd-type" (type1 keyword):<span class='info'>CUPS 1.3</span>
+       <dt>"ppd-type" (type1 keyword):<span class='info'>CUPS 1.3/Mac OS X 10.5</span>
 
        <dd>The client OPTIONALLY supplies a driver type to select which PPDs are returned.
 
@@ -1802,7 +1802,7 @@ CUPS-Move-Job Response:
 
 </dl>
 
-<h3 class='title'><span class='info'>CUPS 1.2</span><a name='CUPS_AUTHENTICATE_JOB'>CUPS-Authenticate-Job Operation</a></h3>
+<h3 class='title'><span class='info'>CUPS 1.2/Mac OS X 10.5</span><a name='CUPS_AUTHENTICATE_JOB'>CUPS-Authenticate-Job Operation</a></h3>
 
 <p>The CUPS-Authenticate-Job operation (0x400E) authenticates a print job for
 printing, releasing the job if it is held. Typically this is used when printing
@@ -1837,11 +1837,11 @@ CUPS-Authenticate-Job request:
 
 <dl>
 
-       <dt>"auth-info" (1setOf text(MAX)):<span class='info'>CUPS 1.3</span>
+       <dt>"auth-info" (1setOf text(MAX)):<span class='info'>CUPS 1.3/Mac OS X 10.5</span>
 
        <dd>The client OPTIONALLY supplies one or more authentication values as specified by the "auth-info-required" attribute.
 
-       <dt>"job-hold-until" (keyword | name(MAX)):<span class='info'>CUPS 1.3</span>
+       <dt>"job-hold-until" (keyword | name(MAX)):<span class='info'>CUPS 1.3/Mac OS X 10.5</span>
 
        <dd>The client OPTIONALLY supplies a new job-hold-until value for the
        job. If specified and not the "no-hold" value, the job is held instead
@@ -1880,7 +1880,7 @@ CUPS-Authenticate-Job Response:
 
 </dl>
 
-<h3 class='title'><span class='info'>CUPS 1.3</span><a name='CUPS_GET_PPD'>CUPS-Get-PPD Operation</a></h3>
+<h3 class='title'><span class='info'>CUPS 1.3/Mac OS X 10.5</span><a name='CUPS_GET_PPD'>CUPS-Get-PPD Operation</a></h3>
 
 <p>The CUPS-Get-PPD operation (0x400F) gets a PPD file from the
 server. The PPD file can be specified using a <tt>ppd-name</tt>
@@ -1950,7 +1950,7 @@ CUPS-Get-PPD Response:
 <p>If the status code is <tt>successful-ok</tt>, the PPD file follows
 the end of the IPP response.</p>
 
-<h3 class='title'><span class='info'>CUPS 1.4</span><a name='CUPS_GET_DOCUMENT'>CUPS-Get-Document Operation</a></h3>
+<h3 class='title'><span class='info'>CUPS 1.4/Mac OS X 10.6</span><a name='CUPS_GET_DOCUMENT'>CUPS-Get-Document Operation</a></h3>
 
 <p>The CUPS-Get-Document operation (0x4027) gets a document file from a
 job on the server. The document file is specified using the
@@ -2067,7 +2067,7 @@ one of the following:
 
 </ul>
 
-<h4><a name="device-id">device-id (text(127))</a><span class="info">CUPS 1.2</span></h4>
+<h4><a name="device-id">device-id (text(127))</a><span class="info">CUPS 1.2/Mac OS X 10.5</span></h4>
 
 <p>The device-id attribute specifies the IEEE-1284 device ID
 string for the device.</p>
@@ -2077,7 +2077,7 @@ string for the device.</p>
 <p>The device-info attribute specifies a human-readable string describing
 the device, e.g. "Parallel Port #1".
 
-<h4><a name="device-location">device-location (text(127))</a><span class="info">CUPS 1.4</span></h4>
+<h4><a name="device-location">device-location (text(127))</a><span class="info">CUPS 1.4/Mac OS X 10.6</span></h4>
 
 <p>The device-location attribute specifies the physical location of the
 printer.
@@ -2137,7 +2137,7 @@ of the device-class attribute:
 
 <h3 class='title'><a name='JOB_TEMPLATE_ATTRIBUTES'>Job Template Attributes</a></h3>
 
-<h4><a name="auth-info">auth-info (1setOf text(MAX))</a><span class="info">CUPS 1.3</span></h4>
+<h4><a name="auth-info">auth-info (1setOf text(MAX))</a><span class="info">CUPS 1.3/Mac OS X 10.5</span></h4>
 
 <p>The auth-info attribute specifies the authentication information to use when printing to a remote device. The order and content of each text value is specifed by the <a href="#auth-info-required">auth-info-required</a> printer attribute.
 
@@ -2179,7 +2179,7 @@ supported. The default value is 10.
 <p>The document-count attribute specifies the number of documents that
 are present in the job.
 
-<h4><a name="fit-to-page">fit-to-page (boolean)</a><span class="info">CUPS 1.4</span></h4>
+<h4><a name="fit-to-page">fit-to-page (boolean)</a><span class="info">CUPS 1.4/Mac OS X 10.6</span></h4>
 
 <p>The fit-to-page attribute specifies whether to scale documents to fit on the
 selected media (fit-to-page=true) or use the physical size specified in the
@@ -2234,17 +2234,17 @@ Universal Coordinated Time (UTC) and <i>not</i> in the local time zone. If the
 specified time is less than the current time, the job is held until the
 next day.
 
-<h4><a name="job-media-progress">job-media-progress (integer(0:100))</a><span class='info'>CUPS 1.4</span></h4>
+<h4><a name="job-media-progress">job-media-progress (integer(0:100))</a><span class='info'>CUPS 1.4/Mac OS X 10.6</span></h4>
 
 <p>The job-media-progress attribute specifies the percentage of completion of
 the current page. It is only valid when the job-state attribute has the
 "processing" value (5).</p>
 
-<h4><a name="job-printer-state-message">job-printer-state-message (text(MAX))</a><span class='info'>CUPS 1.3</span></h4>
+<h4><a name="job-printer-state-message">job-printer-state-message (text(MAX))</a><span class='info'>CUPS 1.3/Mac OS X 10.5</span></h4>
 
 <p>The job-printer-state-message attribute provides the last known value of the printer-state-message attribute for the printer that processed (or is processing) the job.</p>
 
-<h4><a name="job-printer-state-reasons">job-printer-state-reasons (1setOf type2 keyword)</a><span class='info'>CUPS 1.3</span></h4>
+<h4><a name="job-printer-state-reasons">job-printer-state-reasons (1setOf type2 keyword)</a><span class='info'>CUPS 1.3/Mac OS X 10.5</span></h4>
 
 <p>The job-printer-state-reasons attribute provides the last known value of the printer-state-reasons attribute for the printer that processed (or is processing) the job.</p>
 
@@ -2466,7 +2466,7 @@ name of the PPD file (the NickName attribute in the PPD file). If the
 make and model is not specified in the PPD file then the ModelName or
 ShortNickName attributes are used instead.
 
-<h4><a name="ppd-model-number">ppd-model-number (integer)</a><span class="info">CUPS 1.3</span></h4>
+<h4><a name="ppd-model-number">ppd-model-number (integer)</a><span class="info">CUPS 1.3/Mac OS X 10.5</span></h4>
 
 <p>The ppd-model-number attribute provides the <tt>cupsModelNumber</tt> value from the PPD file.
 
@@ -2484,11 +2484,11 @@ language is unknown or undefined then "en" (English) is assumed.
 
 <p>The ppd-product attribute specifies the Product attribute values in the PPD file.
 
-<h4><a name="ppd-psversion">ppd-psversion (1setOf text(127))</a><span class="info">CUPS 1.3</span></h4>
+<h4><a name="ppd-psversion">ppd-psversion (1setOf text(127))</a><span class="info">CUPS 1.3/Mac OS X 10.5</span></h4>
 
 <p>The ppd-product attribute specifies the PSVersion attribute values in the PPD file.
 
-<h4><a name="ppd-type">ppd-type (type1 keyword)</a><span class="info">CUPS 1.3</span></h4>
+<h4><a name="ppd-type">ppd-type (type1 keyword)</a><span class="info">CUPS 1.3/Mac OS X 10.5</span></h4>
 
 <p>The ppd-type attribute specifies the type of driver described by the PPD file:</p>
 
@@ -2509,7 +2509,7 @@ language is unknown or undefined then "en" (English) is assumed.
 
 <h3 class='title'><a name='PRINTER_ATTRIBUTES'>Printer Attributes</a></h3>
 
-<h4><a name="auth-info-required">auth-info-required (1setOf type2 keyword)</a><span class="info">CUPS 1.3</span></h4>
+<h4><a name="auth-info-required">auth-info-required (1setOf type2 keyword)</a><span class="info">CUPS 1.3/Mac OS X 10.5</span></h4>
 
 <p>The auth-info-required attribute specifies the authentication information that is required for printing a job. The following keywords are recognized:</p>
 
@@ -2549,50 +2549,50 @@ the system.
 <p>The job-sheets-supported attribute specifies the available banner files.
 There will always be at least one banner file available called "none".
 
-<h4><a name="marker-change-time">marker-change-time (integer)</a><span class='info'>CUPS 1.3</span></h4>
+<h4><a name="marker-change-time">marker-change-time (integer)</a><span class='info'>CUPS 1.3/Mac OS X 10.5</span></h4>
 
 <p>The marker-change-time attribute specifies the printer-up-time value when
 the last change to the marker-colors, marker-levels, marker-message,
 marker-names, or marker-types attributes was made.</p>
 
-<h4><a name="marker-colors">marker-colors (1setof name(MAX))</a><span class='info'>CUPS 1.3</span></h4>
+<h4><a name="marker-colors">marker-colors (1setof name(MAX))</a><span class='info'>CUPS 1.3/Mac OS X 10.5</span></h4>
 
 <p>The marker-colors attribute specifies the color(s) for each supply in the
 printer. It is only available when the driver provides supply levels. The
 color is either "none" or one or more hex-encoded sRGB colors of the form
 "#RRGGBB".</p>
 
-<h4><a name="marker-high-levels">marker-high-levels (1setof integer(0:100))</a><span class='info'>CUPS 1.4</span></h4>
+<h4><a name="marker-high-levels">marker-high-levels (1setof integer(0:100))</a><span class='info'>CUPS 1.4/Mac OS X 10.6</span></h4>
 
 <p>The marker-high-levels attribute specifies the supply levels that indicate
 a near-full condition. A value of 100 should be used for supplies that are
 consumed/emptied, e.g. ink cartridges.</p>
 
-<h4><a name="marker-levels">marker-levels (1setof integer(-1:100))</a><span class='info'>CUPS 1.3</span></h4>
+<h4><a name="marker-levels">marker-levels (1setof integer(-1:100))</a><span class='info'>CUPS 1.3/Mac OS X 10.5</span></h4>
 
 <p>The marker-levels attribute specifies the current supply levels for the
 printer. It is only available when the driver provides supply levels. A
 value of -1 indicates the level is unknown, while values from 0 to 100
 indicate the corresponding percentage.</p>
 
-<h4><a name="marker-low-levels">marker-low-levels (1setof integer(0:100))</a><span class='info'>CUPS 1.4</span></h4>
+<h4><a name="marker-low-levels">marker-low-levels (1setof integer(0:100))</a><span class='info'>CUPS 1.4/Mac OS X 10.6</span></h4>
 
 <p>The marker-low-levels attribute specifies the supply levels that indicate
 a near-empty condition. A value of 0 should be used for supplies that are
 filled, e.g. waste ink tanks.</p>
 
-<h4><a name="marker-message">marker-message (text(MAX))</a><span class='info'>CUPS 1.4</span></h4>
+<h4><a name="marker-message">marker-message (text(MAX))</a><span class='info'>CUPS 1.4/Mac OS X 10.6</span></h4>
 
 <p>The marker-message attribute provides a human-readable status message
 for the current supply levels, e.g. "12 pages of ink remaining." It is only
 available when the driver provides supply levels.</p>
 
-<h4><a name="marker-names">marker-names (1setof name(MAX))</a><span class='info'>CUPS 1.3</span></h4>
+<h4><a name="marker-names">marker-names (1setof name(MAX))</a><span class='info'>CUPS 1.3/Mac OS X 10.5</span></h4>
 
 <p>The marker-names attribute specifies the name(s) for each supply in the
 printer. It is only available when the driver provides supply levels.</p>
 
-<h4><a name="marker-types">marker-types (1setof type3 keyword)</a><span class='info'>CUPS 1.3</span></h4>
+<h4><a name="marker-types">marker-types (1setof type3 keyword)</a><span class='info'>CUPS 1.3/Mac OS X 10.5</span></h4>
 
 <p>The marker-types attribute specifies the type(s) of each supply in the
 printer. It is only available when the driver provides supply levels. The
@@ -2671,13 +2671,13 @@ to this printer. The default port monitor is "none".
 
 <p>The port-monitor-supported attribute specifies the available port monitors.
 
-<h4><a name="printer-commands">printer-commands (1setOf Type3 keyword)</a><span class='info'>CUPS 1.4</span></h4>
+<h4><a name="printer-commands">printer-commands (1setOf Type3 keyword)</a><span class='info'>CUPS 1.4/Mac OS X 10.6</span></h4>
 
 <p>The printer-commands attribute specifies the commands that are supported
 by the CUPS command file filter. The keyword "none" indicates that no commands
 are supported.</p>
 
-<h4><a name="printer-dns-sd-name">printer-dns-sd-name (name(MAX) | noValue)</a><span class='info'>CUPS 1.4</span></h4>
+<h4><a name="printer-dns-sd-name">printer-dns-sd-name (name(MAX) | noValue)</a><span class='info'>CUPS 1.4/Mac OS X 10.6</span></h4>
 
 <p>The printer-dns-sd-name attribute specifies the registered DNS-SD service
 name for the printer. If the printer is not being shared using this protocol,
@@ -2697,10 +2697,10 @@ and the following CUPS-specific keywords:</p>
        permissions. CUPS will not execute programs with world write permissions
        or setuid programs. When run as root (the default), CUPS also does not
        execute programs that are not owned by root.
-       <span class='info'>CUPS 1.4</span></li>
+       <span class='info'>CUPS 1.4/Mac OS X 10.6</span></li>
 
        <li><tt>cups-missing-filter-warning</tt> - a filter or backend is not
-       installed. <span class='info'>CUPS 1.4</span></li>
+       installed. <span class='info'>CUPS 1.4/Mac OS X 10.6</span></li>
 
 </ul>
 
index 6753cd48edea717a8f8f215be84dbd1cff942783..9fce558dcef6f8bf0ef449654a4921075956efef 100644 (file)
@@ -212,7 +212,7 @@ function is applied <i>after</i> the CMY transformation:</p>
 </pre>
 
 
-<h3><span class='info'>Mac OS X 10.3/CUPS 1.2</span><a name='cupsICCProfile'>cupsICCProfile</a></h3>
+<h3><span class='info'>Mac OS X 10.3/CUPS 1.2/Mac OS X 10.5</span><a name='cupsICCProfile'>cupsICCProfile</a></h3>
 
 <p class='summary'>*cupsICCProfile
 ColorModel.MediaType.Resolution/Description: "filename"</p>
@@ -395,7 +395,7 @@ The same <tt>cupsUIResolver</tt> can be used by multiple
 
 </blockquote>
 
-<h3><span class='info'>CUPS 1.4</span><a name='cupsUIConstraints'>cupsUIConstraints</a></h3>
+<h3><span class='info'>CUPS 1.4/Mac OS X 10.6</span><a name='cupsUIConstraints'>cupsUIConstraints</a></h3>
 
 <p class='summary'>*cupsUIConstraints resolver: "*Keyword1 *Keyword2 ..."<br>
 *cupsUIConstraints resolver: "*Keyword1 OptionKeyword1 *Keyword2 ..."<br>
@@ -428,7 +428,7 @@ choice followed by testing each option choice to resolve the conflict.</p>
 *cupsUIConstraints photo: "*OutputMode Photo *MediaType Transparency *Resolution 1200dpi"
 </pre>
 
-<h3><span class='info'>CUPS 1.4</span><a name='cupsUIResolver'>cupsUIResolver</a></h3>
+<h3><span class='info'>CUPS 1.4/Mac OS X 10.6</span><a name='cupsUIResolver'>cupsUIResolver</a></h3>
 
 <p class='summary'>*cupsUIResolution resolver: "*Keyword1 OptionKeyword1 *Keyword2 OptionKeyword2 ..."</p>
 
@@ -1058,7 +1058,7 @@ PRE B {
 <p>The CUPS media attributes allow drivers to specify alternate custom page
 size limits based on up to two options.</p>
 
-<h3><span class='info'>CUPS 1.4</span><a name='cupsMediaQualifier2'>cupsMediaQualifier2</a></h3>
+<h3><span class='info'>CUPS 1.4/Mac OS X 10.6</span><a name='cupsMediaQualifier2'>cupsMediaQualifier2</a></h3>
 
 <p class='summary'>*cupsMediaQualifier2: MainKeyword</p>
 
@@ -1077,7 +1077,7 @@ custom page size limits.</p>
 *cupsMinSize ..Photo: "300 300"
 </pre>
 
-<h3><span class='info'>CUPS 1.4</span><a name='cupsMediaQualifier3'>cupsMediaQualifier3</a></h3>
+<h3><span class='info'>CUPS 1.4/Mac OS X 10.6</span><a name='cupsMediaQualifier3'>cupsMediaQualifier3</a></h3>
 
 <p class='summary'>*cupsMediaQualifier3: MainKeyword</p>
 
@@ -1096,7 +1096,7 @@ custom page size limits.</p>
 *cupsMinSize ..Photo: "300 300"
 </pre>
 
-<h3><span class='info'>CUPS 1.4</span><a name='cupsMinSize'>cupsMinSize</a></h3>
+<h3><span class='info'>CUPS 1.4/Mac OS X 10.6</span><a name='cupsMinSize'>cupsMinSize</a></h3>
 
 <p class='summary'>*cupsMinSize .Qualifier2.Qualifier3: "width length"<br>
 *cupsMinSize .Qualifier2.: "width length"<br>
@@ -1119,7 +1119,7 @@ are used to identify options to use for matching.</p>
 *cupsMinSize ..Photo: "300 300"
 </pre>
 
-<h3><span class='info'>CUPS 1.4</span><a name='cupsMaxSize'>cupsMaxSize</a></h3>
+<h3><span class='info'>CUPS 1.4/Mac OS X 10.6</span><a name='cupsMaxSize'>cupsMaxSize</a></h3>
 
 <p class='summary'>*cupsMaxSize .Qualifier2.Qualifier3: "width length"<br>
 *cupsMaxSize .Qualifier2.: "width length"<br>
@@ -1145,7 +1145,7 @@ are used to identify options to use for matching.</p>
 
 <h2 class='title'><a name='ATTRIBUTES'>General Attributes</a></h2>
 
-<h3><span class='info'>CUPS 1.3</span><a name='cupsBackSide'>cupsBackSide</a></h3>
+<h3><span class='info'>CUPS 1.3/Mac OS X 10.5</span><a name='cupsBackSide'>cupsBackSide</a></h3>
 
 <p class='summary'>*cupsBackSide: keyword</p>
 
@@ -1241,7 +1241,7 @@ will be ignored.</p>
 <p>Also see the related <a href='#APDuplexRequiresFlippedMargin'><tt>APDuplexRequiresFlippedMargin</tt></a>
 attribute.</p>
 
-<h3><span class='info'>CUPS 1.4</span><a name='cupsCommands'>cupsCommands</a></h3>
+<h3><span class='info'>CUPS 1.4/Mac OS X 10.6</span><a name='cupsCommands'>cupsCommands</a></h3>
 
 <p class='summary'>*cupsCommands: "name name2 ... nameN"</p>
 
@@ -1257,7 +1257,7 @@ by whitespace.</p>
 </pre>
 
 
-<h3><span class='info'>CUPS 1.3</span><a name='cupsEvenDuplex'>cupsEvenDuplex</a></h3>
+<h3><span class='info'>CUPS 1.3/Mac OS X 10.5</span><a name='cupsEvenDuplex'>cupsEvenDuplex</a></h3>
 
 <p class='summary'>*cupsEvenDuplex: boolean</p>
 
@@ -1341,7 +1341,7 @@ Ghostscript can use:</p>
 *cupsFlipDuplex: true
 </pre></blockquote>
 
-<h3><span class='info'>CUPS 1.3</span><a name='cupsIPPFinishings'>cupsIPPFinishings</a></h3>
+<h3><span class='info'>CUPS 1.3/Mac OS X 10.5</span><a name='cupsIPPFinishings'>cupsIPPFinishings</a></h3>
 
 <p class='summary'>*cupsIPPFinishings number/text: "*Option Choice ..."</p>
 
@@ -1357,7 +1357,7 @@ values to PPD options and choices.</p>
 *cupsIPPFinishings 21/staple-bottom-left: "*StapleLocation SingleLandscape"
 </pre>
 
-<h3><span class='info'>CUPS 1.3</span><a name='cupsIPPReason'>cupsIPPReason</a></h3>
+<h3><span class='info'>CUPS 1.3/Mac OS X 10.5</span><a name='cupsIPPReason'>cupsIPPReason</a></h3>
 
 <p class='summary'>*cupsIPPReason reason/Reason Text: "optional URIs"</p>
 
@@ -1401,7 +1401,7 @@ http://www.vendor.com/help"
 *End
 </pre>
 
-<h3><span class='info'>CUPS 1.2</span><a name='cupsLanguages'>cupsLanguages</a></h3>
+<h3><span class='info'>CUPS 1.2/Mac OS X 10.5</span><a name='cupsLanguages'>cupsLanguages</a></h3>
 
 <p class='summary'>*cupsLanguages: "locale list"</p>
 
@@ -1431,7 +1431,7 @@ hardware. The default value is <code>false</code>.</p>
 *cupsManualCopies: true
 </pre>
 
-<h3><span class='info'>CUPS 1.4</span><a name='cupsMarkerName'>cupsMarkerName</a></h3>
+<h3><span class='info'>CUPS 1.4/Mac OS X 10.6</span><a name='cupsMarkerName'>cupsMarkerName</a></h3>
 
 <p class='summary'>*cupsMarkerName/Name Text: ""</p>
 
@@ -1445,7 +1445,7 @@ generated by the driver to human readable text.</p>
 *cupsMarkerName cyanToner/Cyan Toner: ""
 </pre>
 
-<h3><span class='info'>CUPS 1.4</span><a name='cupsMarkerNotice'>cupsMarkerNotice</a></h3>
+<h3><span class='info'>CUPS 1.4/Mac OS X 10.6</span><a name='cupsMarkerNotice'>cupsMarkerNotice</a></h3>
 
 <p class='summary'>*cupsMarkerNotice: "disclaimer text"</p>
 
@@ -1474,7 +1474,7 @@ the output for a specific model of printer.</p>
 *cupsModelNumber: 1234
 </pre>
 
-<h3><span class='info'>CUPS 1.3</span><a name='cupsPJLCharset'>cupsPJLCharset</a></h3>
+<h3><span class='info'>CUPS 1.3/Mac OS X 10.5</span><a name='cupsPJLCharset'>cupsPJLCharset</a></h3>
 
 <p class='summary'>*cupsPJLCharset: "ISO character set name"</p>
 
@@ -1489,7 +1489,7 @@ assumed.</p>
 *cupsPJLCharset: "UTF-8"
 </pre>
 
-<h3><span class='info'>CUPS 1.4</span><a name='cupsPJLDisplay'>cupsPJLDisplay</a></h3>
+<h3><span class='info'>CUPS 1.4/Mac OS X 10.6</span><a name='cupsPJLDisplay'>cupsPJLDisplay</a></h3>
 
 <p class='summary'>*cupsPJLDisplay: "what"</p>
 
@@ -1508,7 +1508,7 @@ to use "@PJL RDYMSG DISPLAY". The default is "job".</p>
 *cupsPJLDisplay: "none"
 </pre>
 
-<h3><span class='info'>CUPS 1.2</span><a name='cupsPortMonitor'>cupsPortMonitor</a></h3>
+<h3><span class='info'>CUPS 1.2/Mac OS X 10.5</span><a name='cupsPortMonitor'>cupsPortMonitor</a></h3>
 
 <p class='summary'>*cupsPortMonitor urischeme/Descriptive Text: "port monitor"</p>
 
@@ -1540,7 +1540,7 @@ to disable the port monitor for the given URI scheme.</p>
 *cupsPortMonitor usb/USB Status Monitor: "epson-usb"
 </pre>
 
-<h3><span class='info'>CUPS 1.3</span><a name='cupsPreFilter'>cupsPreFilter</a></h3>
+<h3><span class='info'>CUPS 1.3/Mac OS X 10.5</span><a name='cupsPreFilter'>cupsPreFilter</a></h3>
 
 <p class='summary'>*cupsPreFilter: "source/type cost program"</p>
 
@@ -1558,7 +1558,7 @@ before the filter that accepts the given MIME type.</p>
 *cupsPreFilter: "image/png 0 mypngprefilter"
 </pre>
 
-<h3><span class='info'>CUPS 1.4</span><a name='cupsSNMPSupplies'>cupsSNMPSupplies</a></h3>
+<h3><span class='info'>CUPS 1.4/Mac OS X 10.6</span><a name='cupsSNMPSupplies'>cupsSNMPSupplies</a></h3>
 
 <p class='summary'>*cupsSNMPSupplies: boolean</p>
 
@@ -1863,7 +1863,7 @@ the device.</p>
 
 <h2 class='title'><a name='HISTORY'>Change History</a></h2>
 
-<h3>Changes in CUPS 1.4</a></h3>
+<h3>Changes in CUPS 1.4</h3>
 
 <ul>
 
@@ -1898,7 +1898,7 @@ the device.</p>
 </ul>
 
 
-<h3>Changes in CUPS 1.3.1</a></h3>
+<h3>Changes in CUPS 1.3.1</h3>
 
 <ul>
 
@@ -1913,7 +1913,7 @@ the device.</p>
 </ul>
 
 
-<h3>Changes in CUPS 1.3</a></h3>
+<h3>Changes in CUPS 1.3</h3>
 
 <ul>
 
@@ -1932,7 +1932,7 @@ the device.</p>
 
 </ul>
 
-<h3>Changes in CUPS 1.2.8</a></h3>
+<h3>Changes in CUPS 1.2.8</h3>
 
 <ul>
 
@@ -1941,7 +1941,7 @@ the device.</p>
 
 </ul>
 
-<h3>Changes in CUPS 1.2</a></h3>
+<h3>Changes in CUPS 1.2</h3>
 
 <ul>
 
@@ -1966,7 +1966,7 @@ the device.</p>
 
 </ul>
 
-<h3>Changes in CUPS 1.1</a></h3>
+<h3>Changes in CUPS 1.1</h3>
 
 <ul>
 
index 713c024a07fa0f71c601552729008a54515f029f..4f51d2bc04c7332aba2d7f68c2e433302fd868b9 100644 (file)
@@ -139,7 +139,7 @@ _cupsRasterClearError(void)
  *
  * If there are no recent errors, NULL is returned.
  *
- * @since CUPS 1.3@
+ * @since CUPS 1.3/Mac OS X 10.5@
  */
 
 const char *                           /* O - Last error */
index acb88b5d8993703a5556fe825c57cfeb05facc66..d79aed4b95e6f4bc4bb841464e13d35d18943101 100644 (file)
@@ -985,6 +985,9 @@ scan_ps(_cups_ps_stack_t *st,               /* I  - Stack */
       */
 
       for (cur ++; *cur && *cur != '\n' && *cur != '\r'; cur ++);
+
+      if (!*cur)
+        cur --;
     }
     else if (!isspace(*cur & 255))
       break;
index 03f453d81ff5f783c32f187f9a107d9a085a03b7..221aeb760b03c312730522702f1e949071b47f3e 100644 (file)
@@ -65,13 +65,23 @@ main(int  argc,                             /* I - Number of command-line args */
                fit;                    /* Fit output to default page size? */
   ppd_file_t   *ppd;                   /* PPD file */
   ppd_size_t   *size;                  /* Current page size */
-  int          pdfpid,                 /* Process ID for pdftops */
-               pdfwaitpid,             /* Process ID from wait() */
-               pdfstatus,              /* Status from pdftops */
-               pdfargc;                /* Number of args for pdftops */
-  char         *pdfargv[100],          /* Arguments for pdftops/gs */
-               pdfwidth[255],          /* Paper width */
-               pdfheight[255];         /* Paper height */
+  int          pdf_pid,                /* Process ID for pdftops */
+               pdf_argc,               /* Number of args for pdftops */
+               pstops_pid,             /* Process ID of pstops filter */
+               pstops_pipe[2],         /* Pipe to pstops filter */
+               wait_children,          /* Number of child processes left */
+               wait_pid,               /* Process ID from wait() */
+               wait_status,            /* Status from child */
+               exit_status = 0;        /* Exit status */
+  char         *pdf_argv[100],         /* Arguments for pdftops/gs */
+               pdf_width[255],         /* Paper width */
+               pdf_height[255],        /* Paper height */
+               pstops_path[1024],      /* Path to pstops program */
+               *pstops_argv[7],        /* Arguments for pstops filter */
+               *pstops_options,        /* Options for pstops filter */
+               *pstops_start,          /* Start of pstops filter option */
+               *pstops_end;            /* End of pstops filter option */
+  const char   *cups_serverbin;        /* CUPS_SERVERBIN environment variable */
 #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
   struct sigaction action;             /* Actions for POSIX signals */
 #endif /* HAVE_SIGACTION && !HAVE_SIGSET */
@@ -157,22 +167,112 @@ main(int  argc,                          /* I - Number of command-line args */
   ppdMarkDefaults(ppd);
   cupsMarkOptions(ppd, num_options, options);
 
+ /*
+  * Build the pstops command-line...
+  */
+
+  if ((cups_serverbin = getenv("CUPS_SERVERBIN")) == NULL)
+    cups_serverbin = CUPS_SERVERBIN;
+
+  snprintf(pstops_path, sizeof(pstops_path), "%s/filter/pstops",
+           cups_serverbin);
+
+  pstops_options = strdup(argv[5]);
+
+  if ((pstops_start = strstr(pstops_options, "fitplot")) != NULL &&
+      (!pstops_start[7] || isspace(pstops_start[7] & 255)))
+  {
+   /*
+    * Strip [no]fitplot option...
+    */
+
+    pstops_end = pstops_start + 7;
+
+    if ((pstops_start - pstops_options) >= 2 &&
+        !strncmp(pstops_start - 2, "no", 2))
+      pstops_start -= 2;
+
+    while (*pstops_end && isspace(*pstops_end & 255))
+      pstops_end ++;
+
+    _cups_strcpy(pstops_start, pstops_end);
+  }
+
+  if ((pstops_start = strstr(pstops_options, "fit-to-page")) != NULL &&
+      (!pstops_start[11] || isspace(pstops_start[11] & 255)))
+  {
+   /*
+    * Strip [no]fit-to-page option...
+    */
+
+    pstops_end = pstops_start + 11;
+
+    if ((pstops_start - pstops_options) >= 2 &&
+        !strncmp(pstops_start - 2, "no", 2))
+      pstops_start -= 2;
+
+    while (*pstops_end && isspace(*pstops_end & 255))
+      pstops_end ++;
+
+    _cups_strcpy(pstops_start, pstops_end);
+  }
+
+  if ((pstops_start = strstr(pstops_options, "landscape")) != NULL &&
+      (!pstops_start[9] || isspace(pstops_start[9] & 255)))
+  {
+   /*
+    * Strip [no]landscape option...
+    */
+
+    pstops_end = pstops_start + 9;
+
+    if ((pstops_start - pstops_options) >= 2 &&
+        !strncmp(pstops_start - 2, "no", 2))
+      pstops_start -= 2;
+
+    while (*pstops_end && isspace(*pstops_end & 255))
+      pstops_end ++;
+
+    _cups_strcpy(pstops_start, pstops_end);
+  }
+
+  if ((pstops_start = strstr(pstops_options, "orientation-requested=")) != NULL)
+  {
+   /*
+    * Strip [no]fitplot option...
+    */
+
+    pstops_end = pstops_start + 22;
+    while (*pstops_end && !isspace(*pstops_end & 255))
+      pstops_end ++;
+
+    _cups_strcpy(pstops_start, pstops_end);
+  }
+
+  pstops_argv[0] = argv[0];            /* Printer */
+  pstops_argv[1] = argv[1];            /* Job */
+  pstops_argv[2] = argv[2];            /* User */
+  pstops_argv[3] = argv[3];            /* Title */
+  pstops_argv[4] = argv[4];            /* Copies */
+  pstops_argv[5] = pstops_options;     /* Options */
+  pstops_argv[6] = NULL;
+
  /*
   * Build the command-line for the pdftops or gs filter...
   */
 
 #ifdef HAVE_PDFTOPS
-  pdfargv[0] = (char *)"pdftops";
-  pdfargc    = 1;
+  pdf_argv[0] = (char *)"pdftops";
+  pdf_argc    = 1;
 #else
-  pdfargv[0] = (char *)"gs";
-  pdfargv[1] = (char *)"-q";
-  pdfargv[2] = (char *)"-dNOPAUSE";
-  pdfargv[3] = (char *)"-dBATCH";
-  pdfargv[4] = (char *)"-dSAFER";
-  pdfargv[5] = (char *)"-sDEVICE=pswrite";
-  pdfargv[6] = (char *)"-sOUTPUTFILE=%stdout";
-  pdfargc    = 7;
+  pdf_argv[0] = (char *)"gs";
+  pdf_argv[1] = (char *)"-q";
+  pdf_argv[2] = (char *)"-dNOPAUSE";
+  pdf_argv[3] = (char *)"-dBATCH";
+  pdf_argv[4] = (char *)"-dSAFER";
+  pdf_argv[5] = (char *)"-sDEVICE=pswrite";
+  pdf_argv[6] = (char *)"-sOUTPUTFILE=%stdout";
+  pdf_argc    = 7;
 #endif /* HAVE_PDFTOPS */
 
   if (ppd)
@@ -184,27 +284,27 @@ main(int  argc,                           /* I - Number of command-line args */
     if (ppd->language_level == 1)
     {
 #ifdef HAVE_PDFTOPS
-      pdfargv[pdfargc++] = (char *)"-level1";
-      pdfargv[pdfargc++] = (char *)"-noembtt";
+      pdf_argv[pdf_argc++] = (char *)"-level1";
+      pdf_argv[pdf_argc++] = (char *)"-noembtt";
 #else
-      pdfargv[pdfargc++] = (char *)"-dLanguageLevel=1";
+      pdf_argv[pdf_argc++] = (char *)"-dLanguageLevel=1";
 #endif /* HAVE_PDFTOPS */
     }
     else if (ppd->language_level == 2)
     {
 #ifdef HAVE_PDFTOPS
-      pdfargv[pdfargc++] = (char *)"-level2";
+      pdf_argv[pdf_argc++] = (char *)"-level2";
       if (!ppd->ttrasterizer)
-       pdfargv[pdfargc++] = (char *)"-noembtt";
+       pdf_argv[pdf_argc++] = (char *)"-noembtt";
 #else
-      pdfargv[pdfargc++] = (char *)"-dLanguageLevel=2";
+      pdf_argv[pdf_argc++] = (char *)"-dLanguageLevel=2";
 #endif /* HAVE_PDFTOPS */
     }
     else
 #ifdef HAVE_PDFTOPS
-      pdfargv[pdfargc++] = (char *)"-level3";
+      pdf_argv[pdf_argc++] = (char *)"-level3";
 #else
-      pdfargv[pdfargc++] = (char *)"-dLanguageLevel=3";
+      pdf_argv[pdf_argc++] = (char *)"-dLanguageLevel=3";
 #endif /* HAVE_PDFTOPS */
 
     if ((val = cupsGetOption("fitplot", num_options, options)) == NULL)
@@ -254,72 +354,88 @@ main(int  argc,                           /* I - Number of command-line args */
 #ifdef HAVE_PDFTOPS
       if (orientation & 1)
       {
-       snprintf(pdfwidth, sizeof(pdfwidth), "%.0f", size->length);
-       snprintf(pdfheight, sizeof(pdfheight), "%.0f", size->width);
+       snprintf(pdf_width, sizeof(pdf_width), "%.0f", size->length);
+       snprintf(pdf_height, sizeof(pdf_height), "%.0f", size->width);
       }
       else
       {
-       snprintf(pdfwidth, sizeof(pdfwidth), "%.0f", size->width);
-       snprintf(pdfheight, sizeof(pdfheight), "%.0f", size->length);
+       snprintf(pdf_width, sizeof(pdf_width), "%.0f", size->width);
+       snprintf(pdf_height, sizeof(pdf_height), "%.0f", size->length);
       }
 
-      pdfargv[pdfargc++] = (char *)"-paperw";
-      pdfargv[pdfargc++] = pdfwidth;
-      pdfargv[pdfargc++] = (char *)"-paperh";
-      pdfargv[pdfargc++] = pdfheight;
-      pdfargv[pdfargc++] = (char *)"-expand";
+      pdf_argv[pdf_argc++] = (char *)"-paperw";
+      pdf_argv[pdf_argc++] = pdf_width;
+      pdf_argv[pdf_argc++] = (char *)"-paperh";
+      pdf_argv[pdf_argc++] = pdf_height;
+      pdf_argv[pdf_argc++] = (char *)"-expand";
 
 #else
       if (orientation & 1)
       {
-       snprintf(pdfwidth, sizeof(pdfwidth), "-dDEVICEWIDTHPOINTS=%.0f",
+       snprintf(pdf_width, sizeof(pdf_width), "-dDEVICEWIDTHPOINTS=%.0f",
                 size->length);
-       snprintf(pdfheight, sizeof(pdfheight), "-dDEVICEHEIGHTPOINTS=%.0f",
+       snprintf(pdf_height, sizeof(pdf_height), "-dDEVICEHEIGHTPOINTS=%.0f",
                 size->width);
       }
       else
       {
-       snprintf(pdfwidth, sizeof(pdfwidth), "-dDEVICEWIDTHPOINTS=%.0f",
+       snprintf(pdf_width, sizeof(pdf_width), "-dDEVICEWIDTHPOINTS=%.0f",
                 size->width);
-       snprintf(pdfheight, sizeof(pdfheight), "-dDEVICEHEIGHTPOINTS=%.0f",
+       snprintf(pdf_height, sizeof(pdf_height), "-dDEVICEHEIGHTPOINTS=%.0f",
                 size->length);
       }
 
-      pdfargv[pdfargc++] = pdfwidth;
-      pdfargv[pdfargc++] = pdfheight;
+      pdf_argv[pdf_argc++] = pdf_width;
+      pdf_argv[pdf_argc++] = pdf_height;
 #endif /* HAVE_PDFTOPS */
     }
   }
 
 #ifdef HAVE_PDFTOPS
-  pdfargv[pdfargc++] = filename;
-  pdfargv[pdfargc++] = (char *)"-";
+  pdf_argv[pdf_argc++] = filename;
+  pdf_argv[pdf_argc++] = (char *)"-";
 #else
-  pdfargv[pdfargc++] = (char *)"-c";
-  pdfargv[pdfargc++] = (char *)"save pop";
-  pdfargv[pdfargc++] = (char *)"-f";
-  pdfargv[pdfargc++] = filename;
+  pdf_argv[pdf_argc++] = (char *)"-c";
+  pdf_argv[pdf_argc++] = (char *)"save pop";
+  pdf_argv[pdf_argc++] = (char *)"-f";
+  pdf_argv[pdf_argc++] = filename;
 #endif /* HAVE_PDFTOPS */
 
-  pdfargv[pdfargc] = NULL;
+  pdf_argv[pdf_argc] = NULL;
+
+ /*
+  * Execute "pdftops/gs | pstops"...
+  */
+
+  if (pipe(pstops_pipe))
+  {
+    _cupsLangPrintError(_("ERROR: Unable to create pipe"));
+
+    exit_status = 1;
+    goto error;
+  }
 
-  if ((pdfpid = fork()) == 0)
+  if ((pdf_pid = fork()) == 0)
   {
    /*
     * Child comes here...
     */
 
+    dup2(pstops_pipe[1], 1);
+    close(pstops_pipe[0]);
+    close(pstops_pipe[1]);
+
 #ifdef HAVE_PDFTOPS
-    execv(CUPS_PDFTOPS, pdfargv);
+    execv(CUPS_PDFTOPS, pdf_argv);
     _cupsLangPrintError(_("ERROR: Unable to execute pdftops program"));
 #else
-    execv(CUPS_GHOSTSCRIPT, pdfargv);
+    execv(CUPS_GHOSTSCRIPT, pdf_argv);
     _cupsLangPrintError(_("ERROR: Unable to execute gs program"));
 #endif /* HAVE_PDFTOPS */
 
     exit(1);
   }
-  else if (pdfpid < 0)
+  else if (pdf_pid < 0)
   {
    /*
     * Unable to fork!
@@ -331,56 +447,137 @@ main(int  argc,                          /* I - Number of command-line args */
     _cupsLangPrintError(_("ERROR: Unable to execute gs program"));
 #endif /* HAVE_PDFTOPS */
 
-    pdfstatus = 1;
+    exit_status = 1;
+    goto error;
   }
-  else
+
+  fprintf(stderr, "DEBUG: Started filter %s (PID %d)\n", pdf_argv[0], pdf_pid);
+
+  if ((pstops_pid = fork()) == 0)
   {
    /*
-    * Parent comes here...
+    * Child comes here...
     */
 
-    while ((pdfwaitpid = wait(&pdfstatus)) != pdfpid && errno == EINTR)
-    {
-     /*
-      * Wait until we get a valid process ID or the job is canceled...
-      */
+    dup2(pstops_pipe[0], 0);
+    close(pstops_pipe[0]);
+    close(pstops_pipe[1]);
+
+    execv(pstops_path, pstops_argv);
+    _cupsLangPrintError(_("ERROR: Unable to execute pstops program"));
+
+    exit(1);
+  }
+  else if (pstops_pid < 0)
+  {
+   /*
+    * Unable to fork!
+    */
+
+    _cupsLangPrintError(_("ERROR: Unable to execute pstops program"));
+
+    exit_status = 1;
+    goto error;
+  }
+
+  fprintf(stderr, "DEBUG: Started filter pstops (PID %d)\n", pstops_pid);
+
+  close(pstops_pipe[0]);
+  close(pstops_pipe[1]);
+
+ /*
+  * Wait for the child processes to exit...
+  */
+
+  wait_children = 2;
+
+  while (wait_children > 0)
+  {
+   /*
+    * Wait until we get a valid process ID or the job is canceled...
+    */
 
+    while ((wait_pid = wait(&wait_status)) < 0 && errno == EINTR)
+    {
       if (job_canceled)
       {
-        kill(pdfpid, SIGTERM);
+       kill(pdf_pid, SIGTERM);
+       kill(pstops_pid, SIGTERM);
+
        job_canceled = 0;
       }
     }
 
-    if (pdfstatus)
+    if (wait_pid < 0)
+      break;
+
+    wait_children --;
+
+   /*
+    * Report child status...
+    */
+
+    if (wait_status)
     {
-      if (WIFEXITED(pdfstatus))
+      if (WIFEXITED(wait_status))
       {
-       pdfstatus = WEXITSTATUS(pdfstatus);
+       exit_status = WEXITSTATUS(wait_status);
 
-       _cupsLangPrintf(stderr,
-                       _("ERROR: pdftops filter exited with status %d!\n"),
-                       pdfstatus);
+        fprintf(stderr, "DEBUG: PID %d (%s) stopped with status %d!\n",
+               wait_pid,               
+#ifdef HAVE_PDFTOPS
+                wait_pid == pdf_pid ? "pdftops" : "pstops",
+#else
+                wait_pid == pdf_pid ? "gs" : "pstops",
+#endif /* HAVE_PDFTOPS */
+               exit_status);
+      }
+      else if (WTERMSIG(wait_status) == SIGTERM)
+      {
+        fprintf(stderr,
+               "DEBUG: PID %d (%s) was terminated normally with signal %d!\n",
+               wait_pid,               
+#ifdef HAVE_PDFTOPS
+                wait_pid == pdf_pid ? "pdftops" : "pstops",
+#else
+                wait_pid == pdf_pid ? "gs" : "pstops",
+#endif /* HAVE_PDFTOPS */
+               exit_status);
       }
       else
       {
-       pdfstatus = WTERMSIG(pdfstatus);
+       exit_status = WTERMSIG(wait_status);
 
-       _cupsLangPrintf(stderr,
-                       _("ERROR: pdftops filter crashed on signal %d!\n"),
-                       pdfstatus);
+        fprintf(stderr, "DEBUG: PID %d (%s) crashed on signal %d!\n", wait_pid,                
+#ifdef HAVE_PDFTOPS
+                wait_pid == pdf_pid ? "pdftops" : "pstops",
+#else
+                wait_pid == pdf_pid ? "gs" : "pstops",
+#endif /* HAVE_PDFTOPS */
+               exit_status);
       }
     }
+    else
+    {
+      fprintf(stderr, "DEBUG: PID %d (%s) exited with no errors.\n", wait_pid,         
+#ifdef HAVE_PDFTOPS
+             wait_pid == pdf_pid ? "pdftops" : "pstops");
+#else
+             wait_pid == pdf_pid ? "gs" : "pstops");
+#endif /* HAVE_PDFTOPS */
+    }
   }
 
  /*
   * Cleanup and exit...
   */
 
+  error:
+
   if (tempfile[0])
     unlink(tempfile);
 
-  return (pdfstatus);
+  return (exit_status);
 }
 
 
index a21086d92a18091d2860b587bfa546085e7958d1..439744f0fa8b1dd7181f667607991296369c72be 100644 (file)
@@ -6,7 +6,7 @@
 
 <div class='figure'><table summary='PostScript Filter Chain'>
 <caption>Figure 1: <a name='FIGURE_1'>PostScript Filter Chain</a></caption>
-<tr><td><img src='/images/cups-postscript-chain.png' width='700' height='150' alt='PostScript Filter Chain'></td></tr>
+<tr><td><img src='../images/cups-postscript-chain.png' width='700' height='150' alt='PostScript Filter Chain'></td></tr>
 </table></div>
 
 <p>The optional PostScript filter can be provided to add printer-specific commands to the PostScript output that cannot be represented in the PPD file or to reorganize the output for special printer features. Typically this is used to support advanced job management or finishing functions on the printer. CUPS includes a generic PostScript filter that handles all PPD-defined commands.</p>
@@ -19,7 +19,7 @@
 
 <div class='figure'><table summary='Command Filter Chain'>
 <caption>Figure 2: <a name='FIGURE_2'>Command Filter Chain</a></caption>
-<tr><td><img src='/images/cups-command-chain.png' width='575' height='150' alt='Command Filter Chain'></td></tr>
+<tr><td><img src='../images/cups-command-chain.png' width='575' height='150' alt='Command Filter Chain'></td></tr>
 </table></div>
 
 <p>PostScript printer drivers typically do not require their own command filter since CUPS includes a generic PostScript command filter that supports all of the standard functions using PPD-defined commands.</p>
index 3a260f008583edd2f547b659933fa9d75705c04c..1c0c32a9d09d69acfc3e3b8b095b24f1395b112f 100644 (file)
@@ -6,7 +6,7 @@
 
 <div class='figure'><table summary='Raster Filter Chain'>
 <caption>Figure 1: <a name='FIGURE_1'>Raster Filter Chain</a></caption>
-<tr><td><img src='/images/cups-raster-chain.png' width='700' height='150' alt='Raster Filter Chain'></td></tr>
+<tr><td><img src='../images/cups-raster-chain.png' width='700' height='150' alt='Raster Filter Chain'></td></tr>
 </table></div>
 
 <p>The raster filter converts CUPS raster data into a format the printer understands, for example HP-PCL. CUPS includes several sample raster filters supporting standard page description languages (PDLs). <a href='#TABLE_1'>Table 1</a> shows the raster filters that are bundled with CUPS and the languages they support.</p>
@@ -33,7 +33,7 @@
 
 <div class='figure'><table summary='Command Filter Chain'>
 <caption>Figure 2: <a name='FIGURE_2'>Command Filter Chain</a></caption>
-<tr><td><img src='/images/cups-command-chain.png' width='575' height='150' alt='Command Filter Chain'></td></tr>
+<tr><td><img src='../images/cups-command-chain.png' width='575' height='150' alt='Command Filter Chain'></td></tr>
 </table></div>
 
 <p>Raster printer drivers must provide their own command filter.</p>
index 237b0fd0f95ff0dbbedd6ad9d16eb9f01e85ff74..55f3058a5e603f0c145d662ea6f30d1196ca530a 100644 (file)
@@ -71,6 +71,9 @@
 #include "data/hp.h"
 #include "data/label.h"
 #include "data/pcl.h"
+#ifndef WIN32
+#  include <sys/utsname.h>
+#endif // !WIN32
 
 
 //
@@ -110,6 +113,25 @@ ppdcSource::ppdcSource(const char  *f,     // I - File to read
   cond_current  = cond_stack;
   cond_stack[0] = PPDC_COND_NORMAL;
 
+  // Add standard #define variables...
+#define MAKE_STRING(x) #x
+
+  vars->add(new ppdcVariable("CUPS_VERSION", MAKE_STRING(CUPS_VERSION)));
+  vars->add(new ppdcVariable("CUPS_VERSION_MAJOR", MAKE_STRING(CUPS_VERSION_MAJOR)));
+  vars->add(new ppdcVariable("CUPS_VERSION_MINOR", MAKE_STRING(CUPS_VERSION_MINOR)));
+  vars->add(new ppdcVariable("CUPS_VERSION_PATCH", MAKE_STRING(CUPS_VERSION_PATCH)));
+
+#ifdef WIN32
+  vars->add(new ppdcVariable("PLATFORM_NAME", "Windows"));
+  vars->add(new ppdcVariable("PLATFORM_ARCH", "X86"));
+
+#else
+  struct utsname name;                 // uname information
+
+  vars->add(new ppdcVariable("PLATFORM_NAME", name.sysname));
+  vars->add(new ppdcVariable("PLATFORM_ARCH", name.machine));
+#endif // WIN32
+
   if (f)
     read_file(f, ffp);
 }
index 7383145cc04f7e7e34d2ecf55abb66b903163115..f52527f7f7a683e9074113d0ecbd0e0cefcc5795 100644 (file)
  * Constants...
  */
 
-#define PPD_SYNC       0x50504436      /* Sync word for ppds.dat (PPD6) */
+#define PPD_SYNC       0x50504437      /* Sync word for ppds.dat (PPD7) */
 #define PPD_MAX_LANG   32              /* Maximum languages */
-#define PPD_MAX_PROD                 /* Maximum products */
-#define PPD_MAX_VERS                 /* Maximum versions */
+#define PPD_MAX_PROD   32              /* Maximum products */
+#define PPD_MAX_VERS   32              /* Maximum versions */
 
 #define PPD_TYPE_POSTSCRIPT    0       /* PostScript PPD */
 #define PPD_TYPE_PDF           1       /* PDF PPD */
index fe6459b7f553d98b6e038e8bcded2af93f1ab978..f36acaed19e7c07498562255df97c8233de3da70 100644 (file)
@@ -3730,7 +3730,8 @@ authenticate_job(cupsd_client_t  *con,    /* I - Client connection */
 
   if (!validate_user(job, con, job->username, username, sizeof(username)))
   {
-    send_http_error(con, HTTP_UNAUTHORIZED, cupsdFindDest(job->dest));
+    send_http_error(con, con->username[0] ? HTTP_FORBIDDEN : HTTP_UNAUTHORIZED,
+                    cupsdFindDest(job->dest));
     return;
   }
 
@@ -4054,7 +4055,8 @@ cancel_job(cupsd_client_t  *con,  /* I - Client connection */
 
   if (!validate_user(job, con, job->username, username, sizeof(username)))
   {
-    send_http_error(con, HTTP_UNAUTHORIZED, cupsdFindDest(job->dest));
+    send_http_error(con, con->username[0] ? HTTP_FORBIDDEN : HTTP_UNAUTHORIZED,
+                    cupsdFindDest(job->dest));
     return;
   }
 
@@ -8088,7 +8090,8 @@ hold_job(cupsd_client_t  *con,            /* I - Client connection */
 
   if (!validate_user(job, con, job->username, username, sizeof(username)))
   {
-    send_http_error(con, HTTP_UNAUTHORIZED, cupsdFindDest(job->dest));
+    send_http_error(con, con->username[0] ? HTTP_FORBIDDEN : HTTP_UNAUTHORIZED,
+                   cupsdFindDest(job->dest));
     return;
   }
 
@@ -8385,7 +8388,8 @@ move_job(cupsd_client_t  *con,            /* I - Client connection */
 
     if (!validate_user(job, con, job->username, username, sizeof(username)))
     {
-      send_http_error(con, HTTP_UNAUTHORIZED, cupsdFindDest(job->dest));
+      send_http_error(con, con->username[0] ? HTTP_FORBIDDEN : HTTP_UNAUTHORIZED,
+                      cupsdFindDest(job->dest));
       return;
     }
 
@@ -9199,7 +9203,8 @@ release_job(cupsd_client_t  *con, /* I - Client connection */
 
   if (!validate_user(job, con, job->username, username, sizeof(username)))
   {
-    send_http_error(con, HTTP_UNAUTHORIZED, cupsdFindDest(job->dest));
+    send_http_error(con, con->username[0] ? HTTP_FORBIDDEN : HTTP_UNAUTHORIZED,
+                    cupsdFindDest(job->dest));
     return;
   }
 
@@ -9442,7 +9447,8 @@ restart_job(cupsd_client_t  *con, /* I - Client connection */
 
   if (!validate_user(job, con, job->username, username, sizeof(username)))
   {
-    send_http_error(con, HTTP_UNAUTHORIZED, cupsdFindDest(job->dest));
+    send_http_error(con, con->username[0] ? HTTP_FORBIDDEN : HTTP_UNAUTHORIZED,
+                    cupsdFindDest(job->dest));
     return;
   }
 
@@ -9765,7 +9771,8 @@ send_document(cupsd_client_t  *con,       /* I - Client connection */
 
   if (!validate_user(job, con, job->username, username, sizeof(username)))
   {
-    send_http_error(con, HTTP_UNAUTHORIZED, cupsdFindDest(job->dest));
+    send_http_error(con, con->username[0] ? HTTP_FORBIDDEN : HTTP_UNAUTHORIZED,
+                    cupsdFindDest(job->dest));
     return;
   }
 
@@ -10353,7 +10360,8 @@ set_job_attrs(cupsd_client_t  *con,     /* I - Client connection */
 
   if (!validate_user(job, con, job->username, username, sizeof(username)))
   {
-    send_http_error(con, HTTP_UNAUTHORIZED, cupsdFindDest(job->dest));
+    send_http_error(con, con->username[0] ? HTTP_FORBIDDEN : HTTP_UNAUTHORIZED,
+                    cupsdFindDest(job->dest));
     return;
   }
 
diff --git a/tools/products.php b/tools/products.php
new file mode 100644 (file)
index 0000000..9c2e743
--- /dev/null
@@ -0,0 +1,50 @@
+#!/usr/bin/php -f
+<?php
+
+$fp     = popen("zgrep '^\\*Product:' /Library/Printers/PPDs/Contents/Resources/*.gz", "r");
+$files  = array();
+$maxlen = 0;
+
+while ($line = fgets($fp, 1024))
+{
+  $data = explode(":", $line);
+  if (array_key_exists($data[0], $files))
+    $files[$data[0]] ++;
+  else
+    $files[$data[0]] = 1;
+
+  $data = explode("\"", $line);
+  if (strlen($data[1]) > $maxlen)
+    $maxlen = strlen($data[1]);
+}
+
+pclose($fp);
+
+arsort($files);
+
+$current_count = 0;
+$current_files = 0;
+
+foreach ($files as $file => $count)
+{
+  if ($current_count == 0)
+    print(basename($file) . "  => $count products\n");
+
+  if ($count != $current_count)
+  {
+    if ($current_count != 0)
+      print("$current_files PPDs with $current_count products.\n");
+
+    $current_count = $count;
+    $current_files = 1;
+  }
+  else
+    $current_files ++;
+}
+
+if ($current_count != 0)
+  print("$current_files PPDs with $current_count products.\n");
+
+print("Maximum length of Product string: $maxlen\n");
+
+?>