| 126 | */ |
| 127 | |
| 128 | static void |
| 129 | show_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 : |
no test coverage detected