| 1011 | */ |
| 1012 | |
| 1013 | static void |
| 1014 | show_capabilities(ipp_t *response) /* I - Printer attributes */ |
| 1015 | { |
| 1016 | int i; /* Looping var */ |
| 1017 | ipp_attribute_t *attr; /* Attribute */ |
| 1018 | char buffer[1024]; /* Attribute value buffer */ |
| 1019 | static const char * const pattrs[] = /* Attributes we want to show */ |
| 1020 | { |
| 1021 | "copies-default", |
| 1022 | "copies-supported", |
| 1023 | "finishings-default", |
| 1024 | "finishings-ready", |
| 1025 | "finishings-supported", |
| 1026 | "media-default", |
| 1027 | "media-ready", |
| 1028 | "media-supported", |
| 1029 | "output-bin-default", |
| 1030 | "output-bin-supported", |
| 1031 | "print-color-mode-default", |
| 1032 | "print-color-mode-supported", |
| 1033 | "sides-default", |
| 1034 | "sides-supported", |
| 1035 | "document-format-default", |
| 1036 | "document-format-supported", |
| 1037 | "pwg-raster-document-resolution-supported", |
| 1038 | "pwg-raster-document-type-supported", |
| 1039 | "urf-supported" |
| 1040 | }; |
| 1041 | |
| 1042 | |
| 1043 | puts("CAPABILITIES:"); |
| 1044 | for (i = 0; i < (int)(sizeof(pattrs) / sizeof(pattrs[0])); i ++) |
| 1045 | { |
| 1046 | if ((attr = ippFindAttribute(response, pattrs[i], IPP_TAG_ZERO)) != NULL) |
| 1047 | { |
| 1048 | ippAttributeString(attr, buffer, sizeof(buffer)); |
| 1049 | printf(" %s=%s\n", pattrs[i], buffer); |
| 1050 | } |
| 1051 | } |
| 1052 | } |
| 1053 | |
| 1054 | |
| 1055 | /* |
no test coverage detected