]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Update man pages.
authorMichael R Sweet <michael.r.sweet@gmail.com>
Wed, 24 Apr 2019 22:35:00 +0000 (18:35 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Wed, 24 Apr 2019 22:35:00 +0000 (18:35 -0400)
Default manufacturer is now "Example".

Add support for DEBUG:, ERROR:, and INFO: messages from print commands.
Info and error messages get copied to the job-state-message attribute.

Add support for updating printer-alert-description attributes.

doc/help/man-client.conf.html
doc/help/man-cupsd.conf.html
doc/help/man-ippevepcl.html
doc/help/man-ippeveprinter.html
man/ippevepcl.man
man/ippeveprinter.man
test/ippeveprinter.c
test/ippeveps.c

index 879213735a68e7bae1ecdd06a1f40cbdc15c636f..4cf714c96b1326dea619c8313ecc0be4bcd7f6ac 100644 (file)
@@ -60,6 +60,22 @@ Not all operating systems support TLS 1.3 at this time.
 The default is "Yes".
 <dt><b>User </b><i>name</i>
 <dd style="margin-left: 5.0em">Specifies the default user name to use for requests.
+<dt><a name="UserAgentTokens"></a><b>UserAgentTokens None</b>
+<dd style="margin-left: 5.0em"><dt><b>UserAgentTokens ProductOnly</b>
+<dd style="margin-left: 5.0em"><dt><b>UserAgentTokens Major</b>
+<dd style="margin-left: 5.0em"><dt><b>UserAgentTokens Minor</b>
+<dd style="margin-left: 5.0em"><dt><b>UserAgentTokens Minimal</b>
+<dd style="margin-left: 5.0em"><dt><b>UserAgentTokens OS</b>
+<dd style="margin-left: 5.0em"><dt><b>UserAgentTokens Full</b>
+<dd style="margin-left: 5.0em">Specifies what information is included in the User-Agent header of HTTP requests.
+"None" disables the User-Agent header.
+"ProductOnly" reports "CUPS".
+"Major" reports "CUPS/major IPP/2".
+"Minor" reports "CUPS/major.minor IPP/2.1".
+"Minimal" reports "CUPS/major.minor.patch IPP/2.1".
+"OS" reports "CUPS/major.minor.path (osname osversion) IPP/2.1".
+"Full" reports "CUPS/major.minor.path (osname osversion; architecture) IPP/2.1".
+The default is "Minimal".
 <dt><b>ValidateCerts Yes</b>
 <dd style="margin-left: 5.0em"><dt><b>ValidateCerts No</b>
 <dd style="margin-left: 5.0em">Specifies whether to only allow TLS with certificates whose common name matches the hostname.
index b1b0ac0b5dbe1aaac592e11aecaf4a20641b3b11..a34be393f972029f03093191aa7af76e9e77aef2 100644 (file)
@@ -267,13 +267,11 @@ command.
 <dd style="margin-left: 5.0em">Specifies what information is included in the Server header of HTTP responses.
 "None" disables the Server header.
 "ProductOnly" reports "CUPS".
-"Major" reports "CUPS 2".
-"Minor" reports "CUPS 2.0".
-"Minimal" reports "CUPS 2.0.0".
-"OS" reports "CUPS 2.0.0 (UNAME)" where UNAME is the output of the
-<b>uname</b>(1)
-command.
-"Full" reports "CUPS 2.0.0 (UNAME) IPP/2.0".
+"Major" reports "CUPS/major IPP/2".
+"Minor" reports "CUPS/major.minor IPP/2.1".
+"Minimal" reports "CUPS/major.minor.patch IPP/2.1".
+"OS" reports "CUPS/major.minor.path (osname osversion) IPP/2.1".
+"Full" reports "CUPS/major.minor.path (osname osversion; architecture) IPP/2.1".
 The default is "Minimal".
 <dt><a name="SSLListen"></a><b>SSLListen </b><i>ipv4-address</i><b>:</b><i>port</i>
 <dd style="margin-left: 5.0em"><dt><b>SSLListen [</b><i>ipv6-address</i><b>]:</b><i>port</i>
index 929657ec42481efc6b88c03f29f4a0b689e617a7..b07b9be4dfc37dd95b303b9035373fcde4f4941f 100644 (file)
@@ -27,12 +27,13 @@ are print commands for
 <a href="man-ippeveprinter.html?TOPIC=Man+Pages"><b>ippeveprinter</b>(1).</a>
 As with all print commands, these commands read either the filename specified on the command-line or from the standard input.
 Output is sent to the standard output.
+Status and progress messages are sent to the standard error.
 <p><b>ippevepcl</b>
-prints to B&amp;W HP PCL laser printers and some color inkjet printers and supports printing of PWG Raster (image/pwg-raster) and Apple Raster (image/urf) print files.
+prints to B&amp;W HP PCL laser printers and supports printing of HP PCL (application/vnd.hp-pcl), PWG Raster (image/pwg-raster), and Apple Raster (image/urf) print files.
 <p><b>ippeveps</b>
-print to Adobe PostScript printers and supports printing of PDF (application/pdf), JPEG (image/jpeg), PWG Raster (image/pwg-raster), and Apple Raster (image/urf) print files.
+print to Adobe PostScript printers and supports printing of PDF (application/pdf), PostScript (application/postscript), JPEG (image/jpeg), PWG Raster (image/pwg-raster), and Apple Raster (image/urf) print files.
 Printer-specific commands are read from a supplied PPD file.
-If no PPD file is specified, generic commands suitable for any Level 2 or Level 3 PostScript printer are used instead to specify copies, duplex printing, and media size.
+If no PPD file is specified, generic commands suitable for any Level 2 or Level 3 PostScript printer are used instead to specify duplex printing and media size.
 <h2 class="title"><a name="EXIT_STATUS">Exit Status</a></h2>
 These programs return 1 on error and 0 on success.
 <h2 class="title"><a name="ENVIRONMENT">Environment</a></h2>
index d653f254c1f82fde7fd9822623d046e649353dd0..b0af8e24581081d5e7f845e9267f97e17a6db88c 100644 (file)
@@ -20,10 +20,23 @@ ippeveprinter - an ipp everywhere printer application for cups
 ] [
 <b>-2</b>
 ] [
+<b>-D</b>
+<i>device-uri</i>
+] [
+<b>-K</b>
+<i>keypath</i>
+] [
 <b>-M</b>
 <i>manufacturer</i>
 ] [
 <b>-P</b>
+<i>filename.ppd</i>
+] [
+<b>-V</b>
+<i>ipp-version</i>
+] [
+<b>-a</b>
+<i>filename.conf</i>
 ] [
 <b>-c</b>
 <i>command</i>
@@ -34,8 +47,6 @@ ippeveprinter - an ipp everywhere printer application for cups
 <b>-f</b>
 <i>type/subtype[,...]</i>
 ] [
-<b>-h</b>
-] [
 <b>-i</b>
 <i>iconfile.png</i>
 ] [
@@ -54,7 +65,7 @@ ippeveprinter - an ipp everywhere printer application for cups
 <i>port</i>
 ] [
 <b>-r</b>
-<i>subtype</i>
+<i>subtype[,subtype]</i>
 ] [
 <b>-s</b>
 <i>speed[,color-speed]</i>
@@ -77,24 +88,45 @@ The following options are recognized by
 <dd style="margin-left: 5.0em">Show the CUPS version.
 <dt><b>-2</b>
 <dd style="margin-left: 5.0em">Report support for two-sided (duplex) printing.
+<dt><b>-D </b><i>device-uri</i>
+<dd style="margin-left: 5.0em">Set the device URI for print output.
+The URI can be a filename, directory, or a network socket URI of the form "socket://ADDRESS[:PORT]" (where the default port number is 9100).
+When specifying a directory,
+<b>ippeveprinter</b>
+will create an output file using the job ID and name.
 <dt><b>-M </b><i>manufacturer</i>
 <dd style="margin-left: 5.0em">Set the manufacturer of the printer.
-The default is "Test".
-<dt><b>-P</b>
-<dd style="margin-left: 5.0em">Report support for PIN printing.
+The default is "Example".
+<dt><b>-P </b><i>filename.ppd</i>
+<dd style="margin-left: 5.0em">Load printer attributes from the specified PPD file.
+This option is typically used in conjunction with the
+<b>ippeveps</b>(7)
+printer command ("-c ippeveps").
+<dt><b>-V 1.1</b>
+<dd style="margin-left: 5.0em"><dt><b>-V 2.0</b>
+<dd style="margin-left: 5.0em">Specifies the maximum IPP version to report.
+2.0 is the default.
 <dt><b>-c </b><i>command</i>
 <dd style="margin-left: 5.0em">Run the specified command for each document that is printed.
+If "command" is not an absolute path ("/path/to/command"),
+<b>ippeveprinter</b>
+looks for the command in the "ippeveprinter" subdirectory of the CUPS binary directory, typically /usr/lib/cups/ippeveprinter or /usr/libexec/cups/ippeveprinter.
+The
+<a href="man-cups-config.html?TOPIC=Man+Pages"><b>cups-config</b>(1)</a>
+command can be used to discover the correct binary directory ("cups-config --serverbin").
+In addition, the CUPS_SERVERBIN environment variable can be used to override the default location of this directory - see the
+<a href="man-cups.html?TOPIC=Man+Pages"><b>cups</b>(1)</a>
+man page for more details.
 <dt><b>-d </b><i>spool-directory</i>
 <dd style="margin-left: 5.0em">Specifies the directory that will hold the print files.
 The default is a directory under the user's current temporary directory.
 <dt><b>-f </b><i>type/subtype[,...]</i>
 <dd style="margin-left: 5.0em">Specifies a list of MIME media types that the server will accept.
-The default is "application/pdf,image/jpeg,image/pwg-raster".
-<dt><b>-h</b>
-<dd style="margin-left: 5.0em">Shows program help.
+The default depends on the type of printer created.
 <dt><b>-i </b><i>iconfile.png</i>
 <dd style="margin-left: 5.0em">Specifies the printer icon file for the server.
-The default is "printer.png".
+The file must be a PNG format image.
+The default is an internally-provided PNG image.
 <dt><b>-k</b>
 <dd style="margin-left: 5.0em">Keeps the print documents in the spool directory rather than deleting them.
 <dt><b>-l </b><i>location</i>
@@ -111,8 +143,8 @@ command.
 <dt><b>-p </b><i>port</i>
 <dd style="margin-left: 5.0em">Specifies the port number to listen on.
 The default is a user-specific number from 8000 to 8999.
-<dt><b>-r </b><i>subtype</i>
-<dd style="margin-left: 5.0em">Specifies the Bonjour subtype(s) to advertise.
+<dt><b>-r </b><i>subtype[,subtype]</i>
+<dd style="margin-left: 5.0em">Specifies the DNS-SD subtype(s) to advertise.
 Separate multiple subtypes with a comma.
 The default is "_print".
 <dt><b>-s </b><i>speed[,color-speed]</i>
@@ -120,7 +152,7 @@ The default is "_print".
 If two numbers are specified and the second number is greater than zero, the server will report support for color printing.
 The default is "10,0".
 <dt><b>-v[vvv]</b>
-<dd style="margin-left: 5.0em">Be (very) verbose when logging activity to the standard output.
+<dd style="margin-left: 5.0em">Be (very) verbose when logging activity to standard error.
 </dl>
 <h2 class="title"><a name="EXIT_STATUS">Exit Status</a></h2>
 The
@@ -137,8 +169,34 @@ program is unique to CUPS and conforms to the IPP Everywhere (PWG 5100.14) speci
 <b>ippeveprinter</b>
 adds environment variables starting with "IPP_" for all IPP Job attributes in the print request.
 For example, when executing a command for an IPP Job containing the "media" Job Template attribute, the "IPP_MEDIA" environment variable will be set to the value of that attribute.
+<p>In addition, all IPP "xxx-default" Printer Description attributes are added to the environment.
+For example, the "IPP_MEDIA_DEFAULT" environment variable will be set to the default value for the "media" Job Template attribute.
 <p>Enumerated values are converted to their keyword equivalents.
 For example, a "print-quality" Job Template attribute with a enum value of 3 will become the "IPP_PRINT_QUALITY" environment variable with a value of "draft".
+This string conversion only happens for standard Job Template attributes, currently "finishings", "orientation-requested", and "print-quality".
+<p>Finally, the "CONTENT_TYPE" environment variable contains the MIME media type of the document being printed, the "DEVICE_URI" environment variable contains the device URI as specified with the "-D" option, and the "PPD" environment variable contains the PPD filename as specified with the "-P" option.
+<h2 class="title"><a name="COMMAND_OUTPUT">Command Output</a></h2>
+Unless they communicate directly with a printer, print commands send printer-ready data to the standard output.
+<p>Print commands can send messages back to
+<b>ippeveprinter</b>
+on the standard error with one of the following prefixes:
+<dl class="man">
+<dt><b>ATTR: </b><i>attribute=value[ attribute=value]</i>
+<dd style="margin-left: 5.0em">Sets the named attribute(s) to the given values.
+Currently only the "job-impressions" and "job-impressions-completed" Job Status attributes and the "marker-xxx", "printer-alert", "printer-alert-description", "printer-supply", and "printer-supply-description" Printer Status attributes can be set.
+<dt><b>DEBUG: </b><i>Debugging message</i>
+<dd style="margin-left: 5.0em">Logs a debugging message if at least two -v's have been specified.
+<dt><b>ERROR: </b><i>Error message</i>
+<dd style="margin-left: 5.0em">Logs an error message and copies the message to the "job-state-message" attribute.
+<dt><b>INFO: </b><i>Informational message</i>
+<dd style="margin-left: 5.0em">Logs an informational/progress message if -v has been specified and copies the message to the "job-state-message" attribute unless an error has been reported.
+<dt><b>STATE: </b><i>keyword[,keyword,...]</i>
+<dd style="margin-left: 5.0em">Sets the printer's "printer-state-reasons" attribute to the listed keywords.
+<dt><b>STATE: -</b><i>keyword[,keyword,...]</i>
+<dd style="margin-left: 5.0em">Removes the listed keywords from the printer's "printer-state-reasons" attribute.
+<dt><b>STATE: +</b><i>keyword[,keyword,...]</i>
+<dd style="margin-left: 5.0em">Adds the listed keywords to the printer's "printer-state-reasons" attribute.
+</dl>
 <h2 class="title"><a name="EXAMPLES">Examples</a></h2>
 Run
 <b>ippeveprinter</b>
@@ -152,7 +210,7 @@ with a service name of My Cool Printer:
 command whenever a job is sent to the server:
 <pre class="man">
 
-    ippeveprinter -c file "My Cool Printer"
+    ippeveprinter -c /usr/bin/file "My Cool Printer"
 </pre>
 <h2 class="title"><a name="SEE_ALSO">See Also</a></h2>
 PWG Internet Printing Protocol Workgroup (<a href="http://www.pwg.org/ipp">http://www.pwg.org/ipp</a>)
index 02a9e33d43ce230e8587c40d39d5ab6eba01423e..738e87cd9a83411dbefd963e52f2cb53d5428696 100644 (file)
@@ -1,12 +1,12 @@
 .\"
-.\" ippeveprinter man page for CUPS.
+.\" ippevepcl/ps man page for CUPS.
 .\"
 .\" Copyright © 2019 by Apple Inc.
 .\"
 .\" Licensed under Apache License v2.0.  See the file "LICENSE" for more
 .\" information.
 .\"
-.TH ippevepcl/ps 7 "CUPS" "22 March 2019" "Apple Inc."
+.TH ippevepcl/ps 7 "CUPS" "24 April 2019" "Apple Inc."
 .SH NAME
 ippevepcl/ps \- pcl and postscript print commands for ippeveprinter
 .SH SYNOPSIS
@@ -27,14 +27,15 @@ are print commands for
 .BR ippeveprinter (1).
 As with all print commands, these commands read either the filename specified on the command-line or from the standard input.
 Output is sent to the standard output.
+Status and progress messages are sent to the standard error.
 .PP
 .B ippevepcl
-prints to B&W HP PCL laser printers and some color inkjet printers and supports printing of PWG Raster (image/pwg-raster) and Apple Raster (image/urf) print files.
+prints to B&W HP PCL laser printers and supports printing of HP PCL (application/vnd.hp-pcl), PWG Raster (image/pwg-raster), and Apple Raster (image/urf) print files.
 .PP
 .B ippeveps
-print to Adobe PostScript printers and supports printing of PDF (application/pdf), JPEG (image/jpeg), PWG Raster (image/pwg-raster), and Apple Raster (image/urf) print files.
+print to Adobe PostScript printers and supports printing of PDF (application/pdf), PostScript (application/postscript), JPEG (image/jpeg), PWG Raster (image/pwg-raster), and Apple Raster (image/urf) print files.
 Printer-specific commands are read from a supplied PPD file.
-If no PPD file is specified, generic commands suitable for any Level 2 or Level 3 PostScript printer are used instead to specify copies, duplex printing, and media size.
+If no PPD file is specified, generic commands suitable for any Level 2 or Level 3 PostScript printer are used instead to specify duplex printing and media size.
 .SH EXIT STATUS
 These programs return 1 on error and 0 on success.
 .SH ENVIRONMENT
index 796f78ac6de5bd41b26dd2dffff59105456a5f11..0fb4c2416e964e7498dbca6c8bf6ac9c6b6c8cf8 100644 (file)
@@ -6,7 +6,7 @@
 .\" Licensed under Apache License v2.0.  See the file "LICENSE" for more
 .\" information.
 .\"
-.TH ippeveprinter 1 "CUPS" "19 April 2019" "Apple Inc."
+.TH ippeveprinter 1 "CUPS" "24 April 2019" "Apple Inc."
 .SH NAME
 ippeveprinter \- an ipp everywhere printer application for cups
 .SH SYNOPSIS
@@ -20,10 +20,23 @@ ippeveprinter \- an ipp everywhere printer application for cups
 ] [
 .B \-2
 ] [
+.B \-D
+.I device-uri
+] [
+.B \-K
+.I keypath
+] [
 .B \-M
 .I manufacturer
 ] [
 .B \-P
+.I filename.ppd
+] [
+.B \-V
+.I ipp-version
+] [
+.B \-a
+.I filename.conf
 ] [
 .B \-c
 .I command
@@ -34,8 +47,6 @@ ippeveprinter \- an ipp everywhere printer application for cups
 .B \-f
 .I type/subtype[,...]
 ] [
-.B \-h
-] [
 .B \-i
 .I iconfile.png
 ] [
@@ -54,7 +65,7 @@ ippeveprinter \- an ipp everywhere printer application for cups
 .I port
 ] [
 .B \-r
-.I subtype
+.I subtype[,subtype]
 ] [
 .B \-s
 .I speed[,color-speed]
@@ -81,15 +92,40 @@ Show the CUPS version.
 .B \-2
 Report support for two-sided (duplex) printing.
 .TP 5
+\fB\-D \fIdevice-uri\fR
+Set the device URI for print output.
+The URI can be a filename, directory, or a network socket URI of the form "socket://ADDRESS[:PORT]" (where the default port number is 9100).
+When specifying a directory,
+.B ippeveprinter
+will create an output file using the job ID and name.
+.TP 5
 \fB\-M \fImanufacturer\fR
 Set the manufacturer of the printer.
-The default is "Test".
+The default is "Example".
 .TP 5
-.B \-P
-Report support for PIN printing.
+\fB\-P \fIfilename.ppd\fR
+Load printer attributes from the specified PPD file.
+This option is typically used in conjunction with the
+.BR ippeveps (7)
+printer command ("\-c ippeveps").
+.TP 5
+\fB\-V 1.1\fR
+.TP 5
+\fB\-V 2.0\fR
+Specifies the maximum IPP version to report.
+2.0 is the default.
 .TP 5
 \fB\-c \fIcommand\fR
 Run the specified command for each document that is printed.
+If "command" is not an absolute path ("/path/to/command"),
+.B ippeveprinter
+looks for the command in the "ippeveprinter" subdirectory of the CUPS binary directory, typically /usr/lib/cups/ippeveprinter or /usr/libexec/cups/ippeveprinter.
+The
+.BR cups-config (1)
+command can be used to discover the correct binary directory ("cups-config --serverbin").
+In addition, the CUPS_SERVERBIN environment variable can be used to override the default location of this directory - see the
+.BR cups (1)
+man page for more details.
 .TP 5
 \fB\-d \fIspool-directory\fR
 Specifies the directory that will hold the print files.
@@ -97,14 +133,12 @@ The default is a directory under the user's current temporary directory.
 .TP 5
 \fB\-f \fItype/subtype[,...]\fR
 Specifies a list of MIME media types that the server will accept.
-The default is "application/pdf,image/jpeg,image/pwg-raster".
-.TP 5
-.B \-h
-Shows program help.
+The default depends on the type of printer created.
 .TP 5
 \fB\-i \fIiconfile.png\fR
 Specifies the printer icon file for the server.
-The default is "printer.png".
+The file must be a PNG format image.
+The default is an internally-provided PNG image.
 .TP 5
 .B \-k
 Keeps the print documents in the spool directory rather than deleting them.
@@ -127,8 +161,8 @@ command.
 Specifies the port number to listen on.
 The default is a user-specific number from 8000 to 8999.
 .TP 5
-\fB\-r \fIsubtype\fR
-Specifies the Bonjour subtype(s) to advertise.
+\fB\-r \fIsubtype[,subtype]\fR
+Specifies the DNS-SD subtype(s) to advertise.
 Separate multiple subtypes with a comma.
 The default is "_print".
 .TP 5
@@ -138,7 +172,7 @@ If two numbers are specified and the second number is greater than zero, the ser
 The default is "10,0".
 .TP 5
 .B \-v[vvv]
-Be (very) verbose when logging activity to the standard output.
+Be (very) verbose when logging activity to standard error.
 .SH EXIT STATUS
 The
 .B ippeveprinter
@@ -155,8 +189,42 @@ program is unique to CUPS and conforms to the IPP Everywhere (PWG 5100.14) speci
 adds environment variables starting with "IPP_" for all IPP Job attributes in the print request.
 For example, when executing a command for an IPP Job containing the "media" Job Template attribute, the "IPP_MEDIA" environment variable will be set to the value of that attribute.
 .LP
+In addition, all IPP "xxx-default" Printer Description attributes are added to the environment.
+For example, the "IPP_MEDIA_DEFAULT" environment variable will be set to the default value for the "media" Job Template attribute.
+.LP
 Enumerated values are converted to their keyword equivalents.
 For example, a "print-quality" Job Template attribute with a enum value of 3 will become the "IPP_PRINT_QUALITY" environment variable with a value of "draft".
+This string conversion only happens for standard Job Template attributes, currently "finishings", "orientation-requested", and "print-quality".
+.LP
+Finally, the "CONTENT_TYPE" environment variable contains the MIME media type of the document being printed, the "DEVICE_URI" environment variable contains the device URI as specified with the "\-D" option, and the "PPD" environment variable contains the PPD filename as specified with the "\-P" option.
+.SH COMMAND OUTPUT
+Unless they communicate directly with a printer, print commands send printer-ready data to the standard output.
+.LP
+Print commands can send messages back to
+.B ippeveprinter
+on the standard error with one of the following prefixes:
+.TP 5
+\fBATTR: \fIattribute=value[ attribute=value]\fR
+Sets the named attribute(s) to the given values.
+Currently only the "job-impressions" and "job-impressions-completed" Job Status attributes and the "marker-xxx", "printer-alert", "printer-alert-description", "printer-supply", and "printer-supply-description" Printer Status attributes can be set.
+.TP 5
+\fBDEBUG: \fIDebugging message\fR
+Logs a debugging message if at least two \-v's have been specified.
+.TP 5
+\fBERROR: \fIError message\fR
+Logs an error message and copies the message to the "job-state-message" attribute.
+.TP 5
+\fBINFO: \fIInformational message\fR
+Logs an informational/progress message if \-v has been specified and copies the message to the "job-state-message" attribute unless an error has been reported.
+.TP 5
+\fBSTATE: \fIkeyword[,keyword,...]\fR
+Sets the printer's "printer-state-reasons" attribute to the listed keywords.
+.TP 5
+\fBSTATE: -\fIkeyword[,keyword,...]\fR
+Removes the listed keywords from the printer's "printer-state-reasons" attribute.
+.TP 5
+\fBSTATE: +\fIkeyword[,keyword,...]\fR
+Adds the listed keywords to the printer's "printer-state-reasons" attribute.
 .SH EXAMPLES
 Run
 .B ippeveprinter
@@ -171,7 +239,7 @@ Run the
 command whenever a job is sent to the server:
 .nf
 
-    ippeveprinter \-c file "My Cool Printer"
+    ippeveprinter \-c /usr/bin/file "My Cool Printer"
 .fi
 .SH SEE ALSO
 PWG Internet Printing Protocol Workgroup (http://www.pwg.org/ipp)
index 5e817df2bb6f0545d1db014286029438f8010c09..0f94b4e19ff9e1e9973bf8d5c9ca27d8ae765250 100644 (file)
@@ -197,6 +197,8 @@ struct ippeve_job_s                 /**** Job data ****/
                        *username,      /* job-originating-user-name */
                        *format;        /* document-format */
   ipp_jstate_t         state;          /* job-state value */
+  char                 *message;       /* job-state-message value */
+  int                  msglevel;       /* job-state-message log level (0=error, 1=info) */
   time_t               created,        /* time-at-creation value */
                        processing,     /* time-at-processing value */
                        completed;      /* time-at-completed value */
@@ -332,7 +334,7 @@ main(int  argc,                             /* I - Number of command-line args */
                *keypath = NULL,        /* Keychain path */
 #endif /* HAVE_SSL */
                *location = "",         /* Location of printer */
-               *make = "Test",         /* Manufacturer */
+               *make = "Example",      /* Manufacturer */
                *model = "Printer",     /* Model */
                *name = NULL,           /* Printer name */
 #if !CUPS_LITE
@@ -781,43 +783,50 @@ copy_job_attributes(
 
   if (!ra || cupsArrayFind(ra, "job-state-message"))
   {
-    switch (job->state)
+    if (job->message)
     {
-      case IPP_JSTATE_PENDING :
-         ippAddString(client->response, IPP_TAG_JOB, IPP_CONST_TAG(IPP_TAG_TEXT), "job-state-message", NULL, "Job pending.");
-         break;
+      ippAddString(client->response, IPP_TAG_JOB, IPP_TAG_TEXT, "job-state-message", NULL, job->message);
+    }
+    else
+    {
+      switch (job->state)
+      {
+       case IPP_JSTATE_PENDING :
+           ippAddString(client->response, IPP_TAG_JOB, IPP_CONST_TAG(IPP_TAG_TEXT), "job-state-message", NULL, "Job pending.");
+           break;
 
-      case IPP_JSTATE_HELD :
-          if (job->fd >= 0)
-           ippAddString(client->response, IPP_TAG_JOB, IPP_CONST_TAG(IPP_TAG_TEXT), "job-state-message", NULL, "Job incoming.");
-         else if (ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_ZERO))
-           ippAddString(client->response, IPP_TAG_JOB, IPP_CONST_TAG(IPP_TAG_TEXT), "job-state-message", NULL, "Job held.");
-          else
-           ippAddString(client->response, IPP_TAG_JOB, IPP_CONST_TAG(IPP_TAG_TEXT), "job-state-message", NULL, "Job created.");
-         break;
+       case IPP_JSTATE_HELD :
+           if (job->fd >= 0)
+             ippAddString(client->response, IPP_TAG_JOB, IPP_CONST_TAG(IPP_TAG_TEXT), "job-state-message", NULL, "Job incoming.");
+           else if (ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_ZERO))
+             ippAddString(client->response, IPP_TAG_JOB, IPP_CONST_TAG(IPP_TAG_TEXT), "job-state-message", NULL, "Job held.");
+           else
+             ippAddString(client->response, IPP_TAG_JOB, IPP_CONST_TAG(IPP_TAG_TEXT), "job-state-message", NULL, "Job created.");
+           break;
 
-      case IPP_JSTATE_PROCESSING :
-         if (job->cancel)
-           ippAddString(client->response, IPP_TAG_JOB, IPP_CONST_TAG(IPP_TAG_TEXT), "job-state-message", NULL, "Job canceling.");
-         else
-           ippAddString(client->response, IPP_TAG_JOB, IPP_CONST_TAG(IPP_TAG_TEXT), "job-state-message", NULL, "Job printing.");
-         break;
+       case IPP_JSTATE_PROCESSING :
+           if (job->cancel)
+             ippAddString(client->response, IPP_TAG_JOB, IPP_CONST_TAG(IPP_TAG_TEXT), "job-state-message", NULL, "Job canceling.");
+           else
+             ippAddString(client->response, IPP_TAG_JOB, IPP_CONST_TAG(IPP_TAG_TEXT), "job-state-message", NULL, "Job printing.");
+           break;
 
-      case IPP_JSTATE_STOPPED :
-         ippAddString(client->response, IPP_TAG_JOB, IPP_CONST_TAG(IPP_TAG_TEXT), "job-state-message", NULL, "Job stopped.");
-         break;
+       case IPP_JSTATE_STOPPED :
+           ippAddString(client->response, IPP_TAG_JOB, IPP_CONST_TAG(IPP_TAG_TEXT), "job-state-message", NULL, "Job stopped.");
+           break;
 
-      case IPP_JSTATE_CANCELED :
-         ippAddString(client->response, IPP_TAG_JOB, IPP_CONST_TAG(IPP_TAG_TEXT), "job-state-message", NULL, "Job canceled.");
-         break;
+       case IPP_JSTATE_CANCELED :
+           ippAddString(client->response, IPP_TAG_JOB, IPP_CONST_TAG(IPP_TAG_TEXT), "job-state-message", NULL, "Job canceled.");
+           break;
 
-      case IPP_JSTATE_ABORTED :
-         ippAddString(client->response, IPP_TAG_JOB, IPP_CONST_TAG(IPP_TAG_TEXT), "job-state-message", NULL, "Job aborted.");
-         break;
+       case IPP_JSTATE_ABORTED :
+           ippAddString(client->response, IPP_TAG_JOB, IPP_CONST_TAG(IPP_TAG_TEXT), "job-state-message", NULL, "Job aborted.");
+           break;
 
-      case IPP_JSTATE_COMPLETED :
-         ippAddString(client->response, IPP_TAG_JOB, IPP_CONST_TAG(IPP_TAG_TEXT), "job-state-message", NULL, "Job completed.");
-         break;
+       case IPP_JSTATE_COMPLETED :
+           ippAddString(client->response, IPP_TAG_JOB, IPP_CONST_TAG(IPP_TAG_TEXT), "job-state-message", NULL, "Job completed.");
+           break;
+      }
     }
   }
 
@@ -1820,10 +1829,13 @@ static void
 delete_job(ippeve_job_t *job)          /* I - Job */
 {
   if (Verbosity)
-    fprintf(stderr, "Removing job #%d from history.\n", job->id);
+    fprintf(stderr, "[Job %d] Removing job from history.\n", job->id);
 
   ippDelete(job->attrs);
 
+  if (job->message)
+    free(job->message);
+
   if (job->filename)
   {
     if (!KeepFiles)
@@ -5224,7 +5236,7 @@ process_attr_message(
 
       job->impcompleted = atoi(option->value);
     }
-    else if (!strncmp(option->name, "marker-", 7) || !strcmp(option->name, "printer-alert") || !strcmp(option->name, "printer-supply") || !strcmp(option->name, "printer-supply-description"))
+    else if (!strncmp(option->name, "marker-", 7) || !strcmp(option->name, "printer-alert") || !strcmp(option->name, "printer-alert-description") || !strcmp(option->name, "printer-supply") || !strcmp(option->name, "printer-supply-description"))
     {
      /*
       * Update Printer Status attribute...
@@ -6195,27 +6207,60 @@ process_job(ippeve_job_t *job)          /* I - Job */
 
           while ((ptr = strchr(line, '\n')) != NULL)
          {
+           int level = 3;              /* Message log level */
+
            *ptr++ = '\0';
 
-           if (Verbosity > 1)
-             fprintf(stderr, "[Job %d] Command - %s\n", job->id, line);
+           if (!strncmp(line, "ATTR:", 5))
+           {
+            /*
+             * Process job/printer attribute updates.
+             */
 
-           if (!strncmp(line, "STATE:", 6))
+             process_attr_message(job, line);
+           }
+           else if (!strncmp(line, "DEBUG:", 6))
            {
             /*
-             * Process printer-state-reasons keywords.
+             * Debug message...
              */
 
-             process_state_message(job, line);
+              level = 2;
            }
-           else if (!strncmp(line, "ATTR:", 5))
+           else if (!strncmp(line, "ERROR:", 6))
            {
             /*
-             * Process job/printer attribute updates.
+             * Error message...
              */
 
-             process_attr_message(job, line);
+              level         = 0;
+              job->message  = strdup(line + 6);
+              job->msglevel = 0;
            }
+           else if (!strncmp(line, "INFO:", 5))
+           {
+            /*
+             * Informational/progress message...
+             */
+
+              level = 1;
+              if (job->msglevel)
+              {
+                job->message  = strdup(line + 5);
+                job->msglevel = 1;
+             }
+           }
+           else if (!strncmp(line, "STATE:", 6))
+           {
+            /*
+             * Process printer-state-reasons keywords.
+             */
+
+             process_state_message(job, line);
+           }
+
+           if (Verbosity >= level)
+             fprintf(stderr, "[Job %d] Command - %s\n", job->id, line);
 
            bytes = ptr - line;
             if (ptr < endptr)
@@ -7560,7 +7605,7 @@ usage(int status)                 /* O - Exit status */
   _cupsLangPuts(stdout, _("-m model                Set model name (default=Printer)"));
   _cupsLangPuts(stdout, _("-n hostname             Set hostname for printer"));
   _cupsLangPuts(stdout, _("-p port                 Set port number for printer"));
-  _cupsLangPuts(stdout, _("-r subtype              Set DNS-SD service subtype"));
+  _cupsLangPuts(stdout, _("-r subtype,[subtype]    Set DNS-SD service subtype"));
   _cupsLangPuts(stdout, _("-s speed[,color-speed]  Set speed in pages per minute"));
   _cupsLangPuts(stderr, _("-v                      Be verbose"));
 
index 6a48aacdb214e73927854763f040d8dc1bbac1fc..2bfc14eb447df68e80be5185a8eb577771947ebd 100644 (file)
@@ -420,6 +420,7 @@ get_options(cups_option_t **options)        /* O - Options */
   {
     ppd_cache = _ppdCacheCreateWithPPD(ppd);
 
+    /* TODO: Fix me - values are names, not numbers... Also need to support finishings-col */
     if ((value = getenv("IPP_FINISHINGS")) == NULL)
       value = getenv("IPP_FINISHINGS_DEFAULT");
 
@@ -482,10 +483,12 @@ get_options(cups_option_t **options)      /* O - Options */
       int              num_presets;    /* Number of presets */
       cups_option_t    *presets;       /* Presets */
 
-      if ((pq = atoi(value) - 3) < 0)
-       pq = 0;
-      else if (pq > 2)
-       pq = 2;
+      if (!strcmp(value, "draft"))
+        pq = 0;
+      else if (!strcmp(value, "high"))
+        pq = 2;
+      else
+        pq = 1;
 
       if ((value = getenv("IPP_PRINT_COLOR_MODE")) == NULL)
        value = getenv("IPP_PRINT_COLOR_MODE_DEFAULT");