]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - filter/rastertohp.c
Import CUPS v1.7.1
[thirdparty/cups.git] / filter / rastertohp.c
index e39194f627ab4d07c40afff578307d97967cae9a..5efad593b09ccf9fc9b93c922a0b98d633b25004 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * "$Id: rastertohp.c 7834 2008-08-04 21:02:09Z mike $"
+ * "$Id: rastertohp.c 10996 2013-05-29 11:51:34Z msweet $"
  *
  *   Hewlett-Packard Page Control Language filter for CUPS.
  *
- *   Copyright 2007-2010 by Apple Inc.
+ *   Copyright 2007-2012 by Apple Inc.
  *   Copyright 1993-2007 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -707,9 +707,9 @@ main(int  argc,                             /* I - Number of command-line arguments */
     * and return.
     */
 
-    _cupsLangPrintf(stderr,
-                    _("Usage: %s job-id user title copies options [file]\n"),
-                    "rastertohp");
+    _cupsLangPrintFilter(stderr, "ERROR",
+                         _("%s job-id user title copies options [file]"),
+                        "rastertohp");
     return (1);
   }
 
@@ -721,8 +721,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
   {
     if ((fd = open(argv[6], O_RDONLY)) == -1)
     {
-      _cupsLangPrintf(stderr, _("ERROR: Unable to open raster file - %s\n"),
-                      strerror(errno));
+      _cupsLangPrintError("ERROR", _("Unable to open raster file"));
       sleep(1);
       return (1);
     }
@@ -761,7 +760,8 @@ main(int  argc,                             /* I - Number of command-line arguments */
     ppd_status_t       status;         /* PPD error */
     int                        linenum;        /* Line number */
 
-    _cupsLangPrintf(stderr, _("ERROR: The PPD file could not be opened.\n"));
+    _cupsLangPrintFilter(stderr, "ERROR",
+                         _("The PPD file could not be opened."));
 
     status = ppdLastError(&linenum);
 
@@ -790,6 +790,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
     Page ++;
 
     fprintf(stderr, "PAGE: %d %d\n", Page, header.NumCopies);
+    _cupsLangPrintFilter(stderr, "INFO", _("Starting page %d."), Page);
 
    /*
     * Start the page...
@@ -811,8 +812,13 @@ main(int  argc,                            /* I - Number of command-line arguments */
        break;
 
       if ((y & 127) == 0)
-        _cupsLangPrintf(stderr, _("INFO: Printing page %d, %d%% complete...\n"),
-                        Page, 100 * y / header.cupsHeight);
+      {
+        _cupsLangPrintFilter(stderr, "INFO",
+                            _("Printing page %d, %d%% complete."),
+                            Page, 100 * y / header.cupsHeight);
+        fprintf(stderr, "ATTR: job-media-progress=%d\n",
+               100 * y / header.cupsHeight);
+      }
 
      /*
       * Read a line of graphics...
@@ -836,6 +842,8 @@ main(int  argc,                             /* I - Number of command-line arguments */
     * Eject the page...
     */
 
+    _cupsLangPrintFilter(stderr, "INFO", _("Finished page %d."), Page);
+
     EndPage();
 
     if (Canceled)
@@ -865,17 +873,14 @@ main(int  argc,                           /* I - Number of command-line arguments */
 
   if (Page == 0)
   {
-    _cupsLangPuts(stderr, _("ERROR: No pages were found.\n"));
+    _cupsLangPrintFilter(stderr, "ERROR", _("No pages were found."));
     return (1);
   }
   else
-  {
-    _cupsLangPuts(stderr, _("INFO: Ready to print.\n"));
     return (0);
-  }
 }
 
 
 /*
- * End of "$Id: rastertohp.c 7834 2008-08-04 21:02:09Z mike $".
+ * End of "$Id: rastertohp.c 10996 2013-05-29 11:51:34Z msweet $".
  */