Closed michaelrsweet closed 13 years ago
CUPS.org User: mike
Fixed in Subversion repository.
"str3656.patch":
--- backend/ipp.c (revision 9599) +++ backend/ipp.c (working copy) @@ -115,7 +115,7 @@ const char user, const char title, int num_options, cups_option_t options, const char compression, int copies,
int version; / IPP version / ppd_filet *ppd; / PPD file */
_ppd_cache_t pc; / PPD cache and mapping data */
/ @@ -956,7 +956,7 @@ /
options = NULL;
pc = NULL;
if (send_options) { @@ -969,7 +969,7 @@ */
ppd = ppdOpenFile(getenv("PPD"));
pc = _ppdCacheCreateWithPPD(ppd);
ppdClose(ppd); } @@ -1025,7 +1025,7 @@ { request = new_request(IPP_VALIDATE_JOB, version, uri, argv[2], argv[3], num_options, options, compression,
copies_sup ? copies : 1, document_format, pc,
media_col_sup);
ippDelete(cupsDoRequest(http, request, resource)); @@ -1101,7 +1101,7 @@ request = new_request(num_files > 1 ? IPP_CREATE_JOB : IPP_PRINT_JOB, version, uri, argv[2], argv[3], num_options, options, compression, copies_sup ? copies : 1, document_format,
pc, media_col_sup);
/*
cupsFreeOptions(num_options, options);
_ppdCacheDestroy(pc);
httpClose(http);
@@ -1671,8 +1671,7 @@ response; / IPP response _/ ipp_attributet *attr; / Attribute in response / int delay, / Current delay */
prev_delay; /* Previous delay */
/ @@ -1787,7 +1786,7 @@ const char compression, / I - compression value or NULL / int copies, / I - copies value or 0 _/ const char format, /_ I - documet-format value or NULL */
_ppd_cache_t pc, / I - PPD cache and mapping data _/ ipp_attribute_t media_colsup) / I - media-col-supported values / { int i; / Looping var / @@ -1857,7 +1856,7 @@
if (num_options > 0) {
if ((size = _pwgGetSize(pwg, keyword)) != NULL)
if ((size = _ppdCacheGetSize(pc, keyword)) != NULL)
{ / \ Add a media-col value... @@ -1881,11 +1880,12 @@ media_col = ippNew(); ippAddCollection(media_col, IPP_TAG_ZERO, "media-size", media_size);
options));
for (i = 0; i < media_col_sup->num_values; i ++) { @@ -1920,8 +1920,8 @@
if ((keyword = cupsGetOption("output-bin", num_options, options)) == NULL)
options));
if (keyword) ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "output-bin", @@ -1963,17 +1963,17 @@ if ((keyword = cupsGetOption("sides", num_options, options)) != NULL) ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides", NULL, keyword);
if (!strcasecmp(keyword, pc->sides_2sided_short)) ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides", NULL, "two-sided-short-edge"); }
--- cups/ppd.c (revision 9599) +++ cups/ppd.c (working copy) @@ -310,11 +310,11 @@ }
/*
_ppdCacheDestroy(ppd->cache);
/*
--- cups/ppd.h (revision 9599) +++ cups/ppd.h (working copy) @@ -273,6 +273,9 @@ cups_array_t params; / Parameters */ } ppd_coption_t;
+typedef struct _ppd_cache_s _ppd_cache_t;
/**** PPD cache and mapping data @since CUPS 1.5@ @private@ ****/
+ typedef struct ppd_files /** PPD File */ { int languagelevel; / Language level of device _/ @@ -337,7 +340,7 @@ cups_array_t cupsuiconstraints; / cupsUIConstraints @since CUPS 1.4/Mac OS X 10.6@ @private@ /
/\ New in CUPS 1.5 **/
--- cups/mark.c (revision 9599) +++ cups/mark.c (working copy) @@ -3,7 +3,7 @@ *
This function maps the IPP "finishings", "media", "mirror",
int /* O - 1 if conflicts exist, 0 otherwise / @@ -78,14 +79,14 @@ const char *val, / Pointer into value / *media, / media option _/ outputbin, / output-bin option /
/* @@ -104,22 +105,25 @@
media = cupsGetOption("media", num_options, options); output_bin = cupsGetOption("output-bin", num_options, options);
cache = ppd->cache;
if (media) { @@ -154,40 +158,40 @@ { if (!strncasecmp(s, "Custom.", 7) || ppdPageSize(ppd, s)) ppd_mark_option(ppd, "PageSize", s);
else if ((ppd_keyword = _ppdCacheGetPageSize(cache, NULL, s, NULL)) != NULL)
ppd_mark_option(ppd, "PageSize", ppd_keyword); }
if (pwg && pwg->source_option &&
ppd_mark_option(ppd, cache->source_option, ppd_keyword);
if (!cupsGetOption("MediaType", num_options, options) &&
(ppd_keyword = _ppdCacheGetMediaType(cache, NULL, s)) != NULL)
ppd_mark_option(ppd, "MediaType", ppd_keyword); } }
(print_color_mode || print_quality))
{ /*
_pwg_output_mode_t pwg_om; /* output-mode index */
_pwg_print_color_mode_t pwg_pcm;/* print-color-mode index */
_pwg_print_quality_t pwgpq; /* print-quality index / cups_optiont *preset;/ Current preset option */
if (output_mode && !strcmp(output_mode, "monochrome"))
pwg_pcm = _PWG_PRINT_COLOR_MODE_COLOR;
if (print_quality) { @@ -200,33 +204,33 @@ else pwg_pq = _PWG_PRINT_QUALITY_NORMAL;
if (pwg->num_presets[pwg_om][pwg_pq] == 0)
if (cache->num_presets[pwg_pcm][pwg_pq] == 0)
{ /*
pwg_pcm = _PWG_PRINT_COLOR_MODE_COLOR;
} }
if (pwg->num_presets[pwg_om][pwg_pq] > 0)
if (cache->num_presets[pwg_pcm][pwg_pq] > 0)
{ /*
preset = cache->presets[pwg_pcm][pwg_pq];
i > 0;
i --, preset ++)
{ @@ -237,7 +241,7 @@ }
if (output_bin && !cupsGetOption("OutputBin", num_options, options) &&
!cupsGetOption(cache->sides_option, num_options, options))
{ /*
if (!strcmp(sides, "one-sided"))
--- cups/Makefile (revision 9599) +++ cups/Makefile (working copy) @@ -56,9 +56,8 @@ options.o \ page.o \ ppd.o \
--- cups/ppd-cache.c (revision 0) +++ cups/ppd-cache.c (revision 9601) @@ -0,0 +1,2348 @@ +/*
Property changes on: cups/ppd-cache.c
Added: svn:keywords
--- cups/testpwg.c (revision 9599) +++ cups/testpwg.c (working copy) @@ -3,7 +3,7 @@ *
Contents: *
/* @@ -32,9 +32,9 @@
-static int test_pwg(_pwg_t pwg, ppd_file_t ppd); -static int test_pagesize(_pwg_t pwg, ppd_file_t ppd, +static int test_pagesize(_ppd_cache_t pc, ppd_file_t ppd, const char ppdsize); +static int test_ppd_cache(_ppd_cache_t pc, ppd_file_t *ppd);
/ @@ -48,7 +48,7 @@ int status; /* Status of tests (0 = success, 1 = fail) _/ const char ppdfile; / PPD filename / ppd_filet *ppd; / PPD file */
@@ -78,8 +78,8 @@ else puts("PASS");
status += test_ppd_cache(pc, ppd);
if (argc == 3) { @@ -112,13 +112,14 @@ media = NULL;
if (media)
fputs("_ppdCacheGetPageSize(media-col): ", stdout);
fflush(stdout);
if ((pagesize = _ppdCacheGetPageSize(pc, job, NULL, NULL)) == NULL) { puts("FAIL (Not Found)"); status = 1; @@ -142,11 +143,11 @@ }
/*
@@ -268,9 +269,9 @@ */
static int /* O - 1 on failure, 0 on success _/ -test_pagesize(_pwgt *pwg, / I - PWG mapping data */
const char *ppdsize) /* I - PPD page size */
{ int status = 0; /* Return status _/ ippt *job; / Job attributes */ @@ -279,10 +280,10 @@
if (ppdPageSize(ppd, ppdsize)) {
if ((pagesize = _ppdCacheGetPageSize(pc, job, NULL, NULL)) == NULL) { puts("FAIL (Not Found)"); status = 1; @@ -322,16 +323,16 @@
/*
static int /* O - 1 on failure, 0 on success _/ -test_pwg(_pwgt *pwg, / I - PWG mapping data */
printf(" SAVED num_sizes=%d, ORIG num_sizes=%d\n", pwg2->num_sizes,
pc->num_sizes);
status ++; } else {
for (i = pc->num_sizes, size = pc->sizes, size2 = pc2->sizes;
i > 0;
i --, size ++, size2 ++) { @@ -424,7 +426,7 @@ } }
for (i = pwg->num_sources, map = pwg->sources, map2 = pwg2->sources;
for (i = pc->num_sources, map = pc->sources, map2 = pc2->sources;
i > 0;
i --, map ++, map2 ++) { @@ -447,7 +449,7 @@ } }
for (i = pwg->num_types, map = pwg->types, map2 = pwg2->types;
for (i = pc->num_types, map = pc->types, map2 = pc2->types;
i > 0;
i --, map ++, map2 ++) { @@ -474,17 +476,17 @@ if (!status) puts("PASS");
_ppdCacheDestroy(pc2); }
/*
status += test_pagesize(pc, ppd, "iso-a4");
return (status); }
--- cups/ppd-private.h (revision 9599) +++ cups/ppd-private.h (working copy) @@ -3,7 +3,7 @@ *
/*
@@ -71,12 +78,13 @@ _ppd_cups_uiconst_t constraints; / Constraints */ } _ppd_cups_uiconsts_t;
-typedef enum _pwg_output_modee /** PWG output-mode indices */ +typedef enum _pwg_print_color_modee /*** PWG print-color-mode indices ****/ {
_PWG_PRINT_COLOR_MODE_MAX +} _pwg_print_color_mode_t;
typedef enum _pwg_print_quality_e /\ PWG print-quality indices **/ { @@ -86,7 +94,7 @@ _PWG_PRINT_QUALITY_MAX } _pwg_print_quality_t;
-typedef struct _pwgs /** PWG-PPD conversion data */ +struct _ppd_caches /*** PPD cache and PWG conversion data **_/ { int numbins; / Number of output bins _/ _pwg_map_t bins; / Output bins / @@ -105,21 +113,46 @@ _pwg_mapt *sources; / Media sources _/ int numtypes; / Number of media types _/ _pwg_mapt *types; / Media types */
*prefilters; /* cupsPreFilter values */
+};
/*
+extern _ppd_cache_t _ppdCacheCreateWithFile(const char filename,
char *name, size_t namesize);
extern const char _pwgPageSizeForMedia(_pwg_media_t media, char name, size_t namesize); -extern int _pwgWriteFile(_pwg_t pwg, const char *filename);
/*
--- cups/pwg-ppd.c (revision 9599) +++ cups/pwg-ppd.c (working copy) @@ -1,1490 +0,0 @@ -/*
-/*
-#include "cups-private.h"
-/*
-/*
-static void pwg_ppdize_name(const char ipp, char name, size_t namesize);
-/*
-_pwgt * /* O - PWG mapping data / -_pwgCreateWithPPD(ppd_filet *ppd) / I - PPD file */ -{
- -/*
-const char * /* O - output-bin or NULL _/ -_pwgGetBin(_pwgt *pwg, / I - PWG mapping data */
- -/*
-const char * /* O - PPD InputSlot or NULL _/ -_pwgGetInputSlot(_pwgt *pwg, / I - PWG mapping data */
- -/*
-const char * /* O - PPD MediaType or NULL _/ -_pwgGetMediaType(_pwgt *pwg, / I - PWG mapping data */
- -/*
-const char * /* O - PPD OutputBin or NULL _/ -_pwgGetOutputBin(_pwgt *pwg, / I - PWG mapping data */
- -/*
-const char * /* O - PPD PageSize or NULL _/ -_pwgGetPageSize(_pwgt *pwg, / I - PWG mapping data */
-#ifdef DEBUG
- -/*
-_pwg_sizet * /* O - PWG size or NULL / -_pwgGetSize(_pwgt *pwg, / I - PWG mapping data */
- -/*
-const char * /* O - PWG media-source keyword _/ -_pwgGetSource(_pwgt *pwg, / I - PWG mapping data */
- -/*
-const char * /* O - PWG media-type keyword _/ -_pwgGetType(_pwgt *pwg, / I - PWG mapping data */
- -/*
-const char * /* O - InputSlot name */ -_pwgInputSlotForSource(
- -/*
-const char * /* O - MediaType name */ -_pwgMediaTypeForType(
- -/*
-const char * /* O - PageSize name */ -_pwgPageSizeForMedia(
- -/*
-static void -pwg_ppdize_name(const char ipp, / I - IPP keyword */
- -/_
-static void -pwg_unppdize_name(const char ppd, / I - PPD keyword */
- -/_
--- cups/pwg-file.c (revision 9599) +++ cups/pwg-file.c (working copy) @@ -1,638 +0,0 @@ -/_
-/*
-#include "cups-private.h"
-/*
-_pwgt * /* O - PWG mapping data / -pwgCreateWithFile(const char *filename)/ I - File to read */ -{
- -/*
-void -_pwgDestroy(_pwg_t pwg) / I - PWG mapping data */ -{
- -/*
-int /* O - 1 on success, 0 on failure _/ -_pwgWriteFile(_pwgt *pwg, / I - PWG mapping data */
- -/*
*/
--- scheduler/ipp.c (revision 9599) +++ scheduler/ipp.c (working copy) @@ -1540,7 +1540,7 @@
if (!ippFindAttribute(con->request, "PageRegion", IPP_TAG_ZERO) && !ippFindAttribute(con->request, "PageSize", IPP_TAG_ZERO) &&
_ppdCacheGetPageSize(printer->pc, con->request, NULL, &exact))
{ if (!exact && (media_col = ippFindAttribute(con->request, "media-col", @@ -2944,14 +2944,10 @@
char cache_name[1024]; /* Cache filename for printer attrs */
cupsdSetPrinterReasons(printer, "none");
@@ -7014,13 +7010,10 @@ printer->name); unlink(filename);
snprintf(filename, sizeof(filename), "%s/%s.png", CacheDir, printer->name); unlink(filename);
snprintf(filename, sizeof(filename), "%s/%s.data", CacheDir, printer->name); unlink(filename);
--- scheduler/printers.c (revision 9599) +++ scheduler/printers.c (working copy) @@ -42,10 +42,8 @@
cupsdFreeStrings(&(p->users)); cupsdFreeQuotas(p);
@@ -850,7 +843,6 @@ cupsdClearString(&p->alert_description);
@@ -1177,44 +1169,6 @@ cupsdLogMessage(CUPSD_LOG_ERROR, "Syntax error on line %d of printers.conf.", linenum); }
} else if (!strcasecmp(line, "Shared")) { /* @@ -1597,21 +1551,6 @@
cupsFilePrintf(fp, "Type %d\n", printer->type);
-#ifdef HAVE_DNSSD
if (printer->accepting)
cupsFilePuts(fp, "Accepting Yes\n");
else
@@ -2395,18 +2334,55 @@ cupsdSetPrinterReasons(p, "-cups-missing-filter-warning," "cups-insecure-filter-warning");
if (p->pre_filters)
+
if (p->pc && p->pc->prefilters)
{ p->prefiltertype = mimeAddType(MimeDatabase, "prefilter", p->name);
for (filter = (char *)cupsArrayFirst(p->pre_filters);
filter = (char *)cupsArrayNext(p->pc->prefilters))
add_printer_filter(p, p->prefiltertype, filter); } } @@ -3522,6 +3498,11 @@ struct stat fileinfo; /* File information */
filtertype->type, filter);
+ /*
@@ -3830,21 +3811,6 @@
/*
-static void -add_string_array(cups_array_t a, / I - Array /
- -/_
@@ -3909,26 +3875,6 @@
/*
-static void -delete_string_array(cups_array_t a) / I - Array / -{
- -/_
snprintf(ppd_name, sizeof(ppd_name), "%s/ppd/%s.ppd", ServerRoot, p->name); if (stat(ppd_name, &ppd_info)) ppd_info.st_mtime = 1; @@ -4021,29 +3961,22 @@ ippDelete(p->ppd_attrs); p->ppd_attrs = ippNew();
cupsdLogMessage(CUPSD_LOG_DEBUG, "load_ppd: Loading %s...", cache_name);
cupsFileClose(cache); }
/* @@ -4052,14 +3985,8 @@
cupsdMarkDirty(CUPSD_DIRTY_PRINTERS);
cupsdLogMessage(CUPSD_LOG_DEBUG, "load_ppd: Loading %s...", ppd_name);
p->type &= ~CUPS_PRINTER_OPTIONS; p->type |= CUPS_PRINTER_BW;
@@ -4072,7 +3999,7 @@ * Add make/model and other various attributes... */
p->pc = _ppdCacheCreateWithPPD(ppd);
ppdMarkDefaults(ppd);
@@ -4175,7 +4102,7 @@ * Add media options from the PPD file... */
if (ppd->num_sizes == 0 || !p->pc) { if (!ppdFindAttr(ppd, "APScannerOnly", NULL)) cupsdLogMessage(CUPSD_LOG_CRIT, @@ -4194,7 +4121,7 @@ */
if ((size = ppdPageSize(ppd, NULL)) != NULL)
@@ -4214,12 +4141,12 @@ media_type = ppdFindMarkedChoice(ppd, "MediaType"); col = new_media_col(pwgsize, input_slot ?
media_type->choice) :
NULL);
ippAddCollection(p->ppd_attrs, IPP_TAG_PRINTER, "media-col-default", @@ -4231,8 +4158,8 @@
num_media = p->pwg->num_sizes;
if (p->pc->custom_min_keyword)
num_media += 2;
if ((attr = ippAddStrings(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, @@ -4241,16 +4168,16 @@ { val = attr->values;
for (i = p->pwg->num_sizes, pwgsize = p->pwg->sizes;
for (i = p->pc->num_sizes, pwgsize = p->pc->sizes;
i > 0;
i --, pwgsize ++, val ++)
val->string.text = _cupsStrRetain(pwgsize->map.pwg);
if (p->pwg->custom_min_keyword)
@@ -4258,12 +4185,12 @@ * media-source-supported */
if (p->pwg->num_types > 0 &&
for (i = p->pwg->num_sizes, pwgsize = p->pwg->sizes, num_margins = 0;
for (i = p->pc->num_sizes, pwgsize = p->pc->sizes, num_margins = 0;
i > 0 && num_margins < (int)(sizeof(margins) / sizeof(margins[0])); i --, pwgsize ++) { @@ -4312,7 +4239,7 @@ ippAddInteger(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER, "media-bottom-margin-supported", 0);
for (i = p->pwg->num_sizes, pwgsize = p->pwg->sizes, num_margins = 0;
for (i = p->pc->num_sizes, pwgsize = p->pc->sizes, num_margins = 0;
i > 0 && num_margins < (int)(sizeof(margins) / sizeof(margins[0])); i --, pwgsize ++) { @@ -4334,7 +4261,7 @@ ippAddInteger(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER, "media-left-margin-supported", 0);
for (i = p->pwg->num_sizes, pwgsize = p->pwg->sizes, num_margins = 0;
for (i = p->pc->num_sizes, pwgsize = p->pc->sizes, num_margins = 0;
i > 0 && num_margins < (int)(sizeof(margins) / sizeof(margins[0])); i --, pwgsize ++) { @@ -4356,7 +4283,7 @@ ippAddInteger(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER, "media-right-margin-supported", 0);
for (i = p->pwg->num_sizes, pwgsize = p->pwg->sizes, num_margins = 0;
for (i = p->pc->num_sizes, pwgsize = p->pc->sizes, num_margins = 0;
i > 0 && num_margins < (int)(sizeof(margins) / sizeof(margins[0])); i --, pwgsize ++) { @@ -4382,23 +4309,23 @@
num_media = p->pwg->num_sizes;
num_media += p->pc->num_sizes * p->pc->num_types;
if ((attr = ippAddCollections(p->ppd_attrs, IPP_TAG_PRINTER, "media-col-database", num_media, NULL)) != NULL) {
for (i = p->pc->num_sizes, pwgsize = p->pc->sizes, val = attr->values;
i > 0;
i --, pwgsize ++)
{ @@ -4416,17 +4343,17 @@
if (p->pwg->num_sources > 0)
for (j = p->pc->num_sources, pwgsource = p->pc->sources;
j > 0;
j --, pwgsource ++)
{
ppdMarkOption(ppd, "InputSlot", pwgsource->ppd);
if (p->pwg->num_types > 0)
for (j = p->pc->num_types, pwgtype = p->pc->types;
j > 0;
j --, pwgtype ++)
{
@@ -4472,35 +4399,35 @@
"output-bin-supported", p->pc->num_bins,
NULL, NULL);
if (attr != NULL) { for (i = 0, val = attr->values;
val->string.text = _cupsStrAlloc(p->pc->bins[i].pwg);
}
if ((output_bin = ppdFindOption(ppd, "OutputBin")) != NULL) {
if (!strcmp(p->pc->bins[i].ppd, output_bin->defchoice))
break;
if (i >= p->pwg->num_bins)
if (i >= p->pc->num_bins)
i = 0;
ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
"output-bin-default", NULL, p->pc->bins[0].pwg);
} else if (((ppd_attr = ppdFindAttr(ppd, "DefaultOutputOrder", NULL)) != NULL && @@ -4528,7 +4455,7 @@ }
/*
if (ppd->color_device) @@ -4543,6 +4470,11 @@ "output-mode-supported", 2, NULL, output_modes); ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "output-mode-default", NULL, "color"); +
"print-color-mode-default", NULL, "monochrome");
}
/* @@ -4715,106 +4652,21 @@ }
/*
@@ -4825,12 +4677,11 @@ end; / End of name / int count; / Number of commands */
while (_cups_isspace(*start))
start ++;
if (!*start) @@ -4937,10 +4788,6 @@ attr->values[i].string.text = _cupsStrAlloc("bcp"); }
-#ifdef HAVE_DNSSD
if (ppdFindAttr(ppd, "APRemoteQueueID", NULL)) p->type |= CUPS_PRINTER_REMOTE;
@@ -5099,19 +4946,6 @@ cupsdLogMessage(CUPSD_LOG_INFO, "Hint: Run \"cupstestppd %s\" and fix any errors.",
add_string_array(&(p->filters), interface);
} else if (!strncmp(p->device_uri, "ipp://", 6) && (strstr(p->device_uri, "/printers/") != NULL || @@ -5209,7 +5039,7 @@ ippAddInteger(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM, "finishings-default", IPP_FINISHINGS_NONE);
if (ppd && p->pc) { /*
cupsdLogMessage(CUPSD_LOG_DEBUG, "load_ppd: Saving %s...", cache_name);
_ppdCacheWriteFile(p->pc, cache_name, p->ppd_attrs); } else { @@ -5240,9 +5057,6 @@
if (cache_info.st_mtime)
--- scheduler/job.c (revision 9599) +++ scheduler/job.c (working copy) @@ -3034,12 +3034,13 @@ char optptr, / Pointer to options / *valptr; / Pointer in value string _/ ipp_attributet *attr; / Current attribute */
/* Output mode (if any) */
print_quality; /* Print quality (if any) */
const char ppd; / PPD option choice / int exact; / Did we get an exact match? */ @@ -3055,28 +3056,31 @@
ippFindAttribute(job->attrs, "print-color-mode", IPP_TAG_ZERO) ||
ippFindAttribute(job->attrs, "print-quality", IPP_TAG_ZERO)))
{ /*
print_color_mode = _PWG_PRINT_COLOR_MODE_COLOR;
if ((attr = ippFindAttribute(job->attrs, "print-quality", IPP_TAG_ENUM)) != NULL && @@ -3086,33 +3090,33 @@ else print_quality = _PWG_PRINT_QUALITY_NORMAL;
if (pwg->num_presets[output_mode][_PWG_PRINT_QUALITY_NORMAL] > 0)
print_color_mode = _PWG_PRINT_COLOR_MODE_COLOR;
} }
for (i = pwg->num_presets[output_mode][print_quality],
preset = pc->presets[print_color_mode][print_quality];
i > 0; i --, preset ++) { @@ -3123,13 +3127,13 @@ } }
num_pwgppds = cupsAddOption(pc->source_option, ppd, num_pwgppds, &pwgppds); else if (!ippFindAttribute(job->attrs, "AP_D_InputSlot", IPP_TAG_ZERO)) num_pwgppds = cupsAddOption("AP_D_InputSlot", "", num_pwgppds, @@ -3137,12 +3141,12 @@ }
if (!ippFindAttribute(job->attrs, "MediaType", IPP_TAG_ZERO) &&
(ppd = _ppdCacheGetMediaType(pc, job->attrs, NULL)) != NULL) num_pwgppds = cupsAddOption("MediaType", ppd, num_pwgppds, &pwgppds);
if (!ippFindAttribute(job->attrs, "PageRegion", IPP_TAG_ZERO) && !ippFindAttribute(job->attrs, "PageSize", IPP_TAG_ZERO) &&
@@ -3155,7 +3159,7 @@ IPP_TAG_ZERO)) != NULL && (attr->value_tag == IPP_TAG_KEYWORD || attr->value_tag == IPP_TAG_NAME) &&
!ippFindAttribute(job->attrs, pc->sides_option, IPP_TAG_ZERO) &&
(attr = ippFindAttribute(job->attrs, "sides", IPP_TAG_KEYWORD)) != NULL) { / @@ -3173,13 +3177,13 @@ /
if (!strcmp(attr->values[0].string.text, "one-sided"))
--- scheduler/printers.h (revision 9599) +++ scheduler/printers.h (working copy) @@ -70,7 +70,8 @@ int remote; /* Remote queue? _/ mime_typet *filetype, / Pseudo-filetype for printer / *prefiltertype; / Pseudo-filetype for pre-filters */
_ppd_cache_t pc; / PPD cache and mapping data */
char _regname, / Name used for service registration */
--- scheduler/dirsvc.c (revision 9599) +++ scheduler/dirsvc.c (working copy)
@@ -2396,7 +2396,7 @@ keyvalue[i++][1] = for_lpd ? "100" : "0";
keyvalue[i ][0] = "product";
keyvalue[i++][1] = p->pc && p->pc->product ? p->pc->product : "Unknown";
snprintf(type_str, sizeof(type_str), "0x%X", p->type | CUPS_PRINTER_REMOTE); snprintf(state_str, sizeof(state_str), "%d", p->state);
Version: 1.5-current CUPS.org User: mike
Now that we have a PPD cache, move all of the PPD bits from printers.conf into that cache.