| 156 | */ |
| 157 | |
| 158 | static int /* O - Number of errors */ |
| 159 | show_ppd(const char *filename) /* I - Filename */ |
| 160 | { |
| 161 | ppd_file_t *ppd; /* PPD file */ |
| 162 | ppd_option_t *option; /* PageSize option */ |
| 163 | ppd_choice_t *choice; /* PageSize/Letter choice */ |
| 164 | char buffer[1024]; /* String buffer */ |
| 165 | |
| 166 | |
| 167 | if ((ppd = ppdOpenFile(filename)) == NULL) |
| 168 | { |
| 169 | printf("Unable to open PPD file \"%s\".\n", filename); |
| 170 | return (1); |
| 171 | } |
| 172 | |
| 173 | ppdLocalize(ppd); |
| 174 | |
| 175 | if ((option = ppdFindOption(ppd, "PageSize")) == NULL) |
| 176 | { |
| 177 | puts("No PageSize option."); |
| 178 | return (1); |
| 179 | } |
| 180 | else |
| 181 | { |
| 182 | printf("PageSize: %s\n", option->text); |
| 183 | |
| 184 | if ((choice = ppdFindChoice(option, "Letter")) == NULL) |
| 185 | { |
| 186 | puts("No Letter PageSize choice."); |
| 187 | return (1); |
| 188 | } |
| 189 | else |
| 190 | { |
| 191 | printf("Letter: %s\n", choice->text); |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | printf("media-empty: %s\n", ppdLocalizeIPPReason(ppd, "media-empty", NULL, buffer, sizeof(buffer))); |
| 196 | |
| 197 | ppdClose(ppd); |
| 198 | |
| 199 | return (0); |
| 200 | } |
| 201 | |
| 202 | |
| 203 | /* |
no test coverage detected