summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2021-04-21 11:39:06 -0400
committerMichael R Sweet <michael.r.sweet@gmail.com>2021-04-21 11:39:06 -0400
commit9a13f253405cdfdff14a4387821f9aa62a479c21 (patch)
tree0e1e9bfa4af4f201789b331bcab37de6e5f2d31a /tools
parent14a52682f82c17045fe99415f81ebfefe2100fa4 (diff)
downloadcups-9a13f253405cdfdff14a4387821f9aa62a479c21.tar.gz
Add WITH-DISTINCT-VALUES support for collections.bug-fix-rollup-1
Diffstat (limited to 'tools')
-rw-r--r--tools/ipptool.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/ipptool.c b/tools/ipptool.c
index 0ebc016c0..e3692524c 100644
--- a/tools/ipptool.c
+++ b/tools/ipptool.c
@@ -5279,6 +5279,7 @@ with_distinct_values(
case IPP_TAG_CHARSET :
case IPP_TAG_LANGUAGE :
case IPP_TAG_MIMETYPE :
+ case IPP_TAG_BEGIN_COLLECTION :
break;
default :
@@ -5327,6 +5328,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;