Comparar commits
1 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 92986e272e |
@@ -1,6 +1,73 @@
|
||||
CHANGES.txt - 2007-08-13
|
||||
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
|
||||
|
||||
|
||||
@@ -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,4 +1,4 @@
|
||||
INSTALL - CUPS v1.3.0 - 2007-08-13
|
||||
INSTALL - CUPS v1.3.2 - 2007-09-18
|
||||
----------------------------------
|
||||
|
||||
This file describes how to compile and install CUPS from source
|
||||
|
||||
@@ -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,4 +1,4 @@
|
||||
README - CUPS v1.3.0 - 2007-08-13
|
||||
README - CUPS v1.3.2 - 2007-09-18
|
||||
---------------------------------
|
||||
|
||||
Looking for compile instructions? Read the file "INSTALL.txt"
|
||||
|
||||
@@ -67,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);
|
||||
@@ -102,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 */
|
||||
@@ -132,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 */
|
||||
@@ -199,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);
|
||||
}
|
||||
|
||||
@@ -208,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...
|
||||
@@ -224,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);
|
||||
}
|
||||
|
||||
@@ -263,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...
|
||||
@@ -327,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);
|
||||
}
|
||||
@@ -340,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);
|
||||
}
|
||||
@@ -369,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -422,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
|
||||
@@ -434,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)
|
||||
@@ -470,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");
|
||||
@@ -488,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)
|
||||
{
|
||||
@@ -505,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);
|
||||
@@ -525,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);
|
||||
|
||||
@@ -543,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
|
||||
@@ -552,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);
|
||||
}
|
||||
|
||||
@@ -572,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)
|
||||
@@ -638,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);
|
||||
|
||||
@@ -663,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);
|
||||
@@ -679,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);
|
||||
}
|
||||
|
||||
@@ -713,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);
|
||||
|
||||
@@ -742,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);
|
||||
@@ -848,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)
|
||||
{
|
||||
@@ -875,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)
|
||||
@@ -944,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 ||
|
||||
@@ -954,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);
|
||||
@@ -1010,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;
|
||||
}
|
||||
}
|
||||
@@ -1035,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;)
|
||||
{
|
||||
@@ -1089,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;
|
||||
}
|
||||
}
|
||||
@@ -1124,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...
|
||||
@@ -1145,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...
|
||||
@@ -1211,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;
|
||||
@@ -1231,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());
|
||||
}
|
||||
|
||||
|
||||
@@ -1246,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 */
|
||||
@@ -1281,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);
|
||||
}
|
||||
}
|
||||
@@ -1312,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);
|
||||
}
|
||||
@@ -1339,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);
|
||||
@@ -1408,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... */
|
||||
@@ -1419,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",
|
||||
@@ -1431,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))
|
||||
@@ -1504,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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1550,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
|
||||
{
|
||||
@@ -1572,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);
|
||||
@@ -1629,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);
|
||||
}
|
||||
|
||||
@@ -1642,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);
|
||||
@@ -1656,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)
|
||||
@@ -1673,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);
|
||||
}
|
||||
@@ -439,7 +446,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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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, int serial_size, 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,6 +328,7 @@ 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, sizeof(serial), &location, &g.wait_eof);
|
||||
@@ -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 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,56 +1596,61 @@ static void parse_options(const char *options,
|
||||
if (!options)
|
||||
return;
|
||||
|
||||
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)
|
||||
{
|
||||
else if (!strcasecmp(name, "serial"))
|
||||
strlcpy(serial, value, serial_size);
|
||||
}
|
||||
else if (strcasecmp(optionName, "location") == 0 && location)
|
||||
else if (!strcasecmp(name, "location") && location)
|
||||
*location = strtol(value, NULL, 16);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1885,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));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-common.m4 6790 2007-08-13 20:09:45Z 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.3.0"
|
||||
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 6790 2007-08-13 20:09:45Z 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-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
|
||||
|
||||
@@ -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>?
|
||||
*/
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -186,6 +186,10 @@ translated buttons.</P>
|
||||
<TD>button-export-samba.gif</TD>
|
||||
<TD>Export Printers to Samba</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>button-find-new-printers.gif</TD>
|
||||
<TD>Find New Printers</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>button-help.gif</TD>
|
||||
<TD>Help</TD>
|
||||
@@ -379,7 +383,14 @@ message catalog and then make any necessary changes.</P>
|
||||
favorite text editor or translation program to translate the text
|
||||
to the desired language.</P>
|
||||
|
||||
<P>Finally, add your locale to the <CODE>LANGUAGES</CODE>
|
||||
<P>Then validate your translation using the <VAR>locale/checkpo</VAR> utility:</P>
|
||||
|
||||
<PRE CLASS="command">
|
||||
cd locale
|
||||
./checkpo cups_ll_CC.po
|
||||
</PRE>
|
||||
|
||||
<P>After fixing any errors in your translation, add your locale to the <CODE>LANGUAGES</CODE>
|
||||
variable in the <VAR>Makedefs</VAR> file and run the "make
|
||||
install" command in the <VAR>locale</VAR> subdirectory to test
|
||||
the translation.</P>
|
||||
@@ -555,6 +566,10 @@ translated all of the templates, add the locale to the
|
||||
<TD>This template shows the "showing N or M jobs" header in the
|
||||
jobs list.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>list-available-printers.tmpl</TD>
|
||||
<TD>This template shows a list of new printers that have been found.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>maintenance.tmpl</TD>
|
||||
<TD>This template shows "maintenance commands sent".</TD>
|
||||
@@ -916,6 +931,10 @@ supported <CODE>OP</CODE> values.</P>
|
||||
<TD>export-samba</TD>
|
||||
<TD>Exports printers to Samba.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>find-new-printers</TD>
|
||||
<TD>Find new printers that have not yet been added.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>modify-class</TD>
|
||||
<TD>Modifies a printer class.</TD>
|
||||
|
||||
|
Depois Largura: | Altura: | Tamanho: 37 KiB |
@@ -0,0 +1,386 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://web.resource.org/cc/"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="438.75"
|
||||
height="315"
|
||||
id="svg2"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.45.1"
|
||||
version="1.0"
|
||||
sodipodi:docbase="/home/mike/c/cups-trunk/doc/images"
|
||||
sodipodi:docname="raster.svg"
|
||||
inkscape:output_extension="org.inkscape.output.svg.inkscape"
|
||||
inkscape:export-filename="/home/mike/c/cups-trunk/doc/images/raster.png"
|
||||
inkscape:export-xdpi="128"
|
||||
inkscape:export-ydpi="128">
|
||||
<defs
|
||||
id="defs4" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
gridtolerance="10000"
|
||||
guidetolerance="10"
|
||||
objecttolerance="10"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.90444444"
|
||||
inkscape:cx="225"
|
||||
inkscape:cy="177.5167"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
width="351pt"
|
||||
height="252pt"
|
||||
units="pt"
|
||||
showgrid="true"
|
||||
gridspacingx="9pt"
|
||||
gridspacingy="9pt"
|
||||
gridanglex="24pt"
|
||||
gridanglez="24pt"
|
||||
grid_units="pt"
|
||||
inkscape:object-bbox="true"
|
||||
inkscape:object-points="true"
|
||||
inkscape:object-nodes="true"
|
||||
inkscape:grid-points="true"
|
||||
inkscape:guide-points="true"
|
||||
inkscape:window-width="872"
|
||||
inkscape:window-height="622"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<g
|
||||
id="g3338"
|
||||
transform="translate(0.5,-1.3515625)">
|
||||
<rect
|
||||
y="11.25"
|
||||
x="11.25"
|
||||
height="90"
|
||||
width="67.5"
|
||||
id="rect3336"
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<flowRoot
|
||||
transform="translate(11.34082,17.328046)"
|
||||
style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Monospace"
|
||||
id="flowRoot2357"
|
||||
xml:space="preserve"><flowRegion
|
||||
id="flowRegion2359"><rect
|
||||
style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Monospace"
|
||||
y="12.162162"
|
||||
x="9.95086"
|
||||
height="128.25552"
|
||||
width="86.240784"
|
||||
id="rect2361" /></flowRegion><flowPara
|
||||
id="flowPara2363">Back</flowPara><flowPara
|
||||
id="flowPara2365">Side</flowPara></flowRoot> </g>
|
||||
<g
|
||||
id="g3346"
|
||||
transform="translate(113,-1.3515625)">
|
||||
<rect
|
||||
y="11.25"
|
||||
x="11.25"
|
||||
height="90"
|
||||
width="67.5"
|
||||
id="rect3348"
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<flowRoot
|
||||
transform="translate(11.34082,17.328046)"
|
||||
style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Monospace"
|
||||
id="flowRoot3350"
|
||||
xml:space="preserve"><flowRegion
|
||||
id="flowRegion3352"><rect
|
||||
style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Monospace"
|
||||
y="12.162162"
|
||||
x="9.95086"
|
||||
height="128.25552"
|
||||
width="86.240784"
|
||||
id="rect3354" /></flowRegion><flowPara
|
||||
id="flowPara3356">Back</flowPara><flowPara
|
||||
id="flowPara3358">Side</flowPara></flowRoot> </g>
|
||||
<g
|
||||
id="g3360"
|
||||
transform="translate(226,-1.8515625)">
|
||||
<rect
|
||||
y="11.25"
|
||||
x="11.25"
|
||||
height="90"
|
||||
width="67.5"
|
||||
id="rect3362"
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<flowRoot
|
||||
transform="translate(11.34082,17.328046)"
|
||||
style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Monospace"
|
||||
id="flowRoot3364"
|
||||
xml:space="preserve"><flowRegion
|
||||
id="flowRegion3366"><rect
|
||||
style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Monospace"
|
||||
y="12.162162"
|
||||
x="9.95086"
|
||||
height="128.25552"
|
||||
width="86.240784"
|
||||
id="rect3368" /></flowRegion><flowPara
|
||||
id="flowPara3370">Back</flowPara><flowPara
|
||||
id="flowPara3372">Side</flowPara></flowRoot> </g>
|
||||
<g
|
||||
id="g3374"
|
||||
transform="matrix(-1,0,0,-1,428,111.14844)">
|
||||
<rect
|
||||
y="11.25"
|
||||
x="11.25"
|
||||
height="90"
|
||||
width="67.5"
|
||||
id="rect3376"
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<flowRoot
|
||||
transform="translate(11.34082,17.328046)"
|
||||
style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Monospace"
|
||||
id="flowRoot3378"
|
||||
xml:space="preserve"><flowRegion
|
||||
id="flowRegion3380"><rect
|
||||
style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Monospace"
|
||||
y="12.162162"
|
||||
x="9.95086"
|
||||
height="128.25552"
|
||||
width="86.240784"
|
||||
id="rect3382" /></flowRegion><flowPara
|
||||
id="flowPara3384">Back</flowPara><flowPara
|
||||
id="flowPara3386">Side</flowPara></flowRoot> </g>
|
||||
<g
|
||||
id="g3388"
|
||||
transform="matrix(-1,0,0,-1,90.5,279.89844)">
|
||||
<rect
|
||||
y="11.25"
|
||||
x="11.25"
|
||||
height="90"
|
||||
width="67.5"
|
||||
id="rect3390"
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<flowRoot
|
||||
transform="translate(11.34082,17.328046)"
|
||||
style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Monospace"
|
||||
id="flowRoot3392"
|
||||
xml:space="preserve"><flowRegion
|
||||
id="flowRegion3394"><rect
|
||||
style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Monospace"
|
||||
y="12.162162"
|
||||
x="9.95086"
|
||||
height="128.25552"
|
||||
width="86.240784"
|
||||
id="rect3396" /></flowRegion><flowPara
|
||||
id="flowPara3398">Back</flowPara><flowPara
|
||||
id="flowPara3400">Side</flowPara></flowRoot> </g>
|
||||
<g
|
||||
id="g3402"
|
||||
transform="translate(113,167.39844)">
|
||||
<rect
|
||||
y="11.25"
|
||||
x="11.25"
|
||||
height="90"
|
||||
width="67.5"
|
||||
id="rect3404"
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<flowRoot
|
||||
transform="translate(11.34082,17.328046)"
|
||||
style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Monospace"
|
||||
id="flowRoot3406"
|
||||
xml:space="preserve"><flowRegion
|
||||
id="flowRegion3408"><rect
|
||||
style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Monospace"
|
||||
y="12.162162"
|
||||
x="9.95086"
|
||||
height="128.25552"
|
||||
width="86.240784"
|
||||
id="rect3410" /></flowRegion><flowPara
|
||||
id="flowPara3412">Back</flowPara><flowPara
|
||||
id="flowPara3414">Side</flowPara></flowRoot> </g>
|
||||
<g
|
||||
id="g3416"
|
||||
transform="matrix(1,0,0,-1,226,279.39844)">
|
||||
<rect
|
||||
y="11.25"
|
||||
x="11.25"
|
||||
height="90"
|
||||
width="67.5"
|
||||
id="rect3418"
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<flowRoot
|
||||
transform="translate(11.34082,17.328046)"
|
||||
style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Monospace"
|
||||
id="flowRoot3420"
|
||||
xml:space="preserve"><flowRegion
|
||||
id="flowRegion3422"><rect
|
||||
style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Monospace"
|
||||
y="12.162162"
|
||||
x="9.95086"
|
||||
height="128.25552"
|
||||
width="86.240784"
|
||||
id="rect3424" /></flowRegion><flowPara
|
||||
id="flowPara3426">Back</flowPara><flowPara
|
||||
id="flowPara3428">Side</flowPara></flowRoot> </g>
|
||||
<g
|
||||
id="g3430"
|
||||
transform="matrix(-1,0,0,1,428,167.39844)">
|
||||
<rect
|
||||
y="11.25"
|
||||
x="11.25"
|
||||
height="90"
|
||||
width="67.5"
|
||||
id="rect3432"
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<flowRoot
|
||||
transform="translate(11.34082,17.328046)"
|
||||
style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Monospace"
|
||||
id="flowRoot3434"
|
||||
xml:space="preserve"><flowRegion
|
||||
id="flowRegion3436"><rect
|
||||
style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Monospace"
|
||||
y="12.162162"
|
||||
x="9.95086"
|
||||
height="128.25552"
|
||||
width="86.240784"
|
||||
id="rect3438" /></flowRegion><flowPara
|
||||
id="flowPara3440">Back</flowPara><flowPara
|
||||
id="flowPara3442">Side</flowPara></flowRoot> </g>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Monospace"
|
||||
x="47.503906"
|
||||
y="119.83008"
|
||||
id="text3444"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan3446"
|
||||
x="47.503906"
|
||||
y="119.83008">Normal</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
x="47.503906"
|
||||
y="134.83008"
|
||||
id="tspan3448">false</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Monospace"
|
||||
x="160.00391"
|
||||
y="119.83008"
|
||||
id="text3450"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan3452"
|
||||
x="160.00391"
|
||||
y="119.83008">Normal</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
x="160.00391"
|
||||
y="134.83008"
|
||||
id="tspan3454">true</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Monospace"
|
||||
x="273.00391"
|
||||
y="119.83008"
|
||||
id="text3456"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan3458"
|
||||
x="273.00391"
|
||||
y="119.83008">ManualTumble</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
x="273.00391"
|
||||
y="134.83008"
|
||||
id="tspan3460">false</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Monospace"
|
||||
x="385.39062"
|
||||
y="119.83008"
|
||||
id="text3462"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan3464"
|
||||
x="385.39062"
|
||||
y="119.83008">ManualTumble</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
x="385.39062"
|
||||
y="134.83008"
|
||||
id="tspan3466">true</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Monospace"
|
||||
x="43.847656"
|
||||
y="288.51562"
|
||||
id="text3468"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan3470"
|
||||
x="43.847656"
|
||||
y="288.51562">Rotated</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
x="43.847656"
|
||||
y="303.51562"
|
||||
id="tspan3472">false</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Monospace"
|
||||
x="156.84766"
|
||||
y="288.51562"
|
||||
id="text3474"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan3476"
|
||||
x="156.84766"
|
||||
y="288.51562">Rotated</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
x="156.84766"
|
||||
y="303.51562"
|
||||
id="tspan3478">true</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Monospace"
|
||||
x="269.34766"
|
||||
y="288.58008"
|
||||
id="text3480"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan3482"
|
||||
x="269.34766"
|
||||
y="288.58008">Flipped</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
x="269.34766"
|
||||
y="303.58008"
|
||||
id="tspan3484">false</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Monospace"
|
||||
x="381.84766"
|
||||
y="288.58008"
|
||||
id="text3486"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan3488"
|
||||
x="381.84766"
|
||||
y="288.58008">Flipped</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
x="381.84766"
|
||||
y="303.58008"
|
||||
id="tspan3490">true</tspan></text>
|
||||
</g>
|
||||
</svg>
|
||||
|
Depois Largura: | Altura: | Tamanho: 17 KiB |
@@ -660,7 +660,8 @@ EndPage(ppd_file_t *ppd, /* I - PPD file */
|
||||
* End the label and eject...
|
||||
*/
|
||||
|
||||
puts("^XZ");
|
||||
puts("^IDR:CUPS.GRF^FS");
|
||||
puts("^XZ");
|
||||
|
||||
/*
|
||||
* Free compression buffers...
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
include ../Makedefs
|
||||
|
||||
|
||||
OBJS = po2strings.o strings2po.o translate.o
|
||||
TARGETS = po2strings strings2po translate
|
||||
OBJS = checkpo po2strings.o strings2po.o translate.o
|
||||
TARGETS = checkpo po2strings strings2po translate
|
||||
|
||||
|
||||
#
|
||||
@@ -95,6 +95,18 @@ pot:
|
||||
done
|
||||
|
||||
|
||||
#
|
||||
# checkpo - A simple utility to check PO files for correct translation
|
||||
# strings.
|
||||
#
|
||||
# checkpo filename.po [... filenameN.po]
|
||||
#
|
||||
|
||||
checkpo: checkpo.o ../cups/$(LIBCUPS)
|
||||
echo Linking $<...
|
||||
$(CC) $(LDFLAGS) -o checkpo checkpo.o $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
# po2strings - A simple utility which uses iconv to convert GNU gettext
|
||||
# message catalogs to Mac OS X .strings files.
|
||||
|
||||
@@ -0,0 +1,343 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Verify that translations in the .po file have the same number and type of
|
||||
* printf-style format strings.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* checkpo filename.po [... filenameN.po]
|
||||
*
|
||||
* Compile with:
|
||||
*
|
||||
* gcc -o checkpo checkpo.c `cups-config --libs`
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Validate .po files.
|
||||
* abbreviate() - Abbreviate a message string as needed.
|
||||
* collect_formats() - Collect all of the format strings in the msgid.
|
||||
* free_formats() - Free all of the format strings.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <cups/string.h>
|
||||
#include <cups/i18n.h>
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static char *abbreviate(const char *s, char *buf, int bufsize);
|
||||
static cups_array_t *collect_formats(const char *id);
|
||||
static void free_formats(cups_array_t *fmts);
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Validate .po files.
|
||||
*/
|
||||
|
||||
int /* O - Exit code */
|
||||
main(int argc, /* I - Number of command-line args */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
cups_array_t *po; /* .po file */
|
||||
_cups_message_t *msg; /* Current message */
|
||||
cups_array_t *idfmts, /* Format strings in msgid */
|
||||
*strfmts; /* Format strings in msgstr */
|
||||
char *idfmt, /* Current msgid format string */
|
||||
*strfmt; /* Current msgstr format string */
|
||||
int fmtidx, /* Format index */
|
||||
fmtcount; /* Format count */
|
||||
int status, /* Exit status */
|
||||
pass, /* Pass/fail status */
|
||||
untranslated; /* Untranslated messages */
|
||||
char idbuf[80], /* Abbreviated msgid */
|
||||
strbuf[80]; /* Abbreviated msgstr */
|
||||
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
puts("Usage: checkpo filename.po [... filenameN.po]");
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check every .po file on the command-line...
|
||||
*/
|
||||
|
||||
for (i = 1, status = 0; i < argc; i ++)
|
||||
{
|
||||
/*
|
||||
* Use the CUPS .po loader to get the message strings...
|
||||
*/
|
||||
|
||||
if ((po = _cupsMessageLoad(argv[i])) == NULL)
|
||||
{
|
||||
perror(argv[i]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
printf("%s: ", argv[i]);
|
||||
fflush(stdout);
|
||||
|
||||
/*
|
||||
* Scan every message for a % string and then match them up with
|
||||
* the corresponding string in the translation...
|
||||
*/
|
||||
|
||||
pass = 1;
|
||||
untranslated = 0;
|
||||
|
||||
for (msg = (_cups_message_t *)cupsArrayFirst(po);
|
||||
msg;
|
||||
msg = (_cups_message_t *)cupsArrayNext(po))
|
||||
{
|
||||
if (!msg->str || !msg->str[0])
|
||||
{
|
||||
untranslated ++;
|
||||
continue;
|
||||
}
|
||||
else if (strchr(msg->id, '%'))
|
||||
{
|
||||
idfmts = collect_formats(msg->id);
|
||||
strfmts = collect_formats(msg->str);
|
||||
fmtidx = 0;
|
||||
|
||||
for (strfmt = (char *)cupsArrayFirst(strfmts);
|
||||
strfmt;
|
||||
strfmt = (char *)cupsArrayNext(strfmts))
|
||||
{
|
||||
if (isdigit(strfmt[1] & 255) && strfmt[2] == '$')
|
||||
{
|
||||
/*
|
||||
* Handle positioned format stuff...
|
||||
*/
|
||||
|
||||
fmtidx = strfmt[1] - '1';
|
||||
strfmt += 3;
|
||||
if ((idfmt = (char *)cupsArrayIndex(idfmts, fmtidx)) != NULL)
|
||||
idfmt ++;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Compare against the current format...
|
||||
*/
|
||||
|
||||
idfmt = (char *)cupsArrayIndex(idfmts, fmtidx);
|
||||
}
|
||||
|
||||
fmtidx ++;
|
||||
|
||||
if (!idfmt || strcmp(strfmt, idfmt))
|
||||
break;
|
||||
|
||||
fmtcount ++;
|
||||
}
|
||||
|
||||
if (cupsArrayCount(strfmts) != cupsArrayCount(idfmts) || strfmt)
|
||||
{
|
||||
if (pass)
|
||||
{
|
||||
pass = 0;
|
||||
puts("FAIL");
|
||||
}
|
||||
|
||||
printf(" Bad translation string \"%s\"\n for \"%s\"\n",
|
||||
abbreviate(msg->str, strbuf, sizeof(strbuf)),
|
||||
abbreviate(msg->id, idbuf, sizeof(idbuf)));
|
||||
fputs(" Translation formats:", stdout);
|
||||
for (strfmt = (char *)cupsArrayFirst(strfmts);
|
||||
strfmt;
|
||||
strfmt = (char *)cupsArrayNext(strfmts))
|
||||
printf(" %s", strfmt);
|
||||
fputs("\n Original formats:", stdout);
|
||||
for (idfmt = (char *)cupsArrayFirst(idfmts);
|
||||
idfmt;
|
||||
idfmt = (char *)cupsArrayNext(idfmts))
|
||||
printf(" %s", idfmt);
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
free_formats(idfmts);
|
||||
free_formats(strfmts);
|
||||
}
|
||||
|
||||
if ((!strncmp(msg->id, "ALERT:", 6) && strncmp(msg->str, "ALERT:", 6)) ||
|
||||
(!strncmp(msg->id, "CRIT:", 5) && strncmp(msg->str, "CRIT:", 5)) ||
|
||||
(!strncmp(msg->id, "DEBUG:", 6) && strncmp(msg->str, "DEBUG:", 6)) ||
|
||||
(!strncmp(msg->id, "DEBUG2:", 7) && strncmp(msg->str, "DEBUG2:", 7)) ||
|
||||
(!strncmp(msg->id, "EMERG:", 6) && strncmp(msg->str, "EMERG:", 6)) ||
|
||||
(!strncmp(msg->id, "ERROR:", 6) && strncmp(msg->str, "ERROR:", 6)) ||
|
||||
(!strncmp(msg->id, "INFO:", 5) && strncmp(msg->str, "INFO:", 5)) ||
|
||||
(!strncmp(msg->id, "NOTICE:", 7) && strncmp(msg->str, "NOTICE:", 7)) ||
|
||||
(!strncmp(msg->id, "WARNING:", 8) && strncmp(msg->str, "WARNING:", 8)))
|
||||
{
|
||||
if (pass)
|
||||
{
|
||||
pass = 0;
|
||||
puts("FAIL");
|
||||
}
|
||||
|
||||
printf(" Bad prefix on filter message \"%s\"\n for \"%s\"\n",
|
||||
abbreviate(msg->str, strbuf, sizeof(strbuf)),
|
||||
abbreviate(msg->id, idbuf, sizeof(idbuf)));
|
||||
}
|
||||
}
|
||||
|
||||
if (pass)
|
||||
{
|
||||
if ((untranslated * 10) >= cupsArrayCount(po))
|
||||
{
|
||||
/*
|
||||
* Only allow 10% of messages to be untranslated before we fail...
|
||||
*/
|
||||
|
||||
pass = 0;
|
||||
puts("FAIL");
|
||||
printf(" Too many untranslated messages (%d of %d)\n", untranslated,
|
||||
cupsArrayCount(po));
|
||||
}
|
||||
else if (untranslated > 0)
|
||||
printf("PASS (%d of %d untranslated)\n", untranslated,
|
||||
cupsArrayCount(po));
|
||||
else
|
||||
puts("PASS");
|
||||
}
|
||||
|
||||
if (!pass)
|
||||
status = 1;
|
||||
|
||||
_cupsMessageFree(po);
|
||||
}
|
||||
|
||||
return (status);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'abbreviate()' - Abbreviate a message string as needed.
|
||||
*/
|
||||
|
||||
static char * /* O - Abbreviated string */
|
||||
abbreviate(const char *s, /* I - String to abbreviate */
|
||||
char *buf, /* I - Buffer */
|
||||
int bufsize) /* I - Size of buffer */
|
||||
{
|
||||
char *bufptr; /* Pointer into buffer */
|
||||
|
||||
|
||||
for (bufptr = buf, bufsize -= 4; *s && bufsize > 0; s ++)
|
||||
{
|
||||
if (*s == '\n')
|
||||
{
|
||||
if (bufsize < 2)
|
||||
break;
|
||||
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = 'n';
|
||||
bufsize -= 2;
|
||||
}
|
||||
else if (*s == '\t')
|
||||
{
|
||||
if (bufsize < 2)
|
||||
break;
|
||||
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = 't';
|
||||
bufsize -= 2;
|
||||
}
|
||||
else if (*s >= 0 && *s < ' ')
|
||||
{
|
||||
if (bufsize < 4)
|
||||
break;
|
||||
|
||||
sprintf(bufptr, "\\%03o", *s);
|
||||
bufptr += 4;
|
||||
bufsize -= 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
*bufptr++ = *s;
|
||||
bufsize --;
|
||||
}
|
||||
}
|
||||
|
||||
if (*s)
|
||||
strcpy(bufptr, "...");
|
||||
else
|
||||
*bufptr = '\0';
|
||||
|
||||
return (buf);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'collect_formats()' - Collect all of the format strings in the msgid.
|
||||
*/
|
||||
|
||||
static cups_array_t * /* O - Array of format strings */
|
||||
collect_formats(const char *id) /* I - msgid string */
|
||||
{
|
||||
cups_array_t *fmts; /* Array of format strings */
|
||||
char buf[255], /* Format string buffer */
|
||||
*bufptr; /* Pointer into format string */
|
||||
|
||||
|
||||
fmts = cupsArrayNew(NULL, NULL);
|
||||
|
||||
while ((id = strchr(id, '%')) != NULL)
|
||||
{
|
||||
if (id[1] == '%')
|
||||
{
|
||||
/*
|
||||
* Skip %%...
|
||||
*/
|
||||
|
||||
id += 2;
|
||||
continue;
|
||||
}
|
||||
|
||||
for (bufptr = buf; *id && bufptr < (buf + sizeof(buf) - 1); id ++)
|
||||
{
|
||||
*bufptr++ = *id;
|
||||
|
||||
if (strchr("CDEFGIOSUXcdeifgopsux", *id))
|
||||
{
|
||||
id ++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
*bufptr = '\0';
|
||||
cupsArrayAdd(fmts, strdup(buf));
|
||||
}
|
||||
|
||||
return (fmts);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'free_formats()' - Free all of the format strings.
|
||||
*/
|
||||
|
||||
static void
|
||||
free_formats(cups_array_t *fmts) /* I - Array of format strings */
|
||||
{
|
||||
char *s; /* Current string */
|
||||
|
||||
|
||||
for (s = (char *)cupsArrayFirst(fmts); s; s = (char *)cupsArrayNext(fmts))
|
||||
free(s);
|
||||
|
||||
cupsArrayDelete(fmts);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||