• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:verbose

6  * Copyright © 2007-2018 by Apple Inc.
7 * Copyright © 1997-2007 by Easy Software Products, all rights reserved.
19 #include <cups/cups-private.h>
21 #include <cups/ppd-private.h>
91 static int check_constraints(ppd_file_t *ppd, int errors, int verbose,
93 static int check_case(ppd_file_t *ppd, int errors, int verbose);
94 static int check_defaults(ppd_file_t *ppd, int errors, int verbose,
96 static int check_duplex(ppd_file_t *ppd, int errors, int verbose,
99 int verbose, int warn);
101 int verbose, int warn);
102 static int check_sizes(ppd_file_t *ppd, int errors, int verbose, int warn);
103 static int check_translations(ppd_file_t *ppd, int errors, int verbose,
106 static int test_raster(ppd_file_t *ppd, int verbose);
109 int verbose, int warn);
114 * 'main()' - Main entry for test program.
117 int /* O - Exit status */
118 main(int argc, /* I - Number of command-line args */ in main()
119 char *argv[]) /* I - Command-line arguments */ in main()
127 int verbose; /* Want verbose output? */ in main() local
156 * Display PPD files for each file listed on the command-line... in main()
161 verbose = 0; in main()
170 if (!strcmp(argv[i], "--help")) in main()
172 else if (argv[i][0] == '-' && argv[i][1]) in main()
235 if (verbose > 0) in main()
238 _("cupstestppd: The -q option is incompatible " in main()
239 "with the -v option.")); in main()
243 verbose --; in main()
250 case 'v' : /* Verbose mode */ in main()
251 if (verbose < 0) in main()
254 _("cupstestppd: The -v option is incompatible " in main()
255 "with the -q option.")); in main()
259 verbose ++; in main()
272 if (files && verbose >= 0) in main()
277 if (argv[i][0] == '-') in main()
285 if (verbose >= 0) in main()
286 printf("%s:", (ppd && ppd->pcfilename) ? ppd->pcfilename : "(stdin)"); in main()
294 if (verbose >= 0) in main()
306 if (verbose >= 0) in main()
310 _(" **FAIL** Unable to open PPD file - %s on " in main()
325 if (verbose >= 0) in main()
329 _(" **FAIL** Unable to open PPD file - %s on " in main()
337 if (verbose >= 0) in main()
341 _(" **FAIL** Unable to open PPD file - " in main()
360 _(" REF: Pages 45-46, section " in main()
366 _(" REF: Pages 42-45, section " in main()
371 _(" REF: Pages 48-49, section " in main()
376 _(" REF: Pages 52-54, section " in main()
396 _(" REF: Pages 16-17, section " in main()
428 if (verbose > 0) in main()
433 attr->value) in main()
434 ppdversion = (int)(10 * _cupsStrScand(attr->value, NULL, loc) + 0.5); in main()
440 if (strstr(attr->value, "application/vnd.cups-raster")) in main()
442 if (!test_raster(ppd, verbose)) in main()
451 for (j = 0; j < ppd->num_filters; j ++) in main()
452 if (strstr(ppd->filters[j], "application/vnd.cups-raster")) in main()
454 if (!test_raster(ppd, verbose)) in main()
465 errors = check_defaults(ppd, errors, verbose, 0); in main()
469 if (verbose >= 0) in main()
471 if (!errors && !verbose) in main()
481 else if (ppdPageSize(ppd, attr->value) == NULL && in main()
482 strcmp(attr->value, "Unknown")) in main()
484 if (verbose >= 0) in main()
486 if (!errors && !verbose) in main()
492 attr->value); in main()
499 if (verbose > 0) in main()
505 if (verbose >= 0) in main()
507 if (!errors && !verbose) in main()
517 else if (ppdPageSize(ppd, attr->value) == NULL && in main()
518 strcmp(attr->value, "Unknown")) in main()
520 if (verbose >= 0) in main()
522 if (!errors && !verbose) in main()
528 attr->value); in main()
533 else if (verbose > 0) in main()
536 for (j = 0, group = ppd->groups; j < ppd->num_groups; j ++, group ++) in main()
537 for (k = 0, option = group->options; in main()
538 k < group->num_options; in main()
545 if (option->defchoice[0]) in main()
547 if (ppdFindChoice(option, option->defchoice) == NULL && in main()
548 strcmp(option->defchoice, "Unknown")) in main()
550 if (verbose >= 0) in main()
552 if (!errors && !verbose) in main()
558 option->keyword, option->defchoice); in main()
563 else if (verbose > 0) in main()
566 option->keyword); in main()
570 if (verbose >= 0) in main()
572 if (!errors && !verbose) in main()
578 option->keyword); in main()
587 for (ptr = attr->value; *ptr; ptr ++) in main()
593 if (verbose >= 0) in main()
595 if (!errors && !verbose) in main()
601 attr->value); in main()
606 else if (verbose > 0) in main()
611 if (verbose >= 0) in main()
613 if (!errors && !verbose) in main()
626 ptr = attr->value; in main()
637 if (verbose >= 0) in main()
639 if (!errors && !verbose) in main()
645 attr->value); in main()
650 else if (verbose > 0) in main()
655 if (verbose >= 0) in main()
657 if (!errors && !verbose) in main()
668 if (ppd->lang_encoding != NULL) in main()
670 if (verbose > 0) in main()
675 if (verbose >= 0) in main()
677 if (!errors && !verbose) in main()
682 " REF: Pages 56-57, section 5.3.")); in main()
688 if (ppd->lang_version != NULL) in main()
690 if (verbose > 0) in main()
695 if (verbose >= 0) in main()
697 if (!errors && !verbose) in main()
702 " REF: Pages 57-58, section 5.3.")); in main()
708 if (ppd->manufacturer != NULL) in main()
710 if (!_cups_strncasecmp(ppd->manufacturer, "Hewlett-Packard", 15) || in main()
711 !_cups_strncasecmp(ppd->manufacturer, "Hewlett Packard", 15)) in main()
713 if (verbose >= 0) in main()
715 if (!errors && !verbose) in main()
727 else if (!_cups_strncasecmp(ppd->manufacturer, "OkiData", 7) || in main()
728 !_cups_strncasecmp(ppd->manufacturer, "Oki Data", 8)) in main()
730 if (verbose >= 0) in main()
732 if (!errors && !verbose) in main()
744 else if (verbose > 0) in main()
749 if (verbose >= 0) in main()
751 if (!errors && !verbose) in main()
756 " REF: Pages 58-59, section 5.3.")); in main()
762 if (ppd->modelname != NULL) in main()
764 for (ptr = ppd->modelname; *ptr; ptr ++) in main()
765 if (!isalnum(*ptr & 255) && !strchr(" ./-+", *ptr)) in main()
770 if (verbose >= 0) in main()
772 if (!errors && !verbose) in main()
776 _(" **FAIL** Bad ModelName - \"%c\" not " in main()
778 " REF: Pages 59-60, section 5.3."), in main()
784 else if (verbose > 0) in main()
789 if (verbose >= 0) in main()
791 if (!errors && !verbose) in main()
796 " REF: Pages 59-60, section 5.3.")); in main()
802 if (ppd->nickname != NULL) in main()
804 if (verbose > 0) in main()
809 if (verbose >= 0) in main()
811 if (!errors && !verbose) in main()
824 if (verbose > 0) in main()
829 if (verbose >= 0) in main()
831 if (!errors && !verbose) in main()
836 " REF: Pages 99-100, section 5.14.")); in main()
844 if (verbose > 0) in main()
849 if (verbose >= 0) in main()
851 if (!errors && !verbose) in main()
862 if (ppd->pcfilename != NULL) in main()
864 if (verbose > 0) in main()
869 if (verbose >= 0) in main()
871 if (!errors && !verbose) in main()
876 " REF: Pages 61-62, section 5.3.")); in main()
882 if (ppd->product != NULL) in main()
884 if (ppd->product[0] != '(' || in main()
885 ppd->product[strlen(ppd->product) - 1] != ')') in main()
887 if (verbose >= 0) in main()
889 if (!errors && !verbose) in main()
893 _(" **FAIL** Bad Product - not \"(string)\".\n" in main()
899 else if (verbose > 0) in main()
904 if (verbose >= 0) in main()
906 if (!errors && !verbose) in main()
918 attr->value != NULL) in main()
924 if (sscanf(attr->value, "(%254[^)\n])%d", junkstr, &junkint) != 2) in main()
926 if (verbose >= 0) in main()
928 if (!errors && !verbose) in main()
932 _(" **FAIL** Bad PSVersion - not \"(string) " in main()
934 " REF: Pages 62-64, section 5.3.")); in main()
939 else if (verbose > 0) in main()
944 if (verbose >= 0) in main()
946 if (!errors && !verbose) in main()
951 " REF: Pages 62-64, section 5.3.")); in main()
957 if (ppd->shortnickname != NULL) in main()
959 if (strlen(ppd->shortnickname) > 31) in main()
961 if (verbose >= 0) in main()
963 if (!errors && !verbose) in main()
967 _(" **FAIL** Bad ShortNickName - longer " in main()
969 " REF: Pages 64-65, section 5.3.")); in main()
974 else if (verbose > 0) in main()
979 if (verbose >= 0) in main()
981 if (!errors && !verbose) in main()
986 " REF: Page 64-65, section 5.3.")); in main()
992 if (ppd->patches != NULL && strchr(ppd->patches, '\"') && in main()
993 strstr(ppd->patches, "*End")) in main()
995 if (verbose >= 0) in main()
997 if (!errors && !verbose) in main()
1013 if (ppd->num_sizes == 0) in main()
1015 if (verbose >= 0) in main()
1017 if (!errors && !verbose) in main()
1030 for (j = 0, size = ppd->sizes; j < ppd->num_sizes; j ++, size ++) in main()
1036 if (!strcmp(size->name, "Custom")) in main()
1043 if (size->left == 0.0 && size->bottom == 0.0 && in main()
1044 size->right == 0.0 && size->top == 0.0) in main()
1046 if (verbose >= 0) in main()
1048 if (!errors && !verbose) in main()
1056 size->name); in main()
1066 if (size->width <= 0.0 && size->length <= 0.0) in main()
1068 if (verbose >= 0) in main()
1070 if (!errors && !verbose) in main()
1078 size->name); in main()
1096 for (j = option->num_choices, choice = option->choices; in main()
1098 j --, choice ++) in main()
1105 xdpi = strtol(choice->choice, (char **)&ptr, 10); in main()
1106 if (ptr > choice->choice && xdpi > 0) in main()
1119 if (verbose >= 0) in main()
1121 if (!errors && !verbose) in main()
1127 option->keyword, choice->choice); in main()
1136 strcmp(attr->name, "1284DeviceID")) in main()
1138 if (verbose >= 0) in main()
1140 if (!errors && !verbose) in main()
1146 attr->name); in main()
1152 errors = check_case(ppd, errors, verbose); in main()
1155 errors = check_constraints(ppd, errors, verbose, 0); in main()
1158 errors = check_filters(ppd, root, errors, verbose, 0); in main()
1161 errors = check_profiles(ppd, root, errors, verbose, 0); in main()
1164 errors = check_sizes(ppd, errors, verbose, 0); in main()
1167 errors = check_translations(ppd, errors, verbose, 0); in main()
1170 errors = check_duplex(ppd, errors, verbose, 0); in main()
1173 attr->value) in main()
1182 if (!attr->value || strcmp(attr->value, "ISOLatin1")) in main()
1184 if (!errors && !verbose) in main()
1187 if (verbose >= 0) in main()
1189 _(" **FAIL** Bad LanguageEncoding %s - " in main()
1191 attr->value ? attr->value : "(null)"); in main()
1196 if (!ppd->lang_version || strcmp(ppd->lang_version, "English")) in main()
1198 if (!errors && !verbose) in main()
1201 if (verbose >= 0) in main()
1203 _(" **FAIL** Bad LanguageVersion %s - " in main()
1205 ppd->lang_version ? ppd->lang_version : "(null)"); in main()
1223 for (ptr = option->text; *ptr; ptr ++) in main()
1230 if (!errors && !verbose) in main()
1233 if (verbose >= 0) in main()
1236 "string for option %s contains 8-bit " in main()
1238 option->keyword); in main()
1243 for (j = 0; j < option->num_choices; j ++) in main()
1250 for (ptr = option->choices[j].text; *ptr; ptr ++) in main()
1257 if (!errors && !verbose) in main()
1260 if (verbose >= 0) in main()
1264 "8-bit characters."), in main()
1265 option->keyword, in main()
1266 option->choices[j].choice); in main()
1281 else if (!verbose) in main()
1284 if (verbose >= 0) in main()
1289 errors = check_defaults(ppd, errors, verbose, 1); in main()
1292 errors = check_constraints(ppd, errors, verbose, 1); in main()
1295 errors = check_filters(ppd, root, errors, verbose, 1); in main()
1298 errors = check_profiles(ppd, root, errors, verbose, 1); in main()
1301 errors = check_sizes(ppd, errors, verbose, 1); in main()
1303 errors = check_sizes(ppd, errors, verbose, 2); in main()
1306 errors = check_translations(ppd, errors, verbose, 1); in main()
1309 errors = check_duplex(ppd, errors, verbose, 1); in main()
1324 option->keyword); in main()
1330 for (j = 0; j < ppd->num_attrs; j ++) in main()
1332 attr = ppd->attrs[j]; in main()
1334 if (!strcmp(attr->name, "DefaultColorSpace") || in main()
1335 !strcmp(attr->name, "DefaultColorSep") || in main()
1336 !strcmp(attr->name, "DefaultFont") || in main()
1337 !strcmp(attr->name, "DefaultHalftoneType") || in main()
1338 !strcmp(attr->name, "DefaultImageableArea") || in main()
1339 !strcmp(attr->name, "DefaultLeadingEdge") || in main()
1340 !strcmp(attr->name, "DefaultOutputOrder") || in main()
1341 !strcmp(attr->name, "DefaultPaperDimension") || in main()
1342 !strcmp(attr->name, "DefaultResolution") || in main()
1343 !strcmp(attr->name, "DefaultScreenProc") || in main()
1344 !strcmp(attr->name, "DefaultTransfer")) in main()
1347 if (!strncmp(attr->name, "Default", 7) && in main()
1348 !ppdFindOption(ppd, attr->name + 7)) in main()
1352 attr->name); in main()
1363 if (!ppd->lang_encoding && ppdversion < 41) in main()
1368 " REF: Pages 56-57, section 5.3.")); in main()
1371 if (!ppd->manufacturer && ppdversion < 43) in main()
1376 " REF: Pages 58-59, section 5.3.")); in main()
1384 if (!(ignore & WARN_FILENAME) && ppd->pcfilename) in main()
1386 if (strlen(ppd->pcfilename) > 12) in main()
1391 " REF: Pages 61-62, section " in main()
1395 if (!_cups_strcasecmp(ppd->pcfilename, "unused.ppd")) in main()
1399 " REF: Pages 61-62, section " in main()
1403 if (!ppd->shortnickname && ppdversion < 43) in main()
1408 " REF: Pages 64-65, section 5.3.")); in main()
1416 if (ppd->protocols) in main()
1418 if (strstr(ppd->protocols, "PJL") && in main()
1419 strstr(ppd->protocols, "BCP") && in main()
1420 !strstr(ppd->protocols, "TBCP")) in main()
1425 " REF: Pages 78-79, section 5.7.")); in main()
1428 if (strstr(ppd->protocols, "PJL") && in main()
1429 (!ppd->jcl_begin || !ppd->jcl_end || !ppd->jcl_ps)) in main()
1434 " REF: Pages 78-79, section 5.7.")); in main()
1444 for (j = 0, group = ppd->groups; j < ppd->num_groups; j ++, group ++) in main()
1445 for (k = 0, option = group->options; in main()
1446 k < group->num_options; in main()
1449 len = strlen(option->keyword); in main()
1451 for (m = 0, group2 = ppd->groups; in main()
1452 m < ppd->num_groups; in main()
1454 for (n = 0, option2 = group2->options; in main()
1455 n < group2->num_options; in main()
1458 len < strlen(option2->keyword) && in main()
1459 !strncmp(option->keyword, option2->keyword, len)) in main()
1466 option->keyword, option2->keyword); in main()
1471 if (verbose > 0) in main()
1480 * Then list the options, if "-v" was provided... in main()
1483 if (verbose > 1) in main()
1491 ppd->language_level, in main()
1492 ppd->color_device ? "TRUE" : "FALSE", in main()
1493 ppd->variable_sizes ? "TRUE" : "FALSE", in main()
1494 ppd->landscape); in main()
1496 switch (ppd->colorspace) in main()
1516 ppd->num_emulations); in main()
1517 for (j = 0; j < ppd->num_emulations; j ++) in main()
1519 j, ppd->emulations[j].name); in main()
1522 ppd->lang_encoding); in main()
1524 ppd->lang_version); in main()
1525 _cupsLangPrintf(stdout, " modelname = %s", ppd->modelname); in main()
1527 ppd->ttrasterizer == NULL ? "None" : ppd->ttrasterizer); in main()
1529 ppd->manufacturer); in main()
1530 _cupsLangPrintf(stdout, " product = %s", ppd->product); in main()
1531 _cupsLangPrintf(stdout, " nickname = %s", ppd->nickname); in main()
1533 ppd->shortnickname); in main()
1535 ppd->patches == NULL ? 0 : (int)strlen(ppd->patches)); in main()
1537 _cupsLangPrintf(stdout, " num_groups = %d", ppd->num_groups); in main()
1538 for (j = 0, group = ppd->groups; j < ppd->num_groups; j ++, group ++) in main()
1541 j, group->text); in main()
1543 for (k = 0, option = group->options; k < group->num_options; k ++, option ++) in main()
1548 k, option->keyword, option->text, uis[option->ui], in main()
1549 sections[option->section], option->order, in main()
1550 option->num_choices); in main()
1552 if (!strcmp(option->keyword, "PageSize") || in main()
1553 !strcmp(option->keyword, "PageRegion")) in main()
1555 for (m = option->num_choices, choice = option->choices; in main()
1557 m --, choice ++) in main()
1559 size = ppdPageSize(ppd, choice->choice); in main()
1564 choice->choice, choice->text, in main()
1565 !strcmp(option->defchoice, choice->choice) in main()
1571 choice->choice, choice->text, in main()
1572 size->width / 72.0, size->length / 72.0, in main()
1573 size->left / 72.0, size->bottom / 72.0, in main()
1574 size->right / 72.0, size->top / 72.0, in main()
1575 !strcmp(option->defchoice, choice->choice) in main()
1581 for (m = option->num_choices, choice = option->choices; in main()
1583 m --, choice ++) in main()
1586 choice->choice, choice->text, in main()
1587 !strcmp(option->defchoice, choice->choice) in main()
1595 ppd->num_consts); in main()
1596 for (j = 0; j < ppd->num_consts; j ++) in main()
1599 j, ppd->consts[j].option1, ppd->consts[j].choice1, in main()
1600 ppd->consts[j].option2, ppd->consts[j].choice2); in main()
1603 ppd->num_profiles); in main()
1604 for (j = 0; j < ppd->num_profiles; j ++) in main()
1608 j, ppd->profiles[j].resolution, in main()
1609 ppd->profiles[j].media_type, in main()
1610 ppd->profiles[j].gamma, ppd->profiles[j].density, in main()
1611 ppd->profiles[j].matrix[0][0], in main()
1612 ppd->profiles[j].matrix[0][1], in main()
1613 ppd->profiles[j].matrix[0][2], in main()
1614 ppd->profiles[j].matrix[1][0], in main()
1615 ppd->profiles[j].matrix[1][1], in main()
1616 ppd->profiles[j].matrix[1][2], in main()
1617 ppd->profiles[j].matrix[2][0], in main()
1618 ppd->profiles[j].matrix[2][1], in main()
1619 ppd->profiles[j].matrix[2][2]); in main()
1621 _cupsLangPrintf(stdout, " num_fonts = %d", ppd->num_fonts); in main()
1622 for (j = 0; j < ppd->num_fonts; j ++) in main()
1624 j, ppd->fonts[j]); in main()
1626 _cupsLangPrintf(stdout, " num_attrs = %d", ppd->num_attrs); in main()
1627 for (j = 0; j < ppd->num_attrs; j ++) in main()
1630 ppd->attrs[j]->name, ppd->attrs[j]->spec, in main()
1631 ppd->attrs[j]->text[0] ? "/" : "", in main()
1632 ppd->attrs[j]->text, in main()
1633 ppd->attrs[j]->value ? in main()
1634 ppd->attrs[j]->value : "(null)"); in main()
1648 * 'check_basics()' - Check for CR LF, mixed line endings, and blank lines.
1652 check_basics(const char *filename) /* I - PPD file to check */ in check_basics()
1725 _(" WARN Non-Windows PPD files should use lines " in check_basics()
1733 * 'check_constraints()' - Check UIConstraints in the PPD file.
1736 static int /* O - Errors found */
1737 check_constraints(ppd_file_t *ppd, /* I - PPD file */ in check_constraints()
1738 int errors, /* I - Errors found */ in check_constraints()
1739 int verbose, /* I - Verbosity level */ in check_constraints() argument
1740 int warn) /* I - Warnings only? */ in check_constraints()
1767 * Check new-style cupsUIConstraints data... in check_constraints()
1773 if (!constattr->value) in check_constraints()
1775 if (!warn && !errors && !verbose) in check_constraints()
1780 prefix, constattr->spec); in check_constraints()
1788 for (i = 0, vptr = strchr(constattr->value, '*'); in check_constraints()
1794 if (!warn && !errors && !verbose) in check_constraints()
1799 prefix, constattr->spec, constattr->value); in check_constraints()
1807 cupsArraySave(ppd->sorted_attrs); in check_constraints()
1809 if (constattr->spec[0] && in check_constraints()
1810 !ppdFindAttr(ppd, "cupsUIResolver", constattr->spec)) in check_constraints()
1812 if (!warn && !errors && !verbose) in check_constraints()
1817 prefix, constattr->spec); in check_constraints()
1823 cupsArrayRestore(ppd->sorted_attrs); in check_constraints()
1828 for (vptr = strchr(constattr->value, '*'); in check_constraints()
1837 if (ptr < (option + sizeof(option) - 1)) in check_constraints()
1850 if (ptr < (choice + sizeof(choice) - 1)) in check_constraints()
1864 if (!warn && !errors && !verbose) in check_constraints()
1870 prefix, option, constattr->spec, constattr->value); in check_constraints()
1880 if (!warn && !errors && !verbose) in check_constraints()
1886 prefix, option, choice, constattr->spec, in check_constraints()
1887 constattr->value); in check_constraints()
1899 for (i = 0; i < o->num_choices; i ++) in check_constraints()
1900 if (_cups_strcasecmp(o->choices[i].choice, "None") && in check_constraints()
1901 _cups_strcasecmp(o->choices[i].choice, "Off") && in check_constraints()
1902 _cups_strcasecmp(o->choices[i].choice, "False")) in check_constraints()
1904 num_options = cupsAddOption(option, o->choices[i].choice, in check_constraints()
1917 if (!warn && !errors && !verbose) in check_constraints()
1923 prefix, constattr->spec); in check_constraints()
1935 if (!warn && !errors && !verbose) in check_constraints()
1940 prefix, constattr->spec); in check_constraints()
1952 * Check old-style [Non]UIConstraints data... in check_constraints()
1955 for (i = ppd->num_consts, c = ppd->consts; i > 0; i --, c ++) in check_constraints()
1957 if (!_cups_strncasecmp(c->option1, "Custom", 6) && in check_constraints()
1958 !_cups_strcasecmp(c->choice1, "True")) in check_constraints()
1960 strlcpy(option, c->option1 + 6, sizeof(option)); in check_constraints()
1965 strlcpy(option, c->option1, sizeof(option)); in check_constraints()
1966 strlcpy(choice, c->choice1, sizeof(choice)); in check_constraints()
1971 if (!warn && !errors && !verbose) in check_constraints()
1977 prefix, c->option1, in check_constraints()
1978 c->option1, c->choice1, c->option2, c->choice2); in check_constraints()
1985 if (!warn && !errors && !verbose) in check_constraints()
1991 prefix, c->option1, c->choice1, in check_constraints()
1992 c->option1, c->choice1, c->option2, c->choice2); in check_constraints()
1998 if (!_cups_strncasecmp(c->option2, "Custom", 6) && in check_constraints()
1999 !_cups_strcasecmp(c->choice2, "True")) in check_constraints()
2001 strlcpy(option, c->option2 + 6, sizeof(option)); in check_constraints()
2006 strlcpy(option, c->option2, sizeof(option)); in check_constraints()
2007 strlcpy(choice, c->choice2, sizeof(choice)); in check_constraints()
2012 if (!warn && !errors && !verbose) in check_constraints()
2018 prefix, c->option2, in check_constraints()
2019 c->option1, c->choice1, c->option2, c->choice2); in check_constraints()
2026 if (!warn && !errors && !verbose) in check_constraints()
2032 prefix, c->option2, c->choice2, in check_constraints()
2033 c->option1, c->choice1, c->option2, c->choice2); in check_constraints()
2046 * 'check_case()' - Check that there are no duplicate groups, options,
2050 static int /* O - Errors found */
2051 check_case(ppd_file_t *ppd, /* I - PPD file */ in check_case()
2052 int errors, /* I - Errors found */ in check_case()
2053 int verbose) /* I - Verbosity level */ in check_case() argument
2068 for (i = ppd->num_groups, groupa = ppd->groups; i > 1; i --, groupa ++) in check_case()
2069 for (j = i - 1, groupb = groupa + 1; j > 0; j --, groupb ++) in check_case()
2070 if (!_cups_strcasecmp(groupa->name, groupb->name)) in check_case()
2072 if (!errors && !verbose) in check_case()
2075 if (verbose >= 0) in check_case()
2079 groupa->name, groupb->name); in check_case()
2090 cupsArraySave(ppd->options); in check_case()
2092 if (!_cups_strcasecmp(optiona->keyword, optionb->keyword)) in check_case()
2094 if (!errors && !verbose) in check_case()
2097 if (verbose >= 0) in check_case()
2101 optiona->keyword, optionb->keyword); in check_case()
2105 cupsArrayRestore(ppd->options); in check_case()
2111 for (i = optiona->num_choices, choicea = optiona->choices; in check_case()
2113 i --, choicea ++) in check_case()
2114 for (j = i - 1, choiceb = choicea + 1; j > 0; j --, choiceb ++) in check_case()
2115 if (!strcmp(choicea->choice, choiceb->choice)) in check_case()
2117 if (!errors && !verbose) in check_case()
2120 if (verbose >= 0) in check_case()
2124 optiona->keyword, choicea->choice); in check_case()
2129 i --; in check_case()
2132 else if (!_cups_strcasecmp(choicea->choice, choiceb->choice)) in check_case()
2134 if (!errors && !verbose) in check_case()
2137 if (verbose >= 0) in check_case()
2141 optiona->keyword, choicea->choice, choiceb->choice); in check_case()
2156 * 'check_defaults()' - Check default option keywords in the PPD file.
2159 static int /* O - Errors found */
2160 check_defaults(ppd_file_t *ppd, /* I - PPD file */ in check_defaults()
2161 int errors, /* I - Errors found */ in check_defaults()
2162 int verbose, /* I - Verbosity level */ in check_defaults() argument
2163 int warn) /* I - Warnings only? */ in check_defaults()
2176 if (!warn && !errors && !verbose) in check_defaults()
2179 if (verbose >= 0) in check_defaults()
2189 for (j = 0; j < ppd->num_attrs; j ++) in check_defaults()
2191 attr = ppd->attrs[j]; in check_defaults()
2193 if (!strcmp(attr->name, "DefaultColorSpace") || in check_defaults()
2194 !strcmp(attr->name, "DefaultFont") || in check_defaults()
2195 !strcmp(attr->name, "DefaultHalftoneType") || in check_defaults()
2196 !strcmp(attr->name, "DefaultImageableArea") || in check_defaults()
2197 !strcmp(attr->name, "DefaultLeadingEdge") || in check_defaults()
2198 !strcmp(attr->name, "DefaultOutputOrder") || in check_defaults()
2199 !strcmp(attr->name, "DefaultPaperDimension") || in check_defaults()
2200 !strcmp(attr->name, "DefaultResolution") || in check_defaults()
2201 !strcmp(attr->name, "DefaultTransfer")) in check_defaults()
2204 if (!strncmp(attr->name, "Default", 7)) in check_defaults()
2206 if ((option = ppdFindOption(ppd, attr->name + 7)) != NULL && in check_defaults()
2207 strcmp(attr->value, "Unknown")) in check_defaults()
2213 for (k = 0; k < option->num_choices; k ++) in check_defaults()
2214 if (!strcmp(option->choices[k].choice, attr->value)) in check_defaults()
2217 if (k >= option->num_choices) in check_defaults()
2219 if (!warn && !errors && !verbose) in check_defaults()
2222 if (verbose >= 0) in check_defaults()
2225 prefix, attr->name, attr->value); in check_defaults()
2239 * 'check_duplex()' - Check duplex keywords in the PPD file.
2242 static int /* O - Errors found */
2243 check_duplex(ppd_file_t *ppd, /* I - PPD file */ in check_duplex()
2244 int errors, /* I - Error found */ in check_duplex()
2245 int verbose, /* I - Verbosity level */ in check_duplex() argument
2246 int warn) /* I - Warnings only? */ in check_duplex()
2264 if (verbose >= 0) in check_duplex()
2266 if (!warn && !errors && !verbose) in check_duplex()
2273 prefix, option->keyword); in check_duplex()
2280 for (i = option->num_choices, choice = option->choices; in check_duplex()
2282 i --, choice ++) in check_duplex()
2283 if (strcmp(choice->choice, "None") && in check_duplex()
2284 strcmp(choice->choice, "DuplexNoTumble") && in check_duplex()
2285 strcmp(choice->choice, "DuplexTumble") && in check_duplex()
2286 strcmp(choice->choice, "SimplexTumble")) in check_duplex()
2288 if (verbose >= 0) in check_duplex()
2290 if (!warn && !errors && !verbose) in check_duplex()
2296 prefix, option->keyword, choice->choice); in check_duplex()
2309 * 'check_filters()' - Check filters in the PPD file.
2312 static int /* O - Errors found */
2313 check_filters(ppd_file_t *ppd, /* I - PPD file */ in check_filters()
2314 const char *root, /* I - Root directory */ in check_filters()
2315 int errors, /* I - Errors found */ in check_filters()
2316 int verbose, /* I - Verbosity level */ in check_filters() argument
2317 int warn) /* I - Warnings only? */ in check_filters()
2321 char super[16], /* Super-type for filter */ in check_filters()
2323 dstsuper[16], /* Destination super-type for filter */ in check_filters()
2342 if (strcmp(attr->name, "cupsFilter")) in check_filters()
2344 if (!warn && !errors && !verbose) in check_filters()
2347 if (verbose >= 0) in check_filters()
2349 _(" %s Bad spelling of %s - should be %s."), in check_filters()
2350 prefix, attr->name, "cupsFilter"); in check_filters()
2356 if (!attr->value || in check_filters()
2357 sscanf(attr->value, "%15[^/]/%255s%d%*[ \t]%1023[^\n]", super, type, in check_filters()
2360 if (!warn && !errors && !verbose) in check_filters()
2363 if (verbose >= 0) in check_filters()
2366 prefix, attr->value); in check_filters()
2382 if (!warn && !errors && !verbose) in check_filters()
2385 if (verbose >= 0) in check_filters()
2388 prefix, attr->value); in check_filters()
2403 if (strcmp(program, "-")) in check_filters()
2422 if (!warn && !errors && !verbose) in check_filters()
2425 if (verbose >= 0) in check_filters()
2436 if (!warn && !errors && !verbose) in check_filters()
2439 if (verbose >= 0) in check_filters()
2448 errors = valid_path("cupsFilter", pathprog, errors, verbose, warn); in check_filters()
2460 if (strcmp(attr->name, "cupsFilter2")) in check_filters()
2462 if (!warn && !errors && !verbose) in check_filters()
2465 if (verbose >= 0) in check_filters()
2467 _(" %s Bad spelling of %s - should be %s."), in check_filters()
2468 prefix, attr->name, "cupsFilter2"); in check_filters()
2474 if (!attr->value || in check_filters()
2475 sscanf(attr->value, "%15[^/]/%255s%*[ \t]%15[^/]/%255s%d%*[ \t]%1023[^\n]", in check_filters()
2478 if (!warn && !errors && !verbose) in check_filters()
2481 if (verbose >= 0) in check_filters()
2484 prefix, attr->value); in check_filters()
2500 if (!warn && !errors && !verbose) in check_filters()
2503 if (verbose >= 0) in check_filters()
2506 prefix, attr->value); in check_filters()
2521 if (strcmp(program, "-")) in check_filters()
2550 if (!warn && !errors && !verbose) in check_filters()
2553 if (verbose >= 0) in check_filters()
2564 if (!warn && !errors && !verbose) in check_filters()
2567 if (verbose >= 0) in check_filters()
2576 errors = valid_path("cupsFilter2", pathprog, errors, verbose, warn); in check_filters()
2588 if (strcmp(attr->name, "cupsPreFilter")) in check_filters()
2590 if (!warn && !errors && !verbose) in check_filters()
2593 if (verbose >= 0) in check_filters()
2595 _(" %s Bad spelling of %s - should be %s."), in check_filters()
2596 prefix, attr->name, "cupsPreFilter"); in check_filters()
2602 if (!attr->value || in check_filters()
2603 sscanf(attr->value, "%15[^/]/%255s%d%*[ \t]%1023[^\n]", super, type, in check_filters()
2606 if (!warn && !errors && !verbose) in check_filters()
2609 if (verbose >= 0) in check_filters()
2612 prefix, attr->value ? attr->value : ""); in check_filters()
2617 else if (strcmp(program, "-")) in check_filters()
2636 if (!warn && !errors && !verbose) in check_filters()
2639 if (verbose >= 0) in check_filters()
2650 if (!warn && !errors && !verbose) in check_filters()
2653 if (verbose >= 0) in check_filters()
2662 errors = valid_path("cupsPreFilter", pathprog, errors, verbose, warn); in check_filters()
2675 if (strcmp(attr->name, "APDialogExtension")) in check_filters()
2677 if (!warn && !errors && !verbose) in check_filters()
2680 if (verbose >= 0) in check_filters()
2682 _(" %s Bad spelling of %s - should be %s."), in check_filters()
2683 prefix, attr->name, "APDialogExtension"); in check_filters()
2690 attr->value ? attr->value : "(null)"); in check_filters()
2692 if (!attr->value || stat(pathprog, &fileinfo)) in check_filters()
2694 if (!warn && !errors && !verbose) in check_filters()
2697 if (verbose >= 0) in check_filters()
2708 if (!warn && !errors && !verbose) in check_filters()
2711 if (verbose >= 0) in check_filters()
2720 errors = valid_path("APDialogExtension", pathprog, errors, verbose, in check_filters()
2730 if (strcmp(attr->name, "APPrinterIconPath")) in check_filters()
2732 if (!warn && !errors && !verbose) in check_filters()
2735 if (verbose >= 0) in check_filters()
2737 _(" %s Bad spelling of %s - should be %s."), in check_filters()
2738 prefix, attr->name, "APPrinterIconPath"); in check_filters()
2745 attr->value ? attr->value : "(null)"); in check_filters()
2747 if (!attr->value || stat(pathprog, &fileinfo)) in check_filters()
2749 if (!warn && !errors && !verbose) in check_filters()
2752 if (verbose >= 0) in check_filters()
2763 if (!warn && !errors && !verbose) in check_filters()
2766 if (verbose >= 0) in check_filters()
2775 errors = valid_path("APPrinterIconPath", pathprog, errors, verbose, in check_filters()
2785 if (strcmp(attr->name, "APPrinterLowInkTool")) in check_filters()
2787 if (!warn && !errors && !verbose) in check_filters()
2790 if (verbose >= 0) in check_filters()
2792 _(" %s Bad spelling of %s - should be %s."), in check_filters()
2793 prefix, attr->name, "APPrinterLowInkTool"); in check_filters()
2800 attr->value ? attr->value : "(null)"); in check_filters()
2802 if (!attr->value || stat(pathprog, &fileinfo)) in check_filters()
2804 if (!warn && !errors && !verbose) in check_filters()
2807 if (verbose >= 0) in check_filters()
2818 if (!warn && !errors && !verbose) in check_filters()
2821 if (verbose >= 0) in check_filters()
2830 errors = valid_path("APPrinterLowInkTool", pathprog, errors, verbose, in check_filters()
2840 if (strcmp(attr->name, "APPrinterUtilityPath")) in check_filters()
2842 if (!warn && !errors && !verbose) in check_filters()
2845 if (verbose >= 0) in check_filters()
2847 _(" %s Bad spelling of %s - should be %s."), in check_filters()
2848 prefix, attr->name, "APPrinterUtilityPath"); in check_filters()
2855 attr->value ? attr->value : "(null)"); in check_filters()
2857 if (!attr->value || stat(pathprog, &fileinfo)) in check_filters()
2859 if (!warn && !errors && !verbose) in check_filters()
2862 if (verbose >= 0) in check_filters()
2873 if (!warn && !errors && !verbose) in check_filters()
2876 if (verbose >= 0) in check_filters()
2885 errors = valid_path("APPrinterUtilityPath", pathprog, errors, verbose, in check_filters()
2895 if (strcmp(attr->name, "APScanAppPath")) in check_filters()
2897 if (!warn && !errors && !verbose) in check_filters()
2900 if (verbose >= 0) in check_filters()
2902 _(" %s Bad spelling of %s - should be %s."), in check_filters()
2903 prefix, attr->name, "APScanAppPath"); in check_filters()
2909 if (!attr->value || stat(attr->value, &fileinfo)) in check_filters()
2911 if (!warn && !errors && !verbose) in check_filters()
2914 if (verbose >= 0) in check_filters()
2917 attr->value ? attr->value : "<NULL>"); in check_filters()
2926 if (!warn && !errors && !verbose) in check_filters()
2929 if (verbose >= 0) in check_filters()
2932 prefix, "APScanAppPath", attr->value); in check_filters()
2938 errors = valid_path("APScanAppPath", attr->value, errors, verbose, in check_filters()
2943 if (!warn && !errors && !verbose) in check_filters()
2946 if (verbose >= 0) in check_filters()
2962 * 'check_profiles()' - Check ICC color profiles in the PPD file.
2965 static int /* O - Errors found */
2966 check_profiles(ppd_file_t *ppd, /* I - PPD file */ in check_profiles()
2967 const char *root, /* I - Root directory */ in check_profiles()
2968 int errors, /* I - Errors found */ in check_profiles()
2969 int verbose, /* I - Verbosity level */ in check_profiles() argument
2970 int warn) /* I - Warnings only? */ in check_profiles()
2994 for (i = 0, ptr = strchr(attr->spec, '.'); ptr; ptr = strchr(ptr + 1, '.')) in check_profiles()
2997 if (!attr->value || i < 2) in check_profiles()
2999 if (!warn && !errors && !verbose) in check_profiles()
3002 if (verbose >= 0) in check_profiles()
3005 prefix, attr->spec); in check_profiles()
3017 if (attr->value[0] == '/') in check_profiles()
3018 snprintf(filename, sizeof(filename), "%s%s", root, attr->value); in check_profiles()
3026 attr->value); in check_profiles()
3029 attr->value); in check_profiles()
3034 if (!warn && !errors && !verbose) in check_profiles()
3037 if (verbose >= 0) in check_profiles()
3048 if (!warn && !errors && !verbose) in check_profiles()
3051 if (verbose >= 0) in check_profiles()
3060 errors = valid_path("cupsICCProfile", filename, errors, verbose, warn); in check_profiles()
3066 hash = _ppdHashName(attr->spec); in check_profiles()
3076 if (!warn && !errors && !verbose) in check_profiles()
3079 if (verbose >= 0) in check_profiles()
3082 "collides with %s."), prefix, attr->spec, in check_profiles()
3097 specs[num_profiles] = attr->spec; in check_profiles()
3107 * 'check_sizes()' - Check media sizes in the PPD file.
3110 static int /* O - Errors found */
3111 check_sizes(ppd_file_t *ppd, /* I - PPD file */ in check_sizes()
3112 int errors, /* I - Errors found */ in check_sizes()
3113 int verbose, /* I - Verbosity level */ in check_sizes() argument
3114 int warn) /* I - Warnings only? */ in check_sizes()
3141 if (!warn && !errors && !verbose) in check_sizes()
3144 if (verbose >= 0) in check_sizes()
3156 if (!warn && !errors && !verbose) in check_sizes()
3159 if (verbose >= 0) in check_sizes()
3169 for (i = ppd->num_sizes, size = ppd->sizes; i > 0; i --, size ++) in check_sizes()
3175 if (!strcmp(size->name, "Custom")) in check_sizes()
3184 if (warn != 2 && size->name[0] == 'w' && in check_sizes()
3185 sscanf(size->name, "w%dh%d", &width, &length) == 2) in check_sizes()
3188 * Validate device-specific size wNNNhNNN should have proper width and in check_sizes()
3192 if (fabs(width - size->width) >= 1.0 || in check_sizes()
3193 fabs(length - size->length) >= 1.0) in check_sizes()
3195 if (!warn && !errors && !verbose) in check_sizes()
3198 if (verbose >= 0) in check_sizes()
3202 prefix, size->name, size->width, size->length); in check_sizes()
3213 if (warn != 2 && !ppdFindChoice(page_size, size->name)) in check_sizes()
3215 if (!warn && !errors && !verbose) in check_sizes()
3218 if (verbose >= 0) in check_sizes()
3222 prefix, size->name, "PageRegion", "PageSize"); in check_sizes()
3227 else if (warn != 2 && !ppdFindChoice(page_region, size->name)) in check_sizes()
3229 if (!warn && !errors && !verbose) in check_sizes()
3232 if (verbose >= 0) in check_sizes()
3236 prefix, size->name, "PageSize", "PageRegion"); in check_sizes()
3252 width_2540ths = (size->length > size->width) ? in check_sizes()
3253 PWG_FROM_POINTS(size->width) : in check_sizes()
3254 PWG_FROM_POINTS(size->length); in check_sizes()
3255 length_2540ths = (size->length > size->width) ? in check_sizes()
3256 PWG_FROM_POINTS(size->length) : in check_sizes()
3257 PWG_FROM_POINTS(size->width); in check_sizes()
3261 (abs(pwg_media->width - width_2540ths) > 34 || in check_sizes()
3262 abs(pwg_media->length - length_2540ths) > 34)) in check_sizes()
3265 if (pwg_media && pwg_media->ppd && in check_sizes()
3266 (pwg_media->ppd[0] < 'a' || pwg_media->ppd[0] > 'z')) in check_sizes()
3268 size_t ppdlen = strlen(pwg_media->ppd); in check_sizes()
3271 strlcpy(buf, pwg_media->ppd, sizeof(buf)); in check_sizes()
3273 if (strcmp(size->name, buf) && size->width > size->length) in check_sizes()
3275 if (!strcmp(pwg_media->ppd, "DoublePostcardRotated")) in check_sizes()
3277 else if (strstr(size->name, ".Transverse")) in check_sizes()
3278 snprintf(buf, sizeof(buf), "%s.Transverse", pwg_media->ppd); in check_sizes()
3280 snprintf(buf, sizeof(buf), "%sRotated", pwg_media->ppd); in check_sizes()
3285 if (size->left == 0 && size->bottom == 0 && in check_sizes()
3286 size->right == size->width && size->top == size->length) in check_sizes()
3288 strlcat(buf, ".Fullbleed", sizeof(buf) - strlen(buf)); in check_sizes()
3289 if (_cups_strcasecmp(size->name, buf)) in check_sizes()
3297 if (_cups_strncasecmp(size->name, buf, buflen) || in check_sizes()
3298 size->name[buflen] != '.') in check_sizes()
3302 else if (!strncmp(size->name, pwg_media->ppd, ppdlen)) in check_sizes()
3308 ptr = size->name + ppdlen; in check_sizes()
3330 if (strncmp(pwg_media->ppd, "Env", 3) && in check_sizes()
3331 !strncmp(size->name, "Env", 3)) in check_sizes()
3332 snprintf(buf, sizeof(buf), "Env%s", pwg_media->ppd); in check_sizes()
3334 if (strcmp(size->name, buf)) in check_sizes()
3342 prefix, size->name, buf); in check_sizes()
3346 width_tmp = (fabs(size->width - ceil(size->width)) < 0.1) ? in check_sizes()
3347 ceil(size->width) : size->width; in check_sizes()
3348 length_tmp = (fabs(size->length - ceil(size->length)) < 0.1) ? in check_sizes()
3349 ceil(size->length) : size->length; in check_sizes()
3360 width_mm = size->width / 72.0 * 25.4; in check_sizes()
3361 length_mm = size->length / 72.0 * 25.4; in check_sizes()
3366 if (size->left == 0 && size->bottom == 0 && in check_sizes()
3367 size->right == size->width && size->top == size->length) in check_sizes()
3369 else if (size->width > size->length) in check_sizes()
3372 if (_cups_strcasecmp(size->name, buf)) in check_sizes()
3377 if (_cups_strncasecmp(size->name, buf, buflen) || in check_sizes()
3378 (strcmp(size->name + buflen, "in") && in check_sizes()
3379 size->name[buflen] != '.')) in check_sizes()
3385 snprintf(altbuf, sizeof(altbuf), "w%.0fh%.0f", size->width, in check_sizes()
3386 size->length); in check_sizes()
3388 if (_cups_strncasecmp(size->name, altbuf, altlen) || in check_sizes()
3389 (size->name[altlen] && size->name[altlen] != '.')) in check_sizes()
3392 prefix, size->name, buf); in check_sizes()
3404 * 'check_translations()' - Check translations in the PPD file.
3407 static int /* O - Errors found */
3408 check_translations(ppd_file_t *ppd, /* I - PPD file */ in check_translations()
3409 int errors, /* I - Errors found */ in check_translations()
3410 int verbose, /* I - Verbosity level */ in check_translations() argument
3411 int warn) /* I - Warnings only? */ in check_translations()
3446 if (!warn && !errors && !verbose) in check_translations()
3449 if (verbose >= 0) in check_translations()
3473 if (!strcmp(option->keyword, "PageRegion")) in check_translations()
3479 if ((attr = ppdFindAttr(ppd, keyword, option->keyword)) == NULL && in check_translations()
3480 (attr = ppdFindAttr(ppd, llkeyword, option->keyword)) == NULL) in check_translations()
3482 if (!warn && !errors && !verbose) in check_translations()
3485 if (verbose >= 0) in check_translations()
3489 prefix, language, option->keyword); in check_translations()
3494 else if (!valid_utf8(attr->text)) in check_translations()
3496 if (!warn && !errors && !verbose) in check_translations()
3499 if (verbose >= 0) in check_translations()
3501 _(" %s Bad UTF-8 \"%s\" translation " in check_translations()
3503 prefix, language, option->keyword); in check_translations()
3510 option->keyword); in check_translations()
3512 option->keyword); in check_translations()
3514 for (j = 0; j < option->num_choices; j ++) in check_translations()
3521 for (text = option->choices[j].text; *text; text ++) in check_translations()
3522 if (!strchr("0123456789-+.", *text)) in check_translations()
3532 if (!_cups_strcasecmp(option->choices[j].choice, "Custom") && in check_translations()
3534 option->keyword)) != NULL) in check_translations()
3537 language, option->keyword); in check_translations()
3540 !valid_utf8(attr->text)) in check_translations()
3542 if (!warn && !errors && !verbose) in check_translations()
3545 if (verbose >= 0) in check_translations()
3547 _(" %s Bad UTF-8 \"%s\" " in check_translations()
3558 if (_cups_strcasecmp(option->keyword, "PageSize")) in check_translations()
3560 for (cparam = (ppd_cparam_t *)cupsArrayFirst(coption->params); in check_translations()
3562 cparam = (ppd_cparam_t *)cupsArrayNext(coption->params)) in check_translations()
3565 language, option->keyword); in check_translations()
3567 ll, option->keyword); in check_translations()
3570 cparam->name)) == NULL && in check_translations()
3572 cparam->name)) == NULL) in check_translations()
3574 if (!warn && !errors && !verbose) in check_translations()
3577 if (verbose >= 0) in check_translations()
3584 cparam->name); in check_translations()
3589 else if (!valid_utf8(attr->text)) in check_translations()
3591 if (!warn && !errors && !verbose) in check_translations()
3594 if (verbose >= 0) in check_translations()
3596 _(" %s Bad UTF-8 \"%s\" " in check_translations()
3601 cparam->name); in check_translations()
3610 option->choices[j].choice)) == NULL && in check_translations()
3612 option->choices[j].choice)) == NULL) in check_translations()
3614 if (!warn && !errors && !verbose) in check_translations()
3617 if (verbose >= 0) in check_translations()
3622 prefix, language, option->keyword, in check_translations()
3623 option->choices[j].choice); in check_translations()
3628 else if (!valid_utf8(attr->text)) in check_translations()
3630 if (!warn && !errors && !verbose) in check_translations()
3633 if (verbose >= 0) in check_translations()
3635 _(" %s Bad UTF-8 \"%s\" " in check_translations()
3638 prefix, language, option->keyword, in check_translations()
3639 option->choices[j].choice); in check_translations()
3668 if (!warn && !errors && !verbose) in check_translations()
3671 if (verbose >= 0) in check_translations()
3695 * 'show_conflicts()' - Show option conflicts in a PPD file.
3699 show_conflicts(ppd_file_t *ppd, /* I - PPD to check */ in show_conflicts()
3700 const char *prefix) /* I - Prefix string */ in show_conflicts()
3713 for (i = ppd->num_consts, c = ppd->consts; i > 0; i --, c ++) in show_conflicts()
3719 o1 = ppdFindOption(ppd, c->option1); in show_conflicts()
3723 else if (c->choice1[0] != '\0') in show_conflicts()
3729 c1 = ppdFindChoice(o1, c->choice1); in show_conflicts()
3737 for (j = o1->num_choices, c1 = o1->choices; j > 0; j --, c1 ++) in show_conflicts()
3738 if (c1->marked) in show_conflicts()
3742 !_cups_strcasecmp(c1->choice, "None") || in show_conflicts()
3743 !_cups_strcasecmp(c1->choice, "Off") || in show_conflicts()
3744 !_cups_strcasecmp(c1->choice, "False")) in show_conflicts()
3752 o2 = ppdFindOption(ppd, c->option2); in show_conflicts()
3756 else if (c->choice2[0] != '\0') in show_conflicts()
3762 c2 = ppdFindChoice(o2, c->choice2); in show_conflicts()
3770 for (j = o2->num_choices, c2 = o2->choices; j > 0; j --, c2 ++) in show_conflicts()
3771 if (c2->marked) in show_conflicts()
3775 !_cups_strcasecmp(c2->choice, "None") || in show_conflicts()
3776 !_cups_strcasecmp(c2->choice, "Off") || in show_conflicts()
3777 !_cups_strcasecmp(c2->choice, "False")) in show_conflicts()
3785 if (c1 != NULL && c1->marked && c2 != NULL && c2->marked) in show_conflicts()
3789 prefix, o1->keyword, c1->choice, o2->keyword, c2->choice, in show_conflicts()
3790 c->option1, c->choice1, c->option2, c->choice2); in show_conflicts()
3796 * 'test_raster()' - Test PostScript commands for raster printers.
3799 static int /* O - 1 on success, 0 on failure */
3800 test_raster(ppd_file_t *ppd, /* I - PPD file */ in test_raster()
3801 int verbose) /* I - Verbosity */ in test_raster() argument
3809 if (!verbose) in test_raster()
3812 if (verbose >= 0) in test_raster()
3831 if (!verbose) in test_raster()
3834 if (verbose >= 0) in test_raster()
3847 * 'usage()' - Show program usage.
3855 " program | cupstestppd [options] -")); in usage()
3857 _cupsLangPuts(stdout, _("-I {filename,filters,none,profiles}\n" in usage()
3859 _cupsLangPuts(stdout, _("-R root-directory Set alternate root")); in usage()
3860 …_cupsLangPuts(stdout, _("-W {all,none,constraints,defaults,duplex,filters,profiles,sizes,translati… in usage()
3862 _cupsLangPuts(stdout, _("-q Run silently")); in usage()
3863 _cupsLangPuts(stdout, _("-r Use 'relaxed' open mode")); in usage()
3864 _cupsLangPuts(stdout, _("-v Be verbose")); in usage()
3865 _cupsLangPuts(stdout, _("-vv Be very verbose")); in usage()
3872 * 'valid_path()' - Check whether a path has the correct capitalization.
3875 static int /* O - Errors found */
3876 valid_path(const char *keyword, /* I - Keyword using path */ in valid_path()
3877 const char *path, /* I - Path to check */ in valid_path()
3878 int errors, /* I - Errors found */ in valid_path()
3879 int verbose, /* I - Verbosity level */ in valid_path() argument
3880 int warn) /* I - Warnings only? */ in valid_path()
3921 if (!strcmp(dentry->filename, ptr)) in valid_path()
3935 if (!warn && !errors && !verbose) in valid_path()
3938 if (verbose >= 0) in valid_path()
3955 * 'valid_utf8()' - Check whether a string contains valid UTF-8 text.
3958 static int /* O - 1 if valid, 0 if not */
3959 valid_utf8(const char *s) /* I - String to check */ in valid_utf8()
3966 * Check for valid UTF-8 sequence... in valid_utf8()
3974 * 2-byte sequence... in valid_utf8()
3985 * 3-byte sequence... in valid_utf8()
4001 * 4-byte sequence... in valid_utf8()