From: Michael R Sweet Date: Wed, 21 Apr 2021 15:37:34 +0000 (-0400) Subject: Add WITH-DISTINCT-VALUES support for collections. X-Git-Tag: v2.4b1~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a09fa7b55b07504311ffc8bd47ae2ff2015d20e8;p=thirdparty%2Fcups.git Add WITH-DISTINCT-VALUES support for collections. --- diff --git a/doc/help/man-cupsd.conf.html b/doc/help/man-cupsd.conf.html index 798ab63261..fc095a696f 100644 --- a/doc/help/man-cupsd.conf.html +++ b/doc/help/man-cupsd.conf.html @@ -142,9 +142,6 @@ The default is "5".
KeepAlive No
Specifies whether to support HTTP keep-alive connections. The default is "Yes". -
KeepAliveTimeout seconds -
Specifies how long an idle client connection remains open. -The default is "30".
<Limit operation ...> ... </Limit>
Specifies the IPP operations that are being limited inside a Policy section. IPP operation names are listed below in the section "IPP OPERATION NAMES".
<Limit method ...> ... </Limit> diff --git a/doc/help/man-ipptoolfile.html b/doc/help/man-ipptoolfile.html index 36171127f6..89d146520d 100644 --- a/doc/help/man-ipptoolfile.html +++ b/doc/help/man-ipptoolfile.html @@ -272,7 +272,7 @@ Comparisons are case-sensitive.
WITH-DISTINCT-VALUES
Requires that all values of the EXPECT 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.
WITH-HOSTNAME "literal string"
WITH-HOSTNAME "/regular expression/"
Requires that at least one URI value contains a matching hostname. diff --git a/man/ipptoolfile.5 b/man/ipptoolfile.5 index 3392242919..b40042f2da 100644 --- a/man/ipptoolfile.5 +++ b/man/ipptoolfile.5 @@ -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 diff --git a/tools/ipptool.c b/tools/ipptool.c index 2162f7b1cf..f6d3e2305e 100644 --- a/tools/ipptool.c +++ b/tools/ipptool.c @@ -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;