From: Michael R Sweet Date: Fri, 5 Apr 2024 21:00:45 +0000 (-0400) Subject: Support enum keywords (Issue #734) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ee7183bc6ed43f0dd1a55dc05470ccf73963e33;p=thirdparty%2Fcups.git Support enum keywords (Issue #734) --- diff --git a/CHANGES.md b/CHANGES.md index 24b250f14e..13226c3f1e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -25,6 +25,8 @@ Changes in CUPS v2.5b1 (TBA) - Updated IPP Everywhere printer creation error reporting (Issue #347) - Updated internal usage of CUPS array API to include callback pointer even when not used (Issue #674) +- Updated support for using keyword equivalents for enumerated values like + "print-quality" (Issue #734) - Updated `cups_enum_dests()` timeout for listing available IPP printers (Issue #751) - Updated default destination documentation (Issue #819) diff --git a/cups/encode.c b/cups/encode.c index 2e85bc8bf5..703cfe854d 100644 --- a/cups/encode.c +++ b/cups/encode.c @@ -546,8 +546,15 @@ _cupsEncodeOption( switch (attr->value_tag) { - case IPP_TAG_INTEGER : case IPP_TAG_ENUM : + if (isalpha(*val & 255)) + { + // Map enum keyword to integer value... + ippSetInteger(ipp, &attr, i, ippEnumValue(name, val)); + break; + } + + case IPP_TAG_INTEGER : /* * Integer/enumeration value... */