[common] Add an ERROR macro to distinguish between "normal" and "error" output.
parent
c4c54470ae
commit
6d2621f205
|
@ -28,6 +28,7 @@
|
|||
#define VERSION "0.25"
|
||||
|
||||
#define DEBUG( ... ) fprintf(stderr, "DEBUG: " __VA_ARGS__ )
|
||||
#define ERROR( ... ) fprintf(stderr, "ERROR: " __VA_ARGS__ )
|
||||
|
||||
#if (__BYTE_ORDER == __LITTLE_ENDIAN)
|
||||
#define le32_to_cpu(__x) __x
|
||||
|
@ -180,7 +181,7 @@ static void setup_paper_codes(void)
|
|||
// printers[P_ES3_30]paper_codes[0x02] = -1;
|
||||
// printers[P_ES3_30]paper_codes[0x03] = -1;
|
||||
|
||||
/* SELPHY ES40/CP790 paper codes */
|
||||
/* SELPHY ES40/CP790 paper codes -- UNKNOWN */
|
||||
// printers[P_ES40_CP790].paper_codes[0x00] = -1;
|
||||
// printers[P_ES40_CP790].paper_codes[0x01] = -1;
|
||||
// printers[P_ES40_CP790].paper_codes[0x02] = -1;
|
||||
|
|
|
@ -126,7 +126,7 @@ int main(int argc, char **argv)
|
|||
break;
|
||||
}
|
||||
if (printer_type2 == P_END) {
|
||||
DEBUG("Unrecognized printer!\n");
|
||||
ERROR("Unrecognized printer!\n");
|
||||
DEBUG("readback: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
|
||||
rdbuf[0], rdbuf[1], rdbuf[2], rdbuf[3],
|
||||
rdbuf[4], rdbuf[5], rdbuf[6], rdbuf[7],
|
||||
|
@ -138,12 +138,12 @@ int main(int argc, char **argv)
|
|||
|
||||
printer_type = parse_printjob(buffer, &bw_mode, &plane_len);
|
||||
if (printer_type < 0) {
|
||||
DEBUG("Unrecognized file format!\n");
|
||||
ERROR("Unrecognized file format!\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (printer_type != printer_type2) {
|
||||
DEBUG("File intended for a %s printer, aborting!\n", printers[printer_type].model);
|
||||
ERROR("File intended for a %s printer, aborting!\n", printers[printer_type].model);
|
||||
exit(-1);
|
||||
} else {
|
||||
DEBUG("Printing a %s file\n", printers[printer_type].model);
|
||||
|
|
Loading…
Reference in New Issue