diff options
author | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2009-04-22 17:28:12 +0000 |
---|---|---|
committer | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2009-04-22 17:28:12 +0000 |
commit | e07d4801f9846b9155d4c63872f51b18d8537d01 (patch) | |
tree | 5d86f7517a23788405e78b36d0a91c6898d3390d /cups/ppd.c | |
parent | 38e73f87814ea3029636fb1850b0483884b3cbbe (diff) | |
download | cups-e07d4801f9846b9155d4c63872f51b18d8537d01.tar.gz |
Merge changes from CUPS 1.4svn-r8540.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@1432 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'cups/ppd.c')
-rw-r--r-- | cups/ppd.c | 64 |
1 files changed, 29 insertions, 35 deletions
diff --git a/cups/ppd.c b/cups/ppd.c index c42d36d48..4018d803b 100644 --- a/cups/ppd.c +++ b/cups/ppd.c @@ -3,7 +3,7 @@ * * PPD file routines for the Common UNIX Printing System (CUPS). * - * Copyright 2007-2008 by Apple Inc. + * Copyright 2007-2009 by Apple Inc. * Copyright 1997-2007 by Easy Software Products, all rights reserved. * * These coded instructions, statements, and computer programs are the @@ -549,6 +549,8 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ }; + DEBUG_printf(("ppdOpen2(fp=%p)", fp)); + /* * Default to "OK" status... */ @@ -575,7 +577,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ mask = ppd_read(fp, &line, keyword, name, text, &string, 0, cg); - DEBUG_printf(("mask=%x, keyword=\"%s\"...\n", mask, keyword)); + DEBUG_printf(("2ppdOpen2: mask=%x, keyword=\"%s\"...", mask, keyword)); if (mask == 0 || strcmp(keyword, "PPD-Adobe") || @@ -594,7 +596,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ return (NULL); } - DEBUG_printf(("ppdOpen: keyword = %s, string = %p\n", keyword, string)); + DEBUG_printf(("2ppdOpen2: keyword=%s, string=%p", keyword, string)); _cupsStrFree(string); @@ -639,8 +641,8 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ while ((mask = ppd_read(fp, &line, keyword, name, text, &string, 1, cg)) != 0) { - DEBUG_printf(("mask=%x, keyword=\"%s\", name=\"%s\", text=\"%s\", " - "string=%d chars...", mask, keyword, name, text, + DEBUG_printf(("2ppdOpen2: mask=%x, keyword=\"%s\", name=\"%s\", " + "text=\"%s\", string=%d chars...", mask, keyword, name, text, string ? (int)strlen(string) : 0)); if (strncmp(keyword, "Default", 7) && !string && @@ -690,7 +692,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ ui_keyword = 1; - DEBUG_printf(("**** FOUND ADOBE UI KEYWORD %s WITHOUT OPENUI!\n", + DEBUG_printf(("2ppdOpen2: FOUND ADOBE UI KEYWORD %s WITHOUT OPENUI!", keyword)); if (!group) @@ -699,7 +701,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ encoding)) == NULL) goto error; - DEBUG_printf(("Adding to group %s...\n", group->text)); + DEBUG_printf(("2ppdOpen2: Adding to group %s...", group->text)); option = ppd_get_option(group, keyword); group = NULL; } @@ -734,7 +736,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ !strcmp(ppd->attrs[j]->name + 7, keyword) && ppd->attrs[j]->value) { - DEBUG_printf(("Setting Default%s to %s via attribute...\n", + DEBUG_printf(("2ppdOpen2: Setting Default%s to %s via attribute...", option->keyword, ppd->attrs[j]->value)); strlcpy(option->defchoice, ppd->attrs[j]->value, sizeof(option->defchoice)); @@ -1032,7 +1034,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ { ppd_option_t *custom_option; /* Custom option */ - DEBUG_puts("Processing Custom option..."); + DEBUG_puts("2ppdOpen2: Processing Custom option..."); /* * Get the option and custom option... @@ -1059,7 +1061,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ if ((choice = ppdFindChoice(custom_option, "Custom")) == NULL) if ((choice = ppd_add_choice(custom_option, "Custom")) == NULL) { - DEBUG_puts("Unable to add Custom choice!"); + DEBUG_puts("1ppdOpen2: Unable to add Custom choice!"); cg->ppd_status = PPD_ALLOC_ERROR; @@ -1099,7 +1101,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ if ((choice = ppdFindChoice(custom_option, "Custom")) == NULL) if ((choice = ppd_add_choice(custom_option, "Custom")) == NULL) { - DEBUG_puts("Unable to add Custom choice!"); + DEBUG_puts("1ppdOpen2: Unable to add Custom choice!"); cg->ppd_status = PPD_ALLOC_ERROR; @@ -1209,7 +1211,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ * Add an option record to the current sub-group, group, or file... */ - DEBUG_printf(("name=\"%s\" (%d)\n", name, (int)strlen(name))); + DEBUG_printf(("2ppdOpen2: name=\"%s\" (%d)", name, (int)strlen(name))); if (name[0] == '*') _cups_strcpy(name, name + 1); /* Eliminate leading asterisk */ @@ -1217,7 +1219,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ for (i = (int)strlen(name) - 1; i > 0 && isspace(name[i] & 255); i --) name[i] = '\0'; /* Eliminate trailing spaces */ - DEBUG_printf(("OpenUI of %s in group %s...\n", name, + DEBUG_printf(("2ppdOpen2: OpenUI of %s in group %s...", name, group ? group->text : "(null)")); if (subgroup != NULL) @@ -1228,7 +1230,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ encoding)) == NULL) goto error; - DEBUG_printf(("Adding to group %s...\n", group->text)); + DEBUG_printf(("2ppdOpen2: Adding to group %s...", group->text)); option = ppd_get_option(group, name); group = NULL; } @@ -1266,7 +1268,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ !strcmp(ppd->attrs[j]->name + 7, name) && ppd->attrs[j]->value) { - DEBUG_printf(("Setting Default%s to %s via attribute...\n", + DEBUG_printf(("2ppdOpen2: Setting Default%s to %s via attribute...", option->keyword, ppd->attrs[j]->value)); strlcpy(option->defchoice, ppd->attrs[j]->value, sizeof(option->defchoice)); @@ -1312,7 +1314,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ if ((choice = ppdFindChoice(option, "Custom")) == NULL) if ((choice = ppd_add_choice(option, "Custom")) == NULL) { - DEBUG_puts("Unable to add Custom choice!"); + DEBUG_puts("1ppdOpen2: Unable to add Custom choice!"); cg->ppd_status = PPD_ALLOC_ERROR; @@ -1385,7 +1387,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ !strcmp(ppd->attrs[j]->name + 7, name) && ppd->attrs[j]->value) { - DEBUG_printf(("Setting Default%s to %s via attribute...\n", + DEBUG_printf(("2ppdOpen2: Setting Default%s to %s via attribute...", option->keyword, ppd->attrs[j]->value)); strlcpy(option->defchoice, ppd->attrs[j]->value, sizeof(option->defchoice)); @@ -1415,7 +1417,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ { if ((choice = ppd_add_choice(option, "Custom")) == NULL) { - DEBUG_puts("Unable to add Custom choice!"); + DEBUG_puts("1ppdOpen2: Unable to add Custom choice!"); cg->ppd_status = PPD_ALLOC_ERROR; @@ -1588,11 +1590,11 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ * Set the default as part of the current option... */ - DEBUG_printf(("Setting %s to %s...\n", keyword, string)); + DEBUG_printf(("2ppdOpen2: Setting %s to %s...", keyword, string)); strlcpy(option->defchoice, string, sizeof(option->defchoice)); - DEBUG_printf(("%s is now %s...\n", keyword, option->defchoice)); + DEBUG_printf(("2ppdOpen2: %s is now %s...", keyword, option->defchoice)); } else { @@ -1605,7 +1607,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ if ((toption = ppdFindOption(ppd, keyword + 7)) != NULL) { - DEBUG_printf(("Setting %s to %s...\n", keyword, string)); + DEBUG_printf(("2ppdOpen2: Setting %s to %s...", keyword, string)); strlcpy(toption->defchoice, string, sizeof(toption->defchoice)); } } @@ -1836,7 +1838,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ (PPD_KEYWORD | PPD_OPTION | PPD_STRING) && !strcmp(keyword, option->keyword)) { - DEBUG_printf(("group = %p, subgroup = %p\n", group, subgroup)); + DEBUG_printf(("2ppdOpen2: group=%p, subgroup=%p", group, subgroup)); if (!strcmp(keyword, "PageSize")) { @@ -1897,7 +1899,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ #ifdef DEBUG if (!cupsFileEOF(fp)) - DEBUG_printf(("Premature EOF at %lu...\n", + DEBUG_printf(("1ppdOpen2: Premature EOF at %lu...\n", (unsigned long)cupsFileTell(fp))); #endif /* DEBUG */ @@ -2497,7 +2499,7 @@ ppd_get_group(ppd_file_t *ppd, /* I - PPD file */ ppd_group_t *group; /* Group */ - DEBUG_printf(("ppd_get_group(ppd=%p, name=\"%s\", text=\"%s\", cg=%p)\n", + DEBUG_printf(("7ppd_get_group(ppd=%p, name=\"%s\", text=\"%s\", cg=%p)", ppd, name, text, cg)); for (i = ppd->num_groups, group = ppd->groups; i > 0; i --, group ++) @@ -2506,7 +2508,7 @@ ppd_get_group(ppd_file_t *ppd, /* I - PPD file */ if (i == 0) { - DEBUG_printf(("Adding group %s...\n", name)); + DEBUG_printf(("8ppd_get_group: Adding group %s...", name)); if (cg->ppd_conform == PPD_CONFORM_STRICT && strlen(text) >= sizeof(group->text)) { @@ -2555,7 +2557,7 @@ ppd_get_option(ppd_group_t *group, /* I - Group */ ppd_option_t *option; /* Option */ - DEBUG_printf(("ppd_get_option(group=%p(\"%s\"), name=\"%s\")\n", + DEBUG_printf(("7ppd_get_option(group=%p(\"%s\"), name=\"%s\")", group, group->name, name)); for (i = group->num_options, option = group->options; i > 0; i --, option ++) @@ -2890,7 +2892,7 @@ ppd_read(cups_file_t *fp, /* I - File to read from */ *lineptr = '\0'; - DEBUG_printf(("LINE=\"%s\"\n", line->buffer)); + DEBUG_printf(("9ppd_read: LINE=\"%s\"", line->buffer)); /* * The dynamically created PPDs for older style Mac OS X @@ -2988,8 +2990,6 @@ ppd_read(cups_file_t *fp, /* I - File to read from */ mask |= PPD_KEYWORD; -/* DEBUG_printf(("keyword = \"%s\", lineptr = \"%s\"\n", keyword, lineptr));*/ - if (isspace(*lineptr & 255)) { /* @@ -3027,8 +3027,6 @@ ppd_read(cups_file_t *fp, /* I - File to read from */ mask |= PPD_OPTION; -/* DEBUG_printf(("option = \"%s\", lineptr = \"%s\"\n", option, lineptr));*/ - if (*lineptr == '/') { /* @@ -3062,8 +3060,6 @@ ppd_read(cups_file_t *fp, /* I - File to read from */ mask |= PPD_TEXT; } - -/* DEBUG_printf(("text = \"%s\", lineptr = \"%s\"\n", text, lineptr));*/ } if (isspace(*lineptr & 255) && cg->ppd_conform == PPD_CONFORM_STRICT) @@ -3101,8 +3097,6 @@ ppd_read(cups_file_t *fp, /* I - File to read from */ *string = _cupsStrAlloc(lineptr); -/* DEBUG_printf(("string = \"%s\", lineptr = \"%s\"\n", *string, lineptr));*/ - mask |= PPD_STRING; } } |