/*
- * "$Id$"
+ * PPD test program for CUPS.
*
- * PPD test program for CUPS.
+ * Copyright 2007-2016 by Apple Inc.
+ * Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
- * Copyright 2007-2013 by Apple Inc.
- * Copyright 1997-2007 by Easy Software Products, all rights reserved.
+ * These coded instructions, statements, and computer programs are the
+ * property of Apple Inc. and are protected by Federal copyright
+ * law. Distribution and use rights are outlined in the file "LICENSE.txt"
+ * which should have been included with this file. If this file is
+ * file is missing or damaged, see the license at "http://www.cups.org/".
*
- * These coded instructions, statements, and computer programs are the
- * property of Apple Inc. and are protected by Federal copyright
- * law. Distribution and use rights are outlined in the file "LICENSE.txt"
- * which should have been included with this file. If this file is
- * file is missing or damaged, see the license at "http://www.cups.org/".
+ * PostScript is a trademark of Adobe Systems, Inc.
*
- * PostScript is a trademark of Adobe Systems, Inc.
- *
- * This file is subject to the Apple OS-Developed Software exception.
- *
- * Contents:
- *
- * main() - Main entry for test program.
- * check_basics() - Check for CR LF, mixed line endings, and blank
- * lines.
- * check_constraints() - Check UIConstraints in the PPD file.
- * check_case() - Check that there are no duplicate groups, options,
- * or choices that differ only by case.
- * check_defaults() - Check default option keywords in the PPD file.
- * check_duplex() - Check duplex keywords in the PPD file.
- * check_filters() - Check filters in the PPD file.
- * check_profiles() - Check ICC color profiles in the PPD file.
- * check_sizes() - Check media sizes in the PPD file.
- * check_translations() - Check translations in the PPD file.
- * show_conflicts() - Show option conflicts in a PPD file.
- * test_raster() - Test PostScript commands for raster printers.
- * usage() - Show program usage.
- * valid_path() - Check whether a path has the correct capitalization.
- * valid_utf8() - Check whether a string contains valid UTF-8 text.
+ * This file is subject to the Apple OS-Developed Software exception.
*/
/*
if (!warn)
errors ++;
+
+ continue;
}
- else if (strcmp(program, "-"))
+
+ if (!strncmp(program, "maxsize(", 8))
+ {
+ char *mptr; /* Pointer into maxsize(nnnn) program */
+
+ strtoll(program + 8, &mptr, 10);
+
+ if (*mptr != ')')
+ {
+ if (!warn && !errors && !verbose)
+ _cupsLangPuts(stdout, _(" FAIL"));
+
+ if (verbose >= 0)
+ _cupsLangPrintf(stdout,
+ _(" %s Bad cupsFilter value \"%s\"."),
+ prefix, attr->value);
+
+ if (!warn)
+ errors ++;
+
+ continue;
+ }
+
+ mptr ++;
+ while (_cups_isspace(*mptr))
+ mptr ++;
+
+ _cups_strcpy(program, mptr);
+ }
+
+ if (strcmp(program, "-"))
{
if (program[0] == '/')
snprintf(pathprog, sizeof(pathprog), "%s%s", root, program);
if (!warn)
errors ++;
+
+ continue;
}
- else if (strcmp(program, "-"))
+
+ if (!strncmp(program, "maxsize(", 8))
+ {
+ char *mptr; /* Pointer into maxsize(nnnn) program */
+
+ strtoll(program + 8, &mptr, 10);
+
+ if (*mptr != ')')
+ {
+ if (!warn && !errors && !verbose)
+ _cupsLangPuts(stdout, _(" FAIL"));
+
+ if (verbose >= 0)
+ _cupsLangPrintf(stdout,
+ _(" %s Bad cupsFilter2 value \"%s\"."),
+ prefix, attr->value);
+
+ if (!warn)
+ errors ++;
+
+ continue;
+ }
+
+ mptr ++;
+ while (_cups_isspace(*mptr))
+ mptr ++;
+
+ _cups_strcpy(program, mptr);
+ }
+
+ if (strcmp(program, "-"))
{
if (strncmp(program, "maxsize(", 8) &&
(ptr = strchr(program + 8, ')')) != NULL)
const char *prefix; /* WARN/FAIL prefix */
ppd_option_t *page_size, /* PageSize option */
*page_region; /* PageRegion option */
- _pwg_media_t *pwg_media; /* PWG media */
+ pwg_media_t *pwg_media; /* PWG media */
char buf[PPD_MAX_NAME]; /* PapeSize name that is supposed to be */
const char *ptr; /* Pointer into string */
int width_2540ths, /* PageSize width in 2540ths */
pwg_media = pwgMediaForSize(width_2540ths, length_2540ths);
if (pwg_media &&
- (fabs(pwg_media->width - width_2540ths) > 34 ||
- fabs(pwg_media->length - length_2540ths) > 34))
+ (abs(pwg_media->width - width_2540ths) > 34 ||
+ abs(pwg_media->length - length_2540ths) > 34))
pwg_media = NULL; /* Only flag matches within a point */
if (pwg_media && pwg_media->ppd &&
return (1);
}
-
-
-/*
- * End of "$Id$".
- */