1 diff -durN release-1.2.1/backend/backend-private.h cups-1.2.x/backend/backend-private.h
2 --- release-1.2.1/backend/backend-private.h 1970-01-01 01:00:00.000000000 +0100
3 +++ cups-1.2.x/backend/backend-private.h 2006-06-26 12:42:40.000000000 +0100
8 + * Backend support definitions for the Common UNIX Printing System (CUPS).
10 + * Copyright 1997-2006 by Easy Software Products, all rights reserved.
12 + * These coded instructions, statements, and computer programs are the
13 + * property of Easy Software Products and are protected by Federal
14 + * copyright law. Distribution and use rights are outlined in the file
15 + * "LICENSE" which should have been included with this file. If this
16 + * file is missing or damaged please contact Easy Software Products
19 + * Attn: CUPS Licensing Information
20 + * Easy Software Products
21 + * 44141 Airport View Drive, Suite 204
22 + * Hollywood, Maryland 20636 USA
24 + * Voice: (301) 373-9600
25 + * EMail: cups-info@cups.org
26 + * WWW: http://www.cups.org
28 + * This file is subject to the Apple OS-Developed Software exception.
31 +#ifndef _CUPS_BACKEND_PRIVATE_H_
32 +# define _CUPS_BACKEND_PRIVATE_H_
36 + * Include necessary headers.
39 +# include <cups/backend.h>
40 +# include <cups/cups.h>
41 +# include <cups/debug.h>
44 +# include <cups/string.h>
54 +# endif /* _cplusplus */
61 +extern int backendGetDeviceID(int fd, char *device_id, int device_id_size,
62 + char *make_model, int make_model_size,
63 + const char *scheme, char *uri, int uri_size);
64 +extern int backendGetMakeModel(const char *device_id, char *make_model,
65 + int make_model_size);
66 +extern ssize_t backendRunLoop(int print_fd, int device_fd, int use_bc);
71 +# endif /* _cplusplus */
72 +#endif /* !_CUPS_BACKEND_PRIVATE_H_ */
78 diff -durN release-1.2.1/backend/Dependencies cups-1.2.x/backend/Dependencies
79 --- release-1.2.1/backend/Dependencies 2006-07-04 17:32:11.000000000 +0100
80 +++ cups-1.2.x/backend/Dependencies 2006-06-26 12:42:40.000000000 +0100
82 lpd.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/cups.h
83 lpd.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
84 lpd.o: ../cups/string.h
85 -parallel.o: ../cups/backend.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
86 -parallel.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
87 -parallel.o: ../cups/language.h ../cups/string.h ../config.h ieee1284.c
88 -parallel.o: ../cups/debug.h
89 +pap.o: ../cups/http.h ../cups/md5.h
90 +parallel.o: backend-private.h ../cups/backend.h ../cups/cups.h ../cups/ipp.h
91 +parallel.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
92 +parallel.o: ../cups/file.h ../cups/language.h ../cups/debug.h
93 +parallel.o: ../cups/string.h ../config.h
94 scsi.o: ../cups/backend.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
95 scsi.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
96 scsi.o: ../cups/language.h ../cups/string.h ../config.h
97 -serial.o: ../cups/backend.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
98 -serial.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
99 -serial.o: ../cups/language.h ../cups/string.h ../config.h
100 -snmp.o: ../cups/backend.h ../cups/http-private.h ../config.h ../cups/http.h
101 -snmp.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/cups.h
102 -snmp.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
103 -snmp.o: ../cups/string.h ../cups/array.h ../cups/file.h ieee1284.c
104 -snmp.o: ../cups/debug.h
105 -socket.o: ../cups/backend.h ../cups/http-private.h ../config.h ../cups/http.h
106 -socket.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/cups.h
107 -socket.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
108 -socket.o: ../cups/string.h
109 -test1284.o: ../cups/string.h ../config.h ieee1284.c ../cups/debug.h
110 +serial.o: backend-private.h ../cups/backend.h ../cups/cups.h ../cups/ipp.h
111 +serial.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h
112 +serial.o: ../cups/file.h ../cups/language.h ../cups/debug.h ../cups/string.h
113 +serial.o: ../config.h
114 +snmp.o: ../cups/http-private.h ../config.h ../cups/http.h ../cups/md5.h
115 +snmp.o: ../cups/ipp-private.h ../cups/ipp.h backend-private.h
116 +snmp.o: ../cups/backend.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
117 +snmp.o: ../cups/file.h ../cups/language.h ../cups/debug.h ../cups/string.h
118 +snmp.o: ../cups/array.h ../cups/file.h
119 +socket.o: ../cups/http-private.h ../config.h ../cups/http.h ../cups/md5.h
120 +socket.o: ../cups/ipp-private.h ../cups/ipp.h backend-private.h
121 +socket.o: ../cups/backend.h ../cups/cups.h ../cups/ppd.h ../cups/array.h
122 +socket.o: ../cups/file.h ../cups/language.h ../cups/debug.h ../cups/string.h
123 +test1284.o: ../cups/string.h ../config.h ieee1284.c backend-private.h
124 +test1284.o: ../cups/backend.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
125 +test1284.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
126 +test1284.o: ../cups/language.h ../cups/debug.h
127 usb.o: ../cups/backend.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
128 usb.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
129 usb.o: ../cups/language.h ../cups/string.h ../config.h
130 diff -durN release-1.2.1/backend/easysw-firewire-design.txt cups-1.2.x/backend/easysw-firewire-design.txt
131 --- release-1.2.1/backend/easysw-firewire-design.txt 2006-07-04 17:32:11.000000000 +0100
132 +++ cups-1.2.x/backend/easysw-firewire-design.txt 1970-01-01 01:00:00.000000000 +0100
134 -Preliminary Design for CUPS Firewire Printer Backend - 03/19/2002
135 ------------------------------------------------------------------
139 - Easy Software Products will develop an IEEE-1394, a.k.a.
140 - Firewire, printing interface for its Common UNIX Printing
141 - System ("CUPS") for initial use under the Linux operating
142 - system. A follow-on implementation for MacOS X is
143 - anticipated as well.
145 - The operating system interfaces for IEEE-1394 ports vary
146 - widely; the CUPS printing interface will abstract the OS
147 - layer to a simpler interface geared towards discovering,
148 - opening, reading from, writing to, and closing IEEE-1394
151 - The initial development of the CUPS backend will be targeted
152 - at the EPSON Stylus Pro 10000 large format printer, which
153 - requires the bandwidth provided by Firewire in order to
154 - print at full speed. This printer supports printing via
155 - Serial Bus Protocol 2 (SBP-2) using the SCSI and PWG command
156 - sets. The CUPS backend will implement the PWG command set on
160 -OS ABSTRACTION LAYER
162 - The OS abstraction layer will be a thin client library that
163 - implements the following functions:
172 - The "ieee1394_list" function will list all of the available
173 - printer devices on the bus. The device information will
174 - consist of the device URI (ieee1394:/something) used to
175 - access the device and the make and model information, if
176 - available, for the device ("EPSON Stylus Printer").
178 - The "ieee1394_open" and "ieee1394_close" functions will open
179 - and close a connection to the printer, respectively.
181 - The "ieee1394_read" and "ieee1394_write" functions will read
182 - and write data to and from the printer, respectively. The
183 - read function will be non-blocking, returning data only if
184 - there is data coming back from the printer.
186 - The "ieee1394_error" function will return a string
187 - describing the last error or NULL if no error occurred.
189 - The library will be responsible for creating any background
190 - threads that are needed to monitor the connection to the
196 - The CUPS backend will use the OS abstraction layer to list
197 - and access the Firewire printers. The "main" function will
198 - read and write printer data, while the "list_devices"
199 - function will be called as necessary to identify the
202 - The CUPS 1.1 backend will record any status information in
203 - the error log file, while the 1.2 backend will supply it to
204 - the printer driver process.
205 diff -durN release-1.2.1/backend/easysw-firewire-linux.txt cups-1.2.x/backend/easysw-firewire-linux.txt
206 --- release-1.2.1/backend/easysw-firewire-linux.txt 2006-07-04 17:32:11.000000000 +0100
207 +++ cups-1.2.x/backend/easysw-firewire-linux.txt 1970-01-01 01:00:00.000000000 +0100
209 -Easy Software Products
210 -44141 Airport View Drive
212 -Hollywood, Maryland 20636
217 -Subject: EPSON Firewire Printer Driver for Linux
219 -Currently, no Firewire printer support exists for Linux. Since
220 -the latest EPSON printer products depend on the Firewire
221 -interface to print at full speed, a solution is needed to
222 -support customers using Linux as their server platform.
224 -The Linux Firewire subsystem provides a user-mode driver
225 -interface that allows driver programs to access Firewire
226 -devices. Easy Software Products will utilize this interface to
227 -develop a "backend" program for the Common UNIX Printing System
228 -that will allow users to print to EPSON printers using the
231 -After examining the Linux interface, we estimate that it will
232 -require approximately 30 hours of development time to write,
233 -test, and document the Firewire backend, for a total cost of
234 -$3,000. The new backend will become a standard part of the CUPS
235 -software distribution and will be included with at least the
236 -following Linux distributions:
243 -ESP will provide EPSON with binaries for Red Hat Linux 7.2.
244 diff -durN release-1.2.1/backend/ieee1284.c cups-1.2.x/backend/ieee1284.c
245 --- release-1.2.1/backend/ieee1284.c 2006-07-04 17:32:11.000000000 +0100
246 +++ cups-1.2.x/backend/ieee1284.c 2006-06-26 12:42:40.000000000 +0100
252 * IEEE-1284 support functions for the Common UNIX Printing System (CUPS).
258 - * get_device_id() - Get the IEEE-1284 device ID string and corresponding
260 - * get_make_model() - Get the make and model string from the device ID.
261 + * backendGetDeviceID() - Get the IEEE-1284 device ID string and
262 + * corresponding URI.
263 + * backendGetMakeModel() - Get the make and model string from the device ID.
267 * Include necessary headers.
270 -#include <cups/debug.h>
272 +#include "backend-private.h"
278 +# include <sys/ioctl.h>
279 +# include <linux/lp.h>
280 +# define IOCNR_GET_DEVICE_ID 1
281 +# define LPIOC_GET_DEVICE_ID(len) _IOC(_IOC_READ, 'P', IOCNR_GET_DEVICE_ID, len)
282 +#endif /* __linux */
284 -static int get_make_model(const char *device_id, char *make_model,
285 - int make_model_size);
288 +# include <sys/ecppio.h>
290 +# include <sys/ioccom.h>
291 +# include <sys/ecppsys.h>
292 +# endif /* __sparc */
297 - * 'get_device_id()' - Get the IEEE-1284 device ID string and
298 - * corresponding URI.
299 + * 'backendGetDeviceID()' - Get the IEEE-1284 device ID string and
300 + * corresponding URI.
303 -#ifndef SNMP_BACKEND
305 -# include <sys/ioctl.h>
306 -# include <linux/lp.h>
307 -# define IOCNR_GET_DEVICE_ID 1
308 -# define LPIOC_GET_DEVICE_ID(len) _IOC(_IOC_READ, 'P', IOCNR_GET_DEVICE_ID, len)
309 -# endif /* __linux */
313 -# include <sys/ecppio.h>
315 -# include <sys/ioccom.h>
316 -# include <sys/ecppsys.h>
317 -# endif /* __sparc */
321 int /* O - 0 on success, -1 on failure */
324 int fd, /* I - File descriptor */
325 char *device_id, /* O - 1284 device ID */
326 int device_id_size, /* I - Size of buffer */
328 #endif /* __sun && ECPPIOC_GETDEVID */
331 - DEBUG_printf(("get_device_id(fd=%d, device_id=%p, device_id_size=%d, "
332 + DEBUG_printf(("backendGetDeviceID(fd=%d, device_id=%p, device_id_size=%d, "
333 "make_model=%p, make_model_size=%d, scheme=\"%s\", "
334 "uri=%p, uri_size=%d)\n", fd, device_id, device_id_size,
335 make_model, make_model_size, scheme ? scheme : "(null)",
337 !device_id || device_id_size < 32 ||
338 !make_model || make_model_size < 32)
340 - DEBUG_puts("get_device_id: Bad args!");
341 + DEBUG_puts("backendGetDeviceID: Bad args!");
349 - printf("get_device_id: ioctl failed - %s\n", strerror(errno));
350 + printf("backendGetDeviceID: ioctl failed - %s\n", strerror(errno));
354 @@ -178,11 +168,11 @@
358 - printf("get_device_id: ioctl failed - %s\n", strerror(errno));
359 + printf("backendGetDeviceID: ioctl failed - %s\n", strerror(errno));
361 #endif /* __sun && ECPPIOC_GETDEVID */
363 - DEBUG_printf(("get_device_id: device_id=\"%s\"\n", device_id));
364 + DEBUG_printf(("backendGetDeviceID: device_id=\"%s\"\n", device_id));
369 * Get the make and model...
372 - get_make_model(device_id, make_model, make_model_size);
373 + backendGetMakeModel(device_id, make_model, make_model_size);
376 * Then generate a device URI...
377 @@ -303,15 +293,14 @@
381 -#endif /* !SNMP_BACKEND */
385 - * 'get_make_model()' - Get the make and model string from the device ID.
386 + * 'backendGetMakeModel()' - Get the make and model string from the device ID.
389 int /* O - 0 on success, -1 on failure */
391 +backendGetMakeModel(
392 const char *device_id, /* O - 1284 device ID */
393 char *make_model, /* O - Make/model */
394 int make_model_size) /* I - Size of buffer */
396 *mdl; /* Model string */
399 - DEBUG_printf(("get_make_model(device_id=\"%s\", "
400 + DEBUG_printf(("backendGetMakeModel(device_id=\"%s\", "
401 "make_model=%p, make_model_size=%d)\n", device_id,
402 make_model, make_model_size));
406 if (!device_id || !*device_id || !make_model || make_model_size < 32)
408 - DEBUG_puts("get_make_model: Bad args!");
409 + DEBUG_puts("backendGetMakeModel: Bad args!");
420 diff -durN release-1.2.1/backend/ieee1394.c cups-1.2.x/backend/ieee1394.c
421 --- release-1.2.1/backend/ieee1394.c 2006-07-04 17:32:11.000000000 +0100
422 +++ cups-1.2.x/backend/ieee1394.c 1970-01-01 01:00:00.000000000 +0100
427 - * IEEE-1394 backend for the Common UNIX Printing System (CUPS).
429 - * Copyright 2002 by Easy Software Products, all rights reserved.
431 - * Redistribution and use in source and binary forms, with or
432 - * without modification, are permitted provided that the
433 - * following conditions are met:
435 - * 1. Redistributions of source code must retain the above
436 - * copyright notice, this list of conditions and the
437 - * following disclaimer.
439 - * 2. Redistributions in binary form must reproduce the
440 - * above copyright notice, this list of conditions and
441 - * the following disclaimer in the documentation and/or
442 - * other materials provided with the distribution.
444 - * 3. All advertising materials mentioning features or use
445 - * of this software must display the following
448 - * This product includes software developed by Easy
449 - * Software Products.
451 - * 4. The name of Easy Software Products may not be used to
452 - * endorse or promote products derived from this software
453 - * without specific prior written permission.
455 - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS
456 - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
457 - * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
458 - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
459 - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
460 - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
461 - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
462 - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
463 - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
464 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
465 - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
466 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
467 - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
472 - * main() - Send a file to the printer.
473 - * list_devices() - List all known printer devices...
477 - * Include necessary headers.
480 -#include "ieee1394.h"
484 - * Local functions...
487 -void list_devices(void);
491 - * 'main()' - Send a file to the printer.
495 - * printer-uri job-id user title copies options [file]
498 -int /* O - Exit status */
499 -main(int argc, /* I - Number of command-line arguments (6 or 7) */
500 - char *argv[]) /* I - Command-line arguments */
502 - ieee1394_dev_t dev; /* Printer device */
503 - int fp; /* Print file */
504 - int copies; /* Number of copies to print */
505 - int rbytes; /* Number of bytes read from device */
506 - size_t nbytes, /* Number of bytes read from file */
507 - tbytes; /* Total number of bytes written */
508 - char buffer[8192]; /* Input/output buffer */
509 -#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
510 - struct sigaction action; /* Actions for POSIX signals */
511 -#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
515 - * Make sure status messages are not buffered...
518 - setbuf(stderr, NULL);
521 - * Check command-line...
530 - else if (argc < 6 || argc > 7)
532 - fprintf(stderr, "Usage: %s job-id user title copies options [file]\n",
538 - * If we have 7 arguments, print the file named on the command-line.
539 - * Otherwise, send stdin instead...
550 - * Try to open the print file...
553 - if ((fp = open(argv[6], O_RDONLY)) < 0)
555 - perror("ERROR: unable to open print file");
559 - copies = atoi(argv[4]);
563 - * Try to open the printer device...
566 - fputs("STATE: +connecting-to-device\n", stderr);
570 - if ((dev = ieee1394_open(argv[0])) == NULL)
572 - fputs("INFO: Firewire printer busy; will retry in 30 seconds...\n", stderr);
576 - while (dev == NULL);
578 - fputs("STATE: -connecting-to-device\n", stderr);
581 - * Now that we are "connected" to the port, ignore SIGTERM so that we
582 - * can finish out any page data the driver sends (e.g. to eject the
583 - * current page... Only ignore SIGTERM if we are printing data from
584 - * stdin (otherwise you can't cancel raw jobs...)
589 -#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
590 - sigset(SIGTERM, SIG_IGN);
591 -#elif defined(HAVE_SIGACTION)
592 - memset(&action, 0, sizeof(action));
594 - sigemptyset(&action.sa_mask);
595 - action.sa_handler = SIG_IGN;
596 - sigaction(SIGTERM, &action, NULL);
598 - signal(SIGTERM, SIG_IGN);
599 -#endif /* HAVE_SIGSET */
603 - * Finally, send the print file...
612 - fputs("PAGE: 1 1\n", stderr);
613 - lseek(fp, 0, SEEK_SET);
617 - while ((nbytes = read(fp, buffer, sizeof(buffer))) > 0)
620 - * Write the print data to the printer...
625 - if (ieee1394_write(dev, buffer, nbytes) < 0)
627 - perror("ERROR: Unable to send print file to printer");
631 - if ((rbytes = ieee1394_read(dev, buffer, sizeof(buffer))) > 0)
632 - fprintf(stderr, "INFO: Read %d bytes from printer...\n", rbytes);
635 - fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
636 - (unsigned long)tbytes);
641 - * Close the printer device and input file and return...
644 - ieee1394_close(dev);
649 - fputs("INFO: Ready to print.\n", stderr);
656 - * 'list_devices()' - List all known devices...
662 - int i, /* Looping var */
663 - num_info; /* Number of devices */
664 - ieee1394_info_t *info; /* Devices... */
668 - * Get the available devices...
671 - info = ieee1394_list(&num_info);
674 - * List them as needed...
679 - for (i = 0; i < num_info; i ++)
680 - printf("direct %s \"%s\" \"%s\"\n", info[i].uri,
681 - info[i].make_model, info[i].description);
691 diff -durN release-1.2.1/backend/ieee1394.h cups-1.2.x/backend/ieee1394.h
692 --- release-1.2.1/backend/ieee1394.h 2006-07-04 17:32:11.000000000 +0100
693 +++ cups-1.2.x/backend/ieee1394.h 1970-01-01 01:00:00.000000000 +0100
698 - * IEEE-1394 header for the Common UNIX Printing System (CUPS).
700 - * Copyright 2002 by Easy Software Products, all rights reserved.
702 - * Redistribution and use in source and binary forms, with or
703 - * without modification, are permitted provided that the
704 - * following conditions are met:
706 - * 1. Redistributions of source code must retain the above
707 - * copyright notice, this list of conditions and the
708 - * following disclaimer.
710 - * 2. Redistributions in binary form must reproduce the
711 - * above copyright notice, this list of conditions and
712 - * the following disclaimer in the documentation and/or
713 - * other materials provided with the distribution.
715 - * 3. All advertising materials mentioning features or use
716 - * of this software must display the following
719 - * This product includes software developed by Easy
720 - * Software Products.
722 - * 4. The name of Easy Software Products may not be used to
723 - * endorse or promote products derived from this software
724 - * without specific prior written permission.
726 - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS
727 - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
728 - * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
729 - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
730 - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
731 - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
732 - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
733 - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
734 - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
735 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
736 - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
737 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
738 - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
743 - * Include necessary headers.
746 -#include <cups/cups.h>
750 -#include <cups/string.h>
752 -#include <sys/types.h>
753 -#include <sys/stat.h>
759 -# include <unistd.h>
765 - * Device information structure...
770 - char uri[HTTP_MAX_URI], /* Device URI */
771 - description[128], /* Description of port */
772 - make_model[128]; /* Make and model */
777 - * Private device connection information...
780 -typedef void *ieee1394_dev_t;
784 - * Prototypes for standard IEEE-1394 interface...
787 -extern ieee1394_info_t *ieee1394_list(int *num_devices);
788 -extern ieee1394_dev_t ieee1394_open(const char *uri);
789 -extern int ieee1394_close(ieee1394_dev_t dev);
790 -extern int ieee1394_read(ieee1394_dev_t dev, char *buffer, int len);
791 -extern int ieee1394_write(ieee1394_dev_t dev, char *buffer, int len);
792 -extern const char *ieee1394_error(void);
798 diff -durN release-1.2.1/backend/ieee1394-linux.c cups-1.2.x/backend/ieee1394-linux.c
799 --- release-1.2.1/backend/ieee1394-linux.c 2006-07-04 17:32:11.000000000 +0100
800 +++ cups-1.2.x/backend/ieee1394-linux.c 1970-01-01 01:00:00.000000000 +0100
805 - * Linux IEEE-1394 glue for the Common UNIX Printing System (CUPS).
807 - * Copyright 2002 by Easy Software Products, all rights reserved.
809 - * Redistribution and use in source and binary forms, with or
810 - * without modification, are permitted provided that the
811 - * following conditions are met:
813 - * 1. Redistributions of source code must retain the above
814 - * copyright notice, this list of conditions and the
815 - * following disclaimer.
817 - * 2. Redistributions in binary form must reproduce the
818 - * above copyright notice, this list of conditions and
819 - * the following disclaimer in the documentation and/or
820 - * other materials provided with the distribution.
822 - * 3. All advertising materials mentioning features or use
823 - * of this software must display the following
826 - * This product includes software developed by Easy
827 - * Software Products.
829 - * 4. The name of Easy Software Products may not be used to
830 - * endorse or promote products derived from this software
831 - * without specific prior written permission.
833 - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS
834 - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
835 - * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
836 - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
837 - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
838 - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
839 - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
840 - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
841 - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
842 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
843 - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
844 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
845 - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
850 - * get_device_id() - Get the IEEE-1284 device ID for a node...
851 - * get_unit_type() - Get the unit type for a node...
852 - * show_data() - Show a data node...
853 - * show_dir() - Show a directory list...
854 - * ieee1394_list() - List the available printer devices.
855 - * ieee1394_open() - Open a printer device.
856 - * ieee1394_close() - Close a printer device.
857 - * ieee1394_read() - Read from a printer device.
858 - * ieee1394_write() - Write data to a printer device.
859 - * ieee1394_error() - Return the last error.
863 - * Include necessary headers.
866 -#include "ieee1394.h"
867 -#include <cups/debug.h>
868 -#include <libraw1394/raw1394.h>
869 -#include <libraw1394/csr.h>
876 -#define MAX_NODES 100
885 - char uri[HTTP_MAX_URI],/* URI for this node... */
886 - description[128],/* Description of port */
887 - make_model[128];/* Make and model */
888 - int port, /* Port where this node is found */
889 - node; /* Node number */
890 - unsigned long long addr; /* Management address */
895 - raw1394handle_t handle; /* Handle for printer device */
896 - int node; /* Node number for printer device */
897 - unsigned long long addr; /* Management address */
902 - * ORB messages for communication with the device...
905 -typedef struct /**** Login ORB Message */
907 - unsigned char passwd_addr[8]; /* Password address */
908 - unsigned char resp_addr[8]; /* Login response address */
909 - unsigned char notify_excl; /* Notify and exclusive bits */
910 - unsigned char recon_func; /* Reconnect time and function */
911 - unsigned char lun[2]; /* Logical unit number */
912 - unsigned char passwd_len[2]; /* Length of password */
913 - unsigned char resp_len[2]; /* Length of login response */
914 - unsigned char fifo_addr[8]; /* Local status FIFO address */
917 -typedef struct /**** Login Response Message ****/
919 - unsigned char length[2]; /* Length of response */
920 - unsigned char login_id[2]; /* Login ID */
921 - unsigned char cmd_addr[8]; /* Command block agent address */
922 - unsigned char reserved[2]; /* Reserved (0) */
923 - unsigned char recon_hold[2]; /* Number of seconds to hold login */
931 -static char error_string[1024] = "";
932 -static int num_nodes;
933 -static linux1394_node_t nodes[MAX_NODES];
937 - * 'get_device_id()' - Get the IEEE-1284 device ID for a node...
940 -static char * /* O - Device ID */
941 -get_device_id(raw1394handle_t handle,/* I - Handle for device */
942 - int node, /* I - Node number */
943 - unsigned long long offset,/* I - Offset to directory */
944 - char *id, /* O - ID string */
945 - int idlen) /* I - Size of ID string */
947 - unsigned char data[1024], /* Data from ROM */
948 - *dataptr; /* Pointer into data */
949 - int length; /* Length of directory */
950 - int datalen; /* Length of data */
951 - unsigned long long dataoff; /* Offset of data */
954 - DEBUG_printf(("get_device_id(handle = %p, node = %d, offset = %llx, id = %p, idlen = %d)\n",
955 - handle, node, offset, id, idlen));
960 - * Read the directory length from the first quadlet...
963 - if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
969 - * The length is in the upper 16 bits...
972 - length = (data[0] << 8) | data[1];
974 - DEBUG_printf((" length = %d\n", length));
977 - * Then read the directory, looking for unit directory or device tags...
982 - if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
985 - DEBUG_printf((" data = %02X %02X %02X %02X\n", data[0], data[1],
986 - data[2], data[3]));
988 - if (data[0] == 0xd1)
991 - * Found the unit directory...
994 - offset += ((((data[1] << 8) | data[2]) << 8) | data[3]) << 2;
996 - return (get_device_id(handle, node, offset, id, idlen));
998 - else if (data[0] == 0x81)
1001 - * Found potential IEEE-1284 device ID...
1004 - dataoff = offset + (((((data[1] << 8) | data[2]) << 8) | data[3]) << 2);
1006 - if (raw1394_read(handle, 0xffc0 | node, dataoff, 4, (quadlet_t *)data) < 0)
1012 - * Read the leaf value...
1015 - datalen = (data[0] << 8) | data[1];
1017 - if (datalen > (sizeof(data) / 4))
1018 - datalen = sizeof(data) / 4;
1020 - for (dataptr = data; datalen > 0; datalen --, dataptr += 4, dataoff += 4)
1021 - if (raw1394_read(handle, 0xffc0 | node, dataoff, 4,
1022 - (quadlet_t *)dataptr) < 0)
1025 - if (data[0] == 0 && memcmp(data + 8, "MFG:", 4) == 0)
1028 - * Found the device ID...
1031 - datalen = dataptr - data - 8;
1032 - if (datalen >= idlen)
1035 - memcpy(id, data + 8, datalen);
1036 - id[datalen] = '\0';
1051 - * 'get_man_addr()' - Get the management address for a node...
1054 -static int /* O - Unit type */
1055 -get_man_addr(raw1394handle_t handle, /* I - Handle for device */
1056 - int node, /* I - Node number */
1057 - unsigned long long offset) /* I - Offset to directory */
1059 - unsigned char data[4]; /* Data from ROM */
1060 - int length; /* Length of directory */
1063 - DEBUG_printf(("get_man_addr(handle = %p, node = %d, offset = %llx)\n",
1064 - handle, node, offset));
1067 - * Read the directory length from the first quadlet...
1070 - if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
1076 - * The length is in the upper 16 bits...
1079 - length = (data[0] << 8) | data[1];
1081 - DEBUG_printf((" length = %d\n", length));
1084 - * Then read the directory, looking for unit directory or type tags...
1087 - while (length > 0)
1089 - if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
1092 - DEBUG_printf((" data = %02X %02X %02X %02X\n", data[0], data[1],
1093 - data[2], data[3]));
1095 - if (data[0] == 0xd1)
1098 - * Found the unit directory...
1101 - offset += ((((data[1] << 8) | data[2]) << 8) | data[3]) << 2;
1103 - return (get_man_addr(handle, node, offset));
1105 - else if (data[0] == 0x54)
1108 - * Found the management address...
1111 - return (((((data[1] << 8) | data[2]) << 8) | data[3]) << 2);
1123 - * 'get_unit_type()' - Get the unit type for a node...
1126 -static int /* O - Unit type */
1127 -get_unit_type(raw1394handle_t handle,/* I - Handle for device */
1128 - int node, /* I - Node number */
1129 - unsigned long long offset)/* I - Offset to directory */
1131 - unsigned char data[4]; /* Data from ROM */
1132 - int length; /* Length of directory */
1135 - DEBUG_printf(("get_unit_type(handle = %p, node = %d, offset = %llx)\n",
1136 - handle, node, offset));
1139 - * Read the directory length from the first quadlet...
1142 - if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
1148 - * The length is in the upper 16 bits...
1151 - length = (data[0] << 8) | data[1];
1153 - DEBUG_printf((" length = %d\n", length));
1156 - * Then read the directory, looking for unit directory or type tags...
1159 - while (length > 0)
1161 - if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
1164 - DEBUG_printf((" data = %02X %02X %02X %02X\n", data[0], data[1],
1165 - data[2], data[3]));
1167 - if (data[0] == 0xd1)
1170 - * Found the unit directory...
1173 - offset += ((((data[1] << 8) | data[2]) << 8) | data[3]) << 2;
1175 - return (get_unit_type(handle, node, offset));
1177 - else if (data[0] == 0x14)
1180 - * Found the unit type...
1183 - return (data[1] & 0x1f);
1196 - * 'show_data()' - Show a data node...
1200 -show_data(raw1394handle_t handle, /* I - Handle for device */
1201 - int node, /* I - Node number */
1202 - unsigned long long offset, /* I - Offset to directory */
1203 - int indent) /* Amount to indent */
1205 - int i; /* Looping var */
1206 - unsigned char data[4]; /* Data from ROM */
1207 - int length; /* Length of data */
1211 - * Read the data length from the first quadlet...
1214 - if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
1220 - * The length is in the upper 16 bits...
1223 - length = (data[0] << 8) | data[1];
1226 - * Then read the data...
1229 - for (i = 0; i < indent; i ++)
1232 - printf("LEAF (%d quadlets)\n", length);
1234 - while (length > 0)
1236 - if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
1239 - for (i = 0; i < indent; i ++)
1242 - printf("%02X %02X %02X %02X '%c%c%c%c'\n",
1243 - data[0], data[1], data[2], data[3],
1244 - (data[0] < ' ' || data[0] >= 0x7f) ? '.' : data[0],
1245 - (data[1] < ' ' || data[1] >= 0x7f) ? '.' : data[1],
1246 - (data[2] < ' ' || data[2] >= 0x7f) ? '.' : data[2],
1247 - (data[3] < ' ' || data[3] >= 0x7f) ? '.' : data[3]);
1256 - * 'show_dir()' - Show a directory list...
1260 -show_dir(raw1394handle_t handle, /* I - Handle for device */
1261 - int node, /* I - Node number */
1262 - unsigned long long offset, /* I - Offset to directory */
1263 - int indent) /* Amount to indent */
1265 - int i; /* Looping var */
1266 - unsigned char data[4]; /* Data from ROM */
1267 - int length; /* Length of directory */
1268 - int value; /* Value in directory */
1272 - * Read the directory length from the first quadlet...
1275 - if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
1281 - * The length is in the upper 16 bits...
1284 - length = (data[0] << 8) | data[1];
1287 - * Then read the directory...
1290 - while (length > 0)
1292 - if (raw1394_read(handle, 0xffc0 | node, offset, 4, (quadlet_t *)data) < 0)
1295 - for (i = 0; i < indent; i ++)
1298 - printf("%02X %02X %02X %02X\n", data[0], data[1], data[2], data[3]);
1300 - value = (((data[1] << 8) | data[2]) << 8) | data[3];
1302 - switch (data[0] & 0xc0)
1305 - for (i = -4; i < indent; i ++)
1308 - printf("IMMEDIATE %d\n", value);
1312 - for (i = -4; i < indent; i ++)
1315 - printf("CSR OFFSET +%06X\n", value);
1319 - show_data(handle, node, offset + value * 4, indent + 4);
1323 - show_dir(handle, node, offset + value * 4, indent + 4);
1335 - * 'ieee1394_list()' - List the available printer devices.
1338 -ieee1394_info_t * /* O - Printer information */
1339 -ieee1394_list(int *num_devices) /* O - Number of printers */
1341 - int i, j; /* Looping vars */
1342 - raw1394handle_t handle; /* 1394 handle */
1343 - int num_ports; /* Number of ports */
1344 - struct raw1394_portinfo ports[100]; /* Port data... */
1345 - unsigned char guid[8]; /* Global unique ID */
1346 - int vendor; /* Vendor portion of GUID */
1347 - int unit_type; /* Unit type */
1348 - int addr; /* Management address offset */
1349 - char id[1024], /* Device ID string */
1350 - *idptr, /* Pointer into ID string */
1351 - *idsep; /* Pointer to separator */
1352 - ieee1394_info_t *devices; /* Device list */
1356 - * Connect to the user-mode driver interface...
1359 - handle = raw1394_new_handle();
1360 - num_ports = raw1394_get_port_info(handle, ports,
1361 - sizeof(ports) / sizeof(ports[0]));
1363 - DEBUG_printf(("num_ports = %d\n", num_ports));
1366 - * Loop through the ports to discover what nodes are available.
1371 - for (i = 0; i < num_ports; i ++)
1373 - DEBUG_printf(("ports[%d] = { nodes = %d, name = \"%s\" }\n", i,
1374 - ports[i].nodes, ports[i].name));
1376 - raw1394_set_port(handle, i);
1378 - for (j = 0; j < ports[i].nodes; j ++)
1380 - if (raw1394_read(handle, 0xffc0 | j,
1381 - CSR_REGISTER_BASE + CSR_CONFIG_ROM + 12, 4,
1382 - (quadlet_t *)guid) < 0)
1384 - DEBUG_printf((" Node #%d: Unable to contact (%s)!\n", j,
1385 - strerror(errno)));
1390 - raw1394_read(handle, 0xffc0 | j,
1391 - CSR_REGISTER_BASE + CSR_CONFIG_ROM + 16, 4,
1392 - (quadlet_t *)(guid + 4));
1394 - DEBUG_printf((" Node #%d: GUID = %02X%02X%02X%02X%02X%02X%02X%02X\n",
1395 - j, guid[0], guid[1], guid[2], guid[3], guid[4],
1396 - guid[5], guid[6], guid[7]));
1398 - vendor = (((guid[0] << 8) | guid[1]) << 8) | guid[2];
1399 - unit_type = get_unit_type(handle, j,
1400 - CSR_REGISTER_BASE + CSR_CONFIG_ROM + 20);
1402 - DEBUG_printf(("vendor = %x, unit_type = %d\n", vendor, unit_type));
1404 - if (unit_type == 2 && num_nodes < MAX_NODES)
1407 - * Found a printer device; add it to the nodes list...
1411 - show_dir(handle, j, CSR_REGISTER_BASE + CSR_CONFIG_ROM + 20, 0);
1414 - memset(nodes + num_nodes, 0, sizeof(linux1394_node_t));
1416 - sprintf(nodes[num_nodes].uri, "ieee1394://%02X%02X%02X%02X%02X%02X%02X%02X",
1417 - guid[0], guid[1], guid[2], guid[3], guid[4],
1418 - guid[5], guid[6], guid[7]);
1420 - nodes[num_nodes].port = i;
1421 - nodes[num_nodes].node = j;
1423 - addr = get_man_addr(handle, j, CSR_REGISTER_BASE + CSR_CONFIG_ROM + 20);
1428 - nodes[num_nodes].addr = CSR_REGISTER_BASE + addr;
1430 - DEBUG_printf(("Node address = %llx\n", nodes[num_nodes].addr));
1432 - get_device_id(handle, j, CSR_REGISTER_BASE + CSR_CONFIG_ROM + 20,
1438 - * Grab the manufacturer and model name from the device ID
1443 - idsep = strchr(id, ';');
1449 - snprintf(nodes[num_nodes].description,
1450 - sizeof(nodes[num_nodes].description),
1451 - "%s Firewire Printer", idptr);
1453 - if ((idptr = strstr(idsep, "DES:")) == NULL)
1454 - idptr = strstr(idsep, "MDL:");
1456 - if (idptr == NULL)
1457 - strcpy(nodes[num_nodes].make_model, "Unknown");
1461 - * Grab the DES or MDL code...
1465 - idsep = strchr(idptr, ';');
1469 - if (strncmp(id + 4, idptr, strlen(id + 4)) == 0)
1472 - * Use the description directly...
1475 - strlcpy(nodes[num_nodes].make_model, idptr,
1476 - sizeof(nodes[num_nodes].make_model));
1481 - * Add the manufacturer to the front of the name...
1484 - snprintf(nodes[num_nodes].make_model,
1485 - sizeof(nodes[num_nodes].make_model),
1486 - "%s %s", id + 4, idptr);
1493 - * Flag it as an unknown printer...
1496 - sprintf(nodes[num_nodes].description,
1497 - "Unknown%06X Firewire Printer", vendor);
1498 - strcpy(nodes[num_nodes].make_model, "Unknown");
1508 - * Done querying the Firewire bus...
1511 - raw1394_destroy_handle(handle);
1514 - * Build an array of device info structures as needed...
1517 - if (num_devices == NULL)
1520 - *num_devices = num_nodes;
1524 - if ((devices = calloc(sizeof(ieee1394_info_t), num_nodes)) != NULL)
1526 - for (i = 0; i < num_nodes; i ++)
1528 - strcpy(devices[i].uri, nodes[i].uri);
1529 - strcpy(devices[i].description, nodes[i].description);
1530 - strcpy(devices[i].make_model, nodes[i].make_model);
1542 - * 'ieee1394_open()' - Open a printer device.
1545 -ieee1394_dev_t /* O - Printer device or NULL */
1546 -ieee1394_open(const char *uri) /* I - Device URI */
1548 - int i; /* Looping var */
1549 - linux1394_dev_t *ldev; /* Linux device */
1553 - * Return early if we can't see any printers...
1556 - if (num_nodes == 0)
1557 - ieee1394_list(NULL);
1559 - if (num_nodes == 0)
1561 - strcpy(error_string, "No IEEE-1394 printers found!");
1566 - * Look for the URI...
1569 - for (i = 0; i < num_nodes; i ++)
1570 - if (strcmp(nodes[i].uri, uri) == 0)
1573 - if (i >= num_nodes)
1575 - snprintf(error_string, sizeof(error_string), "Device %s not found!", uri);
1580 - * Now create a new device structure...
1583 - if ((ldev = calloc(sizeof(linux1394_dev_t), 1)) == NULL)
1585 - strcpy(error_string, "Out of memory!");
1589 - ldev->handle = raw1394_new_handle();
1590 - ldev->node = nodes[i].node;
1591 - ldev->addr = nodes[i].addr;
1593 - raw1394_set_port(ldev->handle, nodes[i].port);
1595 - error_string[0] = '\0';
1597 - return ((ieee1394_dev_t)ldev);
1602 - * 'ieee1394_close()' - Close a printer device.
1605 -int /* O - 0 on success, -1 on failure */
1606 -ieee1394_close(ieee1394_dev_t dev) /* I - Printer device */
1608 - linux1394_dev_t *ldev; /* Linux device */
1611 - ldev = (linux1394_dev_t *)dev;
1613 - raw1394_destroy_handle(ldev->handle);
1622 - * 'ieee1394_read()' - Read from a printer device.
1625 -int /* O - Number of bytes read or -1 */
1626 -ieee1394_read(ieee1394_dev_t dev, /* I - Printer device */
1627 - char *buffer, /* I - Read buffer */
1628 - int len) /* I - Max bytes to read */
1630 - linux1394_dev_t *ldev; /* Linux device */
1633 - ldev = (linux1394_dev_t *)dev;
1641 - * 'ieee1394_write()' - Write data to a printer device.
1644 -int /* O - Number of bytes written or -1 */
1645 -ieee1394_write(ieee1394_dev_t dev, /* I - Printer device */
1646 - char *buffer, /* I - Buffer to write */
1647 - int len) /* I - Number of bytes to write */
1649 - linux1394_dev_t *ldev; /* Linux device */
1652 - ldev = (linux1394_dev_t *)dev;
1655 -/* if (raw1394_write(handle, 0xffc0 | j, 0, ,
1656 - (quadlet_t *)guid) < 0)*/
1663 - * 'ieee1394_error()' - Return the last error.
1666 -const char * /* O - Error string or NULL */
1667 -ieee1394_error(void)
1669 - if (error_string[0])
1670 - return (error_string);
1679 diff -durN release-1.2.1/backend/ipp.c cups-1.2.x/backend/ipp.c
1680 --- release-1.2.1/backend/ipp.c 2006-07-04 17:32:11.000000000 +0100
1681 +++ cups-1.2.x/backend/ipp.c 2006-06-26 12:42:40.000000000 +0100
1687 * IPP backend for the Common UNIX Printing System (CUPS).
1692 if ((content_type = getenv("FINAL_CONTENT_TYPE")) == NULL)
1693 - content_type = "application/octet-stream";
1694 + if ((content_type = getenv("CONTENT_TYPE")) == NULL)
1695 + content_type = "application/octet-stream";
1698 * Extract the hostname and printer name from the URI...
1699 @@ -1619,5 +1620,5 @@
1706 diff -durN release-1.2.1/backend/Makefile cups-1.2.x/backend/Makefile
1707 --- release-1.2.1/backend/Makefile 2006-07-04 17:32:11.000000000 +0100
1708 +++ cups-1.2.x/backend/Makefile 2006-06-26 12:42:40.000000000 +0100
1714 # Backend makefile for the Common UNIX Printing System (CUPS).
1719 UBACKENDS = $(PAP) parallel scsi serial snmp socket usb
1720 -TARGETS = betest test1284 $(RBACKENDS) $(UBACKENDS)
1721 +TARGETS = betest test1284 libbackend.a $(RBACKENDS) $(UBACKENDS)
1722 +LIBOBJS = ieee1284.o runloop.o
1723 OBJS = betest.o ipp.o lpd.o pap.o parallel.o scsi.o \
1724 serial.o snmp.o socket.o test1284.o usb.o
1726 @@ -105,6 +106,17 @@
1733 +libbackend.a: $(LIBOBJS)
1734 + echo Archiving $@...
1736 + $(AR) $(ARFLAGS) $@ $(LIBOBJS)
1748 -parallel: parallel.o ../cups/$(LIBCUPS)
1749 +parallel: parallel.o ../cups/$(LIBCUPS) libbackend.a
1751 - $(CC) $(LDFLAGS) -o parallel parallel.o $(LIBS)
1752 + $(CC) $(LDFLAGS) -o parallel parallel.o libbackend.a $(LIBS)
1756 @@ -169,37 +181,37 @@
1760 -serial: serial.o ../cups/$(LIBCUPS)
1761 +serial: serial.o ../cups/$(LIBCUPS) libbackend.a
1763 - $(CC) $(LDFLAGS) -o serial serial.o $(BACKLIBS) $(LIBS)
1764 + $(CC) $(LDFLAGS) -o serial serial.o libbackend.a $(BACKLIBS) $(LIBS)
1771 -snmp: snmp.o ../cups/$(LIBCUPS)
1772 +snmp: snmp.o ../cups/$(LIBCUPS) libbackend.a
1774 - $(CC) $(LDFLAGS) -o snmp snmp.o $(LIBS)
1775 + $(CC) $(LDFLAGS) -o snmp snmp.o libbackend.a $(LIBS)
1782 -socket: socket.o ../cups/$(LIBCUPS)
1783 +socket: socket.o ../cups/$(LIBCUPS) libbackend.a
1785 - $(CC) $(LDFLAGS) -o socket socket.o $(LIBS)
1786 + $(CC) $(LDFLAGS) -o socket socket.o libbackend.a $(LIBS)
1793 -usb: usb.o ../cups/$(LIBCUPS)
1794 +usb: usb.o ../cups/$(LIBCUPS) libbackend.a
1796 - $(CC) $(LDFLAGS) -o usb usb.o $(BACKLIBS) $(LIBS)
1797 -usb.o: usb.c usb-darwin.c usb-unix.c ieee1284.c
1798 + $(CC) $(LDFLAGS) -o usb usb.o libbackend.a $(BACKLIBS) $(LIBS)
1799 +usb.o: usb.c usb-darwin.c usb-unix.c
1810 diff -durN release-1.2.1/backend/parallel.c cups-1.2.x/backend/parallel.c
1811 --- release-1.2.1/backend/parallel.c 2006-07-04 17:32:11.000000000 +0100
1812 +++ cups-1.2.x/backend/parallel.c 2006-06-26 12:42:40.000000000 +0100
1818 * Parallel port backend for the Common UNIX Printing System (CUPS).
1821 * Include necessary headers.
1824 -#include <cups/backend.h>
1825 -#include <cups/cups.h>
1827 -#include <stdlib.h>
1829 -#include <cups/string.h>
1830 -#include <signal.h>
1831 -#include "ieee1284.c"
1832 +#include "backend-private.h"
1835 # include <sys/time.h>
1837 resource[1024], /* Resource info (device and options) */
1838 *options; /* Pointer to options */
1839 int port; /* Port number (not used) */
1840 - int fp; /* Print file */
1841 + int print_fd, /* Print file */
1842 + device_fd; /* Parallel device */
1843 int copies; /* Number of copies to print */
1844 - int fd; /* Parallel device */
1845 - int rbytes; /* Number of bytes read */
1846 - int wbytes; /* Number of bytes written */
1847 - size_t nbytes, /* Number of bytes read */
1848 - tbytes; /* Total number of bytes written */
1849 - char buffer[8192], /* Output buffer */
1850 - *bufptr; /* Pointer into buffer */
1851 + size_t tbytes; /* Total number of bytes written */
1852 struct termios opts; /* Parallel port options */
1853 - fd_set input, /* Input set for select() */
1854 - output; /* Output set for select() */
1855 +#if defined(__linux) && defined(LP_POUTPA)
1856 + unsigned int status; /* Port status (off-line, out-of-paper, etc.) */
1857 int paperout; /* Paper out? */
1858 +#endif /* __linux && LP_POUTPA */
1859 #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
1860 struct sigaction action; /* Actions for POSIX signals */
1861 #endif /* HAVE_SIGACTION && !HAVE_SIGSET */
1863 - unsigned int status; /* Port status (off-line, out-of-paper, etc.) */
1864 -#endif /* __linux */
1880 * Try to open the print file...
1883 - if ((fp = open(argv[6], O_RDONLY)) < 0)
1884 + if ((print_fd = open(argv[6], O_RDONLY)) < 0)
1886 perror("ERROR: unable to open print file");
1887 return (CUPS_BACKEND_FAILED);
1892 - if ((fd = open(resource, O_WRONLY | O_EXCL)) == -1)
1893 + if ((device_fd = open(resource, O_WRONLY | O_EXCL)) == -1)
1895 if (getenv("CLASS") != NULL)
1898 * available printer in the class.
1901 - fputs("INFO: Unable to open parallel port, queuing on next printer in class...\n",
1903 + fputs("INFO: Unable to open parallel port, queuing on next printer "
1904 + "in class...\n", stderr);
1907 * Sleep 5 seconds to keep the job from requeuing too rapidly...
1908 @@ -231,23 +217,26 @@
1912 - fputs("INFO: Parallel port busy; will retry in 30 seconds...\n", stderr);
1913 + fputs("INFO: Parallel port busy; will retry in 30 seconds...\n",
1917 else if (errno == ENXIO || errno == EIO || errno == ENOENT)
1919 - fputs("INFO: Printer not connected; will retry in 30 seconds...\n", stderr);
1920 + fputs("INFO: Printer not connected; will retry in 30 seconds...\n",
1926 - fprintf(stderr, "ERROR: Unable to open parallel port device file \"%s\": %s\n",
1928 + "ERROR: Unable to open parallel port device file \"%s\": %s\n",
1929 resource, strerror(errno));
1930 return (CUPS_BACKEND_FAILED);
1935 + while (device_fd < 0);
1937 fputs("STATE: -connecting-to-device\n", stderr);
1939 @@ -255,25 +244,21 @@
1940 * Set any options provided...
1943 - tcgetattr(fd, &opts);
1944 + tcgetattr(device_fd, &opts);
1946 opts.c_lflag &= ~(ICANON | ECHO | ISIG); /* Raw mode */
1948 /**** No options supported yet ****/
1950 - tcsetattr(fd, TCSANOW, &opts);
1953 - * Check printer status...
1957 + tcsetattr(device_fd, TCSANOW, &opts);
1959 #if defined(__linux) && defined(LP_POUTPA)
1961 * Show the printer status before we send the file...
1966 while (!ioctl(fd, LPGETSTATUS, &status))
1968 fprintf(stderr, "DEBUG: LPGETSTATUS returned a port status of %02X...\n", status);
1969 @@ -298,146 +283,38 @@
1970 #endif /* __linux && LP_POUTPA */
1973 - * Now that we are "connected" to the port, ignore SIGTERM so that we
1974 - * can finish out any page data the driver sends (e.g. to eject the
1975 - * current page... Only ignore SIGTERM if we are printing data from
1976 - * stdin (otherwise you can't cancel raw jobs...)
1981 -#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
1982 - sigset(SIGTERM, SIG_IGN);
1983 -#elif defined(HAVE_SIGACTION)
1984 - memset(&action, 0, sizeof(action));
1986 - sigemptyset(&action.sa_mask);
1987 - action.sa_handler = SIG_IGN;
1988 - sigaction(SIGTERM, &action, NULL);
1990 - signal(SIGTERM, SIG_IGN);
1991 -#endif /* HAVE_SIGSET */
1995 * Finally, send the print file...
2001 - while (copies > 0)
2002 + while (copies > 0 && tbytes >= 0)
2007 + if (print_fd != 0)
2009 fputs("PAGE: 1 1\n", stderr);
2010 - lseek(fp, 0, SEEK_SET);
2011 + lseek(print_fd, 0, SEEK_SET);
2015 - while ((nbytes = read(fp, buffer, sizeof(buffer))) > 0)
2018 - * Write the print data to the printer...
2024 - while (nbytes > 0)
2027 - * See if we are ready to read or write...
2033 - FD_SET(fd, &input);
2035 - FD_SET(fd, &output);
2037 - while (select(fd + 1, &input, &output, NULL, NULL) < 0);
2039 - if (FD_ISSET(fd, &input))
2042 - * Read backchannel data...
2045 - if ((rbytes = read(fd, resource, sizeof(resource))) > 0)
2047 - fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
2049 - cupsBackChannelWrite(resource, rbytes, 1.0);
2053 - if (FD_ISSET(fd, &output))
2056 - * Write print data...
2059 - if ((wbytes = write(fd, bufptr, nbytes)) < 0)
2060 - if (errno == ENOTTY)
2061 - wbytes = write(fd, bufptr, nbytes);
2066 - * Check for retryable errors...
2069 - if (errno == ENOSPC)
2072 - fputs("ERROR: Out of paper!\n", stderr);
2073 - fputs("STATUS: +media-tray-empty-error\n", stderr);
2075 - else if (errno != EAGAIN && errno != EINTR)
2077 - perror("ERROR: Unable to send print file to printer");
2084 - * Update count and pointer...
2089 - fputs("STATUS: -media-tray-empty-error\n", stderr);
2101 + tbytes = backendRunLoop(print_fd, device_fd, 1);
2104 - fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
2105 - (unsigned long)tbytes);
2107 + if (print_fd != 0 && tbytes >= 0)
2108 + fprintf(stderr, "INFO: Sent print file, " CUPS_LLFMT " bytes...\n",
2109 + CUPS_LLCAST tbytes);
2113 * Close the socket connection and input file and return...
2121 - return (wbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
2122 + if (print_fd != 0)
2125 + return (tbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
2130 * Now grab the IEEE 1284 device ID string...
2133 - if (!get_device_id(fd, device_id, sizeof(device_id),
2134 - make_model, sizeof(make_model),
2136 + if (!backendGetDeviceID(fd, device_id, sizeof(device_id),
2137 + make_model, sizeof(make_model),
2139 printf("direct parallel:%s \"%s\" \"%s LPT #%d\" \"%s\"\n", device,
2140 make_model, make_model, i + 1, device_id);
2149 diff -durN release-1.2.1/backend/runloop.c cups-1.2.x/backend/runloop.c
2150 --- release-1.2.1/backend/runloop.c 1970-01-01 01:00:00.000000000 +0100
2151 +++ cups-1.2.x/backend/runloop.c 2006-06-26 12:42:40.000000000 +0100
2156 + * Common run loop API for the Common UNIX Printing System (CUPS).
2158 + * Copyright 2006 by Easy Software Products, all rights reserved.
2160 + * These coded instructions, statements, and computer programs are the
2161 + * property of Easy Software Products and are protected by Federal
2162 + * copyright law. Distribution and use rights are outlined in the file
2163 + * "LICENSE" which should have been included with this file. If this
2164 + * file is missing or damaged please contact Easy Software Products
2167 + * Attn: CUPS Licensing Information
2168 + * Easy Software Products
2169 + * 44141 Airport View Drive, Suite 204
2170 + * Hollywood, Maryland 20636 USA
2172 + * Voice: (301) 373-9600
2173 + * EMail: cups-info@cups.org
2174 + * WWW: http://www.cups.org
2176 + * This file is subject to the Apple OS-Developed Software exception.
2180 + * backendRunLoop() - Read and write print and back-channel data.
2184 + * Include necessary headers.
2187 +#include "backend-private.h"
2188 +#include <sys/select.h>
2192 + * 'backendRunLoop()' - Read and write print and back-channel data.
2195 +ssize_t /* O - Total bytes on success, -1 on error */
2196 +backendRunLoop(int print_fd, /* I - Print file descriptor */
2197 + int device_fd, /* I - Device file descriptor */
2198 + int use_bc) /* I - Use back-channel? */
2200 + int nfds; /* Maximum file descriptor value + 1 */
2201 + fd_set input, /* Input set for reading */
2202 + output; /* Output set for writing */
2203 + ssize_t print_bytes, /* Print bytes read */
2204 + bc_bytes, /* Backchannel bytes read */
2205 + total_bytes, /* Total bytes written */
2206 + bytes; /* Bytes written */
2207 + int paperout; /* "Paper out" status */
2208 + char print_buffer[8192], /* Print data buffer */
2209 + *print_ptr, /* Pointer into print data buffer */
2210 + bc_buffer[1024]; /* Back-channel data buffer */
2211 +#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
2212 + struct sigaction action; /* Actions for POSIX signals */
2213 +#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
2217 + * If we are printing data from a print driver on stdin, ignore SIGTERM
2218 + * so that the driver can finish out any page data, e.g. to eject the
2219 + * current page. We only do this for stdin printing as otherwise there
2220 + * is no way to cancel a raw print job...
2225 +#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
2226 + sigset(SIGTERM, SIG_IGN);
2227 +#elif defined(HAVE_SIGACTION)
2228 + memset(&action, 0, sizeof(action));
2230 + sigemptyset(&action.sa_mask);
2231 + action.sa_handler = SIG_IGN;
2232 + sigaction(SIGTERM, &action, NULL);
2234 + signal(SIGTERM, SIG_IGN);
2235 +#endif /* HAVE_SIGSET */
2239 + * Figure out the maximum file descriptor value to use with select()...
2242 + nfds = (print_fd > device_fd ? print_fd : device_fd) + 1;
2245 + * Now loop until we are out of data from print_fd...
2248 + for (print_bytes = 0, print_ptr = print_buffer, paperout = 0, total_bytes = 0;;)
2251 + * Use select() to determine whether we have data to copy around...
2256 + FD_SET(print_fd, &input);
2258 + FD_SET(device_fd, &input);
2262 + FD_SET(device_fd, &output);
2264 + if (select(nfds, &input, &output, NULL, NULL) < 0)
2265 + continue; /* Ignore errors here */
2268 + * Check if we have back-channel data ready...
2271 + if (FD_ISSET(device_fd, &input))
2273 + if ((bc_bytes = read(device_fd, bc_buffer, sizeof(bc_buffer))) > 0)
2276 + "DEBUG: Received " CUPS_LLFMT " bytes of back-channel data!\n",
2277 + CUPS_LLCAST bc_bytes);
2278 + cupsBackChannelWrite(bc_buffer, bc_bytes, 1.0);
2283 + * Check if we have print data ready...
2286 + if (FD_ISSET(print_fd, &input))
2288 + if ((print_bytes = read(print_fd, print_buffer,
2289 + sizeof(print_buffer))) < 0)
2292 + * Read error - bail if we don't see EAGAIN or EINTR...
2295 + if (errno != EAGAIN || errno != EINTR)
2297 + perror("ERROR: Unable to read print data");
2303 + else if (print_bytes == 0)
2306 + * End of file, break out of the loop...
2312 + print_ptr = print_buffer;
2316 + * Check if the device is ready to receive data and we have data to
2320 + if (print_bytes && FD_ISSET(device_fd, &output))
2322 + if ((bytes = write(device_fd, print_ptr, print_bytes)) < 0)
2325 + * Write error - bail if we don't see an error we can retry...
2328 + if (errno == ENOSPC)
2332 + fputs("ERROR: Out of paper!\n", stderr);
2333 + fputs("STATUS: +media-tray-empty-error\n", stderr);
2337 + else if (errno != EAGAIN && errno != EINTR && errno != ENOTTY)
2339 + perror("ERROR: Unable to write print data");
2347 + fputs("STATUS: -media-tray-empty-error\n", stderr);
2351 + fprintf(stderr, "DEBUG: Wrote %d bytes...\n", (int)bytes);
2353 + print_bytes -= bytes;
2354 + print_ptr += bytes;
2355 + total_bytes += bytes;
2361 + * Return with success...
2364 + return (total_bytes);
2371 diff -durN release-1.2.1/backend/serial.c cups-1.2.x/backend/serial.c
2372 --- release-1.2.1/backend/serial.c 2006-07-04 17:32:11.000000000 +0100
2373 +++ cups-1.2.x/backend/serial.c 2006-06-26 12:42:40.000000000 +0100
2379 * Serial port backend for the Common UNIX Printing System (CUPS).
2382 * Include necessary headers.
2385 -#include <cups/backend.h>
2386 -#include <cups/cups.h>
2388 -#include <stdlib.h>
2390 -#include <cups/string.h>
2391 -#include <signal.h>
2392 +#include "backend-private.h"
2395 # include <sys/modem.h>
2396 @@ -121,21 +115,23 @@
2397 value[255], /* Value of option */
2398 *ptr; /* Pointer into name or value */
2399 int port; /* Port number (not used) */
2400 - int fp; /* Print file */
2401 int copies; /* Number of copies to print */
2402 - int fd; /* Parallel device */
2403 - int rbytes; /* Number of bytes read */
2404 - int wbytes; /* Number of bytes written */
2405 - size_t nbytes, /* Number of bytes read */
2406 - tbytes; /* Total number of bytes written */
2407 + int print_fd, /* Print file */
2408 + device_fd; /* Serial device */
2409 + int nfds; /* Maximum file descriptor value + 1 */
2410 + fd_set input, /* Input set for reading */
2411 + output; /* Output set for writing */
2412 + ssize_t print_bytes, /* Print bytes read */
2413 + bc_bytes, /* Backchannel bytes read */
2414 + total_bytes, /* Total bytes written */
2415 + bytes; /* Bytes written */
2416 int dtrdsr; /* Do dtr/dsr flow control? */
2417 - int bufsize; /* Size of output buffer for writes */
2418 - char buffer[8192], /* Output buffer */
2419 - *bufptr; /* Pointer into buffer */
2420 + int print_size; /* Size of output buffer for writes */
2421 + char print_buffer[8192], /* Print data buffer */
2422 + *print_ptr, /* Pointer into print data buffer */
2423 + bc_buffer[1024]; /* Back-channel data buffer */
2424 struct termios opts; /* Serial port options */
2425 struct termios origopts; /* Original port options */
2426 - fd_set input, /* Input set for select() */
2427 - output; /* Output set for select() */
2428 #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
2429 struct sigaction action; /* Actions for POSIX signals */
2430 #endif /* HAVE_SIGACTION && !HAVE_SIGSET */
2443 * Try to open the print file...
2446 - if ((fp = open(argv[6], O_RDONLY)) < 0)
2447 + if ((print_fd = open(argv[6], O_RDONLY)) < 0)
2449 perror("ERROR: unable to open print file");
2450 return (CUPS_BACKEND_FAILED);
2455 - if ((fd = open(resource, O_WRONLY | O_NOCTTY | O_EXCL | O_NDELAY)) == -1)
2456 + if ((device_fd = open(resource, O_RDWR | O_NOCTTY | O_EXCL |
2459 if (getenv("CLASS") != NULL)
2466 + while (device_fd < 0);
2468 fputs("STATE: -connecting-to-device\n", stderr);
2470 @@ -276,16 +273,18 @@
2471 * Set any options provided...
2474 - tcgetattr(fd, &origopts);
2475 - tcgetattr(fd, &opts);
2476 + tcgetattr(device_fd, &origopts);
2477 + tcgetattr(device_fd, &opts);
2479 - opts.c_lflag &= ~(ICANON | ECHO | ISIG); /* Raw mode */
2480 - opts.c_oflag &= ~OPOST; /* Don't post-process */
2481 + opts.c_lflag &= ~(ICANON | ECHO | ISIG);
2483 + opts.c_oflag &= ~OPOST; /* Don't post-process */
2485 - bufsize = 96; /* 9600 baud / 10 bits/char / 10Hz */
2486 - dtrdsr = 0; /* No dtr/dsr flow control */
2487 + print_size = 96; /* 9600 baud / 10 bits/char / 10Hz */
2488 + dtrdsr = 0; /* No dtr/dsr flow control */
2490 - if (options != NULL)
2497 * Set the baud rate...
2500 - bufsize = atoi(value) / 100;
2501 + print_size = atoi(value) / 100;
2504 cfsetispeed(&opts, atoi(value));
2505 @@ -488,9 +487,10 @@
2511 - tcsetattr(fd, TCSANOW, &opts);
2512 - fcntl(fd, F_SETFL, 0);
2513 + tcsetattr(device_fd, TCSANOW, &opts);
2514 + fcntl(device_fd, F_SETFL, 0);
2517 * Now that we are "connected" to the port, ignore SIGTERM so that we
2519 * stdin (otherwise you can't cancel raw jobs...)
2523 + if (print_fd != 0)
2525 #ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
2526 sigset(SIGTERM, SIG_IGN);
2527 @@ -515,133 +515,181 @@
2531 - * Finally, send the print file...
2532 + * Figure out the maximum file descriptor value to use with select()...
2535 - if (bufsize > sizeof(buffer))
2536 - bufsize = sizeof(buffer);
2537 + nfds = (print_fd > device_fd ? print_fd : device_fd) + 1;
2541 + * Finally, send the print file. Ordinarily we would just use the
2542 + * backendRunLoop() function, however since we need to use smaller
2543 + * writes and may need to do DSR/DTR flow control, we duplicate much
2544 + * of the code here instead...
2547 + if (print_size > sizeof(print_buffer))
2548 + print_size = sizeof(print_buffer);
2557 + if (print_fd != 0)
2559 fputs("PAGE: 1 1\n", stderr);
2560 - lseek(fp, 0, SEEK_SET);
2561 + lseek(print_fd, 0, SEEK_SET);
2566 + * Now loop until we are out of data from print_fd...
2569 + for (print_bytes = 0, print_ptr = print_buffer;;)
2572 - * Check the port and sleep until DSR is set...
2573 + * Use select() to determine whether we have data to copy around...
2579 + FD_SET(print_fd, &input);
2580 + FD_SET(device_fd, &input);
2584 + FD_SET(device_fd, &output);
2586 - if (!ioctl(fd, TIOCMGET, &status))
2587 - if (!(status & TIOCM_DSR))
2588 + if (select(nfds, &input, &output, NULL, NULL) < 0)
2589 + continue; /* Ignore errors here */
2592 + * Check if we have back-channel data ready...
2595 + if (FD_ISSET(device_fd, &input))
2597 + if ((bc_bytes = read(device_fd, bc_buffer, sizeof(bc_buffer))) > 0)
2600 + "DEBUG: Received " CUPS_LLFMT " bytes of back-channel data!\n",
2601 + CUPS_LLCAST bc_bytes);
2602 + cupsBackChannelWrite(bc_buffer, bc_bytes, 1.0);
2607 + * Check if we have print data ready...
2610 + if (FD_ISSET(print_fd, &input))
2612 + if ((print_bytes = read(print_fd, print_buffer, print_size)) < 0)
2615 - * Wait for DSR to go high...
2616 + * Read error - bail if we don't see EAGAIN or EINTR...
2619 - fputs("DEBUG: DSR is low; waiting for device...\n", stderr);
2622 + if (errno != EAGAIN || errno != EINTR)
2625 - if (ioctl(fd, TIOCMGET, &status))
2628 - while (!(status & TIOCM_DSR));
2630 - fputs("DEBUG: DSR is high; writing to device...\n", stderr);
2633 + perror("ERROR: Unable to read print data");
2636 - while ((nbytes = read(fp, buffer, bufsize)) > 0)
2639 - * Write the print data to the printer...
2641 + tcsetattr(device_fd, TCSADRAIN, &origopts);
2647 - while (nbytes > 0)
2650 - * See if we are ready to read or write...
2652 + if (print_fd != 0)
2658 - FD_SET(fd, &input);
2660 - FD_SET(fd, &output);
2662 - while (select(fd + 1, &input, &output, NULL, NULL) < 0);
2663 + return (CUPS_BACKEND_FAILED);
2666 - if (FD_ISSET(fd, &input))
2669 + else if (print_bytes == 0)
2672 - * Read backchannel data...
2673 + * End of file, break out of the loop...
2676 - if ((rbytes = read(fd, resource, sizeof(resource))) > 0)
2678 - fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
2680 - cupsBackChannelWrite(resource, rbytes, 1.0);
2685 - if (FD_ISSET(fd, &output))
2686 + print_ptr = print_buffer;
2690 + * Check if the device is ready to receive data and we have data to
2694 + if (print_bytes && FD_ISSET(device_fd, &output))
2699 - * Write print data...
2700 + * Check the port and sleep until DSR is set...
2703 - if ((wbytes = write(fd, bufptr, nbytes)) < 0)
2704 - if (errno == ENOTTY)
2705 - wbytes = write(fd, bufptr, nbytes);
2711 - * Check for retryable errors...
2714 - if (errno != EAGAIN && errno != EINTR)
2715 + if (!ioctl(device_fd, TIOCMGET, &status))
2716 + if (!(status & TIOCM_DSR))
2718 - perror("ERROR: Unable to send print file to printer");
2724 + * Wait for DSR to go high...
2727 + fputs("DEBUG: DSR is low; waiting for device...\n", stderr);
2732 + * Poll every 100ms...
2737 + if (ioctl(device_fd, TIOCMGET, &status))
2740 + while (!(status & TIOCM_DSR));
2742 + fputs("DEBUG: DSR is high; writing to device...\n", stderr);
2746 + if ((bytes = write(device_fd, print_ptr, print_bytes)) < 0)
2749 + * Write error - bail if we don't see an error we can retry...
2752 + if (errno != EAGAIN && errno != EINTR && errno != ENOTTY)
2755 - * Update count and pointer...
2757 + perror("ERROR: Unable to write print data");
2761 + tcsetattr(device_fd, TCSADRAIN, &origopts);
2765 + if (print_fd != 0)
2768 + return (CUPS_BACKEND_FAILED);
2777 + fprintf(stderr, "DEBUG: Wrote %d bytes...\n", (int)bytes);
2780 - fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
2781 - (unsigned long)tbytes);
2782 + print_bytes -= bytes;
2783 + print_ptr += bytes;
2784 + total_bytes += bytes;
2790 @@ -649,13 +697,14 @@
2791 * Close the serial port and input file and return...
2794 - tcsetattr(fd, TCSADRAIN, &origopts);
2795 + tcsetattr(device_fd, TCSADRAIN, &origopts);
2802 - return (wbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
2803 + if (print_fd != 0)
2806 + return (total_bytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
2810 @@ -1169,5 +1218,5 @@
2817 diff -durN release-1.2.1/backend/snmp.c cups-1.2.x/backend/snmp.c
2818 --- release-1.2.1/backend/snmp.c 2006-07-04 17:32:11.000000000 +0100
2819 +++ cups-1.2.x/backend/snmp.c 2006-06-28 09:59:03.000000000 +0100
2825 * SNMP discovery backend for the Common UNIX Printing System (CUPS).
2828 * Include necessary headers.
2831 -#include <cups/backend.h>
2832 #include <cups/http-private.h>
2833 -#include <cups/cups.h>
2834 -#include <cups/string.h>
2835 +#include "backend-private.h"
2836 #include <cups/array.h>
2837 #include <cups/file.h>
2839 -#include <signal.h>
2841 -#define SNMP_BACKEND
2842 -#include "ieee1284.c"
2848 debug_printf("DEBUG: add_cache(addr=%p, addrname=\"%s\", uri=\"%s\", "
2849 "id=\"%s\", make_and_model=\"%s\")\n",
2850 - addr, addrname, uri, id ? id : "(null)",
2851 + addr, addrname, uri ? uri : "(null)", id ? id : "(null)",
2852 make_and_model ? make_and_model : "(null)");
2854 temp = calloc(1, sizeof(snmp_cache_t));
2855 @@ -1648,6 +1641,14 @@
2859 + * Don't use the printer-make-and-model if it contains a generic
2860 + * string like "Ricoh IPP Printer"...
2863 + if (model && strstr(model->values[0].string.text, "IPP Printer"))
2867 * If we don't have a printer-make-and-model string from the printer
2868 * but do have the 1284 device ID string, generate a make-and-model
2869 * string from the device ID info...
2870 @@ -1656,7 +1657,9 @@
2872 strlcpy(temp, model->values[0].string.text, sizeof(temp));
2874 - get_make_model(info->values[0].string.text, temp, sizeof(temp));
2875 + backendGetMakeModel(info->values[0].string.text, temp, sizeof(temp));
2879 fix_make_model(make_model, temp, sizeof(make_model));
2881 @@ -1928,8 +1931,8 @@
2882 * Description is the IEEE-1284 device ID...
2885 - get_make_model(packet.object_value.string, make_model,
2886 - sizeof(make_model));
2887 + backendGetMakeModel(packet.object_value.string, make_model,
2888 + sizeof(make_model));
2892 @@ -2212,5 +2215,5 @@
2899 diff -durN release-1.2.1/backend/socket.c cups-1.2.x/backend/socket.c
2900 --- release-1.2.1/backend/socket.c 2006-07-04 17:32:11.000000000 +0100
2901 +++ cups-1.2.x/backend/socket.c 2006-06-26 12:42:40.000000000 +0100
2907 * AppSocket backend for the Common UNIX Printing System (CUPS).
2910 * Include necessary headers.
2913 -#include <cups/backend.h>
2914 #include <cups/http-private.h>
2915 -#include <cups/cups.h>
2917 -#include <stdlib.h>
2918 +#include "backend-private.h"
2920 -#include <cups/string.h>
2922 #include <sys/types.h>
2923 #include <sys/stat.h>
2924 -#include <signal.h>
2927 # include <winsock.h>
2929 name[255], /* Name of option */
2930 value[255], /* Value of option */
2931 *ptr; /* Pointer into name or value */
2932 - int fp; /* Print file */
2933 + int print_fd; /* Print file */
2934 int copies; /* Number of copies to print */
2935 int waiteof; /* Wait for end-of-file? */
2936 int port; /* Port number */
2937 char portname[255]; /* Port name */
2938 int delay; /* Delay for retries... */
2939 - int fd; /* AppSocket */
2940 + int device_fd; /* AppSocket */
2941 int error; /* Error code (if any) */
2942 http_addrlist_t *addrlist; /* Address list */
2943 - int rbytes; /* Number of bytes read */
2944 - int wbytes; /* Number of bytes written */
2945 - int nbytes; /* Number of bytes read */
2946 - size_t tbytes; /* Total number of bytes written */
2947 - char buffer[8192], /* Output buffer */
2948 - *bufptr; /* Pointer into buffer */
2949 + ssize_t tbytes; /* Total number of bytes written */
2950 struct timeval timeout; /* Timeout for select() */
2951 - fd_set input, /* Input set for select() */
2952 - output; /* Output set for select() */
2953 + fd_set input; /* Input set for select() */
2954 + ssize_t bc_bytes; /* Number of back-channel bytes read */
2955 #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
2956 struct sigaction action; /* Actions for POSIX signals */
2957 #endif /* HAVE_SIGACTION && !HAVE_SIGSET */
2970 * Try to open the print file...
2973 - if ((fp = open(argv[6], O_RDONLY)) < 0)
2974 + if ((print_fd = open(argv[6], O_RDONLY)) < 0)
2976 perror("ERROR: unable to open print file");
2977 return (CUPS_BACKEND_FAILED);
2978 @@ -252,228 +241,134 @@
2979 fprintf(stderr, "INFO: Attempting to connect to host %s on port %d\n",
2983 + fputs("STATE: +connecting-to-device\n", stderr);
2985 - while (copies > 0)
2988 - fputs("STATE: +connecting-to-device\n", stderr);
2991 + if (!httpAddrConnect(addrlist, &device_fd))
2993 - if (!httpAddrConnect(addrlist, &fd))
3000 - if (getenv("CLASS") != NULL)
3003 - * If the CLASS environment variable is set, the job was submitted
3004 - * to a class and not to a specific queue. In this case, we want
3005 - * to abort immediately so that the job can be requeued on the next
3006 - * available printer in the class.
3008 + if (getenv("CLASS") != NULL)
3011 + * If the CLASS environment variable is set, the job was submitted
3012 + * to a class and not to a specific queue. In this case, we want
3013 + * to abort immediately so that the job can be requeued on the next
3014 + * available printer in the class.
3017 - fprintf(stderr, "INFO: Unable to connect to \"%s\", queuing on next printer in class...\n",
3019 + fprintf(stderr, "INFO: Unable to connect to \"%s\", queuing on next printer in class...\n",
3023 - * Sleep 5 seconds to keep the job from requeuing too rapidly...
3026 + * Sleep 5 seconds to keep the job from requeuing too rapidly...
3032 - return (CUPS_BACKEND_FAILED);
3034 + return (CUPS_BACKEND_FAILED);
3037 - if (error == ECONNREFUSED || error == EHOSTDOWN ||
3038 - error == EHOSTUNREACH)
3040 - fprintf(stderr, "INFO: Network host \'%s\' is busy; will retry in %d seconds...\n",
3043 + if (error == ECONNREFUSED || error == EHOSTDOWN ||
3044 + error == EHOSTUNREACH)
3047 + "INFO: Network host \'%s\' is busy; will retry in %d seconds...\n",
3056 - perror("ERROR: Unable to connect to printer (retrying in 30 seconds)");
3065 + perror("ERROR: Unable to connect to printer (retrying in 30 seconds)");
3073 - fputs("STATE: -connecting-to-device\n", stderr);
3076 - * Now that we are "connected" to the port, ignore SIGTERM so that we
3077 - * can finish out any page data the driver sends (e.g. to eject the
3078 - * current page... Only ignore SIGTERM if we are printing data from
3079 - * stdin (otherwise you can't cancel raw jobs...)
3084 -#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
3085 - sigset(SIGTERM, SIG_IGN);
3086 -#elif defined(HAVE_SIGACTION)
3087 - memset(&action, 0, sizeof(action));
3088 + fputs("STATE: -connecting-to-device\n", stderr);
3090 - sigemptyset(&action.sa_mask);
3091 - action.sa_handler = SIG_IGN;
3092 - sigaction(SIGTERM, &action, NULL);
3094 - signal(SIGTERM, SIG_IGN);
3095 -#endif /* HAVE_SIGSET */
3098 + * Print everything...
3102 - * Finally, send the print file...
3106 + while (copies > 0 && tbytes >= 0)
3111 + if (print_fd != 0)
3113 fputs("PAGE: 1 1\n", stderr);
3114 - lseek(fp, 0, SEEK_SET);
3115 + lseek(print_fd, 0, SEEK_SET);
3118 - fputs("INFO: Connected to host, sending print job...\n", stderr);
3121 - while ((nbytes = read(fp, buffer, sizeof(buffer))) > 0)
3124 - * Write the print data to the printer...
3130 - while (nbytes > 0)
3133 - * See if we are ready to read or write...
3139 - FD_SET(fd, &input);
3141 - FD_SET(fd, &output);
3143 - while (select(fd + 1, &input, &output, NULL, NULL) < 0);
3145 - if (FD_ISSET(fd, &input))
3148 - * Read backchannel data...
3151 - if ((rbytes = recv(fd, resource, sizeof(resource), 0)) > 0)
3153 - fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
3155 - cupsBackChannelWrite(resource, rbytes, 1.0);
3159 - if (FD_ISSET(fd, &output))
3162 - * Write print data...
3165 - if ((wbytes = send(fd, bufptr, nbytes, 0)) < 0)
3168 - * Check for retryable errors...
3170 + tbytes = backendRunLoop(print_fd, device_fd, 1);
3172 - if (errno != EAGAIN && errno != EINTR)
3174 - perror("ERROR: Unable to send print file to printer");
3181 - * Update count and pointer...
3183 + if (print_fd != 0 && tbytes >= 0)
3184 + fprintf(stderr, "INFO: Sent print file, " CUPS_LLFMT " bytes...\n",
3185 + CUPS_LLCAST tbytes);
3196 + * Shutdown the socket and wait for the other end to finish...
3201 + fputs("INFO: Print file sent, waiting for printer to finish...\n", stderr);
3204 - fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
3205 - (unsigned long)tbytes);
3207 + shutdown(device_fd, 1);
3213 - * Shutdown the socket and wait for the other end to finish...
3214 + * Wait a maximum of 90 seconds for backchannel data or a closed
3218 - fputs("INFO: Print file sent, waiting for printer to finish...\n", stderr);
3219 + timeout.tv_sec = 90;
3220 + timeout.tv_usec = 0;
3224 + FD_SET(device_fd, &input);
3228 + if (select(device_fd + 1, (int *)&input, NULL, NULL, &timeout) > 0)
3230 + if (select(device_fd + 1, &input, NULL, NULL, &timeout) > 0)
3231 +#endif /* __hpux */
3234 - * Wait a maximum of 90 seconds for backchannel data or a closed
3236 + * Grab the data coming back and spit it out to stderr...
3239 - timeout.tv_sec = 90;
3240 - timeout.tv_usec = 0;
3243 - FD_SET(fd, &input);
3246 - if (select(fd + 1, (int *)&input, NULL, NULL, &timeout) > 0)
3248 - if (select(fd + 1, &input, NULL, NULL, &timeout) > 0)
3249 - #endif /* __hpux */
3250 + if ((bc_bytes = read(device_fd, resource, sizeof(resource))) > 0)
3253 - * Grab the data coming back and spit it out to stderr...
3256 - if ((rbytes = recv(fd, resource, sizeof(resource), 0)) > 0)
3258 - fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
3260 - cupsBackChannelWrite(resource, rbytes, 1.0);
3264 + fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
3266 + cupsBackChannelWrite(resource, bc_bytes, 1.0);
3277 - * Close the socket connection...
3280 + * Close the socket connection...
3287 httpAddrFreeList(addrlist);
3289 @@ -481,16 +376,16 @@
3290 * Close the input file and return...
3295 + if (print_fd != 0)
3300 fputs("INFO: Ready to print.\n", stderr);
3302 - return (wbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
3303 + return (tbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
3311 diff -durN release-1.2.1/backend/test1284.c cups-1.2.x/backend/test1284.c
3312 --- release-1.2.1/backend/test1284.c 2006-07-04 17:32:11.000000000 +0100
3313 +++ cups-1.2.x/backend/test1284.c 2006-06-26 12:42:40.000000000 +0100
3319 * IEEE-1284 support functions test program for the Common UNIX Printing
3322 # include <unistd.h>
3327 #include "ieee1284.c"
3331 printf("%s:\n", argv[i]);
3333 - get_device_id(fd, device_id, sizeof(device_id), make_model,
3334 - sizeof(make_model), "test", uri, sizeof(uri));
3335 + backendGetDeviceID(fd, device_id, sizeof(device_id), make_model,
3336 + sizeof(make_model), "test", uri, sizeof(uri));
3338 printf(" device_id=\"%s\"\n", device_id);
3339 printf(" make_model=\"%s\"\n", make_model);
3347 diff -durN release-1.2.1/backend/usb.c cups-1.2.x/backend/usb.c
3348 --- release-1.2.1/backend/usb.c 2006-07-04 17:32:11.000000000 +0100
3349 +++ cups-1.2.x/backend/usb.c 2006-06-26 12:42:40.000000000 +0100
3355 * USB port backend for the Common UNIX Printing System (CUPS).
3358 void list_devices(void);
3359 int print_device(const char *uri, const char *hostname,
3360 const char *resource, const char *options,
3361 - int fp, int copies, int argc, char *argv[]);
3362 + int print_fd, int copies, int argc, char *argv[]);
3367 const char *hostname, /* I - Hostname/manufacturer */
3368 const char *resource, /* I - Resource/modelname */
3369 const char *options, /* I - Device options/serial number */
3370 - int fp, /* I - File descriptor to print */
3371 + int print_fd, /* I - File descriptor to print */
3372 int copies, /* I - Copies to print */
3373 int argc, /* I - Number of command-line arguments (6 or 7) */
3374 char *argv[]) /* I - Command-line arguments */
3385 main(int argc, /* I - Number of command-line arguments (6 or 7) */
3386 char *argv[]) /* I - Command-line arguments */
3388 - int fp; /* Print file */
3389 + int print_fd; /* Print file */
3390 int copies; /* Number of copies to print */
3391 int status; /* Exit status */
3392 int port; /* Port number (not used) */
3405 * Try to open the print file...
3408 - if ((fp = open(argv[6], O_RDONLY)) < 0)
3409 + if ((print_fd = open(argv[6], O_RDONLY)) < 0)
3411 fprintf(stderr, "ERROR: unable to open print file %s - %s\n",
3412 argv[6], strerror(errno));
3413 @@ -255,19 +255,20 @@
3414 * Finally, send the print file...
3417 - status = print_device(uri, hostname, resource, options, fp, copies, argc, argv);
3418 + status = print_device(uri, hostname, resource, options, print_fd, copies,
3422 * Close the input file and return...
3427 + if (print_fd != 0)
3438 diff -durN release-1.2.1/backend/usb-darwin.c cups-1.2.x/backend/usb-darwin.c
3439 --- release-1.2.1/backend/usb-darwin.c 2006-07-04 17:32:11.000000000 +0100
3440 +++ cups-1.2.x/backend/usb-darwin.c 2006-06-26 12:42:40.000000000 +0100
3446 * © Copyright 2005-2006 Apple Computer, Inc. All rights reserved.
3448 @@ -1310,7 +1310,7 @@
3450 start = mach_absolute_time();
3452 - rbytes = sizeof(readbuffer) - 1;
3453 + rbytes = sizeof(readbuffer);
3454 readstatus = (*classdriver)->ReadPipe( classdriver, readbuffer, &rbytes );
3455 if ( kIOReturnSuccess == readstatus && rbytes > 0 ) {
3457 @@ -1346,5 +1346,5 @@
3464 diff -durN release-1.2.1/backend/usb-unix.c cups-1.2.x/backend/usb-unix.c
3465 --- release-1.2.1/backend/usb-unix.c 2006-07-04 17:32:11.000000000 +0100
3466 +++ cups-1.2.x/backend/usb-unix.c 2006-06-26 12:42:40.000000000 +0100
3472 * USB port backend for the Common UNIX Printing System (CUPS).
3478 - * main() - Send a file to the specified USB port.
3479 + * print_device() - Print a file to a USB device.
3480 * list_devices() - List all USB devices.
3481 + * open_device() - Open a USB device...
3486 const char *hostname, /* I - Hostname/manufacturer */
3487 const char *resource, /* I - Resource/modelname */
3488 const char *options, /* I - Device options/serial number */
3489 - int fp, /* I - File descriptor to print */
3490 + int print_fd, /* I - File descriptor to print */
3491 int copies, /* I - Copies to print */
3492 int argc, /* I - Number of command-line arguments (6 or 7) */
3493 char *argv[]) /* I - Command-line arguments */
3495 - int usebc; /* Use backchannel path? */
3496 - int fd; /* USB device */
3497 - int rbytes; /* Number of bytes read */
3498 - int wbytes; /* Number of bytes written */
3499 - size_t nbytes, /* Number of bytes read */
3500 - tbytes; /* Total number of bytes written */
3501 - char buffer[8192], /* Output buffer */
3502 - *bufptr, /* Pointer into buffer */
3503 - backbuf[1024]; /* Backchannel buffer */
3504 + int use_bc; /* Use backchannel path? */
3505 + int device_fd; /* USB device */
3506 + size_t tbytes; /* Total number of bytes written */
3507 struct termios opts; /* Parallel port options */
3508 - fd_set input, /* Input set for select() */
3509 - output; /* Output set for select() */
3510 - int paperout; /* Paper out? */
3511 -#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
3512 - struct sigaction action; /* Actions for POSIX signals */
3513 -#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
3515 +#if defined(__linux) && defined(LP_POUTPA)
3516 unsigned int status; /* Port status (off-line, out-of-paper, etc.) */
3517 -#endif /* __linux */
3518 + int paperout; /* Paper out? */
3519 +#endif /* __linux && LP_POUTPA */
3525 * when they get a read request...
3528 - usebc = strcasecmp(hostname, "Canon") != 0;
3529 + use_bc = strcasecmp(hostname, "Canon") != 0;
3532 * Open the USB port device...
3537 - if ((fd = open_device(uri)) == -1)
3538 + if ((device_fd = open_device(uri)) == -1)
3540 if (getenv("CLASS") != NULL)
3543 fputs("INFO: USB port busy; will retry in 30 seconds...\n", stderr);
3546 - else if (errno == ENXIO || errno == EIO || errno == ENOENT || errno == ENODEV)
3547 + else if (errno == ENXIO || errno == EIO || errno == ENOENT ||
3550 fputs("INFO: Printer not connected; will retry in 30 seconds...\n", stderr);
3557 + while (device_fd < 0);
3559 fputs("STATE: -connecting-to-device\n", stderr);
3561 @@ -148,28 +140,25 @@
3562 * Set any options provided...
3565 - tcgetattr(fd, &opts);
3566 + tcgetattr(device_fd, &opts);
3568 opts.c_lflag &= ~(ICANON | ECHO | ISIG); /* Raw mode */
3570 /**** No options supported yet ****/
3572 - tcsetattr(fd, TCSANOW, &opts);
3575 - * Check printer status...
3579 + tcsetattr(device_fd, TCSANOW, &opts);
3581 #if defined(__linux) && defined(LP_POUTPA)
3583 * Show the printer status before we send the file...
3586 - while (!ioctl(fd, LPGETSTATUS, &status))
3589 + while (!ioctl(device_fd, LPGETSTATUS, &status))
3591 - fprintf(stderr, "DEBUG: LPGETSTATUS returned a port status of %02X...\n", status);
3592 + fprintf(stderr, "DEBUG: LPGETSTATUS returned a port status of %02X...\n",
3595 if (status & LP_POUTPA)
3597 @@ -191,146 +180,35 @@
3598 #endif /* __linux && LP_POUTPA */
3601 - * Now that we are "connected" to the port, ignore SIGTERM so that we
3602 - * can finish out any page data the driver sends (e.g. to eject the
3603 - * current page... Only ignore SIGTERM if we are printing data from
3604 - * stdin (otherwise you can't cancel raw jobs...)
3609 -#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
3610 - sigset(SIGTERM, SIG_IGN);
3611 -#elif defined(HAVE_SIGACTION)
3612 - memset(&action, 0, sizeof(action));
3614 - sigemptyset(&action.sa_mask);
3615 - action.sa_handler = SIG_IGN;
3616 - sigaction(SIGTERM, &action, NULL);
3618 - signal(SIGTERM, SIG_IGN);
3619 -#endif /* HAVE_SIGSET */
3623 * Finally, send the print file...
3629 - while (copies > 0)
3630 + while (copies > 0 && tbytes >= 0)
3635 + if (print_fd != 0)
3637 fputs("PAGE: 1 1\n", stderr);
3638 - lseek(fp, 0, SEEK_SET);
3639 + lseek(print_fd, 0, SEEK_SET);
3643 - while ((nbytes = read(fp, buffer, sizeof(buffer))) > 0)
3646 - * Write the print data to the printer...
3652 - while (nbytes > 0)
3655 - * See if we are ready to read or write...
3662 - FD_SET(fd, &input);
3665 - FD_SET(fd, &output);
3667 - while (select(fd + 1, &input, &output, NULL, NULL) < 0);
3669 - if (FD_ISSET(fd, &input))
3672 - * Read backchannel data...
3675 - if ((rbytes = read(fd, backbuf, sizeof(backbuf))) > 0)
3677 - fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
3679 - cupsBackChannelWrite(backbuf, rbytes, 1.0);
3683 - if (FD_ISSET(fd, &output))
3686 - * Write print data...
3689 - if ((wbytes = write(fd, bufptr, nbytes)) < 0)
3690 - if (errno == ENOTTY)
3691 - wbytes = write(fd, bufptr, nbytes);
3696 - * Check for retryable errors...
3699 - if (errno == ENOSPC)
3702 - fputs("ERROR: Out of paper!\n", stderr);
3703 - fputs("STATUS: +media-tray-empty-error\n", stderr);
3705 - else if (errno != EAGAIN && errno != EINTR)
3707 - perror("ERROR: Unable to send print file to printer");
3714 - * Update count and pointer...
3719 - fputs("STATUS: -media-tray-empty-error\n", stderr);
3731 + tbytes = backendRunLoop(print_fd, device_fd, 1);
3734 - fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
3735 - (unsigned long)tbytes);
3737 + if (print_fd != 0 && tbytes >= 0)
3738 + fprintf(stderr, "INFO: Sent print file, " CUPS_LLFMT " bytes...\n",
3739 + CUPS_LLCAST tbytes);
3743 * Close the USB port and return...
3749 - return (wbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
3750 + return (tbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
3756 if ((fd = open(device, O_RDWR | O_EXCL)) >= 0)
3758 - if (!get_device_id(fd, device_id, sizeof(device_id),
3759 - make_model, sizeof(make_model),
3760 - "usb", device_uri, sizeof(device_uri)))
3761 + if (!backendGetDeviceID(fd, device_id, sizeof(device_id),
3762 + make_model, sizeof(make_model),
3763 + "usb", device_uri, sizeof(device_uri)))
3764 printf("direct %s \"%s\" \"%s USB #%d\" \"%s\"\n", device_uri,
3765 make_model, make_model, i + 1, device_id);
3769 if ((fd = open(device, O_RDWR | O_EXCL)) >= 0)
3771 - if (!get_device_id(fd, device_id, sizeof(device_id),
3772 - make_model, sizeof(make_model),
3773 - "usb", device_uri, sizeof(device_uri)))
3774 + if (!backendGetDeviceID(fd, device_id, sizeof(device_id),
3775 + make_model, sizeof(make_model),
3776 + "usb", device_uri, sizeof(device_uri)))
3777 printf("direct %s \"%s\" \"%s USB #%d\" \"%s\"\n", device_uri,
3778 make_model, make_model, i + 1, device_id);
3780 @@ -446,7 +324,14 @@
3782 if (!strncmp(uri, "usb:/dev/", 9))
3784 - return (-1); /* Do not allow direct devices anymore */
3787 + * Do not allow direct devices anymore...
3793 else if (!strncmp(uri, "usb://", 6))
3798 if ((fd = open(device, O_RDWR | O_EXCL)) >= 0)
3800 - get_device_id(fd, device_id, sizeof(device_id),
3801 - make_model, sizeof(make_model),
3802 - "usb", device_uri, sizeof(device_uri));
3803 + backendGetDeviceID(fd, device_id, sizeof(device_id),
3804 + make_model, sizeof(make_model),
3805 + "usb", device_uri, sizeof(device_uri));
3809 @@ -545,7 +430,14 @@
3812 #elif defined(__sun) && defined(ECPPIOC_GETDEVID)
3813 - return (-1); /* Do not allow direct devices anymore */
3816 + * Do not allow direct devices anymore...
3822 else if (!strncmp(uri, "usb://", 6))
3826 sprintf(device, "/dev/usb/printer%d", i);
3828 if ((fd = open(device, O_RDWR | O_EXCL)) >= 0)
3829 - get_device_id(fd, device_id, sizeof(device_id),
3830 - make_model, sizeof(make_model),
3831 - "usb", device_uri, sizeof(device_uri));
3832 + backendGetDeviceID(fd, device_id, sizeof(device_id),
3833 + make_model, sizeof(make_model),
3834 + "usb", device_uri, sizeof(device_uri));
3845 diff -durN release-1.2.1/berkeley/lpq.c cups-1.2.x/berkeley/lpq.c
3846 --- release-1.2.1/berkeley/lpq.c 2006-07-04 17:32:18.000000000 +0100
3847 +++ cups-1.2.x/berkeley/lpq.c 2006-06-26 12:42:47.000000000 +0100
3853 * "lpq" command for the Common UNIX Printing System (CUPS).
3856 cups_lang_t *language; /* Language */
3862 * Check for command-line options...
3871 diff -durN release-1.2.1/berkeley/lprm.c cups-1.2.x/berkeley/lprm.c
3872 --- release-1.2.1/berkeley/lprm.c 2006-07-04 17:32:18.000000000 +0100
3873 +++ cups-1.2.x/berkeley/lprm.c 2006-06-28 09:59:03.000000000 +0100
3879 * "lprm" command for the Common UNIX Printing System (CUPS).
3882 ipp_op_t op; /* Operation */
3883 cups_lang_t *language; /* Language */
3884 int num_dests; /* Number of destinations */
3885 - cups_dest_t *dests; /* Destinations */
3886 + cups_dest_t *dests, /* Destinations */
3887 + *defdest; /* Default destination */
3888 http_encryption_t encryption; /* Encryption? */
3893 encryption = cupsEncryption();
3894 language = cupsLangDefault();
3895 - num_dests = cupsGetDests(&dests);
3897 - for (i = 0; i < num_dests; i ++)
3898 - if (dests[i].is_default)
3899 - dest = dests[i].name;
3902 * Open a connection to the server...
3907 + num_dests = cupsGetDests2(http, &dests);
3908 + defdest = cupsGetDest(NULL, NULL, num_dests, dests);
3909 + dest = defdest ? defdest->name : NULL;
3912 * Process command-line arguments...
3915 encryption = HTTP_ENCRYPT_REQUIRED;
3917 httpEncryption(http, encryption);
3918 + cupsSetEncryption(encryption);
3920 _cupsLangPrintf(stderr,
3921 _("%s: Sorry, no encryption support compiled in!\n"),
3925 case 'h' : /* Connect to host */
3929 if (argv[i][2] != '\0')
3930 cupsSetServer(argv[i] + 2);
3932 @@ -172,6 +170,21 @@
3934 cupsSetServer(argv[i]);
3938 + cupsFreeDests(num_dests, dests);
3940 + if ((http = httpConnectEncrypt(cupsServer(), ippPort(),
3941 + encryption)) == NULL)
3943 + _cupsLangPuts(stderr, _("lprm: Unable to contact server!\n"));
3944 + cupsFreeDests(num_dests, dests);
3948 + num_dests = cupsGetDests2(http, &dests);
3949 + defdest = cupsGetDest(NULL, NULL, num_dests, dests);
3950 + dest = defdest ? defdest->name : NULL;
3961 diff -durN release-1.2.1/cgi-bin/help-index.c cups-1.2.x/cgi-bin/help-index.c
3962 --- release-1.2.1/cgi-bin/help-index.c 2006-07-04 17:35:24.000000000 +0100
3963 +++ cups-1.2.x/cgi-bin/help-index.c 2006-06-26 12:45:33.000000000 +0100
3969 * On-line help index routines for the Common UNIX Printing System (CUPS).
3972 if (isspace(*ptr & 255))
3974 while (isspace(*ptr & 255))
3987 diff -durN release-1.2.1/CHANGES.txt cups-1.2.x/CHANGES.txt
3988 --- release-1.2.1/CHANGES.txt 2006-07-04 17:35:29.000000000 +0100
3989 +++ cups-1.2.x/CHANGES.txt 2006-06-28 09:59:05.000000000 +0100
3991 -CHANGES.txt - 2006-05-22
3992 +CHANGES.txt - 2006-06-26
3993 ------------------------
3995 +CHANGES IN CUPS V1.2.2
3997 + - The scheduler used up the CPU if BrowseRemoteProtocols
3998 + was empty (STR #1792)
3999 + - Custom page sizes did not work (STR #1787)
4000 + - The SNMP backend could crash on some systems when SNMP
4001 + logging was enabled (STR #1789)
4002 + - Browsing could produce some funny printer names when
4003 + ServerName was set to an IP address (STR #1799)
4004 + - Fixed the log message for BrowseRelay (STR #1798)
4005 + - Fixes to allow CUPS to compile on MirBSD (STR #1796)
4006 + - The scheduler incorrectly set the FINAL_CONTENT_TYPE
4007 + environment variable (STR #1795)
4008 + - The pdftops filter incorrectly embedded a "produced by"
4009 + comment, causing PDF printing not to work on some
4010 + operating systems (STR #1801)
4011 + - Sending raw jobs from a client system could cause the
4012 + client's scheduler to eventually crash (STR #1786)
4013 + - The scheduler now checks that the notifier exists prior
4014 + to accepting a new subscription request.
4015 + - The scheduler now reports the supported
4016 + notify-recipient schemes based on the contents of the
4017 + ServerBin/notifier directory.
4018 + - Event notifications did not include the
4019 + notify-sequence-number or other required attributes
4021 + - Allow/Deny addresses of the form "11.22.33.*" did not
4022 + work on Linux (STR #1769)
4023 + - cupsGetPPD() did not work if the scheduler was only
4024 + listening on a domain socket (STR #1766)
4025 + - The scheduler could crash advertising a class (STR
4027 + - The scheduler could crash if the default printer was
4028 + deleted (STR #1776)
4029 + - Added a new default CUPS raster format (v3) which does
4030 + not compress the raster stream in order to provide the
4031 + same cupsRasterReadPixels() and cupsRasterWritePixels()
4032 + performance as CUPS 1.1.x.
4033 + - The cupsaddsmb man page listed the wrong files for the
4035 + - Some configure --with options did not work (STR #1746)
4036 + - "Allow @IF(name)" didn't work if "name" wasn't the
4037 + first network interface (STR #1758)
4038 + - The lpstat command did not use the correct character
4039 + set when reporting the date and time (STR #1751)
4040 + - The cupsaddsmb command and web interface did not update
4041 + the Windows PPD files properly, resulting in corrupt
4042 + PPD files for the Windows client to use (STR #1750)
4043 + - The cupsd.conf man page didn't describe the Listen
4044 + domain socket syntax (STR #1753)
4045 + - The scheduler no longer tries to support more than
4046 + FD_SETSIZE file descriptors.
4047 + - CDSA (encryption) support fixes for MacOS X.
4048 + - The lppasswd program needs to be setuid to root to
4049 + create and update the /etc/cups/passwd.md5 file (STR
4051 + - 32/64-bit library installation was broken (STR #1741)
4052 + - The USB backend now reports a "no such device" error
4053 + when using the old filename-based USB URIs instead of
4054 + the "success" error.
4055 + - Increased the HTTP and IPP read timeouts to 10 seconds,
4056 + as 1 second was too short on congested networks (STR
4058 + - The SNMP backend now uses the device description over
4059 + the printer-make-and-model attribute when the attribute
4060 + contains a generic name (STR #1728)
4061 + - Fixed another file descriptor leak when printing raw
4063 + - Raw queues were not shared via LDAP (STR #1739)
4064 + - The pstops filter didn't always embed PageSetup
4065 + commands from the PPD file (STR #1740)
4066 + - "make install" didn't work if you disabled all of the
4068 + - The scheduler didn't always choose the least costly
4070 + - Fixed parsing of IPv6 addresses in Allow, Deny,
4071 + BrowseAllow, BrowseDeny, and BrowseRelay directives
4073 + - Printers that were shared via LDAP did not get added to
4074 + the LDAP server properly (STR #1733)
4075 + - LDAP browsing would crash the scheduler if a required
4076 + value was missing (STR #1731)
4077 + - Special cases for the "localhost" hostname did not
4078 + work, causing printing to not work when the /etc/hosts
4079 + file did not contain a localhost entry (STR #1723)
4080 + - Updated the Spanish translation (STR #1720, STR #1770)
4081 + - Reverse-order page output was broken when N-up or
4082 + landscape orientations were used (STR #1725)
4083 + - The parallel, serial, socket, and USB backends needed
4084 + print data before they would report back-channel data,
4085 + causing problems with several new drivers (STR #1724)
4088 CHANGES IN CUPS V1.2.1
4090 + - "lprm -h hostname" did not work (STR #1800)
4091 - The web interface did not handle reloads properly for
4093 - The configure script no longer adds linker rpath
4094 diff -durN release-1.2.1/config.h.in cups-1.2.x/config.h.in
4095 --- release-1.2.1/config.h.in 2006-07-04 17:35:29.000000000 +0100
4096 +++ cups-1.2.x/config.h.in 2006-06-26 12:45:38.000000000 +0100
4102 * Configuration file for the Common UNIX Printing System (CUPS).
4104 @@ -261,6 +261,13 @@
4108 + * Do we have <Security/SecBasePriv.h>?
4111 +#undef HAVE_SECBASEPRIV_H
4115 * Do we have the SLP library?
4119 #endif /* !_CUPS_CONFIG_H_ */
4125 diff -durN release-1.2.1/config-scripts/cups-compiler.m4 cups-1.2.x/config-scripts/cups-compiler.m4
4126 --- release-1.2.1/config-scripts/cups-compiler.m4 2006-07-04 17:32:16.000000000 +0100
4127 +++ cups-1.2.x/config-scripts/cups-compiler.m4 2006-07-04 17:28:24.000000000 +0100
4133 dnl Compiler stuff for the Common UNIX Printing System (CUPS).
4137 dnl Clear the debugging and non-shared library options unless the user asks
4141 -AC_SUBST(ARCHFLAGS)
4144 AC_ARG_WITH(optim, [ --with-optim="flags" set optimization flags ])
4145 -AC_ARG_WITH(archflags, [ --with-arch="flags" set default architecture flags ])
4147 AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging, default=no],
4148 [if test x$enable_debug = xyes; then
4152 +dnl Setup general architecture flags...
4153 +AC_ARG_WITH(archflags, [ --with-archflags="flags"
4154 + set default architecture flags ])
4156 +if test -z "$with_archflags"; then
4159 + ARCHFLAGS="$with_archflags"
4162 +AC_SUBST(ARCHFLAGS)
4164 dnl Setup support for separate 32/64-bit library generation...
4165 AC_ARG_ENABLE(32bit, [ --enable-32bit generate 32-bit libraries on 32/64-bit systems, default=no])
4166 -AC_ARG_WITH(arch32flags, [ --with-arch32="flags" specifies 32-bit architecture flags])
4167 +AC_ARG_WITH(arch32flags, [ --with-arch32flags="flags"
4168 + specifies 32-bit architecture flags])
4173 AC_SUBST(UNINSTALL32)
4175 AC_ARG_ENABLE(64bit, [ --enable-64bit generate 64-bit libraries on 32/64-bit systems, default=no])
4176 -AC_ARG_WITH(arch64flags, [ --with-arch64="flags" specifies 64-bit architecture flags])
4177 +AC_ARG_WITH(arch64flags, [ --with-arch64flags="flags"
4178 + specifies 64-bit architecture flags])
4182 @@ -118,17 +128,6 @@
4187 - if test -z "$with_archflags"; then
4188 - if test "x`uname -m`" = xi386; then
4189 - # Build universal binaries for OSX on Intel...
4190 - ARCHFLAGS="-arch i386 -arch ppc"
4193 - ARCHFLAGS="$with_archflags"
4198 if test "x$enable_32bit" = xyes; then
4199 # Build 32-bit libraries, 64-bit base...
4202 ARCHFLAGS="$with_arch64flags"
4205 - ARCHFLAGS="$with_archflags"
4211 ARCHFLAGS="$with_arch32flags"
4214 - ARCHFLAGS="$with_archflags"
4220 ARCHFLAGS="$with_arch64flags"
4223 - ARCHFLAGS="$with_archflags"
4229 ARCHFLAGS="$with_arch32flags"
4232 - ARCHFLAGS="$with_archflags"
4238 ARCHFLAGS="$with_arch64flags"
4241 - ARCHFLAGS="$with_archflags"
4247 ARCHFLAGS="$with_arch32flags"
4250 - ARCHFLAGS="$with_archflags"
4254 @@ -310,13 +297,6 @@
4255 # Warning 829 is passing constant string as char *
4256 CXXFLAGS="+W336,829 $CXXFLAGS"
4258 - if test -z "$with_archflags"; then
4259 - # Build portable binaries for all HP systems...
4260 - ARCHFLAGS="+DAportable"
4262 - ARCHFLAGS="$with_archflags"
4265 if test $PICFLAG = 1; then
4270 ARCHFLAGS="$with_arch64flags"
4273 - ARCHFLAGS="$with_archflags"
4279 ARCHFLAGS="$with_arch32flags"
4282 - ARCHFLAGS="$with_archflags"
4288 if test -z "$OPTIM"; then
4289 if test "x$with_optim" = x; then
4293 OPTIM="$with_optim $OPTIM"
4297 ARCHFLAGS="$with_arch64flags"
4300 - ARCHFLAGS="$with_archflags"
4303 if test "x$enable_64bit" = xyes; then
4306 ARCHFLAGS="$with_arch32flags"
4309 - ARCHFLAGS="$with_archflags"
4320 diff -durN release-1.2.1/config-scripts/cups-defaults.m4 cups-1.2.x/config-scripts/cups-defaults.m4
4321 --- release-1.2.1/config-scripts/cups-defaults.m4 2006-07-04 17:32:16.000000000 +0100
4322 +++ cups-1.2.x/config-scripts/cups-defaults.m4 2006-06-26 12:42:46.000000000 +0100
4328 dnl Default cupsd configuration settings for the Common UNIX Printing System
4333 dnl Default ConfigFilePerm
4334 -AC_ARG_WITH(config_perm, [ --with-config-file-perm set default ConfigFilePerm value, default=0640],
4335 +AC_ARG_WITH(config_file_perm, [ --with-config-file-perm set default ConfigFilePerm value, default=0640],
4336 CUPS_CONFIG_FILE_PERM="$withval",
4337 if test "x$uname" = xDarwin; then
4338 CUPS_CONFIG_FILE_PERM="644"
4340 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_CONFIG_FILE_PERM, 0$CUPS_CONFIG_FILE_PERM)
4342 dnl Default LogFilePerm
4343 -AC_ARG_WITH(log_perm, [ --with-log-file-perm set default LogFilePerm value, default=0644],
4344 +AC_ARG_WITH(log_file_perm, [ --with-log-file-perm set default LogFilePerm value, default=0644],
4345 CUPS_LOG_FILE_PERM="$withval",
4346 CUPS_LOG_FILE_PERM="644")
4347 AC_SUBST(CUPS_LOG_FILE_PERM)
4349 AC_SUBST(CUPS_BROWSING)
4351 dnl Default BrowseLocalProtocols
4352 -AC_ARG_WITH(browse_local, [ --with-local-protocols set default BrowseLocalProtocols, default="CUPS"],
4353 +AC_ARG_WITH(local_protocols, [ --with-local-protocols set default BrowseLocalProtocols, default="CUPS"],
4354 CUPS_BROWSE_LOCAL_PROTOCOLS="$withval",
4355 CUPS_BROWSE_LOCAL_PROTOCOLS="CUPS")
4356 AC_SUBST(CUPS_BROWSE_LOCAL_PROTOCOLS)
4358 "$CUPS_BROWSE_LOCAL_PROTOCOLS")
4360 dnl Default BrowseRemoteProtocols
4361 -AC_ARG_WITH(browse_remote, [ --with-remote-protocols set default BrowseRemoteProtocols, default="CUPS"],
4362 +AC_ARG_WITH(remote_protocols, [ --with-remote-protocols set default BrowseRemoteProtocols, default="CUPS"],
4363 CUPS_BROWSE_REMOTE_PROTOCOLS="$withval",
4364 CUPS_BROWSE_REMOTE_PROTOCOLS="CUPS")
4365 AC_SUBST(CUPS_BROWSE_REMOTE_PROTOCOLS)
4367 AC_SUBST(CUPS_USE_NETWORK_DEFAULT)
4369 dnl Determine the correct username and group for this OS...
4370 -AC_ARG_WITH(cups-user, [ --with-cups-user set default user for CUPS],
4371 +AC_ARG_WITH(cups_user, [ --with-cups-user set default user for CUPS],
4372 CUPS_USER="$withval",
4373 AC_MSG_CHECKING(for default print user)
4374 if test -f /etc/passwd; then
4376 AC_MSG_RESULT(no password file, using "$CUPS_USER")
4379 -AC_ARG_WITH(cups-group, [ --with-cups-group set default group for CUPS],
4380 +AC_ARG_WITH(cups_group, [ --with-cups-group set default group for CUPS],
4381 CUPS_GROUP="$withval",
4382 AC_MSG_CHECKING(for default print group)
4383 if test -f /etc/group; then
4385 AC_MSG_RESULT(no group file, using "$CUPS_GROUP")
4388 -AC_ARG_WITH(system-groups, [ --with-system-groups set default system groups for CUPS],
4389 +AC_ARG_WITH(system_groups, [ --with-system-groups set default system groups for CUPS],
4390 CUPS_SYSTEM_GROUPS="$withval",
4391 if test x$uname = xDarwin; then
4393 @@ -221,13 +221,25 @@
4394 dnl Default printcap file...
4395 AC_ARG_WITH(printcap, [ --with-printcap set default printcap file],
4396 default_printcap="$withval",
4397 - default_printcap="/etc/printcap")
4398 + default_printcap="default")
4400 if test x$enable_printcap != xno -a x$default_printcap != xno; then
4401 - if test "x$default_printcap" = "x/etc/printcap" -a "$uname" = "Darwin" -a $uversion -ge 90; then
4402 - CUPS_DEFAULT_PRINTCAP=""
4404 - CUPS_DEFAULT_PRINTCAP="$default_printcap"
4405 + if test "x$default_printcap" = "xdefault"; then
4408 + if test $uversion -ge 90; then
4409 + CUPS_DEFAULT_PRINTCAP=""
4411 + CUPS_DEFAULT_PRINTCAP="/etc/printcap"
4415 + CUPS_DEFAULT_PRINTCAP="/etc/printers.conf"
4418 + CUPS_DEFAULT_PRINTCAP="/etc/printcap"
4423 CUPS_DEFAULT_PRINTCAP=""
4425 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTCAP, "$CUPS_DEFAULT_PRINTCAP")
4431 diff -durN release-1.2.1/config-scripts/cups-directories.m4 cups-1.2.x/config-scripts/cups-directories.m4
4432 --- release-1.2.1/config-scripts/cups-directories.m4 2006-07-04 17:32:16.000000000 +0100
4433 +++ cups-1.2.x/config-scripts/cups-directories.m4 2006-06-28 09:59:03.000000000 +0100
4439 dnl Directory stuff for the Common UNIX Printing System (CUPS).
4443 if test x$rcdir = x; then
4445 - FreeBSD* | OpenBSD*)
4446 + FreeBSD* | OpenBSD* | MirBsD* | ekkoBSD*)
4447 # FreeBSD and OpenBSD
4451 AC_SUBST(CUPS_STATEDIR)
4457 diff -durN release-1.2.1/config-scripts/cups-image.m4 cups-1.2.x/config-scripts/cups-image.m4
4458 --- release-1.2.1/config-scripts/cups-image.m4 2006-07-04 17:32:16.000000000 +0100
4459 +++ cups-1.2.x/config-scripts/cups-image.m4 2006-06-26 12:42:46.000000000 +0100
4465 dnl Image library/filter stuff for the Common UNIX Printing System (CUPS).
4469 AC_SUBST(IMGFILTERS)
4471 -dnl Save the current libraries since we don't want the image libraries
4472 -dnl included with every program...
4475 dnl Check for image libraries...
4476 AC_ARG_ENABLE(jpeg, [ --enable-jpeg turn on JPEG support, default=yes])
4477 AC_ARG_ENABLE(png, [ --enable-png turn on PNG support, default=yes])
4482 +dnl Image libraries use math library functions...
4483 +AC_SEARCH_LIBS(pow, m)
4485 +dnl Save the current libraries since we don't want the image libraries
4486 +dnl included with every program...
4489 +dnl JPEG library...
4490 if test x$enable_jpeg != xno; then
4491 AC_CHECK_HEADER(jpeglib.h,
4492 AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
4494 AC_MSG_NOTICE([JPEG support disabled with --disable-jpeg.])
4497 +dnl ZLIB library...
4498 AC_CHECK_HEADER(zlib.h,
4499 AC_CHECK_LIB(z, gzgets,
4500 AC_DEFINE(HAVE_LIBZ)
4504 -dnl PNG library uses math library functions...
4505 -AC_CHECK_LIB(m, pow)
4508 if test x$enable_png != xno; then
4509 AC_CHECK_HEADER(png.h,
4510 AC_CHECK_LIB(png, png_create_read_struct,
4511 AC_DEFINE(HAVE_LIBPNG)
4512 - LIBPNG="-lpng -lm"))
4515 AC_MSG_NOTICE([PNG support disabled with --disable-png.])
4518 +dnl TIFF library...
4519 if test x$enable_tiff != xno; then
4520 AC_CHECK_HEADER(tiff.h,
4521 AC_CHECK_LIB(tiff, TIFFReadScanline,
4523 AC_CHECK_HEADER(stdlib.h,AC_DEFINE(HAVE_STDLIB_H))
4529 diff -durN release-1.2.1/config-scripts/cups-network.m4 cups-1.2.x/config-scripts/cups-network.m4
4530 --- release-1.2.1/config-scripts/cups-network.m4 2006-07-04 17:32:16.000000000 +0100
4531 +++ cups-1.2.x/config-scripts/cups-network.m4 2006-06-26 12:42:46.000000000 +0100
4537 dnl Networking stuff for the Common UNIX Printing System (CUPS).
4543 -AC_ARG_WITH(maxfiles, [ --with-maxfiles=N set maximum number of file descriptors for scheduler ],
4544 +AC_ARG_WITH(maxfiles, [ --with-maxfiles=N set maximum number of file descriptors for scheduler (deprecated) ],
4547 AC_DEFINE_UNQUOTED(CUPS_MAX_FDS, $maxfiles)
4549 AC_SUBST(CUPS_LISTEN_DOMAINSOCKET)
4555 diff -durN release-1.2.1/config-scripts/cups-sharedlibs.m4 cups-1.2.x/config-scripts/cups-sharedlibs.m4
4556 --- release-1.2.1/config-scripts/cups-sharedlibs.m4 2006-07-04 17:32:16.000000000 +0100
4557 +++ cups-1.2.x/config-scripts/cups-sharedlibs.m4 2006-06-26 12:42:46.000000000 +0100
4563 dnl Shared library support for the Common UNIX Printing System (CUPS).
4566 # rather than to the executables. This makes things smaller if you
4567 # are using any static libraries, and it also allows us to distribute
4568 # a single DSO rather than a bunch...
4569 - DSOLIBS="\$(LIBPNG) \$(LIBTIFF) \$(LIBJPEG) \$(LIBZ)"
4570 + DSOLIBS="\$(LIBTIFF) \$(LIBPNG) \$(LIBJPEG) \$(LIBZ)"
4573 # Tell the run-time linkers where to find a DSO. Some platforms
4574 @@ -126,46 +126,46 @@
4577 # HP-UX needs the path, even for /usr/lib...
4578 - DSOFLAGS="+s +b \$(libdir) $DSOFLAGS"
4579 - DSO32FLAGS="+s +b \$(LIB32DIR) $DSO32FLAGS"
4580 - DSO64FLAGS="+s +b \$(LIB64DIR) $DSO64FLAGS"
4581 - LDFLAGS="$LDFLAGS -Wl,+s,+b,\$(libdir)"
4582 - EXPORT_LDFLAGS="-Wl,+s,+b,\$(libdir)"
4583 + DSOFLAGS="+s +b $libdir $DSOFLAGS"
4584 + DSO32FLAGS="+s +b $LIB32DIR $DSO32FLAGS"
4585 + DSO64FLAGS="+s +b $LIB64DIR $DSO64FLAGS"
4586 + LDFLAGS="$LDFLAGS -Wl,+s,+b,$libdir"
4587 + EXPORT_LDFLAGS="-Wl,+s,+b,$libdir"
4591 if test $exec_prefix != /usr; then
4592 - DSOFLAGS="-R\$(libdir) $DSOFLAGS"
4593 - DSO32FLAGS="-R\$(LIB32DIR) $DSO32FLAGS"
4594 - DSO64FLAGS="-R\$(LIB64DIR) $DSO64FLAGS"
4595 - LDFLAGS="$LDFLAGS -R\$(libdir)"
4596 - EXPORT_LDFLAGS="-R\$(libdir)"
4597 + DSOFLAGS="-R$libdir $DSOFLAGS"
4598 + DSO32FLAGS="-R$LIB32DIR $DSO32FLAGS"
4599 + DSO64FLAGS="-R$LIB64DIR $DSO64FLAGS"
4600 + LDFLAGS="$LDFLAGS -R$libdir"
4601 + EXPORT_LDFLAGS="-R$libdir"
4606 if test $exec_prefix != /usr; then
4607 - DSOFLAGS="-Wl,-R\$(libdir) $DSOFLAGS"
4608 - DSO32FLAGS="-Wl,-R\$(LIB32DIR) $DSO32FLAGS"
4609 - DSO64FLAGS="-Wl,-R\$(LIB64DIR) $DSO64FLAGS"
4610 - LDFLAGS="$LDFLAGS -Wl,-R\$(libdir)"
4611 - EXPORT_LDFLAGS="-Wl,-R\$(libdir)"
4612 + DSOFLAGS="-Wl,-R$libdir $DSOFLAGS"
4613 + DSO32FLAGS="-Wl,-R$LIB32DIR $DSO32FLAGS"
4614 + DSO64FLAGS="-Wl,-R$LIB64DIR $DSO64FLAGS"
4615 + LDFLAGS="$LDFLAGS -Wl,-R$libdir"
4616 + EXPORT_LDFLAGS="-Wl,-R$libdir"
4620 # IRIX, Linux, and HURD...
4621 if test $exec_prefix != /usr; then
4622 - DSOFLAGS="-Wl,-rpath,\$(libdir) $DSOFLAGS"
4623 - DSO32FLAGS="-Wl,-rpath,\$(LIB32DIR) $DSO32FLAGS"
4624 - DSO64FLAGS="-Wl,-rpath,\$(LIB64DIR) $DSO64FLAGS"
4625 - LDFLAGS="$LDFLAGS -Wl,-rpath,\$(libdir)"
4626 - EXPORT_LDFLAGS="-Wl,-rpath,\$(libdir)"
4627 + DSOFLAGS="-Wl,-rpath,$libdir $DSOFLAGS"
4628 + DSO32FLAGS="-Wl,-rpath,$LIB32DIR $DSO32FLAGS"
4629 + DSO64FLAGS="-Wl,-rpath,$LIB64DIR $DSO64FLAGS"
4630 + LDFLAGS="$LDFLAGS -Wl,-rpath,$libdir"
4631 + EXPORT_LDFLAGS="-Wl,-rpath,$libdir"
4637 - IMGLIBS="\$(LIBPNG) \$(LIBTIFF) \$(LIBJPEG) \$(LIBZ)"
4638 + IMGLIBS="\$(LIBTIFF) \$(LIBPNG) \$(LIBJPEG) \$(LIBZ)"
4643 AC_SUBST(EXPORT_LDFLAGS)
4649 diff -durN release-1.2.1/config-scripts/cups-ssl.m4 cups-1.2.x/config-scripts/cups-ssl.m4
4650 --- release-1.2.1/config-scripts/cups-ssl.m4 2006-07-04 17:32:16.000000000 +0100
4651 +++ cups-1.2.x/config-scripts/cups-ssl.m4 2006-06-26 12:42:46.000000000 +0100
4657 dnl OpenSSL/GNUTLS stuff for the Common UNIX Printing System (CUPS).
4660 # certificates for CUPS, so don't enable encryption on
4661 # /admin just yet...
4662 #ENCRYPTION_REQUIRED=" Encryption Required"
4663 + AC_CHECK_HEADER(Security/SecBasePriv.h,AC_DEFINE(HAVE_SECBASEPRIV_H))
4665 AC_DEFINE(HAVE_CDSASSL)])
4674 diff -durN release-1.2.1/configure.in cups-1.2.x/configure.in
4675 --- release-1.2.1/configure.in 2006-07-04 17:35:29.000000000 +0100
4676 +++ cups-1.2.x/configure.in 2006-06-26 12:45:38.000000000 +0100
4682 dnl Configuration script for the Common UNIX Printing System (CUPS).
4685 sinclude(config-scripts/cups-pdf.m4)
4686 sinclude(config-scripts/cups-scripting.m4)
4688 +INSTALL_LANGUAGES=""
4689 +UNINSTALL_LANGUAGES=""
4691 if test "x$LANGUAGES" != x; then
4692 + INSTALL_LANGUAGES="install-languages"
4693 + UNINSTALL_LANGUAGES="uninstall-languages"
4694 for lang in $LANGUAGES; do
4695 LANGFILES="$LANGFILES doc/$lang/index.html"
4696 LANGFILES="$LANGFILES templates/$lang/edit-config.tmpl"
4701 +AC_SUBST(INSTALL_LANGUAGES)
4702 +AC_SUBST(UNINSTALL_LANGUAGES)
4704 AC_OUTPUT(Makedefs packaging/cups.list init/cups.sh init/cups-lpd cups-config
4705 conf/cupsd.conf conf/pam.std doc/index.html
4706 doc/help/standard.html man/client.conf.man
4708 chmod +x cups-config
4714 diff -durN release-1.2.1/cups/adminutil.c cups-1.2.x/cups/adminutil.c
4715 --- release-1.2.1/cups/adminutil.c 2006-07-04 17:32:59.000000000 +0100
4716 +++ cups-1.2.x/cups/adminutil.c 2006-06-26 12:43:29.000000000 +0100
4722 * Administration utility API definitions for the Common UNIX Printing
4724 @@ -222,18 +222,18 @@
4727 cupsFilePrintf(dstfp, "*%% Commented out for CUPS Windows Driver...\n"
4728 - "*%%%s", line + 1);
4729 + "*%%%s\n", line + 1);
4732 else if (!strncmp(line, "*JCLOpenUI", 10))
4735 - cupsFilePuts(dstfp, line);
4736 + cupsFilePrintf(dstfp, "%s\n", line);
4738 else if (!strncmp(line, "*JCLCloseUI", 11))
4741 - cupsFilePuts(dstfp, line);
4742 + cupsFilePrintf(dstfp, "%s\n", line);
4744 else if (jcloption &&
4745 strncmp(line, "*End", 4) &&
4746 @@ -312,12 +312,13 @@
4749 snprintf(ptr + 1, sizeof(line) - (ptr - line + 1),
4750 - "%%cupsJobTicket: %s=%s\n\"\n*End\n", option, choice);
4751 + "%%cupsJobTicket: %s=%s\n\"\n*End", option, choice);
4753 - cupsFilePrintf(dstfp, "*%% Changed for CUPS Windows Driver...\n%s", line);
4754 + cupsFilePrintf(dstfp, "*%% Changed for CUPS Windows Driver...\n%s\n",
4758 - cupsFilePuts(dstfp, line);
4759 + cupsFilePrintf(dstfp, "%s\n", line);
4762 cupsFileClose(srcfp);
4763 @@ -1927,5 +1928,5 @@
4770 diff -durN release-1.2.1/cups/emit.c cups-1.2.x/cups/emit.c
4771 --- release-1.2.1/cups/emit.c 2006-07-04 17:32:59.000000000 +0100
4772 +++ cups-1.2.x/cups/emit.c 2006-06-28 09:59:04.000000000 +0100
4778 * PPD code emission routines for the Common UNIX Printing System (CUPS).
4786 #if defined(WIN32) || defined(__EMX__)
4789 ppd_choice_t **collect; /* Collected choices */
4792 + DEBUG_printf(("ppdCollect2(ppd=%p, section=%d, min_order=%f, choices=%p)\n",
4793 + ppd, section, min_order, choices));
4799 for (k = o->num_choices, c = o->choices; k > 0; k --, c ++)
4800 if (c->marked && count < 1000)
4802 + DEBUG_printf(("ppdCollect2: %s=%s marked...\n", o->keyword,
4808 for (m = o->num_choices, c = o->choices; m > 0; m --, c ++)
4809 if (c->marked && count < 1000)
4811 + DEBUG_printf(("ppdCollect2: %s=%s marked...\n", o->keyword,
4817 qsort(collect, count, sizeof(ppd_choice_t *),
4818 (int (*)(const void *, const void *))ppd_sort);
4820 + DEBUG_printf(("ppdCollect2: %d marked choices...\n", count));
4823 * Return the array and number of choices; if 0, free the array since
4826 struct lconv *loc; /* Locale data */
4829 + DEBUG_printf(("ppdEmitString(ppd=%p, section=%d, min_order=%f)\n",
4830 + ppd, section, min_order));
4833 * Range check input...
4836 !strcasecmp(choices[i]->option->keyword, "PageRegion")) &&
4837 !strcasecmp(choices[i]->choice, "Custom"))
4839 + DEBUG_puts("ppdEmitString: Custom size set!");
4841 bufsize += 37; /* %%BeginFeature: *CustomPageSize True\n */
4842 bufsize += 50; /* Five 9-digit numbers + newline */
4845 * Allocate memory...
4848 + DEBUG_printf(("ppdEmitString: Allocating %d bytes for string...\n", bufsize));
4850 if ((buffer = calloc(1, bufsize)) == NULL)
4854 * Send DSC comments with option...
4857 + DEBUG_printf(("Adding code for %s=%s...\n", choices[i]->option->keyword,
4858 + choices[i]->choice));
4860 if ((!strcasecmp(choices[i]->option->keyword, "PageSize") ||
4861 !strcasecmp(choices[i]->option->keyword, "PageRegion")) &&
4862 !strcasecmp(choices[i]->choice, "Custom"))
4864 strlcpy(bufptr, "%%EndFeature\n"
4865 "} stopped cleartomark\n", bufend - bufptr + 1);
4866 bufptr += strlen(bufptr);
4868 + DEBUG_printf(("ppdEmitString: Offset in string is %d...\n",
4869 + bufptr - buffer));
4880 diff -durN release-1.2.1/cups/http-addrlist.c cups-1.2.x/cups/http-addrlist.c
4881 --- release-1.2.1/cups/http-addrlist.c 2006-07-04 17:32:59.000000000 +0100
4882 +++ cups-1.2.x/cups/http-addrlist.c 2006-06-26 12:43:29.000000000 +0100
4888 * HTTP address list routines for the Common UNIX Printing System (CUPS).
4891 if (host->h_addrtype == AF_INET6)
4893 temp->addr.ipv6.sin6_family = AF_INET6;
4894 - memcpy(&(temp->addr.ipv6), host->h_addr_list[i],
4895 + memcpy(&(temp->addr.ipv6.sin6_addr), host->h_addr_list[i],
4896 sizeof(temp->addr.ipv6));
4897 temp->addr.ipv6.sin6_port = htons(portnum);
4900 # endif /* AF_INET6 */
4902 temp->addr.ipv4.sin_family = AF_INET;
4903 - memcpy(&(temp->addr.ipv4), host->h_addr_list[i],
4904 + memcpy(&(temp->addr.ipv4.sin_addr), host->h_addr_list[i],
4905 sizeof(temp->addr.ipv4));
4906 temp->addr.ipv4.sin_port = htons(portnum);
4909 temp->addr.ipv6.sin6_addr.s6_addr32[3] = htonl(1);
4919 temp->addr.ipv4.sin_port = htons(portnum);
4920 temp->addr.ipv4.sin_addr.s_addr = htonl(0x7f000001);
4929 temp->addr.ipv6.sin6_family = AF_INET6;
4930 temp->addr.ipv6.sin6_port = htons(portnum);
4939 temp->addr.ipv4.sin_family = AF_INET;
4940 temp->addr.ipv4.sin_port = htons(portnum);
4955 diff -durN release-1.2.1/cups/http.c cups-1.2.x/cups/http.c
4956 --- release-1.2.1/cups/http.c 2006-07-04 17:32:59.000000000 +0100
4957 +++ cups-1.2.x/cups/http.c 2006-06-26 12:43:29.000000000 +0100
4963 * HTTP routines for the Common UNIX Printing System (CUPS).
4966 * No newline; see if there is more data to be read...
4969 - if (!http->blocking && !http_wait(http, 1000))
4970 + if (!http->blocking && !http_wait(http, 10000))
4972 DEBUG_puts("httpGets: Timed out!");
4973 http->error = ETIMEDOUT;
4974 @@ -1222,7 +1222,7 @@
4975 * Buffer small reads for better performance...
4978 - if (!http->blocking && !httpWait(http, 1000))
4979 + if (!http->blocking && !httpWait(http, 10000))
4982 if (http->data_remaining > sizeof(http->buffer))
4983 @@ -1285,7 +1285,7 @@
4987 - if (!http->blocking && !httpWait(http, 1000))
4988 + if (!http->blocking && !httpWait(http, 10000))
4991 bytes = http_read_ssl(http, buffer, length);
4992 @@ -1293,7 +1293,7 @@
4993 #endif /* HAVE_SSL */
4996 - if (!http->blocking && !httpWait(http, 1000))
4997 + if (!http->blocking && !httpWait(http, 10000))
5000 DEBUG_printf(("httpRead2: reading %d bytes from socket...\n", length));
5001 @@ -1415,13 +1415,11 @@
5005 - result = errSSLClosedAbort;
5006 + result = errSSLClosedGraceful;
5007 else if (errno == EAGAIN)
5008 result = errSSLWouldBlock;
5009 - else if (errno == EPIPE)
5010 - result = errSSLClosedAbort;
5012 - result = errSSLInternal;
5013 + result = errSSLClosedAbort;
5017 @@ -1994,10 +1992,8 @@
5019 if (errno == EAGAIN)
5020 result = errSSLWouldBlock;
5021 - else if (errno == EPIPE)
5022 - result = errSSLClosedAbort;
5024 - result = errSSLInternal;
5025 + result = errSSLClosedAbort;
5029 @@ -2338,6 +2334,9 @@
5030 error = SSLSetAllowsAnyRoot(conn->session, true);
5033 + error = SSLSetProtocolVersionEnabled(conn->session, kSSLProtocol2, false);
5037 while ((error = SSLHandshake(conn->session)) == errSSLWouldBlock)
5039 @@ -2802,5 +2801,5 @@
5046 diff -durN release-1.2.1/cups/http.h cups-1.2.x/cups/http.h
5047 --- release-1.2.1/cups/http.h 2006-07-04 17:32:59.000000000 +0100
5048 +++ cups-1.2.x/cups/http.h 2006-06-28 09:59:04.000000000 +0100
5054 * Hyper-Text Transport Protocol definitions for the Common UNIX Printing
5057 #if defined(AF_INET6) && !defined(s6_addr32)
5059 # define s6_addr32 _S6_un._S6_u32
5060 -# elif defined(__FreeBSD__) || defined(__APPLE__)
5061 +# elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
5062 # define s6_addr32 __u6_addr.__u6_addr32
5063 # elif defined(__osf__)
5064 # define s6_addr32 s6_un.sa6_laddr
5065 @@ -322,6 +322,14 @@
5067 typedef struct _http_s /**** HTTP connection structure. ****/
5070 + * DO NOT ACCESS MEMBERS OF THIS STRUCTURE DIRECTLY; INSTEAD, USE THE
5071 + * PROVIDED APIS FOR ACCESSING THE VALUES INSTEAD.
5073 + * This structure definition will be removed from the public headers in
5077 int fd; /* File descriptor for this socket */
5078 int blocking; /* To block or not to block */
5079 int error; /* Last error on read */
5081 #endif /* !_CUPS_HTTP_H_ */
5087 diff -durN release-1.2.1/cups/ipp.c cups-1.2.x/cups/ipp.c
5088 --- release-1.2.1/cups/ipp.c 2006-07-04 17:32:59.000000000 +0100
5089 +++ cups-1.2.x/cups/ipp.c 2006-06-26 12:43:29.000000000 +0100
5095 * Internet Printing Protocol support functions for the Common UNIX
5096 * Printing System (CUPS).
5097 @@ -2742,10 +2742,10 @@
5098 if (!http->blocking)
5101 - * Wait up to 1 second for more data on non-blocking sockets...
5102 + * Wait up to 10 seconds for more data on non-blocking sockets...
5105 - if (!httpWait(http, 1000))
5106 + if (!httpWait(http, 10000))
5110 @@ -2824,5 +2824,5 @@
5117 diff -durN release-1.2.1/cups/Makefile cups-1.2.x/cups/Makefile
5118 --- release-1.2.1/cups/Makefile 2006-07-04 17:32:59.000000000 +0100
5119 +++ cups-1.2.x/cups/Makefile 2006-06-26 12:43:29.000000000 +0100
5125 # API library Makefile for the Common UNIX Printing System (CUPS).
5129 $(RM) $(OBJS) $(TARGETS)
5130 $(RM) libcups.so libcups.sl libcups.dylib
5131 - $(RM) -r 32bit 64it
5132 + $(RM) -r 32bit 64bit
5136 @@ -186,12 +186,12 @@
5138 $(INSTALL_DIR) -m 755 $(LIB32DIR)
5139 $(INSTALL_LIB) 32bit/libcups.so.2 $(LIB32DIR)/libcups.so.2
5140 - $(LN) libcups.so $(LIB32DIR)/libcups.so.2
5141 + $(LN) libcups.so.2 $(LIB32DIR)/libcups.so
5144 $(INSTALL_DIR) -m 755 $(LIB64DIR)
5145 $(INSTALL_LIB) 64bit/libcups.so.2 $(LIB64DIR)/libcups.so.2
5146 - $(LN) libcups.so $(LIB64DIR)/libcups.so.2
5147 + $(LN) libcups.so.2 $(LIB64DIR)/libcups.so
5158 diff -durN release-1.2.1/cups/mark.c cups-1.2.x/cups/mark.c
5159 --- release-1.2.1/cups/mark.c 2006-07-04 17:32:59.000000000 +0100
5160 +++ cups-1.2.x/cups/mark.c 2006-06-28 09:59:04.000000000 +0100
5166 * Option marking routines for the Common UNIX Printing System (CUPS).
5169 ppd_cparam_t *cparam; /* Custom parameter */
5170 char *units; /* Custom points units */
5173 if ((coption = ppdFindCustomOption(ppd, option)) != NULL)
5175 if ((cparam = (ppd_cparam_t *)cupsArrayFirst(coption->params)) == NULL)
5176 @@ -455,6 +456,12 @@
5182 + * Make sure that we keep the option marked below...
5185 + choice = "Custom";
5187 else if (choice[0] == '{')
5196 diff -durN release-1.2.1/cups/testhttp.c cups-1.2.x/cups/testhttp.c
5197 --- release-1.2.1/cups/testhttp.c 2006-07-04 17:32:59.000000000 +0100
5198 +++ cups-1.2.x/cups/testhttp.c 2006-06-26 12:43:29.000000000 +0100
5204 * HTTP test program for the Common UNIX Printing System (CUPS).
5206 - * Copyright 1997-2005 by Easy Software Products.
5207 + * Copyright 1997-2006 by Easy Software Products.
5209 * These coded instructions, statements, and computer programs are the
5210 * property of Easy Software Products and are protected by Federal
5211 @@ -311,9 +311,21 @@
5212 addrlist = httpAddrGetList(hostname, AF_UNSPEC, NULL);
5215 - for (i = 0, addr = addrlist; addr; i ++, addr = addr->next);
5216 + for (i = 0, addr = addrlist; addr; i ++, addr = addr->next)
5218 + char numeric[1024]; /* Numeric IP address */
5221 + httpAddrString(&(addr->addr), numeric, sizeof(numeric));
5222 + if (!strcmp(numeric, "UNKNOWN"))
5227 + printf("FAIL (bad address for %s)\n", hostname);
5229 + printf("PASS (%d address(es) for %s)\n", i, hostname);
5231 - printf("PASS (%d address(es) for %s)\n", i, hostname);
5232 httpAddrFreeList(addrlist);
5242 diff -durN release-1.2.1/cups/testppd.c cups-1.2.x/cups/testppd.c
5243 --- release-1.2.1/cups/testppd.c 2006-07-04 17:32:59.000000000 +0100
5244 +++ cups-1.2.x/cups/testppd.c 2006-06-28 09:59:04.000000000 +0100
5250 * PPD test program for the Common UNIX Printing System (CUPS).
5253 "%%BeginFeature: *InputSlot Tray\n"
5256 + "} stopped cleartomark\n"
5258 + "%%BeginFeature: *IntOption None\n"
5260 + "} stopped cleartomark\n"
5262 + "%%BeginFeature: *StringOption None\n"
5264 + "} stopped cleartomark\n";
5266 +static const char *custom_code =
5268 + "%%BeginFeature: *CustomPageSize True\n"
5274 + "PageSize=Custom\n"
5276 + "} stopped cleartomark\n"
5278 + "%%BeginFeature: *InputSlot Tray\n"
5279 + "InputSlot=Tray\n"
5281 + "} stopped cleartomark\n"
5283 + "%%BeginFeature: *IntOption None\n"
5285 + "} stopped cleartomark\n"
5287 + "%%BeginFeature: *StringOption None\n"
5289 "} stopped cleartomark\n";
5293 printf("FAIL (%d conflicts)\n", conflicts);
5296 - fputs("ppdEmitString: ", stdout);
5297 + fputs("ppdEmitString (defaults): ", stdout);
5298 if ((s = ppdEmitString(ppd, PPD_ORDER_ANY, 0.0)) != NULL &&
5299 !strcmp(s, default_code))
5301 @@ -123,6 +156,24 @@
5305 + fputs("ppdEmitString (custom size): ", stdout);
5306 + ppdMarkOption(ppd, "PageSize", "Custom.400x500");
5308 + if ((s = ppdEmitString(ppd, PPD_ORDER_ANY, 0.0)) != NULL &&
5309 + !strcmp(s, custom_code))
5313 + printf("FAIL (%d bytes instead of %d)\n", s ? (int)strlen(s) : 0,
5314 + (int)strlen(custom_code));
5333 diff -durN release-1.2.1/cups/util.c cups-1.2.x/cups/util.c
5334 --- release-1.2.1/cups/util.c 2006-07-04 17:32:59.000000000 +0100
5335 +++ cups-1.2.x/cups/util.c 2006-06-26 12:43:29.000000000 +0100
5341 * Printing utilities for the Common UNIX Printing System (CUPS).
5344 const char *name) /* I - Printer name */
5346 int http_port; /* Port number */
5347 + char http_hostname[HTTP_MAX_HOST];
5348 + /* Hostname associated with connection */
5349 http_t *http2; /* Alternate HTTP connection */
5350 int fd; /* PPD file */
5351 char localhost[HTTP_MAX_URI],/* Local hostname */
5352 @@ -845,9 +847,11 @@
5353 strcpy(hostname, "localhost");
5356 - * Get the port number we are connected to...
5357 + * Get the hostname and port number we are connected to...
5360 + httpGetHostname(http, http_hostname, sizeof(http_hostname));
5363 if (http->hostaddr->addr.sa_family == AF_INET6)
5364 http_port = ntohs(http->hostaddr->ipv6.sin6_port);
5366 * Reconnect to the correct server as needed...
5369 - if (!strcasecmp(http->hostname, hostname) && port == http_port)
5370 + if (!strcasecmp(http_hostname, hostname) && port == http_port)
5372 else if ((http2 = httpConnectEncrypt(hostname, port,
5373 cupsEncryption())) == NULL)
5374 @@ -1394,7 +1398,8 @@
5375 char *printer, /* O - Printer name [HTTP_MAX_URI] */
5376 char *hostname) /* O - Hostname [HTTP_MAX_URI] */
5378 - char hostbuf[HTTP_MAX_URI]; /* Name of host */
5379 + char hostbuf[HTTP_MAX_URI], /* Name of host */
5380 + http_hostname[HTTP_MAX_HOST]; /* Hostname associated with connection */
5381 _cups_globals_t *cg = _cupsGlobals();/* Pointer to library globals */
5384 @@ -1415,6 +1420,8 @@
5386 strlcpy(hostbuf, cupsServer(), sizeof(hostbuf));
5388 + httpGetHostname(cg->http, http_hostname, sizeof(http_hostname));
5390 if (hostname != NULL)
5391 strlcpy(hostname, hostbuf, HTTP_MAX_URI);
5393 @@ -1427,7 +1434,7 @@
5395 if (cg->http != NULL)
5397 - if (!strcasecmp(cg->http->hostname, hostname))
5398 + if (!strcasecmp(http_hostname, hostname))
5401 httpClose(cg->http);
5402 @@ -1473,7 +1480,9 @@
5403 char uri[HTTP_MAX_URI], /* printer-uri attribute */
5404 scheme[HTTP_MAX_URI], /* Scheme name */
5405 username[HTTP_MAX_URI], /* Username:password */
5406 - classname[255]; /* Temporary class name */
5407 + classname[255], /* Temporary class name */
5408 + http_hostname[HTTP_MAX_HOST];
5409 + /* Hostname associated with connection */
5410 static const char * const requested_attrs[] =
5411 { /* Requested attributes */
5412 "printer-uri-supported",
5413 @@ -1505,9 +1514,11 @@
5414 DEBUG_printf(("cups_get_printer_uri: printer-uri=\"%s\"\n", uri));
5417 - * Get the port number we are connected to...
5418 + * Get the hostname and port number we are connected to...
5421 + httpGetHostname(http, http_hostname, sizeof(http_hostname));
5424 if (http->hostaddr->addr.sa_family == AF_INET6)
5425 http_port = ntohs(http->hostaddr->ipv6.sin6_port);
5426 @@ -1585,7 +1596,7 @@
5427 * Found a class! Connect to the right server...
5430 - if (!strcasecmp(http->hostname, host) && *port == http_port)
5431 + if (!strcasecmp(http_hostname, host) && *port == http_port)
5433 else if ((http2 = httpConnectEncrypt(host, *port,
5434 cupsEncryption())) == NULL)
5435 @@ -1641,5 +1652,5 @@
5442 diff -durN release-1.2.1/cups-config.in cups-1.2.x/cups-config.in
5443 --- release-1.2.1/cups-config.in 2006-07-04 17:35:29.000000000 +0100
5444 +++ cups-1.2.x/cups-config.in 2006-06-26 12:45:38.000000000 +0100
5451 # CUPS configuration utility.
5454 # flags for C++ compiler:
5456 LDFLAGS="@EXPORT_LDFLAGS@"
5457 -LIBS="@EXPORT_SSLLIBS@ @LIBS@"
5458 -IMGLIBS="@EXPORT_LIBTIFF@ @EXPORT_LIBJPEG@ @EXPORT_LIBPNG@ @EXPORT_LIBZ@"
5459 +LIBS="@EXPORT_SSLLIBS@ @EXPORT_LIBZ@ @LIBS@"
5460 +IMGLIBS="@EXPORT_LIBTIFF@ @EXPORT_LIBJPEG@ @EXPORT_LIBPNG@"
5462 # Check for local invocation...
5463 selfdir=`dirname $0`
5465 LDFLAGS="-L$selfdir/cups -L$selfdir/filter $LDFLAGS"
5466 libdir="$selfdir/cups"
5467 imagelibdir="$selfdir/filter"
5468 - if test ! -e "$selfdir/cups/raster.h"; then
5469 + if test ! -f "$selfdir/cups/raster.h"; then
5470 ln -s ../filter/raster.h "$selfdir/cups"
5473 @@ -115,13 +115,13 @@
5474 if test $image = no; then
5477 - echo -lcupsimage $IMGLIBS -lcups $LIBS
5478 + echo -lcupsimage -lcups $IMGLIBS $LIBS
5481 if test $image = no; then
5482 echo $libdir/libcups.a $LIBS
5484 - echo $imagelibdir/libcupsimage.a $IMGLIBS $libdir/libcups.a $LIBS
5485 + echo $imagelibdir/libcupsimage.a $libdir/libcups.a $IMGLIBS $LIBS
5496 diff -durN release-1.2.1/doc/help/spec-raster.html cups-1.2.x/doc/help/spec-raster.html
5497 --- release-1.2.1/doc/help/spec-raster.html 2006-07-04 17:32:27.000000000 +0100
5498 +++ cups-1.2.x/doc/help/spec-raster.html 2006-06-26 12:42:55.000000000 +0100
5500 a printable format.</P>
5502 <P>CUPS 1.0 and 1.1 used a version 1 raster format. CUPS 1.2
5503 -introduces a version 2 format that is a superset of the version 1
5504 -format. Applications using the CUPS Imaging API (the cupsRaster*
5505 -functions) can read both formats without code changes.</P>
5506 +introduces version 2 (compressed) and version 3 (uncompressed)
5507 +formats that are a superset of the version 1 format. Applications
5508 +using the CUPS Imaging API (the cupsRaster* functions) can read
5509 +all formats without code changes.</P>
5511 <P>The registered MIME media type for CUPS raster files is
5512 <CODE>application/vnd.cups-raster</CODE>.</P>
5513 @@ -485,6 +486,22 @@
5514 followed by the color value bytes.</P>
5517 +<H2 CLASS="title"><A NAME="V3">Version 3 Raster File Format</A></H2>
5519 +<P>A version 3 raster file begins with a 32-bit synchronization
5520 +word: 0x52615333 ("RaS3") for big-endian architectures and
5521 +0x33536152 ("3SaR") for little-endian architectures. The writer
5522 +of the raster file will use the native word order, and the reader
5523 +is responsible for detecting a reversed word order file and
5524 +swapping bytes as needed. The CUPS Imaging API raster functions
5525 +perform this function automatically.</P>
5527 +<P>Following the synchronization word are a series of raster
5528 +pages. Each page starts with a version 2 page device dictionary
5529 +header and is followed immediately by the uncompressed raster data
5533 <H2 CLASS="title"><A NAME="ENCODING">Pixel Value Coding</A></H2>
5535 <P>The following sections describe the encoding and decoding of
5536 @@ -673,6 +690,15 @@
5538 <H2 CLASS="title"><A NAME="HISTORY">Change History</A></H2>
5540 +<H3>Changes in CUPS 1.2.2</H3>
5544 + <li>Added version 3 (uncompressed) format.</li>
5549 <H3>Changes in CUPS 1.2.1</H3>
5552 cups-1.2.x/doc/ja/.svn/wcprops/index.html.in.svn-work
5553 diff -durN release-1.2.1/doc/Makefile cups-1.2.x/doc/Makefile
5554 --- release-1.2.1/doc/Makefile 2006-07-04 17:32:35.000000000 +0100
5555 +++ cups-1.2.x/doc/Makefile 2006-06-26 12:43:01.000000000 +0100
5561 # Documentation makefile for the Common UNIX Printing System (CUPS).
5564 # Install all documentation files...
5568 +install: all $(INSTALL_LANGUAGES)
5569 $(INSTALL_DIR) -m 755 $(DOCDIR)
5570 for file in $(WEBPAGES); do \
5571 $(INSTALL_MAN) $$file $(DOCDIR); \
5573 for file in $(WEBIMAGES) $(WEBBUTTONS); do \
5574 $(INSTALL_MAN) $$file $(DOCDIR)/images; \
5578 for lang in $(LANGUAGES); do \
5579 $(INSTALL_DIR) -m 755 $(DOCDIR)/$$lang/images; \
5580 if test -f $$lang/index.html; then \
5582 # Unnstall all documentation files...
5586 +uninstall: $(UNINSTALL_LANGUAGES)
5587 for file in $(WEBPAGES); do \
5588 $(RM) $(DOCDIR)/$$file; \
5590 @@ -240,6 +242,11 @@
5591 for file in $(WEBIMAGES) $(WEBBUTTONS); do \
5592 $(INSTALL_MAN) $(DOCDIR)/images/$$file; \
5594 + -$(RMDIR) $(DOCDIR)/images
5595 + -$(RMDIR) $(DOCDIR)/help
5596 + -$(RMDIR) $(DOCDIR)
5598 +uninstall-languages:
5599 -for lang in $(LANGUAGES); do \
5600 $(RM) $(DOCDIR)/$$lang/index.html; \
5601 for file in $(WEBBUTTONS); do \
5603 $(RMDIR) $(DOCDIR)/$$lang/images; \
5604 $(RMDIR) $(DOCDIR)/$$lang; \
5606 - -$(RMDIR) $(DOCDIR)/images
5607 - -$(RMDIR) $(DOCDIR)/help
5608 - -$(RMDIR) $(DOCDIR)
5612 diff -durN release-1.2.1/filter/Makefile cups-1.2.x/filter/Makefile
5613 --- release-1.2.1/filter/Makefile 2006-07-04 17:35:19.000000000 +0100
5614 +++ cups-1.2.x/filter/Makefile 2006-06-26 12:45:28.000000000 +0100
5620 # Filter makefile for the Common UNIX Printing System (CUPS).
5631 FORMOBJS = form-attr.o form-main.o form-ps.o form-text.o form-tree.o
5632 OBJS = $(HPGLOBJS) $(IMAGEOBJS) $(FORMOBJS) \
5633 gziptoany.o imagetops.o imagetoraster.o common.o pstops.o \
5634 - raster.o rastertoepson.o rastertohp.o rastertolabel.o \
5635 + rasterbench.o rastertoepson.o rastertohp.o rastertolabel.o \
5636 testimage.o testraster.o textcommon.o texttops.o
5639 @@ -118,12 +119,12 @@
5641 $(INSTALL_DIR) -m 755 $(LIB32DIR)
5642 $(INSTALL_LIB) 32bit/libcupsimage.so.2 $(LIB32DIR)/libcupsimage.so.2
5643 - $(LN) libcupsimage.so $(LIB32DIR)/libcupsimage.so.2
5644 + $(LN) libcupsimage.so.2 $(LIB32DIR)/libcupsimage.so
5647 $(INSTALL_DIR) -m 755 $(LIB64DIR)
5648 $(INSTALL_LIB) 64bit/libcupsimage.so.2 $(LIB64DIR)/libcupsimage.so.2
5649 - $(LN) libcupsimage.so $(LIB64DIR)/libcupsimage.so.2
5650 + $(LN) libcupsimage.so.2 $(LIB64DIR)/libcupsimage.so
5654 @@ -360,6 +361,15 @@
5661 +rasterbench: rasterbench.o raster.o
5662 + echo Linking $@...
5663 + $(CC) $(LDFLAGS) -o $@ rasterbench.o raster.o
5677 diff -durN release-1.2.1/filter/pstops.c cups-1.2.x/filter/pstops.c
5678 --- release-1.2.1/filter/pstops.c 2006-07-04 17:35:19.000000000 +0100
5679 +++ cups-1.2.x/filter/pstops.c 2006-06-26 12:45:28.000000000 +0100
5685 * PostScript filter for the Common UNIX Printing System (CUPS).
5688 * set_pstops_options() - Set pstops options...
5689 * skip_page() - Skip past a page that won't be printed...
5690 * start_nup() - Start processing for N-up printing...
5691 + * write_labels() - Write the actual page labels.
5697 static void start_nup(pstops_doc_t *doc, int number,
5698 int show_border, const int *bounding_box);
5699 +static void write_labels(pstops_doc_t *doc, int orient);
5703 @@ -1305,6 +1307,9 @@
5707 + char *page_setup; /* PageSetup commands to send */
5710 doc_puts(doc, "%%BeginPageSetup\n");
5712 if (pageinfo->num_options > 0)
5713 @@ -1344,20 +1349,28 @@
5718 doc_puts(doc, doc_setup);
5724 doc_puts(doc, any_setup);
5730 - * Free the command strings...
5733 + * Output commands for the current page...
5738 + page_setup = ppdEmitString(ppd, PPD_ORDER_PAGE, 0);
5744 + doc_puts(doc, page_setup);
5749 @@ -1856,15 +1869,15 @@
5750 int number) /* I - Page number */
5752 if (doc->mirror || Orientation || doc->number_up > 1)
5753 - puts("userdict/ESPsave get restore");
5754 + doc_puts(doc, "userdict/ESPsave get restore\n");
5756 switch (doc->number_up)
5759 if (doc->use_ESPshowpage)
5761 - WriteLabels(Orientation);
5762 - puts("ESPshowpage");
5763 + write_labels(doc, Orientation);
5764 + doc_puts(doc, "ESPshowpage\n");
5768 @@ -1878,7 +1891,7 @@
5769 * Rotate the labels back to portrait...
5772 - WriteLabels(Orientation - 1);
5773 + write_labels(doc, Orientation - 1);
5775 else if (Orientation == 0)
5777 @@ -1886,7 +1899,7 @@
5778 * Rotate the labels to landscape...
5781 - WriteLabels(doc->normal_landscape ? 1 : 3);
5782 + write_labels(doc, doc->normal_landscape ? 1 : 3);
5786 @@ -1894,18 +1907,18 @@
5787 * Rotate the labels to landscape...
5790 - WriteLabels(doc->normal_landscape ? 3 : 1);
5791 + write_labels(doc, doc->normal_landscape ? 3 : 1);
5794 - puts("ESPshowpage");
5795 + doc_puts(doc, "ESPshowpage\n");
5800 if (is_last_page(number) && doc->use_ESPshowpage)
5802 - WriteLabels(Orientation);
5803 - puts("ESPshowpage");
5804 + write_labels(doc, Orientation);
5805 + doc_puts(doc, "ESPshowpage\n");
5809 @@ -2935,5 +2948,51 @@
5814 + * 'write_labels()' - Write the actual page labels.
5816 + * This function is a copy of the one in common.c since we need to
5817 + * use doc_puts/doc_printf instead of puts/printf...
5821 +write_labels(pstops_doc_t *doc, /* I - Document information */
5822 + int orient) /* I - Orientation of the page */
5824 + float width, /* Width of page */
5825 + length; /* Length of page */
5828 + doc_puts(doc, "gsave\n");
5830 + if ((orient ^ Orientation) & 1)
5832 + width = PageLength;
5833 + length = PageWidth;
5837 + width = PageWidth;
5838 + length = PageLength;
5841 + switch (orient & 3)
5843 + case 1 : /* Landscape */
5844 + doc_printf(doc, "%.1f 0.0 translate 90 rotate\n", length);
5846 + case 2 : /* Reverse Portrait */
5847 + doc_printf(doc, "%.1f %.1f translate 180 rotate\n", width, length);
5849 + case 3 : /* Reverse Landscape */
5850 + doc_printf(doc, "0.0 %.1f translate -90 rotate\n", width);
5854 + doc_puts(doc, "ESPwl\n");
5855 + doc_puts(doc, "grestore\n");
5862 diff -durN release-1.2.1/filter/rasterbench.c cups-1.2.x/filter/rasterbench.c
5863 --- release-1.2.1/filter/rasterbench.c 1970-01-01 01:00:00.000000000 +0100
5864 +++ cups-1.2.x/filter/rasterbench.c 2006-06-26 12:45:28.000000000 +0100
5869 + * Raster benchmark program for the Common UNIX Printing System (CUPS).
5871 + * Copyright 1997-2006 by Easy Software Products.
5873 + * These coded instructions, statements, and computer programs are the
5874 + * property of Easy Software Products and are protected by Federal
5875 + * copyright law. Distribution and use rights for the CUPS Raster source
5876 + * files are outlined in the GNU Library General Public License, located
5877 + * in the "pstoraster" directory. If this file is missing or damaged
5878 + * please contact Easy Software Products at:
5880 + * Attn: CUPS Licensing Information
5881 + * Easy Software Products
5882 + * 44141 Airport View Drive, Suite 204
5883 + * Hollywood, Maryland 20636 USA
5885 + * Voice: (301) 373-9600
5886 + * EMail: cups-info@cups.org
5887 + * WWW: http://www.cups.org
5889 + * This code and any derivative of it may be used and distributed
5890 + * freely under the terms of the GNU General Public License when
5891 + * used with GNU Ghostscript or its derivatives. Use of the code
5892 + * (or any derivative of it) with software other than GNU
5893 + * GhostScript (or its derivatives) is governed by the CUPS license
5896 + * This file is subject to the Apple OS-Developed Software exception.
5900 + * main() - Benchmark the raster read/write functions.
5901 + * compute_median() - Compute the median time for a test.
5902 + * read_test() - Benchmark the raster read functions.
5903 + * write_test() - Benchmark the raster write functions.
5907 + * Include necessary headers...
5910 +#include "raster.h"
5911 +#include <stdlib.h>
5912 +#include <sys/time.h>
5913 +#include <signal.h>
5914 +#include <unistd.h>
5915 +#include <sys/wait.h>
5922 +#define TEST_WIDTH 1024
5923 +#define TEST_HEIGHT 1024
5924 +#define TEST_PAGES 16
5925 +#define TEST_PASSES 20
5929 + * Local functions...
5932 +static double compute_median(double *secs);
5933 +static double get_time(void);
5934 +static void read_test(int fd);
5935 +static int run_read_test(void);
5936 +static void write_test(int fd);
5940 + * 'main()' - Benchmark the raster read/write functions.
5943 +int /* O - Exit status */
5946 + int i; /* Looping var */
5947 + int ras_fd, /* File descriptor for read process */
5948 + status; /* Exit status of read process */
5949 + double start_secs, /* Start time */
5950 + write_secs, /* Write time */
5951 + read_secs, /* Read time */
5952 + pass_secs[TEST_PASSES]; /* Total test times */
5956 + * Ignore SIGPIPE...
5959 + signal(SIGPIPE, SIG_IGN);
5962 + * Run the tests several times to get a good average...
5965 + printf("Test read/write speed of %d pages, %dx%d pixels...\n\n",
5966 + TEST_PAGES, TEST_WIDTH, TEST_HEIGHT);
5967 + for (i = 0; i < TEST_PASSES; i ++)
5969 + printf("PASS %2d: ", i + 1);
5972 + ras_fd = run_read_test();
5973 + start_secs = get_time();
5975 + write_test(ras_fd);
5977 + write_secs = get_time();
5978 + printf(" %.3f write,", write_secs - start_secs);
5984 + read_secs = get_time();
5985 + pass_secs[i] = read_secs - start_secs;
5986 + printf(" %.3f read, %.3f total\n", read_secs - write_secs, pass_secs[i]);
5989 + printf("\nMedian Total Time: %.3f seconds per document\n",
5990 + compute_median(pass_secs));
5997 + * 'compute_median()' - Compute the median time for a test.
6000 +static double /* O - Median time in seconds */
6001 +compute_median(double *secs) /* I - Array of time samples */
6003 + int i, j; /* Looping vars */
6004 + double temp; /* Swap variable */
6008 + * Sort the array into ascending order using a quicky bubble sort...
6011 + for (i = 0; i < (TEST_PASSES - 1); i ++)
6012 + for (j = i + 1; j < TEST_PASSES; j ++)
6013 + if (secs[i] > secs[j])
6016 + secs[i] = secs[j];
6021 + * Return the average of the middle two samples...
6024 + return (0.5 * (secs[TEST_PASSES / 2 - 1] + secs[TEST_PASSES / 2]));
6029 + * 'get_time()' - Get the current time in seconds.
6032 +static double /* O - Time in seconds */
6035 + struct timeval curtime; /* Current time */
6038 + gettimeofday(&curtime, NULL);
6039 + return (curtime.tv_sec + 0.000001 * curtime.tv_usec);
6044 + * 'read_test()' - Benchmark the raster read functions.
6048 +read_test(int fd) /* I - File descriptor to read from */
6050 + int y; /* Looping var */
6051 + cups_raster_t *r; /* Raster stream */
6052 + cups_page_header_t header; /* Page header */
6053 + unsigned char buffer[8 * TEST_WIDTH];
6058 + * Test read speed...
6061 + if ((r = cupsRasterOpen(fd, CUPS_RASTER_READ)) == NULL)
6063 + perror("Unable to create raster input stream");
6067 + while (cupsRasterReadHeader(r, &header))
6069 + for (y = 0; y < header.cupsHeight; y ++)
6070 + cupsRasterReadPixels(r, buffer, header.cupsBytesPerLine);
6073 + cupsRasterClose(r);
6078 + * 'run_read_test()' - Run the read test as a child process via pipes.
6081 +static int /* O - Standard input of child */
6082 +run_read_test(void)
6084 + int ras_pipes[2]; /* Raster data pipes */
6085 + int pid; /* Child process ID */
6088 + if (pipe(ras_pipes))
6091 + if ((pid = fork()) < 0)
6094 + * Fork error - return -1 on error...
6097 + close(ras_pipes[0]);
6098 + close(ras_pipes[1]);
6102 + else if (pid == 0)
6105 + * Child comes here - read data from the input pipe...
6108 + close(ras_pipes[1]);
6109 + read_test(ras_pipes[0]);
6115 + * Parent comes here - return the output pipe...
6118 + close(ras_pipes[0]);
6119 + return (ras_pipes[1]);
6125 + * 'write_test()' - Benchmark the raster write functions.
6129 +write_test(int fd) /* I - File descriptor to write to */
6131 + int page, x, y; /* Looping vars */
6132 + int count; /* Number of bytes to set */
6133 + cups_raster_t *r; /* Raster stream */
6134 + cups_page_header_t header; /* Page header */
6135 + unsigned char data[32][8 * TEST_WIDTH];
6136 + /* Raster data to write */
6140 + * Create a combination of random data and repeated data to simulate
6141 + * text with some whitespace.
6144 + srand(time(NULL));
6146 + memset(data, 0, sizeof(data));
6148 + for (y = 0; y < 28; y ++)
6150 + for (x = rand() & 127, count = (rand() & 15) + 1;
6151 + x < sizeof(data[0]);
6156 + x += (rand() & 15) + 1;
6157 + count = (rand() & 15) + 1;
6159 + if (x >= sizeof(data[0]))
6163 + data[y][x] = rand();
6168 + * Test write speed...
6171 + if ((r = cupsRasterOpen(fd, CUPS_RASTER_WRITE)) == NULL)
6173 + perror("Unable to create raster output stream");
6177 + for (page = 0; page < TEST_PAGES; page ++)
6179 + memset(&header, 0, sizeof(header));
6180 + header.cupsWidth = TEST_WIDTH;
6181 + header.cupsHeight = TEST_HEIGHT;
6182 + header.cupsBytesPerLine = TEST_WIDTH;
6186 + header.cupsBytesPerLine *= 4;
6187 + header.cupsColorSpace = CUPS_CSPACE_CMYK;
6188 + header.cupsColorOrder = CUPS_ORDER_CHUNKED;
6192 + header.cupsColorSpace = CUPS_CSPACE_K;
6193 + header.cupsColorOrder = CUPS_ORDER_BANDED;
6198 + header.cupsBytesPerLine *= 2;
6199 + header.cupsBitsPerColor = 16;
6200 + header.cupsBitsPerPixel = (page & 1) ? 64 : 16;
6204 + header.cupsBitsPerColor = 8;
6205 + header.cupsBitsPerPixel = (page & 1) ? 32 : 8;
6208 + cupsRasterWriteHeader(r, &header);
6210 + for (y = 0; y < TEST_HEIGHT; y ++)
6211 + cupsRasterWritePixels(r, data[y & 31], header.cupsBytesPerLine);
6214 + cupsRasterClose(r);
6221 diff -durN release-1.2.1/filter/raster.c cups-1.2.x/filter/raster.c
6222 --- release-1.2.1/filter/raster.c 2006-07-04 17:35:19.000000000 +0100
6223 +++ cups-1.2.x/filter/raster.c 2006-06-26 12:45:28.000000000 +0100
6229 * Raster file routines for the Common UNIX Printing System (CUPS).
6235 - * cupsRasterClose() - Close a raster stream.
6236 - * cupsRasterOpen() - Open a raster stream.
6237 - * cupsRasterReadHeader() - Read a raster page header and store it in a
6238 - * V1 page header structure.
6239 - * cupsRasterReadHeader2() - Read a raster page header and store it in a
6240 - * V2 page header structure.
6241 - * cupsRasterReadPixels() - Read raster pixels.
6242 - * cupsRasterWriteHeader() - Write a raster page header from a V1 page
6243 - * header structure.
6244 - * cupsRasterWriteHeader2() - Write a raster page header from a V2 page
6245 - * header structure.
6246 - * cupsRasterWritePixels() - Write raster pixels.
6247 - * cups_raster_update() - Update the raster header and row count for the
6249 - * cups_raster_write() - Write a row of raster data...
6250 - * cups_read() - Read bytes from a file.
6251 - * cups_write() - Write bytes to a file.
6252 + * cupsRasterClose() - Close a raster stream.
6253 + * cupsRasterOpen() - Open a raster stream.
6254 + * cupsRasterReadHeader() - Read a raster page header and store it in a
6255 + * V1 page header structure.
6256 + * cupsRasterReadHeader2() - Read a raster page header and store it in a
6257 + * V2 page header structure.
6258 + * cupsRasterReadPixels() - Read raster pixels.
6259 + * cupsRasterWriteHeader() - Write a raster page header from a V1 page
6260 + * header structure.
6261 + * cupsRasterWriteHeader2() - Write a raster page header from a V2 page
6262 + * header structure.
6263 + * cupsRasterWritePixels() - Write raster pixels.
6264 + * cups_raster_read() - Read through the raster buffer.
6265 + * cups_raster_read_header() - Read a raster page header.
6266 + * cups_raster_update() - Update the raster header and row count for the
6268 + * cups_read() - Read bytes from a file.
6269 + * cups_swap() - Swap bytes in raster data...
6270 + * cups_write() - Write bytes to a file.
6279 +#include <cups/debug.h>
6282 #include <cups/string.h>
6284 unsigned char *pixels, /* Pixels for current row */
6285 *pend, /* End of pixel buffer */
6286 *pcurrent; /* Current byte in pixel buffer */
6287 + int compressed, /* Non-zero if data is compressed */
6288 + swapped; /* Non-zero if data is byte-swapped */
6289 + unsigned char *buffer, /* Read/write buffer */
6290 + *bufptr, /* Current (read) position in buffer */
6291 + *bufend; /* End of current (read) buffer */
6292 + int bufsize; /* Buffer size */
6297 * Local functions...
6300 static unsigned cups_raster_read_header(cups_raster_t *r);
6301 +static int cups_raster_read(cups_raster_t *r, unsigned char *buf,
6303 static void cups_raster_update(cups_raster_t *r);
6304 -static int cups_raster_write(cups_raster_t *r);
6305 static int cups_read(int fd, unsigned char *buf, int bytes);
6306 +static void cups_swap(unsigned char *buf, int bytes);
6307 static int cups_write(int fd, const unsigned char *buf, int bytes);
6321 * Open for read - get sync word...
6324 - if (cups_read(r->fd, (unsigned char *)&(r->sync), sizeof(r->sync))
6325 - < sizeof(r->sync))
6326 + if (!cups_read(r->fd, (unsigned char *)&(r->sync), sizeof(r->sync)))
6330 @@ -149,11 +162,22 @@
6331 if (r->sync != CUPS_RASTER_SYNC &&
6332 r->sync != CUPS_RASTER_REVSYNC &&
6333 r->sync != CUPS_RASTER_SYNCv1 &&
6334 - r->sync != CUPS_RASTER_REVSYNCv1)
6335 + r->sync != CUPS_RASTER_REVSYNCv1 &&
6336 + r->sync != CUPS_RASTER_SYNCv2 &&
6337 + r->sync != CUPS_RASTER_REVSYNCv2)
6343 + if (r->sync == CUPS_RASTER_SYNCv2 ||
6344 + r->sync == CUPS_RASTER_REVSYNCv2)
6345 + r->compressed = 1;
6347 + if (r->sync == CUPS_RASTER_REVSYNC ||
6348 + r->sync == CUPS_RASTER_REVSYNCv1 ||
6349 + r->sync == CUPS_RASTER_REVSYNCv2)
6357 r->sync = CUPS_RASTER_SYNC;
6359 if (cups_write(r->fd, (unsigned char *)&(r->sync), sizeof(r->sync))
6362 @@ -240,15 +265,51 @@
6363 unsigned len) /* I - Number of bytes to read */
6365 int bytes; /* Bytes read */
6366 + unsigned cupsBytesPerLine; /* cupsBytesPerLine value */
6367 unsigned remaining; /* Bytes remaining */
6368 unsigned char *ptr, /* Pointer to read buffer */
6369 - byte; /* Byte from file */
6370 + byte, /* Byte from file */
6371 + *temp; /* Pointer into buffer */
6372 + int count; /* Repetition count */
6375 if (r == NULL || r->mode != CUPS_RASTER_READ || r->remaining == 0)
6379 + if (!r->compressed)
6382 + * Read without compression...
6385 + r->remaining -= len / r->header.cupsBytesPerLine;
6387 + if (!cups_read(r->fd, p, len))
6391 + * Swap bytes as needed...
6394 + if ((r->header.cupsBitsPerColor == 16 ||
6395 + r->header.cupsBitsPerPixel == 12 ||
6396 + r->header.cupsBitsPerPixel == 16) &&
6398 + cups_swap(p, len);
6408 + * Read compressed data...
6412 + cupsBytesPerLine = r->header.cupsBytesPerLine;
6414 while (remaining > 0 && r->remaining > 0)
6416 @@ -258,127 +319,99 @@
6417 * Need to read a new row...
6420 - if (remaining == r->header.cupsBytesPerLine)
6421 + if (remaining == cupsBytesPerLine)
6426 - if (r->sync == CUPS_RASTER_SYNCv1 || r->sync == CUPS_RASTER_REVSYNCv1)
6429 - * Read without compression...
6432 + * Read using a modified TIFF "packbits" compression...
6435 - if (cups_read(r->fd, ptr, r->header.cupsBytesPerLine) <
6436 - r->header.cupsBytesPerLine)
6438 + if (!cups_raster_read(r, &byte, 1))
6444 + r->count = byte + 1;
6450 + bytes = cupsBytesPerLine;
6455 - * Read using a modified TIFF "packbits" compression...
6456 + * Get a new repeat count...
6459 - unsigned char *temp; /* Pointer into buffer */
6460 - int count; /* Repetition count */
6463 - if (cups_read(r->fd, &byte, 1) < 1)
6464 + if (!cups_raster_read(r, &byte, 1))
6467 - r->count = byte + 1;
6473 - bytes = r->header.cupsBytesPerLine;
6479 - * Get a new repeat count...
6480 + * Copy N literal pixels...
6483 - if (cups_read(r->fd, &byte, 1) < 1)
6489 - * Copy N literal pixels...
6491 + count = (257 - byte) * r->bpp;
6493 - count = (257 - byte) * r->bpp;
6494 + if (count > bytes)
6497 - if (count > bytes)
6499 + if (!cups_raster_read(r, temp, count))
6502 - if (cups_read(r->fd, temp, count) < count)
6510 + * Repeat the next N bytes...
6519 - * Repeat the next N bytes...
6521 + count = (byte + 1) * r->bpp;
6522 + if (count > bytes)
6525 - count = (byte + 1) * r->bpp;
6526 - if (count > bytes)
6528 + if (count < r->bpp)
6531 - if (count < r->bpp)
6536 + if (!cups_raster_read(r, temp, r->bpp))
6539 - if (cups_read(r->fd, temp, r->bpp) < r->bpp)
6546 + memcpy(temp, temp - r->bpp, r->bpp);
6552 - memcpy(temp, temp - r->bpp, r->bpp);
6562 + * Swap bytes as needed...
6565 if ((r->header.cupsBitsPerColor == 16 ||
6566 r->header.cupsBitsPerPixel == 12 ||
6567 r->header.cupsBitsPerPixel == 16) &&
6568 - (r->sync == CUPS_RASTER_REVSYNC || r->sync == CUPS_RASTER_REVSYNCv1))
6571 - * Swap bytes in the pixel data...
6574 - unsigned char *temp;
6578 + cups_swap(ptr, bytes);
6580 - for (temp = ptr, count = r->header.cupsBytesPerLine;
6582 - temp += 2, count -= 2)
6585 - temp[0] = temp[1];
6590 + * Update pointers...
6593 - if (remaining >= r->header.cupsBytesPerLine)
6594 + if (remaining >= cupsBytesPerLine)
6596 - bytes = r->header.cupsBytesPerLine;
6597 + bytes = cupsBytesPerLine;
6598 r->pcurrent = r->pixels;
6601 @@ -389,6 +422,10 @@
6602 r->pcurrent = r->pixels + bytes;
6606 + * Copy data as needed...
6610 memcpy(p, ptr, bytes);
6612 @@ -494,10 +531,6 @@
6613 unsigned char *p, /* I - Bytes to write */
6614 unsigned len)/* I - Number of bytes to write */
6616 - int bytes; /* Bytes read */
6617 - unsigned remaining; /* Bytes remaining */
6621 fprintf(stderr, "cupsRasterWritePixels(r=%p, p=%p, len=%u), remaining=%u\n",
6622 r, p, len, r->remaining);
6623 @@ -506,99 +539,13 @@
6624 if (r == NULL || r->mode != CUPS_RASTER_WRITE || r->remaining == 0)
6627 - for (remaining = len; remaining > 0; remaining -= bytes, p += bytes)
6631 - * Figure out the number of remaining bytes on the current line...
6634 - if ((bytes = remaining) > (r->pend - r->pcurrent))
6635 - bytes = r->pend - r->pcurrent;
6640 - * Check to see if this line is the same as the previous line...
6643 - if (memcmp(p, r->pcurrent, bytes))
6645 - if (!cups_raster_write(r))
6653 - * Mark more bytes as the same...
6656 - r->pcurrent += bytes;
6658 - if (r->pcurrent >= r->pend)
6661 - * Increase the repeat count...
6665 - r->pcurrent = r->pixels;
6668 - * Flush out this line if it is the last one...
6673 - if (r->remaining == 0)
6674 - return (cups_raster_write(r));
6675 - else if (r->count == 256)
6677 - if (cups_raster_write(r) == 0)
6688 - if (r->count == 0)
6691 - * Copy the raster data to the buffer...
6694 - memcpy(r->pcurrent, p, bytes);
6696 - r->pcurrent += bytes;
6698 - if (r->pcurrent >= r->pend)
6701 - * Increase the repeat count...
6705 - r->pcurrent = r->pixels;
6708 - * Flush out this line if it is the last one...
6713 + * No write compression, just write the raster data raw...
6716 - if (r->remaining == 0)
6717 - return (cups_raster_write(r));
6721 + r->remaining -= len / r->header.cupsBytesPerLine;
6724 + return (cups_write(r->fd, p, len));
6728 @@ -636,14 +583,14 @@
6730 memset(&(r->header), 0, sizeof(r->header));
6732 - if (cups_read(r->fd, (unsigned char *)&(r->header), len) < len)
6733 + if (cups_raster_read(r, (unsigned char *)&(r->header), len) < len)
6737 * Swap bytes as needed...
6740 - if (r->sync == CUPS_RASTER_REVSYNC || r->sync == CUPS_RASTER_REVSYNCv1)
6742 for (len = 81, s = (union swap_s *)&(r->header.AdvanceDistance);
6745 @@ -660,6 +607,144 @@
6749 + * 'cups_raster_read()' - Read through the raster buffer.
6752 +static int /* O - Number of bytes read */
6753 +cups_raster_read(cups_raster_t *r, /* I - Raster stream */
6754 + unsigned char *buf, /* I - Buffer */
6755 + int bytes) /* I - Number of bytes to read */
6757 + int count, /* Number of bytes read */
6758 + remaining, /* Remaining bytes in buffer */
6759 + total; /* Total bytes read */
6762 + DEBUG_printf(("cups_raster_read(r=%p, buf=%p, bytes=%d)\n", r, buf, bytes));
6764 + if (!r->compressed)
6765 + return (cups_read(r->fd, buf, bytes));
6768 + * Allocate a read buffer as needed...
6771 + count = 2 * r->header.cupsBytesPerLine;
6773 + if (count > r->bufsize)
6775 + int offset = r->bufptr - r->buffer; /* Offset to current start of buffer */
6776 + int end = r->bufend - r->buffer; /* Offset to current end of buffer */
6777 + unsigned char *rptr; /* Pointer in read buffer */
6780 + rptr = realloc(r->buffer, count);
6782 + rptr = malloc(count);
6788 + r->bufptr = rptr + offset;
6789 + r->bufend = rptr + end;
6790 + r->bufsize = count;
6794 + * Loop until we have read everything...
6797 + for (total = 0, remaining = r->bufend - r->bufptr;
6799 + total += count, buf += count)
6801 + count = bytes - total;
6803 + DEBUG_printf(("count=%d, remaining=%d, buf=%p, bufptr=%p, bufend=%p...\n",
6804 + count, remaining, buf, r->bufptr, r->bufend));
6806 + if (remaining == 0)
6811 + * Read into the raster buffer and then copy...
6814 + remaining = cups_read(r->fd, r->buffer, r->bufsize);
6815 + if (remaining <= 0)
6818 + r->bufptr = r->buffer;
6819 + r->bufend = r->buffer + remaining;
6824 + * Read directly into "buf"...
6827 + count = cups_read(r->fd, buf, count);
6837 + * Copy bytes from raster buffer to "buf"...
6840 + if (count > remaining)
6841 + count = remaining;
6849 + *buf = *(r->bufptr)++;
6852 + else if (count < 128)
6855 + * Copy up to 127 bytes without using memcpy(); this is
6856 + * faster because it avoids an extra function call and is
6857 + * often further optimized by the compiler...
6860 + unsigned char *bufptr; /* Temporary buffer pointer */
6863 + remaining -= count;
6865 + for (bufptr = r->bufptr; count > 0; count --, total ++)
6866 + *buf++ = *bufptr++;
6868 + r->bufptr = bufptr;
6873 + * Use memcpy() for a large read...
6876 + memcpy(buf, r->bufptr, count);
6877 + r->bufptr += count;
6878 + remaining -= count;
6887 * 'cups_raster_update()' - Update the raster header and row count for the
6890 @@ -745,159 +830,19 @@
6891 r->remaining = r->header.cupsHeight;
6894 - * Allocate the read/write buffer...
6897 - if (r->pixels != NULL)
6900 - r->pixels = calloc(r->header.cupsBytesPerLine, 1);
6901 - r->pcurrent = r->pixels;
6902 - r->pend = r->pixels + r->header.cupsBytesPerLine;
6908 - * 'cups_raster_write()' - Write a row of raster data...
6911 -static int /* O - Number of bytes written */
6912 -cups_raster_write(cups_raster_t *r) /* I - Raster stream */
6914 - unsigned char *start, /* Start of sequence */
6915 - *ptr, /* Current pointer in sequence */
6916 - byte; /* Byte to write */
6917 - int count; /* Count */
6921 - fprintf(stderr, "cups_raster_write(r=%p)\n", r);
6925 - * Write the row repeat count...
6928 - byte = r->count - 1;
6930 - if (cups_write(r->fd, &byte, 1) < 1)
6933 - fputs("cups_raster_write: Unable to write row repeat count...\n",
6941 - * Write using a modified TIFF "packbits" compression...
6942 + * Allocate the compression buffer...
6945 - for (ptr = r->pixels; ptr < r->pend;)
6946 + if (r->compressed)
6951 - if (ptr == r->pend)
6954 - * Encode a single pixel at the end...
6958 - if (cups_write(r->fd, &byte, 1) < 1)
6961 - fputs("cups_raster_write: Unable to write last pixel count...\n", stderr);
6967 - if (cups_write(r->fd, start, r->bpp) < r->bpp)
6970 - fputs("cups_raster_write: Unable to write last pixel data...\n", stderr);
6976 - else if (!memcmp(start, ptr, r->bpp))
6979 - * Encode a sequence of repeating pixels...
6982 - for (count = 2; count < 128 && ptr < (r->pend - r->bpp); count ++, ptr += r->bpp)
6983 - if (memcmp(ptr, ptr + r->bpp, r->bpp) != 0)
6990 - if (cups_write(r->fd, &byte, 1) < 1)
6993 - fputs("cups_raster_write: Unable to write repeated pixel count...\n", stderr);
6999 - if (cups_write(r->fd, start, r->bpp) < r->bpp)
7002 - fputs("cups_raster_write: Unable to write repeated pixel data...\n", stderr);
7011 - * Encode a sequence of non-repeating pixels...
7014 - for (count = 1; count < 127 && ptr < (r->pend - r->bpp); count ++, ptr += r->bpp)
7015 - if (!memcmp(ptr, ptr + r->bpp, r->bpp))
7018 - if (ptr >= (r->pend - r->bpp) && count < 128)
7024 - byte = 257 - count;
7026 - if (cups_write(r->fd, &byte, 1) < 1)
7029 - fputs("cups_raster_write: Unable to write non-repeating pixel count...\n", stderr);
7037 - if (cups_write(r->fd, start, count) < count)
7040 - fputs("cups_raster_write: Unable to write non-repeating pixel data...\n", stderr);
7042 + if (r->pixels != NULL)
7048 + r->pixels = calloc(r->header.cupsBytesPerLine, 1);
7049 + r->pcurrent = r->pixels;
7050 + r->pend = r->pixels + r->header.cupsBytesPerLine;
7054 - return (r->header.cupsBytesPerLine);
7058 @@ -934,6 +879,32 @@
7062 + * 'cups_swap()' - Swap bytes in raster data...
7066 +cups_swap(unsigned char *buf, /* I - Buffer to swap */
7067 + int bytes) /* I - Number of bytes to swap */
7069 + unsigned char even, odd; /* Temporary variables */
7088 * 'cups_write()' - Write bytes to a file.
7098 diff -durN release-1.2.1/filter/raster.h cups-1.2.x/filter/raster.h
7099 --- release-1.2.1/filter/raster.h 2006-07-04 17:35:19.000000000 +0100
7100 +++ cups-1.2.x/filter/raster.h 2006-06-26 12:45:28.000000000 +0100
7106 * Raster file definitions for the Common UNIX Printing System (CUPS).
7112 -# define CUPS_RASTER_SYNC 0x52615332 /* RaS2 */
7113 -# define CUPS_RASTER_REVSYNC 0x32536152 /* 2SaR */
7114 +# define CUPS_RASTER_SYNC 0x52615333 /* RaS3 */
7115 +# define CUPS_RASTER_REVSYNC 0x33536152 /* 3SaR */
7117 # define CUPS_RASTER_SYNCv1 0x52615374 /* RaSt */
7118 # define CUPS_RASTER_REVSYNCv1 0x74536152 /* tSaR */
7120 +# define CUPS_RASTER_SYNCv2 0x52615332 /* RaS2 */
7121 +# define CUPS_RASTER_REVSYNCv2 0x32536152 /* 2SaR */
7125 * The following definition can be used to determine if the
7127 #endif /* !_CUPS_RASTER_H_ */
7133 diff -durN release-1.2.1/filter/rastertolabel.c cups-1.2.x/filter/rastertolabel.c
7134 --- release-1.2.1/filter/rastertolabel.c 2006-07-04 17:35:19.000000000 +0100
7135 +++ cups-1.2.x/filter/rastertolabel.c 2006-07-04 17:28:24.000000000 +0100
7141 * Label printer filter for the Common UNIX Printing System (CUPS).
7144 printf("! 0 %u %u %u %u\r\n", header->HWResolution[0],
7145 header->HWResolution[1], header->cupsHeight,
7147 + printf("PAGE-WIDTH %d\r\n", header->cupsWidth);
7148 + printf("PAGE-HEIGHT %d\r\n", header->cupsWidth);
7152 @@ -588,7 +590,10 @@
7153 * Print the label...
7157 + if ((choice = ppdFindMarkedChoice(ppd, "zeMediaTracking")) == NULL ||
7158 + strcmp(choice->choice, "Continuous"))
7166 int i; /* Looping var */
7167 unsigned char *ptr; /* Pointer into buffer */
7168 - char *compptr; /* Pointer into compression buffer */
7169 + unsigned char *compptr; /* Pointer into compression buffer */
7170 char repeat_char; /* Repeated character */
7171 int repeat_count; /* Number of repeated characters */
7172 static const char *hex = "0123456789ABCDEF";
7173 @@ -1003,5 +1008,5 @@
7180 diff -durN release-1.2.1/locale/cups_es.po cups-1.2.x/locale/cups_es.po
7181 --- release-1.2.1/locale/cups_es.po 2006-07-04 17:32:18.000000000 +0100
7182 +++ cups-1.2.x/locale/cups_es.po 2006-06-26 12:42:47.000000000 +0100
7186 -# Message catalog template for the Common UNIX Printing System (CUPS).
7187 -# Copyright 2005-2006 by Easy Software Products.
7188 -# These coded instructions, statements, and computer programs are the
7189 -# property of Easy Software Products and are protected by Federal
7190 -# copyright law. Distribution and use rights are outlined in the file
7191 -# "LICENSE.txt" which should have been included with this file. If this
7192 -# file is missing or damaged please contact Easy Software Products
7194 -# Attn: CUPS Licensing Information
7195 -# Easy Software Products
7196 -# 44141 Airport View Drive, Suite 204
7197 -# Hollywood, Maryland 20636 USA
7198 -# Voice: (301) 373-9600
7199 -# EMail: cups-info@cups.org
7200 -# WWW: http://www.cups.org
7206 +# Spanish message catalog for the Common UNIX Printing System (CUPS).
7208 +# Copyright 2005-2006 by Easy Software Products.
7210 +# These coded instructions, statements, and computer programs are the
7211 +# property of Easy Software Products and are protected by Federal
7212 +# copyright law. Distribution and use rights are outlined in the file
7213 +# "LICENSE.txt" which should have been included with this file. If this
7214 +# file is missing or damaged please contact Easy Software Products
7217 +# Attn: CUPS Licensing Information
7218 +# Easy Software Products
7219 +# 44141 Airport View Drive, Suite 204
7220 +# Hollywood, Maryland 20636 USA
7222 +# Voice: (301) 373-9600
7223 +# EMail: cups-info@cups.org
7224 +# WWW: http://www.cups.org
7228 "Project-Id-Version: CUPS 1.2\n"
7229 "Report-Msgid-Bugs-To: http://www.cups.org/str.php\n"
7230 -"POT-Creation-Date: 2006-05-21 10:08-0400\n"
7231 -"PO-Revision-Date: 2006-03-25 21:48+0100\n"
7232 +"POT-Creation-Date: 2006-05-21 10:07-0400\n"
7233 +"PO-Revision-Date: 2006-06-12 19:01+0100\n"
7234 "Last-Translator: Juan Pablo González Riopedre <riopedre@tiscali.es>\n"
7235 "Language-Team: Spanish\n"
7236 "MIME-Version: 1.0\n"
7242 -"Enter your username and password or the root username and password to access "
7245 -"Introduzca su nombre de usuario y contraseña o el nombre de usuario y "
7246 -"contraseña de root para poder acceder a esta página."
7247 +msgid "Enter your username and password or the root username and password to access this page."
7248 +msgstr "Introduzca su nombre de usuario y contraseña o el nombre de usuario y contraseña de root para poder acceder a esta página."
7250 msgid "You must use a https: URL to access this page."
7251 msgstr "Debe escribir un URL https para acceder a esta página."
7254 msgid "Bad request version number %d.%d!"
7255 -msgstr "Petición incorrecta de número de versión %d %d."
7256 +msgstr "Petición incorrecta de número de versión %d.%d."
7258 msgid "No attributes in request!"
7259 msgstr "No hay atributos en la solicitud."
7260 @@ -103,11 +102,8 @@
7261 msgid "The printer or class was not found."
7262 msgstr "No se ha encontrado la impresora o la clase."
7265 -"The printer-uri must be of the form \"ipp://HOSTNAME/classes/CLASSNAME\"."
7267 -"El printer-uri debe ser de la forma \"ipp://NOMBRE_ORDENADOR/classes/"
7269 +msgid "The printer-uri must be of the form \"ipp://HOSTNAME/classes/CLASSNAME\"."
7270 +msgstr "El printer-uri debe ser de la forma \"ipp://NOMBRE_ORDENADOR/classes/NOMBRE_CLASE\"."
7273 msgid "The printer-uri \"%s\" contains invalid characters."
7277 msgid "Attempt to set %s printer-state to bad value %d!"
7279 -"Se ha intentado cambiar el valor printer-state de %s a un valor incorrecto %"
7281 +msgstr "Se ha intentado cambiar el valor printer-state de %s a un valor incorrecto %d."
7284 msgid "add_class: Unknown printer-op-policy \"%s\"."
7285 @@ -146,29 +140,19 @@
7286 msgid "The notify-user-data value is too large (%d > 63 octets)!"
7287 msgstr "El valor notify-user-data es demasiado grande (%d > 63 octetos)."
7290 -"The notify-lease-duration attribute cannot be used with job subscriptions."
7292 -"El atributo notify-lease-duration no puede ser usado con subscripciones de "
7294 +msgid "The notify-lease-duration attribute cannot be used with job subscriptions."
7295 +msgstr "El atributo notify-lease-duration no puede ser usado con subscripciones de trabajos."
7298 -"The printer-uri must be of the form \"ipp://HOSTNAME/printers/PRINTERNAME\"."
7300 -"El printer-uri debe ser de la forma \"ipp://NOMBRE_ORDENADOR/printers/"
7301 -"NOMBRE_IMPRESORA\"."
7302 +msgid "The printer-uri must be of the form \"ipp://HOSTNAME/printers/PRINTERNAME\"."
7303 +msgstr "El printer-uri debe ser de la forma \"ipp://NOMBRE_ORDENADOR/printers/NOMBRE_IMPRESORA\"."
7306 msgid "A class named \"%s\" already exists!"
7307 msgstr "Ya existe una clase llamada \"%s\"."
7311 -"File device URIs have been disabled! To enable, see the FileDevice directive "
7312 -"in \"%s/cupsd.conf\"."
7314 -"Los URIs del dispositivo de archivo han sido deshabilitados. Para "
7315 -"habilitarlos, vea la directiva FileDevice en \"%s/cupsd.conf\"."
7316 +msgid "File device URIs have been disabled! To enable, see the FileDevice directive in \"%s/cupsd.conf\"."
7317 +msgstr "Los URIs del dispositivo de archivo han sido deshabilitados. Para habilitarlos, vea la directiva FileDevice en \"%s/cupsd.conf\"."
7320 msgid "Bad device-uri \"%s\"!"
7324 msgid "You are not authorized to authenticate job #%d owned by \"%s\"!"
7326 -"No tiene permiso para autentificar el trabajo #%d que pertenece a \"%s\"."
7327 +msgstr "No tiene permiso para autentificar el trabajo #%d que pertenece a \"%s\"."
7329 msgid "The printer-uri attribute is required!"
7330 msgstr "Se necesita el atributo printer-uri."
7331 @@ -360,14 +343,11 @@
7334 msgid "You are not authorized to restart job id %d owned by \"%s\"!"
7336 -"No tiene permiso para reiniciar el trabajo id %d que pertenece a \"%s\"."
7337 +msgstr "No tiene permiso para reiniciar el trabajo id %d que pertenece a \"%s\"."
7340 msgid "You are not authorized to send document for job #%d owned by \"%s\"!"
7342 -"No tiene permiso para enviar el documento para el trabajo #%d que pertenece "
7344 +msgstr "No tiene permiso para enviar el documento para el trabajo #%d que pertenece a \"%s\"."
7347 msgid "Bad document-format \"%s\"!"
7348 @@ -465,11 +445,8 @@
7349 msgstr "lpq: Destino desconocido \"%s\".\n"
7353 -"lp: error - %s environment variable names non-existent destination \"%s\"!\n"
7355 -"lp: error - los nombres de la variable de entorno %s no existentes en el "
7356 -"destino \"%s\".\n"
7357 +msgid "lp: error - %s environment variable names non-existent destination \"%s\"!\n"
7358 +msgstr "lp: error - los nombres de la variable de entorno %s no existentes en el destino \"%s\".\n"
7360 msgid "lpq: error - no default destination available.\n"
7361 msgstr "lpq: error - no está disponible el destino predeterminado.\n"
7362 @@ -478,10 +455,8 @@
7363 msgid "lpq: get-jobs failed: %s\n"
7364 msgstr "lpq: get-jobs ha fallado: %s\n"
7367 -"Rank Owner Pri Job Files Total Size\n"
7369 -"Rango Propiet. Pri Trabajo Archivos Tamaño total\n"
7370 +msgid "Rank Owner Pri Job Files Total Size\n"
7371 +msgstr "Rango Propiet. Pri Trabajo Archivos Tamaño total\n"
7373 msgid "Rank Owner Job File(s) Total Size\n"
7374 msgstr "Rango Propiet. Trabajo Archivo(s) Tamaño total\n"
7375 @@ -492,15 +467,15 @@
7378 msgid " %-39.39s %.0f bytes\n"
7379 -msgstr " %-39.39s %.de bytes\n"
7380 +msgstr " %-39.39s %.0f bytes\n"
7383 msgid "%-6s %-10.10s %-4d %-10d %-27.27s %.0f bytes\n"
7384 -msgstr "%-6s %-10.10s %-4d %-10d %-27.27s %.de bytes\n"
7385 +msgstr "%-6s %-10.10s %-4d %-10d %-27.27s %.0f bytes\n"
7388 msgid "%-7s %-7.7s %-7d %-31.31s %.0f bytes\n"
7389 -msgstr "%-7s %-7.7s %-7d %-31.31s %.de bytes\n"
7390 +msgstr "%-7s %-7.7s %-7d %-31.31s %.0f bytes\n"
7392 msgid "no entries\n"
7393 msgstr "no hay entradas\n"
7394 @@ -529,20 +504,14 @@
7395 msgstr "lpr: error - se esperaba un valor tras la opción %c\n"
7399 -"lpr: warning - '%c' format modifier not supported - output may not be "
7402 -"lpr: advertencia - no admite el uso del modificador de formato '%c' - la "
7403 -"salida puede que no sea correcta.\n"
7404 +msgid "lpr: warning - '%c' format modifier not supported - output may not be correct!\n"
7405 +msgstr "lpr: advertencia - no admite el uso del modificador de formato '%c' - la salida puede que no sea correcta.\n"
7407 msgid "lpr: error - expected option=value after -o option!\n"
7408 msgstr "lpr: error - se esperaba opción=valor tras la opción -o.\n"
7410 msgid "lpr: warning - email notification is not currently supported!\n"
7412 -"lpr: advertencia - actualmente no admite el uso de la notificación por "
7414 +msgstr "lpr: advertencia - actualmente no admite el uso de la notificación por email.\n"
7416 msgid "lpr: error - expected destination after -P option!\n"
7417 msgstr "lpr: error - se esperaba un destino tras la opción -P.\n"
7418 @@ -563,18 +532,15 @@
7421 msgid "lpr: error - unable to access \"%s\" - %s\n"
7422 -msgstr "lpr: error - no se ha podido acceder a \"%s\" - \"s\n"
7423 +msgstr "lpr: error - no se ha podido acceder a \"%s\" - %s\n"
7426 msgid "lpr: error - too many files - \"%s\"\n"
7427 msgstr "lpr: error - demasiados archivos - \"%s\"\n"
7431 -"lpr: error - %s environment variable names non-existent destination \"%s\"!\n"
7433 -"lpr: error - los nombres de variables de entorno %s no existen en el destino "
7435 +msgid "lpr: error - %s environment variable names non-existent destination \"%s\"!\n"
7436 +msgstr "lpr: error - los nombres de variables de entorno %s no existen en el destino \"%s\".\n"
7438 msgid "lpr: error - no default destination available.\n"
7439 msgstr "lpr: error - no está disponible el destino predeterminado.\n"
7440 @@ -588,13 +554,10 @@
7443 msgid "lpr: error - unable to write to temporary file \"%s\" - %s\n"
7445 -"lpr: error - no se ha podido escribir en el archivo temporal \"%s\" - %s\n"
7446 +msgstr "lpr: error - no se ha podido escribir en el archivo temporal \"%s\" - %s\n"
7448 msgid "lpr: error - stdin is empty, so no job has been sent.\n"
7450 -"lpr: error - stdin está vacÃo, por lo tanto no se ha enviado ningún "
7452 +msgstr "lpr: error - stdin está vacÃo, por lo tanto no se ha enviado ningún trabajo.\n"
7455 msgid "lpr: error - unable to print file: %s\n"
7456 @@ -652,12 +615,10 @@
7457 msgstr "%s: La operación ha fallado: %s\n"
7459 msgid "cancel: Error - expected hostname after '-h' option!\n"
7461 -"cancel: Error - se esperaba un nombre de ordenador tras la opción '-h'.\n"
7462 +msgstr "cancel: Error - se esperaba un nombre de ordenador tras la opción '-h'.\n"
7464 msgid "cancel: Error - expected username after '-u' option!\n"
7466 -"cancel: Error - se esperaba un nombre de usuario tras la opción '-u'.\n"
7467 +msgstr "cancel: Error - se esperaba un nombre de usuario tras la opción '-u'.\n"
7470 msgid "cancel: Unknown option '%c'!\n"
7471 @@ -704,39 +665,27 @@
7474 msgid "cupsaddsmb: Unable to copy Windows 2000 printer driver files (%d)!\n"
7476 -"cupsaddsmb: No se han podido copiar los archivos de los controladores de "
7477 -"impresoras de Windows 2000 (%d).\n"
7478 +msgstr "cupsaddsmb: No se han podido copiar los archivos de los controladores de impresoras de Windows 2000 (%d).\n"
7481 msgid "cupsaddsmb: Unable to copy CUPS printer driver files (%d)!\n"
7483 -"cupsaddsmb: No se han podido copiar los archivos de los controladores de "
7484 -"impresoras de CUPS (%d).\n"
7485 +msgstr "cupsaddsmb: No se han podido copiar los archivos de los controladores de impresoras de CUPS (%d).\n"
7488 msgid "cupsaddsmb: Unable to install Windows 2000 printer driver files (%d)!\n"
7490 -"cupsaddsmb: No se han podido instalar los archivos de los controladores de "
7491 -"impresoras de Windows 2000 (%d).\n"
7492 +msgstr "cupsaddsmb: No se han podido instalar los archivos de los controladores de impresoras de Windows 2000 (%d).\n"
7495 msgid "cupsaddsmb: Unable to copy Windows 9x printer driver files (%d)!\n"
7497 -"cupsaddsmb: No se han podido copiar los archivos de los controladores de "
7498 -"impresoras de Windows 9x (%d).\n"
7499 +msgstr "cupsaddsmb: No se han podido copiar los archivos de los controladores de impresoras de Windows 9x (%d).\n"
7502 msgid "cupsaddsmb: Unable to install Windows 9x printer driver files (%d)!\n"
7504 -"cupsaddsmb: No se han podido instalar los archivos de los controladores de "
7505 -"impresoras de Windows 9x (%d).\n"
7506 +msgstr "cupsaddsmb: No se han podido instalar los archivos de los controladores de impresoras de Windows 9x (%d).\n"
7509 msgid "cupsaddsmb: Unable to set Windows printer driver (%d)!\n"
7511 -"cupsaddsmb: No se ha podido poner el controlador de impresora de Windows (%"
7513 +msgstr "cupsaddsmb: No se ha podido poner el controlador de impresora de Windows (%d).\n"
7516 "Usage: cupsaddsmb [options] printer1 ... printerN\n"
7517 @@ -1115,17 +1064,14 @@
7521 -" WARN Duplex option keyword %s should be named Duplex or "
7523 +" WARN Duplex option keyword %s should be named Duplex or JCLDuplex!\n"
7524 " REF: Page 122, section 5.17\n"
7526 -" ADVERTENCIA Clave de opción Duplex %s deberÃa llamarse Duplex o "
7528 +" ADVERTENCIA Clave de opción Duplex %s deberÃa llamarse Duplex o JCLDuplex.\n"
7529 " REF: Página 122, sección 5.17\n"
7531 msgid " WARN Default choices conflicting!\n"
7533 -" ADVERTENCIA Las preferencias predeterminadas están en conflicto.\n"
7534 +msgstr " ADVERTENCIA Las preferencias predeterminadas están en conflicto.\n"
7538 @@ -1139,48 +1085,42 @@
7539 " WARN LanguageEncoding required by PPD 4.3 spec.\n"
7540 " REF: Pages 56-57, section 5.3.\n"
7542 -" ADVERTENCIA Se necesita LanguageEncoding por especificación de "
7544 +" ADVERTENCIA Se necesita LanguageEncoding por especificación de PPD 4.3.\n"
7545 " REF: Páginas 56-57, sección 5.3.\n"
7548 " WARN Manufacturer required by PPD 4.3 spec.\n"
7549 " REF: Pages 58-59, section 5.3.\n"
7551 -" ADVERTENCIA Se necesita Manufacturer por especificación de PPD "
7553 +" ADVERTENCIA Se necesita Manufacturer por especificación de PPD 4.3.\n"
7554 " REF: Páginas 58-59, seccion 5.3.\n"
7557 " WARN PCFileName longer than 8.3 in violation of PPD spec.\n"
7558 " REF: Pages 61-62, section 5.3.\n"
7560 -" ADVERTENCIA PCFileName es mas largo que 8.3 violando la "
7561 -"especificación PPD.\n"
7562 +" ADVERTENCIA PCFileName es mas largo que 8.3 violando la especificación PPD.\n"
7563 " REF: Páginas 61-62, sección 5.3.\n"
7566 " WARN ShortNickName required by PPD 4.3 spec.\n"
7567 " REF: Pages 64-65, section 5.3.\n"
7569 -" ADVERTENCIA Se necesita ShortNickName por especificación de PPD "
7571 +" ADVERTENCIA Se necesita ShortNickName por especificación de PPD 4.3.\n"
7572 " REF: Páginas 64-65, sección 5.3.\n"
7575 " WARN Protocols contains both PJL and BCP; expected TBCP.\n"
7576 " REF: Pages 78-79, section 5.7.\n"
7578 -" ADVERTENCIA Protocols contiene a ambos, PJL y BCP; se esperaba "
7580 +" ADVERTENCIA Protocols contiene a ambos, PJL y BCP; se esperaba TBCP.\n"
7581 " REF: Páginas 78-79, sección 5.7.\n"
7584 " WARN Protocols contains PJL but JCL attributes are not set.\n"
7585 " REF: Pages 78-79, section 5.7.\n"
7587 -" ADVERTENCIA Protocols contiene a PJL pero no se especifican los "
7589 +" ADVERTENCIA Protocols contiene a PJL pero no se especifican los atributos JCL.\n"
7590 " REF: Páginas 78-79, sección 5.7.\n"
7593 @@ -1207,12 +1147,10 @@
7594 " (restricción=\"%s %s %s %s\")\n"
7597 -"Usage: cupstestppd [-q] [-r] [-v[v]] filename1.ppd[.gz] [... filenameN.ppd[."
7599 +"Usage: cupstestppd [-q] [-r] [-v[v]] filename1.ppd[.gz] [... filenameN.ppd[.gz]]\n"
7600 " program | cupstestppd [-q] [-r] [-v[v]] -\n"
7602 -"Uso: cupstestppd [-q] [-r] [-v[v]] nombre_archivo1.ppd[.gz] [... "
7603 -"nombre_archivoN.ppd[.gz]]\n"
7604 +"Uso: cupstestppd [-q] [-r] [-v[v]] nombre_archivo1.ppd[.gz] [... nombre_archivoN.ppd[.gz]]\n"
7605 " programa | cupstestppd [-q] [-r] [-v[v]] -\n"
7607 msgid "lpstat: Need \"completed\" or \"not-completed\" after -W!\n"
7608 @@ -1285,20 +1223,15 @@
7609 msgstr "destino predeterminado del sistema: %s\n"
7613 -"lpstat: error - %s environment variable names non-existent destination \"%s"
7616 -"lpstat: error - Los nombre de variable de entorno %s no existen en el "
7617 -"destino \"%s\".\n"
7618 +msgid "lpstat: error - %s environment variable names non-existent destination \"%s\"!\n"
7619 +msgstr "lpstat: error - Los nombre de variable de entorno %s no existen en el destino \"%s\".\n"
7621 msgid "no system default destination\n"
7622 msgstr "no hay un destino predeterminado del sistema\n"
7625 msgid "Output for printer %s is sent to remote printer %s on %s\n"
7627 -"La salida de la impresora %s se ha enviado a la impresora remota %s en %s\n"
7628 +msgstr "La salida de la impresora %s se ha enviado a la impresora remota %s en %s\n"
7631 msgid "Output for printer %s is sent to %s\n"
7632 @@ -1306,9 +1239,7 @@
7635 msgid "Output for printer %s/%s is sent to remote printer %s on %s\n"
7637 -"La salida de la impresora %s/%s se ha enviado a la impresora remota %s en %"
7639 +msgstr "La salida de la impresora %s/%s se ha enviado a la impresora remota %s en %s\n"
7642 msgid "Output for printer %s/%s is sent to %s\n"
7643 @@ -1452,16 +1383,13 @@
7644 msgstr "lpadmin: Se esperaba un nombre de clase tras la opción '-c'\n"
7646 msgid "lpadmin: Class name can only contain printable characters!\n"
7648 -"lpadmin: El nombre de la clase sólo puede contener caracteres imprimibles.\n"
7649 +msgstr "lpadmin: El nombre de la clase sólo puede contener caracteres imprimibles.\n"
7651 msgid "lpadmin: Expected printer name after '-d' option!\n"
7652 msgstr "lpadmin: Se esperaba un nombre de impresora tras la opción '-d'\n"
7654 msgid "lpadmin: Printer name can only contain printable characters!\n"
7656 -"lpadmin: El nombre de la impresora sólo puede contener caracteres "
7658 +msgstr "lpadmin: El nombre de la impresora sólo puede contener caracteres imprimibles.\n"
7660 msgid "lpadmin: Expected hostname after '-h' option!\n"
7661 msgstr "lpadmin: Se esperaba un nombre de ordenador tras la opción '-h'.\n"
7662 @@ -1536,8 +1464,7 @@
7663 msgstr "lpadmin: Se esperaba tipo(s) de archivo(s) tras la opción '-l'.\n"
7665 msgid "lpadmin: Warning - content type list ignored!\n"
7667 -"lpadmin: Advertencia - lista de tipo de contenido no tenida en cuenta.\n"
7668 +msgstr "lpadmin: Advertencia - lista de tipo de contenido no tenida en cuenta.\n"
7671 "lpadmin: Unable to set the printer location:\n"
7672 @@ -1640,9 +1567,7 @@
7673 msgstr "lp: Se esperaba un ID de trabajo tras la opción -i.\n"
7675 msgid "lp: Error - cannot print files and alter jobs simultaneously!\n"
7677 -"lp: Error - no se pueden imprimir archivos y alterar trabajos al mismo "
7679 +msgstr "lp: Error - no se pueden imprimir archivos y alterar trabajos al mismo tiempo.\n"
7681 msgid "lp: Error - bad job ID!\n"
7682 msgstr "lp: Error - ID de trabajo incorrecta.\n"
7683 @@ -1694,11 +1619,8 @@
7684 msgid "lp: Unknown option '%c'!\n"
7685 msgstr "lp: Opción '%c' desconocida.\n"
7688 -"lp: Error - cannot print from stdin if files or a job ID are provided!\n"
7690 -"lp: Error - no se puede imprimir desde stdin si se proporcionan archivos o "
7691 -"un ID de trabajo.\n"
7692 +msgid "lp: Error - cannot print from stdin if files or a job ID are provided!\n"
7693 +msgstr "lp: Error - no se puede imprimir desde stdin si se proporcionan archivos o un ID de trabajo.\n"
7696 msgid "lp: Unable to access \"%s\" - %s\n"
7697 @@ -1720,8 +1642,7 @@
7700 msgid "lp: error - unable to write to temporary file \"%s\" - %s\n"
7702 -"lp: error - no se ha podido escribir en el archivo temporal \"%s\" - %s\n"
7703 +msgstr "lp: error - no se ha podido escribir en el archivo temporal \"%s\" - %s\n"
7705 msgid "lp: stdin is empty, so no job has been sent.\n"
7706 msgstr "lp: stdin está vacÃo, por lo tanto no se ha enviado ningún trabajo.\n"
7707 @@ -1883,9 +1804,7 @@
7710 msgid "lppasswd: failed to backup old password file: %s\n"
7712 -"lppasswd: falló al hacer una copia de seguridad del antiguo archivo de "
7713 -"contraseñas: %s\n"
7714 +msgstr "lppasswd: falló al hacer una copia de seguridad del antiguo archivo de contraseñas: %s\n"
7717 msgid "lppasswd: failed to rename password file: %s\n"
7718 @@ -1936,12 +1855,8 @@
7720 msgstr "Añadir clase"
7723 -"The class name may only contain up to 127 printable characters and may not "
7724 -"contain spaces, slashes (/), or the pound sign (#)."
7726 -"El nombre de la clase sólo puede contener hasta 127 caracteres imprimibles y "
7727 -"no puede contener espacios, barras (/), o la almohadilla (#)."
7728 +msgid "The class name may only contain up to 127 printable characters and may not contain spaces, slashes (/), or the pound sign (#)."
7729 +msgstr "El nombre de la clase sólo puede contener hasta 127 caracteres imprimibles y no puede contener espacios, barras (/), o la almohadilla (#)."
7731 msgid "Unable to modify class:"
7732 msgstr "No se ha podido modificar la clase:"
7733 @@ -1955,12 +1870,8 @@
7735 msgstr "Añadir impresora"
7738 -"The printer name may only contain up to 127 printable characters and may not "
7739 -"contain spaces, slashes (/), or the pound sign (#)."
7741 -"El nombre de la impresora sólo puede contener hasta 127 caracteres "
7742 -"imprimibles y no puede contener espacios, barras (/), o la almohadilla (#)."
7743 +msgid "The printer name may only contain up to 127 printable characters and may not contain spaces, slashes (/), or the pound sign (#)."
7744 +msgstr "El nombre de la impresora sólo puede contener hasta 127 caracteres imprimibles y no puede contener espacios, barras (/), o la almohadilla (#)."
7746 msgid "Unable to get list of printer drivers:"
7747 msgstr "No se ha podido obtener la lista de controladores de impresora:"
7748 @@ -2059,24 +1970,16 @@
7749 msgstr "No se ha podido convertir el archivo PPD."
7751 msgid "Unable to copy Windows 2000 printer driver files!"
7753 -"No se han podido copiar los archivos del controlador de impresora de Windows "
7755 +msgstr "No se han podido copiar los archivos del controlador de impresora de Windows 2000."
7757 msgid "Unable to install Windows 2000 printer driver files!"
7759 -"No se han podido instalar los archivos del controlador de impresora de "
7761 +msgstr "No se han podido instalar los archivos del controlador de impresora de Windows 2000."
7763 msgid "Unable to copy Windows 9x printer driver files!"
7765 -"No se han podido copiar los archivos del controlador de impresora de Windows "
7767 +msgstr "No se han podido copiar los archivos del controlador de impresora de Windows 9x."
7769 msgid "Unable to install Windows 9x printer driver files!"
7771 -"No se han podido instalar los archivos del controlador de impresora de "
7773 +msgstr "No se han podido instalar los archivos del controlador de impresora de Windows 9x."
7775 msgid "Unable to set Windows printer driver!"
7776 msgstr "No se ha podido configurar el controlador de impresora de Windows."
7777 @@ -2096,14 +1999,10 @@
7778 msgstr "cupsaddsmb se ha estropeado con señal %d"
7780 msgid "A Samba username is required to export printer drivers!"
7782 -"Se requiere un nombre de usuario Samba para exportar los controladores de "
7784 +msgstr "Se requiere un nombre de usuario Samba para exportar los controladores de impresora."
7786 msgid "A Samba password is required to export printer drivers!"
7788 -"Se requiere una contraseña Samba para exportar los controladores de "
7790 +msgstr "Se requiere una contraseña Samba para exportar los controladores de impresora."
7792 msgid "Unable to open cupsd.conf file:"
7793 msgstr "No se ha podido abrir el archivo cupsd.conf:"
7794 @@ -2256,13 +2155,10 @@
7795 msgstr "cupsaddsmb: No se ha podido ejecutar \"%s\": %s\n"
7797 msgid "cupsaddsmb: No Windows printer drivers are installed!\n"
7799 -"cupsaddsmb: No está instalado ningún controlador de impresora de Windows.\n"
7800 +msgstr "cupsaddsmb: No está instalado ningún controlador de impresora de Windows.\n"
7802 msgid "cupsaddsmb: Warning, no Windows 2000 printer drivers are installed!\n"
7804 -"cupsaddsmb: Advertencia, no está instalado ningún controlador de impresora "
7805 -"de Windows 2000.\n"
7806 +msgstr "cupsaddsmb: Advertencia, no está instalado ningún controlador de impresora de Windows 2000.\n"
7809 msgid "lpadmin: Printer %s is already a member of class %s.\n"
7810 @@ -2305,8 +2201,7 @@
7811 msgstr "Uso: lpmove trabajo/fuente destino\n"
7813 msgid "lpstat: Need \"completed\", \"not-completed\", or \"all\" after -W!\n"
7815 -"lpstat: Se necesita \"completed\", \"not completed\", o \"all\" tras -W.\n"
7816 +msgstr "lpstat: Se necesita \"completed\", \"not completed\", o \"all\" tras -W.\n"
7819 msgid "%s accepting requests since %s\n"
7820 @@ -2356,21 +2251,15 @@
7821 msgstr "%s: Error - se esperaba un nombre de ordenador tras la opción '-h'.\n"
7825 -"%s: error - %s environment variable names non-existent destination \"%s\"!\n"
7827 -"%s: error - %s nombres de variables de entorno no existen en destino \"%s"
7829 +msgid "%s: error - %s environment variable names non-existent destination \"%s\"!\n"
7830 +msgstr "%s: error - %s nombres de variables de entorno no existen en destino \"%s\".\n"
7833 msgid "%s: error - no default destination available.\n"
7834 msgstr "%s: error - destino predeterminado no disponible.\n"
7837 -"Usage: lpq [-P dest] [-U username] [-h hostname[:port]] [-l] [+interval]\n"
7839 -"Uso: lpq (-P dest) (-U nombre_usuario) (-h nombre_ordenador(:puerto)) (-l) "
7841 +msgid "Usage: lpq [-P dest] [-U username] [-h hostname[:port]] [-l] [+interval]\n"
7842 +msgstr "Uso: lpq (-P dest) (-U nombre_usuario) (-h nombre_ordenador(:puerto)) (-l) (+intervalo)\n"
7845 msgid "%s: Error - expected hostname after '-H' option!\n"
7846 @@ -2381,12 +2270,8 @@
7847 msgstr "%s: Error - se esperaba un valor tras la opción '%c'.\n"
7851 -"%s: Warning - '%c' format modifier not supported - output may not be "
7854 -"%s: Advertencia - no se admite el uso del modificador de formato '%c' - la "
7855 -"salida puede no ser correcta.\n"
7856 +msgid "%s: Warning - '%c' format modifier not supported - output may not be correct!\n"
7857 +msgstr "%s: Advertencia - no se admite el uso del modificador de formato '%c' - la salida puede no ser correcta.\n"
7860 msgid "%s: error - expected option=value after '-o' option!\n"
7861 @@ -2417,11 +2302,8 @@
7862 msgstr "%s: Error - demasiados archivos - \"%s\"\n"
7866 -"%s: Error - %s environment variable names non-existent destination \"%s\"!\n"
7868 -"%s: Error - %s nombres de variables de entorno no existen en destino \"%s"
7870 +msgid "%s: Error - %s environment variable names non-existent destination \"%s\"!\n"
7871 +msgstr "%s: Error - %s nombres de variables de entorno no existen en destino \"%s\".\n"
7874 msgid "%s: Error - no default destination available.\n"
7875 @@ -2441,8 +2323,7 @@
7878 msgid "%s: Error - stdin is empty, so no job has been sent.\n"
7880 -"%s: Error - stdin está vacÃo, por lo tanto no se ha enviado ningún trabajo.\n"
7881 +msgstr "%s: Error - stdin está vacÃo, por lo tanto no se ha enviado ningún trabajo.\n"
7884 msgid "%s: Error - unknown destination \"%s\"!\n"
7885 @@ -2478,9 +2359,7 @@
7888 msgid "%s: Error - cannot print files and alter jobs simultaneously!\n"
7890 -"%s: Error - no se pueden imprimir archivos y alterar trabajos al mismo "
7892 +msgstr "%s: Error - no se pueden imprimir archivos y alterar trabajos al mismo tiempo.\n"
7895 msgid "%s: Error - bad job ID!\n"
7896 @@ -2520,8 +2399,7 @@
7899 msgid "%s: Need job ID ('-i jobid') before '-H restart'!\n"
7901 -"%s: Se necesita un ID de trabajo ('-i id_trabajo') antes de '-H restart'.\n"
7902 +msgstr "%s: Se necesita un ID de trabajo ('-i id_trabajo') antes de '-H restart'.\n"
7905 msgid "%s: Error - expected page list after '-P' option!\n"
7906 @@ -2544,19 +2422,12 @@
7907 msgstr "%s: Advertencia - opción de tipo de contenido no tenida en cuenta.\n"
7911 -"%s: Error - cannot print from stdin if files or a job ID are provided!\n"
7913 -"%s: Error - no se puede imprimir desde stdin si se proporcionan archivos o "
7914 -"una ID de trabajo.\n"
7915 +msgid "%s: Error - cannot print from stdin if files or a job ID are provided!\n"
7916 +msgstr "%s: Error - no se puede imprimir desde stdin si se proporcionan archivos o una ID de trabajo.\n"
7920 -"%s: Error - need \"completed\", \"not-completed\", or \"all\" after '-W' "
7923 -"%s: Error - se necesita \"completed\", \"not completed\", o \"all\" tras la "
7925 +msgid "%s: Error - need \"completed\", \"not-completed\", or \"all\" after '-W' option!\n"
7926 +msgstr "%s: Error - se necesita \"completed\", \"not completed\", o \"all\" tras la opción '-W'.\n"
7929 msgid "%s: Error - expected destination after '-b' option!\n"
7930 @@ -2613,14 +2484,10 @@
7931 msgstr "Las suscripciones de trabajos no han podido ser renovadas."
7933 msgid "cupsd: Expected config filename after \"-c\" option!\n"
7935 -"cupsd: Se esperaba un nombre de archivo de configuración tras la opción \"-c"
7937 +msgstr "cupsd: Se esperaba un nombre de archivo de configuración tras la opción \"-c\".\n"
7939 msgid "cupsd: launchd(8) support not compiled in, running in normal mode.\n"
7941 -"cupsd: el uso de launchd(8) no ha sido compilado, ejecutándose en modo "
7943 +msgstr "cupsd: el uso de launchd(8) no ha sido compilado, ejecutándose en modo normal.\n"
7946 msgid "cupsd: Unknown option \"%c\" - aborting!\n"
7947 @@ -2651,18 +2518,11 @@
7948 msgid " WARN Line %d only contains whitespace!\n"
7949 msgstr " ADVERTENCIA La lÃnea %d solo contiene espacios en blanco.\n"
7952 -" WARN File contains a mix of CR, LF, and CR LF line endings!\n"
7954 -" ADVERTENCIA El archivo contiene una mezcla de lÃneas acabadas en "
7955 -"CR, LF y CR LF.\n"
7956 +msgid " WARN File contains a mix of CR, LF, and CR LF line endings!\n"
7957 +msgstr " ADVERTENCIA El archivo contiene una mezcla de lÃneas acabadas en CR, LF y CR LF.\n"
7960 -" WARN Non-Windows PPD files should use lines ending with only LF, "
7963 -" ADVERTENCIA Los archivos PPD que no sean de Windows deben tener "
7964 -"lÃneas que acaben sólo en LF, no en CR LF.\n"
7965 +msgid " WARN Non-Windows PPD files should use lines ending with only LF, not CR LF!\n"
7966 +msgstr " ADVERTENCIA Los archivos PPD que no sean de Windows deben tener lÃneas que acaben sólo en LF, no en CR LF.\n"
7968 msgid "Printer Maintenance"
7969 msgstr "Mantenimiento de impresora"
7970 @@ -2684,31 +2544,19 @@
7973 msgid " **FAIL** Missing \"%s\" translation string for option %s!\n"
7975 -" **FALLO** Cadena de traducción \"%s\" para opción %s desaparecida.\n"
7976 +msgstr " **FALLO** Cadena de traducción \"%s\" para opción %s desaparecida.\n"
7980 -" **FAIL** Default translation string for option %s contains 8-bit "
7983 -" **FALLO** Cadena de traducción predeterminada para opción %s contiene "
7984 -"caracteres de 8-bits.\n"
7985 +msgid " **FAIL** Default translation string for option %s contains 8-bit characters!\n"
7986 +msgstr " **FALLO** Cadena de traducción predeterminada para opción %s contiene caracteres de 8-bits.\n"
7990 -" **FAIL** Missing \"%s\" translation string for option %s, choice %s!\n"
7992 -" **FALLO** Cadena de traducción \"%s\" para opción %s, preferencia %"
7994 +msgid " **FAIL** Missing \"%s\" translation string for option %s, choice %s!\n"
7995 +msgstr " **FALLO** Cadena de traducción \"%s\" para opción %s, preferencia %s.\n"
7999 -" **FAIL** Default translation string for option %s choice %s contains "
8000 -"8-bit characters!\n"
8002 -" **FALLO** Cadena de traducción predeterminada para opción %s "
8003 -"preferencia %s contiene caracteres de 8-bits.\n"
8004 +msgid " **FAIL** Default translation string for option %s choice %s contains 8-bit characters!\n"
8005 +msgstr " **FALLO** Cadena de traducción predeterminada para opción %s preferencia %s contiene caracteres de 8-bits.\n"
8008 msgid " **FAIL** Bad cupsFilter value \"%s\"!\n"
8009 @@ -2727,50 +2575,37 @@
8012 msgid "Bad option + choice on line %d!\n"
8013 -msgstr "Opción incorrecta + preferencia en lÃnea %s.\n"
8014 +msgstr "Opción incorrecta + preferencia en lÃnea %d.\n"
8017 msgid "Unable to copy Windows 2000 printer driver files (%d)!\n"
8019 -"No se han podido copiar los archivos del controlador de impresora de Windows "
8021 +msgstr "No se han podido copiar los archivos del controlador de impresora de Windows 2000 (%d).\n"
8024 msgid "Unable to copy CUPS printer driver files (%d)!\n"
8026 -"No se han podido copiar los archivos del controlador de impresora de CUPS (%"
8028 +msgstr "No se han podido copiar los archivos del controlador de impresora de CUPS (%d).\n"
8031 msgid "Unable to install Windows 2000 printer driver files (%d)!\n"
8033 -"No se han podido instalar los archivos del controlador de impresora de "
8034 -"Windows 2000 (%d).\n"
8035 +msgstr "No se han podido instalar los archivos del controlador de impresora de Windows 2000 (%d).\n"
8038 msgid "Unable to copy Windows 9x printer driver files (%d)!\n"
8040 -"No se han podido copiar los archivos del controlador de impresora de Windows "
8042 +msgstr "No se han podido copiar los archivos del controlador de impresora de Windows 9x (%d).\n"
8045 msgid "Unable to install Windows 9x printer driver files (%d)!\n"
8047 -"No se han podido instalar los archivos del controlador de impresora de "
8048 -"Windows 9x (%d).\n"
8049 +msgstr "No se han podido instalar los archivos del controlador de impresora de Windows 9x (%d).\n"
8051 msgid "No Windows printer drivers are installed!\n"
8052 msgstr "No está instalado ningún controlador de impresora de Windows.\n"
8054 msgid "Warning, no Windows 2000 printer drivers are installed!\n"
8056 -"Advertencia, no está instalado ningún controlador de impresora de Windows "
8058 +msgstr "Advertencia, no está instalado ningún controlador de impresora de Windows 2000.\n"
8061 msgid "Unable to set Windows printer driver (%d)!\n"
8063 -"No se ha podido configurar el controlador de impresora de Windows (%d).\n"
8064 +msgstr "No se ha podido configurar el controlador de impresora de Windows (%d).\n"
8067 "Usage: cupsaddsmb [options] printer1 ... printerN\n"
8068 @@ -2788,8 +2623,7 @@
8069 " cupsaddsmb [opciones] -a\n"
8072 -" -E Hace que se use encriptación en la conexión con el "
8074 +" -E Hace que se use encriptación en la conexión con el servidor\n"
8075 " -H servidor_samba Usa el servidor SAMBA especificado\n"
8076 " -U usuario_samba Autentifica usando el usuario SAMBA especificado\n"
8077 " -a Exporta todas las impresoras\n"
8078 @@ -2798,41 +2632,29 @@
8081 msgid "Unable to copy Windows 2000 printer driver files (%d)!"
8083 -"No se han podido copiar los archivos del controlador de impresora de Windows "
8085 +msgstr "No se han podido copiar los archivos del controlador de impresora de Windows 2000 (%d)."
8088 msgid "Unable to copy CUPS printer driver files (%d)!"
8090 -"No se han podido copiar los archivos del controlador de impresora de CUPS (%"
8092 +msgstr "No se han podido copiar los archivos del controlador de impresora de CUPS (%d)."
8095 msgid "Unable to install Windows 2000 printer driver files (%d)!"
8097 -"No se han podido instalar los archivos del controlador de impresora de "
8098 -"Windows 2000 (%d)."
8099 +msgstr "No se han podido instalar los archivos del controlador de impresora de Windows 2000 (%d)."
8102 msgid "Unable to copy Windows 9x printer driver files (%d)!"
8104 -"No se han podido copiar los archivos del controlador de impresora de Windows "
8106 +msgstr "No se han podido copiar los archivos del controlador de impresora de Windows 9x (%d)."
8109 msgid "Unable to install Windows 9x printer driver files (%d)!"
8111 -"No se han podido instalar los archivos del controlador de impresora de "
8113 +msgstr "No se han podido instalar los archivos del controlador de impresora de Windows 9x (%d)."
8115 msgid "No Windows printer drivers are installed!"
8116 msgstr "No está instalado ningún controlador de impresora de Windows."
8118 msgid "Warning, no Windows 2000 printer drivers are installed!"
8120 -"Advertencia, no está instalado ningún controlador de impresora de Windows "
8122 +msgstr "Advertencia, no está instalado ningún controlador de impresora de Windows 2000."
8125 msgid "open of %s failed: %s"
8126 @@ -2859,12 +2681,8 @@
8127 msgstr "El trabajo #%d ya ha sido completado - no se puede cancelar."
8131 -"You must access this page using the URL <A HREF=\"https://%s:%d%s\">https://%"
8134 -"Debe acceder a esta página usando el URL <A HREF=\"https://%s:%d%s\">https://"
8136 +msgid "You must access this page using the URL <A HREF=\"https://%s:%d%s\">https://%s:%d%s</A>."
8137 +msgstr "Debe acceder a esta página usando el URL <A HREF=\"https://%s:%d%s\">https://%s:%d%s</A>."
8140 msgid "Unsupported format '%s'!"
8141 @@ -2978,8 +2796,7 @@
8143 " -h Show program usage\n"
8145 -" Note: this program only validates the DSC comments, not the PostScript "
8147 +" Note: this program only validates the DSC comments, not the PostScript itself.\n"
8149 "Uso: cupstestdsc [opciones] nombre_archivo.ps [... nombre_archivo.ps]\n"
8150 " cupstestdsc [opciones] -\n"
8151 @@ -2988,17 +2805,16 @@
8153 " -h Muestra cómo se usa el programa\n"
8155 -" Nota: este programa sólo valida los comentarios DSC, no el PostScript en "
8157 +" Nota: este programa sólo valida los comentarios DSC, no el PostScript en sà mismo.\n"
8160 msgid "Password for %s on %s? "
8162 +msgstr "¿Contraseña de %s en %s? "
8166 " **FAIL** 1284DeviceId must be 1284DeviceID!\n"
8167 " REF: Page 72, section 5.5\n"
8169 -" **FALLO** Preferencia %s incorrecta %s.\n"
8170 -" REF: Página 122, sección 5.17\n"
8171 +" **FALLO** 1284DeviceId debe ser 1284DeviceID.\n"
8172 +" REF: Página 72, sección 5.5\n"
8174 diff -durN release-1.2.1/locale/Makefile cups-1.2.x/locale/Makefile
8175 --- release-1.2.1/locale/Makefile 2006-07-04 17:32:18.000000000 +0100
8176 +++ cups-1.2.x/locale/Makefile 2006-06-26 12:42:47.000000000 +0100
8182 # Locale file makefile for the Common UNIX Printing System (CUPS).
8189 +install: all $(INSTALL_LANGUAGES)
8192 $(INSTALL_DIR) -m 755 $(LOCALEDIR)
8193 for loc in $(LANGUAGES) ; do \
8194 if test -f cups_$$loc.po; then \
8196 # Uninstall files...
8200 +uninstall: $(UNINSTALL_LANGUAGES)
8202 +uninstall-languages:
8203 -for loc in $(LANGUAGES) ; do \
8204 $(RM) $(LOCALEDIR)/$$loc/cups_$$loc.po ; \
8205 - $(RMDIR) $(LOCALEDIR)/$$loc ; \
8207 - -$(RMDIR) $(LOCALEDIR)
8218 diff -durN release-1.2.1/Makedefs.in cups-1.2.x/Makedefs.in
8219 --- release-1.2.1/Makedefs.in 2006-07-04 17:35:29.000000000 +0100
8220 +++ cups-1.2.x/Makedefs.in 2006-06-26 12:45:38.000000000 +0100
8226 # Common makefile definitions for the Common UNIX Printing System (CUPS).
8231 LANGUAGES = @LANGUAGES@
8232 +INSTALL_LANGUAGES = @INSTALL_LANGUAGES@
8233 +UNINSTALL_LANGUAGES = @UNINSTALL_LANGUAGES@
8239 DSOFLAGS = @DSOFLAGS@
8240 DSOLIBS = @DSOLIBS@ $(COMMONLIBS)
8241 -IMGLIBS = @IMGLIBS@ -lm
8242 +IMGLIBS = @IMGLIBS@
8243 IMGFILTERS = @IMGFILTERS@
8244 -LDFLAGS = -L../cups -L../filter $(RC_CFLAGS) $(ARCHFLAGS) \
8245 +LDFLAGS = -L../cups -L../filter $(ARCHFLAGS) \
8246 @LDFLAGS@ @PIEFLAGS@ $(OPTIM)
8247 LINKCUPS = @LINKCUPS@ $(SSLLIBS)
8248 LINKCUPSIMAGE = @LINKCUPSIMAGE@
8256 diff -durN release-1.2.1/man/cupsaddsmb.man.in cups-1.2.x/man/cupsaddsmb.man.in
8257 --- release-1.2.1/man/cupsaddsmb.man.in 2006-07-04 17:33:01.000000000 +0100
8258 +++ cups-1.2.x/man/cupsaddsmb.man.in 2006-06-26 12:43:31.000000000 +0100
8264 .\" cupsaddsmb man page for the Common UNIX Printing System (CUPS).
8267 .\" EMail: cups-info@cups.org
8268 .\" WWW: http://www.cups.org
8270 -.TH cupsaddsmb 8 "Common UNIX Printing System" "19 April 2006" "Easy Software Products"
8271 +.TH cupsaddsmb 8 "Common UNIX Printing System" "13 June 2006" "Easy Software Products"
8273 cupsaddsmb \- export printers to samba for windows clients
8275 @@ -162,13 +162,14 @@
8278 [Windows 2000 and higher]
8286 + cups6.inf (from www.cups.org)
8287 + cups6.ini (from www.cups.org)
8288 + cupsps6.dll (from www.cups.org)
8289 + cupsui6.dll (from www.cups.org)
8290 + ps5ui.dll (from your Windows system)
8291 + pscript.hlp (from your Windows system)
8292 + pscript.ntf (from your Windows system)
8293 + pscript5.dll (from your Windows system)
8296 \fBNote:\fR Unlike Windows, case is significant - make sure that
8299 Copyright 1997-2006 by Easy Software Products, All Rights Reserved.
8304 diff -durN release-1.2.1/man/cupsd.conf.man.in cups-1.2.x/man/cupsd.conf.man.in
8305 --- release-1.2.1/man/cupsd.conf.man.in 2006-07-04 17:33:01.000000000 +0100
8306 +++ cups-1.2.x/man/cupsd.conf.man.in 2006-06-26 12:43:31.000000000 +0100
8312 .\" cupsd.conf man page for the Common UNIX Printing System (CUPS).
8315 .\" EMail: cups-info@cups.org
8316 .\" WWW: http://www.cups.org
8318 -.TH cupsd.conf 5 "Common UNIX Printing System" "23 March 2006" "Easy Software Products"
8319 +.TH cupsd.conf 5 "Common UNIX Printing System" "6 June 2006" "Easy Software Products"
8321 cupsd.conf \- server configuration file for cups
8323 @@ -367,8 +367,10 @@
8324 Listen ip-address:port
8328 +Listen /path/to/domain/socket
8330 -Listens to the specified address and port.
8331 +Listens to the specified address and port or domain socket path.
8333 <Location /path> ... </Location>
8337 Copyright 1997-2006 by Easy Software Products, All Rights Reserved.
8342 diff -durN release-1.2.1/packaging/cups.list.in cups-1.2.x/packaging/cups.list.in
8343 --- release-1.2.1/packaging/cups.list.in 2006-07-04 17:32:09.000000000 +0100
8344 +++ cups-1.2.x/packaging/cups.list.in 2006-06-26 12:42:38.000000000 +0100
8350 # ESP Package Manager (EPM) file list for the Common UNIX Printing
8353 f 0755 root sys $BINDIR/cupstestppd systemv/cupstestppd
8354 f 0755 root sys $BINDIR/lp systemv/lp
8355 f 0755 root sys $BINDIR/lpoptions systemv/lpoptions
8356 -f 4755 $CUPS_USER sys $BINDIR/lppasswd systemv/lppasswd
8357 +f 4755 root sys $BINDIR/lppasswd systemv/lppasswd
8358 f 0755 root sys $BINDIR/lpq berkeley/lpq
8359 f 0755 root sys $BINDIR/lpr berkeley/lpr
8360 f 0755 root sys $BINDIR/lprm berkeley/lprm
8363 f 0644 root sys $LOCALEDIR/ja/cups_ja.po locale/cups_ja.po
8365 -#f 0644 root sys $LOCALEDIR/pl/cups_pl.po locale/cups_pl.po
8366 +f 0644 root sys $LOCALEDIR/pl/cups_pl.po locale/cups_pl.po
8368 f 0644 root sys $LOCALEDIR/sv/cups_sv.po locale/cups_sv.po
8371 i 0755 root sys cups init/cups.sh
8377 diff -durN release-1.2.1/packaging/cups.spec.in cups-1.2.x/packaging/cups.spec.in
8378 --- release-1.2.1/packaging/cups.spec.in 2006-07-04 17:32:09.000000000 +0100
8379 +++ cups-1.2.x/packaging/cups.spec.in 2006-06-26 12:42:38.000000000 +0100
8385 # RPM "spec" file for the Common UNIX Printing System (CUPS).
8388 /usr/share/doc/cups/pl/images/*
8389 %dir /usr/share/cups/templates/pl
8390 /usr/share/cups/templates/pl/*
8391 -#/usr/share/locale/pl/cups_pl.po
8392 +/usr/share/locale/pl/cups_pl.po
8395 %defattr(-,root,root)
8403 diff -durN release-1.2.1/pdftops/PSOutputDev.cxx cups-1.2.x/pdftops/PSOutputDev.cxx
8404 --- release-1.2.1/pdftops/PSOutputDev.cxx 2006-07-04 17:32:06.000000000 +0100
8405 +++ cups-1.2.x/pdftops/PSOutputDev.cxx 2006-06-28 09:59:03.000000000 +0100
8406 @@ -1158,7 +1158,7 @@
8410 - writePSFmt("% Produced by xpdf/pdftops %s\n", xpdfVersion);
8411 + writePSFmt("%%Producer: xpdf/pdftops %s\n", xpdfVersion);
8412 xref->getDocInfo(&info);
8413 if (info.dictLookup("Creator", &obj1)->isString()) {
8414 writePS("%%Creator: ");
8415 diff -durN release-1.2.1/ppd/zebracpl.ppd cups-1.2.x/ppd/zebracpl.ppd
8416 --- release-1.2.1/ppd/zebracpl.ppd 2006-07-04 17:32:08.000000000 +0100
8417 +++ cups-1.2.x/ppd/zebracpl.ppd 2006-07-04 17:28:24.000000000 +0100
8418 @@ -120,6 +120,14 @@
8419 *Resolution 203dpi/203 DPI: "<</HWResolution[203 203]>>setpagedevice"
8420 *CloseUI: *Resolution
8422 +*OpenUI *zeMediaTracking/Media Tracking: PickOne
8423 +*OrderDependency: 20 AnySetup *zeMediaTracking
8424 +*DefaultzeMediaTracking: Web
8425 +*zeMediaTracking Continuous: ""
8426 +*zeMediaTracking Web/Non-continuous (Web sensing): ""
8427 +*zeMediaTracking Mark/Non-continuous (Mark sensing): ""
8428 +*CloseUI: *zeMediaTracking
8430 *OpenGroup: PrinterSettings/Printer Settings
8431 *OpenUI *Darkness/Media Darkness: PickOne
8432 *OrderDependency: 20 AnySetup *Darkness
8433 diff -durN release-1.2.1/scheduler/auth.c cups-1.2.x/scheduler/auth.c
8434 --- release-1.2.1/scheduler/auth.c 2006-07-04 17:35:29.000000000 +0100
8435 +++ cups-1.2.x/scheduler/auth.c 2006-06-26 12:45:38.000000000 +0100
8441 * Authorization routines for the Common UNIX Printing System (CUPS).
8443 @@ -869,9 +869,12 @@
8446 for (iface = (cupsd_netif_t *)cupsArrayFirst(NetIFList);
8447 - iface && !strcmp(masks->mask.name.name, iface->name);
8449 iface = (cupsd_netif_t *)cupsArrayNext(NetIFList))
8451 + if (strcmp(masks->mask.name.name, iface->name))
8454 if (iface->address.addr.sa_family == AF_INET)
8457 @@ -2168,5 +2171,5 @@
8464 diff -durN release-1.2.1/scheduler/client.c cups-1.2.x/scheduler/client.c
8465 --- release-1.2.1/scheduler/client.c 2006-07-04 17:35:29.000000000 +0100
8466 +++ cups-1.2.x/scheduler/client.c 2006-06-26 12:45:38.000000000 +0100
8472 * Client routines for the Common UNIX Printing System (CUPS) scheduler.
8477 # include <Security/Security.h>
8478 +# ifdef HAVE_SECBASEPRIV_H
8479 +# include <Security/SecBasePriv.h>
8481 + extern const char *cssmErrorString(int error);
8482 +# endif /* HAVE_SECBASEPRIV_H */
8483 #endif /* HAVE_CDSASSL */
8485 # include <gnutls/x509.h>
8486 @@ -1882,24 +1887,27 @@
8491 fd = open(con->filename, O_RDONLY);
8493 - fd = open("/dev/null", O_RDONLY);
8497 - cupsdLogMessage(CUPSD_LOG_ERROR,
8498 - "cupsdSendCommand: %d Unable to open \"%s\" for reading: %s",
8499 - con->http.fd, con->filename ? con->filename : "/dev/null",
8505 + cupsdLogMessage(CUPSD_LOG_ERROR,
8506 + "cupsdSendCommand: %d Unable to open \"%s\" for reading: %s",
8507 + con->http.fd, con->filename ? con->filename : "/dev/null",
8512 - fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
8513 + fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
8518 con->pipe_pid = pipe_command(con, fd, &(con->file), command, options, root);
8524 cupsdLogMessage(CUPSD_LOG_INFO, "Started \"%s\" (pid=%d)", command,
8526 @@ -2659,7 +2667,7 @@
8527 error = SSLSetIOFuncs(conn->session, _httpReadCDSA, _httpWriteCDSA);
8530 - error = SSLSetProtocolVersion(conn->session, kSSLProtocol3);
8531 + error = SSLSetProtocolVersionEnabled(conn->session, kSSLProtocol2, false);
8535 @@ -2697,8 +2705,8 @@
8536 "encrypt_client: Unable to encrypt connection from %s!",
8537 con->http.hostname);
8539 - cupsdLogMessage(CUPSD_LOG_ERROR,
8540 - "encrypt_client: CDSA error code is %d", (int)error);
8541 + cupsdLogMessage(CUPSD_LOG_ERROR, "encrypt_client: %s (%d)",
8542 + cssmErrorString(error), (int)error);
8544 con->http.error = error;
8545 con->http.status = HTTP_ERROR;
8546 @@ -3825,5 +3833,5 @@
8553 diff -durN release-1.2.1/scheduler/conf.c cups-1.2.x/scheduler/conf.c
8554 --- release-1.2.1/scheduler/conf.c 2006-07-04 17:35:29.000000000 +0100
8555 +++ cups-1.2.x/scheduler/conf.c 2006-06-28 09:59:05.000000000 +0100
8561 * Configuration routines for the Common UNIX Printing System (CUPS).
8563 @@ -289,6 +289,11 @@
8564 cupsdSetString(&ServerHeader, "CUPS/1.2");
8565 cupsdSetString(&StateDir, CUPS_STATEDIR);
8567 + if (!strcmp(CUPS_DEFAULT_PRINTCAP, "/etc/printers.conf"))
8568 + PrintcapFormat = PRINTCAP_SOLARIS;
8570 + PrintcapFormat = PRINTCAP_BSD;
8572 strlcpy(temp, ConfigurationFile, sizeof(temp));
8573 if ((slash = strrchr(temp, '/')) != NULL)
8575 @@ -463,6 +468,14 @@
8579 + * See if the ServerName is an IP address...
8582 + for (slash = ServerName; isdigit(*slash & 255) || *slash == '.'; slash ++);
8584 + ServerNameIsIP = !*slash;
8587 * Use the default system group if none was supplied in cupsd.conf...
8590 @@ -1277,33 +1290,14 @@
8591 const char *maskval, /* Pointer to start of mask value */
8592 *ptr, /* Pointer into value */
8594 - static unsigned netmasks[4][4] = /* Standard IPv4 netmasks... */
8596 - { 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000 },
8597 - { 0xffffffff, 0xffffffff, 0xffffffff, 0xffff0000 },
8598 - { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffff00 },
8599 - { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
8602 - static unsigned netmasks6[8][4] = /* Standard IPv6 netmasks... */
8604 - { 0xffff0000, 0x00000000, 0x00000000, 0x00000000 },
8605 - { 0xffffffff, 0x00000000, 0x00000000, 0x00000000 },
8606 - { 0xffffffff, 0xffff0000, 0x00000000, 0x00000000 },
8607 - { 0xffffffff, 0xffffffff, 0x00000000, 0x00000000 },
8608 - { 0xffffffff, 0xffffffff, 0xffff0000, 0x00000000 },
8609 - { 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000 },
8610 - { 0xffffffff, 0xffffffff, 0xffffffff, 0xffff0000 },
8611 - { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }
8613 -#endif /* AF_INET6 */
8617 * Get the address...
8620 - memset(ip, 0, sizeof(unsigned) * 4);
8621 + ip[0] = ip[1] = ip[2] = ip[2] = 0x00000000;
8622 + mask[0] = mask[1] = mask[2] = mask[3] = 0xffffffff;
8624 if ((maskval = strchr(value, '/')) != NULL)
8626 @@ -1334,6 +1328,7 @@
8627 ptr2 = strchr(ptr2 + 1, ':'), j ++);
8632 else if (isxdigit(*ptr & 255))
8634 @@ -1343,9 +1338,9 @@
8639 + ip[i / 2] |= ipval;
8641 - ip[i] |= ipval << 16;
8642 + ip[i / 2] |= ipval << 16;
8646 @@ -1354,7 +1349,10 @@
8656 if (*ptr && *ptr != '/')
8658 @@ -1366,70 +1364,55 @@
8659 * Parse dotted-decimal IPv4 address...
8663 - ipcount = sscanf(value, "%u.%u.%u.%u", ip + 0, ip + 1, ip + 2, ip + 3);
8664 + unsigned val[4]; /* IPv4 address values */
8666 - ip[3] |= ((((ip[0] << 8) | ip[1]) << 8) | ip[2]) << 8;
8667 - ip[0] = ip[1] = ip[2] = 0;
8673 + ipcount = sscanf(value, "%u.%u.%u.%u", val + 0, val + 1, val + 2, val + 3);
8676 - * Get the netmask value(s)...
8677 + * Range check the IP numbers...
8680 - memset(mask, 0, sizeof(unsigned) * 4);
8681 + for (i = 0; i < ipcount; i ++)
8686 - if (*maskval == '[')
8689 - * Get hexadecimal mask value...
8692 + * Make sure the trailing values are zeroed, as some C libraries like
8693 + * glibc apparently like to fill the unused arguments with garbage...
8696 - for (i = 0, ptr = maskval + 1; *ptr && i < 8; i ++)
8700 - else if (!strncmp(ptr, "::", 2))
8702 - for (ptr2 = strchr(ptr + 2, ':'), j = 0;
8704 - ptr2 = strchr(ptr2 + 1, ':'), j ++);
8705 + for (i = ipcount; i < 4; i ++)
8710 - else if (isxdigit(*ptr & 255))
8712 - ipval = strtoul(ptr, (char **)&ptr, 16);
8714 + * Merge everything into a 32-bit IPv4 address in ip[3]...
8717 - if (ipval > 0xffff)
8719 + ip[3] = (((((val[0] << 8) | val[1]) << 8) | val[2]) << 8) | val[3];
8724 - mask[i] |= ipval << 16;
8729 + mask[3] = (0xffffffff << (32 - 8 * ipcount)) & 0xffffffff;
8732 - while (*ptr == ':')
8738 + * Get the netmask value(s)...
8741 + memset(mask, 0, sizeof(unsigned) * 4);
8747 -#endif /* AF_INET6 */
8748 if (strchr(maskval, '.'))
8751 * Get dotted-decimal mask...
8754 + if (family != AF_INET)
8757 if (sscanf(maskval, "%u.%u.%u.%u", mask + 0, mask + 1, mask + 2, mask + 3) != 4)
8760 @@ -1447,6 +1430,9 @@
8762 if (family == AF_INET6)
8770 @@ -1478,25 +1464,20 @@
8772 #endif /* AF_INET6 */
8778 mask[0] = 0xffffffff;
8779 mask[1] = 0xffffffff;
8780 mask[2] = 0xffffffff;
8783 - mask[3] = (0xffffffff << i) & 0xffffffff;
8785 + mask[3] = (0xffffffff << (32 - i)) & 0xffffffff;
8787 mask[3] = 0xffffffff;
8792 - else if (family == AF_INET6)
8793 - memcpy(mask, netmasks6[ipcount - 1], sizeof(unsigned) * 4);
8794 -#endif /* AF_INET6 */
8796 - memcpy(mask, netmasks[ipcount - 1], sizeof(unsigned) * 4);
8798 cupsdLogMessage(CUPSD_LOG_DEBUG2,
8799 "get_addr_and_mask(value=\"%s\", "
8800 @@ -1634,7 +1615,12 @@
8802 cupsdDenyIP(loc, ones, zeros);
8805 + else if (value[0] == '*' || value[0] == '.' ||
8806 + (!isdigit(value[0] & 255) && value[0] != '['))
8808 else if (value[0] == '*' || value[0] == '.' || !isdigit(value[0] & 255))
8809 +#endif /* AF_INET6 */
8812 * Host or domain name...
8813 @@ -2406,7 +2392,12 @@
8815 cupsdDenyIP(location, ones, zeros);
8817 - else if (value[0] == '*' || value[0] == '.' || !isdigit(value[0]))
8819 + else if (value[0] == '*' || value[0] == '.' ||
8820 + (!isdigit(value[0] & 255) && value[0] != '['))
8822 + else if (value[0] == '*' || value[0] == '.' || !isdigit(value[0] & 255))
8823 +#endif /* AF_INET6 */
8826 * Host or domain name...
8827 @@ -2490,7 +2481,12 @@
8828 * nnn.nnn.nnn.nnn/mmm.mmm.mmm.mmm
8831 - if (value[0] == '*' || value[0] == '.' || !isdigit(value[0]))
8833 + if (value[0] == '*' || value[0] == '.' ||
8834 + (!isdigit(value[0] & 255) && value[0] != '['))
8836 + if (value[0] == '*' || value[0] == '.' || !isdigit(value[0] & 255))
8837 +#endif /* AF_INET6 */
8840 * Host or domain name...
8841 @@ -2584,7 +2580,7 @@
8842 strlcpy(temp2, relay->from.mask.name.name, sizeof(temp2));
8844 cupsdLogMessage(CUPSD_LOG_INFO, "Relaying from %s to %s:%d (IPv4)",
8845 - temp, temp2, ntohs(relay->to.ipv4.sin_port));
8846 + temp2, temp, ntohs(relay->to.ipv4.sin_port));
8850 @@ -3261,5 +3257,5 @@
8857 diff -durN release-1.2.1/scheduler/conf.h cups-1.2.x/scheduler/conf.h
8858 --- release-1.2.1/scheduler/conf.h 2006-07-04 17:35:29.000000000 +0100
8859 +++ cups-1.2.x/scheduler/conf.h 2006-06-28 09:59:05.000000000 +0100
8865 * Configuration file definitions for the Common UNIX Printing System (CUPS)
8868 /* Directory for request files */
8869 *DocumentRoot VALUE(NULL);
8870 /* Root directory for documents */
8871 +VAR int ServerNameIsIP VALUE(0);
8872 VAR int NumSystemGroups VALUE(0);
8873 /* Number of system group names */
8874 VAR char *SystemGroups[MAX_SYSTEM_GROUPS];
8882 diff -durN release-1.2.1/scheduler/dirsvc.c cups-1.2.x/scheduler/dirsvc.c
8883 --- release-1.2.1/scheduler/dirsvc.c 2006-07-04 17:35:29.000000000 +0100
8884 +++ cups-1.2.x/scheduler/dirsvc.c 2006-06-28 09:59:05.000000000 +0100
8890 * Directory services routines for the Common UNIX Printing System (CUPS).
8893 * cupsdStopPolling() - Stop polling servers as needed.
8894 * cupsdUpdateCUPSBrowse() - Update the browse lists using the CUPS
8896 + * cupsdUpdateLDAPBrowse() - Scan for new printers via LDAP...
8897 * cupsdUpdatePolling() - Read status messages from the poll daemons.
8898 * cupsdUpdateSLPBrowse() - Get browsing information via SLP.
8899 * dequote() - Remote quotes from a string.
8900 @@ -905,14 +906,21 @@
8901 fcntl(BrowseSocket, F_SETFD, fcntl(BrowseSocket, F_GETFD) | FD_CLOEXEC);
8904 - * Finally, add the socket to the input selection set...
8905 + * Finally, add the socket to the input selection set as needed...
8908 - cupsdLogMessage(CUPSD_LOG_DEBUG2,
8909 - "cupsdStartBrowsing: Adding fd %d to InputSet...",
8911 + if (BrowseRemoteProtocols & BROWSE_CUPS)
8914 + * We only listen if we want remote printers...
8917 - FD_SET(BrowseSocket, InputSet);
8918 + cupsdLogMessage(CUPSD_LOG_DEBUG2,
8919 + "cupsdStartBrowsing: Adding fd %d to InputSet...",
8922 + FD_SET(BrowseSocket, InputSet);
8927 @@ -1526,39 +1534,57 @@
8928 * Loop through the available printers...
8931 - if ((e = ldap_first_entry(BrowseLDAPHandle, res)) == NULL)
8932 + for (e = ldap_first_entry(BrowseLDAPHandle, res);
8934 + e = ldap_next_entry(BrowseLDAPHandle, e))
8936 - cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to get LDAP printer entry!");
8940 + * Get the required values from this entry...
8943 + if ((value = ldap_get_values(BrowseLDAPHandle, e,
8944 + "printerDescription")) == NULL)
8949 - value = ldap_get_values(BrowseLDAPHandle, e, "printerDescription");
8950 strlcpy(info, *value, sizeof(info));
8951 ldap_value_free(value);
8953 - value = ldap_get_values(BrowseLDAPHandle, e, "printerLocation");
8954 + if ((value = ldap_get_values(BrowseLDAPHandle, e,
8955 + "printerLocation")) == NULL)
8958 strlcpy(location, *value, sizeof(location));
8959 ldap_value_free(value);
8961 - value = ldap_get_values(BrowseLDAPHandle, e, "printerMakeAndModel");
8962 + if ((value = ldap_get_values(BrowseLDAPHandle, e,
8963 + "printerMakeAndModel")) == NULL)
8966 strlcpy(make_model, *value, sizeof(make_model));
8967 ldap_value_free(value);
8969 - value = ldap_get_values(BrowseLDAPHandle, e, "printerType");
8970 + if ((value = ldap_get_values(BrowseLDAPHandle, e,
8971 + "printerType")) == NULL)
8974 type = atoi(*value);
8975 ldap_value_free(value);
8977 - value = ldap_get_values(BrowseLDAPHandle, e, "printerURI");
8978 + if ((value = ldap_get_values(BrowseLDAPHandle, e,
8979 + "printerURI")) == NULL)
8982 strlcpy(uri, *value, sizeof(uri));
8983 ldap_value_free(value);
8986 + * Process the entry as browse data...
8989 if (!is_local_queue(uri, host, sizeof(host), resource, sizeof(resource)))
8990 process_browse_data(uri, host, resource, type, IPP_PRINTER_IDLE,
8991 location, info, make_model, 0, NULL);
8993 - e = ldap_next_entry(BrowseLDAPHandle, e);
8996 #endif /* HAVE_OPENLDAP */
8997 @@ -1866,7 +1892,7 @@
8998 hptr = strchr(host, '.');
8999 sptr = strchr(ServerName, '.');
9001 - if (sptr != NULL && hptr != NULL)
9002 + if (!ServerNameIsIP && sptr != NULL && hptr != NULL)
9005 * Strip the common domain name components...
9006 @@ -2521,7 +2547,7 @@
9008 httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
9009 iface->hostname, iface->port,
9010 - (p->type & CUPS_PRINTER_CLASS) ? "/classes/%s%s" :
9011 + (p->type & CUPS_PRINTER_CLASS) ? "/classes/%s" :
9014 snprintf(packet, sizeof(packet), "%x %x %s \"%s\" \"%s\" \"%s\" %s\n",
9015 @@ -2660,13 +2686,13 @@
9017 sprintf(typestring, "%u", p->type);
9019 - cn_value[0] = p->info;
9020 + cn_value[0] = p->name;
9022 - info[0] = p->info;
9023 + info[0] = p->info ? p->info : "Unknown";
9025 - location[0] = p->location;
9026 + location[0] = p->location ? p->location : "Unknown";
9028 - make_model[0] = p->make_model;
9029 + make_model[0] = p->make_model ? p->make_model : "Unknown";
9030 make_model[1] = NULL;
9031 type[0] = typestring;
9033 @@ -2674,7 +2700,7 @@
9036 snprintf(filter, sizeof(filter),
9037 - "(&(objectclass=cupsPrinter)(printerDescription~=%s))", p->info);
9038 + "(&(objectclass=cupsPrinter)(printerURI=%s))", p->uri);
9040 ldap_search_s(BrowseLDAPHandle, BrowseLDAPDN, LDAP_SCOPE_SUBTREE,
9041 filter, (char **)ldap_attrs, 0, &res);
9042 @@ -2696,7 +2722,7 @@
9043 mods[6].mod_type = "objectClass";
9044 mods[6].mod_values = (char **)objectClass_values;
9046 - snprintf(dn, sizeof(dn), "cn=%s,ou=printers,%s", p->info, BrowseLDAPDN);
9047 + snprintf(dn, sizeof(dn), "cn=%s,ou=printers,%s", p->name, BrowseLDAPDN);
9048 cupsdLogMessage(CUPSD_LOG_DEBUG2, "send_ldap_browse: dn=\"%s\"", dn);
9050 if (ldap_count_entries(BrowseLDAPHandle, res) > 0)
9051 @@ -2724,7 +2750,7 @@
9055 - * Printer has already been registered, modify the current
9056 + * Printer has never been registered, add the current
9060 @@ -2734,11 +2760,11 @@
9061 for (i = 0; i < 7; i ++)
9063 pmods[i] = mods + i;
9064 - pmods[i]->mod_op = LDAP_MOD_REPLACE;
9065 + pmods[i]->mod_op = LDAP_MOD_ADD;
9069 - if ((rc = ldap_modify_s(BrowseLDAPHandle, dn, pmods)) != LDAP_SUCCESS)
9070 + if ((rc = ldap_add_s(BrowseLDAPHandle, dn, pmods)) != LDAP_SUCCESS)
9071 cupsdLogMessage(CUPSD_LOG_ERROR,
9072 "LDAP add for %s failed with status %d: %s",
9073 p->name, rc, ldap_err2string(rc));
9074 @@ -3130,5 +3156,5 @@
9081 diff -durN release-1.2.1/scheduler/filter.c cups-1.2.x/scheduler/filter.c
9082 --- release-1.2.1/scheduler/filter.c 2006-07-04 17:35:29.000000000 +0100
9083 +++ cups-1.2.x/scheduler/filter.c 2006-06-26 12:45:38.000000000 +0100
9089 * File type conversion routines for the Common UNIX Printing System (CUPS).
9095 + tempcost += current->cost;
9097 if (tempcost < mincost)
9099 cupsArrayDelete(mintemp);
9104 - mincost = tempcost + current->cost;
9105 + mincost = tempcost;
9106 cupsArrayInsert(mintemp, current);
9116 diff -durN release-1.2.1/scheduler/ipp.c cups-1.2.x/scheduler/ipp.c
9117 --- release-1.2.1/scheduler/ipp.c 2006-07-04 17:35:29.000000000 +0100
9118 +++ cups-1.2.x/scheduler/ipp.c 2006-06-26 12:45:38.000000000 +0100
9124 * IPP routines for the Common UNIX Printing System (CUPS) scheduler.
9126 @@ -4677,8 +4677,8 @@
9127 ipp_attribute_t *attr; /* Current attribute */
9128 const char *dest; /* Destination */
9129 cups_ptype_t dtype; /* Destination type (printer or class) */
9130 - char method[HTTP_MAX_URI],
9131 - /* Method portion of URI */
9132 + char scheme[HTTP_MAX_URI],
9133 + /* Scheme portion of URI */
9134 userpass[HTTP_MAX_URI],
9135 /* Username portion of URI */
9137 @@ -4718,8 +4718,8 @@
9138 "cupsdCreateSubscription(con=%p(%d), uri=\"%s\")",
9139 con, con->http.fd, uri->values[0].string.text);
9141 - httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text, method,
9142 - sizeof(method), userpass, sizeof(userpass), host,
9143 + httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text, scheme,
9144 + sizeof(scheme), userpass, sizeof(userpass), host,
9145 sizeof(host), &port, resource, sizeof(resource));
9147 if (!strcmp(resource, "/"))
9148 @@ -4811,10 +4811,54 @@
9150 if (!strcmp(attr->name, "notify-recipient") &&
9151 attr->value_tag == IPP_TAG_URI)
9154 + * Validate the recipient scheme against the ServerBin/notifier
9158 + char notifier[1024]; /* Notifier filename */
9161 recipient = attr->values[0].string.text;
9163 + if (httpSeparateURI(HTTP_URI_CODING_ALL, recipient, scheme,
9164 + sizeof(scheme), userpass, sizeof(userpass), host,
9165 + sizeof(host), &port, resource, sizeof(resource)))
9167 + send_ipp_status(con, IPP_NOT_POSSIBLE,
9168 + _("Bad notify-recipient URI \"%s\"!"), recipient);
9169 + ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_ENUM,
9170 + "notify-status-code", IPP_URI_SCHEME);
9174 + snprintf(notifier, sizeof(notifier), "%s/notifier/%s", ServerBin,
9176 + if (access(notifier, X_OK))
9178 + send_ipp_status(con, IPP_NOT_POSSIBLE,
9179 + _("notify-recipient URI \"%s\" uses unknown scheme!"),
9181 + ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_ENUM,
9182 + "notify-status-code", IPP_URI_SCHEME);
9186 else if (!strcmp(attr->name, "notify-pull-method") &&
9187 attr->value_tag == IPP_TAG_KEYWORD)
9189 pullmethod = attr->values[0].string.text;
9191 + if (strcmp(pullmethod, "ippget"))
9193 + send_ipp_status(con, IPP_NOT_POSSIBLE,
9194 + _("Bad notify-pull-method \"%s\"!"), pullmethod);
9195 + ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_ENUM,
9196 + "notify-status-code", IPP_ATTRIBUTES);
9200 else if (!strcmp(attr->name, "notify-charset") &&
9201 attr->value_tag == IPP_TAG_CHARSET &&
9202 strcmp(attr->values[0].string.text, "us-ascii") &&
9203 @@ -9170,5 +9214,5 @@
9210 diff -durN release-1.2.1/scheduler/job.c cups-1.2.x/scheduler/job.c
9211 --- release-1.2.1/scheduler/job.c 2006-07-04 17:35:29.000000000 +0100
9212 +++ cups-1.2.x/scheduler/job.c 2006-06-28 09:59:05.000000000 +0100
9218 * Job management routines for the Common UNIX Printing System (CUPS).
9220 @@ -506,8 +506,19 @@
9223 cupsdStopJob(job, 0);
9224 - job->state->values[0].integer = IPP_JOB_PENDING;
9225 - job->state_value = IPP_JOB_PENDING;
9227 + if (!(printer->type & CUPS_PRINTER_REMOTE) ||
9228 + (printer->type & CUPS_PRINTER_IMPLICIT))
9231 + * Mark the job as pending again - we'll retry on another
9235 + job->state->values[0].integer = IPP_JOB_PENDING;
9236 + job->state_value = IPP_JOB_PENDING;
9242 @@ -3011,7 +3022,7 @@
9244 snprintf(final_content_type, sizeof(final_content_type),
9245 "FINAL_CONTENT_TYPE=%s/%s",
9246 - filter->dst->super, filter->dst->type);
9247 + filter->src->super, filter->src->type);
9248 envp[envc ++] = final_content_type;
9251 @@ -3090,28 +3101,6 @@
9253 memset(job->filters, 0, sizeof(job->filters));
9255 - filterfds[1][0] = open("/dev/null", O_RDONLY);
9257 - if (filterfds[1][0] < 0)
9259 - cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to open \"/dev/null\" - %s.",
9261 - snprintf(printer->state_message, sizeof(printer->state_message),
9262 - "Unable to open \"/dev/null\" - %s.", strerror(errno));
9264 - cupsdAddPrinterHistory(printer);
9266 - cupsdAddEvent(CUPSD_EVENT_JOB_COMPLETED, job->printer, job,
9267 - "Job canceled because the server could not open /dev/null.");
9272 - fcntl(filterfds[1][0], F_SETFD, fcntl(filterfds[1][0], F_GETFD) | FD_CLOEXEC);
9274 - cupsdLogMessage(CUPSD_LOG_DEBUG2, "start_job: filterfds[%d] = [ %d %d ]",
9275 - 1, filterfds[1][0], filterfds[1][1]);
9277 for (i = 0, slot = 0, filter = (mime_filter_t *)cupsArrayFirst(filters);
9279 i ++, filter = (mime_filter_t *)cupsArrayNext(filters))
9280 @@ -3165,36 +3154,43 @@
9283 job->print_pipes[0] = -1;
9284 - if (!strncmp(printer->device_uri, "file:/dev/", 10) &&
9285 - strcmp(printer->device_uri, "file:/dev/null"))
9286 - job->print_pipes[1] = open(printer->device_uri + 5,
9287 - O_WRONLY | O_EXCL);
9288 - else if (!strncmp(printer->device_uri, "file:///dev/", 12) &&
9289 - strcmp(printer->device_uri, "file:///dev/null"))
9290 - job->print_pipes[1] = open(printer->device_uri + 7,
9291 - O_WRONLY | O_EXCL);
9292 + if (!strcmp(printer->device_uri, "file:/dev/null") ||
9293 + !strcmp(printer->device_uri, "file:///dev/null"))
9294 + job->print_pipes[1] = -1;
9296 - job->print_pipes[1] = open(printer->device_uri + 5,
9297 - O_WRONLY | O_CREAT | O_TRUNC, 0600);
9299 - if (job->print_pipes[1] < 0)
9301 - cupsdLogMessage(CUPSD_LOG_ERROR,
9302 - "Unable to open output file \"%s\" - %s.",
9303 - printer->device_uri, strerror(errno));
9304 - snprintf(printer->state_message, sizeof(printer->state_message),
9305 - "Unable to open output file \"%s\" - %s.",
9306 - printer->device_uri, strerror(errno));
9307 + if (!strncmp(printer->device_uri, "file:/dev/", 10))
9308 + job->print_pipes[1] = open(printer->device_uri + 5,
9309 + O_WRONLY | O_EXCL);
9310 + else if (!strncmp(printer->device_uri, "file:///dev/", 12))
9311 + job->print_pipes[1] = open(printer->device_uri + 7,
9312 + O_WRONLY | O_EXCL);
9313 + else if (!strncmp(printer->device_uri, "file:///", 8))
9314 + job->print_pipes[1] = open(printer->device_uri + 7,
9315 + O_WRONLY | O_CREAT | O_TRUNC, 0600);
9317 + job->print_pipes[1] = open(printer->device_uri + 5,
9318 + O_WRONLY | O_CREAT | O_TRUNC, 0600);
9320 - cupsdAddEvent(CUPSD_EVENT_JOB_COMPLETED, job->printer, job,
9321 - "Job canceled because the server could not open the "
9323 + if (job->print_pipes[1] < 0)
9325 + cupsdLogMessage(CUPSD_LOG_ERROR,
9326 + "Unable to open output file \"%s\" - %s.",
9327 + printer->device_uri, strerror(errno));
9328 + snprintf(printer->state_message, sizeof(printer->state_message),
9329 + "Unable to open output file \"%s\" - %s.",
9330 + printer->device_uri, strerror(errno));
9334 + cupsdAddEvent(CUPSD_EVENT_JOB_COMPLETED, job->printer, job,
9335 + "Job canceled because the server could not open the "
9338 - fcntl(job->print_pipes[1], F_SETFD,
9339 - fcntl(job->print_pipes[1], F_GETFD) | FD_CLOEXEC);
9343 + fcntl(job->print_pipes[1], F_SETFD,
9344 + fcntl(job->print_pipes[1], F_GETFD) | FD_CLOEXEC);
9348 cupsdLogMessage(CUPSD_LOG_DEBUG2,
9349 @@ -3274,25 +3270,7 @@
9352 filterfds[slot][0] = -1;
9353 - filterfds[slot][1] = open("/dev/null", O_WRONLY);
9355 - if (filterfds[slot][1] < 0)
9357 - cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to open \"/dev/null\" - %s.",
9359 - snprintf(printer->state_message, sizeof(printer->state_message),
9360 - "Unable to open \"/dev/null\" - %s.", strerror(errno));
9362 - cupsdAddPrinterHistory(printer);
9364 - cupsdAddEvent(CUPSD_EVENT_JOB_COMPLETED, job->printer, job,
9365 - "Job canceled because the server could not open a file.");
9370 - fcntl(filterfds[slot][1], F_SETFD,
9371 - fcntl(filterfds[slot][1], F_GETFD) | FD_CLOEXEC);
9372 + filterfds[slot][1] = -1;
9374 cupsdLogMessage(CUPSD_LOG_DEBUG2, "start_job: backend=\"%s\"",
9376 @@ -3455,5 +3433,5 @@
9383 diff -durN release-1.2.1/scheduler/main.c cups-1.2.x/scheduler/main.c
9384 --- release-1.2.1/scheduler/main.c 2006-07-04 17:35:29.000000000 +0100
9385 +++ cups-1.2.x/scheduler/main.c 2006-06-26 12:45:38.000000000 +0100
9391 * Scheduler main loop for the Common UNIX Printing System (CUPS).
9395 getrlimit(RLIMIT_NOFILE, &limit);
9397 - if (limit.rlim_max > CUPS_MAX_FDS)
9398 - MaxFDs = CUPS_MAX_FDS;
9399 + if (limit.rlim_max > FD_SETSIZE)
9400 + MaxFDs = FD_SETSIZE;
9402 MaxFDs = limit.rlim_max;
9404 @@ -2253,5 +2253,5 @@
9411 diff -durN release-1.2.1/scheduler/mime.c cups-1.2.x/scheduler/mime.c
9412 --- release-1.2.1/scheduler/mime.c 2006-07-04 17:35:29.000000000 +0100
9413 +++ cups-1.2.x/scheduler/mime.c 2006-06-26 12:45:38.000000000 +0100
9419 * MIME database file routines for the Common UNIX Printing System (CUPS).
9425 +#include <cups/debug.h>
9426 #include <cups/dir.h>
9427 #include <cups/string.h>
9430 if ((fp = cupsFileOpen(filename, "r")) == NULL)
9433 + DEBUG_printf(("\"%s\":\n", filename));
9436 * Then read each line from the file, skipping any comments in the file...
9439 * Skip blank lines and lines starting with a #...
9444 if (!line[0] || line[0] == '#')
9447 @@ -544,7 +549,10 @@
9450 if ((dsttype = mimeType(mime, super, type)) == NULL)
9452 + DEBUG_printf((" Destination type %s/%s not found!\n", super, type));
9457 * Then get the cost and filter program...
9458 @@ -575,7 +583,10 @@
9461 if (!add_fcache(filtercache, filter, filterpath))
9463 + DEBUG_printf((" Filter %s not found in %s!\n", filter, filterpath));
9470 if ((fp = cupsFileOpen(filename, "r")) == NULL)
9473 + DEBUG_printf(("\"%s\":\n", filename));
9476 * Then read each line from the file, skipping any comments in the file...
9479 * Skip blank lines and lines starting with a #...
9484 if (!line[0] || line[0] == '#')
9494 diff -durN release-1.2.1/scheduler/printers.c cups-1.2.x/scheduler/printers.c
9495 --- release-1.2.1/scheduler/printers.c 2006-07-04 17:35:29.000000000 +0100
9496 +++ cups-1.2.x/scheduler/printers.c 2006-06-26 12:45:38.000000000 +0100
9502 * Printer routines for the Common UNIX Printing System (CUPS).
9508 +#include <cups/dir.h>
9512 @@ -257,6 +258,11 @@
9514 int i; /* Looping var */
9515 ipp_attribute_t *attr; /* Attribute data */
9516 + cups_dir_t *dir; /* Notifier directory */
9517 + cups_dentry_t *dent; /* Notifier directory entry */
9518 + cups_array_t *notifiers; /* Notifier array */
9519 + char filename[1024], /* Filename */
9520 + *notifier; /* Current notifier */
9521 static const int nups[] = /* number-up-supported values */
9522 { 1, 2, 4, 6, 9, 16 };
9523 static const ipp_orient_t orients[4] =/* orientation-requested-supported values */
9524 @@ -502,11 +508,11 @@
9525 ippAddInteger(CommonData, IPP_TAG_PRINTER, IPP_TAG_INTEGER,
9526 "notify-max-events-supported", MaxEvents);
9528 - /* notify-notify-events-default */
9529 + /* notify-events-default */
9530 ippAddString(CommonData, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
9531 "notify-events-default", NULL, "job-completed");
9533 - /* notify-notify-events-supported */
9534 + /* notify-events-supported */
9535 ippAddStrings(CommonData, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
9536 "notify-events-supported",
9537 (int)(sizeof(notify_events) / sizeof(notify_events[0])),
9538 @@ -516,10 +522,31 @@
9539 ippAddString(CommonData, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
9540 "notify-pull-method-supported", NULL, "ippget");
9542 - /* TODO: scan notifier directory */
9543 /* notify-schemes-supported */
9544 - ippAddString(CommonData, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
9545 - "notify-schemes-supported", NULL, "mailto");
9546 + snprintf(filename, sizeof(filename), "%s/notifier", ServerBin);
9547 + if ((dir = cupsDirOpen(filename)) != NULL)
9549 + notifiers = cupsArrayNew((cups_array_func_t)strcmp, NULL);
9551 + while ((dent = cupsDirRead(dir)) != NULL)
9552 + if (S_ISREG(dent->fileinfo.st_mode) &&
9553 + (dent->fileinfo.st_mode & S_IXOTH) != 0)
9554 + cupsArrayAdd(notifiers, _cupsStrAlloc(dent->filename));
9556 + if (cupsArrayCount(notifiers) > 0)
9558 + attr = ippAddStrings(CommonData, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
9559 + "notify-schemes-supported",
9560 + cupsArrayCount(notifiers), NULL, NULL);
9562 + for (i = 0, notifier = (char *)cupsArrayFirst(notifiers);
9564 + i ++, notifier = (char *)cupsArrayNext(notifiers))
9565 + attr->values[i].string.text = notifier;
9568 + cupsArrayDelete(notifiers);
9571 /* number-up-supported */
9572 ippAddIntegers(CommonData, IPP_TAG_PRINTER, IPP_TAG_INTEGER,
9574 dp = (cupsd_printer_t *)cupsArrayNext(Printers))
9575 if (dp != p && (dp->type & CUPS_PRINTER_DEFAULT))
9577 - DefaultPrinter = p;
9578 + DefaultPrinter = dp;
9582 @@ -3280,5 +3307,5 @@
9589 diff -durN release-1.2.1/scheduler/subscriptions.c cups-1.2.x/scheduler/subscriptions.c
9590 --- release-1.2.1/scheduler/subscriptions.c 2006-07-04 17:35:29.000000000 +0100
9591 +++ cups-1.2.x/scheduler/subscriptions.c 2006-06-26 12:45:38.000000000 +0100
9597 * Subscription routines for the Common UNIX Printing System (CUPS) scheduler.
9600 * cupsdStopAllNotifiers() - Stop all notifier processes.
9601 * cupsdUpdateNotifierStatus() - Read messages from notifiers.
9602 * cupsd_compare_subscriptions() - Compare two subscriptions.
9603 - * cupsd_delete_all_events() - Delete all cached events.
9604 * cupsd_delete_event() - Delete a single event...
9605 * cupsd_send_dbus() - Send a DBUS notification...
9606 * cupsd_send_notification() - Send a notification for the specified
9608 static int cupsd_compare_subscriptions(cupsd_subscription_t *first,
9609 cupsd_subscription_t *second,
9611 -static void cupsd_delete_all_events(void);
9612 static void cupsd_delete_event(cupsd_event_t *event);
9614 static void cupsd_send_dbus(cupsd_eventmask_t event, cupsd_printer_t *dest,
9615 @@ -114,29 +112,11 @@
9619 - * Allocate memory for the event cache as needed...
9624 - Events = calloc(MaxEvents, sizeof(cupsd_event_t *));
9629 - cupsdLogMessage(CUPSD_LOG_CRIT,
9630 - "Unable to allocate memory for event cache - %s",
9637 * Then loop through the subscriptions and add the event to the corresponding
9641 - for (sub = (cupsd_subscription_t *)cupsArrayFirst(Subscriptions), temp = NULL;
9642 + for (temp = NULL, sub = (cupsd_subscription_t *)cupsArrayFirst(Subscriptions);
9644 sub = (cupsd_subscription_t *)cupsArrayNext(Subscriptions))
9646 @@ -149,185 +129,168 @@
9647 (sub->job == job || !sub->job))
9650 - * Need this event...
9651 + * Need this event, so create a new event record...
9655 + if ((temp = (cupsd_event_t *)calloc(1, sizeof(cupsd_event_t))) == NULL)
9658 - * Create the new event record...
9660 + cupsdLogMessage(CUPSD_LOG_CRIT,
9661 + "Unable to allocate memory for event - %s",
9666 - if ((temp = (cupsd_event_t *)calloc(1, sizeof(cupsd_event_t))) == NULL)
9668 - cupsdLogMessage(CUPSD_LOG_CRIT,
9669 - "Unable to allocate memory for event - %s",
9673 + temp->event = event;
9674 + temp->time = time(NULL);
9675 + temp->attrs = ippNew();
9677 + temp->dest = dest;
9679 - temp->event = event;
9680 - temp->time = time(NULL);
9681 - temp->attrs = ippNew();
9683 - temp->dest = dest;
9685 + * Add common event notification attributes...
9689 - * Add common event notification attributes...
9691 + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_CHARSET,
9692 + "notify-charset", NULL, "utf-8");
9694 - ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_INTEGER,
9695 - "notify-subscription-id", sub->id);
9696 + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_LANGUAGE,
9697 + "notify-natural-langugage", NULL, "en-US");
9699 - ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_KEYWORD,
9700 - "notify-subscribed-event", NULL, cupsdEventName(event));
9701 + ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_INTEGER,
9702 + "notify-subscription-id", sub->id);
9704 - ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_INTEGER,
9705 - "printer-up-time", time(NULL));
9706 + ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_INTEGER,
9707 + "notify-sequence-number", sub->next_event_id);
9709 - va_start(ap, text);
9710 - vsnprintf(ftext, sizeof(ftext), text, ap);
9712 + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_KEYWORD,
9713 + "notify-subscribed-event", NULL, cupsdEventName(event));
9715 - ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_TEXT,
9716 - "notify-text", NULL, ftext);
9717 + if (sub->user_data_len > 0)
9718 + ippAddOctetString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
9719 + "notify-user-data", sub->user_data,
9720 + sub->user_data_len);
9725 - * Add printer attributes...
9727 + ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_INTEGER,
9728 + "printer-up-time", time(NULL));
9730 - ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_URI,
9731 - "notify-printer-uri", NULL, dest->uri);
9732 + va_start(ap, text);
9733 + vsnprintf(ftext, sizeof(ftext), text, ap);
9736 - ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_NAME,
9737 - "printer-name", NULL, dest->name);
9738 + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_TEXT,
9739 + "notify-text", NULL, ftext);
9741 - ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_ENUM,
9742 - "printer-state", dest->state);
9746 + * Add printer attributes...
9749 - if (dest->num_reasons == 0)
9750 - ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
9751 - IPP_TAG_KEYWORD, "printer-state-reasons", NULL,
9752 - dest->state == IPP_PRINTER_STOPPED ? "paused" : "none");
9754 - ippAddStrings(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
9755 - IPP_TAG_KEYWORD, "printer-state-reasons",
9756 - dest->num_reasons, NULL,
9757 - (const char * const *)dest->reasons);
9758 + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_URI,
9759 + "notify-printer-uri", NULL, dest->uri);
9761 - ippAddBoolean(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
9762 - "printer-is-accepting-jobs", dest->accepting);
9764 + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_NAME,
9765 + "printer-name", NULL, dest->name);
9770 - * Add job attributes...
9772 + ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_ENUM,
9773 + "printer-state", dest->state);
9775 - ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_INTEGER,
9776 - "notify-job-id", job->id);
9777 - ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_ENUM,
9778 - "job-state", job->state_value);
9779 + if (dest->num_reasons == 0)
9780 + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
9781 + IPP_TAG_KEYWORD, "printer-state-reasons", NULL,
9782 + dest->state == IPP_PRINTER_STOPPED ? "paused" : "none");
9784 + ippAddStrings(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
9785 + IPP_TAG_KEYWORD, "printer-state-reasons",
9786 + dest->num_reasons, NULL,
9787 + (const char * const *)dest->reasons);
9789 - if ((attr = ippFindAttribute(job->attrs, "job-name",
9790 - IPP_TAG_NAME)) != NULL)
9791 - ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_NAME,
9792 - "job-name", NULL, attr->values[0].string.text);
9793 + ippAddBoolean(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
9794 + "printer-is-accepting-jobs", dest->accepting);
9797 - switch (job->state_value)
9799 - case IPP_JOB_PENDING :
9800 - if (dest && dest->state == IPP_PRINTER_STOPPED)
9801 - ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
9802 - IPP_TAG_KEYWORD, "job-state-reasons", NULL,
9803 - "printer-stopped");
9805 - ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
9806 - IPP_TAG_KEYWORD, "job-state-reasons", NULL,
9812 + * Add job attributes...
9815 - case IPP_JOB_HELD :
9816 - if (ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_KEYWORD) != NULL ||
9817 - ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_NAME) != NULL)
9818 - ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
9819 - IPP_TAG_KEYWORD, "job-state-reasons", NULL,
9820 - "job-hold-until-specified");
9822 - ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
9823 - IPP_TAG_KEYWORD, "job-state-reasons", NULL,
9826 + ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_INTEGER,
9827 + "notify-job-id", job->id);
9828 + ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_ENUM,
9829 + "job-state", job->state_value);
9831 - case IPP_JOB_PROCESSING :
9832 - ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
9833 - IPP_TAG_KEYWORD, "job-state-reasons", NULL,
9836 + if ((attr = ippFindAttribute(job->attrs, "job-name",
9837 + IPP_TAG_NAME)) != NULL)
9838 + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_NAME,
9839 + "job-name", NULL, attr->values[0].string.text);
9841 - case IPP_JOB_STOPPED :
9842 + switch (job->state_value)
9844 + case IPP_JOB_PENDING :
9845 + if (dest && dest->state == IPP_PRINTER_STOPPED)
9846 ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
9847 IPP_TAG_KEYWORD, "job-state-reasons", NULL,
9851 - case IPP_JOB_CANCELLED :
9852 + "printer-stopped");
9854 ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
9855 IPP_TAG_KEYWORD, "job-state-reasons", NULL,
9856 - "job-canceled-by-user");
9861 - case IPP_JOB_ABORTED :
9862 + case IPP_JOB_HELD :
9863 + if (ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_KEYWORD) != NULL ||
9864 + ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_NAME) != NULL)
9865 ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
9866 IPP_TAG_KEYWORD, "job-state-reasons", NULL,
9867 - "aborted-by-system");
9870 - case IPP_JOB_COMPLETED :
9871 + "job-hold-until-specified");
9873 ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
9874 IPP_TAG_KEYWORD, "job-state-reasons", NULL,
9875 - "job-completed-successfully");
9879 - ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_INTEGER,
9880 - "job-impressions-completed",
9881 - job->sheets ? job->sheets->values[0].integer : 0);
9887 - * Purge an old event as needed...
9889 + case IPP_JOB_PROCESSING :
9890 + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
9891 + IPP_TAG_KEYWORD, "job-state-reasons", NULL,
9895 - if (NumEvents >= MaxEvents)
9898 - * Purge the oldest event in the cache...
9900 + case IPP_JOB_STOPPED :
9901 + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
9902 + IPP_TAG_KEYWORD, "job-state-reasons", NULL,
9906 - cupsd_delete_event(Events[0]);
9907 + case IPP_JOB_CANCELLED :
9908 + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
9909 + IPP_TAG_KEYWORD, "job-state-reasons", NULL,
9910 + "job-canceled-by-user");
9914 + case IPP_JOB_ABORTED :
9915 + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
9916 + IPP_TAG_KEYWORD, "job-state-reasons", NULL,
9917 + "aborted-by-system");
9920 - memmove(Events, Events + 1, NumEvents * sizeof(cupsd_event_t *));
9921 + case IPP_JOB_COMPLETED :
9922 + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION,
9923 + IPP_TAG_KEYWORD, "job-state-reasons", NULL,
9924 + "job-completed-successfully");
9928 + ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_INTEGER,
9929 + "job-impressions-completed",
9930 + job->sheets ? job->sheets->values[0].integer : 0);
9933 - * Add the new event to the main cache...
9934 + * Send the notification for this subscription...
9937 - Events[NumEvents] = temp;
9939 + cupsd_send_notification(sub, temp);
9943 - * Send the notification for this subscription...
9946 - cupsd_send_notification(sub, temp);
9951 cupsd_subscription_t *sub; /* Subscription */
9954 - cupsd_delete_all_events();
9960 cupsd_subscription_t *sub, /* I - Subscription object */
9961 int update) /* I - 1 = update subscriptions.conf */
9963 + int i; /* Looping var */
9967 * Close the pipe to the notifier as needed...
9969 @@ -483,7 +447,12 @@
9970 cupsdClearString(&(sub->recipient));
9974 + for (i = 0; i < sub->num_events; i ++)
9975 + cupsd_delete_event(sub->events[i]);
9982 @@ -1300,27 +1269,6 @@
9986 - * 'cupsd_delete_all_events()' - Delete all cached events.
9990 -cupsd_delete_all_events(void)
9992 - int i; /* Looping var */
9995 - if (MaxEvents <= 0 || !Events)
9998 - for (i = 0; i < NumEvents; i ++)
9999 - cupsd_delete_event(Events[i]);
10007 * 'cupsd_delete_event()' - Delete a single event...
10009 * Oldest events must be deleted first, otherwise the subscription cache
10010 @@ -1330,43 +1278,6 @@
10012 cupsd_delete_event(cupsd_event_t *event)/* I - Event to delete */
10014 - cupsd_subscription_t *sub; /* Current subscription */
10018 - * Loop through the subscriptions and look for the event in the cache...
10021 - for (sub = (cupsd_subscription_t *)cupsArrayFirst(Subscriptions);
10023 - sub = (cupsd_subscription_t *)cupsArrayNext(Subscriptions))
10026 - * Only check the first event in the subscription cache, since the
10027 - * caller will only delete the oldest event in the cache...
10030 - if (sub->num_events > 0 && sub->events[0] == event)
10033 - * Remove this event...
10036 - sub->num_events --;
10037 - sub->first_event_id ++;
10039 - if (sub->num_events > 0)
10042 - * Shift other events upward in cache...
10045 - memmove(sub->events, sub->events + 1,
10046 - sub->num_events * sizeof(cupsd_event_t *));
10054 @@ -1490,6 +1401,25 @@
10058 + * Purge an old event as needed...
10061 + if (sub->num_events >= MaxEvents)
10064 + * Purge the oldest event in the cache...
10067 + cupsd_delete_event(sub->events[0]);
10069 + sub->num_events --;
10070 + sub->first_event_id ++;
10072 + memmove(sub->events, sub->events + 1,
10073 + sub->num_events * sizeof(cupsd_event_t *));
10077 * Add the event to the subscription. Since the events array is
10078 * always MaxEvents in length, and since we will have already
10079 * removed an event from the subscription cache if we hit the
10080 @@ -1661,5 +1591,5 @@
10087 diff -durN release-1.2.1/scheduler/subscriptions.h cups-1.2.x/scheduler/subscriptions.h
10088 --- release-1.2.1/scheduler/subscriptions.h 2006-07-04 17:35:29.000000000 +0100
10089 +++ cups-1.2.x/scheduler/subscriptions.h 2006-06-26 12:45:38.000000000 +0100
10095 * Subscription definitions for the Common UNIX Printing System (CUPS) scheduler.
10097 @@ -131,11 +131,9 @@
10098 VAR cups_array_t *Subscriptions VALUE(NULL);
10099 /* Active subscriptions */
10101 -VAR int MaxEvents VALUE(100), /* Maximum number of events */
10102 - NumEvents VALUE(0); /* Number of active events */
10103 -VAR cupsd_event_t **Events VALUE(NULL); /* Active events */
10104 +VAR int MaxEvents VALUE(100); /* Maximum number of events */
10106 -VAR unsigned LastEvent VALUE(0); /* Last events processed */
10107 +VAR unsigned LastEvent VALUE(0); /* Last event(s) processed */
10108 VAR int NotifierPipes[2] VALUE2(-1, -1);
10109 /* Pipes for notifier error/debug output */
10110 VAR cupsd_statbuf_t *NotifierStatusBuffer VALUE(NULL);
10111 @@ -170,5 +168,5 @@
10118 diff -durN release-1.2.1/scheduler/testmime.c cups-1.2.x/scheduler/testmime.c
10119 --- release-1.2.1/scheduler/testmime.c 2006-07-04 17:35:29.000000000 +0100
10120 +++ cups-1.2.x/scheduler/testmime.c 2006-06-26 12:45:38.000000000 +0100
10126 * MIME test program for the Common UNIX Printing System (CUPS).
10132 - filter_path = "../filter:../pdftops";
10133 + filter_path = "../filter:../pdftops:" CUPS_SERVERBIN "/filter";
10135 for (i = 1; i < argc; i ++)
10136 if (!strcmp(argv[i], "-d"))
10137 @@ -331,5 +331,5 @@
10144 diff -durN release-1.2.1/systemv/cancel.c cups-1.2.x/systemv/cancel.c
10145 --- release-1.2.1/systemv/cancel.c 2006-07-04 17:33:00.000000000 +0100
10146 +++ cups-1.2.x/systemv/cancel.c 2006-06-28 09:59:04.000000000 +0100
10152 * "cancel" command for the Common UNIX Printing System (CUPS).
10154 @@ -121,7 +121,10 @@
10156 case 'h' : /* Connect to host */
10163 if (argv[i][2] != '\0')
10164 cupsSetServer(argv[i] + 2);
10165 @@ -387,5 +390,5 @@
10172 diff -durN release-1.2.1/systemv/lpstat.c cups-1.2.x/systemv/lpstat.c
10173 --- release-1.2.1/systemv/lpstat.c 2006-07-04 17:33:00.000000000 +0100
10174 +++ cups-1.2.x/systemv/lpstat.c 2006-06-26 12:43:30.000000000 +0100
10180 * "lpstat" command for the Common UNIX Printing System (CUPS).
10182 @@ -70,26 +70,59 @@
10186 -main(int argc, /* I - Number of command-line arguments */
10187 - char *argv[]) /* I - Command-line arguments */
10188 +main(int argc, /* I - Number of command-line arguments */
10189 + char *argv[]) /* I - Command-line arguments */
10191 - int i, /* Looping var */
10192 - status; /* Exit status */
10193 - http_t *http; /* Connection to server */
10194 - int num_dests; /* Number of user destinations */
10195 - cups_dest_t *dests; /* User destinations */
10196 - int long_status; /* Long status report? */
10197 - int ranking; /* Show job ranking? */
10198 - const char *which; /* Which jobs to show? */
10199 - char op; /* Last operation on command-line */
10200 + int i, /* Looping var */
10201 + status; /* Exit status */
10202 + http_t *http; /* Connection to server */
10203 + int num_dests; /* Number of user destinations */
10204 + cups_dest_t *dests; /* User destinations */
10205 + int long_status; /* Long status report? */
10206 + int ranking; /* Show job ranking? */
10207 + const char *which; /* Which jobs to show? */
10208 + char op; /* Last operation on command-line */
10212 * Set the locale so that times, etc. are displayed properly.
10214 + * Unfortunately, while we need the localized time value, we *don't*
10215 + * want to use the localized charset for the time value, so we need
10216 + * to set LC_TIME to the locale name with .UTF-8 on the end (if
10217 + * the locale includes a character set specifier...)
10220 setlocale(LC_ALL, "");
10224 + const char *lc_time; /* Current LC_TIME value */
10225 + char new_lc_time[255], /* New LC_TIME value */
10226 + *charset; /* Pointer to character set */
10228 + if ((lc_time = setlocale(LC_TIME, NULL)) == NULL)
10229 + lc_time = setlocale(LC_ALL, NULL);
10233 + strlcpy(new_lc_time, lc_time, sizeof(new_lc_time));
10234 + if ((charset = strchr(new_lc_time, '.')) == NULL)
10235 + charset = new_lc_time + strlen(new_lc_time);
10237 + strlcpy(charset, ".UTF-8", sizeof(new_lc_time) - (charset - new_lc_time));
10240 + strcpy(new_lc_time, "C");
10242 + setlocale(LC_TIME, new_lc_time);
10244 +#endif /* LC_TIME */
10247 + * Parse command-line options...
10253 @@ -2248,5 +2281,5 @@
10260 diff -durN release-1.2.1/systemv/Makefile cups-1.2.x/systemv/Makefile
10261 --- release-1.2.1/systemv/Makefile 2006-07-04 17:33:00.000000000 +0100
10262 +++ cups-1.2.x/systemv/Makefile 2006-06-26 12:43:30.000000000 +0100
10268 # System V commands makefile for the Common UNIX Printing System (CUPS).
10271 $(INSTALL_BIN) lp $(BINDIR)
10272 $(INSTALL_BIN) lpoptions $(BINDIR)
10273 $(INSTALL_BIN) lpstat $(BINDIR)
10274 - $(INSTALL_BIN) -m 4755 -o $(CUPS_USER) -g $(CUPS_GROUP) lppasswd $(BINDIR) || $(INSTALL_BIN) lppasswd $(BINDIR)
10275 + $(INSTALL_BIN) -m 4755 -o root lppasswd $(BINDIR) || $(INSTALL_BIN) lppasswd $(BINDIR)
10279 @@ -225,5 +225,5 @@
10286 diff -durN release-1.2.1/templates/Makefile cups-1.2.x/templates/Makefile
10287 --- release-1.2.1/templates/Makefile 2006-07-04 17:35:22.000000000 +0100
10288 +++ cups-1.2.x/templates/Makefile 2006-06-26 12:45:31.000000000 +0100
10294 # Template makefile for the Common UNIX Printing System (CUPS).
10296 @@ -118,11 +118,13 @@
10301 +install: all $(INSTALL_LANGUAGES)
10302 $(INSTALL_DIR) -m 755 $(DATADIR)/templates
10303 for file in $(FILES); do \
10304 $(INSTALL_DATA) $$file $(DATADIR)/templates; \
10307 +install-languages:
10308 for lang in $(LANGUAGES); do \
10309 $(INSTALL_DIR) -m 755 $(DATADIR)/templates/$$lang; \
10310 for file in $(FILES); do \
10311 @@ -137,19 +139,21 @@
10312 # Uninstall files...
10316 +uninstall: $(UNINSTALL_LANGUAGES)
10317 for file in $(FILES); do \
10318 $(RM) $(DATADIR)/templates/$$file; \
10320 + -$(RMDIR) $(DATADIR)/templates
10322 +uninstall-languages:
10323 for lang in $(LANGUAGES); do \
10324 for file in $(FILES); do \
10325 $(RM) $(DATADIR)/templates/$$lang/$$file; \
10327 $(RMDIR) $(DATADIR)/templates/$$lang; \
10329 - -$(RMDIR) $(DATADIR)/templates