]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Add WITH-DISTINCT-VALUES support for collections.
authorMichael R Sweet <michael.r.sweet@gmail.com>
Wed, 21 Apr 2021 15:37:34 +0000 (11:37 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Wed, 21 Apr 2021 15:37:39 +0000 (11:37 -0400)
doc/help/man-cupsd.conf.html
doc/help/man-ipptoolfile.html
man/ipptoolfile.5
tools/ipptool.c

index 798ab63261b7bb097844f8640504966839d0777a..fc095a696ffda68a5d04646a7e889e5545732874 100644 (file)
@@ -142,9 +142,6 @@ The default is "5".
 <dd style="margin-left: 5.0em"><dt><b>KeepAlive No</b>
 <dd style="margin-left: 5.0em">Specifies whether to support HTTP keep-alive connections.
 The default is "Yes".
-<dt><a name="KeepAliveTimeout"></a><b>KeepAliveTimeout </b><i>seconds</i>
-<dd style="margin-left: 5.0em">Specifies how long an idle client connection remains open.
-The default is "30".
 <dt><a name="LimitIPP"></a><b>&lt;Limit </b><i>operation </i>...<b>> </b>... <b>&lt;/Limit></b>
 <dd style="margin-left: 5.0em">Specifies the IPP operations that are being limited inside a Policy section. IPP operation names are listed below in the section "IPP OPERATION NAMES".
 <dt><a name="Limit"></a><b>&lt;Limit </b><i>method </i>...<b>> </b>... <b>&lt;/Limit></b>
index 36171127f66a611c9d6ebf06f7c0d4960b446081..89d146520d99e49f1a1b23e56fb7958ce76a1f9f 100644 (file)
@@ -272,7 +272,7 @@ Comparisons are case-sensitive.
 <dt><b>WITH-DISTINCT-VALUES</b>
 <dd style="margin-left: 5.0em">Requires that all values of the <b>EXPECT</b> attribute are unique.
 Comparisons are case-sensitive.
-Only charset, enum, integer, keyword, mimeMediaType, naturalLanguage, rangeOfInteger, resolution, uriScheme attributes support this predicate.
+Only charset, collection, enum, integer, keyword, mimeMediaType, naturalLanguage, rangeOfInteger, resolution, uriScheme attributes support this predicate.
 <dt><b>WITH-HOSTNAME "</b><i>literal string</i><b>"</b>
 <dd style="margin-left: 5.0em"><dt><b>WITH-HOSTNAME "/</b><i>regular expression</i><b>/"</b>
 <dd style="margin-left: 5.0em">Requires that at least one URI value contains a matching hostname.
index 3392242919c6f72ecd3b7106082e838ffb117b31..b40042f2daec275b9a78da4bbecd503a1efa10a6 100644 (file)
@@ -7,7 +7,7 @@
 .\" Licensed under Apache License v2.0.  See the file "LICENSE" for more
 .\" information.
 .\"
-.TH ipptoolfile 5 "CUPS" "2021-04-07" "OpenPrinting"
+.TH ipptoolfile 5 "CUPS" "2021-04-21" "OpenPrinting"
 .SH NAME
 ipptoolfile \- ipptool file format
 .SH DESCRIPTION
@@ -359,7 +359,7 @@ Comparisons are case-sensitive.
 \fBWITH\-DISTINCT\-VALUES\fR
 Requires that all values of the \fBEXPECT\fR attribute are unique.
 Comparisons are case-sensitive.
-Only charset, enum, integer, keyword, mimeMediaType, naturalLanguage, rangeOfInteger, resolution, uriScheme attributes support this predicate.
+Only charset, collection, enum, integer, keyword, mimeMediaType, naturalLanguage, rangeOfInteger, resolution, uriScheme attributes support this predicate.
 .TP 5
 \fBWITH\-HOSTNAME "\fIliteral string\fB"\fR
 .TP 5
index 2162f7b1cf9ebc214b70f63d0f4cbae3cbfc56ac..f6d3e2305ead66151efc9514a4616ef1661edcaf 100644 (file)
@@ -5333,6 +5333,7 @@ with_distinct_values(
     case IPP_TAG_CHARSET :
     case IPP_TAG_LANGUAGE :
     case IPP_TAG_MIMETYPE :
+    case IPP_TAG_BEGIN_COLLECTION :
         break;
 
     default :
@@ -5381,6 +5382,29 @@ with_distinct_values(
       case IPP_TAG_MIMETYPE :
           value = ippGetString(attr, i, NULL);
           break;
+      case IPP_TAG_BEGIN_COLLECTION :
+          {
+            ipp_t      *col = ippGetCollection(attr, i);
+                                       // Collection value
+            ipp_attribute_t *member;   // Member attribute
+            char       *bufptr,        // Pointer into buffer
+                       *bufend,        // End of buffer
+                       prefix;         // Prefix character
+
+            for (prefix = '{', bufptr = buffer, bufend = buffer + sizeof(buffer) - 2, member = ippFirstAttribute(col); member && bufptr < bufend; member = ippNextAttribute(col))
+            {
+              *bufptr++ = prefix;
+              prefix    = ' ';
+
+              ippAttributeString(member, bufptr, (size_t)(bufend - bufptr));
+              bufptr += strlen(bufptr);
+            }
+
+            *bufptr++ = '}';
+            *bufptr   = '\0';
+            value     = buffer;
+          }
+          break;
       default : // Should never happen
           value = "unsupported";
           break;