MCPcopy Create free account
hub / github.com/OpenPrinting/cups / cupsMarkOptions

Function cupsMarkOptions

cups/ppd-mark.c:47–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45 */
46
47int /* O - 1 if conflicts exist, 0 otherwise */
48cupsMarkOptions(
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 {

Callers 13

get_optionsFunction · 0.85
mainFunction · 0.85
do_setupFunction · 0.85
write_optionsFunction · 0.85
mainFunction · 0.85
SetCommonOptionsFunction · 0.85
mainFunction · 0.85
set_printer_optionsFunction · 0.85
list_optionsFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 15

ppd_debug_markedFunction · 0.85
cupsGetOptionFunction · 0.85
_ppdCacheCreateWithPPDFunction · 0.85
_cups_strncasecmpFunction · 0.85
ppdPageSizeFunction · 0.85
ppd_mark_optionFunction · 0.85
_ppdCacheGetPageSizeFunction · 0.85
_ppdCacheGetInputSlotFunction · 0.85
_ppdCacheGetMediaTypeFunction · 0.85
_ppdCacheGetOutputBinFunction · 0.85
_cups_strcasecmpFunction · 0.85
ppdFindOptionFunction · 0.85

Tested by 4

mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
do_ppd_testsFunction · 0.68