]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
<rdar://problem/13875803> cups.org: ipptool does not proceed past INCLUDE if ignore...
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Mon, 13 May 2013 19:15:06 +0000 (19:15 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Mon, 13 May 2013 19:15:06 +0000 (19:15 +0000)
Also: IPP finishings values for (now standardized) punch and fold stuff, new
IPP FaxOut Send-Hardcopy-Document operation.

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@10980 a1ca3aef-8c08-0410-bb20-df032aa958be

CHANGES.txt
cups/ipp-support.c
cups/ipp.h
doc/help/man-ipptool.html
doc/help/man-ipptoolfile.html
man/ipptool.man
man/ipptoolfile.man
test/ipptool.c

index 757e4bb9f4ee782e2f98bc90473ee71bdf8f8371..d05d8c820ef489a075c96ce254e0aebfb0eac454 100644 (file)
@@ -1,6 +1,12 @@
-CHANGES.txt - 1.7b1 - 2013-04-18
+CHANGES.txt - 1.7b1 - 2013-05-13
 --------------------------------
 
+CHANGES IN CUPS V1.7b2
+
+       - The ipptool program did not continue past include file errors by
+         default (<rdar://problem/13875803>)
+
+
 CHANGES IN CUPS V1.7b1
 
        - The configure script now supports a --with-rundir option to change
index 6c7aadeda7ddec36cc7f57b76fa9793598430f08..d5c39f9400f7787fa33e5511b4ebc6ac3281428b 100644 (file)
@@ -204,7 +204,7 @@ static const char * const ipp_std_ops[] =
                  "Suspend-Current-Job",
                  "Resume-Job",
 
-                 /* 0x0030 - 0x003d */
+                 /* 0x0030 - 0x003e */
                  "Promote-Job",
                  "Schedule-Job-After",
                  "0x0032",
@@ -218,7 +218,8 @@ static const char * const ipp_std_ops[] =
                  "Resubmit-Job",
                  "Close-Job",
                  "Identify-Printer",
-                 "Validate-Document"
+                 "Validate-Document",
+                 "Send-Hardcopy-Document"
                },
                * const ipp_cups_ops[] =
                {
@@ -400,7 +401,44 @@ static const char * const ipp_document_states[] =
                  "trim-after-pages",
                  "trim-after-documents",
                  "trim-after-copies",
-                 "trim-after-job"
+                 "trim-after-job",
+                 "64",
+                 "65",
+                 "66",
+                 "67",
+                 "68",
+                 "69",
+                 "punch-top-left",
+                 "punch-bottom-left",
+                 "punch-top-right",
+                 "punch-bottom-right",
+                 "punch-dual-left",
+                 "punch-dual-top",
+                 "punch-dual-right",
+                 "punch-dual-bottom",
+                 "punch-triple-left",
+                 "punch-triple-top",
+                 "punch-triple-right",
+                 "punch-triple-bottom",
+                 "punch-quad-left",
+                 "punch-quad-top",
+                 "punch-quad-right",
+                 "punch-quad-bottom",
+                 "86",
+                 "87",
+                 "88",
+                 "89",
+                 "fold-accordian",
+                 "fold-double-gate",
+                 "fold-gate",
+                 "fold-half",
+                 "fold-half-z",
+                 "fold-left-gate",
+                 "fold-letter",
+                 "fold-parallel",
+                 "fold-poster",
+                 "fold-right-gate",
+                 "fold-z"
                },
                * const ipp_finishings_vendor[] =
                {
@@ -479,39 +517,39 @@ static const char * const ipp_document_states[] =
                  "0x40000043",
                  "0x40000044",
                  "0x40000045",
-                 "punch-top-left",
-                 "punch-bottom-left",
-                 "punch-top-right",
-                 "punch-bottom-right",
-                 "punch-dual-left",
-                 "punch-dual-top",
-                 "punch-dual-right",
-                 "punch-dual-bottom",
-                 "punch-triple-left",
-                 "punch-triple-top",
+                 "cups-punch-top-left",
+                 "cups-punch-bottom-left",
+                 "cups-punch-top-right",
+                 "cups-punch-bottom-right",
+                 "cups-punch-dual-left",
+                 "cups-punch-dual-top",
+                 "cups-punch-dual-right",
+                 "cups-punch-dual-bottom",
+                 "cups-punch-triple-left",
+                 "cups-punch-triple-top",
                  /* 0x40000050 - 0x4000005F */
-                 "punch-triple-right",
-                 "punch-triple-bottom",
-                 "punch-quad-left",
-                 "punch-quad-top",
-                 "punch-quad-right",
-                 "punch-quad-bottom",
+                 "cups-punch-triple-right",
+                 "cups-punch-triple-bottom",
+                 "cups-punch-quad-left",
+                 "cups-punch-quad-top",
+                 "cups-punch-quad-right",
+                 "cups-punch-quad-bottom",
                  "0x40000056",
                  "0x40000057",
                  "0x40000058",
                  "0x40000059",
-                 "fold-accordian",
-                 "fold-double-gate",
-                 "fold-gate",
-                 "fold-half",
-                 "fold-half-z",
-                 "fold-left-gate",
+                 "cups-fold-accordian",
+                 "cups-fold-double-gate",
+                 "cups-fold-gate",
+                 "cups-fold-half",
+                 "cups-fold-half-z",
+                 "cups-fold-left-gate",
                  /* 0x40000060 - 0x40000064 */
-                 "fold-letter",
-                 "fold-parallel",
-                 "fold-poster",
-                 "fold-right-gate",
-                 "fold-z"
+                 "cups-fold-letter",
+                 "cups-fold-parallel",
+                 "cups-fold-poster",
+                 "cups-fold-right-gate",
+                 "cups-fold-z"
                },
                * const ipp_job_collation_types[] =
                {                       /* job-collation-type enums */
index 5360ff1a7a7c8c63c7ae4f6f4392d6d3daa7f52e..7ae983d88e526354ebdc1ecebb87d0ac87e054f3 100644 (file)
@@ -123,8 +123,35 @@ typedef enum ipp_finishings_e              /**** Finishings ****/
   IPP_FINISHINGS_TRIM_AFTER_DOCUMENTS, /* Trim output after each document */
   IPP_FINISHINGS_TRIM_AFTER_COPIES,    /* Trim output after each copy */
   IPP_FINISHINGS_TRIM_AFTER_JOB,       /* Trim output after job */
-
-  /* Proposed extensions for finishings */
+  IPP_FINISHINGS_PUNCH_TOP_LEFT = 70,  /* Punch 1 hole top left */
+  IPP_FINISHINGS_PUNCH_BOTTOM_LEFT,    /* Punch 1 hole bottom left */
+  IPP_FINISHINGS_PUNCH_TOP_RIGHT,      /* Punch 1 hole top right */
+  IPP_FINISHINGS_PUNCH_BOTTOM_RIGHT,   /* Punch 1 hole bottom right */
+  IPP_FINISHINGS_PUNCH_DUAL_LEFT,      /* Punch 2 holes left side */
+  IPP_FINISHINGS_PUNCH_DUAL_TOP,       /* Punch 2 holes top edge */
+  IPP_FINISHINGS_PUNCH_DUAL_RIGHT,     /* Punch 2 holes right side */
+  IPP_FINISHINGS_PUNCH_DUAL_BOTTOM,    /* Punch 2 holes bottom edge */
+  IPP_FINISHINGS_PUNCH_TRIPLE_LEFT,    /* Punch 3 holes left side */
+  IPP_FINISHINGS_PUNCH_TRIPLE_TOP,     /* Punch 3 holes top edge */
+  IPP_FINISHINGS_PUNCH_TRIPLE_RIGHT,   /* Punch 3 holes right side */
+  IPP_FINISHINGS_PUNCH_TRIPLE_BOTTOM,  /* Punch 3 holes bottom edge */
+  IPP_FINISHINGS_PUNCH_QUAD_LEFT,      /* Punch 4 holes left side */
+  IPP_FINISHINGS_PUNCH_QUAD_TOP,       /* Punch 4 holes top edge */
+  IPP_FINISHINGS_PUNCH_QUAD_RIGHT,     /* Punch 4 holes right side */
+  IPP_FINISHINGS_PUNCH_QUAD_BOTTOM,    /* Punch 4 holes bottom edge */
+  IPP_FINISHINGS_FOLD_ACCORDIAN = 90,  /* Accordian-fold the paper vertically into four sections */
+  IPP_FINISHINGS_FOLD_DOUBLE_GATE,     /* Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically */
+  IPP_FINISHINGS_FOLD_GATE,            /* Fold the top and bottom quarters of the paper towards the midline */
+  IPP_FINISHINGS_FOLD_HALF,            /* Fold the paper in half vertically */
+  IPP_FINISHINGS_FOLD_HALF_Z,          /* Fold the paper in half horizontally, then Z-fold the paper vertically */
+  IPP_FINISHINGS_FOLD_LEFT_GATE,       /* Fold the top quarter of the paper towards the midline */
+  IPP_FINISHINGS_FOLD_LETTER,          /* Fold the paper into three sections vertically; sometimes also known as a C fold*/
+  IPP_FINISHINGS_FOLD_PARALLEL,                /* Fold the paper in half vertically two times, yielding four sections */
+  IPP_FINISHINGS_FOLD_POSTER,          /* Fold the paper in half horizontally and vertically; sometimes also called a cross fold */
+  IPP_FINISHINGS_FOLD_RIGHT_GATE,      /* Fold the bottom quarter of the paper towards the midline */
+  IPP_FINISHINGS_FOLD_Z,               /* Fold the paper vertically into three sections, forming a Z */
+
+  /* CUPS extensions for finishings (pre-standard versions of values above) */
   IPP_FINISHINGS_CUPS_PUNCH_TOP_LEFT = 0x40000046,
                                        /* Punch 1 hole top left */
   IPP_FINISHINGS_CUPS_PUNCH_BOTTOM_LEFT,/* Punch 1 hole bottom left */
@@ -262,8 +289,10 @@ typedef enum ipp_op_e                      /**** IPP operations ****/
   IPP_OP_CANCEL_MY_JOBS,               /* Cancel-My-Jobs */
   IPP_OP_RESUBMIT_JOB,                 /* Resubmit-Job */
   IPP_OP_CLOSE_JOB,                    /* Close-Job */
-  IPP_OP_IDENTIFY_PRINTER,             /* Identify-Printer (proposed IPP JPS3) */
-  IPP_OP_VALIDATE_DOCUMENT,            /* Validate-Document (proposed IPP JPS3) */
+  IPP_OP_IDENTIFY_PRINTER,             /* Identify-Printer @private@ */
+  IPP_OP_VALIDATE_DOCUMENT,            /* Validate-Document @private@ */
+  IPP_OP_SEND_HARDCOPY_DOCUMENT,       /* Send-Hardcopy-Document @private@ */
+
   IPP_OP_PRIVATE = 0x4000,             /* Reserved @private@ */
   IPP_OP_CUPS_GET_DEFAULT,             /* Get the default printer */
   IPP_OP_CUPS_GET_PRINTERS,            /* Get a list of printers and/or classes */
index 189613a9d4a267f4eb975e73316d9ed41fbbddb3..486080c6ac909dd427842257879e19c086919d44 100644 (file)
@@ -11,7 +11,8 @@
 ipptool - perform internet printing protocol requests
 <h2 class="title"><a name="SYNOPSIS">Synopsis</a></h2>
 <b>ipptool
-</b>[ -4 ] [ -6 ] [ -C ] [ -E ] [ -I ] [ -L ] [ -S ] [ -T
+</b>[ --help ] [ --stop-after-include-error ] [ --version ]
+[ -4 ] [ -6 ] [ -C ] [ -E ] [ -I ] [ -L ] [ -S ] [ -T
 <i>seconds
 </i>] [ -V
 <i>version
@@ -34,6 +35,14 @@ ipptool - perform internet printing protocol requests
 <h2 class="title"><a name="OPTIONS">Options</a></h2>
 The following options are recognized by <i>ipptool</i>:
 <dl>
+<dt>--help
+</dt>
+<dd>Shows program help.
+--stop-after-include-error
+Tells <i>ipptool</i> to stop if an error occurs in an included file. Normally <i>ipptool</i> will continue with subsequent tests after the INCLUDE directive.
+--version
+Shows the version of <i>ipptool</i> being used.
+</dd>
 <dt>-4
 </dt>
 <dd>Specifies that <i>ipptool</i> must connect to the printer or server using IPv4.
@@ -107,6 +116,8 @@ The following options are recognized by <i>ipptool</i>:
 <dd>Specifies that all request and response attributes should be output in CUPS test mode (<i>-t</i>). This is the default for XML output.
 </dd>
 </dl>
+<h2 class="title"><a name="EXIT_CODE">Exit Code</a></h2>
+The <i>ipptool</i> program returns 0 if all tests were sucessful and 1 otherwise.
 <h2 class="title"><a name="COMPATIBILITY">Compatibility</a></h2>
 The <i>ipptool</i> program is unique to CUPS.
 <h2 class="title"><a name="EXAMPLES">Examples</a></h2>
@@ -130,21 +141,28 @@ The following standard files are available:
     document-letter.ps
     get-completed-jobs.test
     get-jobs.test
+    get-notifications.test
     get-printer-attributes.test
+    get-subscriptions.test
     gray.jpg
     ipp-1.1.test
     ipp-2.0.test
     ipp-2.1.test
     ipp-2.2.test
+    ipp-everywhere.test
     onepage-a4.pdf
     onepage-a4.ps
     onepage-letter.pdf
     onepage-letter.ps
     print-job.test
+    print-job-deflate.test
+    print-job-gzip.test
     testfile.jpg
+    testfile.pcl
     testfile.pdf
     testfile.ps
     testfile.txt
+    validate-job.test
 </pre>
 <h2 class="title"><a name="SEE_ALSO">See Also</a></h2>
 <a href='man-ipptoolfile.html?TOPIC=Man+Pages'>ipptoolfile(5)</a>,
index 7011a973084b4bc37ec11dbd31ef552eed12186a..4441d9d7595ca4b27de84e0b4420a51b4e8713ab 100644 (file)
@@ -119,6 +119,13 @@ includes a file from the <i>ipptool</i> include directory.
 <dd>Specifies that the remainder of the test file should be skipped when the
 variable is or is not defined.
 </dd>
+<dt>STOP-AFTER-INCLUDE-ERROR no
+</dt>
+<dd></dd>
+<dt>STOP-AFTER-INCLUDE-ERROR yes
+</dt>
+<dd>Specifies whether tests will be stopped after an error in an included file.
+</dd>
 <dt>TRANSFER auto
 </dt>
 <dd>Specifies that tests will, by default, use "Transfer-Encoding: chunked" for
@@ -506,6 +513,7 @@ RFC 2911 and other IPP extension specifications. Here is a complete list:
     Resume-Printer
     Schedule-Job-After
     Send-Document
+    Send-Hardcopy-Document
     Send-Notifications
     Send-URI
     Set-Job-Attributes
index 16b12764b1038e1d210b281e8b13b7f0d181fd1f..75567c11b8ade0d0736a5a192687191f6f08a87a 100644 (file)
 .\"   which should have been included with this file.  If this file is
 .\"   file is missing or damaged, see the license at "http://www.cups.org/".
 .\"
-.TH ipptool 1 "CUPS" "9 November 2010" "Apple Inc."
+.TH ipptool 1 "CUPS" "13 May 2013" "Apple Inc."
 .SH NAME
 ipptool - perform internet printing protocol requests
 .SH SYNOPSIS
 .B ipptool
+[ --help ] [ --stop-after-include-error ] [ --version ]
 [ -4 ] [ -6 ] [ -C ] [ -E ] [ -I ] [ -L ] [ -S ] [ -T
 .I seconds
 ] [ -V
@@ -39,6 +40,13 @@ ipptool - perform internet printing protocol requests
 .SH OPTIONS
 The following options are recognized by \fIipptool\fR:
 .TP 5
+--help
+Shows program help.
+--stop-after-include-error
+Tells \fIipptool\fR to stop if an error occurs in an included file. Normally \fIipptool\fR will continue with subsequent tests after the INCLUDE directive.
+--version
+Shows the version of \fIipptool\fR being used.
+.TP 5
 -4
 Specifies that \fIipptool\fR must connect to the printer or server using IPv4.
 .TP 5
@@ -92,6 +100,8 @@ Specifies that CUPS test report output is desired instead of the plain text outp
 .TP 5
 -v
 Specifies that all request and response attributes should be output in CUPS test mode (\fI-t\fR). This is the default for XML output.
+.SH EXIT CODE
+The \fIipptool\fR program returns 0 if all tests were sucessful and 1 otherwise.
 .SH COMPATIBILITY
 The \fIipptool\fR program is unique to CUPS.
 .SH EXAMPLES
@@ -116,21 +126,28 @@ The following standard files are available:
     document-letter.ps
     get-completed-jobs.test
     get-jobs.test
+    get-notifications.test
     get-printer-attributes.test
+    get-subscriptions.test
     gray.jpg
     ipp-1.1.test
     ipp-2.0.test
     ipp-2.1.test
     ipp-2.2.test
+    ipp-everywhere.test
     onepage-a4.pdf
     onepage-a4.ps
     onepage-letter.pdf
     onepage-letter.ps
     print-job.test
+    print-job-deflate.test
+    print-job-gzip.test
     testfile.jpg
+    testfile.pcl
     testfile.pdf
     testfile.ps
     testfile.txt
+    validate-job.test
 .fi
 .SH SEE ALSO
 \fIipptoolfile(5)\fR,
index a4bba335e1595d1634b80dabbd05cf743f781cca..2049cbde0d6cc6c4481fba68c869c6346e7cb4f1 100644 (file)
@@ -11,7 +11,7 @@
 .\"   which should have been included with this file.  If this file is
 .\"   file is missing or damaged, see the license at "http://www.cups.org/".
 .\"
-.TH ipptoolfile 5 "CUPS" "10 January 2013" "Apple Inc."
+.TH ipptoolfile 5 "CUPS" "13 May 2013" "Apple Inc."
 .SH NAME
 ipptoolfile \- ipptool file format
 
@@ -111,6 +111,11 @@ SKIP-IF-NOT-DEFINED variable-name
 Specifies that the remainder of the test file should be skipped when the
 variable is or is not defined.
 .TP 5
+STOP-AFTER-INCLUDE-ERROR no
+.TP 5
+STOP-AFTER-INCLUDE-ERROR yes
+Specifies whether tests will be stopped after an error in an included file.
+.TP 5
 TRANSFER auto
 Specifies that tests will, by default, use "Transfer-Encoding: chunked" for
 requests with attached files and "Content-Length:" for requests without attached
@@ -415,6 +420,7 @@ RFC 2911 and other IPP extension specifications. Here is a complete list:
     Resume-Printer
     Schedule-Job-After
     Send-Document
+    Send-Hardcopy-Document
     Send-Notifications
     Send-URI
     Set-Job-Attributes
index 166336cd24768bb07af65c0646a054d6b0862baa..61fc8ed70edbff2d4dd08470a78a69ed264f5b9c 100644 (file)
@@ -156,6 +156,8 @@ _cups_output_t      Output = _CUPS_OUTPUT_LIST;
                                        /* Output mode */
 int            Cancel = 0,             /* Cancel test? */
                IgnoreErrors = 0,       /* Ignore errors? */
+               StopAfterIncludeError = 0,
+                                       /* Stop after include errors? */
                Verbosity = 0,          /* Show all attributes? */
                Version = 11,           /* Default IPP version */
                XMLHeader = 0,          /* 1 if header is written */
@@ -282,7 +284,20 @@ main(int  argc,                            /* I - Number of command-line args */
 
   for (i = 1; i < argc; i ++)
   {
-    if (argv[i][0] == '-')
+    if (!strcmp(argv[i], "--help"))
+    {
+      usage();
+    }
+    else if (!strcmp(argv[i], "--stop-after-include-error"))
+    {
+      StopAfterIncludeError = 1;
+    }
+    else if (!strcmp(argv[i], "--version"))
+    {
+      puts(CUPS_SVERSION);
+      return (0);
+    }
+    else if (argv[i][0] == '-')
     {
       for (opt = argv[i] + 1; *opt; opt ++)
       {
@@ -949,7 +964,7 @@ do_tests(_cups_vars_t *vars,                /* I - Variables */
        {
          pass = 0;
 
-         if (!IgnoreErrors)
+         if (StopAfterIncludeError)
            goto test_exit;
        }
       }
@@ -983,7 +998,7 @@ do_tests(_cups_vars_t *vars,                /* I - Variables */
        {
          pass = 0;
 
-         if (!IgnoreErrors)
+         if (StopAfterIncludeError)
            goto test_exit;
        }
       }
@@ -1018,7 +1033,7 @@ do_tests(_cups_vars_t *vars,              /* I - Variables */
        {
          pass = 0;
 
-         if (!IgnoreErrors)
+         if (StopAfterIncludeError)
            goto test_exit;
        }
       }
@@ -1071,6 +1086,28 @@ do_tests(_cups_vars_t *vars,             /* I - Variables */
        goto test_exit;
       }
     }
+    else if (!strcmp(token, "STOP-AFTER-INCLUDE-ERROR"))
+    {
+     /*
+      * STOP-AFTER-INCLUDE-ERROR yes
+      * STOP-AFTER-INCLUDE-ERROR no
+      */
+
+      if (get_token(fp, temp, sizeof(temp), &linenum) &&
+          (!_cups_strcasecmp(temp, "yes") || !_cups_strcasecmp(temp, "no")))
+      {
+        StopAfterIncludeError = !_cups_strcasecmp(temp, "yes");
+      }
+      else
+      {
+        print_fatal_error("Missing STOP-AFTER-INCLUDE-ERROR value on line %d.",
+                          linenum);
+       pass = 0;
+       goto test_exit;
+      }
+
+      continue;
+    }
     else if (!strcmp(token, "TRANSFER"))
     {
      /*