cupsFilePuts(fp, "*FileSystem: False\n");
cupsFilePuts(fp, "*PCFileName: \"drvless.ppd\"\n");
+ if ((attr = ippFindAttribute(response, "ipp-features-supported",
+ IPP_TAG_KEYWORD))!= NULL &&
+ ippContainsString(attr, "faxout"))
+ is_fax = 1;
+
if ((attr = ippFindAttribute(response, "printer-make-and-model",
IPP_TAG_TEXT)) != NULL)
strlcpy(make, ippGetString(attr, 0, NULL), sizeof(make));
model = make;
cupsFilePrintf(fp, "*Manufacturer: \"%s\"\n", make);
- cupsFilePrintf(fp, "*ModelName: \"%s %s\"\n", make, model);
- cupsFilePrintf(fp, "*Product: \"(%s %s)\"\n", make, model);
- cupsFilePrintf(fp, "*NickName: \"%s %s, driverless, cups-filters %s\"\n",
- make, model, VERSION);
- cupsFilePrintf(fp, "*ShortNickName: \"%s %s\"\n", make, model);
+ cupsFilePrintf(fp, "*ModelName: \"%s %s%s\"\n",
+ make, model, (is_fax ? " Fax" : ""));
+ cupsFilePrintf(fp, "*Product: \"(%s %s%s)\"\n",
+ make, model, (is_fax ? " Fax" : ""));
+ cupsFilePrintf(fp, "*NickName: \"%s %s%s, driverless, cups-filters %s\"\n",
+ make, model, (is_fax ? " Fax" : ""), VERSION);
+ cupsFilePrintf(fp, "*ShortNickName: \"%s %s%s\"\n",
+ make, model, (is_fax ? " Fax" : ""));
/* Which is the default output bin? */
if ((attr = ippFindAttribute(response, "output-bin-default", IPP_TAG_ZERO))
}
}
}
+
/*
* Fax
*/
-
- if ((attr = ippFindAttribute(response, "ipp-features-supported",
- IPP_TAG_KEYWORD))!= NULL && ippContainsString(attr, "faxout")){
-
+
+ if (is_fax)
cupsFilePuts(fp, "*cupsIPPFaxOut: True\n");
- is_fax = 1;
- }
/* Check for each CUPS/cups-filters-supported PDL, starting with the
most desirable going to the least desirable. If a PDL requires a
"MFG:%s;", txt_usb_mfg);
}
if (txt_usb_mdl[0] != '\0') {
- strncpy(model, txt_usb_mdl, sizeof(model) - 1);
- if (strlen(txt_usb_mdl) > 255)
- model[255] = '\0';
+ snprintf(model, sizeof(model) - 1, "%s%s",
+ txt_usb_mdl, (isFax ? " Fax" : ""));
+ model[255] = '\0';
ptr = device_id + strlen(device_id);
snprintf(ptr, sizeof(device_id) - (size_t)(ptr - device_id),
- "MDL:%s;", txt_usb_mdl);
+ "MDL:%s;", model);
} else if (txt_product[0] != '\0') {
if (txt_product[0] == '(') {
/* Strip parenthesis... */
}
if (!device_id[0] && strcasecmp(model, "Unknown")) {
+ if (isFax)
+ strncpy(model + strlen(model), " Fax",
+ sizeof(model) - strlen(model) - 1);
if (make[0])
snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;",
make, model);
if (mode == 1) {
/* Call with "list" argument (PPD generator in list mode) */
printf("\"%s%s\" en \"%s\" \"%s, %s, cups-filters " VERSION
- "\" \"%s\"\n",((isFax)?"driverless-fax:":"driverless:") ,service_uri, make, make_and_model, driverless_info, device_id);
+ "\" \"%s\"\n",
+ ((isFax) ? "driverless-fax:" : "driverless:"),
+ service_uri, make, make_and_model, driverless_info, device_id);
} else {
/* Call without arguments and env variable "SOFTWARE" starting
with "CUPS" (Backend in discovery mode) */