/*
- * "$Id: ipp.c,v 1.73 2003/02/07 12:03:43 mike Exp $"
+ * "$Id: ipp.c,v 1.74 2003/02/20 03:49:48 mike Exp $"
*
* IPP backend for the Common UNIX Printing System (CUPS).
*
close(fd);
}
-#ifdef __APPLE__
- else if (strcasecmp(content_type, "application/pictwps") == 0)
- {
- /*
- * Convert to PostScript...
- */
-
- if (run_pictwps_filter(argv, filename, sizeof(filename)))
- return (1);
-
- /*
- * Change the MIME type to application/vnd.cups-postscript...
- */
-
- content_type = "application/postscript";
- }
-#endif /* __APPLE__ */
else
strlcpy(filename, argv[6], sizeof(filename));
options = NULL;
num_options = cupsParseOptions(argv[5], 0, &options);
+#ifdef __APPLE__
+ if (content_type != NULL && strcasecmp(content_type, "application/pictwps") == 0)
+ {
+ if (format_sup != NULL)
+ {
+ for (i = 0; i < format_sup->num_values; i ++)
+ if (strcasecmp(content_type, format_sup->values[i].string.text) == 0)
+ break;
+ }
+
+ if (format_sup == NULL || i >= format_sup->num_values)
+ {
+ /*
+ * Remote doesn't support "application/pictwps" (i.e. it's not MacOS X)
+ * so convert the document to PostScript...
+ */
+
+ if (run_pictwps_filter(argv, filename, sizeof(filename)))
+ return (1);
+
+ /*
+ * Change the MIME type to application/postscript...
+ */
+
+ content_type = "application/postscript";
+ }
+ }
+#endif /* __APPLE__ */
+
if (content_type != NULL && format_sup != NULL)
{
for (i = 0; i < format_sup->num_values; i ++)
/*
- * End of "$Id: ipp.c,v 1.73 2003/02/07 12:03:43 mike Exp $".
+ * End of "$Id: ipp.c,v 1.74 2003/02/20 03:49:48 mike Exp $".
*/
/*
- * "$Id: ppd.c,v 1.95 2003/02/19 22:02:39 mike Exp $"
+ * "$Id: ppd.c,v 1.96 2003/02/20 03:49:49 mike Exp $"
*
* PPD file routines for the Common UNIX Printing System (CUPS).
*
ppd_line ++;
col = 0;
- if (lineptr == line) /* Skip blank lines */
- continue;
-
if (ch == '\r')
{
/*
ungetc(ch, fp);
}
+ if (lineptr == line) /* Skip blank lines */
+ continue;
+
ch = '\n';
if (!endquote) /* Continue for multi-line text */
if (*lineptr == ':')
{
/*
- * Get string...
+ * Get string after triming leading and trailing whitespace...
*/
- *string = malloc(strlen(lineptr) + 1);
-
while (*lineptr == ':' || isspace(*lineptr))
lineptr ++;
+ strptr = lineptr + strlen(lineptr);
+ while (*strptr == '\0' || isspace(*strptr))
+ *strptr-- = '\0';
+
+ *string = malloc(strlen(lineptr) + 1);
+
strptr = *string;
for (; *lineptr != '\0'; lineptr ++)
/*
- * End of "$Id: ppd.c,v 1.95 2003/02/19 22:02:39 mike Exp $".
+ * End of "$Id: ppd.c,v 1.96 2003/02/20 03:49:49 mike Exp $".
*/
/*
- * "$Id: cupstestppd.c,v 1.13 2003/02/19 17:38:20 mike Exp $"
+ * "$Id: cupstestppd.c,v 1.14 2003/02/20 03:49:50 mike Exp $"
*
* PPD test program for the Common UNIX Printing System (CUPS).
*
main(int argc, /* I - Number of command-line arguments */
char *argv[]) /* I - Command-line arguments */
{
- int i, j, k, m; /* Looping vars */
+ int i, j, k, m, n; /* Looping vars */
+ int len; /* Length of option name */
char *opt; /* Option character */
const char *ptr; /* Pointer into string */
int files; /* Number of files */
ppd_size_t *size; /* Size record */
ppd_group_t *group; /* UI group */
ppd_option_t *option; /* Standard UI option */
+ ppd_group_t *group2; /* UI group */
+ ppd_option_t *option2; /* Standard UI option */
ppd_choice_t *choice; /* Standard UI option choice */
static char *uis[] = { "BOOLEAN", "PICKONE", "PICKMANY" };
static char *sections[] = { "ANY", "DOCUMENT", "EXIT",
for (j = 0, group = ppd->groups; j < ppd->num_groups; j ++, group ++)
for (k = 0, option = group->options; k < group->num_options; k ++, option ++)
+ {
+ /*
+ * Verify that we have a default choice...
+ */
+
if (option->defchoice[0])
{
if (verbose > 0)
errors ++;
}
+ /*
+ * Then verify that no other options share a common root name.
+ */
+
+ len = strlen(option->keyword);
+
+ for (m = 0, group2 = ppd->groups;
+ m < ppd->num_groups;
+ m ++, group2 ++)
+ for (n = 0, option2 = group2->options;
+ n < group2->num_options;
+ n ++, option2 ++)
+ if (option != option2 &&
+ len < strlen(option2->keyword) &&
+ !strncmp(option->keyword, option2->keyword, len))
+ {
+ if (verbose >= 0)
+ {
+ if (!errors && !verbose)
+ puts(" FAIL");
+
+ printf(" **FAIL** %s shares a common prefix with %s\n",
+ option->keyword, option2->keyword);
+ puts(" REF: Page 15, section 3.2.");
+ }
+
+ errors ++;
+ }
+ }
+
if (ppdFindAttr(ppd, "FileVersion", NULL) != NULL)
{
if (verbose > 0)
/*
- * End of "$Id: cupstestppd.c,v 1.13 2003/02/19 17:38:20 mike Exp $".
+ * End of "$Id: cupstestppd.c,v 1.14 2003/02/20 03:49:50 mike Exp $".
*/