/*
- * "$Id: parallel.c 6178 2007-01-03 18:09:17Z mike $"
+ * "$Id: parallel.c 6649 2007-07-11 21:46:42Z mike $"
*
* Parallel port backend for the Common UNIX Printing System (CUPS).
*
+ * Copyright 2007 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* 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
+ * property of Apple Inc. and are protected by Federal copyright
+ * law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" 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
+ * file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
}
else if (argc < 6 || argc > 7)
{
- fputs("Usage: parallel job-id user title copies options [file]\n", stderr);
+ fprintf(stderr, _("Usage: %s job-id user title copies options [file]\n"),
+ argv[0]);
return (CUPS_BACKEND_FAILED);
}
* available printer in the class.
*/
- fputs("INFO: Unable to open parallel port, queuing on next printer "
- "in class...\n", stderr);
+ fputs(_("INFO: Unable to contact printer, queuing on next "
+ "printer in class...\n"), stderr);
/*
* Sleep 5 seconds to keep the job from requeuing too rapidly...
if (errno == EBUSY)
{
- fputs("INFO: Parallel port busy; will retry in 30 seconds...\n",
- stderr);
+ fputs(_("INFO: Printer busy; will retry in 30 seconds...\n"), stderr);
sleep(30);
}
else if (errno == ENXIO || errno == EIO || errno == ENOENT)
{
- fputs("INFO: Printer not connected; will retry in 30 seconds...\n",
+ fputs(_("INFO: Printer not connected; will retry in 30 seconds...\n"),
stderr);
sleep(30);
}
else
{
- fprintf(stderr,
- "ERROR: Unable to open parallel port device file \"%s\": %s\n",
+ fprintf(stderr, _("ERROR: Unable to open device file \"%s\": %s\n"),
resource, strerror(errno));
return (CUPS_BACKEND_FAILED);
}
tbytes = backendRunLoop(print_fd, device_fd, use_bc, side_cb);
if (print_fd != 0 && tbytes >= 0)
- fprintf(stderr, "INFO: Sent print file, " CUPS_LLFMT " bytes...\n",
- CUPS_LLCAST tbytes);
+ fprintf(stderr,
+#ifdef HAVE_LONG_LONG
+ _("INFO: Sent print file, %lld bytes...\n"),
+#else
+ _("INFO: Sent print file, %ld bytes...\n"),
+#endif /* HAVE_LONG_LONG */
+ CUPS_LLCAST tbytes);
}
/*
if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0))
{
- fputs("WARNING: Failed to read side-channel request!\n", stderr);
+ fputs(_("WARNING: Failed to read side-channel request!\n"), stderr);
return;
}
switch (command)
{
case CUPS_SC_CMD_DRAIN_OUTPUT :
- if (tcdrain(device_fd))
+ if (backendDrainOutput(print_fd, device_fd))
+ status = CUPS_SC_STATUS_IO_ERROR;
+ else if (tcdrain(device_fd))
status = CUPS_SC_STATUS_IO_ERROR;
else
status = CUPS_SC_STATUS_OK;
/*
- * End of "$Id: parallel.c 6178 2007-01-03 18:09:17Z mike $".
+ * End of "$Id: parallel.c 6649 2007-07-11 21:46:42Z mike $".
*/