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

Function show_supported

cups/testthreads.c:128–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126 */
127
128static void
129show_supported(http_t *http, /* I - Connection to destination */
130 cups_dest_t *dest, /* I - Destination */
131 cups_dinfo_t *dinfo, /* I - Destination information */
132 const char *option, /* I - Option, if any */
133 const char *value) /* I - Value, if any */
134{
135 ipp_attribute_t *attr; /* Attribute */
136 int i, /* Looping var */
137 count; /* Number of values */
138
139
140 if (!option)
141 {
142 attr = cupsFindDestSupported(http, dest, dinfo, "job-creation-attributes");
143 if (attr)
144 {
145 count = ippGetCount(attr);
146 for (i = 0; i < count; i ++)
147 show_supported(http, dest, dinfo, ippGetString(attr, i, NULL), NULL);
148 }
149 else
150 {
151 static const char * const options[] =
152 { /* List of standard options */
153 CUPS_COPIES,
154 CUPS_FINISHINGS,
155 CUPS_MEDIA,
156 CUPS_NUMBER_UP,
157 CUPS_ORIENTATION,
158 CUPS_PRINT_COLOR_MODE,
159 CUPS_PRINT_QUALITY,
160 CUPS_SIDES
161 };
162
163 puts(" No job-creation-attributes-supported attribute, probing instead.");
164
165 for (i = 0; i < (int)(sizeof(options) / sizeof(options[0])); i ++)
166 if (cupsCheckDestSupported(http, dest, dinfo, options[i], NULL))
167 show_supported(http, dest, dinfo, options[i], NULL);
168 }
169 }
170 else if (!value)
171 {
172 printf(" %s (%s - %s)\n", option, cupsLocalizeDestOption(http, dest, dinfo, option), cupsCheckDestSupported(http, dest, dinfo, option, NULL) ? "supported" : "not-supported");
173
174 if ((attr = cupsFindDestSupported(http, dest, dinfo, option)) != NULL)
175 {
176 count = ippGetCount(attr);
177
178 switch (ippGetValueTag(attr))
179 {
180 case IPP_TAG_INTEGER :
181 for (i = 0; i < count; i ++)
182 printf(" %d\n", ippGetInteger(attr, i));
183 break;
184
185 case IPP_TAG_ENUM :

Callers 1

run_queryFunction · 0.70

Calls 13

cupsFindDestSupportedFunction · 0.85
ippGetCountFunction · 0.85
ippGetStringFunction · 0.85
cupsCheckDestSupportedFunction · 0.85
cupsLocalizeDestOptionFunction · 0.85
ippGetValueTagFunction · 0.85
ippGetIntegerFunction · 0.85
ippEnumStringFunction · 0.85
cupsLocalizeDestValueFunction · 0.85
ippGetRangeFunction · 0.85
ippGetResolutionFunction · 0.85
ippGetOctetStringFunction · 0.85

Tested by

no test coverage detected