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

Function _cupsConvertOptions

cups/ppd-cache.c:55–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53 */
54
55int /* O - New number of copies */
56_cupsConvertOptions(
57 ipp_t *request, /* I - IPP request */
58 ppd_file_t *ppd, /* I - PPD file */
59 _ppd_cache_t *pc, /* I - PPD cache info */
60 ipp_attribute_t *media_col_sup, /* I - media-col-supported values */
61 ipp_attribute_t *doc_handling_sup, /* I - multiple-document-handling-supported values */
62 ipp_attribute_t *print_color_mode_sup,
63 /* I - Printer supports print-color-mode */
64 const char *user, /* I - User info */
65 const char *format, /* I - document-format value */
66 int copies, /* I - Number of copies */
67 int num_options, /* I - Number of options */
68 cups_option_t *options) /* I - Options */
69{
70 int i; /* Looping var */
71 const char *keyword, /* PWG keyword */
72 *password; /* Password string */
73 pwg_size_t *size; /* PWG media size */
74 ipp_t *media_col, /* media-col value */
75 *media_size; /* media-size value */
76 const char *media_source, /* media-source value */
77 *media_type, /* media-type value */
78 *collate_str, /* multiple-document-handling value */
79 *color_attr_name, /* Supported color attribute */
80 *mandatory, /* Mandatory attributes */
81 *finishing_template; /* Finishing template */
82 int num_finishings = 0, /* Number of finishing values */
83 finishings[10]; /* Finishing enum values */
84 ppd_choice_t *choice; /* Marked choice */
85 int finishings_copies = copies,
86 /* Number of copies for finishings */
87 job_pages = 0, /* job-pages value */
88 number_up = 1; /* number-up value */
89 const char *value; /* Option value */
90
91
92 /*
93 * Send standard IPP attributes...
94 */
95
96 if (pc->password && (password = cupsGetOption("job-password", num_options, options)) != NULL && ippGetOperation(request) != IPP_OP_VALIDATE_JOB)
97 {
98 ipp_attribute_t *attr = NULL; /* job-password attribute */
99
100 if ((keyword = cupsGetOption("job-password-encryption", num_options, options)) == NULL)
101 keyword = "none";
102
103 if (!strcmp(keyword, "none"))
104 {
105 /*
106 * Add plain-text job-password...
107 */
108
109 attr = ippAddOctetString(request, IPP_TAG_OPERATION, "job-password", password, (int)strlen(password));
110 }
111 else
112 {

Callers 1

new_requestFunction · 0.85

Calls 15

cupsGetOptionFunction · 0.85
ippGetOperationFunction · 0.85
ippAddOctetStringFunction · 0.85
cupsHashDataFunction · 0.85
ippAddStringFunction · 0.85
cupsArrayFirstFunction · 0.85
cupsArrayNextFunction · 0.85
_ippFindOptionFunction · 0.85
ippAddIntegerFunction · 0.85
ippAddBooleanFunction · 0.85
_cups_strcasecmpFunction · 0.85
ippAddRangeFunction · 0.85

Tested by

no test coverage detected