Comparar commits

..

1 Commits

Autor SHA1 Mensagem Data
msweet 13fab1a074 Import cups.org releases
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/tags/release-1.2.3@4306 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-05-10 18:56:23 +00:00
231 arquivos alterados com 935 adições e 6335 exclusões
+1 -126
Ver Arquivo
@@ -1,131 +1,6 @@
CHANGES.txt - 2006-11-02
CHANGES.txt - 2006-08-29
------------------------
CHANGES IN CUPS V1.2.6
- The web interface was not localized on Mac OS X (STR
#2075)
- "lpc status" did not show the number of queued jobs for
disabled queues (STR #2069)
- The lpstat program could hang (STR #2073)
- The serial backend did not support the new USB serial
filenames on Linux (STR #2061)
- The parallel backend did not support bidirectional I/O
properly (STR #2056)
- The network backends now log the numeric address that
is being used (STR #2046)
- Fixed a compile error when using libpaper.
- Fixed a compile error when compiling on Solaris with
threading enabled (STR #2049, STR #2050)
- Missing printer-state-changed event for
printer-state-message updates (STR #2047)
CHANGES IN CUPS V1.2.5
- Documentation updates (STR #2038)
- The SNMP backend no longer uses IPP for Epson printers
(STR #2028)
- Updated the configure script for Tru64 UNIX 5.1 (STR
#2033)
- Tru64 5.1B's getaddrinfo() and getnameinfo() functions
leak file descriptors (STR #2034)
- cupsAddDest() didn't add the parent destination's
options and attributes.
- ppdConflicts() did not handle custom option
constraints.
- Raw printing of gzip'd files did not work (STR #2009)
- The scheduler no longer preserves default option
choices when the new PPD no longer provides the old
default choice (STR #1929)
- The Linux SCSI backend is now only built if the SCSI
development headers are installed.
- USB printing to Minolta printers did not work (STR
#2019)
- Windows clients could not monitor the queue status (STR
#2006)
- The scheduler didn't log the operation name in the
access_log file for Create-Job and Print-Job requests.
- The PostScript filter now separates collated copies
with any required JCL commands so that JCL-based
finishing options act on the individual copies and not
all of the copies as a single document.
- The PostScript filter now disables duplex printing when
printing a 1-page document.
- cups-lpd didn't pass the correct
job-originating-host-name value (STR #2023)
- Fixed some speling errors in the German message catalog
(STR #2012)
- cupstestppd did not catch PPD files with bad
UIConstraints values (STR #2016)
- The USB backend did not work with the current udev-
created printers if the first printer was disconnected
(STR #2017)
- Mirrored and rotated printing did not work with some
documents (STR #2004)
- 2-sided printing with banners did not work properly on
some printers (STR #2018)
- Updated the raw type rule to handle PJL within the
first 4k of a print job (STR #1969)
- Added an Estonian translation (STR #1957)
- Clarified the documentation for the cupsd.conf @LOCAL
and @IF(name) allow/deny functionality (STR #1992)
- The PostScript filters did not escape the Title and For
comments in the print job header (STR #1988)
- The scheduler would use 100% CPU if browsing was
disabled and the cupsd.conf file contained BrowsePoll
lines (STR #1994)
- The cupsDirRead() function did not work properly on
non-POSIX-compliant systems (STR #2001)
- The cupsFile functions didn't handle read/write errors
properly (STR #1996)
- The DBUS support now works with older versions of the
DBUS library.
CHANGES IN CUPS V1.2.4
- The --with-printcap configure option did not work (STR
#1984)
- The character set reported by cupsLangGet() did not
always reflect the default character set of a given
locale (STR #1983)
- Older Lexmark and Tektronix printers did not work with
IPP (STR #1980)
- Failsafe printing did not work (PR #6328)
- Some web interface redirects did not work (STR #1978)
- The web interface change settings button could
introduce a "Port 0" line in cupsd.conf if there was no
loopback connection available (STR #1979)
- The web interface change settings and edit
configuration file buttons would truncate the
cupsd.conf file (STR #1976)
- The German web interface used the wrong printer icon
images (STR #1973)
- The "All Documents" link in the on-line help was
missing a trailing slash (STR #1971)
- The Polish web interface translation used the wrong
URLs for the job history (STR #1963)
- The "reprint job" button did not work (STR #1956)
- The scheduler did not always report printer or job
events properly (STR #1955)
- The scheduler always stopped the queue on error,
regardless of the exit code, if the error policy was
set to "stop-printer" (STR #1959)
- ppdEmitJCL() included UTF-8 characters in the JCL job
name, which caused problems on some printers (STR
#1959)
- Fixed a buffering problem that cause high CPU usage
(STR #1968)
- The command-line applications did not convert
command-line strings to UTF-8 as needed (STR #1958)
- cupsDirRead() incorrectly aborted when reading a
symbolic link that pointed to a file/directory that did
not exist (STR #1953)
- The cupsInterpretRasterPPD() function did not handle
custom page sizes properly.
CHANGES IN CUPS V1.2.3
- The scheduler did not send job-state or
+1 -2
Ver Arquivo
@@ -1,4 +1,4 @@
CREDITS.txt - 2006-10-02
CREDITS.txt - 2006-04-17
------------------------
Few projects are completed by one person, and CUPS is no exception. We'd
@@ -20,7 +20,6 @@ like to thank the following individuals for their contributions:
testing.
Kiko - Bug fixes.
Sergey V. Kovalyov - ESP Print Pro and CUPS beta tester.
Marek Laane - Estonian translation.
Mark Lawrence - Microsoft interoperability testing.
Jeff Licquia - Bug fixes, beta testing, evangelism.
Jason McMullan - Original CUPS RPM distributions.
+1 -1
Ver Arquivo
@@ -1,4 +1,4 @@
INSTALL - CUPS v1.2.6 - 2006-11-06
INSTALL - CUPS v1.2.0 - 2006-05-08
----------------------------------
This file describes how to compile and install CUPS from source
+20 -17
Ver Arquivo
@@ -17,12 +17,12 @@ General Public License ("LGPL"), Version 2, with exceptions for
Apple operating systems and the OpenSSL toolkit. A copy of the
exceptions and licenses follow this introduction.
The GNU LGPL applies to the CUPS and CUPS Imaging libraries
located in the "cups" and "filter" subdirectories of the CUPS
source distribution and in the "cups" include directory and
library files in the binary distributions. The GNU GPL applies to
the remainder of the CUPS distribution, including the "pdftops"
filter which is based upon Xpdf.
The GNU LGPL applies to the CUPS API library, located in the
"cups" subdirectory of the CUPS source distribution and in the
"cups" include directory and library files in the binary
distributions. The GNU GPL applies to the remainder of the CUPS
distribution, including the "pdftops" filter which is based upon
Xpdf and the CUPS imaging library.
For those not familiar with the GNU GPL, the license basically
allows you to:
@@ -32,19 +32,22 @@ allows you to:
binary form.
- Sell verbatim copies of the software for a media fee, or
sell support for the software.
- Distribute or sell printer drivers and filters that use
CUPS so long as source code is made available under the
GPL.
What this license *does not* allow you to do is make changes or
add features to CUPS and then sell a binary distribution without
source code. You must provide source for any changes or additions
to the software, and all code must be provided under the GPL or
LGPL as appropriate. The only exceptions to this are the portions
of the CUPS software covered by the Apple operating system
license exceptions outlined later in this license agreement.
source code. You must provide source for any new drivers,
changes, or additions to the software, and all code must be
provided under the GPL or LGPL as appropriate. The only
exceptions to this are the portions of the CUPS software covered
by the Apple operating system license exceptions outlined later
in this license agreement.
The GNU LGPL relaxes the "link-to" restriction, allowing you to
develop applications that use the CUPS and CUPS Imaging libraries
under other licenses and/or conditions as appropriate for your
application, driver, or filter.
develop applications that use the CUPS API library under other
licenses and/or conditions as appropriate for your application.
LICENSE EXCEPTIONS
@@ -116,9 +119,9 @@ BINARY DISTRIBUTION RIGHTS
Easy Software Products also sells rights to the CUPS source code
under a binary distribution license for vendors that are unable
to release source code for their additions and modifications to
CUPS under the GNU GPL and LGPL. For information please contact
us at the address shown above.
to release source code for their drivers, additions, and
modifications to CUPS under the GNU GPL and LGPL. For
information please contact us at the address shown above.
The Common UNIX Printing System provides a "pdftops" filter that
is based on the Xpdf software. For binary distribution licensing
+1 -1
Ver Arquivo
@@ -1,4 +1,4 @@
README - CUPS v1.2.6 - 2006-11-06
README - CUPS v1.2.3 - 2006-08-28
---------------------------------
Looking for compile instructions? Read the file "INSTALL.txt"
+1 -1
Ver Arquivo
@@ -46,7 +46,7 @@ all: $(TARGETS)
#
clean:
$(RM) $(OBJS) $(TARGETS) $(LIBOBJS) http
$(RM) $(OBJS) $(TARGETS) http
#
+7 -32
Ver Arquivo
@@ -107,7 +107,6 @@ main(int argc, /* I - Number of command-line args */
hostname[1024], /* Hostname */
username[255], /* Username info */
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 */
@@ -575,18 +574,6 @@ main(int argc, /* I - Number of command-line args */
fputs("STATE: -connecting-to-device\n", stderr);
fprintf(stderr, "INFO: Connected to %s...\n", hostname);
#ifdef AF_INET6
if (http->hostaddr->addr.sa_family == AF_INET6)
fprintf(stderr, "DEBUG: Connected to [%s]:%d (IPv6)...\n",
httpAddrString(http->hostaddr, addrname, sizeof(addrname)),
ntohs(http->hostaddr->ipv6.sin6_port));
else
#endif /* AF_INET6 */
if (http->hostaddr->addr.sa_family == AF_INET)
fprintf(stderr, "DEBUG: Connected to %s:%d (IPv4)...\n",
httpAddrString(http->hostaddr, addrname, sizeof(addrname)),
ntohs(http->hostaddr->ipv4.sin_port));
/*
* Build a URI for the printer and fill the standard IPP attributes for
* an IPP_PRINT_FILE request. We can't use the URI in argv[0] because it
@@ -868,15 +855,15 @@ main(int argc, /* I - Number of command-line args */
num_options, &options);
}
if (copies_sup && version > 0)
if (copies_sup)
{
/*
* Only send options if the destination printer supports the copies
* attribute and IPP/1.1. This is a hack for the HP and Lexmark
* implementations of IPP, which do not accept extension attributes
* and incorrectly report a client-error-bad-request error instead of
* the successful-ok-unsupported-attributes status. In short, at least
* some HP and Lexmark implementations of IPP are non-compliant.
* attribute. This is a hack for the HP JetDirect implementation of
* IPP, which does not accept extension attributes and incorrectly
* reports a client-error-bad-request error instead of the
* successful-ok-unsupported-attributes status. In short, at least
* some HP implementations of IPP are non-compliant.
*/
cupsEncodeOptions(request, num_options, options);
@@ -890,7 +877,7 @@ main(int argc, /* I - Number of command-line args */
/*
* If copies aren't supported, then we are likely dealing with an HP
* JetDirect. The HP IPP implementation seems to close the connection
* after every request - that is, it does *not* implement HTTP Keep-
* after every request (that is, it does *not* implement HTTP Keep-
* Alive, which is REQUIRED by HTTP/1.1...
*/
@@ -921,18 +908,6 @@ main(int argc, /* I - Number of command-line args */
fputs("INFO: Printer is busy; retrying print job...\n", stderr);
sleep(10);
}
else if ((ipp_status == IPP_BAD_REQUEST ||
ipp_status == IPP_VERSION_NOT_SUPPORTED) && version == 1)
{
/*
* Switch to IPP/1.0...
*/
fputs("INFO: Printer does not support IPP/1.1, trying IPP/1.0...\n",
stderr);
version = 0;
httpReconnect(http);
}
else
fprintf(stderr, "ERROR: Print file was not accepted (%s)!\n",
cupsLastErrorString());
+2 -13
Ver Arquivo
@@ -582,7 +582,6 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
*cptr; /* Pointer into control file string */
char status; /* Status byte from command */
char portname[255]; /* Port name */
char addrname[256]; /* Address name */
http_addrlist_t *addrlist, /* Address list */
*addr; /* Socket address */
int copy; /* Copies written */
@@ -821,18 +820,8 @@ 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);
#ifdef AF_INET6
if (addr->addr.addr.sa_family == AF_INET6)
fprintf(stderr, "DEBUG: Connected to [%s]:%d (IPv6) (local port %d)...\n",
httpAddrString(&addr->addr, addrname, sizeof(addrname)),
ntohs(addr->addr.ipv6.sin6_port), lport);
else
#endif /* AF_INET6 */
if (addr->addr.addr.sa_family == AF_INET)
fprintf(stderr, "DEBUG: Connected to %s:%d (IPv4) (local port %d)...\n",
httpAddrString(&addr->addr, addrname, sizeof(addrname)),
ntohs(addr->addr.ipv4.sin_port), lport);
fprintf(stderr, "DEBUG: Connected on ports %d (local %d)...\n", port,
lport);
/*
* Next, open the print file and figure out its size...
+3 -23
Ver Arquivo
@@ -88,8 +88,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
*options; /* Pointer to options */
int port; /* Port number (not used) */
int print_fd, /* Print file */
device_fd, /* Parallel device */
use_bc; /* Read back-channel data? */
device_fd; /* Parallel device */
int copies; /* Number of copies to print */
size_t tbytes; /* Total number of bytes written */
struct termios opts; /* Parallel port options */
@@ -189,26 +188,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
do
{
#ifdef __linux
/*
* The Linux parallel port driver currently is broken WRT select()
* and bidirection I/O...
*/
device_fd = open(resource, O_WRONLY | O_EXCL);
use_bc = 0;
#else
if ((device_fd = open(resource, O_RDWR | O_EXCL)) < 0)
{
device_fd = open(resource, O_WRONLY | O_EXCL);
use_bc = 0;
}
else
use_bc = 1;
#endif /* __linux */
if (device_fd == -1)
if ((device_fd = open(resource, O_WRONLY | O_EXCL)) == -1)
{
if (getenv("CLASS") != NULL)
{
@@ -284,7 +264,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
lseek(print_fd, 0, SEEK_SET);
}
tbytes = backendRunLoop(print_fd, device_fd, use_bc);
tbytes = backendRunLoop(print_fd, device_fd, 1);
if (print_fd != 0 && tbytes >= 0)
fprintf(stderr, "INFO: Sent print file, " CUPS_LLFMT " bytes...\n",
+2 -2
Ver Arquivo
@@ -80,7 +80,7 @@ void list_devices(void);
int print_device(const char *resource, int fd, int copies);
#if defined(__linux__) && defined(HAVE_SCSI_SG_H)
#ifdef __linux__
# include "scsi-linux.c"
#elif defined(__sgi)
# include "scsi-irix.c"
@@ -90,7 +90,7 @@ int print_device(const char *resource, int fd, int copies);
*/
void list_devices(void) {}
int print_device(const char *resource, int fd, int copies) { return (CUPS_BACKEND_FAILED); }
#endif /* __linux && HAVE_SCSI_SG_H */
#endif /* __linux */
/*
-8
Ver Arquivo
@@ -778,14 +778,6 @@ list_devices(void)
printf("serial serial:%s?baud=230400 \"Unknown\" \"USB Serial Port #%d\"\n",
device, i + 1);
}
sprintf(device, "/dev/ttyUSB%d", i);
if ((fd = open(device, O_WRONLY | O_NOCTTY | O_NDELAY)) >= 0)
{
close(fd);
printf("serial serial:%s?baud=230400 \"Unknown\" \"USB Serial Port #%d\"\n",
device, i + 1);
}
}
for (i = 0; i < 64; i ++)
+4 -7
Ver Arquivo
@@ -1728,15 +1728,12 @@ probe_device(snmp_cache_t *device) /* I - Device */
debug_printf("DEBUG: %.3f Probing %s...\n", run_time(), device->addrname);
if (device->make_and_model &&
(!strncasecmp(device->make_and_model, "Epson", 5) ||
!strncasecmp(device->make_and_model, "Kyocera", 7) ||
!strncasecmp(device->make_and_model, "Lexmark", 7) ||
!strncasecmp(device->make_and_model, "Tektronix", 9) ||
!strncasecmp(device->make_and_model, "Xerox", 5)))
(!strncasecmp(device->make_and_model, "Xerox", 5) ||
!strncasecmp(device->make_and_model, "Kyocera", 7)))
{
/*
* Epson, Kyocera, Lexmark, Tektronix, and Xerox printers often lock up on
* IPP probes, so exclude them from the IPP connection test...
* Xerox and Kyocera printers often lock up on IPP probes, so exclude
* them from the IPP connection test...
*/
http = NULL;
+6 -17
Ver Arquivo
@@ -78,9 +78,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
int delay; /* Delay for retries... */
int device_fd; /* AppSocket */
int error; /* Error code (if any) */
http_addrlist_t *addrlist, /* Address list */
*addr; /* Connected address */
char addrname[256]; /* Address name */
http_addrlist_t *addrlist; /* Address list */
ssize_t tbytes; /* Total number of bytes written */
struct timeval timeout; /* Timeout for select() */
fd_set input; /* Input set for select() */
@@ -247,7 +245,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
for (delay = 5;;)
{
if ((addr = httpAddrConnect(addrlist, &device_fd)) == NULL)
if (!httpAddrConnect(addrlist, &device_fd))
{
error = errno;
device_fd = -1;
@@ -295,19 +293,6 @@ 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);
#ifdef AF_INET6
if (addr->addr.addr.sa_family == AF_INET6)
fprintf(stderr, "DEBUG: Connected to [%s]:%d (IPv6)...\n",
httpAddrString(&addr->addr, addrname, sizeof(addrname)),
ntohs(addr->addr.ipv6.sin6_port));
else
#endif /* AF_INET6 */
if (addr->addr.addr.sa_family == AF_INET)
fprintf(stderr, "DEBUG: Connected to %s:%d (IPv4)...\n",
httpAddrString(&addr->addr, addrname, sizeof(addrname)),
ntohs(addr->addr.ipv4.sin_port));
/*
* Print everything...
@@ -355,7 +340,11 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
FD_ZERO(&input);
FD_SET(device_fd, &input);
#ifdef __hpux
if (select(device_fd + 1, (int *)&input, NULL, NULL, &timeout) > 0)
#else
if (select(device_fd + 1, &input, NULL, NULL, &timeout) > 0)
#endif /* __hpux */
{
/*
* Grab the data coming back and spit it out to stderr...
+48 -63
Ver Arquivo
@@ -79,13 +79,12 @@ print_device(const char *uri, /* I - Device URI */
do
{
/*
* Disable backchannel data when printing to Canon or Minolta USB
* printers - apparently these printers will return the IEEE-1284
* device ID over and over and over when they get a read request...
* Disable backchannel data when printing to Canon USB printers - apparently
* Canon printers will return the IEEE-1284 device ID over and over and over
* when they get a read request...
*/
use_bc = strcasecmp(hostname, "Canon") != 0 ||
strstr(hostname, "Minolta") != NULL;
use_bc = strcasecmp(hostname, "Canon") != 0;
if ((device_fd = open_device(uri, &use_bc)) == -1)
{
@@ -186,52 +185,44 @@ void
list_devices(void)
{
#ifdef __linux
int i; /* Looping var */
int fd; /* File descriptor */
char device[255], /* Device filename */
device_id[1024], /* Device ID string */
device_uri[1024], /* Device URI string */
make_model[1024]; /* Make and model */
int i; /* Looping var */
int fd; /* File descriptor */
char format[255], /* Format for device filename */
device[255], /* Device filename */
device_id[1024], /* Device ID string */
device_uri[1024], /* Device URI string */
make_model[1024]; /* Make and model */
/*
* Try to open each USB device...
* First figure out which USB printer filename to use...
*/
if (!access("/dev/usblp0", 0))
strcpy(format, "/dev/usblp%d");
else if (!access("/dev/usb/usblp0", 0))
strcpy(format, "/dev/usb/usblp%d");
else
strcpy(format, "/dev/usb/lp%d");
/*
* Then open each USB device...
*/
for (i = 0; i < 16; i ++)
{
/*
* Linux has a long history of changing the standard filenames used
* for USB printer devices. We get the honor of trying them all...
*/
sprintf(device, format, i);
sprintf(device, "/dev/usblp%d", i);
if ((fd = open(device, O_RDWR | O_EXCL)) < 0)
if ((fd = open(device, O_RDWR | O_EXCL)) >= 0)
{
if (errno != ENOENT)
continue;
if (!backendGetDeviceID(fd, device_id, sizeof(device_id),
make_model, sizeof(make_model),
"usb", device_uri, sizeof(device_uri)))
printf("direct %s \"%s\" \"%s USB #%d\" \"%s\"\n", device_uri,
make_model, make_model, i + 1, device_id);
sprintf(device, "/dev/usb/lp%d", i);
if ((fd = open(device, O_RDWR | O_EXCL)) < 0)
{
if (errno != ENOENT)
continue;
sprintf(device, "/dev/usb/usblp%d", i);
if ((fd = open(device, O_RDWR | O_EXCL)) < 0)
continue;
}
close(fd);
}
if (!backendGetDeviceID(fd, device_id, sizeof(device_id),
make_model, sizeof(make_model),
"usb", device_uri, sizeof(device_uri)))
printf("direct %s \"%s\" \"%s USB #%d\" \"%s\"\n", device_uri,
make_model, make_model, i + 1, device_id);
close(fd);
}
#elif defined(__sgi)
#elif defined(__sun) && defined(ECPPIOC_GETDEVID)
@@ -318,41 +309,35 @@ open_device(const char *uri, /* I - Device URI */
int i; /* Looping var */
int busy; /* Are any ports busy? */
char device[255], /* Device filename */
char format[255], /* Format for device filename */
device[255], /* Device filename */
device_id[1024], /* Device ID string */
make_model[1024], /* Make and model */
device_uri[1024]; /* Device URI string */
/*
* Find the correct USB device...
* First figure out which USB printer filename to use...
*/
if (!access("/dev/usblp0", 0))
strcpy(format, "/dev/usblp%d");
else if (!access("/dev/usb/usblp0", 0))
strcpy(format, "/dev/usb/usblp%d");
else
strcpy(format, "/dev/usb/lp%d");
/*
* Then find the correct USB device...
*/
do
{
for (busy = 0, i = 0; i < 16; i ++)
{
/*
* Linux has a long history of changing the standard filenames used
* for USB printer devices. We get the honor of trying them all...
*/
sprintf(device, format, i);
sprintf(device, "/dev/usblp%d", i);
if ((fd = open(device, O_RDWR | O_EXCL)) < 0 && errno == ENOENT)
{
sprintf(device, "/dev/usb/lp%d", i);
if ((fd = open(device, O_RDWR | O_EXCL)) < 0 && errno == ENOENT)
{
sprintf(device, "/dev/usb/usblp%d", i);
if ((fd = open(device, O_RDWR | O_EXCL)) < 0 && errno == ENOENT)
continue;
}
}
if (fd >= 0)
if ((fd = open(device, O_RDWR | O_EXCL)) >= 0)
{
backendGetDeviceID(fd, device_id, sizeof(device_id),
make_model, sizeof(make_model),
+4 -6
Ver Arquivo
@@ -2,15 +2,13 @@
lpc.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
lpc.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
lpc.o: ../cups/i18n.h ../cups/transcode.h ../cups/debug.h ../cups/string.h
lpc.o: ../config.h
lpc.o: ../cups/i18n.h ../cups/debug.h ../cups/string.h ../config.h
lpq.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h
lpq.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
lpq.o: ../cups/file.h ../cups/language.h ../cups/i18n.h ../cups/transcode.h
lpq.o: ../cups/debug.h
lpq.o: ../cups/file.h ../cups/language.h ../cups/i18n.h ../cups/debug.h
lpr.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h
lpr.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
lpr.o: ../cups/file.h ../cups/language.h ../cups/i18n.h ../cups/transcode.h
lpr.o: ../cups/file.h ../cups/language.h ../cups/i18n.h
lprm.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
lprm.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
lprm.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
lprm.o: ../cups/i18n.h ../cups/string.h ../config.h
+68 -19
Ver Arquivo
@@ -65,7 +65,7 @@ main(int argc, /* I - Number of command-line arguments */
*params; /* Pointer to parameters */
_cupsSetLocale(argv);
_cupsSetLocale();
/*
* Connect to the scheduler...
@@ -237,8 +237,10 @@ show_status(http_t *http, /* I - HTTP connection to server */
const char *dests) /* I - Destinations */
{
ipp_t *request, /* IPP Request */
*response; /* IPP Response */
ipp_attribute_t *attr; /* Current attribute */
*response, /* IPP Response */
*jobs; /* IPP Get Jobs response */
ipp_attribute_t *attr, /* Current attribute */
*jattr; /* Current job attribute */
cups_lang_t *language; /* Default language */
char *printer, /* Printer name */
*device, /* Device URI */
@@ -249,13 +251,14 @@ show_status(http_t *http, /* I - HTTP connection to server */
const char *dptr, /* Pointer into destination list */
*ptr; /* Pointer into printer name */
int match; /* Non-zero if this job matches */
char printer_uri[HTTP_MAX_URI];
/* Printer URI */
static const char *requested[] = /* Requested attributes */
{
"device-uri",
"printer-is-accepting-jobs",
"printer-name",
"device-uri",
"printer-state",
"queued-job-count"
"printer-is-accepting-jobs"
};
@@ -326,21 +329,21 @@ show_status(http_t *http, /* I - HTTP connection to server */
while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER)
{
if (!strcmp(attr->name, "printer-name") &&
attr->value_tag == IPP_TAG_NAME)
printer = attr->values[0].string.text;
if (!strcmp(attr->name, "device-uri") &&
attr->value_tag == IPP_TAG_URI)
device = attr->values[0].string.text;
else if (!strcmp(attr->name, "printer-is-accepting-jobs") &&
attr->value_tag == IPP_TAG_BOOLEAN)
accepting = attr->values[0].boolean;
else if (!strcmp(attr->name, "printer-name") &&
attr->value_tag == IPP_TAG_NAME)
printer = attr->values[0].string.text;
else if (!strcmp(attr->name, "printer-state") &&
attr->value_tag == IPP_TAG_ENUM)
if (!strcmp(attr->name, "printer-state") &&
attr->value_tag == IPP_TAG_ENUM)
pstate = (ipp_pstate_t)attr->values[0].integer;
else if (!strcmp(attr->name, "queued-job-count") &&
attr->value_tag == IPP_TAG_INTEGER)
jobcount = attr->values[0].integer;
if (!strcmp(attr->name, "printer-is-accepting-jobs") &&
attr->value_tag == IPP_TAG_BOOLEAN)
accepting = attr->values[0].boolean;
attr = attr->next;
}
@@ -392,8 +395,7 @@ show_status(http_t *http, /* I - HTTP connection to server */
*ptr != '\0' && *dptr != '\0' && *ptr == *dptr;
ptr ++, dptr ++);
if (*ptr == '\0' && (*dptr == '\0' || *dptr == ',' ||
isspace(*dptr & 255)))
if (*ptr == '\0' && (*dptr == '\0' || *dptr == ',' || isspace(*dptr & 255)))
{
match = 1;
break;
@@ -419,6 +421,53 @@ show_status(http_t *http, /* I - HTTP connection to server */
if (match)
{
/*
* Build an IPP_GET_JOBS request, which requires the following
* attributes:
*
* attributes-charset
* attributes-natural-language
* printer-uri
* limit
*/
request = ippNew();
request->request.op.operation_id = IPP_GET_JOBS;
request->request.op.request_id = 1;
language = cupsLangDefault();
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
"attributes-charset", NULL,
cupsLangEncoding(language));
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL,
language->language);
httpAssembleURIf(HTTP_URI_CODING_ALL, printer_uri, sizeof(printer_uri),
"ipp", NULL, "localhost", 631, "/printers/%s",
printer);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
"printer-uri", NULL, printer_uri);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"requested-attributes", NULL, "job-id");
if ((jobs = cupsDoRequest(http, request, "/")) != NULL)
{
/*
* Grab the number of jobs for the printer.
*/
for (jattr = jobs->attrs; jattr != NULL; jattr = jattr->next)
if (jattr->name && !strcmp(jattr->name, "job-id"))
jobcount ++;
ippDelete(jobs);
}
/*
* Display it...
*/
+1 -1
Ver Arquivo
@@ -78,7 +78,7 @@ main(int argc, /* I - Number of command-line arguments */
cups_dest_t *dests; /* Destinations */
_cupsSetLocale(argv);
_cupsSetLocale();
/*
* Check for command-line options...
+1 -1
Ver Arquivo
@@ -93,7 +93,7 @@ main(int argc, /* I - Number of command-line arguments */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
_cupsSetLocale(argv);
_cupsSetLocale();
deletefile = 0;
printer = NULL;
+1 -1
Ver Arquivo
@@ -61,7 +61,7 @@ main(int argc, /* I - Number of command-line arguments */
http_encryption_t encryption; /* Encryption? */
_cupsSetLocale(argv);
_cupsSetLocale();
/*
* Setup to cancel individual print jobs...
+11 -13
Ver Arquivo
@@ -3,49 +3,47 @@
help-index.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
help-index.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
help-index.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
help-index.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
help-index.o: ../cups/dir.h
help-index.o: ../cups/i18n.h ../cups/string.h ../config.h ../cups/dir.h
html.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
html.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
html.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
html.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
html.o: ../cups/i18n.h ../cups/string.h ../config.h
ipp-var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
ipp-var.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
ipp-var.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
ipp-var.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
ipp-var.o: ../cups/i18n.h ../cups/string.h ../config.h
search.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
search.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
search.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
search.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
search.o: ../cups/i18n.h ../cups/string.h ../config.h
template.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
template.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
template.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
template.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
template.o: ../cups/i18n.h ../cups/string.h ../config.h
var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
var.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
var.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
var.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
var.o: ../cups/i18n.h ../cups/string.h ../config.h
admin.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
admin.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
admin.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
admin.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
admin.o: ../cups/adminutil.h ../cups/cups.h ../cups/file.h
admin.o: ../cups/i18n.h ../cups/string.h ../config.h ../cups/file.h
classes.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
classes.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
classes.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
classes.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
classes.o: ../cups/i18n.h ../cups/string.h ../config.h
help.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
help.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
help.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
help.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
help.o: ../cups/i18n.h ../cups/string.h ../config.h
jobs.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
jobs.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
jobs.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
jobs.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
jobs.o: ../cups/i18n.h ../cups/string.h ../config.h
printers.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
printers.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
printers.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
printers.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
printers.o: ../cups/i18n.h ../cups/string.h ../config.h
testcgi.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
testcgi.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
testcgi.o: ../cups/array.h help-index.h
+1 -3
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Search routines for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products.
* Copyright 1997-2005 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -225,8 +225,6 @@ cgiCompileSearch(const char *query) /* I - Query string */
*sptr++ = *qptr++;
}
*sptr = '\0';
/*
* For "word1 AND word2", add reciprocal "word2 AND word1"...
*/
+4 -4
Ver Arquivo
@@ -1,5 +1,5 @@
#
# "$Id: mime.types 6003 2006-10-02 16:26:04Z mike $"
# "$Id: mime.types 5402 2006-04-14 19:21:03Z mike $"
#
# MIME types file for the Common UNIX Printing System (CUPS).
#
@@ -154,8 +154,8 @@ application/vnd.cups-raster string(0,"RaSt") string(0,"tSaR")
application/vnd.cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) \
string(0,<1B>@) \
(contains(0,128,<1B>%-12345X) + \
(contains(0,4096,"LANGUAGE=PCL") \
contains(0,4096,"LANGUAGE = PCL")))
(contains(0,1024,"LANGUAGE=PCL") \
contains(0,1024,"LANGUAGE = PCL")))
########################################################################
#
@@ -167,5 +167,5 @@ application/vnd.cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) \
application/octet-stream
#
# End of "$Id: mime.types 6003 2006-10-02 16:26:04Z mike $".
# End of "$Id: mime.types 5402 2006-04-14 19:21:03Z mike $".
#
+7 -9
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-common.m4 6052 2006-10-20 20:35:41Z mike $"
dnl "$Id: cups-common.m4 5843 2006-08-17 18:49:31Z mike $"
dnl
dnl Common configuration stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -29,7 +29,7 @@ dnl Set the name of the config header file...
AC_CONFIG_HEADER(config.h)
dnl Versio number information...
CUPS_VERSION="1.2.6"
CUPS_VERSION="1.2.3"
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'`"
@@ -132,7 +132,6 @@ 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(scsi/sg.h,AC_DEFINE(HAVE_SCSI_SG_H))
dnl Checks for string functions.
AC_CHECK_FUNCS(strdup strcasecmp strncasecmp strlcat strlcpy)
@@ -232,13 +231,12 @@ case $uname in
AC_MSG_CHECKING(for DBUS)
if $PKGCONFIG --exists dbus-1; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_DBUS)
CFLAGS="$CFLAGS `$PKGCONFIG --cflags dbus-1` -DDBUS_API_SUBJECT_TO_CHANGE"
CUPSDLIBS="`$PKGCONFIG --libs dbus-1`"
DBUSDIR="/etc/dbus-1/system.d"
AC_CHECK_LIB(dbus-1,
dbus_message_iter_init_append,
AC_DEFINE(HAVE_DBUS_MESSAGE_ITER_INIT_APPEND))
AC_DEFINE(HAVE_DBUS)
CFLAGS="$CFLAGS `$PKGCONFIG --cflags dbus-1` -DDBUS_API_SUBJECT_TO_CHANGE"
CUPSDLIBS="`$PKGCONFIG --libs dbus-1`"
DBUSDIR="/etc/dbus-1/system.d")
else
AC_MSG_RESULT(no)
fi
@@ -267,5 +265,5 @@ AC_SUBST(DEFAULT_IPP_PORT)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
dnl
dnl End of "$Id: cups-common.m4 6052 2006-10-20 20:35:41Z mike $".
dnl End of "$Id: cups-common.m4 5843 2006-08-17 18:49:31Z mike $".
dnl
+10 -31
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-compiler.m4 6049 2006-10-20 15:07:21Z mike $"
dnl "$Id: cups-compiler.m4 5705 2006-06-30 01:07:29Z mike $"
dnl
dnl Compiler stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -93,7 +93,6 @@ PIEFLAGS=""
AC_SUBST(PIEFLAGS)
if test -n "$GCC"; then
# Add GCC-specific compiler options...
if test -z "$OPTIM"; then
if test "x$with_optim" = x; then
# Default to optimize-for-size and debug
@@ -274,7 +273,6 @@ if test -n "$GCC"; then
;;
esac
else
# Add vendor-specific compiler options...
case $uname in
AIX*)
if test -z "$OPTIM"; then
@@ -360,16 +358,6 @@ else
fi
fi
;;
OSF*)
# Tru64 UNIX aka Digital UNIX aka OSF/1
if test -z "$OPTIM"; then
if test "x$with_optim" = x; then
OPTIM="-O"
else
OPTIM="$with_optim"
fi
fi
;;
SunOS*)
# Solaris
if test -z "$OPTIM"; then
@@ -461,25 +449,16 @@ else
esac
fi
# Add general compiler options per platform...
case $uname in
HP-UX*)
# HP-UX 10.20 (at least) needs this definition to get the
# h_errno global...
OPTIM="$OPTIM -D_XOPEN_SOURCE_EXTENDED"
if test $uname = HP-UX; then
# HP-UX 10.20 (at least) needs this definition to get the
# h_errno global...
OPTIM="$OPTIM -D_XOPEN_SOURCE_EXTENDED"
# HP-UX 11.00 (at least) needs this definition to get the
# u_short type used by the IP headers...
OPTIM="$OPTIM -D_INCLUDE_HPUX_SOURCE"
;;
OSF*)
# Tru64 UNIX aka Digital UNIX aka OSF/1 need to be told
# to be POSIX-compliant...
OPTIM="$OPTIM -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_OSF_SOURCE"
;;
esac
# HP-UX 11.00 (at least) needs this definition to get the
# u_short type used by the IP headers...
OPTIM="$OPTIM -D_INCLUDE_HPUX_SOURCE"
fi
dnl
dnl End of "$Id: cups-compiler.m4 6049 2006-10-20 15:07:21Z mike $".
dnl End of "$Id: cups-compiler.m4 5705 2006-06-30 01:07:29Z mike $".
dnl
+4 -6
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-defaults.m4 6003 2006-10-02 16:26:04Z mike $"
dnl "$Id: cups-defaults.m4 5804 2006-08-04 16:51:58Z mike $"
dnl
dnl Default cupsd configuration settings for the Common UNIX Printing System
dnl (CUPS).
@@ -28,7 +28,7 @@ AC_ARG_WITH(languages, [ --with-languages set installed languages, defau
if test "x$withval" != xno; then
LANGUAGES="$withval"
fi,
LANGUAGES="de es et ja pl sv")
LANGUAGES="de es ja pl sv")
AC_SUBST(LANGUAGES)
dnl Default ConfigFilePerm
@@ -225,7 +225,7 @@ AC_ARG_WITH(printcap, [ --with-printcap set default printcap file],
default_printcap="$withval",
default_printcap="default")
if test x$default_printcap != xno; then
if test x$enable_printcap != xno -a x$default_printcap != xno; then
if test "x$default_printcap" = "xdefault"; then
case $uname in
Darwin*)
@@ -242,8 +242,6 @@ if test x$default_printcap != xno; then
CUPS_DEFAULT_PRINTCAP="/etc/printcap"
;;
esac
else
CUPS_DEFAULT_PRINTCAP="$default_printcap"
fi
else
CUPS_DEFAULT_PRINTCAP=""
@@ -252,5 +250,5 @@ fi
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTCAP, "$CUPS_DEFAULT_PRINTCAP")
dnl
dnl End of "$Id: cups-defaults.m4 6003 2006-10-02 16:26:04Z mike $".
dnl End of "$Id: cups-defaults.m4 5804 2006-08-04 16:51:58Z mike $".
dnl
+4 -9
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-network.m4 6049 2006-10-20 15:07:21Z mike $"
dnl "$Id: cups-network.m4 5634 2006-06-06 17:48:27Z mike $"
dnl
dnl Networking stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -24,17 +24,12 @@ dnl
AC_SEARCH_LIBS(socket, socket)
AC_SEARCH_LIBS(gethostbyaddr, nsl)
AC_SEARCH_LIBS(getaddrinfo, nsl, AC_DEFINE(HAVE_GETADDRINFO))
AC_SEARCH_LIBS(getifaddrs, nsl, AC_DEFINE(HAVE_GETIFADDRS))
AC_SEARCH_LIBS(getnameinfo, nsl, AC_DEFINE(HAVE_GETNAMEINFO))
AC_SEARCH_LIBS(hstrerror, nsl socket resolv, AC_DEFINE(HAVE_HSTRERROR))
AC_SEARCH_LIBS(rresvport_af, nsl, AC_DEFINE(HAVE_RRESVPORT_AF))
# Tru64 5.1b leaks file descriptors with these functions; disable until
# we can come up with a test for this...
if test "$uname" != "OSF1"; then
AC_SEARCH_LIBS(getaddrinfo, nsl, AC_DEFINE(HAVE_GETADDRINFO))
AC_SEARCH_LIBS(getnameinfo, nsl, AC_DEFINE(HAVE_GETNAMEINFO))
fi
AC_CHECK_MEMBER(struct sockaddr.sa_len,,, [#include <sys/socket.h>])
AC_CHECK_HEADER(sys/sockio.h, AC_DEFINE(HAVE_SYS_SOCKIO_H))
@@ -90,5 +85,5 @@ AC_SUBST(CUPS_DEFAULT_DOMAINSOCKET)
AC_SUBST(CUPS_LISTEN_DOMAINSOCKET)
dnl
dnl End of "$Id: cups-network.m4 6049 2006-10-20 15:07:21Z mike $".
dnl End of "$Id: cups-network.m4 5634 2006-06-06 17:48:27Z mike $".
dnl
+2 -8
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-threads.m4 6061 2006-10-23 00:26:52Z mike $"
dnl "$Id: cups-threads.m4 5466 2006-04-26 19:52:27Z mike $"
dnl
dnl Threading stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -44,12 +44,6 @@ if test "x$enable_threads" != xno; then
if test $have_pthread = yes; then
PTHREAD_FLAGS="-D_THREAD_SAFE -D_REENTRANT"
# Solaris requires -D_POSIX_PTHREAD_SEMANTICS to
# be POSIX-compliant... :(
if test $uname = SunOS; then
PTHREAD_FLAGS="$PTHREAD_FLAGS -D_POSIX_PTHREAD_SEMANTICS"
fi
break
fi
done
@@ -59,5 +53,5 @@ fi
AC_SUBST(PTHREAD_FLAGS)
dnl
dnl End of "$Id: cups-threads.m4 6061 2006-10-23 00:26:52Z mike $".
dnl End of "$Id: cups-threads.m4 5466 2006-04-26 19:52:27Z mike $".
dnl
-15
Ver Arquivo
@@ -147,13 +147,6 @@
#undef HAVE_CRYPT_H
/*
* Do we have <scsi/sg.h>?
*/
#undef HAVE_SCSI_SG_H
/*
* Use <string.h>, <strings.h>, and/or <bstring.h>?
*/
@@ -420,13 +413,6 @@
#undef HAVE_CFBUNDLEPRIV_H
/*
* Do we have CFLocaleCreateCanonicalLocaleIdentifierFromString()?
*/
#undef HAVE_CF_LOCALE_ID
/*
* Do we have MacOSX 10.4's mbr_XXX functions()?
*/
@@ -448,7 +434,6 @@
*/
#undef HAVE_DBUS
#undef HAVE_DBUS_MESSAGE_ITER_INIT_APPEND
/*
+3 -3
Ver Arquivo
@@ -82,7 +82,7 @@ transcode.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h
transcode.o: i18n.h transcode.h debug.h
usersys.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
usersys.o: globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
usersys.o: transcode.h debug.h
usersys.o: transcode.h
util.o: globals.h string.h ../config.h http-private.h http.h md5.h
util.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
util.o: transcode.h debug.h
@@ -180,7 +180,7 @@ transcode.32.o: transcode.c ipp-private.h ipp.h cups.h ppd.h array.h file.h lan
transcode.32.o: transcode.c i18n.h transcode.h debug.h
usersys.32.o: usersys.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
usersys.32.o: usersys.c globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
usersys.32.o: usersys.c transcode.h debug.h
usersys.32.o: usersys.c transcode.h
util.32.o: util.c globals.h string.h ../config.h http-private.h http.h md5.h
util.32.o: util.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
util.32.o: util.c transcode.h debug.h
@@ -278,7 +278,7 @@ transcode.64.o: transcode.c ipp-private.h ipp.h cups.h ppd.h array.h file.h lan
transcode.64.o: transcode.c i18n.h transcode.h debug.h
usersys.64.o: usersys.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h
usersys.64.o: usersys.c globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h
usersys.64.o: usersys.c transcode.h debug.h
usersys.64.o: usersys.c transcode.h
util.64.o: util.c globals.h string.h ../config.h http-private.h http.h md5.h
util.64.o: util.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h
util.64.o: util.c transcode.h debug.h
+3 -20
Ver Arquivo
@@ -953,8 +953,6 @@ _cupsAdminSetServerSettings(
{
int i; /* Looping var */
http_status_t status; /* GET/PUT status */
const char *server_port_env; /* SERVER_PORT env var */
int server_port; /* IPP port for server */
cups_file_t *cupsd; /* cupsd.conf file */
char cupsdconf[1024]; /* cupsd.conf filename */
int remote; /* Remote cupsd.conf file? */
@@ -1088,17 +1086,6 @@ _cupsAdminSetServerSettings(
wrote_root_location = 0;
indent = 0;
if ((server_port_env = getenv("SERVER_PORT")) != NULL)
{
if ((server_port = atoi(server_port_env)) <= 0)
server_port = ippPort();
}
else
server_port = ippPort();
if (server_port <= 0)
server_port = IPP_PORT;
while (cupsFileGetConf(cupsd, line, sizeof(line), &value, &linenum))
{
if (!strcasecmp(line, "Port") || !strcasecmp(line, "Listen"))
@@ -1110,24 +1097,20 @@ _cupsAdminSetServerSettings(
if (share_printers || remote_admin)
{
cupsFilePuts(temp, "# Allow remote access\n");
cupsFilePrintf(temp, "Port %d\n", server_port);
cupsFilePrintf(temp, "Port %d\n", ippPort());
}
else
{
cupsFilePuts(temp, "# Only listen for connections from the local "
"machine.\n");
cupsFilePrintf(temp, "Listen localhost:%d\n", server_port);
cupsFilePrintf(temp, "Listen localhost:%d\n", ippPort());
}
#ifdef CUPS_DEFAULT_DOMAINSOCKET
if ((!value || strcmp(CUPS_DEFAULT_DOMAINSOCKET, value)) &&
!access(CUPS_DEFAULT_DOMAINSOCKET, 0))
if (!access(CUPS_DEFAULT_DOMAINSOCKET, 0))
cupsFilePuts(temp, "Listen " CUPS_DEFAULT_DOMAINSOCKET "\n");
#endif /* CUPS_DEFAULT_DOMAINSOCKET */
}
else if (value && value[0] == '/' &&
strcmp(CUPS_DEFAULT_DOMAINSOCKET, value))
cupsFilePrintf(temp, "Listen %s\n", value);
}
else if (!strcasecmp(line, "Browsing") ||
!strcasecmp(line, "BrowseAddress") ||
-2
Ver Arquivo
@@ -81,8 +81,6 @@ cupsDoAuthentication(http_t *http, /* I - HTTP connection to server */
http, method, resource));
DEBUG_printf(("cupsDoAuthentication: digest_tries=%d, userpass=\"%s\"\n",
http->digest_tries, http->userpass));
DEBUG_printf(("cupsDoAuthentication: WWW-Authenticate=\"%s\"\n",
httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE)));
/*
* Clear the current authentication string...
+2 -2
Ver Arquivo
@@ -61,10 +61,10 @@ extern "C" {
* Constants...
*/
# define CUPS_VERSION 1.0206
# define CUPS_VERSION 1.0203
# define CUPS_VERSION_MAJOR 1
# define CUPS_VERSION_MINOR 2
# define CUPS_VERSION_PATCH 6
# define CUPS_VERSION_PATCH 3
# define CUPS_DATE_ANY -1
+13 -55
Ver Arquivo
@@ -64,31 +64,21 @@ static int cups_get_sdests(http_t *http, ipp_op_t op, int num_dests,
/*
* 'cupsAddDest()' - Add a destination to the list of destinations.
*
* This function cannot be used to add a new class or printer queue,
* it only adds a new container of saved options for the named
* destination or instance.
*
* If the named destination already exists, the destination list is
* returned unchanged. Adding a new instance of a destination creates
* a copy of that destination's options.
*
* Use the cupsSaveDests() function to save the updated list of
* destinations to the user's lpoptions file.
* Use the cupsSaveDests() function to save the updated list of destinations
* to the user's lpoptions file.
*/
int /* O - New number of destinations */
cupsAddDest(const char *name, /* I - Destination name */
const char *instance, /* I - Instance name or NULL for none/primary */
cupsAddDest(const char *name, /* I - Name of destination */
const char *instance, /* I - Instance of destination or NULL for none/primary */
int num_dests, /* I - Number of destinations */
cups_dest_t **dests) /* IO - Destinations */
{
int i; /* Looping var */
cups_dest_t *dest; /* Destination pointer */
cups_dest_t *parent; /* Parent destination */
cups_option_t *option; /* Current option */
if (!name || !dests)
if (name == NULL || dests == NULL)
return (0);
if ((dest = cupsGetDest(name, instance, num_dests, *dests)) != NULL)
@@ -108,53 +98,27 @@ cupsAddDest(const char *name, /* I - Destination name */
*dests = dest;
/*
* Find where to insert the destination...
*/
for (i = num_dests; i > 0; i --, dest ++)
if (strcasecmp(name, dest->name) < 0)
break;
else if (!instance && dest->instance)
break;
else if (!strcasecmp(name, dest->name) &&
instance && dest->instance &&
instance != NULL && dest->instance != NULL &&
strcasecmp(instance, dest->instance) < 0)
break;
if (i > 0)
memmove(dest + 1, dest, i * sizeof(cups_dest_t));
/*
* Initialize the destination...
*/
dest->name = strdup(name);
dest->is_default = 0;
dest->num_options = 0;
dest->options = (cups_option_t *)0;
if (!instance)
if (instance == NULL)
dest->instance = NULL;
else
{
/*
* Copy options from the primary instance...
*/
dest->instance = strdup(instance);
if ((parent = cupsGetDest(name, NULL, num_dests + 1, *dests)) != NULL)
{
for (i = parent->num_options, option = parent->options;
i > 0;
i --, option ++)
dest->num_options = cupsAddOption(option->name, option->value,
dest->num_options,
&(dest->options));
}
}
return (num_dests + 1);
}
@@ -196,18 +160,18 @@ cupsFreeDests(int num_dests, /* I - Number of destinations */
*/
cups_dest_t * /* O - Destination pointer or NULL */
cupsGetDest(const char *name, /* I - Destination name or NULL for the default destination */
const char *instance, /* I - Instance name or NULL */
cupsGetDest(const char *name, /* I - Name of destination */
const char *instance, /* I - Instance of destination */
int num_dests, /* I - Number of destinations */
cups_dest_t *dests) /* I - Destinations */
{
int comp; /* Result of comparison */
if (num_dests <= 0 || !dests)
if (num_dests == 0 || dests == NULL)
return (NULL);
if (!name)
if (name == NULL)
{
/*
* NULL name for default printer.
@@ -234,9 +198,9 @@ cupsGetDest(const char *name, /* I - Destination name or NULL for the default
return (NULL);
else if (comp == 0)
{
if ((!instance && !dests->instance) ||
if ((instance == NULL && dests->instance == NULL) ||
(instance != NULL && dests->instance != NULL &&
!strcasecmp(instance, dests->instance)))
strcasecmp(instance, dests->instance) == 0))
return (dests);
}
@@ -256,9 +220,6 @@ cupsGetDest(const char *name, /* I - Destination name or NULL for the default
* printer-info, printer-is-accepting-jobs, printer-is-shared,
* printer-make-and-model, printer-state, printer-state-change-time,
* printer-state-reasons, and printer-type attributes as options.
*
* Use the cupsFreeDests() function to free the destination list and
* the cupsGetDest() function to find a particular destination.
*/
int /* O - Number of destinations */
@@ -291,9 +252,6 @@ cupsGetDests(cups_dest_t **dests) /* O - Destinations */
* printer-make-and-model, printer-state, printer-state-change-time,
* printer-state-reasons, and printer-type attributes as options.
*
* Use the cupsFreeDests() function to free the destination list and
* the cupsGetDest() function to find a particular destination.
*
* @since CUPS 1.1.21@
*/
+24 -53
Ver Arquivo
@@ -347,12 +347,10 @@ cupsDirOpen(const char *directory) /* I - Directory name */
cups_dentry_t * /* O - Directory entry */
cupsDirRead(cups_dir_t *dp) /* I - Directory */
{
struct dirent *entry; /* Pointer to entry */
char filename[1024]; /* Full filename */
# ifdef HAVE_PTHREAD_H
char buffer[sizeof(struct dirent) + 1024];
/* Directory entry buffer */
# endif /* HAVE_PTHREAD_H */
struct dirent *entry; /* Pointer to entry */
char filename[1024]; /* Full filename */
DEBUG_printf(("cupsDirRead(dp=%p)\n", dp));
@@ -368,13 +366,8 @@ cupsDirRead(cups_dir_t *dp) /* I - Directory */
* Try reading an entry that is not "." or ".."...
*/
for (;;)
do
{
# ifdef HAVE_PTHREAD_H
/*
* Read the next entry using the reentrant version of readdir...
*/
if (readdir_r(dp->dir, (struct dirent *)buffer, &entry))
{
DEBUG_printf((" readdir_r() failed - %s\n", strerror(errno)));
@@ -388,50 +381,28 @@ cupsDirRead(cups_dir_t *dp) /* I - Directory */
}
DEBUG_printf((" readdir_r() returned \"%s\"...\n", entry->d_name));
# else
/*
* Read the next entry using the original version of readdir...
*/
if ((entry = readdir(dp->dir)) == NULL)
{
DEBUG_puts(" readdir() returned a NULL pointer!");
return (NULL);
}
DEBUG_printf((" readdir() returned \"%s\"...\n", entry->d_name));
# endif /* HAVE_PTHREAD_H */
/*
* Skip "." and ".."...
*/
if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, ".."))
continue;
/*
* Copy the name over and get the file information...
*/
strlcpy(dp->entry.filename, entry->d_name, sizeof(dp->entry.filename));
snprintf(filename, sizeof(filename), "%s/%s", dp->directory, entry->d_name);
if (stat(filename, &(dp->entry.fileinfo)))
{
DEBUG_printf((" stat() failed for \"%s\" - %s...\n", filename,
strerror(errno)));
continue;
}
/*
* Return the entry...
*/
return (&(dp->entry));
}
while (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, ".."));
/*
* Copy the name over and get the file information...
*/
strlcpy(dp->entry.filename, entry->d_name, sizeof(dp->entry.filename));
snprintf(filename, sizeof(filename), "%s/%s", dp->directory, entry->d_name);
if (stat(filename, &(dp->entry.fileinfo)))
{
DEBUG_printf((" stat() failed for \"%s\" - %s...\n", filename,
strerror(errno)));
return (NULL);
}
/*
* Return the entry...
*/
return (&(dp->entry));
}
+2 -4
Ver Arquivo
@@ -391,8 +391,8 @@ ppdEmitJCL(ppd_file_t *ppd, /* I - PPD file record */
title = ptr + 1;
/*
* Replace double quotes with single quotes and 8-bit characters with
* question marks so that the title does not cause a PJL syntax error.
* Replace double quotes with single quotes so that the title
* does not cause a PJL syntax error.
*/
strlcpy(temp, title, sizeof(temp));
@@ -400,8 +400,6 @@ ppdEmitJCL(ppd_file_t *ppd, /* I - PPD file record */
for (ptr = temp; *ptr; ptr ++)
if (*ptr == '\"')
*ptr = '\'';
else if (*ptr & 128)
*ptr = '?';
/*
* Send PJL JOB and PJL RDYMSG commands before we enter PostScript mode...
+8 -8
Ver Arquivo
@@ -377,7 +377,7 @@ cupsFileFind(const char *filename, /* I - File to find */
int /* O - 0 on success, -1 on error */
cupsFileFlush(cups_file_t *fp) /* I - CUPS file */
{
ssize_t bytes; /* Bytes to write */
size_t bytes; /* Bytes to write */
DEBUG_printf(("cupsFileFlush(fp=%p)\n", fp));
@@ -991,7 +991,7 @@ cupsFilePrintf(cups_file_t *fp, /* I - CUPS file */
...) /* I - Additional args as necessary */
{
va_list ap; /* Argument list */
ssize_t bytes; /* Formatted size */
size_t bytes; /* Formatted size */
char buf[8192]; /* Formatted text */
@@ -1090,7 +1090,7 @@ int /* O - Number of bytes written or -1 */
cupsFilePuts(cups_file_t *fp, /* I - CUPS file */
const char *s) /* I - String to write */
{
ssize_t bytes; /* Bytes to write */
size_t bytes; /* Bytes to write */
/*
@@ -1149,8 +1149,8 @@ cupsFileRead(cups_file_t *fp, /* I - CUPS file */
char *buf, /* O - Buffer */
size_t bytes) /* I - Number of bytes to read */
{
size_t total; /* Total bytes read */
ssize_t count; /* Bytes read */
size_t total, /* Total bytes read */
count; /* Bytes read */
DEBUG_printf(("cupsFileRead(fp=%p, buf=%p, bytes=%ld)\n", fp, buf,
@@ -1274,7 +1274,7 @@ off_t /* O - New file position or -1 */
cupsFileSeek(cups_file_t *fp, /* I - CUPS file */
off_t pos) /* I - Position in file */
{
ssize_t bytes; /* Number bytes in buffer */
size_t bytes; /* Number bytes in buffer */
DEBUG_printf(("cupsFileSeek(fp=%p, pos=" CUPS_LLFMT ")\n", fp, pos));
@@ -2030,8 +2030,8 @@ cups_write(cups_file_t *fp, /* I - CUPS file */
const char *buf, /* I - Buffer */
size_t bytes) /* I - Number bytes */
{
size_t total; /* Total bytes written */
ssize_t count; /* Count this time */
size_t total, /* Total bytes written */
count; /* Count this time */
DEBUG_printf(("cups_write(fp=%p, buf=%p, bytes=%ld)\n", fp, buf,
+4
Ver Arquivo
@@ -98,7 +98,11 @@ typedef struct _cups_globals_s /**** CUPS global state data ****/
/* language.c */
cups_lang_t *lang_default; /* Default language */
# ifdef __APPLE__
# ifdef HAVE_CF_LOCALE_ID
char language[32]; /* Cached language */
# else
const char *language; /* Cached language */
# endif /* HAVE_CF_LOCALE_ID */
# endif /* __APPLE__ */
/* ppd.c */
+2 -13
Ver Arquivo
@@ -595,14 +595,8 @@ httpEncode64_2(char *out, /* I - String to write to */
if (outptr < outend)
*outptr ++ = base64[(in[0] & 255) >> 2];
if (outptr < outend)
{
if (inlen > 1)
*outptr ++ = base64[(((in[0] & 255) << 4) | ((in[1] & 255) >> 4)) & 63];
else
*outptr ++ = base64[((in[0] & 255) << 4) & 63];
}
*outptr ++ = base64[(((in[0] & 255) << 4) | ((in[1] & 255) >> 4)) & 63];
in ++;
inlen --;
@@ -616,12 +610,7 @@ httpEncode64_2(char *out, /* I - String to write to */
}
if (outptr < outend)
{
if (inlen > 1)
*outptr ++ = base64[(((in[0] & 255) << 2) | ((in[1] & 255) >> 6)) & 63];
else
*outptr ++ = base64[((in[0] & 255) << 2) & 63];
}
*outptr ++ = base64[(((in[0] & 255) << 2) | ((in[1] & 255) >> 6)) & 63];
in ++;
inlen --;
+2 -5
Ver Arquivo
@@ -222,10 +222,7 @@ httpClearFields(http_t *http) /* I - HTTP connection */
if (http)
{
memset(http->fields, 0, sizeof(http->fields));
if (http->hostname[0] == '/')
httpSetField(http, HTTP_FIELD_HOST, "localhost");
else
httpSetField(http, HTTP_FIELD_HOST, http->hostname);
httpSetField(http, HTTP_FIELD_HOST, http->hostname);
http->expect = (http_status_t)0;
}
@@ -1896,7 +1893,7 @@ httpWrite2(http_t *http, /* I - HTTP connection */
httpFlushWrite(http);
}
if ((length + http->wused) <= sizeof(http->wbuffer))
if ((length + http->wused) < sizeof(http->wbuffer))
{
/*
* Write to buffer...
+1 -1
Ver Arquivo
@@ -105,7 +105,7 @@ extern const char *_cupsLangString(cups_lang_t *lang, const char *message);
extern void _cupsMessageFree(cups_array_t *a);
extern cups_array_t *_cupsMessageLoad(const char *filename);
extern const char *_cupsMessageLookup(cups_array_t *a, const char *m);
extern void _cupsSetLocale(char *argv[]);
extern void _cupsSetLocale(void);
# ifdef __cplusplus
}
+5 -44
Ver Arquivo
@@ -28,7 +28,7 @@
*
* _cupsLangPrintf() - Print a formatted message string to a file.
* _cupsLangPuts() - Print a static message string to a file.
* _cupsSetLocale() - Set the current locale and transcode the command-line.
* _cupsSetLocale() - Set the current locale.
*/
/*
@@ -140,18 +140,15 @@ _cupsLangPuts(FILE *fp, /* I - File to write to */
/*
* '_cupsSetLocale()' - Set the current locale and transcode the command-line.
* '_cupsSetLocale()' - Set the current locale.
*/
void
_cupsSetLocale(char *argv[]) /* IO - Command-line arguments */
_cupsSetLocale(void)
{
int i; /* Looping var */
char buffer[8192]; /* Command-line argument buffer */
_cups_globals_t *cg; /* Global data */
#ifdef LC_TIME
const char *lc_time; /* Current LC_TIME value */
char new_lc_time[255], /* New LC_TIME value */
const char *lc_time; /* Current LC_TIME value */
char new_lc_time[255], /* New LC_TIME value */
*charset; /* Pointer to character set */
#endif /* LC_TIME */
@@ -184,42 +181,6 @@ _cupsSetLocale(char *argv[]) /* IO - Command-line arguments */
setlocale(LC_TIME, new_lc_time);
#endif /* LC_TIME */
/*
* Initialize the default language info...
*/
cg = _cupsGlobals();
if (!cg->lang_default)
cg->lang_default = cupsLangDefault();
/*
* Transcode the command-line arguments from the locale charset to
* UTF-8...
*/
if (cg->lang_default->encoding != CUPS_US_ASCII &&
cg->lang_default->encoding != CUPS_UTF8)
{
for (i = 1; argv[i]; i ++)
{
/*
* Try converting from the locale charset to UTF-8...
*/
if (cupsCharsetToUTF8((cups_utf8_t *)buffer, argv[i], sizeof(buffer),
cg->lang_default->encoding) < 0)
continue;
/*
* Save the new string if it differs from the original...
*/
if (strcmp(buffer, argv[i]))
argv[i] = strdup(buffer);
}
}
}
+61 -73
Ver Arquivo
@@ -406,6 +406,14 @@ cupsLangGet(const char *language) /* I - Language or locale */
*ptr = '\0';
}
else
{
/*
* Default to UTF-8...
*/
strcpy(charset, "UTF8");
}
/*
* Get the locale for messages from the LC_MESSAGES locale setting...
@@ -465,13 +473,6 @@ cupsLangGet(const char *language) /* I - Language or locale */
}
#endif /* CODESET */
/*
* If we don't have a character set by now, default to UTF-8...
*/
if (!charset[0])
strcpy(charset, "UTF8");
/*
* Parse the language string passed in to a locale string. "C" is the
* standard POSIX locale and is copied unchanged. Otherwise the
@@ -995,7 +996,6 @@ appleLangDefault(void)
/* List of localization data */
CFStringRef languageName; /* Current name */
CFStringRef localeName; /* Canonical from of name */
char *lang; /* LANG environment variable */
_cups_globals_t *cg = _cupsGlobals();
/* Pointer to library globals */
@@ -1006,43 +1006,38 @@ appleLangDefault(void)
if (!cg->language[0])
{
if ((lang = getenv("LANG")))
strlcpy(cg->language, lang, sizeof(cg->language));
else
localizationList =
CFPreferencesCopyAppValue(CFSTR("AppleLanguages"),
kCFPreferencesCurrentApplication);
if (localizationList != NULL)
{
localizationList =
CFPreferencesCopyAppValue(CFSTR("AppleLanguages"),
kCFPreferencesCurrentApplication);
if (localizationList != NULL)
if (CFGetTypeID(localizationList) == CFArrayGetTypeID() &&
CFArrayGetCount(localizationList) > 0)
{
if (CFGetTypeID(localizationList) == CFArrayGetTypeID() &&
CFArrayGetCount(localizationList) > 0)
{
languageName = CFArrayGetValueAtIndex(localizationList, 0);
languageName = CFArrayGetValueAtIndex(localizationList, 0);
if (languageName != NULL &&
CFGetTypeID(languageName) == CFStringGetTypeID())
{
localeName = CFLocaleCreateCanonicalLocaleIdentifierFromString(
kCFAllocatorDefault, languageName);
if (languageName != NULL &&
CFGetTypeID(languageName) == CFStringGetTypeID())
{
localeName = CFLocaleCreateCanonicalLocaleIdentifierFromString(
kCFAllocatorDefault, languageName);
if (localeName != NULL)
{
CFStringGetCString(localeName, cg->language, sizeof(cg->language),
kCFStringEncodingASCII);
CFRelease(localeName);
if (localeName != NULL)
{
CFStringGetCString(localeName, cg->language, sizeof(cg->language),
kCFStringEncodingASCII);
CFRelease(localeName);
if (!strcmp(cg->language, "en"))
strlcpy(cg->language, "en_US.UTF-8", sizeof(cg->language));
else if (strchr(cg->language, '.') == NULL)
strlcat(cg->language, ".UTF-8", sizeof(cg->language));
}
}
}
CFRelease(localizationList);
if (!strcmp(cg->language, "en"))
strlcpy(cg->language, "en_US.UTF-8", sizeof(cg->language));
else if (strchr(cg->language, '.') == NULL)
strlcat(cg->language, ".UTF-8", sizeof(cg->language));
}
}
}
CFRelease(localizationList);
}
/*
@@ -1150,66 +1145,59 @@ appleLangDefault(void)
char buff[256]; /* Temporary buffer */
_cups_globals_t *cg = _cupsGlobals();
/* Pointer to library globals */
char *lang; /* LANG environment variable */
/*
* Only do the lookup and translation the first time.
*/
if (!cg->language[0])
if (cg->language == NULL)
{
if ((lang = getenv("LANG")))
strlcpy(cg->language, lang, sizeof(cg->language));
else
localizationList =
CFPreferencesCopyAppValue(CFSTR("AppleLanguages"),
kCFPreferencesCurrentApplication);
if (localizationList != NULL)
{
localizationList =
CFPreferencesCopyAppValue(CFSTR("AppleLanguages"),
kCFPreferencesCurrentApplication);
if (localizationList != NULL)
if (CFGetTypeID(localizationList) == CFArrayGetTypeID() &&
CFArrayGetCount(localizationList) > 0)
{
if (CFGetTypeID(localizationList) == CFArrayGetTypeID() &&
CFArrayGetCount(localizationList) > 0)
localizationName = CFArrayGetValueAtIndex(localizationList, 0);
if (localizationName != NULL &&
CFGetTypeID(localizationName) == CFStringGetTypeID())
{
localizationName = CFArrayGetValueAtIndex(localizationList, 0);
CFIndex length = CFStringGetLength(localizationName);
if (localizationName != NULL &&
CFGetTypeID(localizationName) == CFStringGetTypeID())
if (length <= sizeof(buff) &&
CFStringGetCString(localizationName, buff, sizeof(buff),
kCFStringEncodingASCII))
{
CFIndex length = CFStringGetLength(localizationName);
buff[sizeof(buff) - 1] = '\0';
if (length <= sizeof(buff) &&
CFStringGetCString(localizationName, buff, sizeof(buff),
kCFStringEncodingASCII))
for (i = 0;
i < sizeof(apple_name_locale) / sizeof(apple_name_locale[0]);
i++)
{
buff[sizeof(buff) - 1] = '\0';
for (i = 0;
i < sizeof(apple_name_locale) / sizeof(apple_name_locale[0]);
i++)
if (!strcasecmp(buff, apple_name_locale[i].name))
{
if (!strcasecmp(buff, apple_name_locale[i].name))
{
strlcpy(cg->language, apple_name_locale[i].locale,
sizeof(cg->language));
break;
}
cg->language = apple_name_locale[i].locale;
break;
}
}
}
}
CFRelease(localizationList);
}
CFRelease(localizationList);
}
/*
* If we didn't find the language, default to en_US...
*/
if (!cg->language[0])
strlcpy(cg->language, apple_name_locale[0].locale, sizeof(cg->language));
if (cg->language == NULL)
cg->language = apple_name_locale[0].locale;
}
/*
+26 -17
Ver Arquivo
@@ -62,14 +62,15 @@ static void ppd_defaults(ppd_file_t *ppd, ppd_group_t *g);
int /* O - Number of conflicts found */
ppdConflicts(ppd_file_t *ppd) /* I - PPD to check */
{
int i, j, /* Looping variables */
int i, j, k, /* Looping variables */
conflicts; /* Number of conflicts */
ppd_const_t *c; /* Current constraint */
ppd_group_t *g, *sg; /* Groups */
ppd_option_t *o1, *o2; /* Options */
ppd_choice_t *c1, *c2; /* Choices */
if (!ppd)
if (ppd == NULL)
return (0);
/*
@@ -78,8 +79,15 @@ ppdConflicts(ppd_file_t *ppd) /* I - PPD to check */
conflicts = 0;
for (o1 = ppdFirstOption(ppd); o1; o1 = ppdNextOption(ppd))
o1->conflicted = 0;
for (i = ppd->num_groups, g = ppd->groups; i > 0; i --, g ++)
{
for (j = g->num_options, o1 = g->options; j > 0; j --, o1 ++)
o1->conflicted = 0;
for (j = g->num_subgroups, sg = g->subgroups; j > 0; j --, sg ++)
for (k = sg->num_options, o1 = sg->options; k > 0; k --, o1 ++)
o1->conflicted = 0;
}
/*
* Loop through all of the UI constraints and flag any options
@@ -94,9 +102,9 @@ ppdConflicts(ppd_file_t *ppd) /* I - PPD to check */
o1 = ppdFindOption(ppd, c->option1);
if (!o1)
if (o1 == NULL)
continue;
else if (c->choice1[0])
else if (c->choice1[0] != '\0')
{
/*
* This constraint maps to a specific choice.
@@ -114,10 +122,10 @@ ppdConflicts(ppd_file_t *ppd) /* I - PPD to check */
if (c1->marked)
break;
if (!j ||
!strcasecmp(c1->choice, "None") ||
!strcasecmp(c1->choice, "Off") ||
!strcasecmp(c1->choice, "False"))
if (j == 0 ||
strcasecmp(c1->choice, "None") == 0 ||
strcasecmp(c1->choice, "Off") == 0 ||
strcasecmp(c1->choice, "False") == 0)
c1 = NULL;
}
@@ -127,9 +135,9 @@ ppdConflicts(ppd_file_t *ppd) /* I - PPD to check */
o2 = ppdFindOption(ppd, c->option2);
if (!o2)
if (o2 == NULL)
continue;
else if (c->choice2[0])
else if (c->choice2[0] != '\0')
{
/*
* This constraint maps to a specific choice.
@@ -147,10 +155,10 @@ ppdConflicts(ppd_file_t *ppd) /* I - PPD to check */
if (c2->marked)
break;
if (!j ||
!strcasecmp(c2->choice, "None") ||
!strcasecmp(c2->choice, "Off") ||
!strcasecmp(c2->choice, "False"))
if (j == 0 ||
strcasecmp(c2->choice, "None") == 0 ||
strcasecmp(c2->choice, "Off") == 0 ||
strcasecmp(c2->choice, "False") == 0)
c2 = NULL;
}
@@ -158,7 +166,8 @@ ppdConflicts(ppd_file_t *ppd) /* I - PPD to check */
* If both options are marked then there is a conflict...
*/
if (c1 && c1->marked && c2 && c2->marked)
if (c1 != NULL && c1->marked &&
c2 != NULL && c2->marked)
{
DEBUG_printf(("%s->%s conflicts with %s->%s (%s %s %s %s)\n",
o1->keyword, c1->choice, o2->keyword, c2->choice,
+2 -112
Ver Arquivo
@@ -1549,18 +1549,6 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
goto error;
case 2 : /* Two options... */
/*
* Check for broken constraints like "* Option"...
*/
if (cg->ppd_conform == PPD_CONFORM_STRICT &&
(!strcmp(constraint->option1, "*") ||
!strcmp(constraint->choice1, "*")))
{
cg->ppd_status = PPD_BAD_UI_CONSTRAINTS;
goto error;
}
/*
* The following strcpy's are safe, as optionN and
* choiceN are all the same size (size defined by PPD spec...)
@@ -1568,38 +1556,17 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
if (constraint->option1[0] == '*')
_cups_strcpy(constraint->option1, constraint->option1 + 1);
else if (cg->ppd_conform == PPD_CONFORM_STRICT)
{
cg->ppd_status = PPD_BAD_UI_CONSTRAINTS;
goto error;
}
if (constraint->choice1[0] == '*')
_cups_strcpy(constraint->option2, constraint->choice1 + 1);
else if (cg->ppd_conform == PPD_CONFORM_STRICT)
{
cg->ppd_status = PPD_BAD_UI_CONSTRAINTS;
goto error;
}
else
_cups_strcpy(constraint->option2, constraint->choice1);
constraint->choice1[0] = '\0';
constraint->choice2[0] = '\0';
break;
case 3 : /* Two options, one choice... */
/*
* Check for broken constraints like "* Option"...
*/
if (cg->ppd_conform == PPD_CONFORM_STRICT &&
(!strcmp(constraint->option1, "*") ||
!strcmp(constraint->choice1, "*") ||
!strcmp(constraint->option2, "*")))
{
cg->ppd_status = PPD_BAD_UI_CONSTRAINTS;
goto error;
}
/*
* The following _cups_strcpy's are safe, as optionN and
* choiceN are all the same size (size defined by PPD spec...)
@@ -1607,21 +1574,9 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
if (constraint->option1[0] == '*')
_cups_strcpy(constraint->option1, constraint->option1 + 1);
else if (cg->ppd_conform == PPD_CONFORM_STRICT)
{
cg->ppd_status = PPD_BAD_UI_CONSTRAINTS;
goto error;
}
if (constraint->choice1[0] == '*')
{
if (cg->ppd_conform == PPD_CONFORM_STRICT &&
constraint->option2[0] == '*')
{
cg->ppd_status = PPD_BAD_UI_CONSTRAINTS;
goto error;
}
_cups_strcpy(constraint->choice2, constraint->option2);
_cups_strcpy(constraint->option2, constraint->choice1 + 1);
constraint->choice1[0] = '\0';
@@ -1630,85 +1585,20 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
{
if (constraint->option2[0] == '*')
_cups_strcpy(constraint->option2, constraint->option2 + 1);
else if (cg->ppd_conform == PPD_CONFORM_STRICT)
{
cg->ppd_status = PPD_BAD_UI_CONSTRAINTS;
goto error;
}
constraint->choice2[0] = '\0';
}
break;
case 4 : /* Two options, two choices... */
/*
* Check for broken constraints like "* Option"...
*/
if (cg->ppd_conform == PPD_CONFORM_STRICT &&
(!strcmp(constraint->option1, "*") ||
!strcmp(constraint->choice1, "*") ||
!strcmp(constraint->option2, "*") ||
!strcmp(constraint->choice2, "*")))
{
cg->ppd_status = PPD_BAD_UI_CONSTRAINTS;
goto error;
}
if (constraint->option1[0] == '*')
_cups_strcpy(constraint->option1, constraint->option1 + 1);
else if (cg->ppd_conform == PPD_CONFORM_STRICT)
{
cg->ppd_status = PPD_BAD_UI_CONSTRAINTS;
goto error;
}
if (cg->ppd_conform == PPD_CONFORM_STRICT &&
constraint->choice1[0] == '*')
{
cg->ppd_status = PPD_BAD_UI_CONSTRAINTS;
goto error;
}
if (constraint->option2[0] == '*')
_cups_strcpy(constraint->option2, constraint->option2 + 1);
else if (cg->ppd_conform == PPD_CONFORM_STRICT)
{
cg->ppd_status = PPD_BAD_UI_CONSTRAINTS;
goto error;
}
if (cg->ppd_conform == PPD_CONFORM_STRICT &&
constraint->choice2[0] == '*')
{
cg->ppd_status = PPD_BAD_UI_CONSTRAINTS;
goto error;
}
break;
}
/*
* Handle CustomFoo option constraints...
*/
if (!strncasecmp(constraint->option1, "Custom", 6) &&
!strcasecmp(constraint->choice1, "True"))
{
_cups_strcpy(constraint->option1, constraint->option1 + 6);
strcpy(constraint->choice1, "Custom");
}
if (!strncasecmp(constraint->option2, "Custom", 6) &&
!strcasecmp(constraint->choice2, "True"))
{
_cups_strcpy(constraint->option2, constraint->option2 + 6);
strcpy(constraint->choice2, "Custom");
}
/*
* Don't add this one as an attribute...
*/
ppd_free(string);
string = NULL;
}
+12 -14
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Temp file utilities for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2006 by Easy Software Products.
* Copyright 1997-2005 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -25,9 +25,9 @@
*
* Contents:
*
* cupsTempFd() - Creates a temporary file.
* cupsTempFile() - Generates a temporary filename.
* cupsTempFile2() - Creates a temporary CUPS file.
* cupsTempFd() - Create a temporary file.
* cupsTempFile() - Generate a temporary filename.
* cupsTempFile2() - Create a temporary CUPS file.
*/
/*
@@ -48,13 +48,12 @@
/*
* 'cupsTempFd()' - Creates a temporary file.
* 'cupsTempFd()' - Create a temporary file.
*
* The temporary filename is returned in the filename buffer.
* The temporary file is opened for reading and writing.
* The temporary filename is stored in the filename buffer.
*/
int /* O - New file descriptor or -1 on error */
int /* O - New file descriptor */
cupsTempFd(char *filename, /* I - Pointer to buffer */
int len) /* I - Size of buffer */
{
@@ -159,16 +158,16 @@ cupsTempFd(char *filename, /* I - Pointer to buffer */
/*
* 'cupsTempFile()' - Generates a temporary filename.
* 'cupsTempFile()' - Generate a temporary filename.
*
* The temporary filename is returned in the filename buffer.
* The temporary filename is stored in the filename buffer.
* This function is deprecated - use cupsTempFd() or cupsTempFile2()
* instead.
*
* @deprecated@
*/
char * /* O - Filename or NULL on error */
char * /* O - Filename */
cupsTempFile(char *filename, /* I - Pointer to buffer */
int len) /* I - Size of buffer */
{
@@ -208,10 +207,9 @@ cupsTempFile(char *filename, /* I - Pointer to buffer */
/*
* 'cupsTempFile2()' - Creates a temporary CUPS file.
* 'cupsTempFile2()' - Create a temporary CUPS file.
*
* The temporary filename is returned in the filename buffer.
* The temporary file is opened for writing.
* The temporary filename is stored in the filename buffer.
*
* @since CUPS 1.2@
*/
-2
Ver Arquivo
@@ -84,8 +84,6 @@ static uri_test_t uri_tests[] = /* URI test data */
"http", "username:password", "server", "/", 8080, 8080 },
{ HTTP_URI_OK, "http://username:passwor%64@server:8080/directory/filename",
"http", "username:password", "server", "/directory/filename", 8080, 8080 },
{ HTTP_URI_OK, "http://[2000::10:100]:631/ipp",
"http", "", "2000::10:100", "/ipp", 631, 631 },
{ HTTP_URI_OK, "https://username:passwor%64@server/directory/filename",
"https", "username:password", "server", "/directory/filename", 443, 0 },
{ HTTP_URI_OK, "ipp://username:passwor%64@[::1]/ipp",
+1 -2
Ver Arquivo
@@ -445,7 +445,6 @@ cupsUTF8ToUTF32(
*/
*dest++ = ch;
continue;
}
else if ((ch & 0xe0) == 0xc0)
{
@@ -541,7 +540,7 @@ cupsUTF8ToUTF32(
* Check for UTF-16 surrogate (illegal UTF-8)...
*/
if (ch32 >= 0xd800 && ch32 <= 0xdfff)
if (*dest >= 0xd800 && *dest <= 0xdfff)
return (-1);
}
+1 -3
Ver Arquivo
@@ -14,12 +14,10 @@ X-DCOP-ServiceType=
X-KDE-SubstituteUID=false
X-KDE-Username=
Name=Manage Printing
Comment=CUPS Web Interface
Name[en_US]=Manage Printing
Comment=CUPS Web Interface
Comment[en_US]=CUPS Web Interface
Name[es]=Administrar impresión
Comment[es]=Interfaz Web de CUPS
Name[et]=Trükkimise haldur
Comment[et]=CUPS-i veebiliides
Name[pl]=Zarządzanie drukowaniem
Comment[pl]=Interfejs WWW CUPS
Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 595 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 443 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 472 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 563 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 636 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 513 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 612 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 644 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 419 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 355 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 506 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 522 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 721 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 874 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 313 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 451 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 523 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 450 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 571 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 541 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 537 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 552 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 475 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 606 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 768 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 630 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 560 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 649 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 534 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 551 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 709 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 329 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 753 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 742 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 696 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 683 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 567 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 683 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 556 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 529 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 607 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 624 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 537 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 567 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 491 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 500 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 638 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 903 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 687 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 550 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 576 B

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 758 B

Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais