/*
- * "$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.
*
#include <cups/cups.h>
#include <cups/string.h>
+#include <cups/i18n.h>
#include "raster.h"
#include <stdlib.h>
#include <unistd.h>
* Set graphics mode...
*/
- if (ppd->model_number == 2)
+ if (ppd && ppd->model_number == 2)
{
/*
* Figure out the number of color planes...
* 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;
* 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);
}
*/
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);
/*
*/
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 $".
*/