various: More consistency with respect to copy generation
* Always use the larger of * specified count from spool file * count from cmdline etc * Always report the copy count used to the common code
This commit is contained in:
parent
b66656fd7d
commit
c06221488a
|
@ -610,6 +610,8 @@ static int magicard_read_parse(void *vctx, const void **vjob, int data_fd, int c
|
|||
/* Strip out the image format, replace it with backend */
|
||||
// } else if (!strncmp("ESS", ptr, 3)) {
|
||||
// /* Strip out copies */
|
||||
// XXX implement me properly.
|
||||
copies = 1;
|
||||
} else if (!strcmp("X-GP-RK", ptr)) {
|
||||
x_gp_rk = 1;
|
||||
} else if (!strncmp("ICC", ptr,3)) {
|
||||
|
@ -939,7 +941,7 @@ static const struct device_id magicard_devices[] = {
|
|||
|
||||
const struct dyesub_backend magicard_backend = {
|
||||
.name = "Magicard family",
|
||||
.version = "0.20",
|
||||
.version = "0.21",
|
||||
.uri_prefixes = magicard_prefixes,
|
||||
.devices = magicard_devices,
|
||||
.cmdline_arg = magicard_cmdline_arg,
|
||||
|
|
|
@ -715,13 +715,12 @@ hdr_done:
|
|||
}
|
||||
|
||||
/* Update printjob header to reflect number of requested copies */
|
||||
// XXX use larger?
|
||||
if (job->hdr2_present) {
|
||||
if (be16_to_cpu(job->hdr2.copies) < copies)
|
||||
job->hdr2.copies = cpu_to_be16(copies);
|
||||
copies = 1;
|
||||
else
|
||||
job->common.copies = be16_to_cpu(job->hdr2.copies);
|
||||
}
|
||||
job->common.copies = copies;
|
||||
|
||||
/* All further work is in main loop */
|
||||
if (test_mode >= TEST_MODE_NOPRINT)
|
||||
|
@ -1006,9 +1005,6 @@ static int mitsu9550_main_loop(void *vctx, const void *vjob, int wait_for_return
|
|||
uint8_t *ptr;
|
||||
|
||||
int ret;
|
||||
#if 0
|
||||
int copies = 1;
|
||||
#endif
|
||||
|
||||
struct mitsu9550_printjob *job = (struct mitsu9550_printjob*) vjob;
|
||||
|
||||
|
@ -1672,7 +1668,7 @@ static const struct device_id mitsu9550_devices[] = {
|
|||
/* Exported */
|
||||
const struct dyesub_backend mitsu9550_backend = {
|
||||
.name = "Mitsubishi CP9xxx family",
|
||||
.version = "0.71" " (lib " LIBMITSU_VER ")",
|
||||
.version = "0.72" " (lib " LIBMITSU_VER ")",
|
||||
.uri_prefixes = mitsu9550_prefixes,
|
||||
.devices = mitsu9550_devices,
|
||||
.cmdline_usage = mitsu9550_cmdline,
|
||||
|
|
|
@ -340,11 +340,14 @@ top:
|
|||
}
|
||||
|
||||
/* Update printjob header to reflect number of requested copies */
|
||||
if (job->hdr2[13] != 0xff)
|
||||
if (job->hdr2[13] != 0xff) {
|
||||
/* Use larger of our copy counts */
|
||||
if (copies > job->hdr2[13])
|
||||
job->hdr2[13] = copies;
|
||||
|
||||
job->common.copies = copies; // XXX use larger?
|
||||
else
|
||||
copies = job->hdr2[13];
|
||||
}
|
||||
job->common.copies = copies;
|
||||
|
||||
*vjob = job;
|
||||
return CUPS_BACKEND_OK;
|
||||
|
@ -613,7 +616,7 @@ static const struct device_id mitsup95d_devices[] = {
|
|||
/* Exported */
|
||||
const struct dyesub_backend mitsup95d_backend = {
|
||||
.name = "Mitsubishi P93D/P95D",
|
||||
.version = "0.16",
|
||||
.version = "0.17",
|
||||
.uri_prefixes = mitsup95d_prefixes,
|
||||
.devices = mitsup95d_devices,
|
||||
.cmdline_arg = mitsup95d_cmdline_arg,
|
||||
|
|
|
@ -90,6 +90,7 @@ struct upd_printjob {
|
|||
|
||||
uint8_t *databuf;
|
||||
int datalen;
|
||||
uint32_t copies_offset;
|
||||
|
||||
uint16_t rows;
|
||||
uint16_t cols;
|
||||
|
@ -676,8 +677,10 @@ static int upd_read_parse(void *vctx, const void **vjob, int data_fd, int copies
|
|||
if (tmp < copies) { /* Use larger of our copy counts */
|
||||
tmp = cpu_to_be16(copies);
|
||||
memcpy(job->databuf + copies_offset, &tmp, sizeof(tmp));
|
||||
} else {
|
||||
job->common.copies = tmp;
|
||||
}
|
||||
job->common.copies = 1;
|
||||
job->copies_offset = copies_offset;
|
||||
}
|
||||
|
||||
if (!job->datalen) {
|
||||
|
@ -724,7 +727,11 @@ static int upd_main_loop(void *vctx, const void *vjob, int wait_for_return) {
|
|||
if (!job)
|
||||
return CUPS_BACKEND_FAILED;
|
||||
|
||||
copies = job->common.copies;
|
||||
/* Hardware copies or not? */
|
||||
if (job->copies_offset)
|
||||
copies = 1;
|
||||
else
|
||||
copies = job->common.copies;
|
||||
|
||||
top:
|
||||
/* Send Unknown CMD. Resets? */
|
||||
|
@ -1002,7 +1009,7 @@ static const struct device_id sonyupd_devices[] = {
|
|||
|
||||
const struct dyesub_backend sonyupd_backend = {
|
||||
.name = "Sony UP-D",
|
||||
.version = "0.55",
|
||||
.version = "0.56",
|
||||
.uri_prefixes = sonyupd_prefixes,
|
||||
.devices = sonyupd_devices,
|
||||
.cmdline_arg = upd_cmdline_arg,
|
||||
|
|
|
@ -384,11 +384,14 @@ static int updneo_read_parse(void *vctx, const void **vjob, int data_fd, int cop
|
|||
if (job->databuf[i] == 0x02 &&
|
||||
job->databuf[i+1] == 0x00 &&
|
||||
job->databuf[i+2] == 0x09) {
|
||||
job->databuf[i+4] = copies;
|
||||
if (job->databuf[i+4] < copies)
|
||||
job->databuf[i+4] = copies;
|
||||
else
|
||||
copies = job->databuf[i+4];
|
||||
break;
|
||||
}
|
||||
}
|
||||
job->common.copies = 1; /* Printer makes copies */
|
||||
job->common.copies = copies;
|
||||
|
||||
*vjob = job;
|
||||
|
||||
|
@ -547,8 +550,6 @@ static int updneo_main_loop(void *vctx, const void *vjob, int wait_for_return) {
|
|||
if (!job)
|
||||
return CUPS_BACKEND_FAILED;
|
||||
|
||||
copies = job->common.copies;
|
||||
|
||||
top:
|
||||
|
||||
/* Query printer status */
|
||||
|
@ -609,15 +610,7 @@ retry:
|
|||
}
|
||||
}
|
||||
|
||||
/* Clean up */
|
||||
if (terminate)
|
||||
copies = 1;
|
||||
|
||||
INFO("Print complete (%d copies remaining)\n", copies - 1);
|
||||
|
||||
if (copies && --copies) {
|
||||
goto top;
|
||||
}
|
||||
INFO("Print complete\n");
|
||||
|
||||
/* Needed by the UP-D898! But should be safe for
|
||||
all models */
|
||||
|
@ -712,7 +705,7 @@ static const struct device_id sonyupdneo_devices[] = {
|
|||
|
||||
const struct dyesub_backend sonyupdneo_backend = {
|
||||
.name = "Sony UP-D Neo",
|
||||
.version = "0.20",
|
||||
.version = "0.21",
|
||||
.flags = BACKEND_FLAG_BADISERIAL, /* UP-D898MD at least */
|
||||
.uri_prefixes = sonyupdneo_prefixes,
|
||||
.devices = sonyupdneo_devices,
|
||||
|
|
Loading…
Reference in a new issue