Comparar commits
1 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 060f751517 |
@@ -1,6 +1,88 @@
|
||||
CHANGES.txt - 2006-09-21
|
||||
CHANGES.txt - 2006-11-02
|
||||
------------------------
|
||||
|
||||
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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
CREDITS.txt - 2006-04-17
|
||||
CREDITS.txt - 2006-10-02
|
||||
------------------------
|
||||
|
||||
Few projects are completed by one person, and CUPS is no exception. We'd
|
||||
@@ -20,6 +20,7 @@ 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,4 +1,4 @@
|
||||
INSTALL - CUPS v1.2.0 - 2006-05-08
|
||||
INSTALL - CUPS v1.2.6 - 2006-11-06
|
||||
----------------------------------
|
||||
|
||||
This file describes how to compile and install CUPS from source
|
||||
|
||||
@@ -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 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.
|
||||
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.
|
||||
|
||||
For those not familiar with the GNU GPL, the license basically
|
||||
allows you to:
|
||||
@@ -32,22 +32,19 @@ 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 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.
|
||||
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.
|
||||
|
||||
The GNU LGPL relaxes the "link-to" restriction, allowing you to
|
||||
develop applications that use the CUPS API library under other
|
||||
licenses and/or conditions as appropriate for your application.
|
||||
develop applications that use the CUPS and CUPS Imaging libraries
|
||||
under other licenses and/or conditions as appropriate for your
|
||||
application, driver, or filter.
|
||||
|
||||
|
||||
LICENSE EXCEPTIONS
|
||||
@@ -119,9 +116,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 drivers, 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 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,4 +1,4 @@
|
||||
README - CUPS v1.2.3 - 2006-08-28
|
||||
README - CUPS v1.2.6 - 2006-11-06
|
||||
---------------------------------
|
||||
|
||||
Looking for compile instructions? Read the file "INSTALL.txt"
|
||||
|
||||
@@ -46,7 +46,7 @@ all: $(TARGETS)
|
||||
#
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) $(TARGETS) http
|
||||
$(RM) $(OBJS) $(TARGETS) $(LIBOBJS) http
|
||||
|
||||
|
||||
#
|
||||
|
||||
@@ -107,6 +107,7 @@ 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 */
|
||||
@@ -574,6 +575,18 @@ 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
|
||||
|
||||
@@ -582,6 +582,7 @@ 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 */
|
||||
@@ -820,8 +821,18 @@ 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);
|
||||
fprintf(stderr, "DEBUG: Connected on ports %d (local %d)...\n", port,
|
||||
lport);
|
||||
|
||||
#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);
|
||||
|
||||
/*
|
||||
* Next, open the print file and figure out its size...
|
||||
|
||||
@@ -88,7 +88,8 @@ 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 */
|
||||
device_fd, /* Parallel device */
|
||||
use_bc; /* Read back-channel data? */
|
||||
int copies; /* Number of copies to print */
|
||||
size_t tbytes; /* Total number of bytes written */
|
||||
struct termios opts; /* Parallel port options */
|
||||
@@ -188,7 +189,26 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
do
|
||||
{
|
||||
if ((device_fd = open(resource, O_WRONLY | O_EXCL)) == -1)
|
||||
#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 (getenv("CLASS") != NULL)
|
||||
{
|
||||
@@ -264,7 +284,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, 1);
|
||||
tbytes = backendRunLoop(print_fd, device_fd, use_bc);
|
||||
|
||||
if (print_fd != 0 && tbytes >= 0)
|
||||
fprintf(stderr, "INFO: Sent print file, " CUPS_LLFMT " bytes...\n",
|
||||
|
||||
@@ -80,7 +80,7 @@ void list_devices(void);
|
||||
int print_device(const char *resource, int fd, int copies);
|
||||
|
||||
|
||||
#ifdef __linux__
|
||||
#if defined(__linux__) && defined(HAVE_SCSI_SG_H)
|
||||
# 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 */
|
||||
#endif /* __linux && HAVE_SCSI_SG_H */
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -778,6 +778,14 @@ 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 ++)
|
||||
|
||||
@@ -1728,13 +1728,14 @@ 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, "Kyocera", 7) ||
|
||||
(!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)))
|
||||
{
|
||||
/*
|
||||
* Kyocera, Lexmark, Tektronix, and Xerox printers often lock up on
|
||||
* Epson, Kyocera, Lexmark, Tektronix, and Xerox printers often lock up on
|
||||
* IPP probes, so exclude them from the IPP connection test...
|
||||
*/
|
||||
|
||||
|
||||
@@ -78,7 +78,9 @@ 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 */
|
||||
http_addrlist_t *addrlist, /* Address list */
|
||||
*addr; /* Connected address */
|
||||
char addrname[256]; /* Address name */
|
||||
ssize_t tbytes; /* Total number of bytes written */
|
||||
struct timeval timeout; /* Timeout for select() */
|
||||
fd_set input; /* Input set for select() */
|
||||
@@ -245,7 +247,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
for (delay = 5;;)
|
||||
{
|
||||
if (!httpAddrConnect(addrlist, &device_fd))
|
||||
if ((addr = httpAddrConnect(addrlist, &device_fd)) == NULL)
|
||||
{
|
||||
error = errno;
|
||||
device_fd = -1;
|
||||
@@ -293,6 +295,19 @@ 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...
|
||||
|
||||
@@ -79,12 +79,13 @@ print_device(const char *uri, /* I - Device URI */
|
||||
do
|
||||
{
|
||||
/*
|
||||
* 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...
|
||||
* 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...
|
||||
*/
|
||||
|
||||
use_bc = strcasecmp(hostname, "Canon") != 0;
|
||||
use_bc = strcasecmp(hostname, "Canon") != 0 ||
|
||||
strstr(hostname, "Minolta") != NULL;
|
||||
|
||||
if ((device_fd = open_device(uri, &use_bc)) == -1)
|
||||
{
|
||||
@@ -185,44 +186,52 @@ void
|
||||
list_devices(void)
|
||||
{
|
||||
#ifdef __linux
|
||||
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 */
|
||||
|
||||
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 */
|
||||
|
||||
/*
|
||||
* 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...
|
||||
* Try to open each USB device...
|
||||
*/
|
||||
|
||||
for (i = 0; i < 16; i ++)
|
||||
{
|
||||
sprintf(device, format, i);
|
||||
/*
|
||||
* Linux has a long history of changing the standard filenames used
|
||||
* for USB printer devices. We get the honor of trying them all...
|
||||
*/
|
||||
|
||||
if ((fd = open(device, O_RDWR | O_EXCL)) >= 0)
|
||||
sprintf(device, "/dev/usblp%d", i);
|
||||
|
||||
if ((fd = open(device, O_RDWR | O_EXCL)) < 0)
|
||||
{
|
||||
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);
|
||||
if (errno != ENOENT)
|
||||
continue;
|
||||
|
||||
close(fd);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
@@ -309,35 +318,41 @@ open_device(const char *uri, /* I - Device URI */
|
||||
|
||||
int i; /* Looping var */
|
||||
int busy; /* Are any ports busy? */
|
||||
char format[255], /* Format for device filename */
|
||||
device[255], /* Device filename */
|
||||
char device[255], /* Device filename */
|
||||
device_id[1024], /* Device ID string */
|
||||
make_model[1024], /* Make and model */
|
||||
device_uri[1024]; /* Device URI string */
|
||||
|
||||
|
||||
/*
|
||||
* 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...
|
||||
* Find the correct USB device...
|
||||
*/
|
||||
|
||||
do
|
||||
{
|
||||
for (busy = 0, i = 0; i < 16; i ++)
|
||||
{
|
||||
sprintf(device, format, i);
|
||||
/*
|
||||
* Linux has a long history of changing the standard filenames used
|
||||
* for USB printer devices. We get the honor of trying them all...
|
||||
*/
|
||||
|
||||
if ((fd = open(device, O_RDWR | O_EXCL)) >= 0)
|
||||
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)
|
||||
{
|
||||
backendGetDeviceID(fd, device_id, sizeof(device_id),
|
||||
make_model, sizeof(make_model),
|
||||
|
||||
@@ -237,10 +237,8 @@ show_status(http_t *http, /* I - HTTP connection to server */
|
||||
const char *dests) /* I - Destinations */
|
||||
{
|
||||
ipp_t *request, /* IPP Request */
|
||||
*response, /* IPP Response */
|
||||
*jobs; /* IPP Get Jobs response */
|
||||
ipp_attribute_t *attr, /* Current attribute */
|
||||
*jattr; /* Current job attribute */
|
||||
*response; /* IPP Response */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
cups_lang_t *language; /* Default language */
|
||||
char *printer, /* Printer name */
|
||||
*device, /* Device URI */
|
||||
@@ -251,14 +249,13 @@ 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 */
|
||||
{
|
||||
"printer-name",
|
||||
"device-uri",
|
||||
"printer-is-accepting-jobs",
|
||||
"printer-name",
|
||||
"printer-state",
|
||||
"printer-is-accepting-jobs"
|
||||
"queued-job-count"
|
||||
};
|
||||
|
||||
|
||||
@@ -329,21 +326,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;
|
||||
|
||||
if (!strcmp(attr->name, "printer-state") &&
|
||||
attr->value_tag == IPP_TAG_ENUM)
|
||||
pstate = (ipp_pstate_t)attr->values[0].integer;
|
||||
|
||||
if (!strcmp(attr->name, "printer-is-accepting-jobs") &&
|
||||
attr->value_tag == IPP_TAG_BOOLEAN)
|
||||
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)
|
||||
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;
|
||||
|
||||
attr = attr->next;
|
||||
}
|
||||
@@ -395,7 +392,8 @@ 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;
|
||||
@@ -421,53 +419,6 @@ 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,5 +1,5 @@
|
||||
#
|
||||
# "$Id: mime.types 5402 2006-04-14 19:21:03Z mike $"
|
||||
# "$Id: mime.types 6003 2006-10-02 16:26:04Z 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,1024,"LANGUAGE=PCL") \
|
||||
contains(0,1024,"LANGUAGE = PCL")))
|
||||
(contains(0,4096,"LANGUAGE=PCL") \
|
||||
contains(0,4096,"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 5402 2006-04-14 19:21:03Z mike $".
|
||||
# End of "$Id: mime.types 6003 2006-10-02 16:26:04Z mike $".
|
||||
#
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-common.m4 5930 2006-09-07 19:49:34Z mike $"
|
||||
dnl "$Id: cups-common.m4 6052 2006-10-20 20:35:41Z 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.4"
|
||||
CUPS_VERSION="1.2.6"
|
||||
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,6 +132,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(scsi/sg.h,AC_DEFINE(HAVE_SCSI_SG_H))
|
||||
|
||||
dnl Checks for string functions.
|
||||
AC_CHECK_FUNCS(strdup strcasecmp strncasecmp strlcat strlcpy)
|
||||
@@ -231,12 +232,13 @@ 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)
|
||||
CFLAGS="$CFLAGS `$PKGCONFIG --cflags dbus-1` -DDBUS_API_SUBJECT_TO_CHANGE"
|
||||
CUPSDLIBS="`$PKGCONFIG --libs dbus-1`"
|
||||
DBUSDIR="/etc/dbus-1/system.d")
|
||||
AC_DEFINE(HAVE_DBUS_MESSAGE_ITER_INIT_APPEND))
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
@@ -265,5 +267,5 @@ AC_SUBST(DEFAULT_IPP_PORT)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-common.m4 5930 2006-09-07 19:49:34Z mike $".
|
||||
dnl End of "$Id: cups-common.m4 6052 2006-10-20 20:35:41Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-compiler.m4 5705 2006-06-30 01:07:29Z mike $"
|
||||
dnl "$Id: cups-compiler.m4 6049 2006-10-20 15:07:21Z mike $"
|
||||
dnl
|
||||
dnl Compiler stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
@@ -93,6 +93,7 @@ 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
|
||||
@@ -273,6 +274,7 @@ if test -n "$GCC"; then
|
||||
;;
|
||||
esac
|
||||
else
|
||||
# Add vendor-specific compiler options...
|
||||
case $uname in
|
||||
AIX*)
|
||||
if test -z "$OPTIM"; then
|
||||
@@ -358,6 +360,16 @@ 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
|
||||
@@ -449,16 +461,25 @@ else
|
||||
esac
|
||||
fi
|
||||
|
||||
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"
|
||||
# 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"
|
||||
|
||||
# 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
|
||||
# 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
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-compiler.m4 5705 2006-06-30 01:07:29Z mike $".
|
||||
dnl End of "$Id: cups-compiler.m4 6049 2006-10-20 15:07:21Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-defaults.m4 5980 2006-09-21 19:01:55Z mike $"
|
||||
dnl "$Id: cups-defaults.m4 6003 2006-10-02 16:26:04Z 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 ja pl sv")
|
||||
LANGUAGES="de es et ja pl sv")
|
||||
AC_SUBST(LANGUAGES)
|
||||
|
||||
dnl Default ConfigFilePerm
|
||||
@@ -252,5 +252,5 @@ fi
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTCAP, "$CUPS_DEFAULT_PRINTCAP")
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-defaults.m4 5980 2006-09-21 19:01:55Z mike $".
|
||||
dnl End of "$Id: cups-defaults.m4 6003 2006-10-02 16:26:04Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-network.m4 5634 2006-06-06 17:48:27Z mike $"
|
||||
dnl "$Id: cups-network.m4 6049 2006-10-20 15:07:21Z mike $"
|
||||
dnl
|
||||
dnl Networking stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
@@ -24,12 +24,17 @@ 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))
|
||||
|
||||
@@ -85,5 +90,5 @@ AC_SUBST(CUPS_DEFAULT_DOMAINSOCKET)
|
||||
AC_SUBST(CUPS_LISTEN_DOMAINSOCKET)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-network.m4 5634 2006-06-06 17:48:27Z mike $".
|
||||
dnl End of "$Id: cups-network.m4 6049 2006-10-20 15:07:21Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-threads.m4 5466 2006-04-26 19:52:27Z mike $"
|
||||
dnl "$Id: cups-threads.m4 6061 2006-10-23 00:26:52Z mike $"
|
||||
dnl
|
||||
dnl Threading stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
@@ -44,6 +44,12 @@ 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
|
||||
@@ -53,5 +59,5 @@ fi
|
||||
AC_SUBST(PTHREAD_FLAGS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-threads.m4 5466 2006-04-26 19:52:27Z mike $".
|
||||
dnl End of "$Id: cups-threads.m4 6061 2006-10-23 00:26:52Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -147,6 +147,13 @@
|
||||
#undef HAVE_CRYPT_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have <scsi/sg.h>?
|
||||
*/
|
||||
|
||||
#undef HAVE_SCSI_SG_H
|
||||
|
||||
|
||||
/*
|
||||
* Use <string.h>, <strings.h>, and/or <bstring.h>?
|
||||
*/
|
||||
@@ -413,6 +420,13 @@
|
||||
#undef HAVE_CFBUNDLEPRIV_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have CFLocaleCreateCanonicalLocaleIdentifierFromString()?
|
||||
*/
|
||||
|
||||
#undef HAVE_CF_LOCALE_ID
|
||||
|
||||
|
||||
/*
|
||||
* Do we have MacOSX 10.4's mbr_XXX functions()?
|
||||
*/
|
||||
@@ -434,6 +448,7 @@
|
||||
*/
|
||||
|
||||
#undef HAVE_DBUS
|
||||
#undef HAVE_DBUS_MESSAGE_ITER_INIT_APPEND
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -61,10 +61,10 @@ extern "C" {
|
||||
* Constants...
|
||||
*/
|
||||
|
||||
# define CUPS_VERSION 1.0204
|
||||
# define CUPS_VERSION 1.0206
|
||||
# define CUPS_VERSION_MAJOR 1
|
||||
# define CUPS_VERSION_MINOR 2
|
||||
# define CUPS_VERSION_PATCH 4
|
||||
# define CUPS_VERSION_PATCH 6
|
||||
# define CUPS_DATE_ANY -1
|
||||
|
||||
|
||||
|
||||
@@ -64,21 +64,31 @@ static int cups_get_sdests(http_t *http, ipp_op_t op, int num_dests,
|
||||
/*
|
||||
* 'cupsAddDest()' - Add a destination to the list of destinations.
|
||||
*
|
||||
* Use the cupsSaveDests() function to save the updated list of destinations
|
||||
* to the user's lpoptions file.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
int /* O - New number of destinations */
|
||||
cupsAddDest(const char *name, /* I - Name of destination */
|
||||
const char *instance, /* I - Instance of destination or NULL for none/primary */
|
||||
cupsAddDest(const char *name, /* I - Destination name */
|
||||
const char *instance, /* I - Instance name 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 == NULL || dests == NULL)
|
||||
if (!name || !dests)
|
||||
return (0);
|
||||
|
||||
if ((dest = cupsGetDest(name, instance, num_dests, *dests)) != NULL)
|
||||
@@ -98,27 +108,53 @@ cupsAddDest(const char *name, /* I - Name of destination */
|
||||
|
||||
*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 != NULL && dest->instance != NULL &&
|
||||
instance && dest->instance &&
|
||||
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 == NULL)
|
||||
if (!instance)
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -160,18 +196,18 @@ cupsFreeDests(int num_dests, /* I - Number of destinations */
|
||||
*/
|
||||
|
||||
cups_dest_t * /* O - Destination pointer or NULL */
|
||||
cupsGetDest(const char *name, /* I - Name of destination */
|
||||
const char *instance, /* I - Instance of destination */
|
||||
cupsGetDest(const char *name, /* I - Destination name or NULL for the default destination */
|
||||
const char *instance, /* I - Instance name or NULL */
|
||||
int num_dests, /* I - Number of destinations */
|
||||
cups_dest_t *dests) /* I - Destinations */
|
||||
{
|
||||
int comp; /* Result of comparison */
|
||||
|
||||
|
||||
if (num_dests == 0 || dests == NULL)
|
||||
if (num_dests <= 0 || !dests)
|
||||
return (NULL);
|
||||
|
||||
if (name == NULL)
|
||||
if (!name)
|
||||
{
|
||||
/*
|
||||
* NULL name for default printer.
|
||||
@@ -198,9 +234,9 @@ cupsGetDest(const char *name, /* I - Name of destination */
|
||||
return (NULL);
|
||||
else if (comp == 0)
|
||||
{
|
||||
if ((instance == NULL && dests->instance == NULL) ||
|
||||
if ((!instance && !dests->instance) ||
|
||||
(instance != NULL && dests->instance != NULL &&
|
||||
strcasecmp(instance, dests->instance) == 0))
|
||||
!strcasecmp(instance, dests->instance)))
|
||||
return (dests);
|
||||
}
|
||||
|
||||
@@ -220,6 +256,9 @@ cupsGetDest(const char *name, /* I - Name of destination */
|
||||
* 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 */
|
||||
@@ -252,6 +291,9 @@ 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@
|
||||
*/
|
||||
|
||||
|
||||
@@ -347,10 +347,12 @@ cupsDirOpen(const char *directory) /* I - Directory name */
|
||||
cups_dentry_t * /* O - Directory entry */
|
||||
cupsDirRead(cups_dir_t *dp) /* I - Directory */
|
||||
{
|
||||
char buffer[sizeof(struct dirent) + 1024];
|
||||
/* Directory entry buffer */
|
||||
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 */
|
||||
|
||||
|
||||
DEBUG_printf(("cupsDirRead(dp=%p)\n", dp));
|
||||
@@ -368,6 +370,11 @@ cupsDirRead(cups_dir_t *dp) /* I - Directory */
|
||||
|
||||
for (;;)
|
||||
{
|
||||
# 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)));
|
||||
@@ -382,6 +389,25 @@ 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;
|
||||
|
||||
|
||||
@@ -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 */
|
||||
{
|
||||
size_t bytes; /* Bytes to write */
|
||||
ssize_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 */
|
||||
size_t bytes; /* Formatted size */
|
||||
ssize_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 */
|
||||
{
|
||||
size_t bytes; /* Bytes to write */
|
||||
ssize_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 */
|
||||
count; /* Bytes read */
|
||||
size_t total; /* Total bytes read */
|
||||
ssize_t 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 */
|
||||
{
|
||||
size_t bytes; /* Number bytes in buffer */
|
||||
ssize_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 */
|
||||
count; /* Count this time */
|
||||
size_t total; /* Total bytes written */
|
||||
ssize_t count; /* Count this time */
|
||||
|
||||
|
||||
DEBUG_printf(("cups_write(fp=%p, buf=%p, bytes=%ld)\n", fp, buf,
|
||||
|
||||
@@ -98,11 +98,7 @@ 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 */
|
||||
|
||||
@@ -595,8 +595,14 @@ httpEncode64_2(char *out, /* I - String to write to */
|
||||
|
||||
if (outptr < outend)
|
||||
*outptr ++ = base64[(in[0] & 255) >> 2];
|
||||
|
||||
if (outptr < outend)
|
||||
*outptr ++ = base64[(((in[0] & 255) << 4) | ((in[1] & 255) >> 4)) & 63];
|
||||
{
|
||||
if (inlen > 1)
|
||||
*outptr ++ = base64[(((in[0] & 255) << 4) | ((in[1] & 255) >> 4)) & 63];
|
||||
else
|
||||
*outptr ++ = base64[((in[0] & 255) << 4) & 63];
|
||||
}
|
||||
|
||||
in ++;
|
||||
inlen --;
|
||||
@@ -610,7 +616,12 @@ httpEncode64_2(char *out, /* I - String to write to */
|
||||
}
|
||||
|
||||
if (outptr < outend)
|
||||
*outptr ++ = base64[(((in[0] & 255) << 2) | ((in[1] & 255) >> 6)) & 63];
|
||||
{
|
||||
if (inlen > 1)
|
||||
*outptr ++ = base64[(((in[0] & 255) << 2) | ((in[1] & 255) >> 6)) & 63];
|
||||
else
|
||||
*outptr ++ = base64[((in[0] & 255) << 2) & 63];
|
||||
}
|
||||
|
||||
in ++;
|
||||
inlen --;
|
||||
|
||||
@@ -995,6 +995,7 @@ 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 */
|
||||
|
||||
@@ -1005,38 +1006,43 @@ appleLangDefault(void)
|
||||
|
||||
if (!cg->language[0])
|
||||
{
|
||||
localizationList =
|
||||
CFPreferencesCopyAppValue(CFSTR("AppleLanguages"),
|
||||
kCFPreferencesCurrentApplication);
|
||||
|
||||
if (localizationList != NULL)
|
||||
if ((lang = getenv("LANG")))
|
||||
strlcpy(cg->language, lang, sizeof(cg->language));
|
||||
else
|
||||
{
|
||||
if (CFGetTypeID(localizationList) == CFArrayGetTypeID() &&
|
||||
CFArrayGetCount(localizationList) > 0)
|
||||
localizationList =
|
||||
CFPreferencesCopyAppValue(CFSTR("AppleLanguages"),
|
||||
kCFPreferencesCurrentApplication);
|
||||
|
||||
if (localizationList != NULL)
|
||||
{
|
||||
languageName = CFArrayGetValueAtIndex(localizationList, 0);
|
||||
if (CFGetTypeID(localizationList) == CFArrayGetTypeID() &&
|
||||
CFArrayGetCount(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));
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
CFRelease(localizationList);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1144,59 +1150,66 @@ 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 == NULL)
|
||||
if (!cg->language[0])
|
||||
{
|
||||
localizationList =
|
||||
CFPreferencesCopyAppValue(CFSTR("AppleLanguages"),
|
||||
kCFPreferencesCurrentApplication);
|
||||
|
||||
if (localizationList != NULL)
|
||||
if ((lang = getenv("LANG")))
|
||||
strlcpy(cg->language, lang, sizeof(cg->language));
|
||||
else
|
||||
{
|
||||
if (CFGetTypeID(localizationList) == CFArrayGetTypeID() &&
|
||||
CFArrayGetCount(localizationList) > 0)
|
||||
localizationList =
|
||||
CFPreferencesCopyAppValue(CFSTR("AppleLanguages"),
|
||||
kCFPreferencesCurrentApplication);
|
||||
|
||||
if (localizationList != NULL)
|
||||
{
|
||||
localizationName = CFArrayGetValueAtIndex(localizationList, 0);
|
||||
|
||||
if (localizationName != NULL &&
|
||||
CFGetTypeID(localizationName) == CFStringGetTypeID())
|
||||
if (CFGetTypeID(localizationList) == CFArrayGetTypeID() &&
|
||||
CFArrayGetCount(localizationList) > 0)
|
||||
{
|
||||
CFIndex length = CFStringGetLength(localizationName);
|
||||
localizationName = CFArrayGetValueAtIndex(localizationList, 0);
|
||||
|
||||
if (length <= sizeof(buff) &&
|
||||
CFStringGetCString(localizationName, buff, sizeof(buff),
|
||||
kCFStringEncodingASCII))
|
||||
if (localizationName != NULL &&
|
||||
CFGetTypeID(localizationName) == CFStringGetTypeID())
|
||||
{
|
||||
buff[sizeof(buff) - 1] = '\0';
|
||||
CFIndex length = CFStringGetLength(localizationName);
|
||||
|
||||
for (i = 0;
|
||||
i < sizeof(apple_name_locale) / sizeof(apple_name_locale[0]);
|
||||
i++)
|
||||
if (length <= sizeof(buff) &&
|
||||
CFStringGetCString(localizationName, buff, sizeof(buff),
|
||||
kCFStringEncodingASCII))
|
||||
{
|
||||
if (!strcasecmp(buff, apple_name_locale[i].name))
|
||||
buff[sizeof(buff) - 1] = '\0';
|
||||
|
||||
for (i = 0;
|
||||
i < sizeof(apple_name_locale) / sizeof(apple_name_locale[0]);
|
||||
i++)
|
||||
{
|
||||
cg->language = apple_name_locale[i].locale;
|
||||
break;
|
||||
if (!strcasecmp(buff, apple_name_locale[i].name))
|
||||
{
|
||||
strlcpy(cg->language, apple_name_locale[i].locale,
|
||||
sizeof(cg->language));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CFRelease(localizationList);
|
||||
CFRelease(localizationList);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If we didn't find the language, default to en_US...
|
||||
*/
|
||||
|
||||
if (cg->language == NULL)
|
||||
cg->language = apple_name_locale[0].locale;
|
||||
if (!cg->language[0])
|
||||
strlcpy(cg->language, apple_name_locale[0].locale, sizeof(cg->language));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -62,15 +62,14 @@ 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, k, /* Looping variables */
|
||||
int i, j, /* 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 == NULL)
|
||||
if (!ppd)
|
||||
return (0);
|
||||
|
||||
/*
|
||||
@@ -79,15 +78,8 @@ ppdConflicts(ppd_file_t *ppd) /* I - PPD to check */
|
||||
|
||||
conflicts = 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;
|
||||
}
|
||||
for (o1 = ppdFirstOption(ppd); o1; o1 = ppdNextOption(ppd))
|
||||
o1->conflicted = 0;
|
||||
|
||||
/*
|
||||
* Loop through all of the UI constraints and flag any options
|
||||
@@ -102,9 +94,9 @@ ppdConflicts(ppd_file_t *ppd) /* I - PPD to check */
|
||||
|
||||
o1 = ppdFindOption(ppd, c->option1);
|
||||
|
||||
if (o1 == NULL)
|
||||
if (!o1)
|
||||
continue;
|
||||
else if (c->choice1[0] != '\0')
|
||||
else if (c->choice1[0])
|
||||
{
|
||||
/*
|
||||
* This constraint maps to a specific choice.
|
||||
@@ -122,10 +114,10 @@ ppdConflicts(ppd_file_t *ppd) /* I - PPD to check */
|
||||
if (c1->marked)
|
||||
break;
|
||||
|
||||
if (j == 0 ||
|
||||
strcasecmp(c1->choice, "None") == 0 ||
|
||||
strcasecmp(c1->choice, "Off") == 0 ||
|
||||
strcasecmp(c1->choice, "False") == 0)
|
||||
if (!j ||
|
||||
!strcasecmp(c1->choice, "None") ||
|
||||
!strcasecmp(c1->choice, "Off") ||
|
||||
!strcasecmp(c1->choice, "False"))
|
||||
c1 = NULL;
|
||||
}
|
||||
|
||||
@@ -135,9 +127,9 @@ ppdConflicts(ppd_file_t *ppd) /* I - PPD to check */
|
||||
|
||||
o2 = ppdFindOption(ppd, c->option2);
|
||||
|
||||
if (o2 == NULL)
|
||||
if (!o2)
|
||||
continue;
|
||||
else if (c->choice2[0] != '\0')
|
||||
else if (c->choice2[0])
|
||||
{
|
||||
/*
|
||||
* This constraint maps to a specific choice.
|
||||
@@ -155,10 +147,10 @@ ppdConflicts(ppd_file_t *ppd) /* I - PPD to check */
|
||||
if (c2->marked)
|
||||
break;
|
||||
|
||||
if (j == 0 ||
|
||||
strcasecmp(c2->choice, "None") == 0 ||
|
||||
strcasecmp(c2->choice, "Off") == 0 ||
|
||||
strcasecmp(c2->choice, "False") == 0)
|
||||
if (!j ||
|
||||
!strcasecmp(c2->choice, "None") ||
|
||||
!strcasecmp(c2->choice, "Off") ||
|
||||
!strcasecmp(c2->choice, "False"))
|
||||
c2 = NULL;
|
||||
}
|
||||
|
||||
@@ -166,8 +158,7 @@ ppdConflicts(ppd_file_t *ppd) /* I - PPD to check */
|
||||
* If both options are marked then there is a conflict...
|
||||
*/
|
||||
|
||||
if (c1 != NULL && c1->marked &&
|
||||
c2 != NULL && c2->marked)
|
||||
if (c1 && c1->marked && c2 && c2->marked)
|
||||
{
|
||||
DEBUG_printf(("%s->%s conflicts with %s->%s (%s %s %s %s)\n",
|
||||
o1->keyword, c1->choice, o2->keyword, c2->choice,
|
||||
|
||||
@@ -1549,6 +1549,18 @@ 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...)
|
||||
@@ -1556,17 +1568,38 @@ 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
|
||||
_cups_strcpy(constraint->option2, constraint->choice1);
|
||||
else if (cg->ppd_conform == PPD_CONFORM_STRICT)
|
||||
{
|
||||
cg->ppd_status = PPD_BAD_UI_CONSTRAINTS;
|
||||
goto error;
|
||||
}
|
||||
|
||||
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...)
|
||||
@@ -1574,9 +1607,21 @@ 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';
|
||||
@@ -1585,20 +1630,85 @@ 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;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Temp file utilities for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 1997-2005 by Easy Software Products.
|
||||
* Copyright 1997-2006 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() - Create a temporary file.
|
||||
* cupsTempFile() - Generate a temporary filename.
|
||||
* cupsTempFile2() - Create a temporary CUPS file.
|
||||
* cupsTempFd() - Creates a temporary file.
|
||||
* cupsTempFile() - Generates a temporary filename.
|
||||
* cupsTempFile2() - Creates a temporary CUPS file.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -48,12 +48,13 @@
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsTempFd()' - Create a temporary file.
|
||||
* 'cupsTempFd()' - Creates a temporary file.
|
||||
*
|
||||
* The temporary filename is stored in the filename buffer.
|
||||
* The temporary filename is returned in the filename buffer.
|
||||
* The temporary file is opened for reading and writing.
|
||||
*/
|
||||
|
||||
int /* O - New file descriptor */
|
||||
int /* O - New file descriptor or -1 on error */
|
||||
cupsTempFd(char *filename, /* I - Pointer to buffer */
|
||||
int len) /* I - Size of buffer */
|
||||
{
|
||||
@@ -158,16 +159,16 @@ cupsTempFd(char *filename, /* I - Pointer to buffer */
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsTempFile()' - Generate a temporary filename.
|
||||
* 'cupsTempFile()' - Generates a temporary filename.
|
||||
*
|
||||
* The temporary filename is stored in the filename buffer.
|
||||
* The temporary filename is returned in the filename buffer.
|
||||
* This function is deprecated - use cupsTempFd() or cupsTempFile2()
|
||||
* instead.
|
||||
*
|
||||
* @deprecated@
|
||||
*/
|
||||
|
||||
char * /* O - Filename */
|
||||
char * /* O - Filename or NULL on error */
|
||||
cupsTempFile(char *filename, /* I - Pointer to buffer */
|
||||
int len) /* I - Size of buffer */
|
||||
{
|
||||
@@ -207,9 +208,10 @@ cupsTempFile(char *filename, /* I - Pointer to buffer */
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsTempFile2()' - Create a temporary CUPS file.
|
||||
* 'cupsTempFile2()' - Creates a temporary CUPS file.
|
||||
*
|
||||
* The temporary filename is stored in the filename buffer.
|
||||
* The temporary filename is returned in the filename buffer.
|
||||
* The temporary file is opened for writing.
|
||||
*
|
||||
* @since CUPS 1.2@
|
||||
*/
|
||||
|
||||
@@ -84,6 +84,8 @@ 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",
|
||||
|
||||
@@ -445,6 +445,7 @@ cupsUTF8ToUTF32(
|
||||
*/
|
||||
|
||||
*dest++ = ch;
|
||||
continue;
|
||||
}
|
||||
else if ((ch & 0xe0) == 0xc0)
|
||||
{
|
||||
@@ -540,7 +541,7 @@ cupsUTF8ToUTF32(
|
||||
* Check for UTF-16 surrogate (illegal UTF-8)...
|
||||
*/
|
||||
|
||||
if (*dest >= 0xd800 && *dest <= 0xdfff)
|
||||
if (ch32 >= 0xd800 && ch32 <= 0xdfff)
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,10 +14,12 @@ X-DCOP-ServiceType=
|
||||
X-KDE-SubstituteUID=false
|
||||
X-KDE-Username=
|
||||
Name=Manage Printing
|
||||
Name[en_US]=Manage Printing
|
||||
Comment=CUPS Web Interface
|
||||
Name[en_US]=Manage Printing
|
||||
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
|
||||
|
||||
|
Depois Largura: | Altura: | Tamanho: 595 B |
|
Depois Largura: | Altura: | Tamanho: 443 B |
|
Depois Largura: | Altura: | Tamanho: 472 B |
|
Depois Largura: | Altura: | Tamanho: 563 B |
|
Depois Largura: | Altura: | Tamanho: 636 B |
|
Depois Largura: | Altura: | Tamanho: 513 B |
|
Depois Largura: | Altura: | Tamanho: 612 B |
|
Depois Largura: | Altura: | Tamanho: 644 B |
|
Depois Largura: | Altura: | Tamanho: 419 B |
|
Depois Largura: | Altura: | Tamanho: 355 B |
|
Depois Largura: | Altura: | Tamanho: 506 B |
|
Depois Largura: | Altura: | Tamanho: 522 B |
|
Depois Largura: | Altura: | Tamanho: 721 B |
|
Depois Largura: | Altura: | Tamanho: 874 B |
|
Depois Largura: | Altura: | Tamanho: 313 B |
|
Depois Largura: | Altura: | Tamanho: 451 B |
|
Depois Largura: | Altura: | Tamanho: 523 B |
|
Depois Largura: | Altura: | Tamanho: 450 B |
|
Depois Largura: | Altura: | Tamanho: 571 B |
|
Depois Largura: | Altura: | Tamanho: 541 B |
|
Depois Largura: | Altura: | Tamanho: 537 B |
|
Depois Largura: | Altura: | Tamanho: 552 B |
|
Depois Largura: | Altura: | Tamanho: 475 B |
|
Depois Largura: | Altura: | Tamanho: 606 B |
|
Depois Largura: | Altura: | Tamanho: 768 B |
|
Depois Largura: | Altura: | Tamanho: 630 B |
|
Depois Largura: | Altura: | Tamanho: 560 B |
|
Depois Largura: | Altura: | Tamanho: 649 B |
|
Depois Largura: | Altura: | Tamanho: 534 B |
|
Depois Largura: | Altura: | Tamanho: 551 B |
|
Depois Largura: | Altura: | Tamanho: 709 B |
|
Depois Largura: | Altura: | Tamanho: 329 B |
|
Depois Largura: | Altura: | Tamanho: 753 B |
|
Depois Largura: | Altura: | Tamanho: 742 B |
|
Depois Largura: | Altura: | Tamanho: 696 B |
|
Depois Largura: | Altura: | Tamanho: 683 B |
|
Depois Largura: | Altura: | Tamanho: 567 B |
|
Depois Largura: | Altura: | Tamanho: 683 B |
|
Depois Largura: | Altura: | Tamanho: 556 B |
|
Depois Largura: | Altura: | Tamanho: 529 B |
|
Depois Largura: | Altura: | Tamanho: 607 B |
|
Depois Largura: | Altura: | Tamanho: 624 B |
|
Depois Largura: | Altura: | Tamanho: 537 B |
|
Depois Largura: | Altura: | Tamanho: 567 B |
|
Depois Largura: | Altura: | Tamanho: 491 B |
|
Depois Largura: | Altura: | Tamanho: 500 B |
|
Depois Largura: | Altura: | Tamanho: 638 B |
|
Depois Largura: | Altura: | Tamanho: 903 B |
|
Depois Largura: | Altura: | Tamanho: 687 B |
|
Depois Largura: | Altura: | Tamanho: 550 B |
|
Depois Largura: | Altura: | Tamanho: 576 B |
|
Depois Largura: | Altura: | Tamanho: 758 B |
@@ -0,0 +1,141 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>Kodu - CUPS @CUPS_VERSION@@CUPS_REVISION@</TITLE>
|
||||
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/cups.css">
|
||||
<LINK REL="SHORTCUT ICON" HREF="/favicon.ico" TYPE="image/x-icon">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<TABLE WIDTH="100%" STYLE="height: 100%;" BORDER="0" CELLSPACING="0" CELLPADDING="0" SUMMARY="Common UNIX Printing System @CUPS_VERSION@">
|
||||
<TR CLASS="header">
|
||||
<TD VALIGN="TOP" WIDTH="15" ROWSPAN="2"><IMG SRC="/images/top-left.gif" WIDTH="15" HEIGHT="80" ALT=""></TD>
|
||||
<TD VALIGN="TOP" WIDTH="55" ROWSPAN="2"><IMG SRC="/images/top-middle.gif" WIDTH="55" HEIGHT="80" ALT=""></TD>
|
||||
<TD WIDTH="100%" HEIGHT="60"><H1>Common UNIX Printing System @CUPS_VERSION@@CUPS_REVISION@</H1></TD>
|
||||
<TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="15" ROWSPAN="2"><IMG
|
||||
SRC="/images/top-right.gif" WIDTH="15" HEIGHT="15" ALT=""></TD>
|
||||
</TR>
|
||||
<TR CLASS="header"><TD WIDTH="100%" VALIGN="BOTTOM" NOWRAP>
|
||||
|
||||
<A CLASS="sel" HREF="/"><IMG SRC="/images/tab-left.gif" WIDTH="4"
|
||||
HEIGHT="4" ALIGN="TOP" BORDER="0"
|
||||
ALT=""> Kodu <IMG
|
||||
SRC="/images/tab-right.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""></A>
|
||||
|
||||
<A CLASS="unsel" HREF="/admin/"><IMG SRC="/images/tab-left.gif" WIDTH="4"
|
||||
HEIGHT="4" ALIGN="TOP" BORDER="0"
|
||||
ALT=""> Haldus <IMG
|
||||
SRC="/images/tab-right.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""></A>
|
||||
|
||||
<A CLASS="unsel" HREF="/classes/"><IMG SRC="/images/tab-left.gif" WIDTH="4"
|
||||
HEIGHT="4" ALIGN="TOP" BORDER="0"
|
||||
ALT=""> Klassid <IMG
|
||||
SRC="/images/tab-right.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""></A>
|
||||
|
||||
<A CLASS="unsel" HREF="/help/"><IMG SRC="/images/tab-left.gif" WIDTH="4"
|
||||
HEIGHT="4" ALIGN="TOP" BORDER="0"
|
||||
ALT=""> Dokumentatsioon/Abi <IMG
|
||||
SRC="/images/tab-right.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""></A>
|
||||
|
||||
<A CLASS="unsel" HREF="/jobs/"><IMG SRC="/images/tab-left.gif" WIDTH="4"
|
||||
HEIGHT="4" ALIGN="TOP" BORDER="0"
|
||||
ALT=""> Tööd <IMG
|
||||
SRC="/images/tab-right.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""></A>
|
||||
|
||||
<A CLASS="unsel" HREF="/printers/"><IMG SRC="/images/tab-left.gif" WIDTH="4"
|
||||
HEIGHT="4" ALIGN="TOP" BORDER="0"
|
||||
ALT=""> Printerid <IMG
|
||||
SRC="/images/tab-right.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""></A>
|
||||
|
||||
</TD></TR>
|
||||
<TR CLASS="page">
|
||||
<TD WIDTH="15"> </TD>
|
||||
<TD COLSPAN="2" WIDTH="100%" VALIGN="TOP" CLASS="page">
|
||||
|
||||
<H2 CLASS="title">Tere tulemast!</H2>
|
||||
|
||||
<P>Käesolevad veebileheküljed võimaldavad Teil jälgida oma printereid ja töid
|
||||
ning süsteemi hallata. Klõpsake vajalike ülesannete sooritamiseks mõnele
|
||||
ülal paiknevale sakile või all asuvale nupule.</P>
|
||||
|
||||
<P>
|
||||
<A HREF="/help/"><IMG SRC="/images/button-help.gif" CLASS="button" ALT="Abi"></A>
|
||||
<A HREF="/admin?OP=add-class"><IMG SRC="/images/button-add-class.gif" CLASS="button" ALT="Lisa klass"></A>
|
||||
<A HREF="/admin?OP=add-printer"><IMG SRC="/images/button-add-printer.gif" CLASS="button" ALT="Lisa printer"></A>
|
||||
<A HREF="/classes"><IMG SRC="/images/button-manage-classes.gif" CLASS="button" ALT="Halda klasse"></A>
|
||||
<A HREF="/jobs"><IMG SRC="/images/button-manage-jobs.gif" CLASS="button" ALT="Halda töid"></A>
|
||||
<A HREF="/printers"><IMG SRC="/images/button-manage-printers.gif" CLASS="button" ALT="Halda printereid"></A>
|
||||
<A HREF="/admin"><IMG SRC="/images/button-manage-server.gif" CLASS="button" ALT="Halda serverit"></A>
|
||||
</P>
|
||||
|
||||
<P><I>Kui Teie käest päritakse kasutajanime ja parooli, sisestage enda
|
||||
või administraatori (root) kasutajanimi ja parool.</I></P>
|
||||
|
||||
<H2 CLASS="title">CUPS-i info</H2>
|
||||
|
||||
<P>
|
||||
<IMG SRC="/images/happy.gif" ALIGN="LEFT" WIDTH="196" HEIGHT="144"
|
||||
STYLE="padding-right: 10px;" ALT="Happy Computer and Printer">
|
||||
|
||||
<A HREF="http://www.easysw.com/"><IMG SRC="/images/esp-logo.gif"
|
||||
ALIGN="RIGHT" WIDTH="110" HEIGHT="68" BORDER="0"
|
||||
STYLE="padding-left: 10px; padding-bottom: 10px;"
|
||||
ALT="Easy Software Products"></A>
|
||||
|
||||
CUPS pakub porditavat trükkimiskihti
|
||||
UNIX<SUP>®</SUP> põhistele operatsioonisüsteemidele. CUPS-i töötas
|
||||
välja ja hooldab <A HREF="http://www.easysw.com">Easy Software
|
||||
Products</a>, selle siht on edendada standardseid trükkimislahendusi. CUPS on
|
||||
standardne trükkimissüsteem, mida kasutavad MacOS<SUP>®</SUP> X ja
|
||||
suurem osa Linux<SUP>®</SUP> distributsioone.</P>
|
||||
|
||||
<P>CUPS kasutab <A HREF="http://www.pwg.org/ipp/"
|
||||
TARGET="_blank"> Interneti trükkimisprotokolli ("IPP")</A>
|
||||
trükitööde ja järjekordade haldamiseks, lisades sellele
|
||||
võrguprinterite kasutamise ning PostScript-printerikirjelduste ("PPD")
|
||||
põhise trükkimise võimalused trükkimise maksimaalseks hõlbustamiseks.<BR CLEAR="ALL"></P>
|
||||
|
||||
<H2 CLASS="title">Printeridraiveritest ja abist</H2>
|
||||
|
||||
<P>Printeridraiverite ja muu abi leidmiseks külastage CUPS-i
|
||||
ametlikku veebilehekülge:</P>
|
||||
|
||||
<PRE>
|
||||
<A HREF="http://www.cups.org/" TARGET="_blank">www.cups.org</A>
|
||||
</PRE>
|
||||
|
||||
<P>Kommertstoetus ja CUPS-i täiustatud versioon nimetusega <A
|
||||
HREF="http://www.easysw.com/printpro/">ESP Print Pro</A> on
|
||||
saadaval aadressil:</P>
|
||||
|
||||
<PRE>
|
||||
<A HREF="http://www.easysw.com/" TARGET="_blank">www.easysw.com</A>
|
||||
</PRE>
|
||||
|
||||
</TD>
|
||||
<TD WIDTH="15"> </TD>
|
||||
</TR>
|
||||
<TR CLASS="header">
|
||||
<TD VALIGN="BOTTOM" WIDTH="15"><IMG SRC="/images/bottom-left.gif"
|
||||
WIDTH="15" HEIGHT="15" ALT=""></TD>
|
||||
<TD COLSPAN="2" WIDTH="100%" STYLE="padding: 5;">
|
||||
|
||||
<P><SMALL>Common UNIX Printing System, CUPS ja CUPS-i logo on
|
||||
firma <A HREF="http://www.easysw.com">Easy Software
|
||||
Products</A> kaubamärgid. CUPS-i autoriõigus 1997-2006: Easy Software Products,
|
||||
kõik õigused kaitstud.</SMALL></P>
|
||||
|
||||
</TD>
|
||||
|
||||
<TD ALIGN="RIGHT" VALIGN="BOTTOM" WIDTH="15"><IMG SRC="/images/bottom-right.gif"
|
||||
WIDTH="15" HEIGHT="15" ALT=""></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -176,8 +176,16 @@ CUPS 1.1 or higher.</p>
|
||||
<h4>Description</h4>
|
||||
<p>Add a destination to the list of destinations.
|
||||
|
||||
Use the cupsSaveDests() function to save the updated list of destinations
|
||||
to the user's lpoptions file.</p>
|
||||
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.</p>
|
||||
<h4>Syntax</h4>
|
||||
<pre>
|
||||
int
|
||||
@@ -191,8 +199,8 @@ cupsAddDest(
|
||||
<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
|
||||
<thead><tr><th>Name</th><th>Description</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><tt>name</tt></td><td>Name of destination</td></tr>
|
||||
<tr><td><tt>instance</tt></td><td>Instance of destination or NULL for none/primary</td></tr>
|
||||
<tr><td><tt>name</tt></td><td>Destination name</td></tr>
|
||||
<tr><td><tt>instance</tt></td><td>Instance name or NULL for none/primary</td></tr>
|
||||
<tr><td><tt>num_dests</tt></td><td>Number of destinations</td></tr>
|
||||
<tr><td><tt>dests</tt></td><td>Destinations</td></tr>
|
||||
</tbody></table></div>
|
||||
@@ -412,8 +420,8 @@ cupsGetDest(
|
||||
<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
|
||||
<thead><tr><th>Name</th><th>Description</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><tt>name</tt></td><td>Name of destination</td></tr>
|
||||
<tr><td><tt>instance</tt></td><td>Instance of destination</td></tr>
|
||||
<tr><td><tt>name</tt></td><td>Destination name or NULL for the default destination</td></tr>
|
||||
<tr><td><tt>instance</tt></td><td>Instance name or NULL</td></tr>
|
||||
<tr><td><tt>num_dests</tt></td><td>Number of destinations</td></tr>
|
||||
<tr><td><tt>dests</tt></td><td>Destinations</td></tr>
|
||||
</tbody></table></div>
|
||||
@@ -427,7 +435,10 @@ cupsGetDest(
|
||||
Starting with CUPS 1.2, the returned list of destinations include the
|
||||
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.</p>
|
||||
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.</p>
|
||||
<h4>Syntax</h4>
|
||||
<pre>
|
||||
int
|
||||
@@ -452,6 +463,9 @@ 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.
|
||||
|
||||
</p>
|
||||
<h4>Syntax</h4>
|
||||
<pre>
|
||||
@@ -1192,9 +1206,10 @@ cupsSetUser(
|
||||
<!-- NEW PAGE -->
|
||||
<h3 class='title'><a name='cupsTempFd'>cupsTempFd()</a></h3>
|
||||
<h4>Description</h4>
|
||||
<p>Create a temporary file.
|
||||
<p>Creates a temporary file.
|
||||
|
||||
The temporary filename is stored in the filename buffer.</p>
|
||||
The temporary filename is returned in the filename buffer.
|
||||
The temporary file is opened for reading and writing.</p>
|
||||
<h4>Syntax</h4>
|
||||
<pre>
|
||||
int
|
||||
@@ -1210,13 +1225,13 @@ cupsTempFd(
|
||||
<tr><td><tt>len</tt></td><td>Size of buffer</td></tr>
|
||||
</tbody></table></div>
|
||||
<h4>Returns</h4>
|
||||
<p>New file descriptor</p>
|
||||
<p>New file descriptor or -1 on error</p>
|
||||
<!-- NEW PAGE -->
|
||||
<h3 class='title'><span class='info'> DEPRECATED </span><a name='cupsTempFile'>cupsTempFile()</a></h3>
|
||||
<h4>Description</h4>
|
||||
<p>Generate a temporary filename.
|
||||
<p>Generates a temporary filename.
|
||||
|
||||
The temporary filename is stored in the filename buffer.
|
||||
The temporary filename is returned in the filename buffer.
|
||||
This function is deprecated - use cupsTempFd() or cupsTempFile2()
|
||||
instead.
|
||||
|
||||
@@ -1236,13 +1251,14 @@ cupsTempFile(
|
||||
<tr><td><tt>len</tt></td><td>Size of buffer</td></tr>
|
||||
</tbody></table></div>
|
||||
<h4>Returns</h4>
|
||||
<p>Filename</p>
|
||||
<p>Filename or NULL on error</p>
|
||||
<!-- NEW PAGE -->
|
||||
<h3 class='title'><span class='info'> CUPS 1.2 </span><a name='cupsTempFile2'>cupsTempFile2()</a></h3>
|
||||
<h4>Description</h4>
|
||||
<p>Create a temporary CUPS file.
|
||||
<p>Creates a temporary CUPS file.
|
||||
|
||||
The temporary filename is stored in the filename buffer.
|
||||
The temporary filename is returned in the filename buffer.
|
||||
The temporary file is opened for writing.
|
||||
|
||||
</p>
|
||||
<h4>Syntax</h4>
|
||||
|
||||
@@ -112,6 +112,7 @@ require CUPS 1.1 or higher.</p>
|
||||
<thead><tr><th>Name</th><th>Description</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><tt>HTTP_ENCODE_CHUNKED</tt> </td><td>Data is chunked</td></tr>
|
||||
<tr><td><tt>HTTP_ENCODE_FIELDS</tt> </td><td>Sending HTTP fields</td></tr>
|
||||
<tr><td><tt>HTTP_ENCODE_LENGTH</tt> </td><td>Data is sent with Content-Length</td></tr>
|
||||
</tbody></table></div>
|
||||
<!-- NEW PAGE -->
|
||||
@@ -256,7 +257,7 @@ require CUPS 1.1 or higher.</p>
|
||||
<tr><td><tt>IPP_DOCUMENT_ACCESS_ERROR</tt> </td><td>client-error-document-access-error</td></tr>
|
||||
<tr><td><tt>IPP_DOCUMENT_FORMAT</tt> </td><td>client-error-document-format-not-supported</td></tr>
|
||||
<tr><td><tt>IPP_DOCUMENT_FORMAT_ERROR</tt> </td><td>client-error-document-format-error</td></tr>
|
||||
<tr><td><tt>IPP_ERROR_JOB_CANCELLED</tt> </td><td>server-error-job-canceled</td></tr>
|
||||
<tr><td><tt>IPP_ERROR_JOB_CANCELED</tt> </td><td>server-error-job-canceled</td></tr>
|
||||
<tr><td><tt>IPP_FORBIDDEN</tt> </td><td>client-error-forbidden</td></tr>
|
||||
<tr><td><tt>IPP_GONE</tt> </td><td>client-error-gone</td></tr>
|
||||
<tr><td><tt>IPP_IGNORED_ALL_NOTIFICATIONS</tt> </td><td>client-error-ignored-all-notifications</td></tr>
|
||||
|
||||
@@ -72,7 +72,7 @@ CUPS 1.1 or higher.</p>
|
||||
<h2 class='title'>Licensing</h2>
|
||||
|
||||
<p>The CUPS raster API is provided under the terms of the GNU
|
||||
General Public License, with exceptions for MacOS X-based
|
||||
Library General Public License, with exceptions for MacOS X-based
|
||||
programs. Please see the CUPS license agreement for more
|
||||
information.</p>
|
||||
<h2 class='title'>Contents</h2>
|
||||
@@ -85,10 +85,31 @@ information.</p>
|
||||
<!-- NEW PAGE -->
|
||||
<h2 class='title'><a name='ENUMERATIONS'>Enumerations</a></h2>
|
||||
<ul>
|
||||
<li><a href='#cups_adv_e'><tt>cups_adv_e</tt></a> </li>
|
||||
<li><a href='#cups_bool_e'><tt>cups_bool_e</tt></a> </li>
|
||||
<li><a href='#cups_cspace_e'><tt>cups_cspace_e</tt></a> </li>
|
||||
<li><a href='#cups_cut_e'><tt>cups_cut_e</tt></a> </li>
|
||||
<li><a href='#cups_edge_e'><tt>cups_edge_e</tt></a> </li>
|
||||
<li><a href='#cups_jog_e'><tt>cups_jog_e</tt></a> </li>
|
||||
<li><a href='#cups_mode_e'><tt>cups_mode_e</tt></a> </li>
|
||||
<li><a href='#cups_order_e'><tt>cups_order_e</tt></a> </li>
|
||||
<li><a href='#cups_orient_e'><tt>cups_orient_e</tt></a> </li>
|
||||
</ul>
|
||||
<!-- NEW PAGE -->
|
||||
<h3 class='title'><a name='cups_adv_e'>cups_adv_e</a></h3>
|
||||
<h4>Description</h4>
|
||||
<p></p>
|
||||
<h4>Values</h4>
|
||||
<div class='table'><table align='center' border='1' width='80%'>
|
||||
<thead><tr><th>Name</th><th>Description</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><tt>CUPS_ADVANCE_FILE</tt> </td><td>Advance the roll after this file</td></tr>
|
||||
<tr><td><tt>CUPS_ADVANCE_JOB</tt> </td><td>Advance the roll after this job</td></tr>
|
||||
<tr><td><tt>CUPS_ADVANCE_NONE</tt> </td><td>Never advance the roll</td></tr>
|
||||
<tr><td><tt>CUPS_ADVANCE_PAGE</tt> </td><td>Advance the roll after this page</td></tr>
|
||||
<tr><td><tt>CUPS_ADVANCE_SET</tt> </td><td>Advance the roll after this set</td></tr>
|
||||
</tbody></table></div>
|
||||
<!-- NEW PAGE -->
|
||||
<h3 class='title'><a name='cups_bool_e'>cups_bool_e</a></h3>
|
||||
<h4>Description</h4>
|
||||
<p>Types...</p>
|
||||
@@ -100,6 +121,89 @@ information.</p>
|
||||
<tr><td><tt>CUPS_TRUE</tt> </td><td>Logical true</td></tr>
|
||||
</tbody></table></div>
|
||||
<!-- NEW PAGE -->
|
||||
<h3 class='title'><a name='cups_cspace_e'>cups_cspace_e</a></h3>
|
||||
<h4>Description</h4>
|
||||
<p></p>
|
||||
<h4>Values</h4>
|
||||
<div class='table'><table align='center' border='1' width='80%'>
|
||||
<thead><tr><th>Name</th><th>Description</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><tt>CUPS_CSPACE_CIELab</tt> <span class='info'> CUPS 1.1.19 </span></td><td>CIE Lab </td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_CIEXYZ</tt> <span class='info'> CUPS 1.1.19 </span></td><td>CIE XYZ </td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_CMY</tt> </td><td>Cyan, magenta, yellow</td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_CMYK</tt> </td><td>Cyan, magenta, yellow, black</td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_GMCK</tt> </td><td>Gold, magenta, yellow, black</td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_GMCS</tt> </td><td>Gold, magenta, yellow, silver</td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_GOLD</tt> </td><td>Gold foil</td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_ICC1</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 1 color </td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_ICC2</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 2 colors </td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_ICC3</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 3 colors </td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_ICC4</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 4 colors </td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_ICC5</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 5 colors </td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_ICC6</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 6 colors </td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_ICC7</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 7 colors </td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_ICC8</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 8 colors </td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_ICC9</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 9 colors </td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_ICCA</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 10 colors </td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_ICCB</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 11 colors </td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_ICCC</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 12 colors </td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_ICCD</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 13 colors </td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_ICCE</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 14 colors </td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_ICCF</tt> <span class='info'> CUPS 1.1.19 </span></td><td>ICC-based, 15 colors </td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_K</tt> </td><td>Black</td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_KCMY</tt> </td><td>Black, cyan, magenta, yellow</td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_KCMYcm</tt> </td><td>Black, cyan, magenta, yellow, *
|
||||
light-cyan, light-magenta</td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_RGB</tt> </td><td>Red, green, blue</td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_RGBA</tt> </td><td>Red, green, blue, alpha</td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_RGBW</tt> <span class='info'> CUPS 1.2 </span></td><td>Red, green, blue, white </td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_SILVER</tt> </td><td>Silver foil</td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_W</tt> </td><td>Luminance</td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_WHITE</tt> </td><td>White ink (as black)</td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_YMC</tt> </td><td>Yellow, magenta, cyan</td></tr>
|
||||
<tr><td><tt>CUPS_CSPACE_YMCK</tt> </td><td>Yellow, magenta, cyan, black</td></tr>
|
||||
</tbody></table></div>
|
||||
<!-- NEW PAGE -->
|
||||
<h3 class='title'><a name='cups_cut_e'>cups_cut_e</a></h3>
|
||||
<h4>Description</h4>
|
||||
<p></p>
|
||||
<h4>Values</h4>
|
||||
<div class='table'><table align='center' border='1' width='80%'>
|
||||
<thead><tr><th>Name</th><th>Description</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><tt>CUPS_CUT_FILE</tt> </td><td>Cut the roll after this file</td></tr>
|
||||
<tr><td><tt>CUPS_CUT_JOB</tt> </td><td>Cut the roll after this job</td></tr>
|
||||
<tr><td><tt>CUPS_CUT_NONE</tt> </td><td>Never cut the roll</td></tr>
|
||||
<tr><td><tt>CUPS_CUT_PAGE</tt> </td><td>Cut the roll after this page</td></tr>
|
||||
<tr><td><tt>CUPS_CUT_SET</tt> </td><td>Cut the roll after this set</td></tr>
|
||||
</tbody></table></div>
|
||||
<!-- NEW PAGE -->
|
||||
<h3 class='title'><a name='cups_edge_e'>cups_edge_e</a></h3>
|
||||
<h4>Description</h4>
|
||||
<p></p>
|
||||
<h4>Values</h4>
|
||||
<div class='table'><table align='center' border='1' width='80%'>
|
||||
<thead><tr><th>Name</th><th>Description</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><tt>CUPS_EDGE_BOTTOM</tt> </td><td>Leading edge is the bottom of the page</td></tr>
|
||||
<tr><td><tt>CUPS_EDGE_LEFT</tt> </td><td>Leading edge is the left of the page</td></tr>
|
||||
<tr><td><tt>CUPS_EDGE_RIGHT</tt> </td><td>Leading edge is the right of the page</td></tr>
|
||||
<tr><td><tt>CUPS_EDGE_TOP</tt> </td><td>Leading edge is the top of the page</td></tr>
|
||||
</tbody></table></div>
|
||||
<!-- NEW PAGE -->
|
||||
<h3 class='title'><a name='cups_jog_e'>cups_jog_e</a></h3>
|
||||
<h4>Description</h4>
|
||||
<p></p>
|
||||
<h4>Values</h4>
|
||||
<div class='table'><table align='center' border='1' width='80%'>
|
||||
<thead><tr><th>Name</th><th>Description</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><tt>CUPS_JOG_FILE</tt> </td><td>Move pages after this file</td></tr>
|
||||
<tr><td><tt>CUPS_JOG_JOB</tt> </td><td>Move pages after this job</td></tr>
|
||||
<tr><td><tt>CUPS_JOG_NONE</tt> </td><td>Never move pages</td></tr>
|
||||
<tr><td><tt>CUPS_JOG_SET</tt> </td><td>Move pages after this set</td></tr>
|
||||
</tbody></table></div>
|
||||
<!-- NEW PAGE -->
|
||||
<h3 class='title'><a name='cups_mode_e'>cups_mode_e</a></h3>
|
||||
<h4>Description</h4>
|
||||
<p>Raster modes</p>
|
||||
@@ -111,6 +215,31 @@ information.</p>
|
||||
<tr><td><tt>CUPS_RASTER_WRITE</tt> </td><td>Open stream for writing</td></tr>
|
||||
</tbody></table></div>
|
||||
<!-- NEW PAGE -->
|
||||
<h3 class='title'><a name='cups_order_e'>cups_order_e</a></h3>
|
||||
<h4>Description</h4>
|
||||
<p></p>
|
||||
<h4>Values</h4>
|
||||
<div class='table'><table align='center' border='1' width='80%'>
|
||||
<thead><tr><th>Name</th><th>Description</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><tt>CUPS_ORDER_BANDED</tt> </td><td>CCC MMM YYY KKK ...</td></tr>
|
||||
<tr><td><tt>CUPS_ORDER_CHUNKED</tt> </td><td>CMYK CMYK CMYK ...</td></tr>
|
||||
<tr><td><tt>CUPS_ORDER_PLANAR</tt> </td><td>CCC ... MMM ... YYY ... KKK ...</td></tr>
|
||||
</tbody></table></div>
|
||||
<!-- NEW PAGE -->
|
||||
<h3 class='title'><a name='cups_orient_e'>cups_orient_e</a></h3>
|
||||
<h4>Description</h4>
|
||||
<p></p>
|
||||
<h4>Values</h4>
|
||||
<div class='table'><table align='center' border='1' width='80%'>
|
||||
<thead><tr><th>Name</th><th>Description</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><tt>CUPS_ORIENT_0</tt> </td><td>Don't rotate the page</td></tr>
|
||||
<tr><td><tt>CUPS_ORIENT_180</tt> </td><td>Turn the page upside down</td></tr>
|
||||
<tr><td><tt>CUPS_ORIENT_270</tt> </td><td>Rotate the page clockwise</td></tr>
|
||||
<tr><td><tt>CUPS_ORIENT_90</tt> </td><td>Rotate the page counter-clockwise</td></tr>
|
||||
</tbody></table></div>
|
||||
<!-- NEW PAGE -->
|
||||
<h2 class='title'><a name='FUNCTIONS'>Functions</a></h2>
|
||||
<ul>
|
||||
<li><a href='#cupsRasterClose'><tt>cupsRasterClose()</tt></a> </li>
|
||||
@@ -151,6 +280,12 @@ and "options" arguments. Instead, mark the options prior to calling
|
||||
cupsRasterInterpretPPD() - this allows you to do per-page options
|
||||
without manipulating the options array.
|
||||
|
||||
The "func" argument specifies an optional callback function that is
|
||||
called prior to the computation of the final raster data. The function
|
||||
can make changes to the cups_page_header2_t data as needed to use a
|
||||
supported raster format and then returns 0 on success and -1 if the
|
||||
requested attributes cannot be supported.
|
||||
|
||||
</p>
|
||||
<h4>Syntax</h4>
|
||||
<pre>
|
||||
@@ -159,7 +294,8 @@ cupsRasterInterpretPPD(
|
||||
<a href='#cups_page_header2_t'>cups_page_header2_t</a> * h,
|
||||
ppd_file_t * ppd,
|
||||
int num_options,
|
||||
cups_option_t * options);
|
||||
cups_option_t * options,
|
||||
<a href='#cups_interpret_cb_t'>cups_interpret_cb_t</a> func);
|
||||
</pre>
|
||||
<h4>Arguments</h4>
|
||||
<div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0'>
|
||||
@@ -169,6 +305,7 @@ cupsRasterInterpretPPD(
|
||||
<tr><td><tt>ppd</tt></td><td>PPD file</td></tr>
|
||||
<tr><td><tt>num_options</tt></td><td>Number of options</td></tr>
|
||||
<tr><td><tt>options</tt></td><td>Options</td></tr>
|
||||
<tr><td><tt>func</tt></td><td>Optional page header callback</td></tr>
|
||||
</tbody></table></div>
|
||||
<h4>Returns</h4>
|
||||
<p>0 on success, -1 on failure</p>
|
||||
@@ -448,7 +585,7 @@ factor not applied) </td></tr>
|
||||
<!-- NEW PAGE -->
|
||||
<h3 class='title'><a name='cups_page_header_s'>cups_page_header_s</a></h3>
|
||||
<h4>Description</h4>
|
||||
<p>Version 1 Page Header</p>
|
||||
<p></p>
|
||||
<h4>Definition</h4>
|
||||
<pre>
|
||||
struct cups_page_header_s
|
||||
@@ -541,11 +678,19 @@ struct cups_page_header_s
|
||||
<!-- NEW PAGE -->
|
||||
<h2 class='title'><a name='TYPES'>Types</a></h2>
|
||||
<ul>
|
||||
<li><a href='#cups_interpret_cb_t'><tt>cups_interpret_cb_t</tt></a> </li>
|
||||
<li><a href='#cups_page_header2_t'><tt>cups_page_header2_t</tt></a> <span class='info'> CUPS 1.2 </span></li>
|
||||
<li><a href='#cups_page_header_t'><tt>cups_page_header_t</tt></a> </li>
|
||||
<li><a href='#cups_raster_t'><tt>cups_raster_t</tt></a> </li>
|
||||
</ul>
|
||||
<!-- NEW PAGE -->
|
||||
<h3 class='title'><a name='cups_interpret_cb_t'>cups_interpret_cb_t</a></h3>
|
||||
<h4>Description</h4>
|
||||
<p>Prototypes...</p>
|
||||
<h4>Definition</h4>
|
||||
<pre>
|
||||
typedef int (*cups_interpret_cb_t)(<a href='#cups_page_header2_t'>cups_page_header2_t</a> *header, int preferred_bits);
|
||||
</pre>
|
||||
<!-- NEW PAGE -->
|
||||
<h3 class='title'><span class='info'> CUPS 1.2 </span><a name='cups_page_header2_t'>cups_page_header2_t</a></h3>
|
||||
<h4>Description</h4>
|
||||
<p>Version 2 Page Header </p>
|
||||
@@ -554,14 +699,6 @@ struct cups_page_header_s
|
||||
typedef struct <a href='#cups_page_header2_s'>cups_page_header2_s</a> cups_page_header2_t;
|
||||
</pre>
|
||||
<!-- NEW PAGE -->
|
||||
<h3 class='title'><a name='cups_page_header_t'>cups_page_header_t</a></h3>
|
||||
<h4>Description</h4>
|
||||
<p>Version 1 Page Header</p>
|
||||
<h4>Definition</h4>
|
||||
<pre>
|
||||
typedef struct <a href='#cups_page_header_s'>cups_page_header_s</a> cups_page_header_t;
|
||||
</pre>
|
||||
<!-- NEW PAGE -->
|
||||
<h3 class='title'><a name='cups_raster_t'>cups_raster_t</a></h3>
|
||||
<h4>Description</h4>
|
||||
<p>Raster stream data</p>
|
||||
|
||||
@@ -22,12 +22,12 @@ Version 2, with exceptions for Apple operating systems and the
|
||||
OpenSSL toolkit. A copy of the exceptions and licenses follow
|
||||
this introduction.</P>
|
||||
|
||||
<P>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.</P>
|
||||
<P>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.</P>
|
||||
|
||||
<P>For those not familiar with the GNU GPL, the license basically
|
||||
allows you to:</P>
|
||||
@@ -42,25 +42,21 @@ allows you to:</P>
|
||||
<LI>Sell verbatim copies of the software for a media
|
||||
fee, or sell support for the software.</LI>
|
||||
|
||||
<LI>Distribute or sell printer drivers and filters that
|
||||
use CUPS so long as source code is made available under
|
||||
the GPL.</LI>
|
||||
|
||||
</UL>
|
||||
|
||||
<P>What this license <EM>does not</EM> 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
|
||||
new drivers, changes, or additions to the software, and all code
|
||||
must be provided under the GPL or LGPL as appropriate. The only
|
||||
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.</P>
|
||||
|
||||
<P>The GNU LGPL relaxes the "link-to" restriction, allowing you
|
||||
to develop applications that use the CUPS API library under other
|
||||
licenses and/or conditions as appropriate for your
|
||||
application.</P>
|
||||
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.</P>
|
||||
|
||||
|
||||
<H2 CLASS="title"><A NAME="EXCEPTIONS">License Exceptions</A></H2>
|
||||
@@ -150,7 +146,7 @@ same high-quality standards as the original.</P>
|
||||
|
||||
<P>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 drivers, additions, and
|
||||
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.</P>
|
||||
|
||||
|
||||
@@ -139,7 +139,10 @@ specifies a CIDR netmask, as shown in Table 1.</P>
|
||||
|
||||
<P>The <CODE>@LOCAL</CODE> name will allow access from all local
|
||||
interfaces. The <CODE>@IF(name)</CODE> name will allow access
|
||||
from the named interface.</P>
|
||||
from the named interface. In both cases, CUPS only allows access
|
||||
from the network that the interface(s) are configured for -
|
||||
requests arriving on the interface from a foreign network will
|
||||
<em>not</em> be accepted.</P>
|
||||
|
||||
<P>The <CODE>Allow</CODE> directive must appear inside a <A
|
||||
HREF="#Location"><CODE>Location</CODE></A> or <A
|
||||
@@ -353,7 +356,10 @@ or bit count.</P>
|
||||
|
||||
<P>The <CODE>@LOCAL</CODE> name will allow browse data from all
|
||||
local interfaces. The <CODE>@IF(name)</CODE> name will allow
|
||||
browse data from the named interface.</P>
|
||||
browse data from the named interface. In both cases, CUPS only
|
||||
allows data from the network that the interface(s) are configured
|
||||
for - data arriving on the interface from a foreign network will
|
||||
<em>not</em> be allowed.</P>
|
||||
|
||||
|
||||
<H2 CLASS="title"><A NAME="BrowseDeny">BrowseDeny</A></H2>
|
||||
@@ -388,7 +394,10 @@ or bit count.</P>
|
||||
|
||||
<P>The <CODE>@LOCAL</CODE> name will block browse data from all
|
||||
local interfaces. The <CODE>@IF(name)</CODE> name will block
|
||||
browse data from the named interface.</P>
|
||||
browse data from the named interface. In both cases, CUPS only
|
||||
blocks data from the network that the interface(s) are configured
|
||||
for - data arriving on the interface from a foreign network will
|
||||
<em>not</em> be blocked.</P>
|
||||
|
||||
|
||||
<H2 CLASS="title"><A NAME="BrowseInterval">BrowseInterval</A></H2>
|
||||
@@ -981,7 +990,10 @@ specifies a CIDR netmask, a shown in <A HREF="TABLE1">Table
|
||||
|
||||
<P>The <CODE>@LOCAL</CODE> name will deny access from all local
|
||||
interfaces. The <CODE>@IF(name)</CODE> name will deny access from
|
||||
the named interface.</P>
|
||||
the named interface. In both cases, CUPS only denies access from
|
||||
the network that the interface(s) are configured for - requests
|
||||
arriving on the interface from a foreign network will
|
||||
<em>not</em> be denied.</P>
|
||||
|
||||
<P>The <CODE>Deny</CODE> directive must appear inside a <A
|
||||
HREF="#Location"><CODE>Location</CODE></A> or <A
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<!--
|
||||
"$Id: spec-ppd.html 5496 2006-05-05 19:26:23Z mike $"
|
||||
"$Id: spec-ppd.html 6025 2006-10-11 14:59:20Z mike $"
|
||||
|
||||
CUPS PPD extensions specification for the Common UNIX Printing System (CUPS).
|
||||
|
||||
@@ -106,6 +106,21 @@ default value is <code>true</code>.</p>
|
||||
|
||||
<p>Also see the related <tt>cupsFlipDuplex</tt> attribute.</p>
|
||||
|
||||
<h3>cupsEvenDuplex</h3>
|
||||
|
||||
<p class='summary'>*cupsEvenDuplex: boolean</p>
|
||||
|
||||
<p>This boolean attribute notifies the RIP filters that the
|
||||
destination printer requires an even number of pages when 2-sided
|
||||
printing is selected. The default value is <code>false</code>.</p>
|
||||
|
||||
<p>Example:</p>
|
||||
|
||||
<pre class='command'>
|
||||
<em>*% Always send an even number of pages when duplexing</em>
|
||||
*cupsEvenDuplex: true
|
||||
</pre>
|
||||
|
||||
<h3>cupsFilter</h3>
|
||||
|
||||
<p class='summary'>*cupsFilter: "source/type cost program"</p>
|
||||
@@ -143,7 +158,8 @@ page. The default value is <code>false</code>.</p>
|
||||
*cupsFlipDuplex: true
|
||||
</pre>
|
||||
|
||||
<p>Also see the related <tt>APDuplexRequiresFlippedMargins</tt> attribute.</p>
|
||||
<p>Also see the related <tt>APDuplexRequiresFlippedMargins</tt>
|
||||
attribute.</p>
|
||||
|
||||
<h3>cupsIPPReason</h3>
|
||||
|
||||
|
||||
@@ -55,6 +55,6 @@ CUPS 1.1 or higher.</p>
|
||||
<h2 class='title'>Licensing</h2>
|
||||
|
||||
<p>The CUPS raster API is provided under the terms of the GNU
|
||||
General Public License, with exceptions for MacOS X-based
|
||||
Library General Public License, with exceptions for MacOS X-based
|
||||
programs. Please see the CUPS license agreement for more
|
||||
information.</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Common filter routines for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 1997-2005 by Easy Software Products.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
@@ -28,6 +28,7 @@
|
||||
* SetCommonOptions() - Set common filter options for media size,
|
||||
* etc.
|
||||
* UpdatePageVars() - Update the page variables for the orientation.
|
||||
* WriteComment() - Write a DSC comment.
|
||||
* WriteCommon() - Write common procedures...
|
||||
* WriteLabelProlog() - Write the prolog with the classification
|
||||
* and page label.
|
||||
@@ -46,30 +47,31 @@
|
||||
* Globals...
|
||||
*/
|
||||
|
||||
int Orientation = 0, /* 0 = portrait, 1 = landscape, etc. */
|
||||
Duplex = 0, /* Duplexed? */
|
||||
LanguageLevel = 1, /* Language level of printer */
|
||||
ColorDevice = 1; /* Do color text? */
|
||||
float PageLeft = 18.0f, /* Left margin */
|
||||
PageRight = 594.0f, /* Right margin */
|
||||
PageBottom = 36.0f, /* Bottom margin */
|
||||
PageTop = 756.0f, /* Top margin */
|
||||
PageWidth = 612.0f, /* Total page width */
|
||||
PageLength = 792.0f; /* Total page length */
|
||||
int Orientation = 0, /* 0 = portrait, 1 = landscape, etc. */
|
||||
Duplex = 0, /* Duplexed? */
|
||||
LanguageLevel = 1, /* Language level of printer */
|
||||
ColorDevice = 1; /* Do color text? */
|
||||
float PageLeft = 18.0f, /* Left margin */
|
||||
PageRight = 594.0f, /* Right margin */
|
||||
PageBottom = 36.0f, /* Bottom margin */
|
||||
PageTop = 756.0f, /* Top margin */
|
||||
PageWidth = 612.0f, /* Total page width */
|
||||
PageLength = 792.0f; /* Total page length */
|
||||
|
||||
|
||||
/*
|
||||
* 'SetCommonOptions()' - Set common filter options for media size, etc.
|
||||
*/
|
||||
|
||||
ppd_file_t * /* O - PPD file */
|
||||
SetCommonOptions(int num_options, /* I - Number of options */
|
||||
cups_option_t *options, /* I - Options */
|
||||
int change_size) /* I - Change page size? */
|
||||
ppd_file_t * /* O - PPD file */
|
||||
SetCommonOptions(
|
||||
int num_options, /* I - Number of options */
|
||||
cups_option_t *options, /* I - Options */
|
||||
int change_size) /* I - Change page size? */
|
||||
{
|
||||
ppd_file_t *ppd; /* PPD file */
|
||||
ppd_size_t *pagesize; /* Current page size */
|
||||
const char *val; /* Option value */
|
||||
ppd_file_t *ppd; /* PPD file */
|
||||
ppd_size_t *pagesize; /* Current page size */
|
||||
const char *val; /* Option value */
|
||||
|
||||
|
||||
#ifdef LC_TIME
|
||||
@@ -227,7 +229,7 @@ SetCommonOptions(int num_options, /* I - Number of options */
|
||||
void
|
||||
UpdatePageVars(void)
|
||||
{
|
||||
float temp; /* Swapping variable */
|
||||
float temp; /* Swapping variable */
|
||||
|
||||
|
||||
switch (Orientation & 3)
|
||||
@@ -466,6 +468,77 @@ WriteLabels(int orient) /* I - Orientation of the page */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'WriteTextComment()' - Write a DSC text comment.
|
||||
*/
|
||||
|
||||
void
|
||||
WriteTextComment(const char *name, /* I - Comment name ("Title", etc.) */
|
||||
const char *value) /* I - Comment value */
|
||||
{
|
||||
int len; /* Current line length */
|
||||
|
||||
|
||||
/*
|
||||
* DSC comments are of the form:
|
||||
*
|
||||
* %%name: value
|
||||
*
|
||||
* The name and value must be limited to 7-bit ASCII for most printers,
|
||||
* so we escape all non-ASCII and ASCII control characters as described
|
||||
* in the Adobe Document Structuring Conventions specification.
|
||||
*/
|
||||
|
||||
printf("%%%%%s: (", name);
|
||||
len = 5 + strlen(name);
|
||||
|
||||
while (*value)
|
||||
{
|
||||
if (*value < ' ' || *value >= 127)
|
||||
{
|
||||
/*
|
||||
* Escape this character value...
|
||||
*/
|
||||
|
||||
if (len >= 251) /* Keep line < 254 chars */
|
||||
break;
|
||||
|
||||
printf("\\%03o", *value & 255);
|
||||
len += 4;
|
||||
}
|
||||
else if (*value == '\\')
|
||||
{
|
||||
/*
|
||||
* Escape the backslash...
|
||||
*/
|
||||
|
||||
if (len >= 253) /* Keep line < 254 chars */
|
||||
break;
|
||||
|
||||
putchar('\\');
|
||||
putchar('\\');
|
||||
len += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Put this character literally...
|
||||
*/
|
||||
|
||||
if (len >= 254) /* Keep line < 254 chars */
|
||||
break;
|
||||
|
||||
putchar(*value);
|
||||
len ++;
|
||||
}
|
||||
|
||||
value ++;
|
||||
}
|
||||
|
||||
puts(")");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Common filter definitions for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 1997-2005 by Easy Software Products.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
@@ -76,6 +76,7 @@ extern void WriteCommon(void);
|
||||
extern void WriteLabelProlog(const char *label, float bottom,
|
||||
float top, float width);
|
||||
extern void WriteLabels(int orient);
|
||||
extern void WriteTextComment(const char *name, const char *value);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -70,8 +70,8 @@ OutputProlog(char *title, /* I - Job title */
|
||||
puts("%%Creator: hpgltops/" CUPS_SVERSION);
|
||||
strftime(line, sizeof(line), "%c", curtm);
|
||||
printf("%%%%CreationDate: %s\n", line);
|
||||
printf("%%%%Title: %s\n", title);
|
||||
printf("%%%%For: %s\n", user);
|
||||
WriteTextComment("Title", title);
|
||||
WriteTextComment("For", user);
|
||||
printf("%%cupsRotation: %d\n", (Orientation & 3) * 90);
|
||||
puts("%%EndComments");
|
||||
puts("%%BeginProlog");
|
||||
|
||||
@@ -609,8 +609,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
puts("%%Creator: imagetops/" CUPS_SVERSION);
|
||||
strftime(curdate, sizeof(curdate), "%c", curtm);
|
||||
printf("%%%%CreationDate: %s\n", curdate);
|
||||
printf("%%%%Title: %s\n", argv[3]);
|
||||
printf("%%%%For: %s\n", argv[2]);
|
||||
WriteTextComment("Title", argv[3]);
|
||||
WriteTextComment("For", argv[2]);
|
||||
if (Orientation & 1)
|
||||
puts("%%Orientation: Landscape");
|
||||
else
|
||||
|
||||
@@ -163,8 +163,8 @@ static int check_range(pstops_doc_t *doc, int page);
|
||||
static void copy_bytes(cups_file_t *fp, off_t offset,
|
||||
size_t length);
|
||||
static size_t copy_comments(cups_file_t *fp, pstops_doc_t *doc,
|
||||
char *line, size_t linelen,
|
||||
size_t linesize);
|
||||
ppd_file_t *ppd, char *line,
|
||||
size_t linelen, size_t linesize);
|
||||
static void copy_dsc(cups_file_t *fp, pstops_doc_t *doc,
|
||||
ppd_file_t *ppd, char *line, size_t linelen,
|
||||
size_t linesize);
|
||||
@@ -542,6 +542,7 @@ copy_bytes(cups_file_t *fp, /* I - File to read from */
|
||||
static size_t /* O - Length of next line */
|
||||
copy_comments(cups_file_t *fp, /* I - File to read from */
|
||||
pstops_doc_t *doc, /* I - Document info */
|
||||
ppd_file_t *ppd, /* I - PPD file */
|
||||
char *line, /* I - Line buffer */
|
||||
size_t linelen, /* I - Length of initial line */
|
||||
size_t linesize) /* I - Size of line buffer */
|
||||
@@ -589,10 +590,53 @@ copy_comments(cups_file_t *fp, /* I - File to read from */
|
||||
|
||||
if (!strncmp(line, "%%Pages:", 8))
|
||||
{
|
||||
int pages; /* Number of pages */
|
||||
|
||||
|
||||
if (saw_pages)
|
||||
fputs("ERROR: Duplicate %%Pages: comment seen!\n", stderr);
|
||||
|
||||
saw_pages = 1;
|
||||
|
||||
if (Duplex && (pages = atoi(line + 8)) > 0 && pages <= doc->number_up)
|
||||
{
|
||||
/*
|
||||
* Since we will only be printing on a single page, disable duplexing.
|
||||
*/
|
||||
|
||||
Duplex = 0;
|
||||
doc->slow_duplex = 0;
|
||||
|
||||
if (cupsGetOption("sides", doc->num_options, doc->options))
|
||||
doc->num_options = cupsAddOption("sides", "one-sided",
|
||||
doc->num_options, &(doc->options));
|
||||
|
||||
if (cupsGetOption("Duplex", doc->num_options, doc->options))
|
||||
doc->num_options = cupsAddOption("Duplex", "None",
|
||||
doc->num_options, &(doc->options));
|
||||
|
||||
if (cupsGetOption("EFDuplex", doc->num_options, doc->options))
|
||||
doc->num_options = cupsAddOption("EFDuplex", "None",
|
||||
doc->num_options, &(doc->options));
|
||||
|
||||
if (cupsGetOption("EFDuplexing", doc->num_options, doc->options))
|
||||
doc->num_options = cupsAddOption("EFDuplexing", "False",
|
||||
doc->num_options, &(doc->options));
|
||||
|
||||
if (cupsGetOption("KD03Duplex", doc->num_options, doc->options))
|
||||
doc->num_options = cupsAddOption("KD03Duplex", "None",
|
||||
doc->num_options, &(doc->options));
|
||||
|
||||
if (cupsGetOption("JCLDuplex", doc->num_options, doc->options))
|
||||
doc->num_options = cupsAddOption("JCLDuplex", "None",
|
||||
doc->num_options, &(doc->options));
|
||||
|
||||
ppdMarkOption(ppd, "Duplex", "None");
|
||||
ppdMarkOption(ppd, "EFDuplex", "None");
|
||||
ppdMarkOption(ppd, "EFDuplexing", "False");
|
||||
ppdMarkOption(ppd, "KD03Duplex", "None");
|
||||
ppdMarkOption(ppd, "JCLDuplex", "None");
|
||||
}
|
||||
}
|
||||
else if (!strncmp(line, "%%BoundingBox:", 14))
|
||||
{
|
||||
@@ -666,10 +710,10 @@ copy_comments(cups_file_t *fp, /* I - File to read from */
|
||||
fputs("ERROR: No %%Pages: comment in header!\n", stderr);
|
||||
|
||||
if (!saw_for)
|
||||
printf("%%%%For: %s\n", doc->user);
|
||||
WriteTextComment("For", doc->user);
|
||||
|
||||
if (!saw_title)
|
||||
printf("%%%%Title: %s\n", doc->title);
|
||||
WriteTextComment("Title", doc->title);
|
||||
|
||||
if (doc->copies != 1 && (!doc->collate || !doc->slow_collate))
|
||||
{
|
||||
@@ -745,7 +789,7 @@ copy_dsc(cups_file_t *fp, /* I - File to read from */
|
||||
*/
|
||||
|
||||
fprintf(stderr, "DEBUG: Before copy_comments - %s", line);
|
||||
linelen = copy_comments(fp, doc, line, linelen, linesize);
|
||||
linelen = copy_comments(fp, doc, ppd, line, linelen, linesize);
|
||||
|
||||
/*
|
||||
* Now find the prolog section, if any...
|
||||
@@ -860,6 +904,33 @@ copy_dsc(cups_file_t *fp, /* I - File to read from */
|
||||
|
||||
for (copy = !doc->slow_order; copy < doc->copies; copy ++)
|
||||
{
|
||||
/*
|
||||
* Send end-of-job stuff followed by any start-of-job stuff required
|
||||
* for the JCL options...
|
||||
*/
|
||||
|
||||
if (!doc->saw_eof)
|
||||
puts("%%EOF");
|
||||
|
||||
if (doc->emit_jcl)
|
||||
{
|
||||
if (ppd && ppd->jcl_end)
|
||||
ppdEmitJCLEnd(ppd, stdout);
|
||||
else
|
||||
putchar(0x04);
|
||||
|
||||
ppdEmitJCL(ppd, stdout, doc->job_id, doc->user, doc->title);
|
||||
}
|
||||
|
||||
puts("%!PS-Adobe-3.0");
|
||||
puts("%%Pages: (atend)");
|
||||
puts("%%BoundingBox: (atend)");
|
||||
puts("%%EndComments");
|
||||
|
||||
/*
|
||||
* Then copy all of the pages...
|
||||
*/
|
||||
|
||||
pageinfo = doc->slow_order ? (pstops_page_t *)cupsArrayLast(doc->pages) :
|
||||
(pstops_page_t *)cupsArrayFirst(doc->pages);
|
||||
|
||||
@@ -946,8 +1017,8 @@ copy_non_dsc(cups_file_t *fp, /* I - File to read from */
|
||||
else
|
||||
puts("%%Pages: 1");
|
||||
|
||||
printf("%%%%For: %s\n", doc->user);
|
||||
printf("%%%%Title: %s\n", doc->title);
|
||||
WriteTextComment("For", doc->user);
|
||||
WriteTextComment("Title", doc->title);
|
||||
|
||||
if (doc->copies != 1 && (!doc->collate || !doc->slow_collate))
|
||||
{
|
||||
@@ -1868,7 +1939,7 @@ static void
|
||||
end_nup(pstops_doc_t *doc, /* I - Document information */
|
||||
int number) /* I - Page number */
|
||||
{
|
||||
if (doc->mirror || Orientation || doc->number_up > 1)
|
||||
if (doc->number_up > 1)
|
||||
doc_puts(doc, "userdict/ESPsave get restore\n");
|
||||
|
||||
switch (doc->number_up)
|
||||
@@ -2407,7 +2478,7 @@ set_pstops_options(
|
||||
* turn the hardware collate option off...
|
||||
*/
|
||||
|
||||
if ((option = ppdFindOption(ppd, "Option")) != NULL &&
|
||||
if ((option = ppdFindOption(ppd, "Collate")) != NULL &&
|
||||
!option->conflicted)
|
||||
doc->slow_collate = 0;
|
||||
else
|
||||
@@ -2422,7 +2493,10 @@ set_pstops_options(
|
||||
else
|
||||
doc->slow_order = 0;
|
||||
|
||||
if ((doc->slow_collate || doc->slow_order) && Duplex)
|
||||
if (Duplex &&
|
||||
(doc->slow_collate || doc->slow_order ||
|
||||
((attr = ppdFindAttr(ppd, "cupsEvenDuplex", NULL)) != NULL &&
|
||||
attr->value && !strcasecmp(attr->value, "true"))))
|
||||
doc->slow_duplex = 1;
|
||||
else
|
||||
doc->slow_duplex = 0;
|
||||
@@ -2543,7 +2617,7 @@ start_nup(pstops_doc_t *doc, /* I - Document information */
|
||||
bboxl; /* BoundingBox height */
|
||||
|
||||
|
||||
if (doc->mirror || Orientation || doc->number_up > 1)
|
||||
if (doc->number_up > 1)
|
||||
doc_puts(doc, "userdict/ESPsave save put\n");
|
||||
|
||||
if (doc->mirror)
|
||||
|
||||