Skip to content

Commit

Permalink
Remove capt_cleanup()
Browse files Browse the repository at this point in the history
capt_cleanup() was imported in 05e6cdd but never used
  • Loading branch information
mounaiban committed Aug 23, 2022
1 parent fb2327f commit 31e9440
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
27 changes: 0 additions & 27 deletions src/capt-command.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@

static uint8_t capt_iobuf[0x10000];
static size_t capt_iosize;
static cups_sc_status_t last_send_status = CUPS_SC_STATUS_NONE;
static bool sendrecv_started = false;

static void capt_debug_buf(const char *level, size_t size)
{
Expand Down Expand Up @@ -205,28 +203,3 @@ void capt_multi_send(void)
capt_send_buf();
}

void capt_cleanup(void)
{
/* For use with handling job cancellations */
if (sendrecv_started) {

if (last_send_status != CUPS_SC_STATUS_OK) {
capt_send_buf();
fprintf(stderr, "DEBUG: CAPT: finished interrupted send\n");
}

/* not else because recv cleanup is needed after finishing send */
if (last_send_status == CUPS_SC_STATUS_OK) {
size_t bytes = 0x10000;
size_t bs = 64;
while(bytes > 0) {
bytes -= bs;
cupsBackChannelRead(NULL, bs, 0.01);
}
fprintf(stderr, "DEBUG: CAPT: finished interrupted recv\n");
}

capt_iosize = 0;
sendrecv_started = false;
}
}
2 changes: 0 additions & 2 deletions src/prn_lbp2900.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,6 @@ static void lbp2900_cancel_cleanup(struct printer_state_s *state)
const struct capt_status_s *status = lbp2900_get_status(state->ops);
uint8_t jbuf[2] = { LO(job), HI(job) };

capt_cleanup();
capt_sendrecv(CAPT_GPIO, lbp2900_gpio_init, ARRAY_SIZE(lbp2900_gpio_init), NULL, 0);
send_job_start(4, status->page_completed);
capt_sendrecv(CAPT_JOB_END, jbuf, 2, NULL, 0);
Expand All @@ -382,7 +381,6 @@ static void lbp3010_cancel_cleanup(struct printer_state_s *state)
const struct capt_status_s *status = lbp2900_get_status(state->ops);
uint8_t jbuf[2] = { LO(job), HI(job) };

capt_cleanup();
capt_sendrecv(CAPT_GPIO, lbp3010_gpio_init, ARRAY_SIZE(lbp3010_gpio_init), NULL, 0);
send_job_start(4, status->page_completed);
capt_sendrecv(CAPT_JOB_END, jbuf, 2, NULL, 0);
Expand Down

0 comments on commit 31e9440

Please sign in to comment.