| 45 | */ |
| 46 | |
| 47 | int /* O - 1 if conflicts exist, 0 otherwise */ |
| 48 | cupsMarkOptions( |
| 49 | ppd_file_t *ppd, /* I - PPD file */ |
| 50 | int num_options, /* I - Number of options */ |
| 51 | cups_option_t *options) /* I - Options */ |
| 52 | { |
| 53 | int i, j; /* Looping vars */ |
| 54 | char *ptr, /* Pointer into string */ |
| 55 | s[255]; /* Temporary string */ |
| 56 | const char *val, /* Pointer into value */ |
| 57 | *media, /* media option */ |
| 58 | *output_bin, /* output-bin option */ |
| 59 | *ppd_keyword, /* PPD keyword */ |
| 60 | *print_color_mode, /* print-color-mode option */ |
| 61 | *print_quality, /* print-quality option */ |
| 62 | *sides; /* sides option */ |
| 63 | cups_option_t *optptr; /* Current option */ |
| 64 | ppd_attr_t *attr; /* PPD attribute */ |
| 65 | _ppd_cache_t *cache; /* PPD cache and mapping data */ |
| 66 | |
| 67 | |
| 68 | /* |
| 69 | * Check arguments... |
| 70 | */ |
| 71 | |
| 72 | if (!ppd || num_options <= 0 || !options) |
| 73 | return (0); |
| 74 | |
| 75 | ppd_debug_marked(ppd, "Before..."); |
| 76 | |
| 77 | /* |
| 78 | * Do special handling for finishings, media, output-bin, output-mode, |
| 79 | * print-color-mode, print-quality, and PageSize... |
| 80 | */ |
| 81 | |
| 82 | media = cupsGetOption("media", num_options, options); |
| 83 | output_bin = cupsGetOption("output-bin", num_options, options); |
| 84 | print_quality = cupsGetOption("print-quality", num_options, options); |
| 85 | sides = cupsGetOption("sides", num_options, options); |
| 86 | |
| 87 | if ((print_color_mode = cupsGetOption("print-color-mode", num_options, |
| 88 | options)) == NULL) |
| 89 | print_color_mode = cupsGetOption("output-mode", num_options, options); |
| 90 | |
| 91 | if ((media || output_bin || print_color_mode || print_quality || sides) && |
| 92 | !ppd->cache) |
| 93 | { |
| 94 | /* |
| 95 | * Load PPD cache and mapping data as needed... |
| 96 | */ |
| 97 | |
| 98 | ppd->cache = _ppdCacheCreateWithPPD(ppd); |
| 99 | } |
| 100 | |
| 101 | cache = ppd->cache; |
| 102 | |
| 103 | if (media) |
| 104 | { |