#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
+#include <errno.h>
/*
* and return.
*/
- fprintf(stderr, _("Usage: %s job-id user title copies options [file]\n"),
- argv[0]);
+ _cupsLangPrintf(stderr,
+ _("Usage: %s job-id user title copies options [file]\n"),
+ "rastertohp");
return (1);
}
{
if ((fd = open(argv[6], O_RDONLY)) == -1)
{
- perror("ERROR: Unable to open raster file - ");
+ _cupsLangPrintf(stderr, _("ERROR: Unable to open raster file - %s\n"),
+ strerror(errno));
sleep(1);
return (1);
}
break;
if ((y & 127) == 0)
- fprintf(stderr, _("INFO: Printing page %d, %d%% complete...\n"), Page,
- 100 * y / header.cupsHeight);
+ _cupsLangPrintf(stderr, _("INFO: Printing page %d, %d%% complete...\n"),
+ Page, 100 * y / header.cupsHeight);
/*
* Read a line of graphics...
*/
if (Page == 0)
- fputs(_("ERROR: No pages found!\n"), stderr);
+ {
+ _cupsLangPuts(stderr, _("ERROR: No pages found!\n"));
+ return (1);
+ }
else
- fputs(_("INFO: Ready to print.\n"), stderr);
-
- return (Page == 0);
+ {
+ _cupsLangPuts(stderr, _("INFO: Ready to print.\n"));
+ return (0);
+ }
}