]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - filter/rastertohp.c
Import CUPS 1.4svn-r7226.
[thirdparty/cups.git] / filter / rastertohp.c
index 32263536f9fefdb25d2e7aa032f8c32e61ead8c5..f35b58ca7639e8a586681a422a16efa1a6d35f4c 100644 (file)
@@ -1,26 +1,17 @@
 /*
- * "$Id$"
+ * "$Id: rastertohp.c 6649 2007-07-11 21:46:42Z mike $"
  *
  *   Hewlett-Packard Page Control Language filter for the Common UNIX
  *   Printing System (CUPS).
  *
- *   Copyright 1993-2005 by Easy Software Products.
+ *   Copyright 2007-2008 by Apple Inc.
+ *   Copyright 1993-2007 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
- *   property of Easy Software Products and are protected by Federal
- *   copyright law.  Distribution and use rights are outlined in the file
- *   "LICENSE.txt" which should have been included with this file.  If this
- *   file is missing or damaged please contact Easy Software Products
- *   at:
- *
- *       Attn: CUPS Licensing Information
- *       Easy Software Products
- *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636 USA
- *
- *       Voice: (301) 373-9600
- *       EMail: cups-info@cups.org
- *         WWW: http://www.cups.org
+ *   property of Apple Inc. and are protected by Federal copyright
+ *   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
+ *   which should have been included with this file.  If this file is
+ *   file is missing or damaged, see the license at "http://www.cups.org/".
  *
  *   This file is subject to the Apple OS-Developed Software exception.
  *
@@ -42,6 +33,7 @@
 
 #include <cups/cups.h>
 #include <cups/string.h>
+#include <cups/i18n.h>
 #include "raster.h"
 #include <stdlib.h>
 #include <unistd.h>
@@ -285,7 +277,7 @@ StartPage(ppd_file_t         *ppd,  /* I - PPD file */
   * Set graphics mode...
   */
 
-  if (ppd->model_number == 2)
+  if (ppd && ppd->model_number == 2)
   {
    /*
     * Figure out the number of color planes...
@@ -390,7 +382,12 @@ StartPage(ppd_file_t         *ppd, /* I - PPD file */
   * Allocate memory for a line of graphics...
   */
 
-  Planes[0] = malloc(header->cupsBytesPerLine);
+  if ((Planes[0] = malloc(header->cupsBytesPerLine)) == NULL)
+  {
+    fputs("ERROR: Unable to allocate memory!\n", stderr);
+    exit(1);
+  }
+
   for (plane = 1; plane < NumPlanes; plane ++)
     Planes[plane] = Planes[0] + plane * header->cupsBytesPerLine / NumPlanes;
 
@@ -762,7 +759,8 @@ main(int  argc,             /* I - Number of command-line arguments */
     * and return.
     */
 
-    fputs("ERROR: rastertopcl job-id user title copies options [file]\n", stderr);
+    fprintf(stderr, _("Usage: %s job-id user title copies options [file]\n"),
+            argv[0]);
     return (1);
   }
 
@@ -825,7 +823,7 @@ main(int  argc,             /* I - Number of command-line arguments */
       */
 
       if ((y & 127) == 0)
-        fprintf(stderr, "INFO: Printing page %d, %d%% complete...\n", Page,
+        fprintf(stderr, _("INFO: Printing page %d, %d%% complete...\n"), Page,
                100 * y / header.cupsHeight);
 
      /*
@@ -875,14 +873,14 @@ main(int  argc,           /* I - Number of command-line arguments */
   */
 
   if (Page == 0)
-    fputs("ERROR: No pages found!\n", stderr);
+    fputs(_("ERROR: No pages found!\n"), stderr);
   else
-    fputs("INFO: " CUPS_SVERSION " is ready to print.\n", stderr);
+    fputs(_("INFO: Ready to print.\n"), stderr);
 
   return (Page == 0);
 }
 
 
 /*
- * End of "$Id$".
+ * End of "$Id: rastertohp.c 6649 2007-07-11 21:46:42Z mike $".
  */