Skip to content

Commit

Permalink
Added output message prefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmayanand44 committed Jun 5, 2019
1 parent 93e5f7b commit d11397c
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions filter/pdftoraster.cxx
Expand Up @@ -338,7 +338,7 @@ static void parseOpts(int argc, char **argv)
ppd_attr_t *attr;

if (argc < 6 || argc > 7) {
fprintf(stderr, "Usage: %s job-id user title copies options [file]\n",
fprintf(stderr, "ERROR: Usage: %s job-id user title copies options [file]\n",
argv[0]);
exit(1);
}
Expand Down Expand Up @@ -1361,7 +1361,7 @@ static void selectConvertFunc(cups_raster_t *raster)
COLORSPACE_SH(dcst) |
CHANNELS_SH(header.cupsNumColors) | BYTES_SH(bytes),
renderingIntent,0)) == 0) {
fprintf(stderr, "Can't create color transform");
fprintf(stderr, "ERROR: Can't create color transform");
exit(1);
}
} else {
Expand Down Expand Up @@ -1432,7 +1432,7 @@ static void selectConvertFunc(cups_raster_t *raster)
convertCSpace = W8toK8;
break;
default:
fprintf(stderr, "Specified ColorSpace is not supported\n" );
fprintf(stderr, "ERROR: Specified ColorSpace is not supported\n" );
exit(1);
break;
}
Expand Down Expand Up @@ -1830,7 +1830,7 @@ static void outPage(poppler::document *doc1, int pageNo,
header.cupsBytesPerLine *= header.cupsNumColors;
}
if (!cupsRasterWriteHeader2(raster,&header)) {
fprintf(stderr, "Can't write page %d header\n",pageNo );
fprintf(stderr, "ERROR: Can't write page %d header\n",pageNo );
exit(1);
}

Expand Down Expand Up @@ -1917,7 +1917,7 @@ static void setPopplerColorProfile()
popplerColorProfile = NULL;
break;
default:
fprintf(stderr, "Specified ColorSpace is not supported\n" );
fprintf(stderr, "ERROR: Specified ColorSpace is not supported\n" );
exit(1);
break;
}
Expand All @@ -1942,14 +1942,14 @@ int main(int argc, char *argv[]) {

fd = cupsTempFd(name,sizeof(name));
if (fd < 0) {
fprintf(stderr, "Can't create temporary file\n");
fprintf(stderr, "ERROR: Can't create temporary file\n");
exit(1);
}

/* copy stdin to the tmp file */
while ((n = read(0,buf,BUFSIZ)) > 0) {
if (write(fd,buf,n) != n) {
fprintf(stderr, "Can't copy stdin to temporary file\n" );
fprintf(stderr, "ERROR: Can't copy stdin to temporary file\n" );
close(fd);
exit(1);
}
Expand All @@ -1963,7 +1963,7 @@ int main(int argc, char *argv[]) {
FILE *fp;

if ((fp = fopen(argv[6],"rb")) == 0) {
fprintf(stderr, "Can't open input file %s\n",argv[6]);
fprintf(stderr, "ERROR: Can't open input file %s\n",argv[6]);
exit(1);
}
parsePDFTOPDFComment(fp);
Expand All @@ -1990,7 +1990,7 @@ int main(int argc, char *argv[]) {
&& header.cupsBitsPerColor != 4
&& header.cupsBitsPerColor != 8
&& header.cupsBitsPerColor != 16) {
fprintf(stderr, "Specified color format is not supported\n");
fprintf(stderr, "ERROR: Specified color format is not supported\n");
exit(1);
}
if (header.cupsColorOrder == CUPS_ORDER_PLANAR) {
Expand Down Expand Up @@ -2025,7 +2025,7 @@ int main(int argc, char *argv[]) {
if (header.cupsColorOrder != CUPS_ORDER_CHUNKED
|| (header.cupsBitsPerColor != 8
&& header.cupsBitsPerColor != 16)) {
fprintf(stderr, "Specified color format is not supported\n");
fprintf(stderr, "ERROR: Specified color format is not supported\n");
exit(1);
}
case CUPS_CSPACE_RGB:
Expand Down Expand Up @@ -2062,7 +2062,7 @@ int main(int argc, char *argv[]) {
popplerNumColors = 1;
break;
default:
fprintf(stderr, "Specified ColorSpace is not supported\n");
fprintf(stderr, "ERROR: Specified ColorSpace is not supported\n");
exit(1);
break;
}
Expand All @@ -2073,7 +2073,7 @@ int main(int argc, char *argv[]) {

if ((raster = cupsRasterOpen(1, pwgraster ? CUPS_RASTER_WRITE_PWG :
CUPS_RASTER_WRITE)) == 0) {
fprintf(stderr, "Can't open raster stream\n");
fprintf(stderr, "ERROR: Can't open raster stream\n");
exit(1);
}
selectConvertFunc(raster);
Expand Down

0 comments on commit d11397c

Please sign in to comment.