Skip to content

Commit 80b57f9

Browse files
committed
Merge branch 'master' of https://github.com/OpenPrinting/libcups
2 parents 23c6a8c + 936f247 commit 80b57f9

40 files changed

Lines changed: 707 additions & 142 deletions

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[submodule "pdfio"]
22
path = pdfio
33
url = https://github.com/michaelrsweet/pdfio.git
4-
branch = v1.5.x
4+
branch = master

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Changes in libcups
44
libcups v3.0.0 (YYYY-MM-DD)
55
---------------------------
66

7+
- Added `cupsLangIsRTL` API.
78
- Added `cupsOAuthGetDeviceGrant`, `cupsOAuthGetJWKS`, and `cupsOAuthGetUserId`
89
APIs.
910
- Added `httpGetCookieValue` and `httpGetSecurity` APIs.

cups/base.strings

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
"" = "";
2+
" No Errors\n" = " No Errors\n";
3+
" No Warnings\n" = " No Warnings\n";
24
"! EXPRESSION Unary NOT of expression" = "! EXPRESSION Unary NOT of expression";
35
"\"%s\": Bad URI value \"%s\" - %s (RFC 8011 section 5.1.6)." = "\"%s\": Bad URI value \"%s\" - %s (RFC 8011 section 5.1.6).";
46
"\"%s\": Bad URI value \"%s\" - bad length %d (RFC 8011 section 5.1.6)." = "\"%s\": Bad URI value \"%s\" - bad length %d (RFC 8011 section 5.1.6).";
@@ -281,6 +283,7 @@
281283
"EXPRESSION EXPRESSION Logical AND" = "EXPRESSION EXPRESSION Logical AND";
282284
"Encryption is not supported." = "Encryption is not supported.";
283285
"Environment Variables:" = "Environment Variables:";
286+
"Errors:\n" = "Errors:\n";
284287
"Expectation Failed" = "Expectation Failed";
285288
"Expressions:" = "Expressions:";
286289
"Failed Dependency" = "Failed Dependency";
@@ -337,6 +340,7 @@
337340
"Listening on port %d." = "Listening on port %d.";
338341
"Locked" = "Locked";
339342
"Loop Detected" = "Loop Detected";
343+
"Message:" = "Message:";
340344
"Method Now Allowed" = "Method Now Allowed";
341345
"Misdirected Request" = "Misdirected Request";
342346
"Missing media or media-col." = "Missing media or media-col.";
@@ -376,6 +380,7 @@
376380
"Other Tray" = "Other Tray";
377381
"Output Formats:" = "Output Formats:";
378382
"PRINTER environment variable names default destination that does not exist." = "PRINTER environment variable names default destination that does not exist.";
383+
"Pages:" = "Pages:";
379384
"Partial Content" = "Partial Content";
380385
"Password for %s on %s? " = "Password for %s on %s? ";
381386
"Payment Required" = "Payment Required";
@@ -403,6 +408,7 @@
403408
"Temporary Redirect" = "Temporary Redirect";
404409
"The client ID is not configured for this server." = "The client ID is not configured for this server.";
405410
"The printer or class does not exist." = "The printer or class does not exist.";
411+
"Title:" = "Title:";
406412
"Too Early" = "Too Early";
407413
"Too Many Requests" = "Too Many Requests";
408414
"Trust on first use is disabled." = "Trust on first use is disabled.";
@@ -455,8 +461,10 @@
455461
"Usage: ipptransform [OPTIONS] FILENAME [ ... FILENAME]" = "Usage: ipptransform [OPTIONS] FILENAME [ ... FILENAME]";
456462
"Use Proxy" = "Use Proxy";
457463
"User Code: %s" = "User Code: %s";
464+
"User:" = "User:";
458465
"Using spool directory '%s'." = "Using spool directory '%s'.";
459466
"Validation of subjectAltName in X.509 certificate request failed." = "Validation of subjectAltName in X.509 certificate request failed.";
467+
"Warnings:\n" = "Warnings:\n";
460468
"Web Page: %s" = "Web Page: %s";
461469
"aborted" = "aborted";
462470
"adobe-rgb_16 48-bit AdobeRGB" = "adobe-rgb_16 48-bit AdobeRGB";
@@ -975,12 +983,15 @@
975983
"job-sheets" = "Banner Pages";
976984
"job-sheets-col" = "Banner Pages";
977985
"job-sheets-col={SPEC} Enable banner pages" = "job-sheets-col={SPEC} Enable banner pages";
986+
"job-sheets.classified" = "Classified Print Job Cover Page";
987+
"job-sheets.confidential" = "Confidential Print Job Cover Page";
978988
"job-sheets.first-print-stream-page" = "First page in document";
979989
"job-sheets.job-both-sheet" = "Start and end sheets";
980990
"job-sheets.job-end-sheet" = "End sheet";
981991
"job-sheets.job-start-sheet" = "Start sheet";
982992
"job-sheets.none" = "None";
983-
"job-sheets.standard" = "Standard";
993+
"job-sheets.standard" = "Print Job Cover Page";
994+
"job-sheets.unclassified" = "Unclassified Print Job Cover Page";
984995
"job-sheets=NAME Enable banner pages" = "job-sheets=NAME Enable banner pages";
985996
"job-state-reasons.aborted-by-system" = "Stopping.";
986997
"job-state-reasons.compression-error" = "Decompression error.";

cups/ipp-file.c

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,13 @@ ippFileGetVar(ipp_file_t *file, // I - IPP data file
310310

311311

312312
//
313-
// 'ippFileNew()' - Create a new IPP data file object for reading or writing.
313+
// 'ippFileNew()' - Create a new IPP data file object in preparation for reading or writing.
314314
//
315-
// This function opens an IPP data file for reading (mode="r") or writing
316-
// (mode="w"). If the "parent" argument is not `NULL`, all variables from the
317-
// parent data file are copied to the new file.
315+
// This function creates a new IPP data file object. If the "parent" argument
316+
// is not `NULL`, all variables from the parent data file are copied to the new
317+
// object.
318+
//
319+
// Call the @link ippFileOpen@ function to open the IPP data file.
318320
//
319321

320322
ipp_file_t * // O - IPP data file
@@ -343,9 +345,8 @@ ippFileNew(ipp_file_t *parent, // I - Parent data file or `NULL` for none
343345
//
344346
// 'ippFileOpen()' - Open an IPP data file for reading or writing.
345347
//
346-
// This function opens an IPP data file for reading (mode="r") or writing
347-
// (mode="w"). If the "parent" argument is not `NULL`, all variables from the
348-
// parent data file are copied to the new file.
348+
// This function opens the IPP data file specified by the "filename" argument
349+
// for reading ("mode" is "r") or writing ("mode" is "w").
349350
//
350351

351352
bool // O - `true` on success, `false` on error
@@ -389,6 +390,14 @@ ippFileOpen(ipp_file_t *file, // I - IPP data file
389390
//
390391
// 'ippFileRead()' - Read an IPP data file.
391392
//
393+
// This function reads tokens from an IPP data file, processes standard
394+
// directives that define attributes and values, and passes on unknown tokens
395+
// to the token callback "token_cb" for processing.
396+
//
397+
// If the "with_groups" argument is `true` then the "GROUP" directive will be
398+
// supported for specifying the attribute group(s) associated with any
399+
// defined attributes.
400+
//
392401

393402
bool // O - `true` on success, `false` on error
394403
ippFileRead(ipp_file_t *file, // I - IPP data file

cups/ipp.strings

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,12 +420,15 @@
420420
"job-retain-until.none" = "Never";
421421
"job-sheets" = "Banner Pages";
422422
"job-sheets-col" = "Banner Pages";
423+
"job-sheets.classified" = "Classified Print Job Cover Page";
424+
"job-sheets.confidential" = "Confidential Print Job Cover Page";
423425
"job-sheets.first-print-stream-page" = "First page in document";
424426
"job-sheets.job-both-sheet" = "Start and end sheets";
425427
"job-sheets.job-end-sheet" = "End sheet";
426428
"job-sheets.job-start-sheet" = "Start sheet";
427429
"job-sheets.none" = "None";
428-
"job-sheets.standard" = "Standard";
430+
"job-sheets.standard" = "Print Job Cover Page";
431+
"job-sheets.unclassified" = "Unclassified Print Job Cover Page";
429432
"job-state.3" = "Pending";
430433
"job-state.4" = "Held";
431434
"job-state.5" = "Processing";

cups/language.c

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// I18N/language support for CUPS.
33
//
4-
// Copyright © 2022 by OpenPrinting.
4+
// Copyright © 2022-2025 by OpenPrinting.
55
// Copyright © 2007-2017 by Apple Inc.
66
// Copyright © 1997-2007 by Easy Software Products.
77
//
@@ -75,6 +75,9 @@ static int cups_message_compare(_cups_message_t *m1, _cups_message_t *m2);
7575
//
7676
// 'cupsLangAddStrings()' - Add strings for the specified language.
7777
//
78+
// This function adds strings for the specified language. It is equivalent to
79+
// calling @link cupsLangFind@ followed by @link cupsLangLoadStrings@.
80+
//
7881

7982
bool // O - `true` on success, `false` on failure
8083
cupsLangAddStrings(
@@ -94,9 +97,12 @@ cupsLangAddStrings(
9497
//
9598
// 'cupsLangFind()' - Find a language localization.
9699
//
100+
// This function finds the localization information for the specified language
101+
// or locale name.
102+
//
97103

98104
cups_lang_t * // O - Language data
99-
cupsLangFind(const char *language) // I - Language or locale name
105+
cupsLangFind(const char *language) // I - Language or locale name, `NULL` for the current locale
100106
{
101107
char langname[16]; // Requested language name
102108
cups_lang_t *lang; // Current language...
@@ -134,6 +140,9 @@ cupsLangFind(const char *language) // I - Language or locale name
134140
//
135141
// 'cupsLangFormatString()' - Create a localized formatted string.
136142
//
143+
// This function formats a string using the localized version of the "format"
144+
// string argument, which supports all of the `printf` format specifiers.
145+
//
137146

138147
const char * // O - Formatted string
139148
cupsLangFormatString(
@@ -200,14 +209,44 @@ cupsLangGetString(cups_lang_t *lang, // I - Language
200209
}
201210

202211

212+
//
213+
// 'cupsLangIsRTL()' - Get the writing direction.
214+
//
215+
// This function gets the writing direction for the specified language.
216+
//
217+
218+
bool // O - `true` if right-to-left, `false` if left-to-right
219+
cupsLangIsRTL(cups_lang_t *lang) // I - Language
220+
{
221+
// Range check input...
222+
if (!lang)
223+
return (false);
224+
225+
// The following languages are written from right to left: Arabic, Aramaic,
226+
// Azeri, Divehi, Fulah, Hebrew, Kurdish, N'ko, Persian, Rohingya, Syriac, and
227+
// Urdu. Not all of these have language codes...
228+
return (!strncmp(lang->language, "ar", 2) || !strncmp(lang->language, "dv", 2) || !strncmp(lang->language, "ff", 2) || !strncmp(lang->language, "he", 2) || !strncmp(lang->language, "ku", 2) || !strncmp(lang->language, "fa", 2) || !strncmp(lang->language, "ur", 2));
229+
}
230+
231+
203232
//
204233
// 'cupsLangLoadStrings()' - Load a message catalog for a language.
205234
//
235+
// This function loads a message catalog for a language. The catalog must be in
236+
// the Apple .strings format. For example, the following translates the strings
237+
// "Yes", "No", and "Welcome, %s." to French:
238+
//
239+
// ```
240+
// "Yes" = "Oui";
241+
// "No" = "Non";
242+
// "Welcome, %s." = "Bievenue, %s.";
243+
// ```
244+
//
206245

207246
bool // O - `true` on success, `false` on failure
208247
cupsLangLoadStrings(
209248
cups_lang_t *lang, // I - Language data
210-
const char *filename, // I - Filename of `NULL` for none
249+
const char *filename, // I - Filename or `NULL` for none
211250
const char *strings) // I - Strings or `NULL` for none
212251
{
213252
bool ret = true; // Return value
@@ -540,7 +579,11 @@ cupsLangLoadStrings(
540579

541580

542581
//
543-
// 'cupsLangSetDirectory()' - Set a directory containing localizations.
582+
// 'cupsLangSetDirectory()' - Set the directory containing localizations.
583+
//
584+
// This function sets the directory where .strings files can be found. The
585+
// files are named "LOCALE.string" where "LOCALE" is the locale name, for
586+
// example "fr" for generic French and "fr-CA" for Canadian French.
544587
//
545588

546589
void

cups/language.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// Language localization definitions for CUPS.
33
//
4-
// Copyright © 2021-2022 by OpenPrinting.
4+
// Copyright © 2021-2025 by OpenPrinting.
55
// Copyright © 2007-2011 by Apple Inc.
66
// Copyright © 1997-2006 by Easy Software Products.
77
//
@@ -38,6 +38,7 @@ extern const char *cupsLangFormatString(cups_lang_t *lang, char *buffer, size_t
3838
extern cups_encoding_t cupsLangGetEncoding(void) _CUPS_PUBLIC;
3939
extern const char *cupsLangGetName(cups_lang_t *lang) _CUPS_PUBLIC;
4040
extern const char *cupsLangGetString(cups_lang_t *lang, const char *s) _CUPS_PUBLIC;
41+
extern bool cupsLangIsRTL(cups_lang_t *lang) _CUPS_PUBLIC;
4142
extern bool cupsLangLoadStrings(cups_lang_t *lang, const char *filename, const char *strings);
4243
extern ssize_t cupsLangPrintf(FILE *fp, const char *format, ...) _CUPS_FORMAT(2, 3) _CUPS_PUBLIC;
4344
extern ssize_t cupsLangPuts(FILE *fp, const char *message) _CUPS_PUBLIC;

cups/libcups3.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ cupsLangFormatString
273273
cupsLangGetEncoding
274274
cupsLangGetName
275275
cupsLangGetString
276+
cupsLangIsRTL
276277
cupsLangLoadStrings
277278
cupsLangPrintf
278279
cupsLangPuts

cups/strings/ca.strings

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
"" = "";
2+
" No Errors\n" = " No Errors\n";
3+
" No Warnings\n" = " No Warnings\n";
24
"! EXPRESSION Unary NOT of expression" = "! EXPRESSION Unary NOT of expression";
35
"\"%s\": Bad URI value \"%s\" - %s (RFC 8011 section 5.1.6)." = "\"%s\": Bad URI value \"%s\" - %s (RFC 8011 section 5.1.6).";
46
"\"%s\": Bad URI value \"%s\" - bad length %d (RFC 8011 section 5.1.6)." = "\"%s\": Bad URI value \"%s\" - bad length %d (RFC 8011 section 5.1.6).";
@@ -281,6 +283,7 @@
281283
"EXPRESSION EXPRESSION Logical AND" = "EXPRESSION EXPRESSION Logical AND";
282284
"Encryption is not supported." = "Encryption is not supported.";
283285
"Environment Variables:" = "Environment Variables:";
286+
"Errors:\n" = "Errors:\n";
284287
"Expectation Failed" = "Ha fallat la condició del valor que s'esperava";
285288
"Expressions:" = "Expressions:";
286289
"Failed Dependency" = "Failed Dependency";
@@ -337,6 +340,7 @@
337340
"Listening on port %d." = "Listening on port %d.";
338341
"Locked" = "Locked";
339342
"Loop Detected" = "Loop Detected";
343+
"Message:" = "Message:";
340344
"Method Now Allowed" = "Method Now Allowed";
341345
"Misdirected Request" = "Misdirected Request";
342346
"Missing media or media-col." = "Falta el media o el media-col.";
@@ -376,6 +380,7 @@
376380
"Other Tray" = "Other Tray";
377381
"Output Formats:" = "Output Formats:";
378382
"PRINTER environment variable names default destination that does not exist." = "PRINTER environment variable names default destination that does not exist.";
383+
"Pages:" = "Pages:";
379384
"Partial Content" = "Partial Content";
380385
"Password for %s on %s? " = "Contrasenya per %s a %s? ";
381386
"Payment Required" = "Payment Required";
@@ -403,6 +408,7 @@
403408
"Temporary Redirect" = "Temporary Redirect";
404409
"The client ID is not configured for this server." = "The client ID is not configured for this server.";
405410
"The printer or class does not exist." = "La impressora o la classe no existeix.";
411+
"Title:" = "Title:";
406412
"Too Early" = "Too Early";
407413
"Too Many Requests" = "Too Many Requests";
408414
"Trust on first use is disabled." = "Trust on first use is disabled.";
@@ -455,8 +461,10 @@
455461
"Usage: ipptransform [OPTIONS] FILENAME [ ... FILENAME]" = "Usage: ipptransform [OPTIONS] FILENAME [ ... FILENAME]";
456462
"Use Proxy" = "Use Proxy";
457463
"User Code: %s" = "User Code: %s";
464+
"User:" = "User:";
458465
"Using spool directory '%s'." = "Using spool directory '%s'.";
459466
"Validation of subjectAltName in X.509 certificate request failed." = "Validation of subjectAltName in X.509 certificate request failed.";
467+
"Warnings:\n" = "Warnings:\n";
460468
"Web Page: %s" = "Web Page: %s";
461469
"aborted" = "interromput";
462470
"adobe-rgb_16 48-bit AdobeRGB" = "adobe-rgb_16 48-bit AdobeRGB";
@@ -975,12 +983,15 @@
975983
"job-sheets" = "Banner Pages";
976984
"job-sheets-col" = "Banner Pages";
977985
"job-sheets-col={SPEC} Enable banner pages" = "job-sheets-col={SPEC} Enable banner pages";
986+
"job-sheets.classified" = "Classified Print Job Cover Page";
987+
"job-sheets.confidential" = "Confidential Print Job Cover Page";
978988
"job-sheets.first-print-stream-page" = "First page in document";
979989
"job-sheets.job-both-sheet" = "Start and end sheets";
980990
"job-sheets.job-end-sheet" = "End sheet";
981991
"job-sheets.job-start-sheet" = "Start sheet";
982992
"job-sheets.none" = "None";
983-
"job-sheets.standard" = "Standard";
993+
"job-sheets.standard" = "Print Job Cover Page";
994+
"job-sheets.unclassified" = "Unclassified Print Job Cover Page";
984995
"job-sheets=NAME Enable banner pages" = "job-sheets=NAME Enable banner pages";
985996
"job-state-reasons.aborted-by-system" = "Stopping.";
986997
"job-state-reasons.compression-error" = "Decompression error.";
@@ -2475,5 +2486,4 @@
24752486
"{service_uri} URI" = "{service_uri} URI";
24762487
"{txt_*} Value of TXT record key" = "{txt_*} Value of TXT record key";
24772488
"{} URI" = "{} URI";
2478-
"{} URI" = "{} URI";
24792489
"~/.../lpoptions file names default destination that does not exist." = "~/.../lpoptions file names default destination that does not exist.";

0 commit comments

Comments
 (0)