From 187dd1e7517a31c473467823e7f89f174a5ba3db Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Thu, 23 Oct 2025 17:55:46 -0400 Subject: [PATCH] Add "WITH-VALUE !number" comparison for ipptool. Clean up man pages. --- doc/help/man-cups-x509.html | 2 +- doc/help/man-ipptoolfile.html | 16 ++++++++++------ man/cups-x509.1 | 4 ++-- man/ipptoolfile.5 | 18 +++++++++++------- tools/ipptool.c | 12 +++++++----- 5 files changed, 31 insertions(+), 21 deletions(-) diff --git a/doc/help/man-cups-x509.html b/doc/help/man-cups-x509.html index bf0e98755e..36788dd95a 100644 --- a/doc/help/man-cups-x509.html +++ b/doc/help/man-cups-x509.html @@ -7,7 +7,7 @@

cups-x509(1)

Name

-

cups-x509 - description +

cups-x509 - manage x.509 certificates and certificate requests

Synopsis

cups-x509 diff --git a/doc/help/man-ipptoolfile.html b/doc/help/man-ipptoolfile.html index 52395a3b2e..b7fb910388 100644 --- a/doc/help/man-ipptoolfile.html +++ b/doc/help/man-ipptoolfile.html @@ -402,15 +402,17 @@ Requires that all URI values contain a matching scheme.

WITH-ALL-VALUES "literal string"
Requires that all values of the EXPECT attribute match the literal string. Comparisons are case-sensitive. -

-

WITH-ALL-VALUES <number

WITH-ALL-VALUES =number
+

+

WITH-ALL-VALUES !number
+

+

WITH-ALL-VALUES <number

WITH-ALL-VALUES >number

WITH-ALL-VALUES number[,...,number]
-Requires that all values of the EXPECT attribute match the number(s) or numeric comparison. When comparing rangeOfInteger values, the "<" and ">" operators only check the upper bound of the range. +Requires that all values of the EXPECT attribute match ("="), do not match ("!"), are less than ("<"), or are greater than (">") the number(s). When comparing rangeOfInteger values, the "<" and ">" operators only check the upper bound of the range, "=" checks for inclusion in a range, and "!" checks for exclusion of a range.

WITH-ALL-VALUES "false"

@@ -447,15 +449,17 @@ Requires that at least one URI value contains a matching scheme.

WITH-VALUE "literal string"
Requires that at least one value of the EXPECT attribute matches the literal string. Comparisons are case-sensitive. -

-

WITH-VALUE <number

WITH-VALUE =number
+

+

WITH-VALUE !number
+

+

WITH-VALUE <number

WITH-VALUE >number

WITH-VALUE number[,...,number]
-Requires that at least one value of the EXPECT attribute matches the number(s) or numeric comparison. When comparing rangeOfInteger values, the "<" and ">" operators only check the upper bound of the range. +Requires that at least one value of the EXPECT attribute matches ("="), does not match ("!"), is less than ("<"), or is greater than (">") the number(s). When comparing rangeOfInteger values, the "<" and ">" operators only check the upper bound of the range, "=" checks for inclusion in a range, and "!" checks for exclusion of a range.

WITH-VALUE "false"

diff --git a/man/cups-x509.1 b/man/cups-x509.1 index 138f9be27c..83ac187e86 100644 --- a/man/cups-x509.1 +++ b/man/cups-x509.1 @@ -6,9 +6,9 @@ .\" Licensed under Apache License v2.0. See the file "LICENSE" for more .\" information. .\" -.TH cups-x509 1 "CUPS" "2025-10-21" "OpenPrinting" +.TH cups-x509 1 "CUPS" "2025-10-23" "OpenPrinting" .SH NAME -cups-x509 \- description +cups-x509 \- manage x.509 certificates and certificate requests .SH SYNOPSIS .B cups-x509 .B \-\-help diff --git a/man/ipptoolfile.5 b/man/ipptoolfile.5 index 1bf9e01825..8ce68088bf 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" "2024-09-12" "OpenPrinting" +.TH ipptoolfile 5 "CUPS" "2024-10-23" "OpenPrinting" .SH NAME ipptoolfile \- ipptool file format .SH DESCRIPTION @@ -391,14 +391,16 @@ Requires that all URI values contain a matching scheme. \fBWITH\-ALL\-VALUES "\fIliteral string\fB"\fR Requires that all values of the \fBEXPECT\fR attribute match the literal string. Comparisons are case-sensitive. .TP 5 -\fBWITH\-ALL\-VALUES <\fInumber\fR -.TP 5 \fBWITH\-ALL\-VALUES =\fInumber\fR .TP 5 +\fBWITH\-ALL\-VALUES !\fInumber\fR +.TP 5 +\fBWITH\-ALL\-VALUES <\fInumber\fR +.TP 5 \fBWITH\-ALL\-VALUES >\fInumber\fR .TP 5 \fBWITH\-ALL\-VALUES \fInumber\fR[\fI,...,number\fR] -Requires that all values of the \fBEXPECT\fR attribute match the number(s) or numeric comparison. When comparing rangeOfInteger values, the "<" and ">" operators only check the upper bound of the range. +Requires that all values of the \fBEXPECT\fR attribute match ("="), do not match ("!"), are less than ("<"), or are greater than (">") the number(s). When comparing rangeOfInteger values, the "<" and ">" operators only check the upper bound of the range, "=" checks for inclusion in a range, and "!" checks for exclusion of a range. .TP 5 \fBWITH\-ALL\-VALUES "false"\fR .TP 5 @@ -436,14 +438,16 @@ Requires that at least one URI value contains a matching scheme. \fBWITH\-VALUE "\fIliteral string\fB"\fR Requires that at least one value of the \fBEXPECT\fR attribute matches the literal string. Comparisons are case-sensitive. .TP 5 -\fBWITH\-VALUE <\fInumber\fR -.TP 5 \fBWITH\-VALUE =\fInumber\fR .TP 5 +\fBWITH\-VALUE !\fInumber\fR +.TP 5 +\fBWITH\-VALUE <\fInumber\fR +.TP 5 \fBWITH\-VALUE >\fInumber\fR .TP 5 \fBWITH\-VALUE \fInumber\fR[\fI,...,number\fR] -Requires that at least one value of the \fBEXPECT\fR attribute matches the number(s) or numeric comparison. When comparing rangeOfInteger values, the "<" and ">" operators only check the upper bound of the range. +Requires that at least one value of the \fBEXPECT\fR attribute matches ("="), does not match ("!"), is less than ("<"), or is greater than (">") the number(s). When comparing rangeOfInteger values, the "<" and ">" operators only check the upper bound of the range, "=" checks for inclusion in a range, and "!" checks for exclusion of a range. .TP 5 \fBWITH\-VALUE "false"\fR .TP 5 diff --git a/tools/ipptool.c b/tools/ipptool.c index 3dd59ed73e..a63eb4a962 100644 --- a/tools/ipptool.c +++ b/tools/ipptool.c @@ -7205,12 +7205,12 @@ with_value(ipptool_test_t *data, // I - Test data while (isspace(*valptr & 255) || isdigit(*valptr & 255) || *valptr == '-' || *valptr == ',' || *valptr == '<' || - *valptr == '=' || *valptr == '>') + *valptr == '=' || *valptr == '>' || *valptr == '!') { op = '='; while (*valptr && !isdigit(*valptr & 255) && *valptr != '-') { - if (*valptr == '<' || *valptr == '>' || *valptr == '=') + if (*valptr == '<' || *valptr == '>' || *valptr == '=' || *valptr == '!') op = *valptr; valptr ++; } @@ -7224,6 +7224,7 @@ with_value(ipptool_test_t *data, // I - Test data valptr = nextptr; if ((op == '=' && attrvalue == intvalue) || + (op == '!' && attrvalue != intvalue) || (op == '<' && attrvalue < intvalue) || (op == '>' && attrvalue > intvalue)) { @@ -7271,13 +7272,13 @@ with_value(ipptool_test_t *data, // I - Test data valptr = value; while (isspace(*valptr & 255) || isdigit(*valptr & 255) || - *valptr == '-' || *valptr == ',' || *valptr == '<' || + *valptr == '-' || *valptr == ',' || *valptr == '!' || *valptr == '<' || *valptr == '=' || *valptr == '>') { op = '='; while (*valptr && !isdigit(*valptr & 255) && *valptr != '-') { - if (*valptr == '<' || *valptr == '>' || *valptr == '=') + if (*valptr == '<' || *valptr == '>' || *valptr == '=' || *valptr == '!') op = *valptr; valptr ++; } @@ -7290,7 +7291,8 @@ with_value(ipptool_test_t *data, // I - Test data break; valptr = nextptr; - if ((op == '=' && (lower == intvalue || upper == intvalue)) || + if ((op == '=' && lower <= intvalue && upper >= intvalue) || + (op == '!' && (lower > intvalue || upper < intvalue)) || (op == '<' && upper < intvalue) || (op == '>' && upper > intvalue)) { -- 2.47.3