all: For printers that automatically generate copies, get rid of

leftover manual copy handling code.

The exception is the dnp backend, it needs do use manual copies under
some situations.
This commit is contained in:
Solomon Peachy 2015-08-20 23:13:52 -04:00
parent 0fb287cb1e
commit 175f6a52d8
8 changed files with 16 additions and 101 deletions

View File

@ -517,18 +517,7 @@ top:
if (ret)
return CUPS_BACKEND_FAILED;
/* This printer handles copies internally */
copies = 1;
/* Clean up */
if (terminate)
copies = 1;
INFO("Print complete (%d copies remaining)\n", copies - 1);
if (copies && --copies) {
goto top;
}
INFO("Print complete\n");
if (resp) free(resp);
@ -879,7 +868,7 @@ static int cw01_cmdline_arg(void *vctx, int argc, char **argv)
/* Exported */
struct dyesub_backend cw01_backend = {
.name = "Citizen CW-01",
.version = "0.10",
.version = "0.11",
.uri_prefix = "citizencw01",
.cmdline_usage = cw01_cmdline,
.cmdline_arg = cw01_cmdline_arg,

View File

@ -301,7 +301,6 @@ static int kodak605_main_loop(void *vctx, int copies) {
/* Printer handles generating copies.. */
if (ctx->hdr.copies < copies)
ctx->hdr.copies = copies;
copies = 1;
/* Query loaded media */
INFO("Querying loaded media\n");
@ -320,7 +319,6 @@ static int kodak605_main_loop(void *vctx, int copies) {
return CUPS_BACKEND_HOLD;
}
top:
INFO("Waiting for printer idle\n");
while(1) {
@ -372,15 +370,7 @@ top:
break;
}
/* Clean up */
if (terminate)
copies = 1;
INFO("Print complete (%d copies remaining)\n", copies - 1);
if (copies && --copies) {
goto top;
}
INFO("Print complete\n");
return CUPS_BACKEND_OK;
}

View File

@ -759,7 +759,6 @@ static int kodak6800_main_loop(void *vctx, int copies) {
/* Printer handles generating copies.. */
if (ctx->hdr.copies < copies)
ctx->hdr.copies = copies;
copies = 1;
/* Query loaded media */
INFO("Querying loaded media\n");
@ -785,7 +784,6 @@ static int kodak6800_main_loop(void *vctx, int copies) {
return CUPS_BACKEND_HOLD;
}
top:
INFO("Waiting for printer idle\n");
while(1) {
@ -881,15 +879,7 @@ top:
sleep(1);
}
/* Clean up */
if (terminate)
copies = 1;
INFO("Print complete (%d copies remaining)\n", copies - 1);
if (copies && --copies) {
goto top;
}
INFO("Print complete\n");
return CUPS_BACKEND_OK;
}
@ -897,7 +887,7 @@ top:
/* Exported */
struct dyesub_backend kodak6800_backend = {
.name = "Kodak 6800/6850",
.version = "0.44",
.version = "0.45",
.uri_prefix = "kodak6800",
.cmdline_usage = kodak6800_cmdline,
.cmdline_arg = kodak6800_cmdline_arg,

View File

@ -329,8 +329,8 @@ static int mitsu9550_main_loop(void *vctx, int copies) {
if (!ctx)
return CUPS_BACKEND_FAILED;
/* This printer handles copies internally */
/* Update printjob header to reflect number of requested copies */
hdr2 = (struct mitsu9550_hdr2 *) (ctx->databuf + sizeof(struct mitsu9550_hdr1));
hdr2->copies = cpu_to_be16(copies);
@ -602,18 +602,7 @@ top:
sleep(1);
}
/* This printer handles copies internally */
copies = 1;
/* Clean up */
if (terminate)
copies = 1;
INFO("Print complete (%d copies remaining)\n", copies - 1);
if (copies && --copies) {
goto top;
}
INFO("Print complete\n");
return CUPS_BACKEND_OK;
}
@ -779,7 +768,7 @@ static int mitsu9550_cmdline_arg(void *vctx, int argc, char **argv)
/* Exported */
struct dyesub_backend mitsu9550_backend = {
.name = "Mitsubishi CP-9550DW-S",
.version = "0.13",
.version = "0.14",
.uri_prefix = "mitsu9550",
.cmdline_usage = mitsu9550_cmdline,
.cmdline_arg = mitsu9550_cmdline_arg,

View File

@ -1573,14 +1573,7 @@ top:
if (state != S_FINISHED)
goto top;
/* This printer handles copies internally */
copies = 1;
/* Clean up */
if (terminate)
copies = 1;
INFO("Print complete (%d copies remaining)\n", copies - 1);
INFO("Print complete\n");
if (copies && --copies) {
state = S_IDLE;
@ -1634,7 +1627,7 @@ static int shinkos1245_query_serno(struct libusb_device_handle *dev, uint8_t end
struct dyesub_backend shinkos1245_backend = {
.name = "Shinko/Sinfonia CHC-S1245",
.version = "0.04WIP",
.version = "0.05WIP",
.uri_prefix = "shinkos1245",
.cmdline_usage = shinkos1245_cmdline,
.cmdline_arg = shinkos1245_cmdline_arg,

View File

@ -1677,19 +1677,7 @@ static int shinkos2145_main_loop(void *vctx, int copies) {
if (state != S_FINISHED)
goto top;
/* This printer handles copies internally */
copies = 1;
/* Clean up */
if (terminate)
copies = 1;
INFO("Print complete (%d copies remaining)\n", copies - 1);
if (copies && --copies) {
state = S_IDLE;
goto top;
}
INFO("Print complete\n");
return CUPS_BACKEND_OK;
@ -1744,7 +1732,7 @@ static int shinkos2145_query_serno(struct libusb_device_handle *dev, uint8_t end
struct dyesub_backend shinkos2145_backend = {
.name = "Shinko/Sinfonia CHC-S2145",
.version = "0.44",
.version = "0.45",
.uri_prefix = "shinkos2145",
.cmdline_usage = shinkos2145_cmdline,
.cmdline_arg = shinkos2145_cmdline_arg,

View File

@ -1895,19 +1895,7 @@ top:
if (state != S_FINISHED)
goto top;
/* This printer handles copies internally */
copies = 1;
/* Clean up */
if (terminate)
copies = 1;
INFO("Print complete (%d copies remaining)\n", copies - 1);
if (copies && --copies) {
state = S_IDLE;
goto top;
}
INFO("Print complete\n");
return CUPS_BACKEND_OK;
@ -1962,7 +1950,7 @@ static int shinkos6145_query_serno(struct libusb_device_handle *dev, uint8_t end
struct dyesub_backend shinkos6145_backend = {
.name = "Shinko/Sinfonia CHC-S6145",
.version = "0.05WIP",
.version = "0.06WIP",
.uri_prefix = "shinkos6145",
.cmdline_usage = shinkos6145_cmdline,
.cmdline_arg = shinkos6145_cmdline_arg,

View File

@ -1786,19 +1786,7 @@ top:
if (state != S_FINISHED)
goto top;
/* This printer handles copies internally */
copies = 1;
/* Clean up */
if (terminate)
copies = 1;
INFO("Print complete (%d copies remaining)\n", copies - 1);
if (copies && --copies) {
state = S_IDLE;
goto top;
}
INFO("Print complete\n");
return CUPS_BACKEND_OK;