Comparar commits
1 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 92986e272e |
@@ -1,6 +1,109 @@
|
||||
CHANGES.txt - 2007-07-27
|
||||
CHANGES.txt - 2007-09-18
|
||||
------------------------
|
||||
|
||||
CHANGES IN CUPS V1.3.2
|
||||
|
||||
- The 1.3.1 release was incorrectly created from the
|
||||
1.4.x source tree (STR #2519)
|
||||
- Added support for 32/64-bit libraries on HP-UX
|
||||
(STR #2520)
|
||||
- The scheduler incorrectly used portrait as the default
|
||||
orientation (STR #2513)
|
||||
- The scheduler no longer writes the printcap file for
|
||||
every remote printer update (STR #2512)
|
||||
- Remote raw printing with multiple copies did not work
|
||||
(STR #2518)
|
||||
- Updated the configure script to require at least autoconf
|
||||
2.60 (STR #2515)
|
||||
- Some gzip'd PPD files were not read in their entirety
|
||||
(STR #2510)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.3.1
|
||||
|
||||
- Documentation updates.
|
||||
- The USB backend on Mac OS X could hang if the driver and
|
||||
printer did not match.
|
||||
- Delegated Kerberos credentials were not working.
|
||||
- "make distclean" incorrectly removed the edit-config.tmpl
|
||||
files (STR #2508)
|
||||
- Fix compile problem on HP-UX (STR #2501)
|
||||
- The cupstestppd utility now tests for resolutions greater
|
||||
than 99999 DPI to detect a missing "x" between the X and Y
|
||||
resolutions.
|
||||
- Fixed many problems in the various translations and added
|
||||
a new "checkpo" utility to validate them.
|
||||
- The cupstestppd utility now tests the custom page size code
|
||||
for CUPS raster drivers.
|
||||
- cupsLangDefault() did not attempt to return a language that
|
||||
was supported by the calling application.
|
||||
- If a remote printer stopped while a job was being sent, the
|
||||
local queue would also get stopped and the job re-queued,
|
||||
resulting in duplicate prints in some cases.
|
||||
- A few Apple-specific job options needed to be omitted when
|
||||
printing a banner page.
|
||||
- The new peer credential support did not compile on FreeBSD
|
||||
(STR #2495)
|
||||
- Direct links to help files did not set the current section
|
||||
so the table-of-contents was not shown.
|
||||
- The configure script did not support --localedir=foo (STR #2488)
|
||||
- The backends were not displaying their localized messages.
|
||||
- CUPS-Authenticate-Job did not require Kerberos authentication
|
||||
on queues protected by Kerberos.
|
||||
- The Zebra ZPL driver did not work with Brady label printers
|
||||
(STR #2487)
|
||||
- Norwegian wasn't localized on Mac OS X.
|
||||
- getnameinfo() returns an error on some systems when DNS is
|
||||
not available, leading to numerous problems (STR #2486)
|
||||
- The cupsfilter command did not work properly on Mac OS X.
|
||||
- The scheduler makefile contained a typo (STR #2483)
|
||||
- The TBCP and BCP port monitors did not handle the trailing
|
||||
CTRL-D in some PostScript output properly.
|
||||
- Fixed the localization instructions and German template for
|
||||
the "Find New Printers" button (STR #2478)
|
||||
- The web interface did not work with the Chinese localization
|
||||
(STR #2477)
|
||||
- The web interface home page did not work for languages that
|
||||
were only partially localized (STR #2472)
|
||||
- Updated the Spanish web interface localization (STR #2473)
|
||||
- ppdLocalize() did not work for country-specific localizations.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.3.0
|
||||
|
||||
- The scheduler did not handle out-of-file conditions
|
||||
gracefully when accepting new connections, leading to
|
||||
heavy CPU usage.
|
||||
- The scheduler did not detect ServerBin misconfigurations
|
||||
(STR #2470)
|
||||
- "AuthType Default" did not work as expected when the
|
||||
"DefaultAuthType foo" line appeared after it in the
|
||||
cupsd.conf file.
|
||||
- The on-line help did not describe many common printing
|
||||
options (STR #1846)
|
||||
- The IPP backend did not return the "auth required" status
|
||||
when printing to a Kerberos-protected queue.
|
||||
- The scheduler was not looking in the correct directories
|
||||
for LSB PPD files (STR #2464)
|
||||
- Changed references to ESP Ghostscript to GPL Ghostscript
|
||||
(STR #2463)
|
||||
- The PostScript filter did not cleanly terminate when
|
||||
the job was canceled or stopped.
|
||||
- Fixed generation of Kerberos credentials for remote
|
||||
printing. Note that this requires a recent version of
|
||||
MIT Kerberos with a working krb5_cc_new_unique()
|
||||
function or Heimdal Kerberos.
|
||||
- Added Portuguese and updated Italian message catalogs.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.3rc2
|
||||
|
||||
- Added more range checking to the pdftops filter.
|
||||
- The scheduler would crash if a remote IPP queue was stopped
|
||||
(STR #2460)
|
||||
- The scheduler did not allow "DefaultAuthType None".
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.3rc1
|
||||
|
||||
- Updated the German localization (STR #2443)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
CREDITS.txt - 2007-02-05
|
||||
CREDITS.txt - 2007-09-10
|
||||
------------------------
|
||||
|
||||
Few projects are completed by one person, and CUPS is no exception. We'd
|
||||
@@ -19,6 +19,7 @@ like to thank the following individuals for their contributions:
|
||||
Till Kamppeter - Bug fixes, beta testing, evangelism.
|
||||
Kenshi Muto - Japanese localization, patches, and
|
||||
testing.
|
||||
Tomohiro Kato - Japanese localization.
|
||||
Kiko - Bug fixes.
|
||||
Sergey V. Kovalyov - ESP Print Pro and CUPS beta tester.
|
||||
Marek Laane - Estonian translation.
|
||||
@@ -36,7 +37,7 @@ like to thank the following individuals for their contributions:
|
||||
Opher Shachar - Hebrew localization.
|
||||
Stuart Stevens - HP JetDirect IPP information.
|
||||
Andrea Suatoni - IRIX desktop integration and testing.
|
||||
Tomohiro Kato - Japanese localization.
|
||||
Teppo Turlianen - Finnish localization.
|
||||
Tim Waugh - Lots of patches, testing, and Linux
|
||||
integration.
|
||||
Yugami - LDAP browsing support.
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
INSTALL - CUPS v1.3rc1 - 2007-07-27
|
||||
-----------------------------------
|
||||
INSTALL - CUPS v1.3.2 - 2007-09-18
|
||||
----------------------------------
|
||||
|
||||
This file describes how to compile and install CUPS from source
|
||||
code. For more information on CUPS see the file called
|
||||
"README.txt". A complete change log can be found in
|
||||
"CHANGES.txt".
|
||||
|
||||
**** IF YOU HAVE A NON-POSTSCRIPT PRINTER, YOU WILL ALSO ****
|
||||
**** NEED TO INSTALL ESP GHOSTSCRIPT AFTER YOU INSTALL CUPS ****
|
||||
**** IF YOU HAVE A NON-POSTSCRIPT PRINTER AND ARE NOT ****
|
||||
**** RUNNING MAC OS X, YOU WILL ALSO NEED TO INSTALL GPL ****
|
||||
**** GHOSTSCRIPT WITH THE "cups" DRIVER AFTER YOU INSTALL ****
|
||||
**** CUPS. ****
|
||||
|
||||
|
||||
BEFORE YOU BEGIN
|
||||
@@ -20,7 +22,7 @@ BEFORE YOU BEGIN
|
||||
The makefiles used by the project should work with all
|
||||
versions of make. We've tested them with GNU make as well as
|
||||
the make programs shipped by Compaq, HP, SGI, and Sun.
|
||||
FreeBSD users should use GNU make (gmake).
|
||||
BSD users should use GNU make (gmake).
|
||||
|
||||
Besides these tools you'll want the JPEG, PNG, TIFF, and ZLIB
|
||||
libraries for image support, the CDSA, GNU TLS, or OpenSSL
|
||||
@@ -29,10 +31,16 @@ BEFORE YOU BEGIN
|
||||
compile and run without these, however you'll miss out on
|
||||
many of the features provided by CUPS.
|
||||
|
||||
Kerberos support requires a very recent version of the MIT
|
||||
implementation with the krb5_cc_new_unique() function or the
|
||||
Heimdal implementation, along with the corresponding GSSAPI
|
||||
pieces.
|
||||
|
||||
Also, please note that CUPS no longer includes the
|
||||
Ghostscript- based pstoraster filter. You *must* download
|
||||
ESP Ghostscript separately from the CUPS web site if you want
|
||||
to print PostScript files to non-PostScript printers.
|
||||
GPL Ghostscript separately from the CUPS web site if you want
|
||||
to print PostScript files to non-PostScript printers on
|
||||
operating systems other than Mac OS X.
|
||||
|
||||
|
||||
COMPILING FROM SUBVERSION
|
||||
|
||||
@@ -63,9 +63,8 @@ distclean: clean
|
||||
$(RM) man/cups-lpd.man man/cupsaddsmb.man man/cupsd.man
|
||||
$(RM) man/cupsd.conf.man man/lpoptions.man
|
||||
$(RM) packaging/cups.list
|
||||
$(RM) templates/edit-config.tmpl templates/header.tmpl
|
||||
$(RM) templates/header.tmpl
|
||||
-$(RM) doc/*/index.html
|
||||
-$(RM) templates/*/edit-config.tmpl
|
||||
-$(RM) templates/*/header.tmpl
|
||||
-$(RM) -r autom4te*.cache
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
README - CUPS v1.3rc1 - 2007-07-27
|
||||
----------------------------------
|
||||
README - CUPS v1.3.2 - 2007-09-18
|
||||
---------------------------------
|
||||
|
||||
Looking for compile instructions? Read the file "INSTALL.txt"
|
||||
instead...
|
||||
@@ -22,12 +22,11 @@ INTRODUCTION
|
||||
to support real-world printing under UNIX.
|
||||
|
||||
CUPS includes an image file RIP that supports printing of
|
||||
image files to non-PostScript printers. A customized version
|
||||
of GPL Ghostscript for CUPS called ESP Ghostscript is
|
||||
available separately to support printing of PostScript files
|
||||
within the CUPS driver framework. Sample drivers for Dymo,
|
||||
EPSON, HP, OKIDATA, and Zebra printers are included that use
|
||||
these filters.
|
||||
image files to non-PostScript printers. GPL Ghostscript now
|
||||
includes the "cups" driver to support printing of PostScript
|
||||
files within the CUPS driver framework. Sample drivers for
|
||||
Dymo, EPSON, HP, OKIDATA, and Zebra printers are included that
|
||||
use these filters.
|
||||
|
||||
CUPS is licensed under the GNU General Public License and GNU
|
||||
Library General Public License versions 2.
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
include ../Makedefs
|
||||
|
||||
RBACKENDS = lpd
|
||||
UBACKENDS = ipp $(PAP) $(LEGACY_BACKENDS) serial snmp socket usb
|
||||
RBACKENDS = ipp lpd
|
||||
UBACKENDS = $(PAP) $(LEGACY_BACKENDS) serial snmp socket usb
|
||||
TARGETS = betest test1284 libbackend.a $(RBACKENDS) $(UBACKENDS)
|
||||
LIBOBJS = ieee1284.o runloop.o
|
||||
OBJS = betest.o ipp.o lpd.o pap.o parallel.o scsi.o \
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
*/
|
||||
|
||||
static char *password = NULL; /* Password for device URI */
|
||||
static int password_tries = 0; /* Password tries */
|
||||
#ifdef __APPLE__
|
||||
static char pstmpname[1024] = ""; /* Temporary PostScript file name */
|
||||
#endif /* __APPLE__ */
|
||||
@@ -66,12 +67,12 @@ static void cancel_job(http_t *http, const char *uri, int id,
|
||||
const char *resource, const char *user, int version);
|
||||
static void check_printer_state(http_t *http, const char *uri,
|
||||
const char *resource, const char *user,
|
||||
int version);
|
||||
int version, int job_id);
|
||||
#ifdef HAVE_LIBZ
|
||||
static void compress_files(int num_files, char **files);
|
||||
#endif /* HAVE_LIBZ */
|
||||
static const char *password_cb(const char *);
|
||||
static int report_printer_state(ipp_t *ipp);
|
||||
static int report_printer_state(ipp_t *ipp, int job_id);
|
||||
|
||||
#ifdef __APPLE__
|
||||
static int run_pictwps_filter(char **argv, const char *filename);
|
||||
@@ -101,9 +102,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
resource[1024], /* Resource info (printer name) */
|
||||
addrname[256], /* Address name */
|
||||
*optptr, /* Pointer to URI options */
|
||||
name[255], /* Name of option */
|
||||
value[255], /* Value of option */
|
||||
*ptr; /* Pointer into name or value */
|
||||
*name, /* Name of option */
|
||||
*value, /* Value of option */
|
||||
sep; /* Separator character */
|
||||
int num_files; /* Number of files to print */
|
||||
char **files, /* Files to print */
|
||||
*filename; /* Pointer to single filename */
|
||||
@@ -131,7 +132,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
ipp_attribute_t *printer_accepting; /* printer-is-accepting-jobs */
|
||||
int copies, /* Number of copies for job */
|
||||
copies_remaining; /* Number of copies remaining */
|
||||
const char *content_type; /* CONTENT_TYPE environment variable */
|
||||
const char *content_type, /* CONTENT_TYPE environment variable */
|
||||
*final_content_type; /* FINAL_CONTENT_TYPE environment var */
|
||||
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
struct sigaction action; /* Actions for POSIX signals */
|
||||
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
|
||||
@@ -198,8 +200,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
}
|
||||
else if (argc < 6)
|
||||
{
|
||||
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"),
|
||||
argv[0]);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
@@ -207,12 +210,16 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Get the (final) content type...
|
||||
*/
|
||||
|
||||
if ((content_type = getenv("FINAL_CONTENT_TYPE")) == NULL)
|
||||
if ((content_type = getenv("CONTENT_TYPE")) == NULL)
|
||||
content_type = "application/octet-stream";
|
||||
if ((content_type = getenv("CONTENT_TYPE")) == NULL)
|
||||
content_type = "application/octet-stream";
|
||||
|
||||
if (!strncmp(content_type, "printer/", 8))
|
||||
content_type = "application/vnd.cups-raw";
|
||||
if ((final_content_type = getenv("FINAL_CONTENT_TYPE")) == NULL)
|
||||
{
|
||||
final_content_type = content_type;
|
||||
|
||||
if (!strncmp(final_content_type, "printer/", 8))
|
||||
final_content_type = "application/vnd.cups-raw";
|
||||
}
|
||||
|
||||
/*
|
||||
* Extract the hostname and printer name from the URI...
|
||||
@@ -223,8 +230,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
hostname, sizeof(hostname), &port,
|
||||
resource, sizeof(resource)) < HTTP_URI_OK)
|
||||
{
|
||||
fputs(_("ERROR: Missing device URI on command-line and no "
|
||||
"DEVICE_URI environment variable!\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("ERROR: Missing device URI on command-line and no "
|
||||
"DEVICE_URI environment variable!\n"));
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
@@ -262,29 +270,30 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Get the name...
|
||||
*/
|
||||
|
||||
for (ptr = name; *optptr && *optptr != '=';)
|
||||
if (ptr < (name + sizeof(name) - 1))
|
||||
*ptr++ = *optptr++;
|
||||
*ptr = '\0';
|
||||
name = optptr;
|
||||
|
||||
if (*optptr == '=')
|
||||
while (*optptr && *optptr != '=' && *optptr != '+' && *optptr != '&')
|
||||
optptr ++;
|
||||
|
||||
if ((sep = *optptr) != '\0')
|
||||
*optptr++ = '\0';
|
||||
|
||||
if (sep == '=')
|
||||
{
|
||||
/*
|
||||
* Get the value...
|
||||
*/
|
||||
|
||||
optptr ++;
|
||||
value = optptr;
|
||||
|
||||
for (ptr = value; *optptr && *optptr != '+' && *optptr != '&';)
|
||||
if (ptr < (value + sizeof(value) - 1))
|
||||
*ptr++ = *optptr++;
|
||||
*ptr = '\0';
|
||||
|
||||
if (*optptr == '+' || *optptr == '&')
|
||||
while (*optptr && *optptr != '+' && *optptr != '&')
|
||||
optptr ++;
|
||||
|
||||
if (*optptr)
|
||||
*optptr++ = '\0';
|
||||
}
|
||||
else
|
||||
value[0] = '\0';
|
||||
value = (char *)"";
|
||||
|
||||
/*
|
||||
* Process the option...
|
||||
@@ -326,7 +335,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
cupsSetEncryption(HTTP_ENCRYPT_IF_REQUESTED);
|
||||
else
|
||||
{
|
||||
fprintf(stderr,
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unknown encryption option value \"%s\"!\n"),
|
||||
value);
|
||||
}
|
||||
@@ -339,7 +348,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
version = 1;
|
||||
else
|
||||
{
|
||||
fprintf(stderr,
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unknown version option value \"%s\"!\n"),
|
||||
value);
|
||||
}
|
||||
@@ -368,8 +377,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Unknown option...
|
||||
*/
|
||||
|
||||
fprintf(stderr, _("ERROR: Unknown option \"%s\" with value \"%s\"!\n"),
|
||||
name, value);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unknown option \"%s\" with value \"%s\"!\n"),
|
||||
name, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -421,10 +431,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Point to the single file from stdin...
|
||||
*/
|
||||
|
||||
filename = tmpfilename;
|
||||
files = &filename;
|
||||
num_files = 1;
|
||||
|
||||
filename = tmpfilename;
|
||||
num_files = 1;
|
||||
files = &filename;
|
||||
send_options = 0;
|
||||
}
|
||||
else
|
||||
@@ -433,10 +442,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Point to the files on the command-line...
|
||||
*/
|
||||
|
||||
num_files = argc - 6;
|
||||
files = argv + 6;
|
||||
|
||||
send_options = strncasecmp(content_type, "application/vnd.cups-", 21) != 0;
|
||||
num_files = argc - 6;
|
||||
files = argv + 6;
|
||||
send_options = 1;
|
||||
|
||||
#ifdef HAVE_LIBZ
|
||||
if (compression)
|
||||
@@ -469,7 +477,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Try loading authentication information from the environment.
|
||||
*/
|
||||
|
||||
if ((ptr = getenv("AUTH_USERNAME")) != NULL)
|
||||
const char *ptr = getenv("AUTH_USERNAME");
|
||||
|
||||
if (ptr)
|
||||
cupsSetUser(ptr);
|
||||
|
||||
password = getenv("AUTH_PASSWORD");
|
||||
@@ -487,8 +497,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
do
|
||||
{
|
||||
fprintf(stderr, _("INFO: Connecting to %s on port %d...\n"),
|
||||
hostname, port);
|
||||
_cupsLangPrintf(stderr, _("INFO: Connecting to %s on port %d...\n"),
|
||||
hostname, port);
|
||||
|
||||
if ((http = httpConnectEncrypt(hostname, port, cupsEncryption())) == NULL)
|
||||
{
|
||||
@@ -504,8 +514,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
fputs(_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
|
||||
if (argc == 6 || strcmp(filename, argv[6]))
|
||||
unlink(filename);
|
||||
@@ -524,16 +535,16 @@ main(int argc, /* I - Number of command-line args */
|
||||
{
|
||||
if (contimeout && (time(NULL) - start_time) > contimeout)
|
||||
{
|
||||
fputs(_("ERROR: Printer not responding!\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("ERROR: Printer not responding!\n"));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
recoverable = 1;
|
||||
|
||||
fprintf(stderr,
|
||||
_("WARNING: recoverable: Network host \'%s\' is busy; will "
|
||||
"retry in %d seconds...\n"),
|
||||
hostname, delay);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: recoverable: Network host \'%s\' is busy; "
|
||||
"will retry in %d seconds...\n"),
|
||||
hostname, delay);
|
||||
|
||||
sleep(delay);
|
||||
|
||||
@@ -542,8 +553,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
}
|
||||
else if (h_errno)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"),
|
||||
hostname);
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"),
|
||||
hostname);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
else
|
||||
@@ -551,8 +562,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
recoverable = 1;
|
||||
|
||||
fprintf(stderr, "DEBUG: Connection error: %s\n", strerror(errno));
|
||||
fputs(_("ERROR: recoverable: Unable to connect to printer; will "
|
||||
"retry in 30 seconds...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("ERROR: recoverable: Unable to connect to printer; will "
|
||||
"retry in 30 seconds...\n"));
|
||||
sleep(30);
|
||||
}
|
||||
|
||||
@@ -571,7 +583,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
}
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
fprintf(stderr, _("INFO: Connected to %s...\n"), hostname);
|
||||
_cupsLangPrintf(stderr, _("INFO: Connected to %s...\n"), hostname);
|
||||
|
||||
#ifdef AF_INET6
|
||||
if (http->hostaddr->addr.sa_family == AF_INET6)
|
||||
@@ -637,18 +649,18 @@ main(int argc, /* I - Number of command-line args */
|
||||
{
|
||||
if (contimeout && (time(NULL) - start_time) > contimeout)
|
||||
{
|
||||
fputs(_("ERROR: Printer not responding!\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("ERROR: Printer not responding!\n"));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
recoverable = 1;
|
||||
|
||||
fprintf(stderr,
|
||||
_("WARNING: recoverable: Network host \'%s\' is busy; will "
|
||||
"retry in %d seconds...\n"),
|
||||
hostname, delay);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: recoverable: Network host \'%s\' is busy; "
|
||||
"will retry in %d seconds...\n"),
|
||||
hostname, delay);
|
||||
|
||||
report_printer_state(supported);
|
||||
report_printer_state(supported, 0);
|
||||
|
||||
sleep(delay);
|
||||
|
||||
@@ -662,14 +674,15 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Switch to IPP/1.0...
|
||||
*/
|
||||
|
||||
fputs(_("INFO: Printer does not support IPP/1.1, trying IPP/1.0...\n"),
|
||||
stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer does not support IPP/1.1, trying "
|
||||
"IPP/1.0...\n"));
|
||||
version = 0;
|
||||
httpReconnect(http);
|
||||
}
|
||||
else if (ipp_status == IPP_NOT_FOUND)
|
||||
{
|
||||
fputs(_("ERROR: Destination printer does not exist!\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("ERROR: Destination printer does not exist!\n"));
|
||||
|
||||
if (supported)
|
||||
ippDelete(supported);
|
||||
@@ -678,8 +691,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to get printer status (%s)!\n"),
|
||||
cupsLastErrorString());
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to get printer status (%s)!\n"),
|
||||
cupsLastErrorString());
|
||||
sleep(10);
|
||||
}
|
||||
|
||||
@@ -712,7 +726,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
format_sup->values[i].string.text);
|
||||
}
|
||||
|
||||
report_printer_state(supported);
|
||||
report_printer_state(supported, 0);
|
||||
}
|
||||
while (ipp_status > IPP_OK_CONFLICT);
|
||||
|
||||
@@ -741,8 +755,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
fputs(_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
|
||||
ippDelete(supported);
|
||||
httpClose(http);
|
||||
@@ -847,8 +862,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
num_options = cupsParseOptions(argv[5], 0, &options);
|
||||
|
||||
#ifdef __APPLE__
|
||||
if (content_type != NULL &&
|
||||
!strcasecmp(content_type, "application/pictwps") && num_files == 1)
|
||||
if (!strcasecmp(content_type, "application/pictwps") && num_files == 1)
|
||||
{
|
||||
if (format_sup != NULL)
|
||||
{
|
||||
@@ -874,23 +888,23 @@ main(int argc, /* I - Number of command-line args */
|
||||
* number of copies to 1...
|
||||
*/
|
||||
|
||||
content_type = "application/postscript";
|
||||
copies = 1;
|
||||
copies_remaining = 1;
|
||||
send_options = 0;
|
||||
final_content_type = "application/postscript";
|
||||
copies = 1;
|
||||
copies_remaining = 1;
|
||||
send_options = 0;
|
||||
}
|
||||
}
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
if (content_type != NULL && format_sup != NULL)
|
||||
if (format_sup != NULL)
|
||||
{
|
||||
for (i = 0; i < format_sup->num_values; i ++)
|
||||
if (!strcasecmp(content_type, format_sup->values[i].string.text))
|
||||
if (!strcasecmp(final_content_type, format_sup->values[i].string.text))
|
||||
break;
|
||||
|
||||
if (i < format_sup->num_values)
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE,
|
||||
"document-format", NULL, content_type);
|
||||
"document-format", NULL, final_content_type);
|
||||
}
|
||||
|
||||
if (copies_sup && version > 0 && send_options)
|
||||
@@ -943,7 +957,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
if (ipp_status == IPP_SERVICE_UNAVAILABLE ||
|
||||
ipp_status == IPP_PRINTER_BUSY)
|
||||
{
|
||||
fputs(_("INFO: Printer busy; will retry in 10 seconds...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 10 seconds...\n"));
|
||||
sleep(10);
|
||||
}
|
||||
else if ((ipp_status == IPP_BAD_REQUEST ||
|
||||
@@ -953,25 +968,28 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Switch to IPP/1.0...
|
||||
*/
|
||||
|
||||
fputs(_("INFO: Printer does not support IPP/1.1, trying IPP/1.0...\n"),
|
||||
stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer does not support IPP/1.1, trying "
|
||||
"IPP/1.0...\n"));
|
||||
version = 0;
|
||||
httpReconnect(http);
|
||||
}
|
||||
else
|
||||
fprintf(stderr, _("ERROR: Print file was not accepted (%s)!\n"),
|
||||
cupsLastErrorString());
|
||||
_cupsLangPrintf(stderr, _("ERROR: Print file was not accepted (%s)!\n"),
|
||||
cupsLastErrorString());
|
||||
}
|
||||
else if ((job_id_attr = ippFindAttribute(response, "job-id",
|
||||
IPP_TAG_INTEGER)) == NULL)
|
||||
{
|
||||
fputs(_("NOTICE: Print file accepted - job ID unknown.\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("NOTICE: Print file accepted - job ID unknown.\n"));
|
||||
job_id = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
job_id = job_id_attr->values[0].integer;
|
||||
fprintf(stderr, _("NOTICE: Print file accepted - job ID %d.\n"), job_id);
|
||||
_cupsLangPrintf(stderr, _("NOTICE: Print file accepted - job ID %d.\n"),
|
||||
job_id);
|
||||
}
|
||||
|
||||
ippDelete(response);
|
||||
@@ -1009,8 +1027,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
{
|
||||
ipp_status = cupsLastError();
|
||||
|
||||
fprintf(stderr, _("ERROR: Unable to add file %d to job: %s\n"),
|
||||
job_id, cupsLastErrorString());
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to add file %d to job: %s\n"),
|
||||
job_id, cupsLastErrorString());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1034,7 +1053,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
if (!job_id || !waitjob)
|
||||
continue;
|
||||
|
||||
fputs(_("INFO: Waiting for job to complete...\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Waiting for job to complete...\n"));
|
||||
|
||||
for (; !job_cancelled;)
|
||||
{
|
||||
@@ -1088,8 +1107,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
{
|
||||
ippDelete(response);
|
||||
|
||||
fprintf(stderr, _("ERROR: Unable to get job %d attributes (%s)!\n"),
|
||||
job_id, cupsLastErrorString());
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to get job %d attributes (%s)!\n"),
|
||||
job_id, cupsLastErrorString());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1123,7 +1143,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Check the printer state and report it if necessary...
|
||||
*/
|
||||
|
||||
check_printer_state(http, uri, resource, argv[2], version);
|
||||
check_printer_state(http, uri, resource, argv[2], version, job_id);
|
||||
|
||||
/*
|
||||
* Wait 10 seconds before polling again...
|
||||
@@ -1144,7 +1164,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Check the printer state and report it if necessary...
|
||||
*/
|
||||
|
||||
check_printer_state(http, uri, resource, argv[2], version);
|
||||
check_printer_state(http, uri, resource, argv[2], version, job_id);
|
||||
|
||||
/*
|
||||
* Free memory...
|
||||
@@ -1178,7 +1198,20 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Return the queue status...
|
||||
*/
|
||||
|
||||
return (ipp_status > IPP_OK_CONFLICT ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
|
||||
if (ipp_status == IPP_NOT_AUTHORIZED)
|
||||
{
|
||||
/*
|
||||
* Authorization failures here mean that we need Kerberos. Username +
|
||||
* password authentication is handled in the password_cb function.
|
||||
*/
|
||||
|
||||
fputs("ATTR: auth-info-required=negotiate\n", stderr);
|
||||
return (CUPS_BACKEND_AUTH_REQUIRED);
|
||||
}
|
||||
else if (ipp_status > IPP_OK_CONFLICT)
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
else
|
||||
return (CUPS_BACKEND_OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -1197,7 +1230,7 @@ cancel_job(http_t *http, /* I - HTTP connection */
|
||||
ipp_t *request; /* Cancel-Job request */
|
||||
|
||||
|
||||
fputs(_("INFO: Canceling print job...\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Canceling print job...\n"));
|
||||
|
||||
request = ippNewRequest(IPP_CANCEL_JOB);
|
||||
request->request.op.version[1] = version;
|
||||
@@ -1217,8 +1250,8 @@ cancel_job(http_t *http, /* I - HTTP connection */
|
||||
ippDelete(cupsDoRequest(http, request, resource));
|
||||
|
||||
if (cupsLastError() > IPP_OK_CONFLICT)
|
||||
fprintf(stderr, _("ERROR: Unable to cancel job %d: %s\n"), id,
|
||||
cupsLastErrorString());
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to cancel job %d: %s\n"), id,
|
||||
cupsLastErrorString());
|
||||
}
|
||||
|
||||
|
||||
@@ -1232,7 +1265,8 @@ check_printer_state(
|
||||
const char *uri, /* I - Printer URI */
|
||||
const char *resource, /* I - Resource path */
|
||||
const char *user, /* I - Username, if any */
|
||||
int version) /* I - IPP version */
|
||||
int version, /* I - IPP version */
|
||||
int job_id) /* I - Current job ID */
|
||||
{
|
||||
ipp_t *request, /* IPP request */
|
||||
*response; /* IPP response */
|
||||
@@ -1267,7 +1301,7 @@ check_printer_state(
|
||||
|
||||
if ((response = cupsDoRequest(http, request, resource)) != NULL)
|
||||
{
|
||||
report_printer_state(response);
|
||||
report_printer_state(response, job_id);
|
||||
ippDelete(response);
|
||||
}
|
||||
}
|
||||
@@ -1298,25 +1332,25 @@ compress_files(int num_files, /* I - Number of files */
|
||||
{
|
||||
if ((fd = cupsTempFd(filename, sizeof(filename))) < 0)
|
||||
{
|
||||
fprintf(stderr,
|
||||
_("ERROR: Unable to create temporary compressed print file: "
|
||||
"%s\n"),
|
||||
strerror(errno));
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to create temporary compressed print "
|
||||
"file: %s\n"), strerror(errno));
|
||||
exit(CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
if ((out = cupsFileOpenFd(fd, "w9")) == NULL)
|
||||
{
|
||||
fprintf(stderr,
|
||||
_("ERROR: Unable to open temporary compressed print file: %s\n"),
|
||||
strerror(errno));
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open temporary compressed print "
|
||||
"file: %s\n"), strerror(errno));
|
||||
exit(CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
if ((in = cupsFileOpen(files[i], "r")) == NULL)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to open print file \"%s\": %s\n"),
|
||||
files[i], strerror(errno));
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open print file \"%s\": %s\n"),
|
||||
files[i], strerror(errno));
|
||||
cupsFileClose(out);
|
||||
exit(CUPS_BACKEND_FAILED);
|
||||
}
|
||||
@@ -1325,8 +1359,9 @@ compress_files(int num_files, /* I - Number of files */
|
||||
while ((bytes = cupsFileRead(in, buffer, sizeof(buffer))) > 0)
|
||||
if (cupsFileWrite(out, buffer, bytes) < bytes)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to write %d bytes to \"%s\": %s\n"),
|
||||
(int)bytes, filename, strerror(errno));
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to write %d bytes to \"%s\": %s\n"),
|
||||
(int)bytes, filename, strerror(errno));
|
||||
cupsFileClose(in);
|
||||
cupsFileClose(out);
|
||||
exit(CUPS_BACKEND_FAILED);
|
||||
@@ -1359,8 +1394,12 @@ password_cb(const char *prompt) /* I - Prompt (not used) */
|
||||
{
|
||||
(void)prompt;
|
||||
|
||||
if (password)
|
||||
if (password && password_tries < 3)
|
||||
{
|
||||
password_tries ++;
|
||||
|
||||
return (password);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
@@ -1390,7 +1429,8 @@ password_cb(const char *prompt) /* I - Prompt (not used) */
|
||||
*/
|
||||
|
||||
static int /* O - Number of reasons shown */
|
||||
report_printer_state(ipp_t *ipp) /* I - IPP response */
|
||||
report_printer_state(ipp_t *ipp, /* I - IPP response */
|
||||
int job_id) /* I - Current job ID */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
int count; /* Count of reasons shown... */
|
||||
@@ -1401,6 +1441,7 @@ report_printer_state(ipp_t *ipp) /* I - IPP response */
|
||||
char unknown[1024]; /* Unknown message string */
|
||||
const char *prefix; /* Prefix for STATE: line */
|
||||
char state[1024]; /* State string */
|
||||
cups_lang_t *language; /* Current localization */
|
||||
|
||||
|
||||
if ((psm = ippFindAttribute(ipp, "printer-state-message",
|
||||
@@ -1413,15 +1454,20 @@ report_printer_state(ipp_t *ipp) /* I - IPP response */
|
||||
|
||||
state[0] = '\0';
|
||||
prefix = "STATE: ";
|
||||
language = cupsLangDefault();
|
||||
|
||||
for (i = 0, count = 0; i < reasons->num_values; i ++)
|
||||
{
|
||||
reason = reasons->values[i].string.text;
|
||||
|
||||
strlcat(state, prefix, sizeof(state));
|
||||
strlcat(state, reason, sizeof(state));
|
||||
if (job_id == 0 || strcmp(reason, "paused"))
|
||||
{
|
||||
strlcat(state, prefix, sizeof(state));
|
||||
strlcat(state, reason, sizeof(state));
|
||||
|
||||
prefix = ",";
|
||||
}
|
||||
|
||||
prefix = ",";
|
||||
message = "";
|
||||
|
||||
if (!strncmp(reason, "media-needed", 12))
|
||||
@@ -1486,11 +1532,11 @@ report_printer_state(ipp_t *ipp) /* I - IPP response */
|
||||
{
|
||||
count ++;
|
||||
if (strstr(reasons->values[i].string.text, "error"))
|
||||
fprintf(stderr, "ERROR: %s\n", message);
|
||||
fprintf(stderr, "ERROR: %s\n", _cupsLangString(language, message));
|
||||
else if (strstr(reasons->values[i].string.text, "warning"))
|
||||
fprintf(stderr, "WARNING: %s\n", message);
|
||||
fprintf(stderr, "WARNING: %s\n", _cupsLangString(language, message));
|
||||
else
|
||||
fprintf(stderr, "INFO: %s\n", message);
|
||||
fprintf(stderr, "INFO: %s\n", _cupsLangString(language, message));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1532,15 +1578,16 @@ run_pictwps_filter(char **argv, /* I - Command-line arguments */
|
||||
printer = getenv("PRINTER");
|
||||
if (!printer)
|
||||
{
|
||||
fputs(_("ERROR: PRINTER environment variable not defined!\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("ERROR: PRINTER environment variable not defined!\n"));
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if ((ppdfile = cupsGetPPD(printer)) == NULL)
|
||||
{
|
||||
fprintf(stderr,
|
||||
_("ERROR: Unable to get PPD file for printer \"%s\" - %s.\n"),
|
||||
printer, cupsLastErrorString());
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to get PPD file for printer \"%s\" - "
|
||||
"%s.\n"), printer, cupsLastErrorString());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1554,8 +1601,8 @@ run_pictwps_filter(char **argv, /* I - Command-line arguments */
|
||||
|
||||
if ((fd = cupsTempFd(pstmpname, sizeof(pstmpname))) < 0)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to create temporary file - %s.\n"),
|
||||
strerror(errno));
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to create temporary file - %s.\n"),
|
||||
strerror(errno));
|
||||
if (ppdfile)
|
||||
unlink(ppdfile);
|
||||
return (-1);
|
||||
@@ -1611,8 +1658,8 @@ run_pictwps_filter(char **argv, /* I - Command-line arguments */
|
||||
|
||||
execlp("pictwpstops", printer, argv[1], argv[2], argv[3], argv[4], argv[5],
|
||||
filename, NULL);
|
||||
fprintf(stderr, _("ERROR: Unable to exec pictwpstops: %s\n"),
|
||||
strerror(errno));
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to exec pictwpstops: %s\n"),
|
||||
strerror(errno));
|
||||
return (errno);
|
||||
}
|
||||
|
||||
@@ -1624,8 +1671,8 @@ run_pictwps_filter(char **argv, /* I - Command-line arguments */
|
||||
* Error!
|
||||
*/
|
||||
|
||||
fprintf(stderr, _("ERROR: Unable to fork pictwpstops: %s\n"),
|
||||
strerror(errno));
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to fork pictwpstops: %s\n"),
|
||||
strerror(errno));
|
||||
unlink(filename);
|
||||
if (ppdfile)
|
||||
unlink(ppdfile);
|
||||
@@ -1638,8 +1685,8 @@ run_pictwps_filter(char **argv, /* I - Command-line arguments */
|
||||
|
||||
if (wait(&status) < 0)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to wait for pictwpstops: %s\n"),
|
||||
strerror(errno));
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to wait for pictwpstops: %s\n"),
|
||||
strerror(errno));
|
||||
close(fd);
|
||||
unlink(filename);
|
||||
if (ppdfile)
|
||||
@@ -1655,11 +1702,11 @@ run_pictwps_filter(char **argv, /* I - Command-line arguments */
|
||||
if (status)
|
||||
{
|
||||
if (status >= 256)
|
||||
fprintf(stderr, _("ERROR: pictwpstops exited with status %d!\n"),
|
||||
status / 256);
|
||||
_cupsLangPrintf(stderr, _("ERROR: pictwpstops exited with status %d!\n"),
|
||||
status / 256);
|
||||
else
|
||||
fprintf(stderr, _("ERROR: pictwpstops exited on signal %d!\n"),
|
||||
status);
|
||||
_cupsLangPrintf(stderr, _("ERROR: pictwpstops exited on signal %d!\n"),
|
||||
status);
|
||||
|
||||
unlink(filename);
|
||||
return (status);
|
||||
|
||||
@@ -125,9 +125,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
username[255], /* Username info */
|
||||
resource[1024], /* Resource info (printer name) */
|
||||
*options, /* Pointer to options */
|
||||
name[255], /* Name of option */
|
||||
value[255], /* Value of option */
|
||||
*ptr, /* Pointer into name or value */
|
||||
*name, /* Name of option */
|
||||
*value, /* Value of option */
|
||||
sep, /* Separator character */
|
||||
*filename, /* File to print */
|
||||
title[256]; /* Title string */
|
||||
int port; /* Port number */
|
||||
@@ -186,8 +186,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
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"),
|
||||
argv[0]);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -276,29 +277,30 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Get the name...
|
||||
*/
|
||||
|
||||
for (ptr = name; *options && *options != '=';)
|
||||
if (ptr < (name + sizeof(name) - 1))
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
name = options;
|
||||
|
||||
if (*options == '=')
|
||||
while (*options && *options != '=' && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
if ((sep = *options) != '\0')
|
||||
*options++ = '\0';
|
||||
|
||||
if (sep == '=')
|
||||
{
|
||||
/*
|
||||
* Get the value...
|
||||
*/
|
||||
|
||||
options ++;
|
||||
value = options;
|
||||
|
||||
for (ptr = value; *options && *options != '+' && *options != '&';)
|
||||
if (ptr < (value + sizeof(value) - 1))
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
|
||||
if (*options == '+' || *options == '&')
|
||||
while (*options && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
if (*options)
|
||||
*options++ = '\0';
|
||||
}
|
||||
else
|
||||
value[0] = '\0';
|
||||
value = (char *)"";
|
||||
|
||||
/*
|
||||
* Process the option...
|
||||
@@ -322,8 +324,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
if (strchr("cdfglnoprtv", value[0]))
|
||||
format = value[0];
|
||||
else
|
||||
fprintf(stderr, _("ERROR: Unknown format character \"%c\"\n"),
|
||||
value[0]);
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unknown format character \"%c\"\n"),
|
||||
value[0]);
|
||||
}
|
||||
else if (!strcasecmp(name, "mode") && value[0])
|
||||
{
|
||||
@@ -336,7 +338,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
else if (!strcasecmp(value, "stream"))
|
||||
mode = MODE_STREAM;
|
||||
else
|
||||
fprintf(stderr, _("ERROR: Unknown print mode \"%s\"\n"), value);
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unknown print mode \"%s\"\n"),
|
||||
value);
|
||||
}
|
||||
else if (!strcasecmp(name, "order") && value[0])
|
||||
{
|
||||
@@ -349,7 +352,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
else if (!strcasecmp(value, "data,control"))
|
||||
order = ORDER_DATA_CONTROL;
|
||||
else
|
||||
fprintf(stderr, _("ERROR: Unknown file order \"%s\"\n"), value);
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unknown file order \"%s\"\n"),
|
||||
value);
|
||||
}
|
||||
else if (!strcasecmp(name, "reserve"))
|
||||
{
|
||||
@@ -457,8 +461,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if (fd == -1)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to open print file %s: %s\n"),
|
||||
filename, strerror(errno));
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to open print file %s: %s\n"),
|
||||
filename, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
@@ -476,6 +480,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* the remote end...
|
||||
*/
|
||||
|
||||
char *ptr;
|
||||
|
||||
for (ptr = title; *ptr; ptr ++)
|
||||
if (!isalnum(*ptr & 255) && !isspace(*ptr & 255))
|
||||
*ptr = '_';
|
||||
@@ -585,9 +591,9 @@ lpd_command(int fd, /* I - Socket connection to LPD host */
|
||||
|
||||
if (recv(fd, &status, 1, 0) < 1)
|
||||
{
|
||||
fprintf(stderr,
|
||||
_("WARNING: Remote host did not respond with command status "
|
||||
"byte after %d seconds!\n"), timeout);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: Remote host did not respond with command "
|
||||
"status byte after %d seconds!\n"), timeout);
|
||||
status = errno;
|
||||
}
|
||||
|
||||
@@ -668,7 +674,8 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
if ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, portname)) == NULL)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"), hostname);
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"),
|
||||
hostname);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
@@ -690,9 +697,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
*/
|
||||
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
fprintf(stderr,
|
||||
_("INFO: Attempting to connect to host %s for printer %s\n"),
|
||||
hostname, printer);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("INFO: Attempting to connect to host %s for printer %s\n"),
|
||||
hostname, printer);
|
||||
|
||||
for (lport = reserve == RESERVE_RFC1179 ? 732 : 1024, addr = addrlist,
|
||||
delay = 5;;
|
||||
@@ -791,8 +798,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
fputs(_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
|
||||
httpAddrFreeList(addrlist);
|
||||
|
||||
@@ -810,16 +818,15 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
{
|
||||
if (contimeout && (time(NULL) - start_time) > contimeout)
|
||||
{
|
||||
fputs(_("ERROR: Printer not responding!\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("ERROR: Printer not responding!\n"));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
recoverable = 1;
|
||||
|
||||
fprintf(stderr,
|
||||
_("WARNING: recoverable: Network host \'%s\' is busy; will "
|
||||
"retry in %d seconds...\n"),
|
||||
hostname, delay);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: recoverable: Network host \'%s\' is busy; "
|
||||
"will retry in %d seconds...\n"), hostname, delay);
|
||||
|
||||
sleep(delay);
|
||||
|
||||
@@ -839,8 +846,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
recoverable = 1;
|
||||
|
||||
fprintf(stderr, "DEBUG: Connection error: %s\n", strerror(errno));
|
||||
fputs(_("ERROR: recoverable: Unable to connect to printer; will "
|
||||
"retry in 30 seconds...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("ERROR: recoverable: Unable to connect to printer; "
|
||||
"will retry in 30 seconds...\n"));
|
||||
sleep(30);
|
||||
}
|
||||
}
|
||||
@@ -858,7 +866,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
}
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
fprintf(stderr, _("INFO: Connected to %s...\n"), hostname);
|
||||
_cupsLangPrintf(stderr, _("INFO: Connected to %s...\n"), hostname);
|
||||
|
||||
#ifdef AF_INET6
|
||||
if (addr->addr.addr.sa_family == AF_INET6)
|
||||
@@ -964,8 +972,8 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
fprintf(stderr, _("INFO: Sending control file (%u bytes)\n"),
|
||||
(unsigned)strlen(control));
|
||||
_cupsLangPrintf(stderr, _("INFO: Sending control file (%u bytes)\n"),
|
||||
(unsigned)strlen(control));
|
||||
|
||||
if (lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
|
||||
{
|
||||
@@ -978,9 +986,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
if (read(fd, &status, 1) < 1)
|
||||
{
|
||||
fprintf(stderr,
|
||||
_("WARNING: Remote host did not respond with control "
|
||||
"status byte after %d seconds!\n"), timeout);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: Remote host did not respond with control "
|
||||
"status byte after %d seconds!\n"), timeout);
|
||||
status = errno;
|
||||
}
|
||||
|
||||
@@ -988,11 +996,11 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
}
|
||||
|
||||
if (status != 0)
|
||||
fprintf(stderr,
|
||||
_("ERROR: Remote host did not accept control file (%d)\n"),
|
||||
status);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Remote host did not accept control file "
|
||||
"(%d)\n"), status);
|
||||
else
|
||||
fputs(_("INFO: Control file sent successfully\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Control file sent successfully\n"));
|
||||
}
|
||||
else
|
||||
status = 0;
|
||||
@@ -1013,13 +1021,13 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
fprintf(stderr,
|
||||
_cupsLangPrintf(stderr,
|
||||
#ifdef HAVE_LONG_LONG
|
||||
_("INFO: Sending data file (%lld bytes)\n"),
|
||||
_("INFO: Sending data file (%lld bytes)\n"),
|
||||
#else
|
||||
_("INFO: Sending data file (%ld bytes)\n"),
|
||||
_("INFO: Sending data file (%ld bytes)\n"),
|
||||
#endif /* HAVE_LONG_LONG */
|
||||
CUPS_LLCAST filestats.st_size);
|
||||
CUPS_LLCAST filestats.st_size);
|
||||
|
||||
tbytes = 0;
|
||||
for (copy = 0; copy < manual_copies; copy ++)
|
||||
@@ -1028,8 +1036,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
while ((nbytes = read(print_fd, buffer, sizeof(buffer))) > 0)
|
||||
{
|
||||
fprintf(stderr, _("INFO: Spooling LPR job, %.0f%% complete...\n"),
|
||||
100.0 * tbytes / filestats.st_size);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("INFO: Spooling LPR job, %.0f%% complete...\n"),
|
||||
100.0 * tbytes / filestats.st_size);
|
||||
|
||||
if (lpd_write(fd, buffer, nbytes) < nbytes)
|
||||
{
|
||||
@@ -1063,9 +1072,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
if (recv(fd, &status, 1, 0) < 1)
|
||||
{
|
||||
fprintf(stderr,
|
||||
_("WARNING: Remote host did not respond with data "
|
||||
"status byte after %d seconds!\n"), timeout);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: Remote host did not respond with data "
|
||||
"status byte after %d seconds!\n"), timeout);
|
||||
status = 0;
|
||||
}
|
||||
|
||||
@@ -1076,10 +1085,11 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
status = 0;
|
||||
|
||||
if (status != 0)
|
||||
fprintf(stderr, _("ERROR: Remote host did not accept data file (%d)\n"),
|
||||
status);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Remote host did not accept data file (%d)\n"),
|
||||
status);
|
||||
else
|
||||
fputs(_("INFO: Data file sent successfully\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Data file sent successfully\n"));
|
||||
}
|
||||
|
||||
if (status == 0 && order == ORDER_DATA_CONTROL)
|
||||
@@ -1093,8 +1103,8 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
fprintf(stderr, _("INFO: Sending control file (%lu bytes)\n"),
|
||||
(unsigned long)strlen(control));
|
||||
_cupsLangPrintf(stderr, _("INFO: Sending control file (%lu bytes)\n"),
|
||||
(unsigned long)strlen(control));
|
||||
|
||||
if (lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
|
||||
{
|
||||
@@ -1107,9 +1117,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
if (read(fd, &status, 1) < 1)
|
||||
{
|
||||
fprintf(stderr,
|
||||
_("WARNING: Remote host did not respond with control "
|
||||
"status byte after %d seconds!\n"), timeout);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: Remote host did not respond with control "
|
||||
"status byte after %d seconds!\n"), timeout);
|
||||
status = errno;
|
||||
}
|
||||
|
||||
@@ -1117,11 +1127,11 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
}
|
||||
|
||||
if (status != 0)
|
||||
fprintf(stderr,
|
||||
_("ERROR: Remote host did not accept control file (%d)\n"),
|
||||
status);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Remote host did not accept control file "
|
||||
"(%d)\n"), status);
|
||||
else
|
||||
fputs(_("INFO: Control file sent successfully\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Control file sent successfully\n"));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -242,7 +242,9 @@ int main (int argc, const char * argv[])
|
||||
/* Try to open the print file... */
|
||||
if ((fp = fopen(argv[6], "rb")) == NULL)
|
||||
{
|
||||
fprintf(stderr, "ERROR: unable to open print file \"%s\": %s\n", argv[6], strerror(errno));
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open print file \"%s\": %s\n"),
|
||||
argv[6], strerror(errno));
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -1363,9 +1365,9 @@ static int parseUri(const char* argv0, char* name, char* type, char* zone)
|
||||
*resourcePtr,
|
||||
*typePtr,
|
||||
*options, /* Pointer to options */
|
||||
optionName[255], /* Name of option */
|
||||
value[255], /* Value of option */
|
||||
*ptr; /* Pointer into name or value */
|
||||
*optionName, /* Name of option */
|
||||
*value, /* Value of option */
|
||||
sep; /* Separator character */
|
||||
int port; /* Port number (not used) */
|
||||
int statusInterval; /* */
|
||||
|
||||
@@ -1393,53 +1395,54 @@ static int parseUri(const char* argv0, char* name, char* type, char* zone)
|
||||
|
||||
while (*options != '\0')
|
||||
{
|
||||
/*
|
||||
/*
|
||||
* Get the name...
|
||||
*/
|
||||
for (ptr = optionName; *options && *options != '=' && *options != '+'; )
|
||||
*ptr++ = *options++;
|
||||
|
||||
*ptr = '\0';
|
||||
value[0] = '\0';
|
||||
optionName = options;
|
||||
|
||||
if (*options == '=')
|
||||
while (*options && *options != '=' && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
if ((sep = *options) != '\0')
|
||||
*options++ = '\0';
|
||||
|
||||
if (sep == '=')
|
||||
{
|
||||
/*
|
||||
/*
|
||||
* Get the value...
|
||||
*/
|
||||
|
||||
options ++;
|
||||
|
||||
for (ptr = value; *options && *options != '+';)
|
||||
*ptr++ = *options++;
|
||||
*/
|
||||
|
||||
*ptr = '\0';
|
||||
|
||||
if (*options == '+')
|
||||
options ++;
|
||||
}
|
||||
else if (*options == '+')
|
||||
{
|
||||
options ++;
|
||||
}
|
||||
value = options;
|
||||
|
||||
/*
|
||||
while (*options && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
if (*options)
|
||||
*options++ = '\0';
|
||||
}
|
||||
else
|
||||
value = (char *)"";
|
||||
|
||||
/*
|
||||
* Process the option...
|
||||
*/
|
||||
if (strcasecmp(optionName, "waiteof") == 0)
|
||||
|
||||
if (!strcasecmp(optionName, "waiteof"))
|
||||
{
|
||||
/*
|
||||
* Set the banner...
|
||||
/*
|
||||
* Wait for the end of the print file?
|
||||
*/
|
||||
if (strcasecmp(value, "on") == 0 ||
|
||||
strcasecmp(value, "yes") == 0 ||
|
||||
strcasecmp(value, "true") == 0)
|
||||
|
||||
if (!strcasecmp(value, "on") ||
|
||||
!strcasecmp(value, "yes") ||
|
||||
!strcasecmp(value, "true"))
|
||||
{
|
||||
gWaitEOF = true;
|
||||
}
|
||||
else if (strcasecmp(value, "off") == 0 ||
|
||||
strcasecmp(value, "no") == 0 ||
|
||||
strcasecmp(value, "false") == 0)
|
||||
else if (!strcasecmp(value, "off") ||
|
||||
!strcasecmp(value, "no") ||
|
||||
!strcasecmp(value, "false"))
|
||||
{
|
||||
gWaitEOF = false;
|
||||
}
|
||||
@@ -1448,13 +1451,17 @@ static int parseUri(const char* argv0, char* name, char* type, char* zone)
|
||||
fprintf(stderr, "WARNING: Boolean expected for waiteof option \"%s\"\n", value);
|
||||
}
|
||||
}
|
||||
else if (strcasecmp(optionName, "status") == 0)
|
||||
else if (!strcasecmp(optionName, "status"))
|
||||
{
|
||||
/*
|
||||
* Set status reporting interval...
|
||||
*/
|
||||
|
||||
statusInterval = atoi(value);
|
||||
if (value[0] < '0' || value[0] > '9' ||
|
||||
statusInterval < 0)
|
||||
if (value[0] < '0' || value[0] > '9' || statusInterval < 0)
|
||||
{
|
||||
fprintf(stderr, "WARNING: number expected for status option \"%s\"\n", value);
|
||||
fprintf(stderr, "WARNING: number expected for status option \"%s\"\n",
|
||||
value);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1469,20 +1476,24 @@ static int parseUri(const char* argv0, char* name, char* type, char* zone)
|
||||
if (*resourcePtr == '/')
|
||||
resourcePtr++;
|
||||
|
||||
/* If the resource has a slash we assume the slash seperates the AppleTalk object
|
||||
* name from the AppleTalk type. If the slash is not present we assume the AppleTalk
|
||||
* type is LaserWriter.
|
||||
*/
|
||||
typePtr = strchr(resourcePtr, '/');
|
||||
if (typePtr != NULL) {
|
||||
*typePtr++ = '\0';
|
||||
} else {
|
||||
typePtr = "LaserWriter";
|
||||
}
|
||||
/* If the resource has a slash we assume the slash seperates the AppleTalk object
|
||||
* name from the AppleTalk type. If the slash is not present we assume the AppleTalk
|
||||
* type is LaserWriter.
|
||||
*/
|
||||
|
||||
removePercentEscapes(hostname, zone, NBP_NVE_STR_SIZE + 1);
|
||||
removePercentEscapes(resourcePtr, name, NBP_NVE_STR_SIZE + 1);
|
||||
removePercentEscapes(typePtr, type, NBP_NVE_STR_SIZE + 1);
|
||||
typePtr = strchr(resourcePtr, '/');
|
||||
if (typePtr != NULL)
|
||||
{
|
||||
*typePtr++ = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
typePtr = "LaserWriter";
|
||||
}
|
||||
|
||||
removePercentEscapes(hostname, zone, NBP_NVE_STR_SIZE + 1);
|
||||
removePercentEscapes(resourcePtr, name, NBP_NVE_STR_SIZE + 1);
|
||||
removePercentEscapes(typePtr, type, NBP_NVE_STR_SIZE + 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -122,8 +122,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
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"),
|
||||
argv[0]);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -213,8 +214,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
fputs(_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -227,19 +229,22 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if (errno == EBUSY)
|
||||
{
|
||||
fputs(_("INFO: Printer busy; will retry in 30 seconds...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 30 seconds...\n"));
|
||||
sleep(30);
|
||||
}
|
||||
else if (errno == ENXIO || errno == EIO || errno == ENOENT)
|
||||
{
|
||||
fputs(_("INFO: Printer not connected; will retry in 30 seconds...\n"),
|
||||
stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer not connected; will retry in 30 "
|
||||
"seconds...\n"));
|
||||
sleep(30);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
@@ -279,13 +284,13 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
tbytes = backendRunLoop(print_fd, device_fd, use_bc, side_cb);
|
||||
|
||||
if (print_fd != 0 && tbytes >= 0)
|
||||
fprintf(stderr,
|
||||
_cupsLangPrintf(stderr,
|
||||
#ifdef HAVE_LONG_LONG
|
||||
_("INFO: Sent print file, %lld bytes...\n"),
|
||||
_("INFO: Sent print file, %lld bytes...\n"),
|
||||
#else
|
||||
_("INFO: Sent print file, %ld bytes...\n"),
|
||||
_("INFO: Sent print file, %ld bytes...\n"),
|
||||
#endif /* HAVE_LONG_LONG */
|
||||
CUPS_LLCAST tbytes);
|
||||
CUPS_LLCAST tbytes);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -613,7 +618,7 @@ side_cb(int print_fd, /* I - Print file */
|
||||
|
||||
if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0))
|
||||
{
|
||||
fputs(_("WARNING: Failed to read side-channel request!\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("WARNING: Failed to read side-channel request!\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -118,8 +118,8 @@ backendDrainOutput(int print_fd, /* I - Print file descriptor */
|
||||
if (errno != ENOSPC && errno != ENXIO && errno != EAGAIN &&
|
||||
errno != EINTR && errno != ENOTTY)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to write print data: %s\n"),
|
||||
strerror(errno));
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to write print data: %s\n"),
|
||||
strerror(errno));
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@@ -230,7 +230,7 @@ backendRunLoop(
|
||||
if (errno == ENXIO && offline != 1)
|
||||
{
|
||||
fputs("STATE: +offline-error\n", stderr);
|
||||
fputs(_("INFO: Printer is currently off-line.\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Printer is currently off-line.\n"));
|
||||
offline = 1;
|
||||
}
|
||||
else if (errno == EINTR && total_bytes == 0)
|
||||
@@ -321,7 +321,7 @@ backendRunLoop(
|
||||
if (paperout != 1)
|
||||
{
|
||||
fputs("STATE: +media-empty-error\n", stderr);
|
||||
fputs(_("ERROR: Out of paper!\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("ERROR: Out of paper!\n"));
|
||||
paperout = 1;
|
||||
}
|
||||
}
|
||||
@@ -330,7 +330,7 @@ backendRunLoop(
|
||||
if (offline != 1)
|
||||
{
|
||||
fputs("STATE: +offline-error\n", stderr);
|
||||
fputs(_("INFO: Printer is currently off-line.\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Printer is currently off-line.\n"));
|
||||
offline = 1;
|
||||
}
|
||||
}
|
||||
@@ -352,7 +352,7 @@ backendRunLoop(
|
||||
if (offline)
|
||||
{
|
||||
fputs("STATE: -offline-error\n", stderr);
|
||||
fputs(_("INFO: Printer is now on-line.\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Printer is now on-line.\n"));
|
||||
offline = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -96,7 +96,8 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
|
||||
if (strncmp(resource, "/dev/scsi/", 10) != 0)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Bad SCSI device file \"%s\"!\n"), resource);
|
||||
_cupsLangPrintf(stderr, _("ERROR: Bad SCSI device file \"%s\"!\n"),
|
||||
resource);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
@@ -119,8 +120,9 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
fputs(_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -133,13 +135,15 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
|
||||
if (errno != EAGAIN && errno != EBUSY)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
else
|
||||
{
|
||||
fputs(_("INFO: Printer busy; will retry in 30 seconds...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 30 seconds...\n"));
|
||||
sleep(30);
|
||||
}
|
||||
}
|
||||
@@ -201,9 +205,9 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
if (ioctl(scsi_fd, DS_ENTER, &scsi_req) < 0 ||
|
||||
scsi_req.ds_status != 0)
|
||||
{
|
||||
fprintf(stderr,
|
||||
_("WARNING: SCSI command timed out (%d); retrying...\n"),
|
||||
scsi_req.ds_status);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: SCSI command timed out (%d); "
|
||||
"retrying...\n"), scsi_req.ds_status);
|
||||
sleep(try + 1);
|
||||
}
|
||||
else
|
||||
@@ -211,8 +215,8 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
|
||||
if (try >= 10)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to send print data (%d)\n"),
|
||||
scsi_req.ds_status);
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to send print data (%d)\n"),
|
||||
scsi_req.ds_status);
|
||||
close(scsi_fd);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -110,7 +110,8 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
|
||||
if (strncmp(resource, "/dev/sg", 7) != 0)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Bad SCSI device file \"%s\"!\n"), resource);
|
||||
_cupsLangPrintf(stderr, _("ERROR: Bad SCSI device file \"%s\"!\n"),
|
||||
resource);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
@@ -148,13 +149,15 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
|
||||
if (errno != EAGAIN && errno != EBUSY)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
else
|
||||
{
|
||||
fputs(_("INFO: Printer busy; will retry in 30 seconds...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 30 seconds...\n"));
|
||||
sleep(30);
|
||||
}
|
||||
}
|
||||
@@ -220,9 +223,9 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
if (ioctl(scsi_fd, SG_IO, &scsi_req) < 0 ||
|
||||
scsi_req.status != 0)
|
||||
{
|
||||
fprintf(stderr,
|
||||
_("WARNING: SCSI command timed out (%d); retrying...\n"),
|
||||
scsi_req.status);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: SCSI command timed out (%d); "
|
||||
"retrying...\n"), scsi_req.status);
|
||||
sleep(try + 1);
|
||||
}
|
||||
else
|
||||
@@ -230,8 +233,8 @@ print_device(const char *resource, /* I - SCSI device */
|
||||
|
||||
if (try >= 10)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to send print data (%d)\n"),
|
||||
scsi_req.status);
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to send print data (%d)\n"),
|
||||
scsi_req.status);
|
||||
close(scsi_fd);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -153,8 +153,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
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"),
|
||||
argv[0]);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
|
||||
@@ -104,9 +104,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
username[255], /* Username info (not used) */
|
||||
resource[1024], /* Resource info (device and options) */
|
||||
*options, /* Pointer to options */
|
||||
name[255], /* Name of option */
|
||||
value[255], /* Value of option */
|
||||
*ptr; /* Pointer into name or value */
|
||||
*name, /* Name of option */
|
||||
*value, /* Value of option */
|
||||
sep; /* Option separator */
|
||||
int port; /* Port number (not used) */
|
||||
int copies; /* Number of copies to print */
|
||||
int print_fd, /* Print file */
|
||||
@@ -161,8 +161,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
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"),
|
||||
argv[0]);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -234,8 +235,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
fputs(_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -248,13 +250,15 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if (errno == EBUSY)
|
||||
{
|
||||
fputs(_("INFO: Printer busy; will retry in 30 seconds...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 30 seconds...\n"));
|
||||
sleep(30);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
@@ -285,29 +289,30 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Get the name...
|
||||
*/
|
||||
|
||||
for (ptr = name; *options && *options != '=';)
|
||||
if (ptr < (name + sizeof(name) - 1))
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
name = options;
|
||||
|
||||
if (*options == '=')
|
||||
while (*options && *options != '=' && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
if ((sep = *options) != '\0')
|
||||
*options++ = '\0';
|
||||
|
||||
if (sep == '=')
|
||||
{
|
||||
/*
|
||||
* Get the value...
|
||||
*/
|
||||
|
||||
options ++;
|
||||
value = options;
|
||||
|
||||
for (ptr = value; *options && *options != '+' && *options != '&';)
|
||||
if (ptr < (value + sizeof(value) - 1))
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
|
||||
if (*options == '+' || *options == '&')
|
||||
while (*options && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
if (*options)
|
||||
*options++ = '\0';
|
||||
}
|
||||
else
|
||||
value[0] = '\0';
|
||||
value = (char *)"";
|
||||
|
||||
/*
|
||||
* Process the option...
|
||||
@@ -370,8 +375,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
break;
|
||||
# endif /* B230400 */
|
||||
default :
|
||||
fprintf(stderr, _("WARNING: Unsupported baud rate %s!\n"),
|
||||
value);
|
||||
_cupsLangPrintf(stderr, _("WARNING: Unsupported baud rate %s!\n"),
|
||||
value);
|
||||
break;
|
||||
}
|
||||
#endif /* B19200 == 19200 */
|
||||
@@ -1247,7 +1252,8 @@ side_cb(int print_fd, /* I - Print file */
|
||||
|
||||
if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0))
|
||||
{
|
||||
fputs(_("WARNING: Failed to read side-channel request!\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("WARNING: Failed to read side-channel request!\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -68,9 +68,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
username[255], /* Username info (not used) */
|
||||
resource[1024], /* Resource info (not used) */
|
||||
*options, /* Pointer to options */
|
||||
name[255], /* Name of option */
|
||||
value[255], /* Value of option */
|
||||
*ptr; /* Pointer into name or value */
|
||||
*name, /* Name of option */
|
||||
*value, /* Value of option */
|
||||
sep; /* Option separator */
|
||||
int print_fd; /* Print file */
|
||||
int copies; /* Number of copies to print */
|
||||
time_t start_time; /* Time of first connect */
|
||||
@@ -83,7 +83,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
int device_fd; /* AppSocket */
|
||||
int error; /* Error code (if any) */
|
||||
http_addrlist_t *addrlist, /* Address list */
|
||||
*addr; /* Connected address */
|
||||
*addr; /* Connected address */
|
||||
char addrname[256]; /* Address name */
|
||||
ssize_t tbytes; /* Total number of bytes written */
|
||||
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
@@ -122,8 +122,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
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"),
|
||||
argv[0]);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -190,29 +191,30 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Get the name...
|
||||
*/
|
||||
|
||||
for (ptr = name; *options && *options != '=';)
|
||||
if (ptr < (name + sizeof(name) - 1))
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
name = options;
|
||||
|
||||
if (*options == '=')
|
||||
while (*options && *options != '=' && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
if ((sep = *options) != '\0')
|
||||
*options++ = '\0';
|
||||
|
||||
if (sep == '=')
|
||||
{
|
||||
/*
|
||||
* Get the value...
|
||||
*/
|
||||
|
||||
options ++;
|
||||
value = options;
|
||||
|
||||
for (ptr = value; *options && *options != '+' && *options != '&';)
|
||||
if (ptr < (value + sizeof(value) - 1))
|
||||
*ptr++ = *options++;
|
||||
*ptr = '\0';
|
||||
|
||||
if (*options == '+' || *options == '&')
|
||||
while (*options && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
if (*options)
|
||||
*options++ = '\0';
|
||||
}
|
||||
else
|
||||
value[0] = '\0';
|
||||
value = (char *)"";
|
||||
|
||||
/*
|
||||
* Process the option...
|
||||
@@ -250,12 +252,14 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, portname)) == NULL)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"), hostname);
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"),
|
||||
hostname);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
fprintf(stderr, _("INFO: Attempting to connect to host %s on port %d\n"),
|
||||
hostname, port);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("INFO: Attempting to connect to host %s on port %d\n"),
|
||||
hostname, port);
|
||||
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
|
||||
@@ -275,8 +279,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
fputs(_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -292,16 +297,16 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
{
|
||||
if (contimeout && (time(NULL) - start_time) > contimeout)
|
||||
{
|
||||
fputs(_("ERROR: Printer not responding!\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("ERROR: Printer not responding!\n"));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
recoverable = 1;
|
||||
|
||||
fprintf(stderr,
|
||||
_("WARNING: recoverable: Network host \'%s\' is busy; will "
|
||||
"retry in %d seconds...\n"),
|
||||
hostname, delay);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: recoverable: Network host \'%s\' is busy; "
|
||||
"will retry in %d seconds...\n"),
|
||||
hostname, delay);
|
||||
|
||||
sleep(delay);
|
||||
|
||||
@@ -312,9 +317,11 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
{
|
||||
recoverable = 1;
|
||||
|
||||
fprintf(stderr, "DEBUG: Connection error: %s\n", strerror(errno));
|
||||
fputs(_("ERROR: recoverable: Unable to connect to printer; will "
|
||||
"retry in 30 seconds...\n"), stderr);
|
||||
_cupsLangPrintf(stderr, "DEBUG: Connection error: %s\n",
|
||||
strerror(errno));
|
||||
_cupsLangPuts(stderr,
|
||||
_("ERROR: recoverable: Unable to connect to printer; "
|
||||
"will retry in 30 seconds...\n"));
|
||||
sleep(30);
|
||||
}
|
||||
}
|
||||
@@ -335,7 +342,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
fprintf(stderr, _("INFO: Connected to %s...\n"), hostname);
|
||||
_cupsLangPrintf(stderr, _("INFO: Connected to %s...\n"), hostname);
|
||||
|
||||
#ifdef AF_INET6
|
||||
if (addr->addr.addr.sa_family == AF_INET6)
|
||||
@@ -368,13 +375,13 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
tbytes = backendRunLoop(print_fd, device_fd, 1, side_cb);
|
||||
|
||||
if (print_fd != 0 && tbytes >= 0)
|
||||
fprintf(stderr,
|
||||
_cupsLangPrintf(stderr,
|
||||
#ifdef HAVE_LONG_LONG
|
||||
_("INFO: Sent print file, %lld bytes...\n"),
|
||||
_("INFO: Sent print file, %lld bytes...\n"),
|
||||
#else
|
||||
_("INFO: Sent print file, %ld bytes...\n"),
|
||||
_("INFO: Sent print file, %ld bytes...\n"),
|
||||
#endif /* HAVE_LONG_LONG */
|
||||
CUPS_LLCAST tbytes);
|
||||
CUPS_LLCAST tbytes);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -389,8 +396,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Shutdown the socket and wait for the other end to finish...
|
||||
*/
|
||||
|
||||
fputs(_("INFO: Print file sent, waiting for printer to finish...\n"),
|
||||
stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Print file sent, waiting for printer to finish...\n"));
|
||||
|
||||
shutdown(device_fd, 1);
|
||||
|
||||
@@ -413,7 +420,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
close(print_fd);
|
||||
|
||||
if (tbytes >= 0)
|
||||
fputs(_("INFO: Ready to print.\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Ready to print.\n"));
|
||||
|
||||
return (tbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
|
||||
}
|
||||
@@ -432,13 +439,14 @@ side_cb(int print_fd, /* I - Print file */
|
||||
cups_sc_status_t status; /* Request/response status */
|
||||
char data[2048]; /* Request/response data */
|
||||
int datalen; /* Request/response data size */
|
||||
const char *device_id; /* 1284DEVICEID env var */
|
||||
|
||||
|
||||
datalen = sizeof(data);
|
||||
|
||||
if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0))
|
||||
{
|
||||
fputs(_("WARNING: Failed to read side-channel request!\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("WARNING: Failed to read side-channel request!\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -462,6 +470,14 @@ side_cb(int print_fd, /* I - Print file */
|
||||
datalen = 1;
|
||||
break;
|
||||
|
||||
case CUPS_SC_CMD_GET_DEVICE_ID :
|
||||
if ((device_id = getenv("1284DEVICEID")) != NULL)
|
||||
{
|
||||
strlcpy(data, device_id, sizeof(data));
|
||||
datalen = (int)strlen(data);
|
||||
break;
|
||||
}
|
||||
|
||||
default :
|
||||
status = CUPS_SC_STATUS_NOT_IMPLEMENTED;
|
||||
datalen = 0;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Copyright © 2005-2007 Apple Inc. All rights reserved.
|
||||
* Copyright � 2005-2007 Apple Inc. All rights reserved.
|
||||
*
|
||||
* IMPORTANT: This Apple software is supplied to you by Apple Computer,
|
||||
* Inc. ("Apple") in consideration of your agreement to the following
|
||||
@@ -267,7 +267,7 @@ static void copy_devicestring(io_service_t usbInterface, CFStringRef *deviceID,
|
||||
static void device_added(void *userdata, io_iterator_t iterator);
|
||||
static void get_device_id(cups_sc_status_t *status, char *data, int *datalen);
|
||||
static void iterate_printers(iterator_callback_t callBack, void *userdata);
|
||||
static void parse_options(const char *options, char *serial, UInt32 *location, Boolean *wait_eof);
|
||||
static void parse_options(char *options, char *serial, int serial_size, UInt32 *location, Boolean *wait_eof);
|
||||
static void release_deviceinfo(CFStringRef *make, CFStringRef *model, CFStringRef *serial);
|
||||
static void setup_cfLanguage(void);
|
||||
static void soft_reset();
|
||||
@@ -304,7 +304,7 @@ int /* O - Exit status */
|
||||
print_device(const char *uri, /* I - Device URI */
|
||||
const char *hostname, /* I - Hostname/manufacturer */
|
||||
const char *resource, /* I - Resource/modelname */
|
||||
const char *options, /* I - Device options/serial number */
|
||||
char *options, /* I - Device options/serial number */
|
||||
int print_fd, /* I - File descriptor to print */
|
||||
int copies, /* I - Copies to print */
|
||||
int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
@@ -313,7 +313,8 @@ print_device(const char *uri, /* I - Device URI */
|
||||
char serial[1024]; /* Serial number buffer */
|
||||
OSStatus status; /* Function results */
|
||||
pthread_t read_thread_id, /* Read thread */
|
||||
sidechannel_thread_id;/* Side channel thread */
|
||||
sidechannel_thread_id;/* Side-channel thread */
|
||||
int sidechannel_started = 0;/* Was the side-channel thread started? */
|
||||
char print_buffer[8192], /* Print data buffer */
|
||||
*print_ptr; /* Pointer into print data buffer */
|
||||
UInt32 location; /* Unique location in bus topology */
|
||||
@@ -327,9 +328,10 @@ print_device(const char *uri, /* I - Device URI */
|
||||
stimeout; /* Timeout for select() */
|
||||
struct timespec cond_timeout; /* pthread condition timeout */
|
||||
|
||||
|
||||
setup_cfLanguage();
|
||||
|
||||
parse_options(options, serial, &location, &g.wait_eof);
|
||||
parse_options(options, serial, sizeof(serial), &location, &g.wait_eof);
|
||||
|
||||
if (resource[0] == '/')
|
||||
resource++;
|
||||
@@ -387,7 +389,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
strlcpy(print_buffer, "USB class driver", sizeof(print_buffer));
|
||||
|
||||
fputs("STATE: +apple-missing-usbclassdriver-error\n", stderr);
|
||||
fprintf(stderr, _("FATAL: Could not load %s\n"), print_buffer);
|
||||
_cupsLangPrintf(stderr, _("FATAL: Could not load %s\n"), print_buffer);
|
||||
|
||||
if (driverBundlePath)
|
||||
CFRelease(driverBundlePath);
|
||||
@@ -404,7 +406,8 @@ print_device(const char *uri, /* I - Device URI */
|
||||
countdown -= PRINTER_POLLING_INTERVAL;
|
||||
if (countdown <= 0)
|
||||
{
|
||||
fprintf(stderr, _("INFO: Printer busy (status:0x%08x)\n"), (int)status);
|
||||
_cupsLangPrintf(stderr, _("INFO: Printer busy (status:0x%08x)\n"),
|
||||
(int)status);
|
||||
countdown = SUBSEQUENT_LOG_INTERVAL; /* subsequent log entries, every 15 seconds */
|
||||
}
|
||||
}
|
||||
@@ -456,9 +459,11 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (pthread_create(&sidechannel_thread_id, NULL, sidechannel_thread, NULL))
|
||||
{
|
||||
fputs(_("WARNING: Couldn't create side channel\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("WARNING: Couldn't create side channel\n"));
|
||||
return CUPS_BACKEND_STOP;
|
||||
}
|
||||
|
||||
sidechannel_started = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -473,7 +478,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (pthread_create(&read_thread_id, NULL, read_thread, NULL))
|
||||
{
|
||||
fputs(_("WARNING: Couldn't create read channel\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("WARNING: Couldn't create read channel\n"));
|
||||
return CUPS_BACKEND_STOP;
|
||||
}
|
||||
|
||||
@@ -488,7 +493,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
while (status == noErr && copies-- > 0)
|
||||
{
|
||||
fputs(_("INFO: Sending data\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Sending data\n"));
|
||||
|
||||
if (print_fd != STDIN_FILENO)
|
||||
{
|
||||
@@ -556,7 +561,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
}
|
||||
else if (errno != EAGAIN)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: select() returned %d\n"), (int)errno);
|
||||
_cupsLangPrintf(stderr, _("ERROR: select() returned %d\n"), (int)errno);
|
||||
return CUPS_BACKEND_STOP;
|
||||
}
|
||||
}
|
||||
@@ -632,7 +637,8 @@ print_device(const char *uri, /* I - Device URI */
|
||||
*/
|
||||
|
||||
OSStatus err = (*g.classdriver)->Abort(g.classdriver);
|
||||
fprintf(stderr, _("ERROR: %ld: (canceled:%ld)\n"), (long)status, (long)err);
|
||||
_cupsLangPrintf(stderr, _("ERROR: %ld: (canceled:%ld)\n"),
|
||||
(long)status, (long)err);
|
||||
status = CUPS_BACKEND_STOP;
|
||||
break;
|
||||
}
|
||||
@@ -656,27 +662,42 @@ print_device(const char *uri, /* I - Device URI */
|
||||
* Wait for the side channel thread to exit...
|
||||
*/
|
||||
|
||||
close(CUPS_SC_FD);
|
||||
pthread_mutex_lock(&g.readwrite_lock_mutex);
|
||||
g.readwrite_lock = 0;
|
||||
pthread_cond_signal(&g.readwrite_lock_cond);
|
||||
pthread_mutex_unlock(&g.readwrite_lock_mutex);
|
||||
|
||||
g.sidechannel_thread_stop = 1;
|
||||
pthread_mutex_lock(&g.sidechannel_thread_mutex);
|
||||
if (!g.sidechannel_thread_done)
|
||||
if (sidechannel_started)
|
||||
{
|
||||
cond_timeout.tv_sec = time(NULL) + WAIT_SIDE_DELAY;
|
||||
cond_timeout.tv_nsec = 0;
|
||||
pthread_cond_timedwait(&g.sidechannel_thread_cond,
|
||||
&g.sidechannel_thread_mutex, &cond_timeout);
|
||||
close(CUPS_SC_FD);
|
||||
pthread_mutex_lock(&g.readwrite_lock_mutex);
|
||||
g.readwrite_lock = 0;
|
||||
pthread_cond_signal(&g.readwrite_lock_cond);
|
||||
pthread_mutex_unlock(&g.readwrite_lock_mutex);
|
||||
|
||||
g.sidechannel_thread_stop = 1;
|
||||
pthread_mutex_lock(&g.sidechannel_thread_mutex);
|
||||
if (!g.sidechannel_thread_done)
|
||||
{
|
||||
/*
|
||||
* Wait for the side-channel thread to exit...
|
||||
*/
|
||||
|
||||
cond_timeout.tv_sec = time(NULL) + WAIT_SIDE_DELAY;
|
||||
cond_timeout.tv_nsec = 0;
|
||||
if (pthread_cond_timedwait(&g.sidechannel_thread_cond,
|
||||
&g.sidechannel_thread_mutex,
|
||||
&cond_timeout) != 0)
|
||||
{
|
||||
/*
|
||||
* Force the side-channel thread to exit...
|
||||
*/
|
||||
|
||||
pthread_kill(sidechannel_thread_id, SIGTERM);
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&g.sidechannel_thread_mutex);
|
||||
|
||||
pthread_join(sidechannel_thread_id, NULL);
|
||||
|
||||
pthread_cond_destroy(&g.sidechannel_thread_cond);
|
||||
pthread_mutex_destroy(&g.sidechannel_thread_mutex);
|
||||
}
|
||||
pthread_mutex_unlock(&g.sidechannel_thread_mutex);
|
||||
|
||||
pthread_join(sidechannel_thread_id, NULL);
|
||||
|
||||
pthread_cond_destroy(&g.sidechannel_thread_cond);
|
||||
pthread_mutex_destroy(&g.sidechannel_thread_mutex);
|
||||
|
||||
pthread_cond_destroy(&g.readwrite_lock_cond);
|
||||
pthread_mutex_destroy(&g.readwrite_lock_mutex);
|
||||
@@ -689,9 +710,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
/*
|
||||
* Give the read thread WAIT_EOF_DELAY seconds to complete all the data. If
|
||||
* we are not signaled in that time then force the thread to exit by setting
|
||||
* the waiteof to be false. Plese note that this relies on us using the timeout
|
||||
* class driver.
|
||||
* we are not signaled in that time then force the thread to exit.
|
||||
*/
|
||||
|
||||
pthread_mutex_lock(&g.read_thread_mutex);
|
||||
@@ -703,7 +722,13 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (pthread_cond_timedwait(&g.read_thread_cond, &g.read_thread_mutex,
|
||||
&cond_timeout) != 0)
|
||||
g.wait_eof = false;
|
||||
{
|
||||
/*
|
||||
* Force the read thread to exit...
|
||||
*/
|
||||
|
||||
pthread_kill(read_thread_id, SIGTERM);
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&g.read_thread_mutex);
|
||||
|
||||
@@ -827,8 +852,16 @@ sidechannel_thread(void *reference)
|
||||
switch (command)
|
||||
{
|
||||
case CUPS_SC_CMD_SOFT_RESET: /* Do a soft reset */
|
||||
soft_reset();
|
||||
cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, NULL, 0, 1.0);
|
||||
if ((*g.classdriver)->SoftReset != NULL)
|
||||
{
|
||||
soft_reset();
|
||||
cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, NULL, 0, 1.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
cupsSideChannelWrite(command, CUPS_SC_STATUS_NOT_IMPLEMENTED,
|
||||
NULL, 0, 1.0);
|
||||
}
|
||||
break;
|
||||
|
||||
case CUPS_SC_CMD_DRAIN_OUTPUT: /* Drain all pending output */
|
||||
@@ -1091,7 +1124,7 @@ static Boolean find_device_cb(void *refcon,
|
||||
if (!keepLooking && g.status_timer != NULL)
|
||||
{
|
||||
fputs("STATE: -offline-error\n", stderr);
|
||||
fputs(_("INFO: Printer is now on-line.\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Printer is now on-line.\n"));
|
||||
CFRunLoopRemoveTimer(CFRunLoopGetCurrent(), g.status_timer, kCFRunLoopDefaultMode);
|
||||
CFRelease(g.status_timer);
|
||||
g.status_timer = NULL;
|
||||
@@ -1109,7 +1142,7 @@ static void status_timer_cb(CFRunLoopTimerRef timer,
|
||||
void *info)
|
||||
{
|
||||
fputs("STATE: +offline-error\n", stderr);
|
||||
fputs(_("INFO: Printer is currently off-line.\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Printer is currently off-line.\n"));
|
||||
}
|
||||
|
||||
|
||||
@@ -1541,18 +1574,19 @@ CFStringRef cfstr_create_trim(const char *cstr)
|
||||
|
||||
#pragma mark -
|
||||
/*
|
||||
* 'parse_options()' - Parse uri options.
|
||||
* 'parse_options()' - Parse URI options.
|
||||
*/
|
||||
|
||||
static void parse_options(const char *options,
|
||||
static void parse_options(char *options,
|
||||
char *serial,
|
||||
int serial_size,
|
||||
UInt32 *location,
|
||||
Boolean *wait_eof)
|
||||
{
|
||||
char *serialnumber; /* ?serial=<serial> or ?location=<location> */
|
||||
char optionName[255], /* Name of option */
|
||||
value[255], /* Value of option */
|
||||
*ptr; /* Pointer into name or value */
|
||||
char sep, /* Separator character */
|
||||
*name, /* Name of option */
|
||||
*value; /* Value of option */
|
||||
|
||||
|
||||
if (serial)
|
||||
*serial = '\0';
|
||||
@@ -1562,59 +1596,61 @@ static void parse_options(const char *options,
|
||||
if (!options)
|
||||
return;
|
||||
|
||||
serialnumber = NULL;
|
||||
|
||||
while (*options != '\0')
|
||||
while (*options)
|
||||
{
|
||||
/* Get the name... */
|
||||
for (ptr = optionName; *options && *options != '=' && *options != '+';)
|
||||
*ptr++ = *options++;
|
||||
/*
|
||||
* Get the name...
|
||||
*/
|
||||
|
||||
*ptr = '\0';
|
||||
value[0] = '\0';
|
||||
name = options;
|
||||
|
||||
if (*options == '=')
|
||||
{
|
||||
/* Get the value... */
|
||||
while (*options && *options != '=' && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
|
||||
for (ptr = value; *options && *options != '+';)
|
||||
*ptr++ = *options++;
|
||||
if ((sep = *options) != '\0')
|
||||
*options++ = '\0';
|
||||
|
||||
*ptr = '\0';
|
||||
if (sep == '=')
|
||||
{
|
||||
/*
|
||||
* Get the value...
|
||||
*/
|
||||
|
||||
if (*options == '+')
|
||||
value = options;
|
||||
|
||||
while (*options && *options != '+' && *options != '&')
|
||||
options ++;
|
||||
}
|
||||
else if (*options == '+')
|
||||
options ++;
|
||||
|
||||
/*
|
||||
* Process the option...
|
||||
*/
|
||||
if (strcasecmp(optionName, "waiteof") == 0)
|
||||
if (*options)
|
||||
*options++ = '\0';
|
||||
}
|
||||
else
|
||||
value = (char *)"";
|
||||
|
||||
/*
|
||||
* Process the option...
|
||||
*/
|
||||
|
||||
if (!strcasecmp(name, "waiteof"))
|
||||
{
|
||||
if (strcasecmp(value, "on") == 0 ||
|
||||
strcasecmp(value, "yes") == 0 ||
|
||||
strcasecmp(value, "true") == 0)
|
||||
if (!strcasecmp(value, "on") ||
|
||||
!strcasecmp(value, "yes") ||
|
||||
!strcasecmp(value, "true"))
|
||||
*wait_eof = true;
|
||||
else if (strcasecmp(value, "off") == 0 ||
|
||||
strcasecmp(value, "no") == 0 ||
|
||||
strcasecmp(value, "false") == 0)
|
||||
else if (!strcasecmp(value, "off") ||
|
||||
!strcasecmp(value, "no") ||
|
||||
!strcasecmp(value, "false"))
|
||||
*wait_eof = false;
|
||||
else
|
||||
fprintf(stderr, _("WARNING: Boolean expected for waiteof option \"%s\"\n"), value);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: Boolean expected for waiteof option "
|
||||
"\"%s\"\n"), value);
|
||||
}
|
||||
else if (strcasecmp(optionName, "serial") == 0)
|
||||
{
|
||||
strcpy(serial, value);
|
||||
serialnumber = serial;
|
||||
}
|
||||
else if (strcasecmp(optionName, "location") == 0 && location)
|
||||
else if (!strcasecmp(name, "serial"))
|
||||
strlcpy(serial, value, serial_size);
|
||||
else if (!strcasecmp(name, "location") && location)
|
||||
*location = strtol(value, NULL, 16);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1888,7 +1924,7 @@ static void parse_pserror(char *sockBuffer,
|
||||
|
||||
|
||||
/*
|
||||
* 'soft_reset'
|
||||
* 'soft_reset()' - Send a soft reset to the device.
|
||||
*/
|
||||
|
||||
static void soft_reset()
|
||||
|
||||
@@ -48,7 +48,7 @@ int /* O - Exit status */
|
||||
print_device(const char *uri, /* I - Device URI */
|
||||
const char *hostname, /* I - Hostname/manufacturer */
|
||||
const char *resource, /* I - Resource/modelname */
|
||||
const char *options, /* I - Device options/serial number */
|
||||
char *options, /* I - Device options/serial number */
|
||||
int print_fd, /* I - File descriptor to print */
|
||||
int copies, /* I - Copies to print */
|
||||
int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
@@ -105,8 +105,9 @@ print_device(const char *uri, /* I - Device URI */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
fputs(_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -119,20 +120,23 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (errno == EBUSY)
|
||||
{
|
||||
fputs(_("INFO: Printer busy; will retry in 10 seconds...\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 10 seconds...\n"));
|
||||
sleep(10);
|
||||
}
|
||||
else if (errno == ENXIO || errno == EIO || errno == ENOENT ||
|
||||
errno == ENODEV)
|
||||
{
|
||||
fputs(_("INFO: Printer not connected; will retry in 30 seconds...\n"),
|
||||
stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer not connected; will retry in 30 "
|
||||
"seconds...\n"));
|
||||
sleep(30);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
@@ -172,13 +176,13 @@ print_device(const char *uri, /* I - Device URI */
|
||||
tbytes = backendRunLoop(print_fd, device_fd, use_bc, side_cb);
|
||||
|
||||
if (print_fd != 0 && tbytes >= 0)
|
||||
fprintf(stderr,
|
||||
_cupsLangPrintf(stderr,
|
||||
#ifdef HAVE_LONG_LONG
|
||||
_("INFO: Sent print file, %lld bytes...\n"),
|
||||
_("INFO: Sent print file, %lld bytes...\n"),
|
||||
#else
|
||||
_("INFO: Sent print file, %ld bytes...\n"),
|
||||
_("INFO: Sent print file, %ld bytes...\n"),
|
||||
#endif /* HAVE_LONG_LONG */
|
||||
CUPS_LLCAST tbytes);
|
||||
CUPS_LLCAST tbytes);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -411,8 +415,8 @@ open_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (busy)
|
||||
{
|
||||
fputs(_("INFO: Printer busy; will retry in 5 seconds...\n"),
|
||||
stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 5 seconds...\n"));
|
||||
sleep(5);
|
||||
}
|
||||
}
|
||||
@@ -504,8 +508,8 @@ open_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (busy)
|
||||
{
|
||||
fputs(_("INFO: Printer is busy; will retry in 5 seconds...\n"),
|
||||
stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer is busy; will retry in 5 seconds...\n"));
|
||||
sleep(5);
|
||||
}
|
||||
}
|
||||
@@ -562,7 +566,7 @@ side_cb(int print_fd, /* I - Print file */
|
||||
|
||||
if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0))
|
||||
{
|
||||
fputs(_("WARNING: Failed to read side-channel request!\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("WARNING: Failed to read side-channel request!\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
void list_devices(void);
|
||||
int print_device(const char *uri, const char *hostname,
|
||||
const char *resource, const char *options,
|
||||
const char *resource, char *options,
|
||||
int print_fd, int copies, int argc, char *argv[]);
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ int /* O - Exit status */
|
||||
print_device(const char *uri, /* I - Device URI */
|
||||
const char *hostname, /* I - Hostname/manufacturer */
|
||||
const char *resource, /* I - Resource/modelname */
|
||||
const char *options, /* I - Device options/serial number */
|
||||
char *options, /* I - Device options/serial number */
|
||||
int print_fd, /* I - File descriptor to print */
|
||||
int copies, /* I - Copies to print */
|
||||
int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
@@ -184,8 +184,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
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"),
|
||||
argv[0]);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -200,8 +201,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
hostname, sizeof(hostname), &port,
|
||||
resource, sizeof(resource)) < HTTP_URI_OK)
|
||||
{
|
||||
fputs(_("ERROR: No device URI found in argv[0] or in DEVICE_URI "
|
||||
"environment variable!\n"), stderr);
|
||||
_cupsLangPuts(stderr,
|
||||
_("ERROR: No device URI found in argv[0] or in DEVICE_URI "
|
||||
"environment variable!\n"));
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -237,8 +239,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if ((print_fd = open(argv[6], O_RDONLY)) < 0)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to open print file %s - %s\n"),
|
||||
argv[6], strerror(errno));
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to open print file %s - %s\n"),
|
||||
argv[6], strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
|
||||
@@ -151,6 +151,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
cgiSetVariable("HELPFILE", helpfile);
|
||||
cgiSetVariable("HELPTITLE", n->text);
|
||||
cgiSetVariable("TOPIC", n->section);
|
||||
|
||||
/*
|
||||
* Send a standard page header...
|
||||
|
||||
@@ -85,9 +85,9 @@ cgiCopyTemplateFile(FILE *out, /* I - Output file */
|
||||
void
|
||||
cgiCopyTemplateLang(const char *tmpl) /* I - Base filename */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
char filename[1024], /* Filename */
|
||||
locale[16]; /* Locale name */
|
||||
locale[16], /* Locale name */
|
||||
*locptr; /* Pointer into locale name */
|
||||
const char *directory, /* Directory for templates */
|
||||
*lang; /* Language */
|
||||
FILE *in; /* Input file */
|
||||
@@ -100,22 +100,19 @@ cgiCopyTemplateLang(const char *tmpl) /* I - Base filename */
|
||||
* Convert the language to a locale name...
|
||||
*/
|
||||
|
||||
locale[0] = '\0';
|
||||
|
||||
if ((lang = getenv("LANG")) != NULL)
|
||||
{
|
||||
for (i = 0; lang[i] && i < 15; i ++)
|
||||
if (isalnum(lang[i] & 255) || lang[i] == '_')
|
||||
locale[i] = tolower(lang[i]);
|
||||
else if (lang[i] == '-')
|
||||
locale[i] = '_';
|
||||
else
|
||||
break;
|
||||
locale[0] = '/';
|
||||
strlcpy(locale + 1, lang, sizeof(locale) - 1);
|
||||
|
||||
locale[i] = '\0';
|
||||
if ((locptr = strchr(locale, '.')) != NULL)
|
||||
*locptr = '\0'; /* Strip charset */
|
||||
}
|
||||
else
|
||||
locale[0] = '\0';
|
||||
|
||||
fprintf(stderr, "DEBUG2: locale=\"%s\"...\n", locale);
|
||||
fprintf(stderr, "DEBUG: lang=\"%s\", locale=\"%s\"...\n",
|
||||
lang ? lang : "(null)", locale);
|
||||
|
||||
/*
|
||||
* See if we have a template file for this language...
|
||||
@@ -123,14 +120,17 @@ cgiCopyTemplateLang(const char *tmpl) /* I - Base filename */
|
||||
|
||||
directory = cgiGetTemplateDir();
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/%s/%s", directory, locale, tmpl);
|
||||
if (access(filename, 0))
|
||||
snprintf(filename, sizeof(filename), "%s%s/%s", directory, locale, tmpl);
|
||||
if ((in = fopen(filename, "r")) == NULL)
|
||||
{
|
||||
locale[2] = '\0';
|
||||
locale[3] = '\0';
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/%s/%s", directory, locale, tmpl);
|
||||
if (access(filename, 0))
|
||||
snprintf(filename, sizeof(filename), "%s%s/%s", directory, locale, tmpl);
|
||||
if ((in = fopen(filename, "r")) == NULL)
|
||||
{
|
||||
snprintf(filename, sizeof(filename), "%s/%s", directory, tmpl);
|
||||
in = fopen(filename, "r");
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG2: Template file is \"%s\"...\n", filename);
|
||||
@@ -139,7 +139,7 @@ cgiCopyTemplateLang(const char *tmpl) /* I - Base filename */
|
||||
* Open the template file...
|
||||
*/
|
||||
|
||||
if ((in = fopen(filename, "r")) == NULL)
|
||||
if (!in)
|
||||
{
|
||||
fprintf(stderr, "ERROR: Unable to open template file \"%s\" - %s\n",
|
||||
filename, strerror(errno));
|
||||
|
||||
@@ -95,8 +95,8 @@ image/x-xpixmap application/vnd.cups-raster 100 imagetoraster
|
||||
#image/x-xwindowdump application/vnd.cups-raster 100 imagetoraster
|
||||
image/x-sun-raster application/vnd.cups-raster 100 imagetoraster
|
||||
|
||||
# pstoraster is now part of ESP Ghostscript...
|
||||
#application/vnd.cups-postscript application/vnd.cups-raster 100 pstoraster
|
||||
# pstoraster is part of GPL Ghostscript...
|
||||
application/vnd.cups-postscript application/vnd.cups-raster 100 pstoraster
|
||||
|
||||
########################################################################
|
||||
#
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-common.m4 6720 2007-07-25 00:40:03Z mike $"
|
||||
dnl "$Id: cups-common.m4 6965 2007-09-17 21:34:07Z mike $"
|
||||
dnl
|
||||
dnl Common configuration stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
@@ -13,14 +13,14 @@ dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl We need at least autoconf 2.50...
|
||||
AC_PREREQ(2.50)
|
||||
dnl We need at least autoconf 2.60...
|
||||
AC_PREREQ(2.60)
|
||||
|
||||
dnl Set the name of the config header file...
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl Versio number information...
|
||||
CUPS_VERSION="1.3rc1"
|
||||
CUPS_VERSION="1.3.2"
|
||||
CUPS_REVISION=""
|
||||
#if test -z "$CUPS_REVISION" -a -d .svn; then
|
||||
# CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
|
||||
@@ -123,6 +123,7 @@ AC_CHECK_HEADER(strings.h,AC_DEFINE(HAVE_STRINGS_H))
|
||||
AC_CHECK_HEADER(bstring.h,AC_DEFINE(HAVE_BSTRING_H))
|
||||
AC_CHECK_HEADER(usersec.h,AC_DEFINE(HAVE_USERSEC_H))
|
||||
AC_CHECK_HEADER(sys/ioctl.h,AC_DEFINE(HAVE_SYS_IOCTL_H))
|
||||
AC_CHECK_HEADER(sys/param.h,AC_DEFINE(HAVE_SYS_PARAM_H))
|
||||
AC_CHECK_HEADER(sys/ucred.h,AC_DEFINE(HAVE_SYS_UCRED_H))
|
||||
AC_CHECK_HEADER(scsi/sg.h,AC_DEFINE(HAVE_SCSI_SG_H))
|
||||
|
||||
@@ -286,5 +287,5 @@ AC_SUBST(DEFAULT_IPP_PORT)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-common.m4 6720 2007-07-25 00:40:03Z mike $".
|
||||
dnl End of "$Id: cups-common.m4 6965 2007-09-17 21:34:07Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-compiler.m4 6698 2007-07-20 14:15:44Z mike $"
|
||||
dnl "$Id: cups-compiler.m4 6976 2007-09-18 20:39:31Z mike $"
|
||||
dnl
|
||||
dnl Compiler stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
@@ -301,6 +301,40 @@ else
|
||||
if test $PICFLAG = 1; then
|
||||
OPTIM="+z $OPTIM"
|
||||
fi
|
||||
|
||||
if test "x$enable_32bit" = xyes; then
|
||||
# Build 32-bit libraries, 64-bit base...
|
||||
if test -z "$with_arch32flags"; then
|
||||
ARCH32FLAGS="+DD32"
|
||||
else
|
||||
ARCH32FLAGS="$with_arch32flags"
|
||||
fi
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch64flags"; then
|
||||
ARCHFLAGS="+DD64"
|
||||
else
|
||||
ARCHFLAGS="$with_arch64flags"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$enable_64bit" = xyes; then
|
||||
# Build 64-bit libraries, 32-bit base...
|
||||
if test -z "$with_arch64flags"; then
|
||||
ARCH64FLAGS="+DD64"
|
||||
else
|
||||
ARCH64FLAGS="$with_arch64flags"
|
||||
fi
|
||||
|
||||
if test -z "$with_archflags"; then
|
||||
if test -z "$with_arch32flags"; then
|
||||
ARCHFLAGS="+DD32"
|
||||
else
|
||||
ARCHFLAGS="$with_arch32flags"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
IRIX)
|
||||
if test -z "$OPTIM"; then
|
||||
@@ -464,5 +498,5 @@ case $uname in
|
||||
esac
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-compiler.m4 6698 2007-07-20 14:15:44Z mike $".
|
||||
dnl End of "$Id: cups-compiler.m4 6976 2007-09-18 20:39:31Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-defaults.m4 6740 2007-07-26 23:07:46Z mike $"
|
||||
dnl "$Id: cups-defaults.m4 6754 2007-08-01 19:00:07Z mike $"
|
||||
dnl
|
||||
dnl Default cupsd configuration settings for the Common UNIX Printing System
|
||||
dnl (CUPS).
|
||||
@@ -165,6 +165,7 @@ AC_ARG_WITH(cups_user, [ --with-cups-user set default user for CUPS],
|
||||
else
|
||||
CUPS_USER="_lp";
|
||||
fi
|
||||
AC_MSG_RESULT($CUPS_USER)
|
||||
elif test -f /etc/passwd; then
|
||||
CUPS_USER=""
|
||||
for user in lp lpd guest daemon nobody; do
|
||||
@@ -193,6 +194,7 @@ AC_ARG_WITH(cups_group, [ --with-cups-group set default group for CUPS],
|
||||
else
|
||||
CUPS_GROUP="_lp";
|
||||
fi
|
||||
AC_MSG_RESULT($CUPS_GROUP)
|
||||
elif test -f /etc/group; then
|
||||
GROUP_LIST="_lp lp nobody"
|
||||
CUPS_GROUP=""
|
||||
@@ -336,5 +338,5 @@ AC_SUBST(CUPS_SNMP_ADDRESS)
|
||||
AC_SUBST(CUPS_SNMP_COMMUNITY)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-defaults.m4 6740 2007-07-26 23:07:46Z mike $".
|
||||
dnl End of "$Id: cups-defaults.m4 6754 2007-08-01 19:00:07Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-directories.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-directories.m4 6976 2007-09-18 20:39:31Z mike $"
|
||||
dnl
|
||||
dnl Directory stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
@@ -99,17 +99,23 @@ if test "$sysconfdir" = "\${prefix}/etc"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Fix "libdir" variable for IRIX 6.x...
|
||||
dnl Fix "libdir" variable...
|
||||
if test "$libdir" = "\${exec_prefix}/lib"; then
|
||||
if test "$uname" = "IRIX"; then
|
||||
libdir="$exec_prefix/lib32"
|
||||
else
|
||||
if test "$uname" = Linux -a -d /usr/lib64; then
|
||||
libdir="$exec_prefix/lib64"
|
||||
else
|
||||
libdir="$exec_prefix/lib"
|
||||
fi
|
||||
fi
|
||||
case "$uname" in
|
||||
IRIX*)
|
||||
libdir="$exec_prefix/lib32"
|
||||
;;
|
||||
Linux*)
|
||||
if test -d /usr/lib64; then
|
||||
libdir="$exec_prefix/lib64"
|
||||
fi
|
||||
;;
|
||||
HP-UX*)
|
||||
if test -d /usr/lib/hpux32; then
|
||||
libdir="$exec_prefix/lib/hpux32"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
dnl Setup init.d locations...
|
||||
@@ -146,8 +152,8 @@ if test x$rcdir = x; then
|
||||
HP-UX*)
|
||||
INITDIR="/sbin"
|
||||
RCLEVELS="2"
|
||||
RCSTART="620"
|
||||
RCSTOP="380"
|
||||
RCSTART="380"
|
||||
RCSTOP="620"
|
||||
;;
|
||||
|
||||
IRIX*)
|
||||
@@ -291,21 +297,26 @@ fi
|
||||
AC_SUBST(CUPS_FONTPATH)
|
||||
AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
|
||||
|
||||
# Locale data
|
||||
case "$uname" in
|
||||
Linux | GNU | *BSD* | Darwin*)
|
||||
CUPS_LOCALEDIR="$datadir/locale"
|
||||
;;
|
||||
# Locale data (initial assignment allows us not to require autoconf 2.60)
|
||||
localedir="${localedir:=}"
|
||||
if test "$localedir" = "\${datarootdir}/locale" -o "$localedir" = ""; then
|
||||
case "$uname" in
|
||||
Linux | GNU | *BSD* | Darwin*)
|
||||
CUPS_LOCALEDIR="$datadir/locale"
|
||||
;;
|
||||
|
||||
OSF1* | AIX*)
|
||||
CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg"
|
||||
;;
|
||||
OSF1* | AIX*)
|
||||
CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg"
|
||||
;;
|
||||
|
||||
*)
|
||||
# This is the standard System V location...
|
||||
CUPS_LOCALEDIR="$exec_prefix/lib/locale"
|
||||
;;
|
||||
esac
|
||||
*)
|
||||
# This is the standard System V location...
|
||||
CUPS_LOCALEDIR="$exec_prefix/lib/locale"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
CUPS_LOCALEDIR="$localedir"
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR")
|
||||
AC_SUBST(CUPS_LOCALEDIR)
|
||||
@@ -356,5 +367,5 @@ AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$localstatedir/run/cups")
|
||||
AC_SUBST(CUPS_STATEDIR)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-directories.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-directories.m4 6976 2007-09-18 20:39:31Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -60,7 +60,7 @@ if test x$enable_gssapi != xno; then
|
||||
|
||||
AC_CHECK_FUNC(gsskrb5_register_acceptor_identity,
|
||||
AC_DEFINE(HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY))
|
||||
AC_CHECK_FUNC(krb5_cc_resolve, AC_DEFINE(HAVE_KRB5_CC_RESOLVE))
|
||||
AC_CHECK_FUNC(krb5_cc_new_unique, AC_DEFINE(HAVE_KRB5_CC_NEW_UNIQUE))
|
||||
|
||||
AC_MSG_CHECKING(for GSS_C_NT_HOSTBASED_SERVICE)
|
||||
if test $ac_cv_header_gssapi_gssapi_h = yes; then
|
||||
|
||||
@@ -495,7 +495,7 @@
|
||||
#undef HAVE_GSSAPI_GSSAPI_KRB5_H
|
||||
#undef HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY
|
||||
#undef HAVE_GSS_C_NT_HOSTBASED_SERVICE
|
||||
#undef HAVE_KRB5_CC_RESOLVE
|
||||
#undef HAVE_KRB5_CC_NEW_UNIQUE
|
||||
#undef HAVE_KRB5_H
|
||||
#undef HAVE_HEIMDAL
|
||||
|
||||
@@ -523,6 +523,13 @@
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have <sys/param.h>?
|
||||
*/
|
||||
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have <sys/ucred.h>?
|
||||
*/
|
||||
|
||||
@@ -293,7 +293,7 @@ cupsDoAuthentication(http_t *http, /* I - HTTP connection to server */
|
||||
{
|
||||
# ifdef DEBUG
|
||||
DEBUG_gss_printf(major_status, minor_status,
|
||||
"Unable to initialise security context");
|
||||
"Unable to initialize security context");
|
||||
# endif /* DEBUG */
|
||||
return (-1);
|
||||
}
|
||||
@@ -425,6 +425,8 @@ cups_get_gss_creds(
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s@%s", service_name, fqdn);
|
||||
|
||||
DEBUG_printf(("cups_get_gss_creds: Looking up %s...\n", buf));
|
||||
|
||||
token.value = buf;
|
||||
token.length = strlen(buf);
|
||||
server_name = GSS_C_NO_NAME;
|
||||
|
||||
@@ -59,10 +59,10 @@ extern "C" {
|
||||
* Constants...
|
||||
*/
|
||||
|
||||
# define CUPS_VERSION 1.0300
|
||||
# define CUPS_VERSION 1.0302
|
||||
# define CUPS_VERSION_MAJOR 1
|
||||
# define CUPS_VERSION_MINOR 3
|
||||
# define CUPS_VERSION_PATCH 0
|
||||
# define CUPS_VERSION_PATCH 2
|
||||
# define CUPS_DATE_ANY -1
|
||||
|
||||
|
||||
|
||||
@@ -1207,7 +1207,7 @@ cupsFileRead(cups_file_t *fp, /* I - CUPS file */
|
||||
if (fp->ptr >= fp->end)
|
||||
if (cups_fill(fp) <= 0)
|
||||
{
|
||||
DEBUG_printf((" cups_fill() returned -1, total=%d\n", total));
|
||||
DEBUG_printf((" cups_fill() returned -1, total=%d\n", (int)total));
|
||||
|
||||
if (total > 0)
|
||||
return ((ssize_t)total);
|
||||
@@ -1235,7 +1235,7 @@ cupsFileRead(cups_file_t *fp, /* I - CUPS file */
|
||||
* Return the total number of bytes read...
|
||||
*/
|
||||
|
||||
DEBUG_printf((" total=%d\n", total));
|
||||
DEBUG_printf((" total=%d\n", (int)total));
|
||||
|
||||
return ((ssize_t)total);
|
||||
}
|
||||
@@ -1703,6 +1703,7 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
{
|
||||
ssize_t bytes; /* Number of bytes read */
|
||||
#ifdef HAVE_LIBZ
|
||||
int status; /* Decompression status */
|
||||
const unsigned char *ptr, /* Pointer into buffer */
|
||||
*end; /* End of buffer */
|
||||
#endif /* HAVE_LIBZ */
|
||||
@@ -1921,7 +1922,13 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
fp->stream.next_out = (Bytef *)fp->buf;
|
||||
fp->stream.avail_out = sizeof(fp->buf);
|
||||
|
||||
if (inflate(&(fp->stream), Z_NO_FLUSH) == Z_STREAM_END)
|
||||
status = inflate(&(fp->stream), Z_NO_FLUSH);
|
||||
|
||||
if (fp->stream.next_out > (Bytef *)fp->buf)
|
||||
fp->crc = crc32(fp->crc, (Bytef *)fp->buf,
|
||||
fp->stream.next_out - (Bytef *)fp->buf);
|
||||
|
||||
if (status == Z_STREAM_END)
|
||||
{
|
||||
/*
|
||||
* Read the CRC and length...
|
||||
@@ -1950,6 +1957,9 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
* Bad CRC, mark end-of-file...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("cups_fill: tcrc=%08x, fp->crc=%08x\n",
|
||||
(unsigned int)tcrc, (unsigned int)fp->crc));
|
||||
|
||||
fp->eof = 1;
|
||||
|
||||
return (-1);
|
||||
|
||||
@@ -197,18 +197,17 @@ httpAddrLookup(
|
||||
#endif /* AF_LOCAL */
|
||||
#ifdef HAVE_GETNAMEINFO
|
||||
{
|
||||
/*
|
||||
* STR #2486: httpAddrLookup() fails when getnameinfo() returns EAI_AGAIN
|
||||
*
|
||||
* FWIW, I think this is really a bug in the implementation of
|
||||
* getnameinfo(), but falling back on httpAddrString() is easy to
|
||||
* do...
|
||||
*/
|
||||
|
||||
if (getnameinfo(&addr->addr, httpAddrLength(addr), name, namelen,
|
||||
NULL, 0, 0))
|
||||
{
|
||||
/*
|
||||
* If we get an error back, then the address type is not supported
|
||||
* and we should zero out the buffer...
|
||||
*/
|
||||
|
||||
name[0] = '\0';
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
NULL, 0, 0))
|
||||
return (httpAddrString(addr, name, namelen));
|
||||
}
|
||||
#else
|
||||
{
|
||||
|
||||
@@ -62,6 +62,9 @@
|
||||
# ifndef HAVE_GSS_C_NT_HOSTBASED_SERVICE
|
||||
# define GSS_C_NT_HOSTBASED_SERVICE gss_nt_service_name
|
||||
# endif /* !HAVE_GSS_C_NT_HOSTBASED_SERVICE */
|
||||
# ifdef HAVE_KRB5_H
|
||||
# include <krb5.h>
|
||||
# endif /* HAVE_KRB5_H */
|
||||
# endif /* HAVE_GSSAPI */
|
||||
|
||||
# ifdef HAVE_AUTHORIZATION_H
|
||||
|
||||
@@ -985,11 +985,12 @@ typedef struct
|
||||
static const _apple_name_locale_t apple_name_locale[] =
|
||||
{
|
||||
{ "en" , "en_US" },
|
||||
{ "no" , "nb" },
|
||||
{ "nb" , "no" },
|
||||
{ "zh-Hans" , "zh_CN" },
|
||||
{ "zh-Hant" , "zh_TW" }
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* 'appleLangDefault()' - Get the default locale string.
|
||||
*/
|
||||
@@ -998,6 +999,8 @@ static const char * /* O - Locale string */
|
||||
appleLangDefault(void)
|
||||
{
|
||||
int i; /* Looping var */
|
||||
CFBundleRef bundle; /* Main bundle (if any) */
|
||||
CFArrayRef bundleList; /* List of localizations in bundle */
|
||||
CFPropertyListRef localizationList;
|
||||
/* List of localization data */
|
||||
CFStringRef languageName; /* Current name */
|
||||
@@ -1014,63 +1017,77 @@ appleLangDefault(void)
|
||||
if (!cg->language[0])
|
||||
{
|
||||
if ((lang = getenv("LANG")))
|
||||
{
|
||||
strlcpy(cg->language, lang, sizeof(cg->language));
|
||||
else
|
||||
return (cg->language);
|
||||
}
|
||||
else if ((bundle = CFBundleGetMainBundle()) != NULL &&
|
||||
(bundleList = CFBundleCopyBundleLocalizations(bundle)) != NULL)
|
||||
{
|
||||
localizationList =
|
||||
CFPreferencesCopyAppValue(CFSTR("AppleLanguages"),
|
||||
kCFPreferencesCurrentApplication);
|
||||
CFBundleCopyPreferredLocalizationsFromArray(bundleList);
|
||||
|
||||
if (localizationList != NULL)
|
||||
CFRelease(bundleList);
|
||||
}
|
||||
else
|
||||
localizationList =
|
||||
CFPreferencesCopyAppValue(CFSTR("AppleLanguages"),
|
||||
kCFPreferencesCurrentApplication);
|
||||
|
||||
if (localizationList)
|
||||
{
|
||||
if (CFGetTypeID(localizationList) == CFArrayGetTypeID() &&
|
||||
CFArrayGetCount(localizationList) > 0)
|
||||
{
|
||||
if (CFGetTypeID(localizationList) == CFArrayGetTypeID() &&
|
||||
CFArrayGetCount(localizationList) > 0)
|
||||
languageName = CFArrayGetValueAtIndex(localizationList, 0);
|
||||
|
||||
if (languageName &&
|
||||
CFGetTypeID(languageName) == CFStringGetTypeID())
|
||||
{
|
||||
languageName = CFArrayGetValueAtIndex(localizationList, 0);
|
||||
localeName = CFLocaleCreateCanonicalLocaleIdentifierFromString(
|
||||
kCFAllocatorDefault, languageName);
|
||||
|
||||
if (languageName != NULL &&
|
||||
CFGetTypeID(languageName) == CFStringGetTypeID())
|
||||
{
|
||||
localeName = CFLocaleCreateCanonicalLocaleIdentifierFromString(
|
||||
kCFAllocatorDefault, languageName);
|
||||
if (localeName)
|
||||
{
|
||||
CFStringGetCString(localeName, cg->language, sizeof(cg->language),
|
||||
kCFStringEncodingASCII);
|
||||
CFRelease(localeName);
|
||||
|
||||
if (localeName != NULL)
|
||||
DEBUG_printf(("appleLangDefault: cg->language=\"%s\"\n",
|
||||
cg->language));
|
||||
|
||||
/*
|
||||
* Map new language identifiers to locales...
|
||||
*/
|
||||
|
||||
for (i = 0;
|
||||
i < sizeof(apple_name_locale) / sizeof(apple_name_locale[0]);
|
||||
i++)
|
||||
{
|
||||
CFStringGetCString(localeName, cg->language, sizeof(cg->language),
|
||||
kCFStringEncodingASCII);
|
||||
CFRelease(localeName);
|
||||
|
||||
/*
|
||||
* Map new language identifiers to locales...
|
||||
*/
|
||||
|
||||
for (i = 0;
|
||||
i < sizeof(apple_name_locale) / sizeof(apple_name_locale[0]);
|
||||
i++)
|
||||
if (!strcmp(cg->language, apple_name_locale[i].name))
|
||||
{
|
||||
if (!strcmp(cg->language, apple_name_locale[i].name))
|
||||
{
|
||||
strlcpy(cg->language, apple_name_locale[i].locale,
|
||||
sizeof(cg->language));
|
||||
break;
|
||||
}
|
||||
DEBUG_printf(("appleLangDefault: mapping \"%s\" to \"%s\"...\n",
|
||||
cg->language, apple_name_locale[i].locale));
|
||||
strlcpy(cg->language, apple_name_locale[i].locale,
|
||||
sizeof(cg->language));
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert language subtag into region subtag...
|
||||
*/
|
||||
|
||||
if (cg->language[2] == '-')
|
||||
cg->language[2] = '_';
|
||||
|
||||
if (strchr(cg->language, '.') == NULL)
|
||||
strlcat(cg->language, ".UTF-8", sizeof(cg->language));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CFRelease(localizationList);
|
||||
/*
|
||||
* Convert language subtag into region subtag...
|
||||
*/
|
||||
|
||||
if (cg->language[2] == '-')
|
||||
cg->language[2] = '_';
|
||||
|
||||
if (!strchr(cg->language, '.'))
|
||||
strlcat(cg->language, ".UTF-8", sizeof(cg->language));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CFRelease(localizationList);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -44,7 +44,8 @@
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static void ppd_ll_CC(char *ll_CC, char *ll);
|
||||
static void ppd_ll_CC(char *ll_CC, int ll_CC_size,
|
||||
char *ll, int ll_size);
|
||||
static ppd_attr_t *ppd_localized_attr(ppd_file_t *ppd,
|
||||
const char *keyword,
|
||||
const char *spec, const char *ll_CC,
|
||||
@@ -90,7 +91,7 @@ ppdLocalize(ppd_file_t *ppd) /* I - PPD file */
|
||||
* Get the default language...
|
||||
*/
|
||||
|
||||
ppd_ll_CC(ll_CC, ll);
|
||||
ppd_ll_CC(ll_CC, sizeof(ll_CC), ll, sizeof(ll));
|
||||
|
||||
/*
|
||||
* Now lookup all of the groups, options, choices, etc.
|
||||
@@ -240,7 +241,7 @@ ppdLocalizeIPPReason(
|
||||
* Get the default language...
|
||||
*/
|
||||
|
||||
ppd_ll_CC(ll_CC, ll);
|
||||
ppd_ll_CC(ll_CC, sizeof(ll_CC), ll, sizeof(ll));
|
||||
|
||||
/*
|
||||
* Find the localized attribute...
|
||||
@@ -391,8 +392,9 @@ ppdLocalizeIPPReason(
|
||||
|
||||
static void
|
||||
ppd_ll_CC(char *ll_CC, /* O - Country-specific locale name */
|
||||
char *ll) /* O - Generic locale name */
|
||||
|
||||
int ll_CC_size, /* I - Size of country-specific name */
|
||||
char *ll, /* O - Generic locale name */
|
||||
int ll_size) /* I - Size of generic name */
|
||||
{
|
||||
cups_lang_t *lang; /* Current language */
|
||||
|
||||
@@ -403,8 +405,8 @@ ppd_ll_CC(char *ll_CC, /* O - Country-specific locale name */
|
||||
|
||||
if ((lang = cupsLangDefault()) == NULL)
|
||||
{
|
||||
strcpy(ll_CC, "en_US");
|
||||
strcpy(ll, "en");
|
||||
strlcpy(ll_CC, "en_US", ll_CC_size);
|
||||
strlcpy(ll, "en", ll_size);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -412,8 +414,10 @@ ppd_ll_CC(char *ll_CC, /* O - Country-specific locale name */
|
||||
* Copy the locale name...
|
||||
*/
|
||||
|
||||
strlcpy(ll_CC, lang->language, sizeof(ll_CC));
|
||||
strlcpy(ll, lang->language, sizeof(ll));
|
||||
strlcpy(ll_CC, lang->language, ll_CC_size);
|
||||
strlcpy(ll, lang->language, ll_size);
|
||||
|
||||
DEBUG_printf(("ll_CC=\"%s\", ll=\"%s\"\n", ll_CC, ll));
|
||||
|
||||
if (strlen(ll_CC) == 2)
|
||||
{
|
||||
@@ -423,16 +427,16 @@ ppd_ll_CC(char *ll_CC, /* O - Country-specific locale name */
|
||||
*/
|
||||
|
||||
if (!strcmp(ll_CC, "cs"))
|
||||
strcpy(ll_CC, "cs_CZ");
|
||||
strlcpy(ll_CC, "cs_CZ", ll_CC_size);
|
||||
else if (!strcmp(ll_CC, "en"))
|
||||
strcpy(ll_CC, "en_US");
|
||||
strlcpy(ll_CC, "en_US", ll_CC_size);
|
||||
else if (!strcmp(ll_CC, "ja"))
|
||||
strcpy(ll_CC, "ja_JP");
|
||||
strlcpy(ll_CC, "ja_JP", ll_CC_size);
|
||||
else if (!strcmp(ll_CC, "sv"))
|
||||
strcpy(ll_CC, "sv_SE");
|
||||
else if (!strcmp(ll_CC, "zh"))
|
||||
strcpy(ll_CC, "zh_CN"); /* Simplified Chinese */
|
||||
else
|
||||
strlcpy(ll_CC, "sv_SE", ll_CC_size);
|
||||
else if (!strcmp(ll_CC, "zh")) /* Simplified Chinese */
|
||||
strlcpy(ll_CC, "zh_CN", ll_CC_size);
|
||||
else if (ll_CC_size >= 6)
|
||||
{
|
||||
ll_CC[2] = '_';
|
||||
ll_CC[3] = toupper(ll_CC[0] & 255);
|
||||
@@ -475,17 +479,31 @@ ppd_localized_attr(ppd_file_t *ppd, /* I - PPD file */
|
||||
snprintf(lkeyword, sizeof(lkeyword), "%s.%s", ll, keyword);
|
||||
attr = ppdFindAttr(ppd, lkeyword, spec);
|
||||
|
||||
if (!attr && !strcmp(ll, "ja"))
|
||||
if (!attr)
|
||||
{
|
||||
/*
|
||||
* Due to a bug in the CUPS DDK 1.1.0 ppdmerge program, Japanese
|
||||
* PPD files were incorrectly assigned "jp" as the locale name
|
||||
* instead of "ja". Support both the old (incorrect) and new
|
||||
* locale names for Japanese...
|
||||
*/
|
||||
if (!strcmp(ll, "ja"))
|
||||
{
|
||||
/*
|
||||
* Due to a bug in the CUPS DDK 1.1.0 ppdmerge program, Japanese
|
||||
* PPD files were incorrectly assigned "jp" as the locale name
|
||||
* instead of "ja". Support both the old (incorrect) and new
|
||||
* locale names for Japanese...
|
||||
*/
|
||||
|
||||
snprintf(lkeyword, sizeof(lkeyword), "jp.%s", keyword);
|
||||
attr = ppdFindAttr(ppd, lkeyword, spec);
|
||||
snprintf(lkeyword, sizeof(lkeyword), "jp.%s", keyword);
|
||||
attr = ppdFindAttr(ppd, lkeyword, spec);
|
||||
}
|
||||
else if (!strcmp(ll, "no"))
|
||||
{
|
||||
/*
|
||||
* Norway has two languages, "Bokmal" (the primary one)
|
||||
* and "Nynorsk" (new Norwegian); we map "no" to "nb" here as
|
||||
* recommended by the locale folks...
|
||||
*/
|
||||
|
||||
snprintf(lkeyword, sizeof(lkeyword), "nb.%s", keyword);
|
||||
attr = ppdFindAttr(ppd, lkeyword, spec);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -149,6 +149,18 @@ http://foo/fr/bar.html
|
||||
help:anchor='foo'%20bookID=Vendor%20Help
|
||||
/help/fr/foo/bar.html"
|
||||
*End
|
||||
*zh_TW.cupsIPPReason foo/Number 1 Foo Reason: "text:Number%201
|
||||
text:Foo%20Reason
|
||||
http://foo/zh_TW/bar.html
|
||||
help:anchor='foo'%20bookID=Vendor%20Help
|
||||
/help/zh_TW/foo/bar.html"
|
||||
*End
|
||||
*zh.cupsIPPReason foo/Number 2 Foo Reason: "text:Number%202
|
||||
text:Foo%20Reason
|
||||
http://foo/zh/bar.html
|
||||
help:anchor='foo'%20bookID=Vendor%20Help
|
||||
/help/zh/foo/bar.html"
|
||||
*End
|
||||
|
||||
*DefaultFont: Courier
|
||||
*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Main entry.
|
||||
* main() - Main entry.
|
||||
* read_write_tests() - Perform read/write tests.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -149,6 +150,8 @@ read_write_tests(int compression) /* I - Use compression? */
|
||||
unsigned char readbuf[8192], /* Read buffer */
|
||||
writebuf[8192]; /* Write buffer */
|
||||
int byte; /* Byte from file */
|
||||
static const char *partial_line = "partial line";
|
||||
/* Partial line */
|
||||
|
||||
|
||||
/*
|
||||
@@ -253,11 +256,25 @@ read_write_tests(int compression) /* I - Use compression? */
|
||||
|
||||
fputs("cupsFileWrite(): ", stdout);
|
||||
|
||||
for (i = 0; i < 100; i ++)
|
||||
for (i = 0; i < 10000; i ++)
|
||||
if (cupsFileWrite(fp, (char *)writebuf, sizeof(writebuf)) < 0)
|
||||
break;
|
||||
|
||||
if (i >= 100)
|
||||
if (i >= 10000)
|
||||
puts("PASS");
|
||||
else
|
||||
{
|
||||
printf("FAIL (%s)\n", strerror(errno));
|
||||
status ++;
|
||||
}
|
||||
|
||||
/*
|
||||
* cupsFilePuts() with partial line...
|
||||
*/
|
||||
|
||||
fputs("cupsFilePuts(\"partial line\"): ", stdout);
|
||||
|
||||
if (cupsFilePuts(fp, partial_line) > 0)
|
||||
puts("PASS");
|
||||
else
|
||||
{
|
||||
@@ -405,13 +422,13 @@ read_write_tests(int compression) /* I - Use compression? */
|
||||
|
||||
fputs("cupsFileRead(): ", stdout);
|
||||
|
||||
for (i = 0; i < 100; i ++)
|
||||
for (i = 0; i < 10000; i ++)
|
||||
if ((byte = cupsFileRead(fp, (char *)readbuf, sizeof(readbuf))) < 0)
|
||||
break;
|
||||
else if (memcmp(readbuf, writebuf, sizeof(readbuf)))
|
||||
break;
|
||||
|
||||
if (i >= 100)
|
||||
if (i >= 10000)
|
||||
puts("PASS");
|
||||
else if (byte > 0)
|
||||
{
|
||||
@@ -430,6 +447,26 @@ read_write_tests(int compression) /* I - Use compression? */
|
||||
status ++;
|
||||
}
|
||||
|
||||
/*
|
||||
* cupsFileGetChar() with partial line...
|
||||
*/
|
||||
|
||||
fputs("cupsFileGetChar(partial line): ", stdout);
|
||||
|
||||
for (i = 0; i < strlen(partial_line); i ++)
|
||||
if ((byte = cupsFileGetChar(fp)) < 0)
|
||||
break;
|
||||
else if (byte != partial_line[i])
|
||||
break;
|
||||
|
||||
if (!partial_line[i])
|
||||
puts("PASS");
|
||||
else
|
||||
{
|
||||
printf("FAIL (got '%c', expected '%c')\n", byte, partial_line[i]);
|
||||
status ++;
|
||||
}
|
||||
|
||||
/*
|
||||
* cupsFileClose()
|
||||
*/
|
||||
|
||||
@@ -224,6 +224,18 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
printf("FAIL (\"%s\" instead of \"La Long Foo Reason\")\n", buffer);
|
||||
}
|
||||
|
||||
putenv("LANG=zh_TW");
|
||||
|
||||
fputs("ppdLocalizeIPPReason(zh_TW text): ", stdout);
|
||||
if (ppdLocalizeIPPReason(ppd, "foo", NULL, buffer, sizeof(buffer)) &&
|
||||
!strcmp(buffer, "Number 1 Foo Reason"))
|
||||
puts("PASS");
|
||||
else
|
||||
{
|
||||
status ++;
|
||||
printf("FAIL (\"%s\" instead of \"Number 1 Foo Reason\")\n", buffer);
|
||||
}
|
||||
|
||||
ppdClose(ppd);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -92,6 +92,8 @@ WEBIMAGES = \
|
||||
images/printer-idle.gif \
|
||||
images/printer-processing.gif \
|
||||
images/printer-stopped.gif \
|
||||
images/raster.png \
|
||||
images/raster.svg \
|
||||
images/smiley.jpg \
|
||||
images/tab-left.gif \
|
||||
images/tab-right.gif \
|
||||
|
||||
@@ -110,14 +110,13 @@ SPAN.info {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
H2 SPAN.info, H3 SPAN.info {
|
||||
H2 SPAN.info, H3 SPAN.info, H4 SPAN.info {
|
||||
float: right;
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
H2.title, H3.title {
|
||||
border-bottom: solid 2pt #000000;
|
||||
page-break-before: always;
|
||||
}
|
||||
|
||||
DT {
|
||||
@@ -134,7 +133,7 @@ DL.category DT {
|
||||
}
|
||||
|
||||
P.summary {
|
||||
margin-left: 54pt;
|
||||
margin-left: 36pt;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ SPAN.info {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
H2 SPAN.info, H3 SPAN.info {
|
||||
H2 SPAN.info, H3 SPAN.info, H4 SPAN.info {
|
||||
float: right;
|
||||
font-size: 100%;
|
||||
}
|
||||
@@ -196,9 +196,10 @@ DIV.sidebar {
|
||||
background: #ddddaa;
|
||||
border: solid 2px #cccc99;
|
||||
float: right;
|
||||
min-width: 25%;
|
||||
margin-left: 10pt;
|
||||
max-width: 33%;
|
||||
padding: 5pt;
|
||||
width: 25%;
|
||||
/* These are not implemented by all browsers, but that's OK */
|
||||
border-radius: 10pt;
|
||||
-moz-border-radius: 10pt;
|
||||
@@ -254,7 +255,7 @@ DL.category DT {
|
||||
}
|
||||
|
||||
P.summary {
|
||||
margin-left: 54pt;
|
||||
margin-left: 36pt;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
|
||||
|
Antes Largura: | Altura: | Tamanho: 623 B Depois Largura: | Altura: | Tamanho: 716 B |
|
Antes Largura: | Altura: | Tamanho: 527 B Depois Largura: | Altura: | Tamanho: 561 B |
|
Antes Largura: | Altura: | Tamanho: 617 B Depois Largura: | Altura: | Tamanho: 724 B |
|
Depois Largura: | Altura: | Tamanho: 948 B |
|
Antes Largura: | Altura: | Tamanho: 706 B Depois Largura: | Altura: | Tamanho: 892 B |
|
Antes Largura: | Altura: | Tamanho: 769 B Depois Largura: | Altura: | Tamanho: 897 B |
|
Antes Largura: | Altura: | Tamanho: 560 B Depois Largura: | Altura: | Tamanho: 646 B |
|
Depois Largura: | Altura: | Tamanho: 881 B |
|
Antes Largura: | Altura: | Tamanho: 777 B Depois Largura: | Altura: | Tamanho: 871 B |
|
Antes Largura: | Altura: | Tamanho: 882 B Depois Largura: | Altura: | Tamanho: 1.0 KiB |
|
Antes Largura: | Altura: | Tamanho: 359 B Depois Largura: | Altura: | Tamanho: 396 B |
|
Antes Largura: | Altura: | Tamanho: 461 B Depois Largura: | Altura: | Tamanho: 498 B |
|
Antes Largura: | Altura: | Tamanho: 483 B Depois Largura: | Altura: | Tamanho: 543 B |
|
Antes Largura: | Altura: | Tamanho: 562 B Depois Largura: | Altura: | Tamanho: 627 B |
|
Antes Largura: | Altura: | Tamanho: 788 B Depois Largura: | Altura: | Tamanho: 910 B |
|
Antes Largura: | Altura: | Tamanho: 838 B Depois Largura: | Altura: | Tamanho: 928 B |
|
Depois Largura: | Altura: | Tamanho: 977 B |
|
Antes Largura: | Altura: | Tamanho: 393 B Depois Largura: | Altura: | Tamanho: 424 B |
|
Antes Largura: | Altura: | Tamanho: 567 B Depois Largura: | Altura: | Tamanho: 603 B |
|
Antes Largura: | Altura: | Tamanho: 636 B Depois Largura: | Altura: | Tamanho: 807 B |
|
Antes Largura: | Altura: | Tamanho: 658 B Depois Largura: | Altura: | Tamanho: 744 B |
|
Antes Largura: | Altura: | Tamanho: 718 B Depois Largura: | Altura: | Tamanho: 914 B |
|
Antes Largura: | Altura: | Tamanho: 672 B Depois Largura: | Altura: | Tamanho: 788 B |
|
Antes Largura: | Altura: | Tamanho: 579 B Depois Largura: | Altura: | Tamanho: 618 B |
|
Antes Largura: | Altura: | Tamanho: 659 B Depois Largura: | Altura: | Tamanho: 797 B |
|
Antes Largura: | Altura: | Tamanho: 551 B Depois Largura: | Altura: | Tamanho: 669 B |
|
Antes Largura: | Altura: | Tamanho: 744 B Depois Largura: | Altura: | Tamanho: 918 B |
|
Antes Largura: | Altura: | Tamanho: 856 B Depois Largura: | Altura: | Tamanho: 930 B |
|
Antes Largura: | Altura: | Tamanho: 783 B Depois Largura: | Altura: | Tamanho: 858 B |
|
Antes Largura: | Altura: | Tamanho: 625 B Depois Largura: | Altura: | Tamanho: 722 B |
|
Antes Largura: | Altura: | Tamanho: 642 B Depois Largura: | Altura: | Tamanho: 781 B |
|
Antes Largura: | Altura: | Tamanho: 550 B Depois Largura: | Altura: | Tamanho: 640 B |
|
Antes Largura: | Altura: | Tamanho: 615 B Depois Largura: | Altura: | Tamanho: 738 B |
|
Antes Largura: | Altura: | Tamanho: 601 B Depois Largura: | Altura: | Tamanho: 737 B |
|
Antes Largura: | Altura: | Tamanho: 389 B Depois Largura: | Altura: | Tamanho: 416 B |
|
Antes Largura: | Altura: | Tamanho: 822 B Depois Largura: | Altura: | Tamanho: 888 B |
|
Antes Largura: | Altura: | Tamanho: 794 B Depois Largura: | Altura: | Tamanho: 977 B |
|
Antes Largura: | Altura: | Tamanho: 809 B Depois Largura: | Altura: | Tamanho: 925 B |
|
Antes Largura: | Altura: | Tamanho: 726 B Depois Largura: | Altura: | Tamanho: 910 B |
|
Antes Largura: | Altura: | Tamanho: 747 B Depois Largura: | Altura: | Tamanho: 904 B |
|
Antes Largura: | Altura: | Tamanho: 853 B Depois Largura: | Altura: | Tamanho: 1.0 KiB |
|
Antes Largura: | Altura: | Tamanho: 622 B Depois Largura: | Altura: | Tamanho: 732 B |
|
Antes Largura: | Altura: | Tamanho: 562 B Depois Largura: | Altura: | Tamanho: 663 B |
|
Antes Largura: | Altura: | Tamanho: 721 B Depois Largura: | Altura: | Tamanho: 851 B |
|
Antes Largura: | Altura: | Tamanho: 736 B Depois Largura: | Altura: | Tamanho: 884 B |
|
Antes Largura: | Altura: | Tamanho: 491 B Depois Largura: | Altura: | Tamanho: 551 B |
|
Antes Largura: | Altura: | Tamanho: 586 B Depois Largura: | Altura: | Tamanho: 635 B |
|
Antes Largura: | Altura: | Tamanho: 526 B Depois Largura: | Altura: | Tamanho: 562 B |
|
Antes Largura: | Altura: | Tamanho: 619 B Depois Largura: | Altura: | Tamanho: 674 B |
|
Antes Largura: | Altura: | Tamanho: 698 B Depois Largura: | Altura: | Tamanho: 817 B |
|
Antes Largura: | Altura: | Tamanho: 1.1 KiB Depois Largura: | Altura: | Tamanho: 1.4 KiB |
|
Antes Largura: | Altura: | Tamanho: 940 B Depois Largura: | Altura: | Tamanho: 1.1 KiB |
|
Antes Largura: | Altura: | Tamanho: 900 B Depois Largura: | Altura: | Tamanho: 1.1 KiB |
|
Antes Largura: | Altura: | Tamanho: 949 B Depois Largura: | Altura: | Tamanho: 1.2 KiB |
|
Antes Largura: | Altura: | Tamanho: 706 B Depois Largura: | Altura: | Tamanho: 843 B |
@@ -0,0 +1,55 @@
|
||||
button-accept-jobs.gif green Aceptar trabajos
|
||||
button-add-class.gif standard Añadir clase
|
||||
button-add-printer.gif standard Añadir impresora
|
||||
button-add-rss-subscription.gif standard Añadir subscripción RSS
|
||||
button-add-this-printer.gif standard Añadir esta impresora
|
||||
button-cancel-all-jobs.gif black Cancelar todos los trabajos
|
||||
button-cancel-job.gif black Cancelar trabajo
|
||||
button-cancel-subscription.gif standard Cancelar subscripción
|
||||
button-change-settings.gif standard Cambiar especificaciones
|
||||
button-clean-print-heads.gif standard Limpiar cabezales de impresión
|
||||
button-clear.gif standard Borrar
|
||||
button-continue.gif standard Siguiente
|
||||
button-delete-class.gif black Borrar clase
|
||||
button-delete-printer.gif black Borrar impresora
|
||||
button-edit-configuration-file.gif standard Editar archivo configuración
|
||||
button-export-samba.gif standard Exportar impresoras a Samba
|
||||
button-find-new-printers.gif standard Encontrar nuevas impresoras
|
||||
button-help.gif standard Ayuda
|
||||
button-hold-job.gif red Retener trabajo
|
||||
button-manage-classes.gif standard Administrar clases
|
||||
button-manage-jobs.gif standard Administrar trabajos
|
||||
button-manage-printers.gif standard Administrar impresoras
|
||||
button-manage-server.gif standard Administrar servidor
|
||||
button-modify-class.gif standard Modificar clase
|
||||
button-modify-printer.gif standard Modificar impresora
|
||||
button-move-job.gif standard Mover trabajo
|
||||
button-move-jobs.gif standard Mover todos los trabajos
|
||||
button-print-self-test-page.gif standard Imprimir página de auto prueba
|
||||
button-print-test-page.gif standard Imprimir página de prueba
|
||||
button-publish-printer.gif standard Publicar impresora
|
||||
button-reject-jobs.gif red Rechazar trabajos
|
||||
button-release-job.gif green Liberar trabajo
|
||||
button-restart-job.gif standard Reimprimir trabajo
|
||||
button-save-changes.gif standard Guardar cambios
|
||||
button-search.gif standard Buscar
|
||||
button-set-allowed-users.gif standard Cambiar usuarios permitidos
|
||||
button-set-as-default.gif standard Poner como predeterminada
|
||||
button-set-printer-options.gif standard Cambiar opciones impresora
|
||||
button-show-active.gif standard Mostrar trabajos activos
|
||||
button-show-all.gif standard Mostrar todos los trabajos
|
||||
button-show-completed.gif standard Mostrar trabajos completados
|
||||
button-show-next.gif standard Mostrar siguiente
|
||||
button-show-previous.gif standard Mostrar anterior
|
||||
button-sort-ascending.gif standard @UP Orden ascendente @UP
|
||||
button-sort-descending.gif standard @DOWN Orden descendente @DOWN
|
||||
button-start-class.gif green Iniciar clase
|
||||
button-start-printer.gif green Iniciar impresora
|
||||
button-stop-class.gif red Detener clase
|
||||
button-stop-printer.gif red Detener impresora
|
||||
button-unpublish-printer.gif standard No publicar impresora
|
||||
button-use-default-config.gif standard Usar archivo de configuración predeterminado
|
||||
button-view-access-log.gif standard Ver archivo de registro de accesos
|
||||
button-view-error-log.gif standard Ver archivo de registro de errores
|
||||
button-view-page-log.gif standard Ver archivo de registro de páginas
|
||||
button-view-printable-version.gif standard Ver versión imprimible
|
||||
@@ -62,7 +62,7 @@ BORDER="0" ALT=""></A>
|
||||
|
||||
<P>Estas páginas web permiten monitorizar sus impresoras y trabajos
|
||||
así como realizar tareas de administración del sistema.
|
||||
Haga click en cualquiera de las pestañas de la parte superior o en los
|
||||
Haga clic en cualquiera de las pestañas de la parte superior o en los
|
||||
botones de la parte inferior para realizar la tarea correspondiente.</P>
|
||||
|
||||
<P>
|
||||
@@ -88,7 +88,7 @@ STYLE="padding-right: 10px;" ALT="Ordenador feliz e impresora">
|
||||
CUPS proporciona una capa de impresión portable
|
||||
para sistemas operativos basados en
|
||||
UNIX<SUP>®</SUP>. Está desarrollado y mantenido
|
||||
por <A HREF="http://www.apple.com">Apple Inc.</a> para favorecer una solución de impresión
|
||||
por <A HREF="http://www.apple.com">Apple Inc.</A> para favorecer una solución de impresión
|
||||
estandar. CUPS es el sistema de impresión estandar usado en
|
||||
MacOS<SUP>®</SUP> X y la mayoría de distribuciones
|
||||
Linux<SUP>®</SUP>.</P>
|
||||
|
||||
@@ -11,6 +11,15 @@ to a remote authenticated queue. This document describes how to configure
|
||||
CUPS to use Kerberos authentication and provides helpful links to the MIT
|
||||
help pages for configuring Kerberos on your systems and network.</P>
|
||||
|
||||
<BLOCKQUOTE><B>Note:</B>
|
||||
|
||||
<P>In order to use Kerberos-authenticated shared printers, you <EM>must</EM> be
|
||||
running a version of MIT Kerberos with the <TT>krb5_cc_new_unique()</TT>
|
||||
function or Heimdal Kerberos. Otherwise, only local Kerberos authentication
|
||||
is supported.</P>
|
||||
|
||||
</BLOCKQUOTE>
|
||||
|
||||
|
||||
<H2 CLASS="title"><A NAME="KRB5">Configuring Kerberos on Your System</A></H2>
|
||||
|
||||
@@ -126,8 +135,9 @@ lines to the policies you want to protect with authentication, for example:</P>
|
||||
<H2 CLASS="title"><A NAME="IMPLEMENT">Implementation Information</A></H2>
|
||||
|
||||
<P>CUPS implements Kerberos over HTTP using GSS API and the service name
|
||||
"ipp". Delegation of credentials (needed for remote printers with
|
||||
authentication) is only supported when using a single KDC on your network.</P>
|
||||
"ipp". Delegation of credentials, which is needed when printing to a
|
||||
remote/shared printer with Kerberos authentication, is currently only supported
|
||||
when using a single KDC on your network.</P>
|
||||
|
||||
<P>After getting a user's Kerberos credentials, CUPS strips the "@KDC"
|
||||
portion of the username so that it can check the group membership locally,
|
||||
|
||||
@@ -137,16 +137,16 @@ queue.</P>
|
||||
printing more than one copy of a file:</P>
|
||||
|
||||
<PRE CLASS="command">
|
||||
lp -n <I>num-copies</I> filename
|
||||
lpr -#<I>num-copies</I> filename
|
||||
lp -n <EM>num-copies</EM> filename
|
||||
lpr -#<EM>num-copies</EM> filename
|
||||
</PRE>
|
||||
|
||||
<P>Copies are normally <EM>not</EM> collated for you. Use the
|
||||
<CODE>-o Collate=True</CODE> option to get collated copies:</P>
|
||||
|
||||
<PRE CLASS="command">
|
||||
lp -n <I>num-copies</I> -o Collate=True filename
|
||||
lpr -#<I>num-copies</I> -o Collate=True filename
|
||||
lp -n <EM>num-copies</EM> -o Collate=True filename
|
||||
lpr -#<EM>num-copies</EM> -o Collate=True filename
|
||||
</PRE>
|
||||
|
||||
|
||||
@@ -156,11 +156,11 @@ lpr -#<I>num-copies</I> -o Collate=True filename
|
||||
HREF="man-lprm.html">lprm(1)</A> commands cancel a print job:</P>
|
||||
|
||||
<PRE CLASS="command">
|
||||
cancel <I>job-id</I>
|
||||
lprm <I>job-id</I>
|
||||
cancel <EM>job-id</EM>
|
||||
lprm <EM>job-id</EM>
|
||||
</PRE>
|
||||
|
||||
<P>The <I>job-id</I> is the number that was reported to you by
|
||||
<P>The <EM>job-id</EM> is the number that was reported to you by
|
||||
the <B>lp</B> command. You can also get the job ID using the <A
|
||||
HREF="man-lpq.html">lpq(1)</A> or <A
|
||||
HREF="man-lpstat.html">lpstat</A> commands:</P>
|
||||
@@ -177,10 +177,10 @@ lpstat
|
||||
job to a new printer or class:</P>
|
||||
|
||||
<PRE CLASS="command">
|
||||
lpmove <I>job-id</I> <i>destination</i>
|
||||
lpmove <EM>job-id</EM> <i>destination</i>
|
||||
</PRE>
|
||||
|
||||
<P>The <I>job-id</I> is the number that was reported to you by
|
||||
<P>The <EM>job-id</EM> is the number that was reported to you by
|
||||
the <B>lp</B> or <B>lpstat</B> commands. <i>Destination</i> is the
|
||||
name of a printer or class that you want to actually print the job.
|
||||
|
||||
@@ -256,10 +256,10 @@ lpoptions -p printer -l
|
||||
<P>When <CODE>Custom</CODE> is listed for the <CODE>PageSize</CODE> option, you can specify custom media sizes using one of the following forms:</P>
|
||||
|
||||
<PRE CLASS="command">
|
||||
lp -o media=Custom.<I>WIDTH</I>x<I>LENGTH</I> filename
|
||||
lp -o media=Custom.<I>WIDTH</I>x<I>LENGTH</I>in filename
|
||||
lp -o media=Custom.<I>WIDTH</I>x<I>LENGTH</I>cm filename
|
||||
lp -o media=Custom.<I>WIDTH</I>x<I>LENGTH</I>mm filename
|
||||
lp -o media=Custom.<EM>WIDTH</EM>x<EM>LENGTH</EM> filename
|
||||
lp -o media=Custom.<EM>WIDTH</EM>x<EM>LENGTH</EM>in filename
|
||||
lp -o media=Custom.<EM>WIDTH</EM>x<EM>LENGTH</EM>cm filename
|
||||
lp -o media=Custom.<EM>WIDTH</EM>x<EM>LENGTH</EM>mm filename
|
||||
</PRE>
|
||||
|
||||
<P>where "WIDTH" and "LENGTH" are the width and length of the media in points, inches, centimeters, or millimeters, respectively.</P>
|
||||
@@ -294,6 +294,7 @@ page depending on the value of N:</P>
|
||||
|
||||
</UL>
|
||||
|
||||
|
||||
<H3><A NAME="SIDES">Printing On Both Sides of the Paper</A></H3>
|
||||
|
||||
<P>The <CODE>-o sides=two-sided-short-edge</CODE> and <CODE>-o
|
||||
@@ -317,6 +318,7 @@ lp -o sides=one-sided filename
|
||||
lpr -o sides=one-sided filename
|
||||
</PRE>
|
||||
|
||||
|
||||
<H3><A NAME="JOBSHEETS">Selecting the Banner Page(s)</A></H3>
|
||||
|
||||
<P>The <CODE>-o jobsheets=start,end</CODE> option sets the banner
|
||||
@@ -360,6 +362,60 @@ configuration; CUPS includes the following banner files:</P>
|
||||
</UL>
|
||||
|
||||
|
||||
<H3><A NAME="JOBHOLDUNTIL">Holding Jobs for Later Printing</A></H3>
|
||||
|
||||
<P>The <CODE>-o job-hold-until=when</CODE> option tells CUPS to
|
||||
delay printing until the "when" time, which can be one of the
|
||||
following:</P>
|
||||
|
||||
<UL>
|
||||
|
||||
<LI><CODE>-o job-hold-until=indefinite</CODE>; print only
|
||||
after released by the user or an administrator</LI>
|
||||
|
||||
<LI><CODE>-o job-hold-until=day-time</CODE>; print from
|
||||
6am to 6pm local time</LI>
|
||||
|
||||
<LI><CODE>-o job-hold-until=night</CODE>; print from
|
||||
6pm to 6am local time</LI>
|
||||
|
||||
<LI><CODE>-o job-hold-until=second-shift</CODE>; print from
|
||||
4pm to 12am local time</LI>
|
||||
|
||||
<LI><CODE>-o job-hold-until=third-shift</CODE>; print from
|
||||
12am to 8am local time</LI>
|
||||
|
||||
<LI><CODE>-o job-hold-until=weekend</CODE>; print on Saturday
|
||||
or Sunday</LI>
|
||||
|
||||
<LI><CODE>-o job-hold-until=HH:MM</CODE>; print at the specified
|
||||
UTC time</LI>
|
||||
|
||||
</UL>
|
||||
|
||||
<H3><A NAME="RELEASEJOB">Releasing Held Jobs</A></H3>
|
||||
|
||||
<P>Aside from the web interface, you can use the <B>lp</B> command
|
||||
to release a held job:</P>
|
||||
|
||||
<PRE CLASS="command">
|
||||
lp -i <em>job-id</em> -H resume
|
||||
</PRE>
|
||||
|
||||
<P>where "job-id" is the job ID reported by the <B>lpstat</B>
|
||||
command.</P>
|
||||
|
||||
|
||||
<H3><A NAME="JOBPRIORITY">Setting the Job Priority</A></H3>
|
||||
|
||||
<P>The <CODE>-o job-priority=NNN</CODE> option tells CUPS to
|
||||
assign a priority to your job from 1 (lowest) to 100 (highest),
|
||||
which influences where the job appears in the print queue. Higher
|
||||
priority jobs are printed before lower priority jobs, however
|
||||
submitting a new job with a high priority will not interrupt an
|
||||
</P>
|
||||
|
||||
|
||||
<H3><A NAME="OUTPUTORDER">Specifying the Output Order</A></H3>
|
||||
|
||||
<P>The <CODE>-o outputorder=normal</CODE> and <CODE>-o outputorder=reverse</CODE> options specify the order of the pages. Normal order prints page 1 first, page 2 second, and so forth. Reverse order prints page 1 last.</P>
|
||||
@@ -447,9 +503,48 @@ lpr -o fitplot filename
|
||||
|
||||
<P>The default is to use the size specified in the file.</P>
|
||||
|
||||
<BLOCKQUOTE>Note: This feature depends upon an accurate size in
|
||||
<BLOCKQUOTE><B>Note:</B>
|
||||
|
||||
<P>This feature depends upon an accurate size in
|
||||
the print file. If no size is given in the file, the page may be
|
||||
scaled incorrectly!</BLOCKQUOTE>
|
||||
scaled incorrectly!
|
||||
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H3><A NAME="OUTPUTORDER">Printing in Reverse Order</A></H3>
|
||||
|
||||
<P>The <CODE>-o outputorder=reverse</CODE> option will print the
|
||||
pages in reverse order:</P>
|
||||
|
||||
<PRE CLASS="command">
|
||||
lp -o outputorder=reverse filename
|
||||
lpr -o outputorder=reverse filename
|
||||
</PRE>
|
||||
|
||||
<P>Similarly, the <CODE>-o outputorder=normal</CODE> option will
|
||||
print starting with page 1:</P>
|
||||
|
||||
<PRE CLASS="command">
|
||||
lp -o outputorder=normal filename
|
||||
lpr -o outputorder=normal filename
|
||||
</PRE>
|
||||
|
||||
<P>The default is <CODE>-o outputorder=normal</CODE> for
|
||||
printers that print face down and <CODE>-o outputorder=reverse</CODE>
|
||||
for printers that print face up.
|
||||
|
||||
<H3><A NAME="MIRROR">Printing Mirrored Pages</A></H3>
|
||||
|
||||
<P>The <CODE>-o mirror</CODE> option flips each page along the
|
||||
vertical access to produce a mirrored image:</P>
|
||||
|
||||
<PRE CLASS="command">
|
||||
lp -o mirror filename
|
||||
lpr -o mirror filename
|
||||
</PRE>
|
||||
|
||||
<P>This is typically used when printing on T-shirt transfer
|
||||
media or sometimes on transparencies.</P>
|
||||
|
||||
<H3><A NAME="RAW">Raw or Unfiltered Output</A></H3>
|
||||
|
||||
@@ -523,11 +618,11 @@ page-right=value</CODE>, <CODE>-o page-top=value</CODE>, and
|
||||
margins:</P>
|
||||
|
||||
<PRE CLASS="command">
|
||||
lp -o page-left=<I>value</I> filename
|
||||
lp -o page-right=<I>value</I> filename
|
||||
lp -o page-top=<I>value</I> filename
|
||||
lp -o page-bottom=<I>value</I> filename
|
||||
lpr -o page-left=<I>value</I> -o page-right=<I>value</I> -o page-top=<I>value</I> -o page-bottom=<I>value</I> filename
|
||||
lp -o page-left=<EM>value</EM> filename
|
||||
lp -o page-right=<EM>value</EM> filename
|
||||
lp -o page-top=<EM>value</EM> filename
|
||||
lp -o page-bottom=<EM>value</EM> filename
|
||||
lpr -o page-left=<EM>value</EM> -o page-right=<EM>value</EM> -o page-top=<EM>value</EM> -o page-bottom=<EM>value</EM> filename
|
||||
</PRE>
|
||||
|
||||
<P>The <CODE>value</CODE> argument is the margin in points; each
|
||||
@@ -545,5 +640,197 @@ lp -o prettyprint filename
|
||||
lpr -o prettyprint filename
|
||||
</PRE>
|
||||
|
||||
<H3><A NAME="WRAP">Turning Off Text Wrapping</A><H3>
|
||||
|
||||
<P>The <CODE>-o nowrap</CODE> option disables wrapping of long lines:</P>
|
||||
|
||||
<PRE CLASS="command">
|
||||
lp -o nowrap filename
|
||||
lpr -o nowrap filename
|
||||
</PRE>
|
||||
|
||||
|
||||
<H2 CLASS="title"><SPAN CLASS="info">Not Supported on Mac OS X</SPAN><A NAME="IMAGEOPTIONS">Image Options</A></H2>
|
||||
|
||||
<P>CUPS supports several options that are only used when printing
|
||||
image files. These options have absolutely no effect on PostScript, PDF,
|
||||
HP-GL/2, or text files.</P>
|
||||
|
||||
<H3><A NAME="position">Positioning Images</A></H3>
|
||||
|
||||
<P>The <CODE>-o position=name</CODE> option specifies the position of the
|
||||
image on the page:
|
||||
|
||||
<UL>
|
||||
|
||||
<LI><CODE>center</CODE> - Center the image on the page (default)
|
||||
|
||||
<LI><CODE>top</CODE> - Print the image centered at the top of the page
|
||||
|
||||
<LI><CODE>left</CODE> - Print the image centered on the left of page
|
||||
|
||||
<LI><CODE>right</CODE> - Print the image centered on the right of the page
|
||||
|
||||
<LI><CODE>top-left</CODE> - Print the image at the top left corner of
|
||||
the page
|
||||
|
||||
<LI><CODE>top-right</CODE> - Print the image at the top right corner of
|
||||
the page
|
||||
|
||||
<LI><CODE>bottom</CODE> - Print the image centered at the bottom of
|
||||
the page
|
||||
|
||||
<LI><CODE>bottom-left</CODE> - Print the image at the bottom left
|
||||
corner of the page
|
||||
|
||||
<LI><CODE>bottom-right</CODE> - Print the image at the bottom right
|
||||
corner of the page
|
||||
|
||||
</UL>
|
||||
|
||||
<H3><A NAME="scaling">Scaling Images</A></H3>
|
||||
|
||||
<P>The <CODE>-o scaling=percent</CODE>, <CODE>-o
|
||||
ppi=value</CODE>, and <CODE>-o natural-scaling=percent</CODE>
|
||||
options change the size of a printed image:
|
||||
|
||||
<PRE CLASS="command">
|
||||
lp -o scaling=<EM>percent</EM> filename
|
||||
lp -o ppi=<EM>value</EM> filename
|
||||
lpr -o natural-scaling=<EM>percent</EM> filename
|
||||
</PRE>
|
||||
|
||||
<P>The <CODE>scaling=percent</CODE> value is a number from 1 to 800
|
||||
specifying the size in relation to the page (<EM>not</EM> the image.) A
|
||||
scaling of 100 percent will fill the page as completely as the image
|
||||
aspect ratio allows. A scaling of 200 percent will print on up to 4
|
||||
pages.
|
||||
|
||||
<P>The <CODE>ppi=value</CODE> value is a number from 1 to 1200 specifying the
|
||||
resolution of the image in pixels per inch. An image that is 3000x2400
|
||||
pixels will print 10x8 inches at 300 pixels per inch, for example. If
|
||||
the specified resolution makes the image larger than the page, multiple
|
||||
pages will be printed to satisfy the request.
|
||||
|
||||
<P>The <CODE>natural-scaling=percent</CODE> value is a number
|
||||
from 1 to 800 specifying the size in relation to the natural
|
||||
image size. A scaling of 100 percent will print the image at its
|
||||
natural size, while a scaling of 50 percent will print the image
|
||||
at half its natural size. If the specified scaling makes the
|
||||
image larger than the page, multiple pages will be printed to
|
||||
satisfy the request.
|
||||
|
||||
<H3><A NAME="hue">Adjusting Image Hue (Tint)</A></H3>
|
||||
|
||||
<P>The <CODE>-o hue=value</CODE> option will adjust the hue of the
|
||||
printed image, much like the tint control on your television:
|
||||
|
||||
<PRE CLASS="command">
|
||||
lp -o hue=<EM>value</EM> filename
|
||||
lpr -o hue=<EM>value</EM> filename
|
||||
</PRE>
|
||||
|
||||
<P>The <CODE>value</CODE> argument is a number from -360 to 360 and represents
|
||||
the color hue rotation. The following table summarizes the change you'll see
|
||||
with different colors:</P>
|
||||
|
||||
<DIV CLASS="table"><TABLE SUMMARY="Hue Values">
|
||||
<TR>
|
||||
<TH>Original</TH>
|
||||
<TH>hue=-45</TH>
|
||||
<TH>hue=45</TH>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>Red</TD>
|
||||
<TD>Purple</TD>
|
||||
<TD>Yellow-orange</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>Green</TD>
|
||||
<TD>Yellow-green</TD>
|
||||
<TD>Blue-green</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>Yellow</TD>
|
||||
<TD>Orange</TD>
|
||||
<TD>Green-yellow</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>Blue</TD>
|
||||
<TD>Sky-blue</TD>
|
||||
<TD>Purple</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>Magenta</TD>
|
||||
<TD>Indigo</TD>
|
||||
<TD>Crimson</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>Cyan</TD>
|
||||
<TD>Blue-green</TD>
|
||||
<TD>Light-navy-blue</TD>
|
||||
</TR>
|
||||
</TABLE></DIV>
|
||||
|
||||
<P>The default hue adjustment is 0.
|
||||
|
||||
<H3><A NAME="saturation">Adjusting Image Saturation (Color)</A></H3>
|
||||
|
||||
<P>The <CODE>-o saturation=percent</CODE> option adjusts the saturation
|
||||
of the colors in an image, much like the color control on your television:</P>
|
||||
|
||||
<PRE CLASS="command">
|
||||
lp -o saturation=<EM>percent</EM> filename
|
||||
lpr -o saturation=<EM>percent</EM> filename
|
||||
</PRE>
|
||||
|
||||
<P>The <CODE>percent</CODE> argument specifies the color saturation
|
||||
from 0 to 200. A color saturation of 0 produces a black-and-white
|
||||
print, while a value of 200 will make the colors extremely intense.</P>
|
||||
|
||||
<P>The default saturation is 100.</P>
|
||||
|
||||
|
||||
<H2 CLASS="title"><A NAME="HPGL2OPTIONS">HP-GL/2 Options</A></H2>
|
||||
|
||||
<P>CUPS supports several options that are only used when printing
|
||||
HP-GL/2 files. These options have absolutely no effect on PostScript, PDF,
|
||||
image, or text files.</P>
|
||||
|
||||
<H3><A NAME="blackplot">Printing in Black</A></H3>
|
||||
|
||||
<P>The <CODE>-o blackplot</CODE> option specifies that all pens should
|
||||
plot in black:</P>
|
||||
|
||||
<PRE CLASS="command">
|
||||
lp -o blackplot filename
|
||||
lpr -o blackplot filename
|
||||
</PRE>
|
||||
|
||||
<P>The default is to use the colors defined in the plot file or the
|
||||
standard pen colors defined in the HP-GL/2 reference manual from
|
||||
Hewlett Packard.
|
||||
|
||||
<H3><A NAME="penwidth">Setting the Default Pen Width</A></H3>
|
||||
|
||||
<P>The <CODE>-o penwidth=value</CODE> option specifies the default pen
|
||||
width for HP-GL/2 files:</P>
|
||||
|
||||
<PRE CLASS="command">
|
||||
lp -o penwidth=<EM>value</EM> filename
|
||||
lpr -o penwidth=<EM>value</EM> filename
|
||||
</PRE>
|
||||
|
||||
<P>The pen width <CODE>value</CODE> specifies the pen width in micrometers.
|
||||
The default value of 1000 produces lines that are 1 millimeter in width.
|
||||
Specifying a pen width of 0 produces lines that are exactly 1 pixel wide.</P>
|
||||
|
||||
<BLOCKQUOTE><B>Note:</B>
|
||||
|
||||
<P>This option is ignored when the pen widths are set in the plot
|
||||
file.
|
||||
|
||||
</BLOCKQUOTE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||