]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Merge changes from CUPS 1.5svn-r9313.
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 22 Sep 2010 22:13:21 +0000 (22:13 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 22 Sep 2010 22:13:21 +0000 (22:13 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@2683 a1ca3aef-8c08-0410-bb20-df032aa958be

103 files changed:
CHANGES-1.4.txt
backend/Dependencies
backend/Makefile
backend/ipp.c
backend/pap.c [deleted file]
backend/runloop.c
backend/serial.c
backend/usb-darwin.c
backend/usb-libusb.c
berkeley/Dependencies
cgi-bin/Dependencies
cgi-bin/admin.c
config-scripts/cups-common.m4
config-scripts/cups-pap.m4
config-scripts/cups-ssl.m4
config.h.in
configure.in
cups/Dependencies
cups/adminutil.c
cups/api-filter.header
cups/attr.c
cups/auth.c
cups/conflicts.c
cups/cups-private.h
cups/cups.h
cups/debug-private.h
cups/debug.c
cups/dest.c
cups/dir.c
cups/emit.c
cups/encode.c
cups/file.c
cups/globals.c
cups/http-addrlist.c
cups/http-private.h
cups/http-support.c
cups/http.c
cups/http.h
cups/ipp-support.c
cups/ipp.h
cups/language.c
cups/libcups2.def
cups/localize.c
cups/mark.c
cups/options.c
cups/page.c
cups/ppd-private.h
cups/ppd.c
cups/pwg-media.c
cups/pwg-ppd.c
cups/pwg-private.h
cups/request.c
cups/string-private.h
cups/string.c
cups/testfile.c
cups/testhttp.c
cups/testpwg.c
cups/transcode.c
cups/usersys.c
cups/versioning.h
doc/Makefile
driver/Dependencies
filter/Dependencies
filter/pstops.c
locale/Dependencies
man/ipptoolfile.man
man/lp.man
man/lpadmin.man
monitor/Dependencies
notifier/Dependencies
ppdc/Dependencies
scheduler/Dependencies
scheduler/auth.c
scheduler/classes.c
scheduler/client.c
scheduler/cupsd.h
scheduler/dirsvc.c
scheduler/ipp.c
scheduler/job.c
scheduler/main.c
scheduler/printers.c
scheduler/process.c
scripting/php/Dependencies
systemv/Dependencies
systemv/cupsaddsmb.c
systemv/lpadmin.c
systemv/lpstat.c
templates/de/add-class.tmpl
templates/de/add-rss-subscription.tmpl
templates/de/search.tmpl
templates/ja/option-pickone.tmpl
templates/pl/set-printer-options-header.tmpl
test/Dependencies
test/ipp-1.1.test
test/ipp-2.0.test
test/ipp-2.1.test
test/ipptool.c
test/print-job-media-col.test
test/print-uri.test [new file with mode: 0644]
test/run-stp-tests.sh
vcnet/config.h
vcnet/regex/engine.c
vcnet/regex/regcomp.c

index 330778b10fbbada7bedeb2d467841c23fa7cc427..2888b12a91e7cf28e117d44cb185ec7cb9e5ef86 100644 (file)
@@ -1,9 +1,45 @@
 CHANGES-1.4.txt
 ---------------
 
+CHANGES IN CUPS V1.4.6
+
+
+
 CHANGES IN CUPS V1.4.5
 
-       - Documentation fixes (STR #3542)
+       - Documentation fixes (STR #3542, STR #3650)
+       - Localization fixes (STR #3635, STR #3636, STR #3647, STR #3666)
+       - The scheduler would restart jobs while shutting down (STR #3679)
+       - Fixed a PPD loader bug that could cause a crash in cupsd (STR #3680)
+       - Improved the mapping of non-standard PPD and PWG names (STR #3671)
+       - The scheduler did not initialize Kerberos in all cases (STR #3662)
+       - cupsAdminSetServerSettings duplicated Listen and Order lines
+         (STR #3645)
+       - Added DeviceN colorspace support to the CUPS Raster format (STR #3419)
+       - ppdMarkDefaults() did not clear the marked field of the previous
+         choices (STR #3642)
+       - The serial backend would not allow a raw job to be canceled
+         (STR #3649)
+       - The socket backend could go into an infinite loop with certain
+         printers (STR #3622)
+       - Setting the PRINTER or LPDEST environment variables to "name/instance"
+         did not work (STR #3485)
+       - The scheduler did not handle the JobRetryLimit setting properly
+         (STR #3466)
+       - The lpstat command always showed a remote job ID of 0 for shared
+         printers (STR #3627)
+       - Increased the write timeout for the libusb-based USB backend to 5
+         minutes (STR #3595)
+       - The libusb-base USB backend did not check whether the printer has a
+         serial number (STR #3590)
+       - The lpadmin command did not support setting of custom option values
+         (STR #3631)
+       - The lpadmin command did not support setting of the location or
+         description of a class (STR #3613)
+       - The cupsaddsmb command did not give up after too many failed attempts
+         (STR #3615)
+       - The CUPS library no longer uses certain problematic ctype macros that
+         change based on the locale's character set.
        - PJL value substitution of more than 9 values was broken (STR #3621)
        - Custom options with missing string values caused ppdEmit* to segfault
          (STR #3620)
index 0f3718ed3e2ceb1394192a9a0e34b2a3e6854704..f6c512e4abdee6984e3ebe5be236059360c35267 100644 (file)
@@ -1,8 +1,8 @@
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
 ipp.o: backend-private.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-ipp.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h
-ipp.o: ../cups/array.h ../cups/string-private.h ../config.h
+ipp.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+ipp.o: ../cups/language.h ../cups/string-private.h ../config.h
 ipp.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 ipp.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 ipp.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
@@ -12,8 +12,8 @@ ipp.o: ../cups/sidechannel.h
 lpd.o: ../cups/http-private.h ../config.h ../cups/http.h
 lpd.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
 lpd.o: backend-private.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-lpd.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h
-lpd.o: ../cups/array.h ../cups/string-private.h ../cups/debug-private.h
+lpd.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+lpd.o: ../cups/language.h ../cups/string-private.h ../cups/debug-private.h
 lpd.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
 lpd.o: ../cups/pwg-private.h ../cups/http-private.h
 lpd.o: ../cups/language-private.h ../cups/transcode.h
@@ -21,7 +21,7 @@ lpd.o: ../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h
 lpd.o: ../cups/sidechannel.h
 dnssd.o: backend-private.h ../cups/cups-private.h ../cups/cups.h
 dnssd.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-dnssd.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
+dnssd.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
 dnssd.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
 dnssd.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
 dnssd.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
@@ -29,12 +29,12 @@ dnssd.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
 dnssd.o: ../cups/transcode.h ../cups/thread-private.h ../cups/snmp-private.h
 dnssd.o: ../cups/backend.h ../cups/sidechannel.h ../cups/array.h
 pap.o: ../config.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-pap.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+pap.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 pap.o: ../cups/backend.h ../cups/sidechannel.h ../cups/language-private.h
 pap.o: ../cups/transcode.h
 parallel.o: backend-private.h ../cups/cups-private.h ../cups/cups.h
 parallel.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-parallel.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
+parallel.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
 parallel.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
 parallel.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
 parallel.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
@@ -43,7 +43,7 @@ parallel.o: ../cups/transcode.h ../cups/thread-private.h
 parallel.o: ../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
 serial.o: backend-private.h ../cups/cups-private.h ../cups/cups.h
 serial.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-serial.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
+serial.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
 serial.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
 serial.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
 serial.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
@@ -52,7 +52,7 @@ serial.o: ../cups/transcode.h ../cups/thread-private.h ../cups/snmp-private.h
 serial.o: ../cups/backend.h ../cups/sidechannel.h
 snmp.o: backend-private.h ../cups/cups-private.h ../cups/cups.h
 snmp.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-snmp.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
+snmp.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
 snmp.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
 snmp.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
 snmp.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
@@ -64,7 +64,7 @@ socket.o: ../cups/http-private.h ../config.h ../cups/http.h
 socket.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
 socket.o: backend-private.h ../cups/cups-private.h ../cups/cups.h
 socket.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-socket.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
+socket.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
 socket.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 socket.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 socket.o: ../cups/language-private.h ../cups/transcode.h
@@ -72,8 +72,8 @@ socket.o: ../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h
 socket.o: ../cups/sidechannel.h
 test1284.o: ../cups/string-private.h ../config.h ieee1284.c backend-private.h
 test1284.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-test1284.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-test1284.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
+test1284.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+test1284.o: ../cups/language.h ../cups/string-private.h
 test1284.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 test1284.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 test1284.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
@@ -82,11 +82,11 @@ test1284.o: ../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h
 test1284.o: ../cups/sidechannel.h
 testbackend.o: ../cups/string-private.h ../config.h ../cups/cups.h
 testbackend.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h
-testbackend.o: ../cups/http.h ../cups/language.h ../cups/array.h
+testbackend.o: ../cups/http.h ../cups/array.h ../cups/language.h
 testbackend.o: ../cups/sidechannel.h
 testsupplies.o: backend-private.h ../cups/cups-private.h ../cups/cups.h
 testsupplies.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h
-testsupplies.o: ../cups/http.h ../cups/language.h ../cups/array.h
+testsupplies.o: ../cups/http.h ../cups/array.h ../cups/language.h
 testsupplies.o: ../cups/string-private.h ../config.h ../cups/debug-private.h
 testsupplies.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
 testsupplies.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
@@ -95,8 +95,8 @@ testsupplies.o: ../cups/language-private.h ../cups/transcode.h
 testsupplies.o: ../cups/thread-private.h ../cups/snmp-private.h
 testsupplies.o: ../cups/backend.h ../cups/sidechannel.h
 usb.o: backend-private.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-usb.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h
-usb.o: ../cups/array.h ../cups/string-private.h ../config.h
+usb.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+usb.o: ../cups/language.h ../cups/string-private.h ../config.h
 usb.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 usb.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 usb.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
index 6b217462fa7aabeb9818f338f3b2b08bac2e8545..1cca9836d49c165b7efcca57cb8cbeb4106c3648 100644 (file)
@@ -22,11 +22,11 @@ include ../Makedefs
 #
 
 RBACKENDS =    ipp lpd $(DNSSD_BACKEND)
-UBACKENDS =    $(PAP) $(LEGACY_BACKENDS) serial snmp socket usb
+UBACKENDS =    $(LEGACY_BACKENDS) serial snmp socket usb
 UNITTESTS =    test1284 testbackend testsupplies
 TARGETS =      libbackend.a $(RBACKENDS) $(UBACKENDS)
 LIBOBJS        =       ieee1284.o network.o runloop.o snmp-supplies.o
-OBJS   =       ipp.o lpd.o dnssd.o pap.o parallel.o serial.o snmp.o \
+OBJS   =       ipp.o lpd.o dnssd.o parallel.o serial.o snmp.o \
                socket.o test1284.o testbackend.o testsupplies.o usb.o
 
 
@@ -207,15 +207,6 @@ lpd:       lpd.o ../cups/$(LIBCUPS) libbackend.a
        $(CC) $(LDFLAGS) -o lpd lpd.o libbackend.a $(LIBS)
 
 
-#
-# pap
-#
-
-pap:   pap.o ../cups/$(LIBCUPS)
-       echo Linking $@...
-       $(CC) $(LDFLAGS) -o pap pap.o $(BACKLIBS) $(LIBS) -framework AppleTalk
-
-
 #
 # parallel
 #
index 5d2a82963ad9c67447209acaef27d85459dca0f6..5701ce5d436bf0a72b8135a578d88740ff4e08f4 100644 (file)
@@ -18,8 +18,9 @@
  *
  *   main()                 - Send a file to the printer or server.
  *   cancel_job()           - Cancel a print job.
- *   check_printer_state()  - Check the printer state...
+ *   check_printer_state()  - Check the printer state.
  *   compress_files()       - Compress print files...
+ *   monitor_printer()      - Monitor the printer state...
  *   password_cb()          - Disable the password prompt for
  *                            cupsDoFileRequest().
  *   report_attr()          - Report an IPP attribute value.
 #include <sys/stat.h>
 #include <sys/wait.h>
 
+
+/*
+ * Types...
+ */
+
+typedef struct _cups_monitor_s         /**** Monitoring data ****/
+{
+  const char           *uri,           /* Printer URI */
+                       *hostname,      /* Hostname */
+                       *user,          /* Username */
+                       *resource;      /* Resource path */
+  int                  port,           /* Port number */
+                       version,        /* IPP version */
+                       job_id;         /* Job ID for submitted job */
+  http_encryption_t    encryption;     /* Use encryption? */
+  ipp_jstate_t         job_state;      /* Current job state */
+  ipp_pstate_t         printer_state;  /* Current printer state */
+} _cups_monitor_t;
+
+
 /*
  * Globals...
  */
 
-static char    *password = NULL;       /* Password for device URI */
-static int     password_tries = 0;     /* Password tries */
 static const char *auth_info_required = "none";
                                        /* New auth-info-required value */
+static const char * const jattrs[] =   /* Job attributes we want */
+{
+  "job-media-sheets-completed",
+  "job-state",
+  "job-state-reasons"
+};
 static int     job_canceled = 0;       /* Job cancelled? */
+static char    *password = NULL;       /* Password for device URI */
+static int     password_tries = 0;     /* Password tries */
+static const char * const pattrs[] =   /* Printer attributes we want */
+{
+  "copies-supported",
+  "cups-version",
+  "document-format-supported",
+  "marker-colors",
+  "marker-high-levels",
+  "marker-levels",
+  "marker-low-levels",
+  "marker-message",
+  "marker-names",
+  "marker-types",
+  "media-col-supported",
+  "printer-alert",
+  "printer-alert-description",
+  "printer-is-accepting-jobs",
+  "printer-state",
+  "printer-state-message",
+  "printer-state-reasons",
+};
 
 
 /*
  * Local functions...
  */
 
-static void    cancel_job(http_t *http, const char *uri, int id,
-                          const char *resource, const char *user, int version);
-static void    check_printer_state(http_t *http, const char *uri,
-                                   const char *resource, const char *user,
-                                   int version, int job_id);
+static void            cancel_job(http_t *http, const char *uri, int id,
+                                  const char *resource, const char *user,
+                                  int version);
+static ipp_pstate_t    check_printer_state(http_t *http, const char *uri,
+                                           const char *resource,
+                                           const char *user, int version,
+                                           int job_id);
 #ifdef HAVE_LIBZ
-static void    compress_files(int num_files, char **files);
+static void            compress_files(int num_files, char **files);
 #endif /* HAVE_LIBZ */
-static const char *password_cb(const char *);
-static void    report_attr(ipp_attribute_t *attr);
-static int     report_printer_state(ipp_t *ipp, int job_id);
-static void    sigterm_handler(int sig);
+static void            *monitor_printer(_cups_monitor_t *monitor);
+static const char      *password_cb(const char *);
+static void            report_attr(ipp_attribute_t *attr);
+static int             report_printer_state(ipp_t *ipp, int job_id);
+static void            sigterm_handler(int sig);
 
 
 /*
@@ -111,6 +161,7 @@ main(int  argc,                             /* I - Number of command-line args */
   int          compression,            /* Do compression of the job data? */
                waitjob,                /* Wait for job complete? */
                waitprinter;            /* Wait for printer ready? */
+  _cups_monitor_t monitor;             /* Monitoring data */
   ipp_attribute_t *job_id_attr;                /* job-id attribute */
   int          job_id;                 /* job-id value */
   ipp_attribute_t *job_sheets;         /* job-media-sheets-completed */
@@ -132,28 +183,6 @@ main(int  argc,                            /* I - Number of command-line args */
   struct sigaction action;             /* Actions for POSIX signals */
 #endif /* HAVE_SIGACTION && !HAVE_SIGSET */
   int          version;                /* IPP version */
-  static const char * const pattrs[] =
-               {                       /* Printer attributes we want */
-                 "copies-supported",
-                 "document-format-supported",
-                 "marker-colors",
-                 "marker-high-levels",
-                 "marker-levels",
-                 "marker-low-levels",
-                 "marker-message",
-                 "marker-names",
-                 "marker-types",
-                 "media-col-supported",
-                 "printer-is-accepting-jobs",
-                 "printer-state",
-                 "printer-state-message",
-                 "printer-state-reasons",
-               };
-  static const char * const jattrs[] =
-               {                       /* Job attributes we want */
-                 "job-media-sheets-completed",
-                 "job-state"
-               };
 
 
  /*
@@ -402,8 +431,7 @@ main(int  argc,                             /* I - Number of command-line args */
     send_options = !strcasecmp(final_content_type, "application/pdf") ||
                    !strcasecmp(final_content_type, "application/vnd.cups-pdf") ||
                    !strcasecmp(final_content_type, "image/jpeg") ||
-                   !strcasecmp(final_content_type, "image/png") ||
-                   !strcasecmp(final_content_type, "image/urf");
+                   !strcasecmp(final_content_type, "image/png");
 
     fputs("DEBUG: Sending stdin for job...\n", stderr);
   }
@@ -472,6 +500,11 @@ main(int  argc,                            /* I - Number of command-line args */
 
     if ((http = httpConnectEncrypt(hostname, port, cupsEncryption())) == NULL)
     {
+#if 0 /* These need to go in here someplace when we see HTTP_PKI_ERROR or IPP_PKI_ERROR */
+      fputs("STATE: +cups-certificate-error\n", stderr);
+      fputs("STATE: -cups-certificate-error\n", stderr);
+#endif /* 0 */
+
       int error = errno;               /* Connection error */
 
       if (job_canceled)
@@ -647,13 +680,14 @@ main(int  argc,                           /* I - Number of command-line args */
       exit(CUPS_BACKEND_STOP);
     }
 
-    if ((supported = cupsDoRequest(http, request, resource)) == NULL)
-      ipp_status = cupsLastError();
-    else
-      ipp_status = supported->request.status.status_code;
+    supported  = cupsDoRequest(http, request, resource);
+    ipp_status = cupsLastError();
 
     if (ipp_status > IPP_OK_CONFLICT)
     {
+      fprintf(stderr, "DEBUG: Get-Printer-Attributes returned %s.\n",
+              ippErrorString(ipp_status));
+
       if (ipp_status == IPP_PRINTER_BUSY ||
          ipp_status == IPP_SERVICE_UNAVAILABLE)
       {
@@ -700,7 +734,9 @@ main(int  argc,                             /* I - Number of command-line args */
       }
       else if (ipp_status == IPP_NOT_FOUND)
       {
-        _cupsLangPuts(stderr, _("ERROR: The printer URI is incorrect or no longer exists.\n"));
+        _cupsLangPuts(stderr,
+                     _("ERROR: The printer URI is incorrect or no longer "
+                       "exists.\n"));
 
        if (supported)
           ippDelete(supported);
@@ -834,6 +870,23 @@ main(int  argc,                            /* I - Number of command-line args */
   else
     copies_remaining = copies;
 
+ /*
+  * Start monitoring the printer in the background...
+  */
+
+  monitor.uri           = uri;
+  monitor.hostname      = hostname;
+  monitor.user          = argv[2];
+  monitor.resource      = resource;
+  monitor.port          = port;
+  monitor.version       = version;
+  monitor.job_id        = 0;
+  monitor.encryption    = cupsEncryption();
+  monitor.job_state     = IPP_JOB_PENDING;
+  monitor.printer_state = IPP_PRINTER_IDLE;
+
+  _cupsThreadCreate((_cups_thread_func_t)monitor_printer, &monitor);
+
  /*
   * Then issue the print-job request...
   */
@@ -1005,9 +1058,9 @@ main(int  argc,                           /* I - Number of command-line args */
          _pwg_media_t  *found;         /* PWG media */
 
 
-          if ((found = _pwgMediaForPPD(keyword)) == NULL)
+          if ((found = _pwgMediaForPPD(keyword)) != NULL)
            keyword = found->pwg;
-         else if ((found = _pwgMediaForLegacy(keyword)) == NULL)
+         else if ((found = _pwgMediaForLegacy(keyword)) != NULL)
            keyword = found->pwg;
 
          ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "media",
@@ -1027,11 +1080,52 @@ main(int  argc,                         /* I - Number of command-line args */
                                     options)) != NULL)
          ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "output-mode",
                       NULL, keyword);
+       else if ((keyword = cupsGetOption("ColorModel", num_options,
+                                               options)) != NULL)
+       {
+         if (!strcasecmp(keyword, "Gray"))
+           ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "output-mode",
+                                NULL, "monochrome");
+               else if (!strcasecmp(keyword, "Color"))
+                 ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "output-mode",
+                                  NULL, "color");
+       }
+
+       if ((keyword = cupsGetOption("print-quality", num_options,
+                                    options)) != NULL)
+         ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality",
+                       atoi(keyword));
+        else if ((keyword = cupsGetOption("cupsPrintQuality", num_options,
+                                         options)) != NULL)
+        {
+         if (!strcasecmp(keyword, "draft"))
+           ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality",
+                         IPP_QUALITY_DRAFT);
+         else if (!strcasecmp(keyword, "normal"))
+           ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality",
+                         IPP_QUALITY_NORMAL);
+         else if (!strcasecmp(keyword, "high"))
+           ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality",
+                         IPP_QUALITY_HIGH);
+       }
 
        if ((keyword = cupsGetOption("sides", num_options, options)) != NULL)
          ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides",
-                      NULL, keyword);
-                              
+                      NULL, keyword);
+       else if ((keyword = cupsGetOption("Duplex", num_options,
+                                         options)) != NULL)
+       {
+         if (!strcasecmp(keyword, "None"))
+           ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides",
+                        NULL, "one-sided");
+         else if (!strcasecmp(keyword, "DuplexNoTumble"))
+           ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides",
+                        NULL, "two-sided-long-edge");
+         if (!strcasecmp(keyword, "DuplexTumble"))
+           ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides",
+                        NULL, "two-sided-short-edge");
+        }
+
        _pwgDestroy(pwg);
       }
 
@@ -1134,7 +1228,7 @@ main(int  argc,                           /* I - Number of command-line args */
     }
     else
     {
-      job_id = job_id_attr->values[0].integer;
+      monitor.job_id = job_id = job_id_attr->values[0].integer;
       _cupsLangPrintf(stderr, _("NOTICE: Print file accepted - job ID %d.\n"),
                       job_id);
     }
@@ -1336,11 +1430,13 @@ main(int  argc,                         /* I - Number of command-line args */
 
       ippDelete(response);
 
+#if 0
      /*
       * Check the printer state and report it if necessary...
       */
 
       check_printer_state(http, uri, resource, argv[2], version, job_id);
+#endif /* 0 */
 
      /*
       * Wait 1-10 seconds before polling again...
@@ -1467,34 +1563,27 @@ cancel_job(http_t     *http,            /* I - HTTP connection */
 
 
 /*
- * 'check_printer_state()' - Check the printer state...
+ * 'check_printer_state()' - Check the printer state.
  */
 
-static void
+static ipp_pstate_t                    /* O - Current printer-state */
 check_printer_state(
     http_t      *http,                 /* I - HTTP connection */
     const char  *uri,                  /* I - Printer URI */
     const char  *resource,             /* I - Resource path */
     const char  *user,                 /* I - Username, if any */
     int         version,               /* I - IPP version */
-    int         job_id)                        /* I - Current job ID */
+    int         job_id)
 {
-  ipp_t        *request,                       /* IPP request */
-       *response;                      /* IPP response */
-  static const char * const attrs[] =  /* Attributes we want */
-  {
-    "marker-colors",
-    "marker-levels",
-    "marker-message",
-    "marker-names",
-    "marker-types",
-    "printer-state-message",
-    "printer-state-reasons"
-  };
+  ipp_t                *request,               /* IPP request */
+               *response;              /* IPP response */
+  ipp_attribute_t *attr;               /* Attribute in response */
+  ipp_pstate_t printer_state = IPP_PRINTER_STOPPED;
+                                       /* Current printer-state */
 
 
  /*
-  * Check on the printer state...
+  * Send a Get-Printer-Attributes request and log the results...
   */
 
   request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);
@@ -1502,25 +1591,32 @@ check_printer_state(
   request->request.op.version[1] = version % 10;
 
   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
-               NULL, uri);
+              NULL, uri);
 
   if (user && user[0])
     ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
-                 "requesting-user-name", NULL, user);
+                "requesting-user-name", NULL, user);
 
   ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
-                "requested-attributes",
-               (int)(sizeof(attrs) / sizeof(attrs[0])), NULL, attrs);
-
- /*
-  * Do the request...
-  */
+               "requested-attributes",
+               (int)(sizeof(pattrs) / sizeof(pattrs[0])), NULL, pattrs);
 
   if ((response = cupsDoRequest(http, request, resource)) != NULL)
   {
     report_printer_state(response, job_id);
+
+    if ((attr = ippFindAttribute(response, "printer-state",
+                                IPP_TAG_ENUM)) != NULL)
+      printer_state = (ipp_pstate_t)attr->values[0].integer;
+
     ippDelete(response);
   }
+
+ /*
+  * Return the printer-state value...
+  */
+
+  return (printer_state);
 }
 
 
@@ -1602,6 +1698,122 @@ compress_files(int  num_files,          /* I - Number of files */
 #endif /* HAVE_LIBZ */
 
 
+/*
+ * 'monitor_printer()' - Monitor the printer state...
+ */
+
+static void *                          /* O - Thread exit code */
+monitor_printer(
+    _cups_monitor_t *monitor)          /* I - Monitoring data */
+{
+  http_t       *http;                  /* Connection to printer */
+  ipp_t                *request,               /* IPP request */
+               *response;              /* IPP response */
+  ipp_attribute_t *attr;               /* Attribute in response */
+  int          delay,                  /* Current delay */
+               prev_delay,             /* Previous delay */
+               temp_delay;             /* Temporary delay value */
+
+
+ /*
+  * Make a copy of the printer connection...
+  */
+
+  http = _httpCreate(monitor->hostname, monitor->port, monitor->encryption);
+  cupsSetPasswordCB(password_cb);
+
+ /*
+  * Loop until the job is canceled, aborted, or completed.
+  */
+
+  delay      = 1;
+  prev_delay = 0;
+
+  while (monitor->job_state < IPP_JOB_CANCELED && !job_canceled)
+  {
+   /*
+    * Reconnect to the printer...
+    */
+
+    if (!httpReconnect(http))
+    {
+     /*
+      * Connected, so check on the printer state...
+      */
+
+      monitor->printer_state = check_printer_state(http, monitor->uri,
+                                                   monitor->resource,
+                                                  monitor->user,
+                                                  monitor->version,
+                                                  monitor->job_id);
+
+      if (monitor->job_id > 0)
+      {
+       /*
+        * Check the status of the job itself...
+       */
+
+       request = ippNewRequest(IPP_GET_JOB_ATTRIBUTES);
+       request->request.op.version[0] = monitor->version / 10;
+       request->request.op.version[1] = monitor->version % 10;
+
+       ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
+                    NULL, monitor->uri);
+       ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id",
+                     monitor->job_id);
+
+       if (monitor->user && monitor->user[0])
+         ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
+                      "requesting-user-name", NULL, monitor->user);
+
+       ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
+                     "requested-attributes",
+                     (int)(sizeof(jattrs) / sizeof(jattrs[0])), NULL, jattrs);
+
+       /*
+       * Do the request...
+       */
+
+       response = cupsDoRequest(http, request, monitor->resource);
+
+       if ((attr = ippFindAttribute(response, "job-state",
+                                    IPP_TAG_ENUM)) != NULL)
+         monitor->job_state = (ipp_jstate_t)attr->values[0].integer;
+       else
+         monitor->job_state = IPP_JOB_COMPLETED;
+
+       ippDelete(response);
+      }
+
+     /*
+      * Disconnect from the printer - we'll reconnect on the next poll...
+      */
+
+      _httpDisconnect(http);
+    }
+
+   /*
+    * Sleep for N seconds, and then update the next sleep time using a
+    * Fibonacci series (1 1 2 3 5 8)...
+    */
+
+    sleep(delay);
+
+    temp_delay = delay;
+    delay      = (delay + prev_delay) % 12;
+    prev_delay = delay < temp_delay ? 0 : temp_delay;
+  }
+
+ /*
+  * Cleanup and return...
+  */
+
+  httpClose(http);
+
+  return (NULL);
+}
+
+
 /*
  * 'password_cb()' - Disable the password prompt for cupsDoFileRequest().
  */
@@ -1712,41 +1924,93 @@ report_printer_state(ipp_t *ipp,        /* I - IPP response */
 {
   int                  i;              /* Looping var */
   int                  count;          /* Count of reasons shown... */
-  ipp_attribute_t      *psm,           /* printer-state-message */
+  ipp_attribute_t      *pa,            /* printer-alert */
+                       *pam,           /* printer-alert-message */
+                       *psm,           /* printer-state-message */
                        *reasons,       /* printer-state-reasons */
                        *marker;        /* marker-* attributes */
   const char           *reason;        /* Current reason */
   const char           *prefix;        /* Prefix for STATE: line */
-  char                 state[1024];    /* State string */
+  char                 value[1024],    /* State/message string */
+                       *valptr;        /* Pointer into string */
 
 
+ /*
+  * Report alerts and messages...
+  */
+
+  if ((pa = ippFindAttribute(ipp, "printer-alert", IPP_TAG_TEXT)) != NULL)
+    report_attr(pa);
+
+  if ((pam = ippFindAttribute(ipp, "printer-alert-message",
+                              IPP_TAG_TEXT)) != NULL)
+    report_attr(pam);
+
   if ((psm = ippFindAttribute(ipp, "printer-state-message",
                               IPP_TAG_TEXT)) != NULL)
-    fprintf(stderr, "INFO: %s\n", psm->values[0].string.text);
+  {
+    char       *ptr;                   /* Pointer into message */
+
+
+    strlcpy(value, "INFO: ", sizeof(value));
+    for (ptr = psm->values[0].string.text, valptr = value + 6;
+         *ptr && valptr < (value + sizeof(value) - 6);
+        ptr ++)
+    {
+      if (*ptr < ' ' && *ptr > 0 && *ptr != '\t')
+      {
+       /*
+        * Substitute "<XX>" for the control character; sprintf is safe because
+       * we always leave 6 chars free at the end...
+       */
+
+        sprintf(valptr, "<%02X>", *ptr);
+       valptr += 4;
+      }
+      else
+        *valptr++ = *ptr;
+    }
+
+    *valptr++ = '\n';
+    *valptr++ = '\0';
+
+    fputs(value, stderr);
+  }
+
+ /*
+  * Now report printer-state-reasons, filtering out some of the reasons we never
+  * want to set...
+  */
 
   if ((reasons = ippFindAttribute(ipp, "printer-state-reasons",
                                   IPP_TAG_KEYWORD)) == NULL)
     return (0);
 
-  state[0] = '\0';
+  value[0] = '\0';
   prefix   = "STATE: ";
 
-  for (i = 0, count = 0; i < reasons->num_values; i ++)
+  for (i = 0, count = 0, valptr = value; i < reasons->num_values; i ++)
   {
     reason = reasons->values[i].string.text;
 
     if (strcmp(reason, "paused") &&
        strcmp(reason, "com.apple.print.recoverable-warning"))
     {
-      strlcat(state, prefix, sizeof(state));
-      strlcat(state, reason, sizeof(state));
+      strlcpy(valptr, prefix, sizeof(value) - (valptr - value) - 1);
+      valptr += strlen(valptr);
+      strlcpy(valptr, reason, sizeof(value) - (valptr - value) - 1);
+      valptr += strlen(valptr);
 
       prefix  = ",";
     }
   }
 
-  if (state[0])
-    fprintf(stderr, "%s\n", state);
+  if (value[0])
+  {
+    *valptr++ = '\n';
+    *valptr++ = '\0';
+    fputs(value, stderr);
+  }
 
  /*
   * Relay the current marker-* attribute values...
diff --git a/backend/pap.c b/backend/pap.c
deleted file mode 100644 (file)
index b57698f..0000000
+++ /dev/null
@@ -1,1696 +0,0 @@
-/*
-* "$Id: pap.c 7720 2008-07-11 22:46:21Z mike $"
-*
-* Copyright 2004-2010 Apple Inc. All rights reserved.
-*
-* IMPORTANT:  This Apple software is supplied to you by Apple Computer,
-* Inc. ("Apple") in consideration of your agreement to the following
-* terms, and your use, installation, modification or redistribution of
-* this Apple software constitutes acceptance of these terms.  If you do
-* not agree with these terms, please do not use, install, modify or
-* redistribute this Apple software.
-*
-* In consideration of your agreement to abide by the following terms, and
-* subject to these terms, Apple grants you a personal, non-exclusive
-* license, under AppleÕs copyrights in this original Apple software (the
-* "Apple Software"), to use, reproduce, modify and redistribute the Apple
-* Software, with or without modifications, in source and/or binary forms;
-* provided that if you redistribute the Apple Software in its entirety and
-* without modifications, you must retain this notice and the following
-* text and disclaimers in all such redistributions of the Apple Software.
-* Neither the name, trademarks, service marks or logos of Apple Computer,
-* Inc. may be used to endorse or promote products derived from the Apple
-* Software without specific prior written permission from Apple.  Except
-* as expressly stated in this notice, no other rights or licenses, express
-* or implied, are granted by Apple herein, including but not limited to
-* any patent rights that may be infringed by your derivative works or by
-* other works in which the Apple Software may be incorporated.
-*
-* The Apple Software is provided by Apple on an "AS IS" basis.  APPLE
-* MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
-* THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
-* FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
-* OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
-*
-* IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
-* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
-* MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
-* AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
-* STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*
-*
-* This program implements the Printer Access Protocol (PAP) on top of AppleTalk
-* Transaction Protocol (ATP). If it were to use the blocking pap functions of
-* the AppleTalk library it would need seperate threads for reading, writing
-* and status.
-*
-* Contents:
-*
-*  main()               - Send a file to the specified Appletalk printer.
-*  listDevices()        - List all LaserWriter printers in the local zone.
-*  printFile()          - Print file.
-*  papOpen()            - Open a pap session to a printer.
-*  papClose()           - Close a pap session.
-*  papWrite()           - Write bytes to a printer.
-*  papCloseResp()       - Send a pap close response.
-*  papSendRequest()     - Fomrat and send a pap packet.
-*  papCancelRequest()   - Cancel a pending pap request.
-*  sidechannel_request() - Handle side-channel requests.
-*  statusUpdate()       - Print printer status to stderr.
-*  parseUri()           - Extract the print name and zone from a uri.
-*  addPercentEscapes()  - Encode a string with percent escapes.
-*  removePercentEscapes         - Remove percent escape sequences from a string.
-*  nbptuple_compare()   - Compare routine for qsort.
-*  okayToUseAppleTalk()  - Returns true if AppleTalk is available and enabled.
-*  packet_name()        - Returns packet name string.
-*  connectTimeout()     - Returns the connect timeout preference value.
-*  signalHandler()      - handle SIGINT to close the session before quiting.
-*/
-
-/*
- * This backend uses deprecated APIs for AppleTalk; we know this, so
- * silence any warnings about it...
- */
-
-#ifdef MAC_OS_X_VERSION_MIN_REQUIRED
-#  undef MAC_OS_X_VERSION_MIN_REQUIRED
-#endif /* MAX_OS_X_VERSION_MIN_REQUIRED */
-#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_0
-
-#include <config.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <termios.h>
-#include <unistd.h>
-#include <assert.h>
-#include <signal.h>
-
-#include <sys/fcntl.h>
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/errno.h>
-
-#include <cups/cups.h>
-#include <cups/backend.h>
-#include <cups/sidechannel.h>
-#include <cups/language-private.h>
-
-#include <netat/appletalk.h>
-#include <netat/atp.h>
-#include <netat/ddp.h>
-#include <netat/nbp.h>
-#include <netat/pap.h>
-
-#include <libkern/OSByteOrder.h>
-
-#ifdef HAVE_APPLETALK_AT_PROTO_H
-#  include <AppleTalk/at_proto.h>
-#else
-/* These definitions come from at_proto.h... */
-#  define ZIP_DEF_INTERFACE NULL
-enum { RUNNING, NOTLOADED, LOADED, OTHERERROR };
-
-extern int atp_abort(int fd, at_inet_t *dest, u_short tid);
-extern int atp_close(int fd);
-extern int atp_getreq(int fd, at_inet_t *src, char *buf, int *len, int *userdata,
-                     int *xo, u_short *tid, u_char *bitmap, int nowait);
-extern int atp_getresp(int fd, u_short *tid, at_resp_t *resp);
-extern int atp_look(int fd);
-extern int atp_open(at_socket *sock);
-extern int atp_sendreq(int fd, at_inet_t *dest, char *buf, int len,
-                      int userdata, int xo, int xo_relt, u_short *tid,
-                      at_resp_t *resp, at_retry_t *retry, int nowait);
-extern int atp_sendrsp(int fd, at_inet_t *dest, int xo, u_short tid,
-                      at_resp_t *resp);
-extern int checkATStack();
-extern int nbp_lookup(at_entity_t *entity, at_nbptuple_t *buf, int max,
-                     at_retry_t *retry);
-extern int nbp_make_entity(at_entity_t *entity, char *obj, char *type,
-                          char *zone);
-extern int zip_getmyzone(char *ifName, at_nvestr_t *zone);
-#endif /* HAVE_APPLETALK_AT_PROTO_H */
-
-#include <CoreFoundation/CFURL.h>
-#include <CoreFoundation/CFNumber.h>
-#include <CoreFoundation/CFPreferences.h>
-
-/* Defines */
-#define MAX_PRINTERS   500        /* Max number of printers we can lookup */
-#define PAP_CONNID     0
-#define PAP_TYPE       1
-#define PAP_EOF                2
-
-#define CONNID_OF(p)   (((u_char *)&p)[0])
-#define TYPE_OF(p)     (((u_char *)&p)[1])
-#define SEQUENCE_NUM(p)        (((u_char *)&p)[2])
-#define IS_PAP_EOF(p)  (((u_char *)&p)[2])
-
-#ifndef true
-#define true   1
-#define false  0
-#endif
-
-/* Globals */
-int       gSockfd      = 0;            /* Socket descriptor */
-at_inet_t gSessionAddr = { 0 };        /* Address of the session responding socket */
-u_char    gConnID      = 0;            /* PAP session connection id */
-u_short   gSendDataID  = 0;            /* Transaction id of pending send-data request  */
-u_short   gTickleID    = 0;            /* Transaction id of outstanding tickle request*/
-int       gWaitEOF     = false;        /* Option: wait for a remote's EOF  */
-int       gStatusInterval= 5;          /* Option: 0=off else seconds between status requests*/
-int       gErrorlogged  = false;       /* If an error was logged don't send any more INFO messages */
-int       gDebug       = 0;            /* Option: emit debugging info    */
-
-/* Local functions */
-static int listDevices(void);
-static int printFile(char* name, char* type, char* zone, int fdin, int fdout,
-                    int fderr, int copies, int argc);
-static int papOpen(at_nbptuple_t* tuple, u_char* connID, int* fd,
-                  at_inet_t* pap_to, u_char* flowQuantum);
-static int papClose();
-static int papWrite(int sockfd, at_inet_t* dest, u_short tid, u_char connID,
-                   u_char flowQuantum, char* data, int len, int eof);
-static int papCloseResp(int sockfd, at_inet_t* dest, int xo, u_short tid,
-                       u_char connID);
-static int papSendRequest(int sockfd, at_inet_t* dest, u_char connID,
-                         int function, u_char bitmap, int xo, int seqno);
-static int papCancelRequest(int sockfd, u_short tid);
-static void sidechannel_request();
-static void statusUpdate(char* status, u_char statusLen);
-static int parseUri(const char* argv0, char* name, char* type, char* zone);
-static int addPercentEscapes(const char* src, char* dst, int dstMax);
-static int removePercentEscapes(const char* src, char* dst, int dstMax);
-static int nbptuple_compare(const void *p1, const void *p2);
-static int okayToUseAppleTalk(void);
-static const char *packet_name(u_char x);
-static int connectTimeout(void);
-static void signalHandler(int sigraised);
-
-
-/*!
- * @function  main
- * @abstract  Send a file to the specified AppleTalk PAP address.
- *
- * Usage:  printer-uri job-id user title copies options [file]
- *
- * @param  argc  # of arguments
- * @param  argv  array of arguments
- *
- * @result    A non-zero return value for errors
- */
-int main (int argc, const char * argv[])
-{
-  int   err = 0;
-  FILE  *fp;                           /* Print file */
-  int   copies;                                /* Number of copies to print */
-  char  name[NBP_NVE_STR_SIZE + 1];    /* +1 for a nul */
-  char  type[NBP_NVE_STR_SIZE + 1];    /* +1 for a nul */
-  char  zone[NBP_NVE_STR_SIZE + 1];    /* +1 for a nul */
-
-  /* Make sure status messages are not buffered... */
-  setbuf(stderr, NULL);
-
-  if (argc == 1 || (argc == 2 && strcmp(argv[1], "-discover") == 0))
-  {
-    listDevices();
-
-    return 0;
-  }
-
-  if (argc < 6 || argc > 7)
-  {
-    _cupsLangPrintf(stderr,
-                    _("Usage: %s job-id user title copies options [file]\n"),
-                    argv[0]);
-    return (CUPS_BACKEND_FAILED);
-  }
-
-  /* If we have 7 arguments, print the file named on the command-line.
-  *  Otherwise, send stdin instead...
-  */
-  if (argc == 6)
-  {
-    fp   = stdin;
-    copies = 1;
-  }
-  else
-  {
-    fprintf(stderr, "DEBUG: opening print file \"%s\"\n", argv[6]);
-
-    /* Try to open the print file... */
-    if ((fp = fopen(argv[6], "rb")) == NULL)
-    {
-      _cupsLangPrintf(stderr,
-                      _("ERROR: Unable to open print file \"%s\": %s\n"),
-                     argv[6], strerror(errno));
-      return (CUPS_BACKEND_FAILED);
-    }
-
-    copies = atoi(argv[4]);
-  }
-
-  /* Extract the device name and options from the URI... */
-  parseUri(cupsBackendDeviceURI((char **)argv), name, type, zone);
-
-  err = printFile(name, type, zone, fileno(fp), STDOUT_FILENO, STDERR_FILENO, copies, argc);
-
-  if (fp != stdin)
-    fclose(fp);
-
-  /* Only clear the last status if there wasn't an error */
-  if (err == noErr && !gErrorlogged)
-    fprintf(stderr, "INFO:\n");
-
-  return err;
-}
-
-
-/*!
- * @function  listDevices
- * @abstract  Print a list of all LaserWriter type devices registered in the default zone.
- *
- * @result    A non-zero return value for errors
- */
-static int listDevices(void)
-{
-  int  i;
-  int  numberFound;
-
-  at_nvestr_t   at_zone;
-  at_entity_t   entity;
-  at_nbptuple_t buf[MAX_PRINTERS];
-  at_retry_t    retry;
-  char         name[NBP_NVE_STR_SIZE+1];
-  char         encodedName[(3 * NBP_NVE_STR_SIZE) + 1];
-  char         zone[NBP_NVE_STR_SIZE+1];
-  char         encodedZone[(3 * NBP_NVE_STR_SIZE) + 1];
-
-  /* Make sure it's okay to use appletalk */
-  if (!okayToUseAppleTalk())
-  {
-    _cupsLangPuts(stderr, _("INFO: AppleTalk disabled in System Preferences\n"));
-    return -1;  /* Network is down */
-  }
-
-  if (zip_getmyzone(ZIP_DEF_INTERFACE, &at_zone))
-  {
-    perror("DEBUG: Unable to get default AppleTalk zone.");
-    return -2;
-  }
-
-  memcpy(zone, at_zone.str, MIN(at_zone.len, sizeof(zone)-1));
-  zone[MIN(at_zone.len, sizeof(zone)-1)] = '\0';
-
-  _cupsLangPrintf(stderr, _("INFO: Using default AppleTalk zone \"%s\"\n"),
-                  zone);
-
-  addPercentEscapes(zone, encodedZone, sizeof(encodedZone));
-
-  /* Look up all the printers in our zone */
-  nbp_make_entity(&entity, "=", "LaserWriter", zone);
-  retry.retries = 1;
-  retry.interval = 1;
-  retry.backoff = 1;
-
-  if ((numberFound = nbp_lookup(&entity, buf, MAX_PRINTERS, &retry)) < 0)
-  {
-    perror("DEBUG: Unable to lookup AppleTalk printers.");
-    return numberFound;
-  }
-
-  if (numberFound >= MAX_PRINTERS)
-    _cupsLangPrintf(stderr,
-                    _("WARNING: Adding only the first %d printers found"),
-                   MAX_PRINTERS);
-
-  /* Not required but sort them so they look nice */
-  qsort(buf, numberFound, sizeof(at_nbptuple_t), nbptuple_compare);
-
-  for (i = 0; i < numberFound; i++)
-  {
-    memcpy(name, buf[i].enu_entity.object.str, MIN(buf[i].enu_entity.object.len, sizeof(name)-1));
-    name[MIN(buf[i].enu_entity.object.len, sizeof(name)-1)] = '\0';
-
-    if (addPercentEscapes(name, encodedName, sizeof(encodedName)) == 0)
-    {
-      /* Each line is of the form: "class URI "make model" "info" */
-      char make_model[128],            /* Make and model */
-          *ptr;
-
-
-      if ((ptr = strchr(name, ' ')) != NULL)
-      {
-       /*
-        * If the printer name contains spaces, it is probably a make and
-       * model...
-       */
-
-        if (!strncmp(name, "ET00", 4))
-       {
-        /*
-         * Drop leading ethernet address info...
-         */
-
-          strlcpy(make_model, ptr + 1, sizeof(make_model));
-       }
-       else
-         strlcpy(make_model, name, sizeof(make_model));
-      }
-      else
-        strcpy(make_model, "Unknown");
-
-      printf("network pap://%s/%s/LaserWriter \"%s\" \"%s AppleTalk\"\n",
-             encodedZone, encodedName, make_model, name);
-    }
-  }
-  return numberFound;
-}
-
-
-/*!
- * @function  printFile
- * @abstract  Open a PAP session and send the data from the input socket to the printer.
- *
- * @param  name                NBP name
- * @param  zone                NBP zone
- * @param  type                NBP type
- * @param  fdin                File descriptor to read data from
- * @param  fdout       File descriptor to write printer responses to
- * @param  fderr       File descriptor to write printer status to
- * @param  copies      # of copies to send (in case in the converter couldn't handle this for us).
- * @param  argc                # of command line arguments.
- *
- * @result A non-zero return value for errors
- */
-static int printFile(char* name, char* type, char* zone, int fdin, int fdout, int fderr, int copies, int argc)
-{
-  int  err;
-  int  rc;
-  int  val;
-  int  len, i;
-
-  char fileBuffer[4096];    /* File buffer */
-  int  fileBufferNbytes;
-  off_t        fileTbytes;
-  int  fileEOFRead;
-  int  fileEOFSent;
-
-  char sockBuffer[4096 + 1];    /* Socket buffer with room for nul */
-  char atpReqBuf[AT_PAP_DATA_SIZE];
-  fd_set readSet;
-  int  use_sidechannel;        /* Use side channel? */
-
-  at_nbptuple_t        tuple;
-  at_inet_t    sendDataAddr;
-  at_inet_t    src;
-  at_resp_t    resp;
-  int          userdata, xo = 0, reqlen;
-  u_short      tid;
-  u_char       bitmap;
-  int          maxfdp1,
-               nbp_failures = 0;
-  struct timeval timeout, *timeoutPtr;
-  u_char       flowQuantum = 1;
-  time_t       now,
-               start_time,
-               elasped_time,
-               sleep_time,
-               connect_timeout = -1,
-               nextStatusTime = 0;
-  at_entity_t  entity;
-  at_retry_t   retry;
-
-#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
-  struct sigaction action;  /* Actions for POSIX signals */
-#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
-
- /*
-  * Test the side channel descriptor before calling papOpen() since it may open
-  * an unused fd 4 (a.k.a. CUPS_SC_FD)...
-  */
-
-  FD_ZERO(&readSet);
-  FD_SET(CUPS_SC_FD, &readSet);
-
-  timeout.tv_sec  = 0;
-  timeout.tv_usec = 0;
-
-  if ((select(CUPS_SC_FD+1, &readSet, NULL, NULL, &timeout)) >= 0)
-    use_sidechannel = 1;
-  else
-    use_sidechannel = 0;
-
-  /* try to find our printer */
-  if ((err = nbp_make_entity(&entity, name, type, zone)) != noErr)
-  {
-    perror("DEBUG: Unable to make AppleTalk address.");
-    goto Exit;
-  }
-
- /*
-  * Remember when we started looking for the printer.
-  */
-
-  start_time = time(NULL);
-
-  retry.interval = 1;
-  retry.retries  = 5;
-  retry.backoff  = 0;
-
-  fprintf(stderr, "STATE: +connecting-to-device\n");
-
-  /* Loop forever trying to get an open session with the printer.  */
-  for (;;)
-  {
-    /* Make sure it's okay to use appletalk */
-    if (okayToUseAppleTalk())
-    {
-      /* Clear this printer-state-reason in case we've set it */
-      fprintf(stderr, "STATE: -apple-appletalk-disabled-warning\n");
-
-      /* Resolve the name into an address. Returns the number found or an error */
-      if ((err = nbp_lookup(&entity, &tuple, 1, &retry)) > 0)
-      {
-        if (err > 1)
-          fprintf(stderr, "DEBUG: Found more than one printer with the name \"%s\"\n", name);
-
-        if (nbp_failures)
-        {
-         fprintf(stderr, "STATE: -apple-nbp-lookup-warning\n");
-         nbp_failures = 0;
-       }
-
-        /* Open a connection to the device */
-        if ((err = papOpen(&tuple, &gConnID, &gSockfd, &gSessionAddr, &flowQuantum)) == 0)
-          break;
-
-        _cupsLangPrintf(stderr, _("WARNING: Unable to open \"%s:%s\": %s\n"),
-                       name, zone, strerror(err));
-      }
-      else
-      {
-       /* It's not unusual to have to call nbp_lookup() twice before it's sucessful... */
-        if (++nbp_failures > 2)
-        {
-         retry.interval = 2;
-         retry.retries = 3;
-         fprintf(stderr, "STATE: +apple-nbp-lookup-warning\n");
-         _cupsLangPuts(stderr, _("WARNING: Printer not responding\n"));
-       }
-      }
-    }
-    else
-    {
-      fprintf(stderr, "STATE: +apple-appletalk-disabled-warning\n");
-      _cupsLangPuts(stderr,
-                    _("INFO: AppleTalk disabled in System Preferences.\n"));
-    }
-
-    elasped_time = time(NULL) - start_time;
-
-    if (connect_timeout == -1)
-      connect_timeout = connectTimeout();
-
-    if (connect_timeout && elasped_time > connect_timeout)
-    {
-      _cupsLangPuts(stderr, _("ERROR: Printer not responding\n"));
-      err = ETIMEDOUT;
-      goto Exit;                                               /* Waiting too long... */
-    }
-    else if (elasped_time < (30 * 60))
-      sleep_time = 10;                                 /* Waiting < 30 minutes */
-    else if (elasped_time < (24 * 60 * 60))
-      sleep_time = 30;                                 /* Waiting < 24 hours */
-    else
-      sleep_time = 60;                                 /* Waiting > 24 hours */
-
-    fprintf(stderr, "DEBUG: sleeping %d seconds...\n", (int)sleep_time);
-    sleep(sleep_time);
-  }
-
-  fprintf(stderr, "STATE: -connecting-to-device\n");
-
-  /*
-  * Now that we are connected to the printer ignore SIGTERM so that we
-  * can finish out any page data the driver sends (e.g. to eject the
-  * current page...  if we are printing data from a file then catch the
-  * signal so we can send a PAP Close packet (otherwise you can't cancel
-  * raw jobs...)
-  */
-
-#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
-  sigset(SIGTERM, (argc < 7) ? SIG_IGN : signalHandler);
-#elif defined(HAVE_SIGACTION)
-  memset(&action, 0, sizeof(action));
-
-  sigemptyset(&action.sa_mask);
-  action.sa_handler = (argc < 7) ? SIG_IGN : signalHandler;
-  sigaction(SIGTERM, &action, NULL);
-#else
-  signal(SIGTERM, (argc < 7) ? SIG_IGN : signalHandler);
-
-#ifdef DEBUG
-  /* Makes debugging easier; otherwise printer will be busy for several minutes */
-  signal(SIGINT, signalHandler);
-#endif /* DEBUG */
-
-#endif /* HAVE_SIGSET */
-
-  _cupsLangPuts(stderr, _("INFO: Sending data\n"));
-
-  sendDataAddr = tuple.enu_addr;
-
-  /* Start the tickle packets and set a timeout alarm  */
-  if ((err = papSendRequest(gSockfd, &gSessionAddr, gConnID, AT_PAP_TYPE_TICKLE, 0, false, false)) < 0)
-  {
-    perror("DEBUG: Unable to send PAP tickle request.");
-    goto Exit;
-  }
-  signal(SIGALRM, signalHandler);
-  alarm(PAP_TIMEOUT);
-
-  /* Prime the pump with an initial send-data packet */
-  if ((err = papSendRequest(gSockfd, &gSessionAddr, gConnID, AT_PAP_TYPE_SEND_DATA, 0xFF, true, true)) < 0)
-  {
-    perror("DEBUG: Unable to send initial PAP send data request.");
-    goto Exit;
-  }
-
-  /* Set non-blocking mode on our data source descriptor */
-  val = fcntl(fdin, F_GETFL, 0);
-  fcntl(fdin, F_SETFL, val | O_NONBLOCK);
-
-  fileBufferNbytes = 0;
-  fileTbytes = 0;
-  fileEOFRead = fileEOFSent = false;
-
-  maxfdp1 = MAX(fdin, gSockfd) + 1;
-
-  if (use_sidechannel && CUPS_SC_FD >= maxfdp1)
-    maxfdp1 = CUPS_SC_FD + 1;
-
-  if (gStatusInterval != 0)
-  {
-    timeout.tv_usec  = 0;
-    nextStatusTime = time(NULL) + gStatusInterval;
-    timeoutPtr = &timeout;
-  }
-  else
-    timeoutPtr = NULL;
-
-
-  for (;;)
-  {
-    /* Set up our descriptors for the select */
-    FD_ZERO(&readSet);
-    FD_SET(gSockfd, &readSet);
-
-    if (fileBufferNbytes == 0 && fileEOFRead == false)
-      FD_SET(fdin, &readSet);
-
-    if (use_sidechannel)
-      FD_SET(CUPS_SC_FD, &readSet);
-
-    /* Set the select timeout value based on the next status interval */
-    if (gStatusInterval != 0)
-    {
-      now = time(NULL);
-      timeout.tv_sec = (nextStatusTime > now) ? nextStatusTime - now : 1;
-    }
-
-    /* Wait here for something interesting to happen */
-    if ((err = select(maxfdp1, &readSet, 0, 0, timeoutPtr)) < 0)
-    {
-      perror("DEBUG: select() failed.");
-      break;
-    }
-
-    if (err == 0 || (gStatusInterval != 0 && time(NULL) >= nextStatusTime))
-    {
-      /* Time to send a status request */
-      if ((err = papSendRequest(gSockfd, &tuple.enu_addr, 0, AT_PAP_TYPE_SEND_STATUS, 0x01, false, false)) < 0)
-       _cupsLangPrintError(_("WARNING: Unable to send PAP status request"));
-
-      if (gStatusInterval)
-        nextStatusTime = time(NULL) + gStatusInterval;
-    }
-
-   /*
-    * Check if we have a side-channel request ready...
-    */
-
-    if (use_sidechannel && FD_ISSET(CUPS_SC_FD, &readSet))
-      sidechannel_request();
-
-    /* Was there an event on the input stream? */
-    if (FD_ISSET(fdin, &readSet))
-    {
-      FD_CLR(fdin, &readSet);
-
-      assert(fileBufferNbytes == 0);
-      fileBufferNbytes = read(fdin, fileBuffer, MIN(sizeof(fileBuffer), AT_PAP_DATA_SIZE * flowQuantum));
-      if (fileBufferNbytes == 0)
-        fileEOFRead = true;
-
-      if (fileEOFSent == false && fileBufferNbytes >= 0 && gSendDataID != 0)
-      {
-        fprintf(stderr, "DEBUG: -> PAP_DATA %d bytes %s\n", fileBufferNbytes, fileEOFRead ? "with EOF" : "");
-        papWrite(gSockfd, &sendDataAddr, gSendDataID, gConnID, flowQuantum, fileBuffer, fileBufferNbytes, fileEOFRead);
-
-        fileTbytes += fileBufferNbytes;
-        if (argc > 6 && !gErrorlogged)
-          fprintf(stderr, "DEBUG: Sending print file, %qd bytes\n", (off_t)fileTbytes);
-
-        fileBufferNbytes = 0;
-        gSendDataID = 0;
-        if (fileEOFRead)
-        {
-          fileEOFSent = true;
-          if (gWaitEOF == false || fileTbytes == 0)
-          {
-            err = 0;
-            goto Exit;
-          }
-        }
-      }
-    }
-
-    /* Was there an event on the output stream? */
-    if (FD_ISSET(gSockfd, &readSet))
-    {
-      if ((rc = atp_look(gSockfd)) < 0)
-      {
-       perror("DEBUG: Unable to look for PAP response.");
-        break;
-      }
-
-      if (rc > 0)
-      {
-        /* It's an ATP response */
-        resp.resp[0].iov_base = sockBuffer;
-        resp.resp[0].iov_len = sizeof(sockBuffer) - 1;
-        resp.bitmap = 0x01;
-
-        if ((err = atp_getresp(gSockfd, &tid, &resp)) < 0)
-        {
-         perror("DEBUG: Unable to get PAP response.");
-          break;
-        }
-        userdata = resp.userdata[0];
-      }
-      else
-      {
-        /* It's an ATP request */
-        reqlen = sizeof(atpReqBuf);
-        if ((err = atp_getreq(gSockfd, &src, atpReqBuf, &reqlen, &userdata, &xo, &tid, &bitmap, 0)) < 0)
-        {
-         perror("DEBUG: Unable to get PAP response.");
-          break;
-        }
-      }
-
-      fprintf(stderr, "DEBUG: <- %s\n", packet_name(TYPE_OF(userdata)));
-
-      switch (TYPE_OF(userdata))
-      {
-      case AT_PAP_TYPE_SEND_STS_REPLY:        /* Send-Status-Reply packet */
-        if (resp.bitmap & 1)
-        {
-          char *iov_base = (char *)resp.resp[0].iov_base;
-          statusUpdate(&iov_base[5], iov_base[4]);
-        }
-        break;
-
-      case AT_PAP_TYPE_SEND_DATA:            /* Send-Data packet */
-        sendDataAddr.socket  = src.socket;
-        gSendDataID     = tid;
-        OSReadBigInt16(&SEQUENCE_NUM(userdata), 0);
-
-        if ((fileBufferNbytes > 0 || fileEOFRead) && fileEOFSent == false)
-        {
-          fprintf(stderr, "DEBUG: -> PAP_DATA %d bytes %s\n", fileBufferNbytes, fileEOFRead ? "with EOF" : "");
-          papWrite(gSockfd, &sendDataAddr, gSendDataID, gConnID, flowQuantum, fileBuffer, fileBufferNbytes, fileEOFRead);
-
-          fileTbytes += fileBufferNbytes;
-          if (argc > 6 && !gErrorlogged)
-            fprintf(stderr, "DEBUG: Sending print file, %qd bytes\n", (off_t)fileTbytes);
-
-          fileBufferNbytes = 0;
-          gSendDataID = 0;
-          if (fileEOFRead)
-          {
-            fileEOFSent = true;
-            if (gWaitEOF == false)
-            {
-              err = 0;
-              goto Exit;
-            }
-          }
-        }
-        break;
-
-      case AT_PAP_TYPE_DATA:              /* Data packet */
-        for (len=0, i=0; i < ATP_TRESP_MAX; i++)
-        {
-          if (resp.bitmap & (1 << i))
-            len += resp.resp[i].iov_len;
-        }
-
-        fprintf(stderr, "DEBUG: <- PAP_DATA %d bytes %s\n", len, IS_PAP_EOF(userdata) ? "with EOF" : "");
-
-        if (len > 0)
-        {
-          char *pLineBegin, *pCommentEnd, *pChar;
-          char *logLevel;
-          char logstr[512];
-          int  logstrlen;
-
-         cupsBackChannelWrite(sockBuffer, len, 1.0);
-
-          sockBuffer[len] = '\0';     /* We always reserve room for the nul so we can use strstr() below*/
-          pLineBegin = sockBuffer;
-
-          /* If there are PostScript status comments in the buffer log them.
-           *
-           *  This logic shouldn't be in the backend but until we get backchannel
-           *  data in CUPS 1.2 it has to live here.
-           */
-          while (pLineBegin < sockBuffer + len &&
-               (pLineBegin = strstr(pLineBegin,    "%%[")) != NULL &&
-               (pCommentEnd   = strstr(pLineBegin, "]%%")) != NULL)
-          {
-            pCommentEnd += 3;            /* Skip past "]%%" */
-            *pCommentEnd = '\0';         /* There's always room for the nul */
-
-            /* Strip the CRs & LFs before writing it to stderr */
-            for (pChar = pLineBegin; pChar < pCommentEnd; pChar++)
-              if (*pChar == '\r' || *pChar == '\n')
-                *pChar = ' ';
-
-            if (strncasecmp(pLineBegin, "%%[ Error:", 10) == 0)
-            {
-              /* logLevel should be "ERROR" here but this causes PrintCenter
-              *  to pause the queue which in turn clears this error, which
-              *  restarts the job. So the job ends up in an infinite loop with
-              *  the queue being held/un-held. Just make it DEBUG for now until
-              *  we fix notifications later.
-              */
-              logLevel = "DEBUG";
-              gErrorlogged = true;
-            }
-            else if (strncasecmp(pLineBegin, "%%[ Flushing", 12) == 0)
-              logLevel = "DEBUG";
-            else
-              logLevel = "INFO";
-
-            if ((logstrlen = snprintf(logstr, sizeof(logstr), "%s: %s\n", logLevel, pLineBegin)) >= sizeof(logstr))
-            {
-              /* If the string was trucnated make sure it has a linefeed before the nul */
-              logstrlen = sizeof(logstr) - 1;
-              logstr[logstrlen - 1] = '\n';
-            }
-
-            write(fderr, logstr, logstrlen);
-
-            pLineBegin = pCommentEnd + 1;
-          }
-        }
-
-        if (IS_PAP_EOF(userdata) != 0)
-        {
-          /* If this is EOF then were we expecting it? */
-          if (fileEOFSent == true)
-            goto Exit;
-          else
-          {
-            _cupsLangPuts(stderr, _("WARNING: Printer sent unexpected EOF\n"));
-          }
-        }
-
-        if ((err = papSendRequest(gSockfd, &gSessionAddr, gConnID, AT_PAP_TYPE_SEND_DATA, 0xFF, true, true)) < 0)
-        {
-          _cupsLangPrintf(stderr,
-                         _("ERROR: Error %d sending PAPSendData request: %s\n"),
-                         err, strerror(errno));
-          goto Exit;
-        }
-        break;
-
-      case AT_PAP_TYPE_TICKLE:            /* Tickle packet */
-        break;
-
-      case AT_PAP_TYPE_CLOSE_CONN:          /* Close-Connection packet */
-        /* We shouldn't normally see this. */
-        papCloseResp(gSockfd, &gSessionAddr, xo, tid, gConnID);
-
-        /* If this is EOF then were we expecting it? */
-        if (fileEOFSent == true)
-        {
-          _cupsLangPuts(stderr, _("WARNING: Printer sent unexpected EOF\n"));
-        }
-        else
-        {
-          _cupsLangPuts(stderr, _("ERROR: Printer sent unexpected EOF\n"));
-        }
-        goto Exit;
-        break;
-
-      case AT_PAP_TYPE_OPEN_CONN:            /* Open-Connection packet */
-      case AT_PAP_TYPE_OPEN_CONN_REPLY:        /* Open-Connection-Reply packet */
-      case AT_PAP_TYPE_SEND_STATUS:          /* Send-Status packet */
-      case AT_PAP_TYPE_CLOSE_CONN_REPLY:        /* Close-Connection-Reply packet */
-        _cupsLangPrintf(stderr, _("WARNING: Unexpected PAP packet of type %d\n"),
-                       TYPE_OF(userdata));
-        break;
-
-      default:
-        _cupsLangPrintf(stderr, _("WARNING: Unknown PAP packet of type %d\n"),
-                       TYPE_OF(userdata));
-        break;
-      }
-
-      if (CONNID_OF(userdata) == gConnID)
-      {
-        /* Reset tickle timer */
-        alarm(0);
-        alarm(PAP_TIMEOUT);
-      }
-    }
-  }
-
-Exit:
-  /*
-  * Close the socket and return...
-  */
-  papClose();
-
-  return err;
-}
-
-
-#pragma mark -
-/*!
- * @function  papOpen
- * @abstract  Open a pap session to a printer.
- *
- * @param  tuple       nbp address of printer
- * @param  connID      returned pap connection id
- * @param  fd          returned socket descriptor
- * @param  sessionAddr returned session address
- * @param  flowQuantum returned flow quantum (usually 8)
- *
- * @result    A non-zero return value for errors
- */
-static int papOpen(at_nbptuple_t* tuple, u_char* connID, int* fd,
-                  at_inet_t* sessionAddr, u_char* flowQuantum)
-{
-  int          result,
-               open_result,
-               userdata;
-  time_t       tm,
-               waitTime;
-  char         data[10],
-               rdata[ATP_DATA_SIZE];
-  u_char       *puserdata;
-  at_socket    socketfd;
-  at_resp_t    resp;
-  at_retry_t   retry;
-
-  result    = 0;
-  socketfd  = 0;
-  puserdata = (u_char *)&userdata;
-
-  _cupsLangPuts(stderr, _("INFO: Opening connection\n"));
-
-  if ((*fd = atp_open(&socketfd)) < 0)
-    return -1;
-
- /*
-  * Build the open connection request packet.
-  */
-
-  tm = time(NULL);
-  srand(tm);
-
-  *connID = (rand()&0xff) | 0x01;
-  puserdata[0] = *connID;
-  puserdata[1] = AT_PAP_TYPE_OPEN_CONN;
-  puserdata[2] = 0;
-  puserdata[3] = 0;
-
-  retry.interval = 2;
-  retry.retries = 5;
-
-  resp.bitmap = 0x01;
-  resp.resp[0].iov_base = rdata;
-  resp.resp[0].iov_len = sizeof(rdata);
-
-  data[0] = socketfd;
-  data[1] = 8;
-
-  for (;;)
-  {
-    waitTime = time(NULL) - tm;
-    OSWriteBigInt16(&data[2], 0, (u_short)waitTime);
-
-    fprintf(stderr, "DEBUG: -> %s\n", packet_name(AT_PAP_TYPE_OPEN_CONN));
-
-    if (atp_sendreq(*fd, &tuple->enu_addr, data, 4, userdata, 1, 0,
-                   0, &resp, &retry, 0) < 0)
-    {
-      statusUpdate("Destination unreachable", 23);
-      result = EHOSTUNREACH;
-      break;
-    }
-
-    puserdata = (u_char *)&resp.userdata[0];
-    open_result = OSReadBigInt16(&rdata[2], 0);
-
-    fprintf(stderr, "DEBUG: <- %s, status %d\n", packet_name(puserdata[1]),
-           open_result);
-
-   /*
-    * Just for the sake of our sanity check the other fields in the packet
-    */
-
-    if (puserdata[1] != AT_PAP_TYPE_OPEN_CONN_REPLY ||
-       (open_result == 0 && (puserdata[0] & 0xff) != *connID))
-    {
-      result = EINVAL;
-      break;
-    }
-
-    statusUpdate(&rdata[5], rdata[4] & 0xff);
-
-   /*
-    * if the connection established okay exit from the loop
-    */
-
-    if (open_result == 0)
-      break;
-
-    sleep(1);
-  }
-
-  if (result == 0)
-  {
-    /* Update the session address
-    */
-    sessionAddr->net  = tuple->enu_addr.net;
-    sessionAddr->node  = tuple->enu_addr.node;
-    sessionAddr->socket  = rdata[0];
-    *flowQuantum    = rdata[1];
-  }
-  else
-  {
-    atp_close(*fd);
-    *fd = 0;
-    sleep(1);
-  }
-
-  return result;
-}
-
-
-/*!
- * @function  papClose
- * @abstract  End a PAP session by canceling outstanding send-data & tickle
- *            transactions and sending a PAP close request.
- *
- * @result  A non-zero return value for errors
- */
-static int papClose()
-{
-  int          fd;
-  u_short      tmpID;
-  unsigned char        rdata[ATP_DATA_SIZE];
-  int          userdata;
-  u_char       *puserdata = (u_char *)&userdata;
-  at_resp_t    resp;
-  at_retry_t   retry;
-
-  if (gSockfd != 0)
-  {
-    fd = gSockfd;
-    gSockfd = 0;
-
-    alarm(0);
-
-    /* Cancel the pending send-data and tickle trnsactions
-    */
-    if (gSendDataID)
-    {
-      tmpID = gSendDataID;
-      gSendDataID = 0;
-      papCancelRequest(fd, tmpID);
-    }
-
-    if (gTickleID)
-    {
-      tmpID = gTickleID;
-      gTickleID = 0;
-      papCancelRequest(fd, tmpID);
-    }
-
-    /* This is a workaround for bug #2735145. The problem is papWrite()
-    *  returns before the ATP TRel arrives for it. If we send the pap close packet
-    *  before this release then the printer can drop the last data packets.
-    *  The effect on an Epson printer is the last page doesn't print, on HP it
-    *  doesn't close the pap session.
-    */
-    if (gWaitEOF == false)
-      sleep(2);
-
-    fprintf(stderr, "DEBUG: -> %s\n", packet_name(AT_PAP_TYPE_CLOSE_CONN));
-
-    puserdata[0] = gConnID;
-    puserdata[1] = AT_PAP_TYPE_CLOSE_CONN;
-    puserdata[2] = 0;
-    puserdata[3] = 0;
-
-    retry.interval = 2;
-    retry.retries = 5;
-
-    resp.bitmap = 0x01;
-    resp.resp[0].iov_base = rdata;
-    resp.resp[0].iov_len = sizeof(rdata);
-
-    atp_sendreq(fd, &gSessionAddr, 0, 0, userdata, 1, 0, 0, &resp, &retry, 0);
-
-    close(fd);
-  }
-  return noErr;
-}
-
-
-/*!
- * @function  papWrite
- * @abstract  Write bytes to a printer.
- *
- * @param  sockfd      socket descriptor
- * @param  dest                destination address
- * @param  tid         transaction id
- * @param  connID      connection id
- * @param  flowQuantum returned flow quantum (usually 8)
- * @param  data                pointer to the data
- * @param  len         number of bytes to send
- * @param  eof         pap eof flag
- *
- * @result  A non-zero return value for errors
- */
-static int papWrite(int sockfd, at_inet_t* dest, u_short tid, u_char connID, u_char flowQuantum, char* data, int len, int eof)
-{
-  int          result;
-  int          i;
-  u_char*      puserdata;
-  at_resp_t    resp;
-
-  /* fprintf(stderr, "DEBUG: papWrite(%d%s) to %d,%d,%d; %d\n", len, eof ? " EOF":"", dest->net, dest->node, dest->socket, connID); */
-
-  if (len > AT_PAP_DATA_SIZE * flowQuantum)
-  {
-    fprintf(stderr, "DEBUG: papWrite() len of %d is too big!\n", len);
-    errno = E2BIG;
-    return -1;
-  }
-
-  /*
-  * Break up the outgoing data into a set of
-  * response packets to reply to an incoming
-  * PAP 'SENDDATA' request
-  */
-  for (i = 0; i < flowQuantum; i++)
-  {
-    resp.userdata[i] = 0;
-    puserdata = (u_char *)&resp.userdata[i];
-
-    puserdata[PAP_CONNID]  = connID;
-    puserdata[PAP_TYPE]    = AT_PAP_TYPE_DATA;
-    puserdata[PAP_EOF]    = eof ? 1 : 0;
-
-    resp.resp[i].iov_base = (caddr_t)data;
-
-    if (data)
-      data += AT_PAP_DATA_SIZE;
-
-    resp.resp[i].iov_len = MIN((int)len, (int)AT_PAP_DATA_SIZE);
-    len -= resp.resp[i].iov_len;
-    if (len == 0)
-      break;
-  }
-  resp.bitmap = (1 << (i + 1)) - 1;
-
-  /*
-  *  Write out the data as a PAP 'DATA' response
-  */
-  errno = 0;
-  if ((result = atp_sendrsp(sockfd, dest, true, tid, &resp)) < 0)
-  {
-    fprintf(stderr, "DEBUG: atp_sendrsp() returns %d, errno %d \"%s\"\n", result, errno, strerror(errno));
-    return -1;
-  }
-  return(0);
-}
-
-
-/*!
- * @function  papCloseResp
- * @abstract  Send a pap close response in the rare case we receive a close connection request.
- *
- * @param  sockfd      socket descriptor
- * @param  dest                destination address
- * @param  tid         transaction id
- * @param  connID      connection id
- *
- * @result    A non-zero return value for errors
- */
-static int papCloseResp(int sockfd, at_inet_t* dest, int xo, u_short tid, u_char connID)
-{
-  int          result;
-  at_resp_t    resp;
-
-  resp.bitmap = 1;
-  resp.userdata[0] = 0;
-
-  ((u_char*)&resp.userdata[0])[PAP_CONNID]  = connID;
-  ((u_char*)&resp.userdata[0])[PAP_TYPE]    = AT_PAP_TYPE_CLOSE_CONN_REPLY;
-
-  resp.resp[0].iov_base = NULL;
-  resp.resp[0].iov_len = 0;
-
-  if ((result = atp_sendrsp(sockfd, dest, xo, tid, &resp)) < 0)
-  {
-    fprintf(stderr, "DEBUG: atp_sendrsp() returns %d, errno %d \"%s\"\n", result, errno, strerror(errno));
-    return -1;
-  }
-  return 0;
-}
-
-
-/*!
- * @function  papSendRequest
- * @abstract  Send a pap close response in the rare case we receive a close connection request.
- *
- * @param  sockfd      socket descriptor
- * @param  dest                destination address
- * @param  function    pap function
- * @param  bitmap      bitmap
- * @param  xo          exactly once
- * @param  seqno       sequence number
- *
- * @result  A non-zero return value for errors
- */
-static int papSendRequest(int sockfd, at_inet_t* dest, u_char connID, int function, u_char bitmap, int xo, int seqno)
-{
-  u_short      tid;
-  int          err;
-  sigset_t     sv, osv;
-  int          userdata;
-  u_char       *puserdata = (u_char *)&userdata;
-  at_retry_t   retry;
-  at_resp_t    resp;
-  static u_short pap_send_count = 0;
-
-  fprintf(stderr, "DEBUG: -> %s\n", packet_name(function));
-
-  puserdata[0] = connID;
-  puserdata[1] = function;
-  resp.bitmap = bitmap;
-  retry.interval = 10;
-  retry.retries = -1; /* was ATP_INFINITE_RETRIES */
-  if (seqno)
-  {
-    pap_send_count++;
-    if (pap_send_count == 0)
-      pap_send_count = 1;
-
-    OSWriteBigInt16(&puserdata[2], 0, pap_send_count);
-  }
-  else
-    OSWriteBigInt16(&puserdata[2], 0, 0);
-
-  sigemptyset(&sv);
-  sigaddset(&sv, SIGIO);
-  sigprocmask(SIG_SETMASK, &sv, &osv);
-
-  err = atp_sendreq(sockfd, dest, 0, 0, userdata, xo, 0, &tid, &resp, &retry, 1);
-
-  sigprocmask(SIG_SETMASK, &osv, NULL);
-
-  return err;
-}
-
-
-/*!
- * @function  papCancelRequest
- * @abstract  Cancel a pending pap request.
- *
- * @param  sockfd      socket descriptor
- * @param  tid         transaction ID
- *
- * @result    A non-zero return value for errors
- */
-int papCancelRequest(int sockfd, u_short tid)
-{
-  sigset_t     sv, osv;
-
-  sigemptyset(&sv);
-  sigaddset(&sv, SIGIO);
-  sigprocmask(SIG_SETMASK, &sv, &osv);
-
-  if (atp_abort(sockfd, NULL, tid) < 0)
-  {
-    sigprocmask(SIG_SETMASK, &osv, NULL);
-    return -1;
-  }
-  sigprocmask(SIG_SETMASK, &osv, NULL);
-
-  return 0;
-}
-
-
-/*
- * 'sidechannel_request()' - Handle side-channel requests.
- */
-
-static int
-sidechannel_request()
-{
-  cups_sc_command_t    command;        /* Request command */
-  cups_sc_status_t     status;         /* Request/response status */
-  char                 data[2048];     /* Request/response data */
-  int                  datalen;        /* Request/response data size */
-
-  datalen = sizeof(data);
-
-  if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0))
-    return (-1);
-
-  switch (command)
-  {
-    case CUPS_SC_CMD_GET_BIDI:         /* Is the connection bidirectional? */
-       data[0] = 1;
-       return (cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, data, 1, 1.0));
-       break;
-
-    case CUPS_SC_CMD_GET_STATE:                /* Return device state */
-       data[0] = CUPS_SC_STATE_ONLINE;
-       return (cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, data, 1, 1.0));
-       break;
-
-    case CUPS_SC_CMD_DRAIN_OUTPUT:     /* Drain all pending output */
-    case CUPS_SC_CMD_SOFT_RESET:       /* Do a soft reset */
-    case CUPS_SC_CMD_GET_DEVICE_ID:    /* Return IEEE-1284 device ID */
-    default:
-       return (cupsSideChannelWrite(command, CUPS_SC_STATUS_NOT_IMPLEMENTED,
-                                    NULL, 0, 1.0));
-       break;
-  }
-  return (0);
-}
-
-
-#pragma mark -
-/*!
- * @function  statusUpdate
- * @abstract  Format and print a PAP status response to stderr.
- *
- * @param  status      The status response string
- * @param  statusLen   The length of the status response string
- */
-void statusUpdate(char* status, u_char statusLen)
-{
-  static char  status_str[255];
-  static u_char        last_statusLen  = 0xFF;
-
-  /* Only send this if the status has changed */
-  if (statusLen != last_statusLen || memcmp(status, status_str, statusLen) != 0)
-  {
-    if (statusLen > sizeof(status_str)-1)
-      statusLen = sizeof(status_str)-1;
-    last_statusLen = statusLen;
-    memcpy(status_str, status, statusLen);
-    status_str[(int)statusLen] = '\0';
-
-    /*
-     * Make sure the status string is in the form of a PostScript comment.
-     */
-
-    if (statusLen > 3 && memcmp(status, "%%[", 3) == 0)
-      fprintf(stderr, "INFO: %s\n", status_str);
-    else
-      fprintf(stderr, "INFO: %%%%[ %s ]%%%%\n", status_str);
-  }
-  return;
-}
-
-
-/*!
- * @function  parseUri
- * @abstract  Parse a PAP URI into it's NBP components.
- *
- * @param  argv0       The PAP URI to parse
- * @param  name                NBP name
- * @param  zone                NBP zone
- * @param  type                NBP type
- *
- * @result    A non-zero return value for errors
- */
-static int parseUri(const char* argv0, char* name, char* type, char* zone)
-{
-  char  method[255],           /* Method in URI */
-        hostname[1024],                /* Hostname */
-        username[255],         /* Username info (not used) */
-        resource[1024],                /* Resource info (device and options) */
-        *resourcePtr,
-        *typePtr,
-        *options,              /* Pointer to options */
-        *optionName,           /* Name of option */
-        *value,                        /* Value of option */
-        sep;                   /* Separator character */
-  int   port;                  /* Port number (not used) */
-  int   statusInterval;                /* */
-
-  /*
-  * Extract the device name and options from the URI...
-  */
-  method[0] = username[0] = hostname[0] = resource[0] = '\0';
-  port = 0;
-
-  httpSeparateURI(HTTP_URI_CODING_NONE, argv0, method, sizeof(method),
-                 username, sizeof(username),
-                 hostname, sizeof(hostname), &port,
-                 resource, sizeof(resource));
-
-  /*
-  * See if there are any options...
-  */
-  if ((options = strchr(resource, '?')) != NULL)
-  {
-    /*
-    * Yup, terminate the device name string and move to the first
-    * character of the options...
-    */
-    *options++ = '\0';
-
-    while (*options != '\0')
-    {
-     /*
-      * Get the name...
-      */
-
-      optionName = options;
-
-      while (*options && *options != '=' && *options != '+' && *options != '&')
-        options ++;
-
-      if ((sep = *options) != '\0')
-        *options++ = '\0';
-
-      if (sep == '=')
-      {
-       /*
-        * Get the value...
-       */
-
-        value = options;
-
-       while (*options && *options != '+' && *options != '&')
-         options ++;
-
-        if (*options)
-         *options++ = '\0';
-      }
-      else
-        value = (char *)"";
-
-     /*
-      * Process the option...
-      */
-
-      if (!strcasecmp(optionName, "waiteof"))
-      {
-       /*
-        * Wait for the end of the print file?
-        */
-
-        if (!strcasecmp(value, "on") ||
-            !strcasecmp(value, "yes") ||
-            !strcasecmp(value, "true"))
-        {
-          gWaitEOF = true;
-        }
-        else if (!strcasecmp(value, "off") ||
-                 !strcasecmp(value, "no") ||
-                 !strcasecmp(value, "false"))
-        {
-          gWaitEOF = false;
-        }
-        else
-        {
-          _cupsLangPrintf(stderr,
-                         _("WARNING: Boolean expected for waiteof option \"%s\"\n"),
-                         value);
-        }
-      }
-      else if (!strcasecmp(optionName, "status"))
-      {
-       /*
-        * Set status reporting interval...
-       */
-
-        statusInterval = atoi(value);
-        if (value[0] < '0' || value[0] > '9' || statusInterval < 0)
-        {
-          _cupsLangPrintf(stderr,
-                         _("WARNING: number expected for status option \"%s\"\n"),
-                         value);
-        }
-        else
-        {
-          gStatusInterval = statusInterval;
-        }
-      }
-    }
-  }
-
-  resourcePtr = resource;
-
-  if (*resourcePtr == '/')
-    resourcePtr++;
-
- /* If the resource has a slash we assume the slash seperates the AppleTalk object
-  * name from the AppleTalk type. If the slash is not present we assume the AppleTalk
-  * type is LaserWriter.
-  */
-
-  typePtr = strchr(resourcePtr, '/');
-  if (typePtr != NULL)
-  {
-    *typePtr++ = '\0';
-  }
-  else
-  {
-    typePtr = "LaserWriter";
-  }
-
-  removePercentEscapes(hostname, zone, NBP_NVE_STR_SIZE + 1);
-  removePercentEscapes(resourcePtr, name, NBP_NVE_STR_SIZE + 1);
-  removePercentEscapes(typePtr, type, NBP_NVE_STR_SIZE + 1);
-
-  return 0;
-}
-
-
-/*!
- * @function  addPercentEscapes
- * @abstract  Encode a string with percent escapes
- *
- * @param  src         The source C string
- * @param  dst         Desination buffer
- * @param  dstMax      Size of desination buffer
- *
- * @result    A non-zero return value for errors
- */
-static int addPercentEscapes(const char* src, char* dst, int dstMax)
-{
-  char c;
-  char *dstEnd = dst + dstMax - 1;     /* -1 to leave room for the NUL */
-
-  while (*src)
-  {
-    c = *src++;
-
-    if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||
-        (c >= '0' && c <= '9') || (c == '.' || c == '-'  || c == '*' || c == '_'))
-    {
-      if (dst >= dstEnd)
-        return -1;
-
-      *dst++ = c;
-    }
-    else
-    {
-      if (dst >= dstEnd - 2)
-        return -1;
-
-      snprintf(dst, dstEnd - dst, "%%%02x", c);
-      dst += 3;
-    }
-  }
-
-  *dst = '\0';
-  return 0;
-}
-
-
-/*!
- * @function  removePercentEscapes
- * @abstract  Returns a string with any percent escape sequences replaced with their equivalent character
- *
- * @param  src         Source buffer
- * @param  srclen      Number of bytes in source buffer
- * @param  dst         Desination buffer
- * @param  dstMax      Size of desination buffer
- *
- * @result    A non-zero return value for errors
- */
-static int removePercentEscapes(const char* src, char* dst, int dstMax)
-{
-  int c;
-  const char *dstEnd = dst + dstMax;
-
-  while (*src && dst < dstEnd)
-  {
-    c = *src++;
-
-    if (c == '%')
-    {
-      sscanf(src, "%02x", &c);
-      src += 2;
-    }
-    *dst++ = (char)c;
-  }
-
-  if (dst >= dstEnd)
-    return -1;
-
-  *dst = '\0';
-  return 0;
-}
-
-
-/*!
- * @function  nbptuple_compare
- * @abstract  An NBP comparator for qsort.
- *
- * @result    p1<p2: -1, p1=p2: 0, p1>p2: 1
- */
-int nbptuple_compare(const void *p1, const void *p2)
-{
-  int result;
-  int len = MIN(((at_nbptuple_t*)p1)->enu_entity.object.len,
-          ((at_nbptuple_t*)p2)->enu_entity.object.len);
-
-  if ((result = memcmp(((at_nbptuple_t*)p1)->enu_entity.object.str, ((at_nbptuple_t*)p2)->enu_entity.object.str, len)) == 0)
-  {
-    if (((at_nbptuple_t*)p1)->enu_entity.object.len < ((at_nbptuple_t*)p2)->enu_entity.object.len)
-      result = -1;
-    else if (((at_nbptuple_t*)p1)->enu_entity.object.len > ((at_nbptuple_t*)p2)->enu_entity.object.len)
-      result = 1;
-    else
-      result = 0;
-  }
-  return result;
-}
-
-
-/*!
- * @function  okayToUseAppleTalk
- * @abstract  Returns true if AppleTalk is available and enabled.
- *
- * @result    non-zero if AppleTalk is enabled
- */
-static int okayToUseAppleTalk()
-{
-  int atStatus = checkATStack();
-
-  /* I think the test should be:
-   *    return atStatus == RUNNING || atStatus == LOADED;
-   * but when I disable AppleTalk from the network control panel and
-   * reboot, AppleTalk shows up as loaded. The test empirically becomes
-   * the following:
-   */
-  return atStatus == RUNNING;
-}
-
-
-/*!
- * @function  packet_name
- * @abstract  Returns packet name string.
- *
- * @result    A string
- */
-static const char *packet_name(u_char x)
-{
-  switch (x)
-  {
-  case AT_PAP_TYPE_OPEN_CONN:          return "PAP_OPEN_CONN";
-  case AT_PAP_TYPE_OPEN_CONN_REPLY:    return "PAP_OPEN_CONN_REPLY";
-  case AT_PAP_TYPE_SEND_DATA:          return "PAP_SEND_DATA";
-  case AT_PAP_TYPE_DATA:               return "PAP_DATA";
-  case AT_PAP_TYPE_TICKLE:             return "PAP_TICKLE";
-  case AT_PAP_TYPE_CLOSE_CONN:         return "PAP_CLOSE_CONN";
-  case AT_PAP_TYPE_CLOSE_CONN_REPLY:   return "PAP_CLOSE_CONN_REPLY";
-  case AT_PAP_TYPE_SEND_STATUS:                return "PAP_SEND_STATUS";
-  case AT_PAP_TYPE_SEND_STS_REPLY:     return "PAP_SEND_STS_REPLY";
-  case AT_PAP_TYPE_READ_LW:            return "PAP_READ_LW";
-  }
-  return "<Unknown>";
-}
-
-
-/*!
- * @function  connectTimeout
- * @abstract  Returns the connect timeout preference value.
- */
-static int connectTimeout()
-{
-  CFPropertyListRef value;
-  SInt32 connect_timeout = (7 * 24 * 60 * 60); /* Default timeout is one week... */
-
-  value = CFPreferencesCopyValue(CFSTR("timeout"), CFSTR("com.apple.print.backends"),
-                                kCFPreferencesAnyUser, kCFPreferencesCurrentHost);
-  if (value != NULL)
-  {
-    if (CFGetTypeID(value) == CFNumberGetTypeID())
-      CFNumberGetValue(value, kCFNumberSInt32Type, &connect_timeout);
-
-    CFRelease(value);
-  }
-
-  return connect_timeout;
-}
-
-
-/*!
- * @function  signalHandler
- * @abstract  A signal handler so we can clean up the pap session before exiting.
- *
- * @param  sigraised   The signal raised
- *
- * @result    Never returns
- */
-static void signalHandler(int sigraised)
-{
-  _cupsLangPuts(stderr, _("ERROR: There was a timeout error while sending data to the printer\n"));
-
-  papClose();
-
-  _exit(1);
-}
index 13f9c23daed9dc051f352c7cf616957b8396c643..d225529dad2ed2f9ed1c48d9e84ccebd5788de85 100644 (file)
@@ -1,9 +1,9 @@
 /*
  * "$Id: runloop.c 7895 2008-09-02 19:19:43Z mike $"
  *
- *   Common run loop APIs for the Common UNIX Printing System (CUPS).
+ *   Common run loop APIs for CUPS.
  *
- *   Copyright 2007-2009 by Apple Inc.
+ *   Copyright 2007-2010 by Apple Inc.
  *   Copyright 2006-2007 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -299,6 +299,8 @@ backendRunLoop(
                strerror(errno));
        use_bc = 0;
       }
+      else if (bc_bytes == 0)
+        use_bc = 0;
     }
 
    /*
index 4eb3700ffc09941d1213c2b106be480d07988dba..7a0c36c61c29a145340f5bdb12c09c673bce87dd 100644 (file)
@@ -503,7 +503,7 @@ main(int  argc,                             /* I - Number of command-line arguments (6 or 7) */
   * stdin (otherwise you can't cancel raw jobs...)
   */
 
-  if (print_fd != 0)
+  if (!print_fd)
   {
 #ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
     sigset(SIGTERM, SIG_IGN);
index f94059984d0a7420cf423a97f312877f6ed0d568..7bc883e5ef8b3ad63667996b8873738b1df2fc4f 100644 (file)
@@ -112,6 +112,12 @@ extern char **environ;
 
 #define DEBUG_WRITES 0
 
+/*
+ * WAIT_EOF_DELAY is number of seconds we'll wait for responses from
+ * the printer after we've finished sending all the data
+ */
+#define WAIT_EOF_DELAY                 7
+#define WAIT_SIDE_DELAY                        3
 #define DEFAULT_TIMEOUT                        5000L
 
 #define        USB_INTERFACE_KIND              CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID190)
@@ -241,6 +247,11 @@ typedef struct globals_s
   Boolean              wait_eof;
   int                  drain_output;   /* Drain all pending output */
   int                  bidi_flag;      /* 0=unidirectional, 1=bidirectional */
+
+  pthread_mutex_t      sidechannel_thread_mutex;
+  pthread_cond_t       sidechannel_thread_cond;
+  int                  sidechannel_thread_stop;
+  int                  sidechannel_thread_done;
 } globals_t;
 
 
@@ -333,6 +344,7 @@ print_device(const char *uri,               /* I - Device URI */
   UInt32         bytes;                /* Bytes written */
   struct timeval  *timeout,            /* Timeout pointer */
                  stimeout;             /* Timeout for select() */
+  struct timespec cond_timeout;                /* pthread condition timeout */
 
 
  /*
@@ -477,6 +489,12 @@ print_device(const char *uri,              /* I - Device URI */
 
   if (have_sidechannel)
   {
+    g.sidechannel_thread_stop = 0;
+    g.sidechannel_thread_done = 0;
+
+    pthread_cond_init(&g.sidechannel_thread_cond, NULL);
+    pthread_mutex_init(&g.sidechannel_thread_mutex, NULL);
+
     if (pthread_create(&sidechannel_thread_id, NULL, sidechannel_thread, NULL))
     {
       fprintf(stderr, "DEBUG: Fatal USB error.\n");
@@ -734,6 +752,101 @@ print_device(const char *uri,             /* I - Device URI */
 
   fprintf(stderr, "DEBUG: Sent %lld bytes...\n", (off_t)total_bytes);
 
+  if (!print_fd)
+  {
+   /*
+    * Re-enable the SIGTERM handler so pthread_kill() will work...
+    */
+  
+    struct sigaction   action;         /* POSIX signal action */
+
+    memset(&action, 0, sizeof(action));
+
+    sigemptyset(&action.sa_mask);
+    action.sa_handler = SIG_DFL;
+    sigaction(SIGTERM, &action, NULL);
+  }
+
+ /*
+  * Wait for the side channel thread to exit...
+  */
+
+  if (have_sidechannel)
+  {
+    close(CUPS_SC_FD);
+    pthread_mutex_lock(&g.readwrite_lock_mutex);
+    g.readwrite_lock = 0;
+    pthread_cond_signal(&g.readwrite_lock_cond);
+    pthread_mutex_unlock(&g.readwrite_lock_mutex);
+
+    g.sidechannel_thread_stop = 1;
+    pthread_mutex_lock(&g.sidechannel_thread_mutex);
+    if (!g.sidechannel_thread_done)
+    {
+     /*
+      * Wait for the side-channel thread to exit...
+      */
+
+      cond_timeout.tv_sec  = time(NULL) + WAIT_SIDE_DELAY;
+      cond_timeout.tv_nsec = 0;
+      if (pthread_cond_timedwait(&g.sidechannel_thread_cond,
+                                &g.sidechannel_thread_mutex,
+                                &cond_timeout) != 0)
+      {
+       /*
+       * Force the side-channel thread to exit...
+       */
+
+       pthread_kill(sidechannel_thread_id, SIGTERM);
+      }
+    }
+    pthread_mutex_unlock(&g.sidechannel_thread_mutex);
+
+    pthread_join(sidechannel_thread_id, NULL);
+
+    pthread_cond_destroy(&g.sidechannel_thread_cond);
+    pthread_mutex_destroy(&g.sidechannel_thread_mutex);
+  }
+
+  pthread_cond_destroy(&g.readwrite_lock_cond);
+  pthread_mutex_destroy(&g.readwrite_lock_mutex);
+
+ /*
+  * Signal the read thread to stop...
+  */
+
+  g.read_thread_stop = 1;
+
+ /*
+  * Give the read thread WAIT_EOF_DELAY seconds to complete all the data. If
+  * we are not signaled in that time then force the thread to exit.
+  */
+
+  pthread_mutex_lock(&g.read_thread_mutex);
+
+  if (!g.read_thread_done)
+  {
+    cond_timeout.tv_sec = time(NULL) + WAIT_EOF_DELAY;
+    cond_timeout.tv_nsec = 0;
+
+    if (pthread_cond_timedwait(&g.read_thread_cond, &g.read_thread_mutex,
+                               &cond_timeout) != 0)
+    {
+     /*
+      * Force the read thread to exit...
+      */
+
+      g.wait_eof = 0;
+      pthread_kill(read_thread_id, SIGTERM);
+    }
+  }
+  pthread_mutex_unlock(&g.read_thread_mutex);
+
+  pthread_join(read_thread_id, NULL);  /* wait for the read thread to return */
+
+  pthread_cond_destroy(&g.read_thread_cond);
+  pthread_mutex_destroy(&g.read_thread_mutex);
+
  /*
   * Close the connection and input file and general clean up...
   */
@@ -942,7 +1055,12 @@ sidechannel_thread(void *reference)
          break;
     }
   }
-  while (1);
+  while (!g.sidechannel_thread_stop);
+
+  pthread_mutex_lock(&g.sidechannel_thread_mutex);
+  g.sidechannel_thread_done = 1;
+  pthread_cond_signal(&g.sidechannel_thread_cond);
+  pthread_mutex_unlock(&g.sidechannel_thread_mutex);
 
   return NULL;
 }
@@ -1278,7 +1396,10 @@ static kern_return_t load_classdriver(CFStringRef            driverPath,
   {
     fprintf(stderr, "DEBUG: Unable to load class driver \"%s\": %s\n",
            bundlestr, strerror(errno));
-    return (kr);
+    if (errno == ENOENT)
+      return (load_classdriver(NULL, intf, printerDriver));
+    else
+      return (kr);
   }
   else if (bundleinfo.st_mode & S_IWOTH)
   {
index 7f40951793ef3718529141bb85033b753f3bddb4..3071e1c40cf74ed141fd77f023c9c1cb428e3c82 100644 (file)
@@ -1,9 +1,9 @@
 /*
  * "$Id$"
  *
- *   Libusb interface code for the Common UNIX Printing System (CUPS).
+ *   Libusb interface code for CUPS.
  *
- *   Copyright 2007-2009 by Apple Inc.
+ *   Copyright 2007-2010 by Apple Inc.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Apple Inc. and are protected by Federal copyright
@@ -173,7 +173,7 @@ print_device(const char *uri,               /* I - Device URI */
        if ((bytes = read(print_fd, buffer, sizeof(buffer))) > 0)
        {
          if (usb_bulk_write(printer->handle, printer->write_endp, buffer,
-                               bytes, 45000) < 0)
+                               bytes, 3600000) < 0)
          {
            _cupsLangPrintf(stderr,
                            _("ERROR: Unable to write %d bytes to printer\n"),
@@ -519,7 +519,8 @@ make_device_uri(
 
   if ((sern = cupsGetOption("SERIALNUMBER", num_values, values)) == NULL)
     if ((sern = cupsGetOption("SERN", num_values, values)) == NULL)
-      if ((sern = cupsGetOption("SN", num_values, values)) == NULL)
+      if ((sern = cupsGetOption("SN", num_values, values)) == NULL &&
+          printer->device->descriptor.iSerialNumber)
       {
        /*
         * Try getting the serial number from the device itself...
index 297ddba7ffdd640c4b944177b73030ac46ecd7c8..de9ba9799f033c6fc8db835992d1189b95f1dc4f 100644 (file)
@@ -1,32 +1,32 @@
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
 lpc.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-lpc.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h
-lpc.o: ../cups/array.h ../cups/string-private.h ../config.h
+lpc.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+lpc.o: ../cups/language.h ../cups/string-private.h ../config.h
 lpc.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 lpc.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 lpc.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
 lpc.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
 lpc.o: ../cups/thread-private.h
 lpq.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-lpq.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h
-lpq.o: ../cups/array.h ../cups/string-private.h ../config.h
+lpq.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+lpq.o: ../cups/language.h ../cups/string-private.h ../config.h
 lpq.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 lpq.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 lpq.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
 lpq.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
 lpq.o: ../cups/thread-private.h
 lpr.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-lpr.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h
-lpr.o: ../cups/array.h ../cups/string-private.h ../config.h
+lpr.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+lpr.o: ../cups/language.h ../cups/string-private.h ../config.h
 lpr.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 lpr.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 lpr.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
 lpr.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
 lpr.o: ../cups/thread-private.h
 lprm.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-lprm.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h
-lprm.o: ../cups/array.h ../cups/string-private.h ../config.h
+lprm.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+lprm.o: ../cups/language.h ../cups/string-private.h ../config.h
 lprm.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 lprm.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 lprm.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
index c8a4e51ba531954eed944079d1dc4c59ca617c03..9a5f11d5763244f8b604f09c6d7e057566686d4f 100644 (file)
@@ -2,74 +2,74 @@
 
 help-index.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
 help-index.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-help-index.o: ../cups/language.h ../cups/array.h ../cups/array.h help-index.h
+help-index.o: ../cups/array.h ../cups/language.h ../cups/array.h help-index.h
 help-index.o: ../cups/debug-private.h ../cups/language-private.h
 help-index.o: ../cups/transcode.h ../cups/string-private.h ../config.h
 help-index.o: ../cups/dir.h
 html.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
-html.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h
-html.o: ../cups/array.h ../cups/array.h help-index.h ../cups/debug-private.h
-html.o: ../cups/language-private.h ../cups/transcode.h
-html.o: ../cups/string-private.h ../config.h
+html.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+html.o: ../cups/language.h ../cups/array.h help-index.h
+html.o: ../cups/debug-private.h ../cups/language-private.h
+html.o: ../cups/transcode.h ../cups/string-private.h ../config.h
 ipp-var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
-ipp-var.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-ipp-var.o: ../cups/language.h ../cups/array.h ../cups/array.h help-index.h
+ipp-var.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+ipp-var.o: ../cups/language.h ../cups/array.h help-index.h
 ipp-var.o: ../cups/debug-private.h ../cups/language-private.h
 ipp-var.o: ../cups/transcode.h ../cups/string-private.h ../config.h
 search.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
-search.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-search.o: ../cups/language.h ../cups/array.h ../cups/array.h help-index.h
+search.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+search.o: ../cups/language.h ../cups/array.h help-index.h
 search.o: ../cups/debug-private.h ../cups/language-private.h
 search.o: ../cups/transcode.h ../cups/string-private.h ../config.h
 template.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
-template.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-template.o: ../cups/language.h ../cups/array.h ../cups/array.h help-index.h
+template.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+template.o: ../cups/language.h ../cups/array.h help-index.h
 template.o: ../cups/debug-private.h ../cups/language-private.h
 template.o: ../cups/transcode.h ../cups/string-private.h ../config.h
 var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-var.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+var.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 var.o: ../cups/array.h help-index.h ../cups/debug-private.h
 var.o: ../cups/language-private.h ../cups/transcode.h
 var.o: ../cups/string-private.h ../config.h ../cups/http.h
 var.o: ../cups/md5-private.h
 admin.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
-admin.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h
-admin.o: ../cups/array.h ../cups/array.h help-index.h ../cups/debug-private.h
-admin.o: ../cups/language-private.h ../cups/transcode.h
-admin.o: ../cups/string-private.h ../config.h ../cups/adminutil.h
-admin.o: ../cups/cups.h ../cups/ppd.h
+admin.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+admin.o: ../cups/language.h ../cups/array.h help-index.h
+admin.o: ../cups/debug-private.h ../cups/language-private.h
+admin.o: ../cups/transcode.h ../cups/string-private.h ../config.h
+admin.o: ../cups/adminutil.h ../cups/cups.h ../cups/ppd.h
 classes.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
-classes.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-classes.o: ../cups/language.h ../cups/array.h ../cups/array.h help-index.h
+classes.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+classes.o: ../cups/language.h ../cups/array.h help-index.h
 classes.o: ../cups/debug-private.h ../cups/language-private.h
 classes.o: ../cups/transcode.h ../cups/string-private.h ../config.h
 help.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
-help.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h
-help.o: ../cups/array.h ../cups/array.h help-index.h ../cups/debug-private.h
-help.o: ../cups/language-private.h ../cups/transcode.h
-help.o: ../cups/string-private.h ../config.h
+help.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+help.o: ../cups/language.h ../cups/array.h help-index.h
+help.o: ../cups/debug-private.h ../cups/language-private.h
+help.o: ../cups/transcode.h ../cups/string-private.h ../config.h
 jobs.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
-jobs.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h
-jobs.o: ../cups/array.h ../cups/array.h help-index.h ../cups/debug-private.h
-jobs.o: ../cups/language-private.h ../cups/transcode.h
-jobs.o: ../cups/string-private.h ../config.h
+jobs.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+jobs.o: ../cups/language.h ../cups/array.h help-index.h
+jobs.o: ../cups/debug-private.h ../cups/language-private.h
+jobs.o: ../cups/transcode.h ../cups/string-private.h ../config.h
 makedocset.o: cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-makedocset.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+makedocset.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 makedocset.o: ../cups/array.h help-index.h
 printers.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
-printers.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-printers.o: ../cups/language.h ../cups/array.h ../cups/array.h help-index.h
+printers.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+printers.o: ../cups/language.h ../cups/array.h help-index.h
 printers.o: ../cups/debug-private.h ../cups/language-private.h
 printers.o: ../cups/transcode.h ../cups/string-private.h ../config.h
 testcgi.o: cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-testcgi.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+testcgi.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 testcgi.o: ../cups/array.h help-index.h
 testhi.o: cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-testhi.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+testhi.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 testhi.o: ../cups/array.h help-index.h
 testtemplate.o: cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-testtemplate.o: ../cups/ipp.h ../cups/http.h ../cups/language.h
-testtemplate.o: ../cups/array.h ../cups/array.h help-index.h
+testtemplate.o: ../cups/ipp.h ../cups/http.h ../cups/array.h
+testtemplate.o: ../cups/language.h ../cups/array.h help-index.h
 websearch.o: cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-websearch.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+websearch.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 websearch.o: ../cups/array.h help-index.h
index b890c8b99ddb232a4f61ebe64eb4075bd1ac7e9a..a5250dc10b58f8624775207207c9e3f22f56f208 100644 (file)
@@ -3439,6 +3439,20 @@ do_set_options(http_t *http,             /* I - HTTP connection */
           i > 0;
           i --, group ++)
       {
+       for (j = group->num_options, option = group->options;
+            j > 0;
+            j --, option ++)
+       {
+         if (!strcmp(option->keyword, "PageRegion"))
+           continue;
+
+         if (option->num_choices > 1)
+           break;
+       }
+
+        if (j == 0)
+         continue;
+
         cgiSetVariable("GROUP_ID", group->name);
 
        if (!strcmp(group->name, "InstallableOptions"))
@@ -3452,7 +3466,7 @@ do_set_options(http_t *http,              /* I - HTTP connection */
             j > 0;
             j --, option ++)
        {
-         if (!strcmp(option->keyword, "PageRegion"))
+         if (!strcmp(option->keyword, "PageRegion") || option->num_choices < 2)
            continue;
 
          cgiSetVariable("KEYWORD", option->keyword);
@@ -3485,7 +3499,6 @@ do_set_options(http_t *http,              /* I - HTTP connection */
          {
             const char *units = NULL;  /* Units value, if any */
 
-
            cgiSetVariable("ISCUSTOM", "1");
 
            for (cparam = ppdFirstCustomParam(coption), m = 0;
index db0c6c0c99a0c9fdd0d5fb38959bf1e2abdca731..d99b86301ea39e0e9e8f549d58f6aa0486e652de 100644 (file)
@@ -142,6 +142,13 @@ AC_CHECK_HEADER(iconv.h,
                SAVELIBS="$SAVELIBS $LIBS")
        LIBS="$SAVELIBS")
 
+dnl Checks for statfs and its many headers...
+AC_CHECK_HEADER(sys/mount.h,AC_DEFINE(HAVE_SYS_MOUNT_H))
+AC_CHECK_HEADER(sys/statfs.h,AC_DEFINE(HAVE_SYS_STATFS_H))
+AC_CHECK_HEADER(sys/statvfs.h,AC_DEFINE(HAVE_SYS_STATVFS_H))
+AC_CHECK_HEADER(sys/vfs.h,AC_DEFINE(HAVE_SYS_VFS_H))
+AC_CHECK_FUNCS(statfs statvfs)
+
 dnl Checks for string functions.
 AC_CHECK_FUNCS(strdup strcasecmp strncasecmp strlcat strlcpy)
 if test "$uname" = "HP-UX" -a "$uversion" = "1020"; then
index b532e0370330f76236a891b8b8d398c3f7773302..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,31 +0,0 @@
-dnl
-dnl "$Id$"
-dnl
-dnl   PAP (AppleTalk) stuff for the Common UNIX Printing System (CUPS).
-dnl
-dnl   Copyright 2007-2009 by Apple Inc.
-dnl   Copyright 2006 by Easy Software Products, all rights reserved.
-dnl
-dnl   These coded instructions, statements, and computer programs are the
-dnl   property of Apple Inc. and are protected by Federal copyright
-dnl   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
-dnl   which should have been included with this file.  If this file is
-dnl   file is missing or damaged, see the license at "http://www.cups.org/".
-dnl
-
-# Currently the PAP backend is only supported on MacOS X with the AppleTalk
-# SDK installed...
-AC_ARG_ENABLE(pap, [  --enable-pap            build with AppleTalk support])
-
-PAP=""
-AC_SUBST(PAP)
-
-if test x$enable_pap = xyes -a $uname = Darwin; then
-       AC_CHECK_HEADER(netat/appletalk.h,[
-               PAP="pap"
-               AC_CHECK_HEADER(AppleTalk/at_proto.h)])
-fi
-
-dnl
-dnl End of "$Id$".
-dnl
index c605121c0c56d5538dc939e7d2f5165052bfb7a2..86faf5f9df8119e58ea55dd85c1cc46edfc430ff 100644 (file)
@@ -38,6 +38,8 @@ if test x$enable_ssl != xno; then
                AC_DEFINE(HAVE_CDSASSL)
 
                dnl Check for the various security headers...
+               AC_CHECK_HEADER(Security/SecCertificate.h,
+                   AC_DEFINE(HAVE_SECCERTIFICATE_H))
                AC_CHECK_HEADER(Security/SecItemPriv.h,
                    AC_DEFINE(HAVE_SECITEMPRIV_H))
                AC_CHECK_HEADER(Security/SecPolicy.h,
@@ -60,12 +62,14 @@ if test x$enable_ssl != xno; then
 
                dnl Check for SecPolicyCreateSSL...
                AC_MSG_CHECKING(for SecPolicyCreateSSL)
-               if test $uversion -ge 100; then
+               if test $uversion -ge 110; then
                    AC_DEFINE(HAVE_SECPOLICYCREATESSL)
                    AC_MSG_RESULT(yes)
                else
                    AC_MSG_RESULT(no)
                fi])
+
+               AC_DEFINE(HAVE_CSSMERRORSTRING)
        fi
     fi
 
index af0813dc6a1028a545295bf2d7e864893129f6b6..13e2da071327c97921b2cc4631081ffa6999729f 100644 (file)
  */
 
 #undef HAVE_AUTHORIZATION_H
+#undef HAVE_SECCERTIFICATE_H
 #undef HAVE_SECITEMPRIV_H
 #undef HAVE_SECPOLICY_H
 #undef HAVE_SECPOLICYPRIV_H
 
 #undef HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY
 
+/*
+ * Do we have the SecPolicyCreateSSL function?
+ */
+
+#undef HAVE_SECPOLICYCREATESSL
+
 
 /*
  * Do we have the SecPolicyCreateSSL function?
 #undef HAVE_SECPOLICYCREATESSL
 
 
+/*
+ * Do we have the cssmErrorString function?
+ */
+
+#undef HAVE_CSSMERRORSTRING
+
+
 /*
  * Do we have the SLP library?
  */
 #undef HAVE_ICONV_H
 
 
+/*
+ * Do we have statfs or statvfs and one of the corresponding headers?
+ */
+
+#undef HAVE_STATFS
+#undef HAVE_STATVFS
+#undef HAVE_SYS_MOUNT_H
+#undef HAVE_SYS_STATFS_H
+#undef HAVE_SYS_STATVFS_H
+#undef HAVE_SYS_VFS_H
+
+
 #endif /* !_CUPS_CONFIG_H_ */
 
 /*
index 11b3e49cc28d8abdd16d577bc4b068ce780cb2ea..cc724bde98e0594a1fce691f2f8fe4d136e1e4df 100644 (file)
@@ -38,7 +38,6 @@ sinclude(config-scripts/cups-largefile.m4)
 sinclude(config-scripts/cups-dnssd.m4)
 sinclude(config-scripts/cups-launchd.m4)
 sinclude(config-scripts/cups-defaults.m4)
-sinclude(config-scripts/cups-pap.m4)
 sinclude(config-scripts/cups-pdf.m4)
 sinclude(config-scripts/cups-scripting.m4)
 
index 822b97627a2a369b63558bfa086d7f94d1ef14ad..4eb80b6c5e065ba63ed941c8dedc86bdf11baed0 100644 (file)
 # DO NOT DELETE
 
 adminutil.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-adminutil.o: language.h array.h string-private.h ../config.h debug-private.h
+adminutil.o: array.h language.h string-private.h ../config.h debug-private.h
 adminutil.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 adminutil.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 adminutil.o: language-private.h ../cups/transcode.h thread-private.h
 adminutil.o: adminutil.h
 array.o: string-private.h ../config.h debug-private.h array.h versioning.h
 attr.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-attr.o: language.h array.h string-private.h ../config.h debug-private.h
+attr.o: array.h language.h string-private.h ../config.h debug-private.h
 attr.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 attr.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 attr.o: language-private.h ../cups/transcode.h thread-private.h
 auth.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-auth.o: language.h array.h string-private.h ../config.h debug-private.h
+auth.o: array.h language.h string-private.h ../config.h debug-private.h
 auth.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 auth.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 auth.o: language-private.h ../cups/transcode.h thread-private.h
 backchannel.o: cups.h
 backend.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-backend.o: language.h array.h string-private.h ../config.h debug-private.h
+backend.o: array.h language.h string-private.h ../config.h debug-private.h
 backend.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 backend.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 backend.o: language-private.h ../cups/transcode.h thread-private.h backend.h
 conflicts.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-conflicts.o: language.h array.h string-private.h ../config.h debug-private.h
+conflicts.o: array.h language.h string-private.h ../config.h debug-private.h
 conflicts.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 conflicts.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 conflicts.o: language-private.h ../cups/transcode.h thread-private.h
 custom.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-custom.o: language.h array.h string-private.h ../config.h debug-private.h
+custom.o: array.h language.h string-private.h ../config.h debug-private.h
 custom.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 custom.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 custom.o: language-private.h ../cups/transcode.h thread-private.h
 debug.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-debug.o: language.h array.h string-private.h ../config.h debug-private.h
+debug.o: array.h language.h string-private.h ../config.h debug-private.h
 debug.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 debug.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 debug.o: language-private.h ../cups/transcode.h thread-private.h
 dest.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-dest.o: language.h array.h string-private.h ../config.h debug-private.h
+dest.o: array.h language.h string-private.h ../config.h debug-private.h
 dest.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 dest.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 dest.o: language-private.h ../cups/transcode.h thread-private.h
 dir.o: string-private.h ../config.h debug-private.h dir.h versioning.h
 emit.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-emit.o: language.h array.h string-private.h ../config.h debug-private.h
+emit.o: array.h language.h string-private.h ../config.h debug-private.h
 emit.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 emit.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 emit.o: language-private.h ../cups/transcode.h thread-private.h
 encode.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-encode.o: language.h array.h string-private.h ../config.h debug-private.h
+encode.o: array.h language.h string-private.h ../config.h debug-private.h
 encode.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 encode.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 encode.o: language-private.h ../cups/transcode.h thread-private.h
 file.o: file-private.h cups-private.h ../cups/cups.h file.h versioning.h
-file.o: ipp.h http.h language.h array.h string-private.h ../config.h
+file.o: ipp.h http.h array.h language.h string-private.h ../config.h
 file.o: debug-private.h ppd-private.h ../cups/ppd.h cups.h pwg-private.h
 file.o: http-private.h ../cups/http.h md5-private.h ipp-private.h
 file.o: ../cups/ipp.h language-private.h ../cups/transcode.h thread-private.h
 getdevices.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-getdevices.o: language.h array.h string-private.h ../config.h debug-private.h
+getdevices.o: array.h language.h string-private.h ../config.h debug-private.h
 getdevices.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 getdevices.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 getdevices.o: language-private.h ../cups/transcode.h thread-private.h
 getifaddrs.o: http-private.h ../config.h ../cups/http.h md5-private.h
 getifaddrs.o: ipp-private.h ../cups/ipp.h
 getputfile.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-getputfile.o: language.h array.h string-private.h ../config.h debug-private.h
+getputfile.o: array.h language.h string-private.h ../config.h debug-private.h
 getputfile.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 getputfile.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 getputfile.o: language-private.h ../cups/transcode.h thread-private.h
 globals.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-globals.o: language.h array.h string-private.h ../config.h debug-private.h
+globals.o: array.h language.h string-private.h ../config.h debug-private.h
 globals.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 globals.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 globals.o: language-private.h ../cups/transcode.h thread-private.h
 http.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-http.o: language.h array.h string-private.h ../config.h debug-private.h
+http.o: array.h language.h string-private.h ../config.h debug-private.h
 http.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 http.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 http.o: language-private.h ../cups/transcode.h thread-private.h
 http-addr.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-http-addr.o: language.h array.h string-private.h ../config.h debug-private.h
+http-addr.o: array.h language.h string-private.h ../config.h debug-private.h
 http-addr.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 http-addr.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 http-addr.o: language-private.h ../cups/transcode.h thread-private.h
 http-addrlist.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h
-http-addrlist.o: http.h language.h array.h string-private.h ../config.h
+http-addrlist.o: http.h array.h language.h string-private.h ../config.h
 http-addrlist.o: debug-private.h ppd-private.h ../cups/ppd.h cups.h
 http-addrlist.o: pwg-private.h http-private.h ../cups/http.h md5-private.h
 http-addrlist.o: ipp-private.h ../cups/ipp.h language-private.h
 http-addrlist.o: ../cups/transcode.h thread-private.h
 http-support.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h
-http-support.o: http.h language.h array.h string-private.h ../config.h
+http-support.o: http.h array.h language.h string-private.h ../config.h
 http-support.o: debug-private.h ppd-private.h ../cups/ppd.h cups.h
 http-support.o: pwg-private.h http-private.h ../cups/http.h md5-private.h
 http-support.o: ipp-private.h ../cups/ipp.h language-private.h
 http-support.o: ../cups/transcode.h thread-private.h
-ipp.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-ipp.o: language.h array.h string-private.h ../config.h debug-private.h
-ipp.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
-ipp.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
-ipp.o: language-private.h ../cups/transcode.h thread-private.h
+ipp.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h array.h
+ipp.o: language.h string-private.h ../config.h debug-private.h ppd-private.h
+ipp.o: ../cups/ppd.h cups.h pwg-private.h http-private.h ../cups/http.h
+ipp.o: md5-private.h ipp-private.h ../cups/ipp.h language-private.h
+ipp.o: ../cups/transcode.h thread-private.h
 ipp-support.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-ipp-support.o: language.h array.h string-private.h ../config.h
+ipp-support.o: array.h language.h string-private.h ../config.h
 ipp-support.o: debug-private.h ppd-private.h ../cups/ppd.h cups.h
 ipp-support.o: pwg-private.h http-private.h ../cups/http.h md5-private.h
 ipp-support.o: ipp-private.h ../cups/ipp.h language-private.h
 ipp-support.o: ../cups/transcode.h thread-private.h
 langprintf.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-langprintf.o: language.h array.h string-private.h ../config.h debug-private.h
+langprintf.o: array.h language.h string-private.h ../config.h debug-private.h
 langprintf.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 langprintf.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 langprintf.o: language-private.h ../cups/transcode.h thread-private.h
 language.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-language.o: language.h array.h string-private.h ../config.h debug-private.h
+language.o: array.h language.h string-private.h ../config.h debug-private.h
 language.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 language.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 language.o: language-private.h ../cups/transcode.h thread-private.h
 localize.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-localize.o: language.h array.h string-private.h ../config.h debug-private.h
+localize.o: array.h language.h string-private.h ../config.h debug-private.h
 localize.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 localize.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 localize.o: language-private.h ../cups/transcode.h thread-private.h
 mark.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-mark.o: language.h array.h string-private.h ../config.h debug-private.h
+mark.o: array.h language.h string-private.h ../config.h debug-private.h
 mark.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 mark.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 mark.o: language-private.h ../cups/transcode.h thread-private.h
@@ -133,42 +133,46 @@ md5.o: md5-private.h string-private.h ../config.h
 md5passwd.o: http-private.h ../config.h ../cups/http.h md5-private.h
 md5passwd.o: ipp-private.h ../cups/ipp.h string-private.h
 notify.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-notify.o: language.h array.h string-private.h ../config.h debug-private.h
+notify.o: array.h language.h string-private.h ../config.h debug-private.h
 notify.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 notify.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 notify.o: language-private.h ../cups/transcode.h thread-private.h
-options.o: cups.h string-private.h ../config.h debug-private.h
+options.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
+options.o: array.h language.h string-private.h ../config.h debug-private.h
+options.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
+options.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
+options.o: language-private.h ../cups/transcode.h thread-private.h
 page.o: string-private.h ../config.h debug-private.h ppd.h cups.h array.h
 page.o: versioning.h file.h
-ppd.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-ppd.o: language.h array.h string-private.h ../config.h debug-private.h
-ppd.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
-ppd.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
-ppd.o: language-private.h ../cups/transcode.h thread-private.h
+ppd.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h array.h
+ppd.o: language.h string-private.h ../config.h debug-private.h ppd-private.h
+ppd.o: ../cups/ppd.h cups.h pwg-private.h http-private.h ../cups/http.h
+ppd.o: md5-private.h ipp-private.h ../cups/ipp.h language-private.h
+ppd.o: ../cups/transcode.h thread-private.h
 pwg-file.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-pwg-file.o: language.h array.h string-private.h ../config.h debug-private.h
+pwg-file.o: array.h language.h string-private.h ../config.h debug-private.h
 pwg-file.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 pwg-file.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 pwg-file.o: language-private.h ../cups/transcode.h thread-private.h
 pwg-media.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-pwg-media.o: language.h array.h string-private.h ../config.h debug-private.h
+pwg-media.o: array.h language.h string-private.h ../config.h debug-private.h
 pwg-media.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 pwg-media.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 pwg-media.o: language-private.h ../cups/transcode.h thread-private.h
 pwg-ppd.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-pwg-ppd.o: language.h array.h string-private.h ../config.h debug-private.h
+pwg-ppd.o: array.h language.h string-private.h ../config.h debug-private.h
 pwg-ppd.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 pwg-ppd.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 pwg-ppd.o: language-private.h ../cups/transcode.h thread-private.h
 request.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-request.o: language.h array.h string-private.h ../config.h debug-private.h
+request.o: array.h language.h string-private.h ../config.h debug-private.h
 request.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 request.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 request.o: language-private.h ../cups/transcode.h thread-private.h
 sidechannel.o: sidechannel.h versioning.h string-private.h ../config.h
 sidechannel.o: debug-private.h
 snmp.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-snmp.o: language.h array.h string-private.h ../config.h debug-private.h
+snmp.o: array.h language.h string-private.h ../config.h debug-private.h
 snmp.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 snmp.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 snmp.o: language-private.h ../cups/transcode.h thread-private.h
@@ -177,27 +181,27 @@ snprintf.o: string-private.h ../config.h
 string.o: string-private.h ../config.h debug-private.h thread-private.h
 string.o: array.h versioning.h
 tempfile.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-tempfile.o: language.h array.h string-private.h ../config.h debug-private.h
+tempfile.o: array.h language.h string-private.h ../config.h debug-private.h
 tempfile.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 tempfile.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 tempfile.o: language-private.h ../cups/transcode.h thread-private.h
 thread.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-thread.o: language.h array.h string-private.h ../config.h debug-private.h
+thread.o: array.h language.h string-private.h ../config.h debug-private.h
 thread.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 thread.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 thread.o: language-private.h ../cups/transcode.h thread-private.h
 transcode.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-transcode.o: language.h array.h string-private.h ../config.h debug-private.h
+transcode.o: array.h language.h string-private.h ../config.h debug-private.h
 transcode.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 transcode.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 transcode.o: language-private.h ../cups/transcode.h thread-private.h
 usersys.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-usersys.o: language.h array.h string-private.h ../config.h debug-private.h
+usersys.o: array.h language.h string-private.h ../config.h debug-private.h
 usersys.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 usersys.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 usersys.o: language-private.h ../cups/transcode.h thread-private.h
 util.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-util.o: language.h array.h string-private.h ../config.h debug-private.h
+util.o: array.h language.h string-private.h ../config.h debug-private.h
 util.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 util.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 util.o: language-private.h ../cups/transcode.h thread-private.h
@@ -216,25 +220,25 @@ testi18n.o: ../cups/transcode.h language.h array.h versioning.h
 testipp.o: file.h versioning.h string-private.h ../config.h ipp-private.h
 testipp.o: ../cups/ipp.h
 testoptions.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-testoptions.o: language.h array.h string-private.h ../config.h
+testoptions.o: array.h language.h string-private.h ../config.h
 testoptions.o: debug-private.h ppd-private.h ../cups/ppd.h cups.h
 testoptions.o: pwg-private.h http-private.h ../cups/http.h md5-private.h
 testoptions.o: ipp-private.h ../cups/ipp.h language-private.h
 testoptions.o: ../cups/transcode.h thread-private.h
 testlang.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-testlang.o: language.h array.h string-private.h ../config.h debug-private.h
+testlang.o: array.h language.h string-private.h ../config.h debug-private.h
 testlang.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 testlang.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 testlang.o: language-private.h ../cups/transcode.h thread-private.h
 testppd.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-testppd.o: language.h array.h string-private.h ../config.h debug-private.h
+testppd.o: array.h language.h string-private.h ../config.h debug-private.h
 testppd.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 testppd.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 testppd.o: language-private.h ../cups/transcode.h thread-private.h
-testpwg.o: ppd-private.h ../cups/ppd.h cups.h array.h versioning.h file.h
-testpwg.o: pwg-private.h ../cups/cups.h ipp.h http.h language.h
+testpwg.o: ppd-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
+testpwg.o: array.h language.h ../cups/ppd.h cups.h pwg-private.h
 testsnmp.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-testsnmp.o: language.h array.h string-private.h ../config.h debug-private.h
+testsnmp.o: array.h language.h string-private.h ../config.h debug-private.h
 testsnmp.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 testsnmp.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 testsnmp.o: language-private.h ../cups/transcode.h thread-private.h
@@ -242,131 +246,131 @@ testsnmp.o: snmp-private.h
 # DO NOT DELETE
 
 adminutil.32.o: adminutil.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-adminutil.32.o: adminutil.c  language.h array.h string-private.h ../config.h debug-private.h
+adminutil.32.o: adminutil.c  array.h language.h string-private.h ../config.h debug-private.h
 adminutil.32.o: adminutil.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 adminutil.32.o: adminutil.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 adminutil.32.o: adminutil.c  language-private.h ../cups/transcode.h thread-private.h
 adminutil.32.o: adminutil.c  adminutil.h
 array.32.o: array.c  string-private.h ../config.h debug-private.h array.h versioning.h
 attr.32.o: attr.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-attr.32.o: attr.c  language.h array.h string-private.h ../config.h debug-private.h
+attr.32.o: attr.c  array.h language.h string-private.h ../config.h debug-private.h
 attr.32.o: attr.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 attr.32.o: attr.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 attr.32.o: attr.c  language-private.h ../cups/transcode.h thread-private.h
 auth.32.o: auth.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-auth.32.o: auth.c  language.h array.h string-private.h ../config.h debug-private.h
+auth.32.o: auth.c  array.h language.h string-private.h ../config.h debug-private.h
 auth.32.o: auth.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 auth.32.o: auth.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 auth.32.o: auth.c  language-private.h ../cups/transcode.h thread-private.h
 backchannel.32.o: backchannel.c  cups.h
 backend.32.o: backend.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-backend.32.o: backend.c  language.h array.h string-private.h ../config.h debug-private.h
+backend.32.o: backend.c  array.h language.h string-private.h ../config.h debug-private.h
 backend.32.o: backend.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 backend.32.o: backend.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 backend.32.o: backend.c  language-private.h ../cups/transcode.h thread-private.h backend.h
 conflicts.32.o: conflicts.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-conflicts.32.o: conflicts.c  language.h array.h string-private.h ../config.h debug-private.h
+conflicts.32.o: conflicts.c  array.h language.h string-private.h ../config.h debug-private.h
 conflicts.32.o: conflicts.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 conflicts.32.o: conflicts.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 conflicts.32.o: conflicts.c  language-private.h ../cups/transcode.h thread-private.h
 custom.32.o: custom.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-custom.32.o: custom.c  language.h array.h string-private.h ../config.h debug-private.h
+custom.32.o: custom.c  array.h language.h string-private.h ../config.h debug-private.h
 custom.32.o: custom.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 custom.32.o: custom.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 custom.32.o: custom.c  language-private.h ../cups/transcode.h thread-private.h
 debug.32.o: debug.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-debug.32.o: debug.c  language.h array.h string-private.h ../config.h debug-private.h
+debug.32.o: debug.c  array.h language.h string-private.h ../config.h debug-private.h
 debug.32.o: debug.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 debug.32.o: debug.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 debug.32.o: debug.c  language-private.h ../cups/transcode.h thread-private.h
 dest.32.o: dest.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-dest.32.o: dest.c  language.h array.h string-private.h ../config.h debug-private.h
+dest.32.o: dest.c  array.h language.h string-private.h ../config.h debug-private.h
 dest.32.o: dest.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 dest.32.o: dest.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 dest.32.o: dest.c  language-private.h ../cups/transcode.h thread-private.h
 dir.32.o: dir.c  string-private.h ../config.h debug-private.h dir.h versioning.h
 emit.32.o: emit.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-emit.32.o: emit.c  language.h array.h string-private.h ../config.h debug-private.h
+emit.32.o: emit.c  array.h language.h string-private.h ../config.h debug-private.h
 emit.32.o: emit.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 emit.32.o: emit.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 emit.32.o: emit.c  language-private.h ../cups/transcode.h thread-private.h
 encode.32.o: encode.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-encode.32.o: encode.c  language.h array.h string-private.h ../config.h debug-private.h
+encode.32.o: encode.c  array.h language.h string-private.h ../config.h debug-private.h
 encode.32.o: encode.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 encode.32.o: encode.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 encode.32.o: encode.c  language-private.h ../cups/transcode.h thread-private.h
 file.32.o: file.c  file-private.h cups-private.h ../cups/cups.h file.h versioning.h
-file.32.o: file.c  ipp.h http.h language.h array.h string-private.h ../config.h
+file.32.o: file.c  ipp.h http.h array.h language.h string-private.h ../config.h
 file.32.o: file.c  debug-private.h ppd-private.h ../cups/ppd.h cups.h pwg-private.h
 file.32.o: file.c  http-private.h ../cups/http.h md5-private.h ipp-private.h
 file.32.o: file.c  ../cups/ipp.h language-private.h ../cups/transcode.h thread-private.h
 getdevices.32.o: getdevices.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-getdevices.32.o: getdevices.c  language.h array.h string-private.h ../config.h debug-private.h
+getdevices.32.o: getdevices.c  array.h language.h string-private.h ../config.h debug-private.h
 getdevices.32.o: getdevices.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 getdevices.32.o: getdevices.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 getdevices.32.o: getdevices.c  language-private.h ../cups/transcode.h thread-private.h
 getifaddrs.32.o: getifaddrs.c  http-private.h ../config.h ../cups/http.h md5-private.h
 getifaddrs.32.o: getifaddrs.c  ipp-private.h ../cups/ipp.h
 getputfile.32.o: getputfile.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-getputfile.32.o: getputfile.c  language.h array.h string-private.h ../config.h debug-private.h
+getputfile.32.o: getputfile.c  array.h language.h string-private.h ../config.h debug-private.h
 getputfile.32.o: getputfile.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 getputfile.32.o: getputfile.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 getputfile.32.o: getputfile.c  language-private.h ../cups/transcode.h thread-private.h
 globals.32.o: globals.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-globals.32.o: globals.c  language.h array.h string-private.h ../config.h debug-private.h
+globals.32.o: globals.c  array.h language.h string-private.h ../config.h debug-private.h
 globals.32.o: globals.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 globals.32.o: globals.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 globals.32.o: globals.c  language-private.h ../cups/transcode.h thread-private.h
 http.32.o: http.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-http.32.o: http.c  language.h array.h string-private.h ../config.h debug-private.h
+http.32.o: http.c  array.h language.h string-private.h ../config.h debug-private.h
 http.32.o: http.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 http.32.o: http.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 http.32.o: http.c  language-private.h ../cups/transcode.h thread-private.h
 http-addr.32.o: http-addr.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-http-addr.32.o: http-addr.c  language.h array.h string-private.h ../config.h debug-private.h
+http-addr.32.o: http-addr.c  array.h language.h string-private.h ../config.h debug-private.h
 http-addr.32.o: http-addr.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 http-addr.32.o: http-addr.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 http-addr.32.o: http-addr.c  language-private.h ../cups/transcode.h thread-private.h
 http-addrlist.32.o: http-addrlist.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h
-http-addrlist.32.o: http-addrlist.c  http.h language.h array.h string-private.h ../config.h
+http-addrlist.32.o: http-addrlist.c  http.h array.h language.h string-private.h ../config.h
 http-addrlist.32.o: http-addrlist.c  debug-private.h ppd-private.h ../cups/ppd.h cups.h
 http-addrlist.32.o: http-addrlist.c  pwg-private.h http-private.h ../cups/http.h md5-private.h
 http-addrlist.32.o: http-addrlist.c  ipp-private.h ../cups/ipp.h language-private.h
 http-addrlist.32.o: http-addrlist.c  ../cups/transcode.h thread-private.h
 http-support.32.o: http-support.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h
-http-support.32.o: http-support.c  http.h language.h array.h string-private.h ../config.h
+http-support.32.o: http-support.c  http.h array.h language.h string-private.h ../config.h
 http-support.32.o: http-support.c  debug-private.h ppd-private.h ../cups/ppd.h cups.h
 http-support.32.o: http-support.c  pwg-private.h http-private.h ../cups/http.h md5-private.h
 http-support.32.o: http-support.c  ipp-private.h ../cups/ipp.h language-private.h
 http-support.32.o: http-support.c  ../cups/transcode.h thread-private.h
-ipp.32.o: ipp.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-ipp.32.o: ipp.c  language.h array.h string-private.h ../config.h debug-private.h
-ipp.32.o: ipp.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
-ipp.32.o: ipp.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
-ipp.32.o: ipp.c  language-private.h ../cups/transcode.h thread-private.h
+ipp.32.o: ipp.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h array.h
+ipp.32.o: ipp.c  language.h string-private.h ../config.h debug-private.h ppd-private.h
+ipp.32.o: ipp.c  ../cups/ppd.h cups.h pwg-private.h http-private.h ../cups/http.h
+ipp.32.o: ipp.c  md5-private.h ipp-private.h ../cups/ipp.h language-private.h
+ipp.32.o: ipp.c  ../cups/transcode.h thread-private.h
 ipp-support.32.o: ipp-support.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-ipp-support.32.o: ipp-support.c  language.h array.h string-private.h ../config.h
+ipp-support.32.o: ipp-support.c  array.h language.h string-private.h ../config.h
 ipp-support.32.o: ipp-support.c  debug-private.h ppd-private.h ../cups/ppd.h cups.h
 ipp-support.32.o: ipp-support.c  pwg-private.h http-private.h ../cups/http.h md5-private.h
 ipp-support.32.o: ipp-support.c  ipp-private.h ../cups/ipp.h language-private.h
 ipp-support.32.o: ipp-support.c  ../cups/transcode.h thread-private.h
 langprintf.32.o: langprintf.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-langprintf.32.o: langprintf.c  language.h array.h string-private.h ../config.h debug-private.h
+langprintf.32.o: langprintf.c  array.h language.h string-private.h ../config.h debug-private.h
 langprintf.32.o: langprintf.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 langprintf.32.o: langprintf.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 langprintf.32.o: langprintf.c  language-private.h ../cups/transcode.h thread-private.h
 language.32.o: language.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-language.32.o: language.c  language.h array.h string-private.h ../config.h debug-private.h
+language.32.o: language.c  array.h language.h string-private.h ../config.h debug-private.h
 language.32.o: language.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 language.32.o: language.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 language.32.o: language.c  language-private.h ../cups/transcode.h thread-private.h
 localize.32.o: localize.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-localize.32.o: localize.c  language.h array.h string-private.h ../config.h debug-private.h
+localize.32.o: localize.c  array.h language.h string-private.h ../config.h debug-private.h
 localize.32.o: localize.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 localize.32.o: localize.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 localize.32.o: localize.c  language-private.h ../cups/transcode.h thread-private.h
 mark.32.o: mark.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-mark.32.o: mark.c  language.h array.h string-private.h ../config.h debug-private.h
+mark.32.o: mark.c  array.h language.h string-private.h ../config.h debug-private.h
 mark.32.o: mark.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 mark.32.o: mark.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 mark.32.o: mark.c  language-private.h ../cups/transcode.h thread-private.h
@@ -374,42 +378,46 @@ md5.32.o: md5.c  md5-private.h string-private.h ../config.h
 md5passwd.32.o: md5passwd.c  http-private.h ../config.h ../cups/http.h md5-private.h
 md5passwd.32.o: md5passwd.c  ipp-private.h ../cups/ipp.h string-private.h
 notify.32.o: notify.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-notify.32.o: notify.c  language.h array.h string-private.h ../config.h debug-private.h
+notify.32.o: notify.c  array.h language.h string-private.h ../config.h debug-private.h
 notify.32.o: notify.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 notify.32.o: notify.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 notify.32.o: notify.c  language-private.h ../cups/transcode.h thread-private.h
-options.32.o: options.c  cups.h string-private.h ../config.h debug-private.h
+options.32.o: options.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
+options.32.o: options.c  array.h language.h string-private.h ../config.h debug-private.h
+options.32.o: options.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
+options.32.o: options.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
+options.32.o: options.c  language-private.h ../cups/transcode.h thread-private.h
 page.32.o: page.c  string-private.h ../config.h debug-private.h ppd.h cups.h array.h
 page.32.o: page.c  versioning.h file.h
-ppd.32.o: ppd.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-ppd.32.o: ppd.c  language.h array.h string-private.h ../config.h debug-private.h
-ppd.32.o: ppd.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
-ppd.32.o: ppd.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
-ppd.32.o: ppd.c  language-private.h ../cups/transcode.h thread-private.h
+ppd.32.o: ppd.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h array.h
+ppd.32.o: ppd.c  language.h string-private.h ../config.h debug-private.h ppd-private.h
+ppd.32.o: ppd.c  ../cups/ppd.h cups.h pwg-private.h http-private.h ../cups/http.h
+ppd.32.o: ppd.c  md5-private.h ipp-private.h ../cups/ipp.h language-private.h
+ppd.32.o: ppd.c  ../cups/transcode.h thread-private.h
 pwg-file.32.o: pwg-file.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-pwg-file.32.o: pwg-file.c  language.h array.h string-private.h ../config.h debug-private.h
+pwg-file.32.o: pwg-file.c  array.h language.h string-private.h ../config.h debug-private.h
 pwg-file.32.o: pwg-file.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 pwg-file.32.o: pwg-file.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 pwg-file.32.o: pwg-file.c  language-private.h ../cups/transcode.h thread-private.h
 pwg-media.32.o: pwg-media.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-pwg-media.32.o: pwg-media.c  language.h array.h string-private.h ../config.h debug-private.h
+pwg-media.32.o: pwg-media.c  array.h language.h string-private.h ../config.h debug-private.h
 pwg-media.32.o: pwg-media.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 pwg-media.32.o: pwg-media.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 pwg-media.32.o: pwg-media.c  language-private.h ../cups/transcode.h thread-private.h
 pwg-ppd.32.o: pwg-ppd.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-pwg-ppd.32.o: pwg-ppd.c  language.h array.h string-private.h ../config.h debug-private.h
+pwg-ppd.32.o: pwg-ppd.c  array.h language.h string-private.h ../config.h debug-private.h
 pwg-ppd.32.o: pwg-ppd.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 pwg-ppd.32.o: pwg-ppd.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 pwg-ppd.32.o: pwg-ppd.c  language-private.h ../cups/transcode.h thread-private.h
 request.32.o: request.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-request.32.o: request.c  language.h array.h string-private.h ../config.h debug-private.h
+request.32.o: request.c  array.h language.h string-private.h ../config.h debug-private.h
 request.32.o: request.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 request.32.o: request.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 request.32.o: request.c  language-private.h ../cups/transcode.h thread-private.h
 sidechannel.32.o: sidechannel.c  sidechannel.h versioning.h string-private.h ../config.h
 sidechannel.32.o: sidechannel.c  debug-private.h
 snmp.32.o: snmp.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-snmp.32.o: snmp.c  language.h array.h string-private.h ../config.h debug-private.h
+snmp.32.o: snmp.c  array.h language.h string-private.h ../config.h debug-private.h
 snmp.32.o: snmp.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 snmp.32.o: snmp.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 snmp.32.o: snmp.c  language-private.h ../cups/transcode.h thread-private.h
@@ -418,27 +426,27 @@ snprintf.32.o: snprintf.c  string-private.h ../config.h
 string.32.o: string.c  string-private.h ../config.h debug-private.h thread-private.h
 string.32.o: string.c  array.h versioning.h
 tempfile.32.o: tempfile.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-tempfile.32.o: tempfile.c  language.h array.h string-private.h ../config.h debug-private.h
+tempfile.32.o: tempfile.c  array.h language.h string-private.h ../config.h debug-private.h
 tempfile.32.o: tempfile.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 tempfile.32.o: tempfile.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 tempfile.32.o: tempfile.c  language-private.h ../cups/transcode.h thread-private.h
 thread.32.o: thread.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-thread.32.o: thread.c  language.h array.h string-private.h ../config.h debug-private.h
+thread.32.o: thread.c  array.h language.h string-private.h ../config.h debug-private.h
 thread.32.o: thread.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 thread.32.o: thread.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 thread.32.o: thread.c  language-private.h ../cups/transcode.h thread-private.h
 transcode.32.o: transcode.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-transcode.32.o: transcode.c  language.h array.h string-private.h ../config.h debug-private.h
+transcode.32.o: transcode.c  array.h language.h string-private.h ../config.h debug-private.h
 transcode.32.o: transcode.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 transcode.32.o: transcode.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 transcode.32.o: transcode.c  language-private.h ../cups/transcode.h thread-private.h
 usersys.32.o: usersys.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-usersys.32.o: usersys.c  language.h array.h string-private.h ../config.h debug-private.h
+usersys.32.o: usersys.c  array.h language.h string-private.h ../config.h debug-private.h
 usersys.32.o: usersys.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 usersys.32.o: usersys.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 usersys.32.o: usersys.c  language-private.h ../cups/transcode.h thread-private.h
 util.32.o: util.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-util.32.o: util.c  language.h array.h string-private.h ../config.h debug-private.h
+util.32.o: util.c  array.h language.h string-private.h ../config.h debug-private.h
 util.32.o: util.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 util.32.o: util.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 util.32.o: util.c  language-private.h ../cups/transcode.h thread-private.h
@@ -457,25 +465,25 @@ testi18n.32.o: testi18n.c  ../cups/transcode.h language.h array.h versioning.h
 testipp.32.o: testipp.c  file.h versioning.h string-private.h ../config.h ipp-private.h
 testipp.32.o: testipp.c  ../cups/ipp.h
 testoptions.32.o: testoptions.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-testoptions.32.o: testoptions.c  language.h array.h string-private.h ../config.h
+testoptions.32.o: testoptions.c  array.h language.h string-private.h ../config.h
 testoptions.32.o: testoptions.c  debug-private.h ppd-private.h ../cups/ppd.h cups.h
 testoptions.32.o: testoptions.c  pwg-private.h http-private.h ../cups/http.h md5-private.h
 testoptions.32.o: testoptions.c  ipp-private.h ../cups/ipp.h language-private.h
 testoptions.32.o: testoptions.c  ../cups/transcode.h thread-private.h
 testlang.32.o: testlang.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-testlang.32.o: testlang.c  language.h array.h string-private.h ../config.h debug-private.h
+testlang.32.o: testlang.c  array.h language.h string-private.h ../config.h debug-private.h
 testlang.32.o: testlang.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 testlang.32.o: testlang.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 testlang.32.o: testlang.c  language-private.h ../cups/transcode.h thread-private.h
 testppd.32.o: testppd.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-testppd.32.o: testppd.c  language.h array.h string-private.h ../config.h debug-private.h
+testppd.32.o: testppd.c  array.h language.h string-private.h ../config.h debug-private.h
 testppd.32.o: testppd.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 testppd.32.o: testppd.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 testppd.32.o: testppd.c  language-private.h ../cups/transcode.h thread-private.h
-testpwg.32.o: testpwg.c  ppd-private.h ../cups/ppd.h cups.h array.h versioning.h file.h
-testpwg.32.o: testpwg.c  pwg-private.h ../cups/cups.h ipp.h http.h language.h
+testpwg.32.o: testpwg.c  ppd-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
+testpwg.32.o: testpwg.c  array.h language.h ../cups/ppd.h cups.h pwg-private.h
 testsnmp.32.o: testsnmp.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-testsnmp.32.o: testsnmp.c  language.h array.h string-private.h ../config.h debug-private.h
+testsnmp.32.o: testsnmp.c  array.h language.h string-private.h ../config.h debug-private.h
 testsnmp.32.o: testsnmp.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 testsnmp.32.o: testsnmp.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 testsnmp.32.o: testsnmp.c  language-private.h ../cups/transcode.h thread-private.h
@@ -483,131 +491,131 @@ testsnmp.32.o: testsnmp.c  snmp-private.h
 # DO NOT DELETE
 
 adminutil.64.o: adminutil.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-adminutil.64.o: adminutil.c  language.h array.h string-private.h ../config.h debug-private.h
+adminutil.64.o: adminutil.c  array.h language.h string-private.h ../config.h debug-private.h
 adminutil.64.o: adminutil.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 adminutil.64.o: adminutil.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 adminutil.64.o: adminutil.c  language-private.h ../cups/transcode.h thread-private.h
 adminutil.64.o: adminutil.c  adminutil.h
 array.64.o: array.c  string-private.h ../config.h debug-private.h array.h versioning.h
 attr.64.o: attr.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-attr.64.o: attr.c  language.h array.h string-private.h ../config.h debug-private.h
+attr.64.o: attr.c  array.h language.h string-private.h ../config.h debug-private.h
 attr.64.o: attr.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 attr.64.o: attr.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 attr.64.o: attr.c  language-private.h ../cups/transcode.h thread-private.h
 auth.64.o: auth.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-auth.64.o: auth.c  language.h array.h string-private.h ../config.h debug-private.h
+auth.64.o: auth.c  array.h language.h string-private.h ../config.h debug-private.h
 auth.64.o: auth.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 auth.64.o: auth.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 auth.64.o: auth.c  language-private.h ../cups/transcode.h thread-private.h
 backchannel.64.o: backchannel.c  cups.h
 backend.64.o: backend.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-backend.64.o: backend.c  language.h array.h string-private.h ../config.h debug-private.h
+backend.64.o: backend.c  array.h language.h string-private.h ../config.h debug-private.h
 backend.64.o: backend.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 backend.64.o: backend.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 backend.64.o: backend.c  language-private.h ../cups/transcode.h thread-private.h backend.h
 conflicts.64.o: conflicts.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-conflicts.64.o: conflicts.c  language.h array.h string-private.h ../config.h debug-private.h
+conflicts.64.o: conflicts.c  array.h language.h string-private.h ../config.h debug-private.h
 conflicts.64.o: conflicts.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 conflicts.64.o: conflicts.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 conflicts.64.o: conflicts.c  language-private.h ../cups/transcode.h thread-private.h
 custom.64.o: custom.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-custom.64.o: custom.c  language.h array.h string-private.h ../config.h debug-private.h
+custom.64.o: custom.c  array.h language.h string-private.h ../config.h debug-private.h
 custom.64.o: custom.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 custom.64.o: custom.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 custom.64.o: custom.c  language-private.h ../cups/transcode.h thread-private.h
 debug.64.o: debug.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-debug.64.o: debug.c  language.h array.h string-private.h ../config.h debug-private.h
+debug.64.o: debug.c  array.h language.h string-private.h ../config.h debug-private.h
 debug.64.o: debug.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 debug.64.o: debug.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 debug.64.o: debug.c  language-private.h ../cups/transcode.h thread-private.h
 dest.64.o: dest.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-dest.64.o: dest.c  language.h array.h string-private.h ../config.h debug-private.h
+dest.64.o: dest.c  array.h language.h string-private.h ../config.h debug-private.h
 dest.64.o: dest.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 dest.64.o: dest.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 dest.64.o: dest.c  language-private.h ../cups/transcode.h thread-private.h
 dir.64.o: dir.c  string-private.h ../config.h debug-private.h dir.h versioning.h
 emit.64.o: emit.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-emit.64.o: emit.c  language.h array.h string-private.h ../config.h debug-private.h
+emit.64.o: emit.c  array.h language.h string-private.h ../config.h debug-private.h
 emit.64.o: emit.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 emit.64.o: emit.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 emit.64.o: emit.c  language-private.h ../cups/transcode.h thread-private.h
 encode.64.o: encode.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-encode.64.o: encode.c  language.h array.h string-private.h ../config.h debug-private.h
+encode.64.o: encode.c  array.h language.h string-private.h ../config.h debug-private.h
 encode.64.o: encode.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 encode.64.o: encode.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 encode.64.o: encode.c  language-private.h ../cups/transcode.h thread-private.h
 file.64.o: file.c  file-private.h cups-private.h ../cups/cups.h file.h versioning.h
-file.64.o: file.c  ipp.h http.h language.h array.h string-private.h ../config.h
+file.64.o: file.c  ipp.h http.h array.h language.h string-private.h ../config.h
 file.64.o: file.c  debug-private.h ppd-private.h ../cups/ppd.h cups.h pwg-private.h
 file.64.o: file.c  http-private.h ../cups/http.h md5-private.h ipp-private.h
 file.64.o: file.c  ../cups/ipp.h language-private.h ../cups/transcode.h thread-private.h
 getdevices.64.o: getdevices.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-getdevices.64.o: getdevices.c  language.h array.h string-private.h ../config.h debug-private.h
+getdevices.64.o: getdevices.c  array.h language.h string-private.h ../config.h debug-private.h
 getdevices.64.o: getdevices.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 getdevices.64.o: getdevices.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 getdevices.64.o: getdevices.c  language-private.h ../cups/transcode.h thread-private.h
 getifaddrs.64.o: getifaddrs.c  http-private.h ../config.h ../cups/http.h md5-private.h
 getifaddrs.64.o: getifaddrs.c  ipp-private.h ../cups/ipp.h
 getputfile.64.o: getputfile.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-getputfile.64.o: getputfile.c  language.h array.h string-private.h ../config.h debug-private.h
+getputfile.64.o: getputfile.c  array.h language.h string-private.h ../config.h debug-private.h
 getputfile.64.o: getputfile.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 getputfile.64.o: getputfile.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 getputfile.64.o: getputfile.c  language-private.h ../cups/transcode.h thread-private.h
 globals.64.o: globals.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-globals.64.o: globals.c  language.h array.h string-private.h ../config.h debug-private.h
+globals.64.o: globals.c  array.h language.h string-private.h ../config.h debug-private.h
 globals.64.o: globals.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 globals.64.o: globals.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 globals.64.o: globals.c  language-private.h ../cups/transcode.h thread-private.h
 http.64.o: http.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-http.64.o: http.c  language.h array.h string-private.h ../config.h debug-private.h
+http.64.o: http.c  array.h language.h string-private.h ../config.h debug-private.h
 http.64.o: http.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 http.64.o: http.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 http.64.o: http.c  language-private.h ../cups/transcode.h thread-private.h
 http-addr.64.o: http-addr.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-http-addr.64.o: http-addr.c  language.h array.h string-private.h ../config.h debug-private.h
+http-addr.64.o: http-addr.c  array.h language.h string-private.h ../config.h debug-private.h
 http-addr.64.o: http-addr.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 http-addr.64.o: http-addr.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 http-addr.64.o: http-addr.c  language-private.h ../cups/transcode.h thread-private.h
 http-addrlist.64.o: http-addrlist.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h
-http-addrlist.64.o: http-addrlist.c  http.h language.h array.h string-private.h ../config.h
+http-addrlist.64.o: http-addrlist.c  http.h array.h language.h string-private.h ../config.h
 http-addrlist.64.o: http-addrlist.c  debug-private.h ppd-private.h ../cups/ppd.h cups.h
 http-addrlist.64.o: http-addrlist.c  pwg-private.h http-private.h ../cups/http.h md5-private.h
 http-addrlist.64.o: http-addrlist.c  ipp-private.h ../cups/ipp.h language-private.h
 http-addrlist.64.o: http-addrlist.c  ../cups/transcode.h thread-private.h
 http-support.64.o: http-support.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h
-http-support.64.o: http-support.c  http.h language.h array.h string-private.h ../config.h
+http-support.64.o: http-support.c  http.h array.h language.h string-private.h ../config.h
 http-support.64.o: http-support.c  debug-private.h ppd-private.h ../cups/ppd.h cups.h
 http-support.64.o: http-support.c  pwg-private.h http-private.h ../cups/http.h md5-private.h
 http-support.64.o: http-support.c  ipp-private.h ../cups/ipp.h language-private.h
 http-support.64.o: http-support.c  ../cups/transcode.h thread-private.h
-ipp.64.o: ipp.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-ipp.64.o: ipp.c  language.h array.h string-private.h ../config.h debug-private.h
-ipp.64.o: ipp.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
-ipp.64.o: ipp.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
-ipp.64.o: ipp.c  language-private.h ../cups/transcode.h thread-private.h
+ipp.64.o: ipp.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h array.h
+ipp.64.o: ipp.c  language.h string-private.h ../config.h debug-private.h ppd-private.h
+ipp.64.o: ipp.c  ../cups/ppd.h cups.h pwg-private.h http-private.h ../cups/http.h
+ipp.64.o: ipp.c  md5-private.h ipp-private.h ../cups/ipp.h language-private.h
+ipp.64.o: ipp.c  ../cups/transcode.h thread-private.h
 ipp-support.64.o: ipp-support.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-ipp-support.64.o: ipp-support.c  language.h array.h string-private.h ../config.h
+ipp-support.64.o: ipp-support.c  array.h language.h string-private.h ../config.h
 ipp-support.64.o: ipp-support.c  debug-private.h ppd-private.h ../cups/ppd.h cups.h
 ipp-support.64.o: ipp-support.c  pwg-private.h http-private.h ../cups/http.h md5-private.h
 ipp-support.64.o: ipp-support.c  ipp-private.h ../cups/ipp.h language-private.h
 ipp-support.64.o: ipp-support.c  ../cups/transcode.h thread-private.h
 langprintf.64.o: langprintf.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-langprintf.64.o: langprintf.c  language.h array.h string-private.h ../config.h debug-private.h
+langprintf.64.o: langprintf.c  array.h language.h string-private.h ../config.h debug-private.h
 langprintf.64.o: langprintf.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 langprintf.64.o: langprintf.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 langprintf.64.o: langprintf.c  language-private.h ../cups/transcode.h thread-private.h
 language.64.o: language.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-language.64.o: language.c  language.h array.h string-private.h ../config.h debug-private.h
+language.64.o: language.c  array.h language.h string-private.h ../config.h debug-private.h
 language.64.o: language.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 language.64.o: language.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 language.64.o: language.c  language-private.h ../cups/transcode.h thread-private.h
 localize.64.o: localize.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-localize.64.o: localize.c  language.h array.h string-private.h ../config.h debug-private.h
+localize.64.o: localize.c  array.h language.h string-private.h ../config.h debug-private.h
 localize.64.o: localize.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 localize.64.o: localize.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 localize.64.o: localize.c  language-private.h ../cups/transcode.h thread-private.h
 mark.64.o: mark.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-mark.64.o: mark.c  language.h array.h string-private.h ../config.h debug-private.h
+mark.64.o: mark.c  array.h language.h string-private.h ../config.h debug-private.h
 mark.64.o: mark.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 mark.64.o: mark.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 mark.64.o: mark.c  language-private.h ../cups/transcode.h thread-private.h
@@ -615,42 +623,46 @@ md5.64.o: md5.c  md5-private.h string-private.h ../config.h
 md5passwd.64.o: md5passwd.c  http-private.h ../config.h ../cups/http.h md5-private.h
 md5passwd.64.o: md5passwd.c  ipp-private.h ../cups/ipp.h string-private.h
 notify.64.o: notify.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-notify.64.o: notify.c  language.h array.h string-private.h ../config.h debug-private.h
+notify.64.o: notify.c  array.h language.h string-private.h ../config.h debug-private.h
 notify.64.o: notify.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 notify.64.o: notify.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 notify.64.o: notify.c  language-private.h ../cups/transcode.h thread-private.h
-options.64.o: options.c  cups.h string-private.h ../config.h debug-private.h
+options.64.o: options.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
+options.64.o: options.c  array.h language.h string-private.h ../config.h debug-private.h
+options.64.o: options.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
+options.64.o: options.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
+options.64.o: options.c  language-private.h ../cups/transcode.h thread-private.h
 page.64.o: page.c  string-private.h ../config.h debug-private.h ppd.h cups.h array.h
 page.64.o: page.c  versioning.h file.h
-ppd.64.o: ppd.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-ppd.64.o: ppd.c  language.h array.h string-private.h ../config.h debug-private.h
-ppd.64.o: ppd.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
-ppd.64.o: ppd.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
-ppd.64.o: ppd.c  language-private.h ../cups/transcode.h thread-private.h
+ppd.64.o: ppd.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h array.h
+ppd.64.o: ppd.c  language.h string-private.h ../config.h debug-private.h ppd-private.h
+ppd.64.o: ppd.c  ../cups/ppd.h cups.h pwg-private.h http-private.h ../cups/http.h
+ppd.64.o: ppd.c  md5-private.h ipp-private.h ../cups/ipp.h language-private.h
+ppd.64.o: ppd.c  ../cups/transcode.h thread-private.h
 pwg-file.64.o: pwg-file.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-pwg-file.64.o: pwg-file.c  language.h array.h string-private.h ../config.h debug-private.h
+pwg-file.64.o: pwg-file.c  array.h language.h string-private.h ../config.h debug-private.h
 pwg-file.64.o: pwg-file.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 pwg-file.64.o: pwg-file.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 pwg-file.64.o: pwg-file.c  language-private.h ../cups/transcode.h thread-private.h
 pwg-media.64.o: pwg-media.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-pwg-media.64.o: pwg-media.c  language.h array.h string-private.h ../config.h debug-private.h
+pwg-media.64.o: pwg-media.c  array.h language.h string-private.h ../config.h debug-private.h
 pwg-media.64.o: pwg-media.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 pwg-media.64.o: pwg-media.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 pwg-media.64.o: pwg-media.c  language-private.h ../cups/transcode.h thread-private.h
 pwg-ppd.64.o: pwg-ppd.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-pwg-ppd.64.o: pwg-ppd.c  language.h array.h string-private.h ../config.h debug-private.h
+pwg-ppd.64.o: pwg-ppd.c  array.h language.h string-private.h ../config.h debug-private.h
 pwg-ppd.64.o: pwg-ppd.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 pwg-ppd.64.o: pwg-ppd.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 pwg-ppd.64.o: pwg-ppd.c  language-private.h ../cups/transcode.h thread-private.h
 request.64.o: request.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-request.64.o: request.c  language.h array.h string-private.h ../config.h debug-private.h
+request.64.o: request.c  array.h language.h string-private.h ../config.h debug-private.h
 request.64.o: request.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 request.64.o: request.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 request.64.o: request.c  language-private.h ../cups/transcode.h thread-private.h
 sidechannel.64.o: sidechannel.c  sidechannel.h versioning.h string-private.h ../config.h
 sidechannel.64.o: sidechannel.c  debug-private.h
 snmp.64.o: snmp.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-snmp.64.o: snmp.c  language.h array.h string-private.h ../config.h debug-private.h
+snmp.64.o: snmp.c  array.h language.h string-private.h ../config.h debug-private.h
 snmp.64.o: snmp.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 snmp.64.o: snmp.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 snmp.64.o: snmp.c  language-private.h ../cups/transcode.h thread-private.h
@@ -659,27 +671,27 @@ snprintf.64.o: snprintf.c  string-private.h ../config.h
 string.64.o: string.c  string-private.h ../config.h debug-private.h thread-private.h
 string.64.o: string.c  array.h versioning.h
 tempfile.64.o: tempfile.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-tempfile.64.o: tempfile.c  language.h array.h string-private.h ../config.h debug-private.h
+tempfile.64.o: tempfile.c  array.h language.h string-private.h ../config.h debug-private.h
 tempfile.64.o: tempfile.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 tempfile.64.o: tempfile.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 tempfile.64.o: tempfile.c  language-private.h ../cups/transcode.h thread-private.h
 thread.64.o: thread.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-thread.64.o: thread.c  language.h array.h string-private.h ../config.h debug-private.h
+thread.64.o: thread.c  array.h language.h string-private.h ../config.h debug-private.h
 thread.64.o: thread.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 thread.64.o: thread.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 thread.64.o: thread.c  language-private.h ../cups/transcode.h thread-private.h
 transcode.64.o: transcode.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-transcode.64.o: transcode.c  language.h array.h string-private.h ../config.h debug-private.h
+transcode.64.o: transcode.c  array.h language.h string-private.h ../config.h debug-private.h
 transcode.64.o: transcode.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 transcode.64.o: transcode.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 transcode.64.o: transcode.c  language-private.h ../cups/transcode.h thread-private.h
 usersys.64.o: usersys.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-usersys.64.o: usersys.c  language.h array.h string-private.h ../config.h debug-private.h
+usersys.64.o: usersys.c  array.h language.h string-private.h ../config.h debug-private.h
 usersys.64.o: usersys.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 usersys.64.o: usersys.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 usersys.64.o: usersys.c  language-private.h ../cups/transcode.h thread-private.h
 util.64.o: util.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-util.64.o: util.c  language.h array.h string-private.h ../config.h debug-private.h
+util.64.o: util.c  array.h language.h string-private.h ../config.h debug-private.h
 util.64.o: util.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 util.64.o: util.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 util.64.o: util.c  language-private.h ../cups/transcode.h thread-private.h
@@ -698,25 +710,25 @@ testi18n.64.o: testi18n.c  ../cups/transcode.h language.h array.h versioning.h
 testipp.64.o: testipp.c  file.h versioning.h string-private.h ../config.h ipp-private.h
 testipp.64.o: testipp.c  ../cups/ipp.h
 testoptions.64.o: testoptions.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-testoptions.64.o: testoptions.c  language.h array.h string-private.h ../config.h
+testoptions.64.o: testoptions.c  array.h language.h string-private.h ../config.h
 testoptions.64.o: testoptions.c  debug-private.h ppd-private.h ../cups/ppd.h cups.h
 testoptions.64.o: testoptions.c  pwg-private.h http-private.h ../cups/http.h md5-private.h
 testoptions.64.o: testoptions.c  ipp-private.h ../cups/ipp.h language-private.h
 testoptions.64.o: testoptions.c  ../cups/transcode.h thread-private.h
 testlang.64.o: testlang.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-testlang.64.o: testlang.c  language.h array.h string-private.h ../config.h debug-private.h
+testlang.64.o: testlang.c  array.h language.h string-private.h ../config.h debug-private.h
 testlang.64.o: testlang.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 testlang.64.o: testlang.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 testlang.64.o: testlang.c  language-private.h ../cups/transcode.h thread-private.h
 testppd.64.o: testppd.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-testppd.64.o: testppd.c  language.h array.h string-private.h ../config.h debug-private.h
+testppd.64.o: testppd.c  array.h language.h string-private.h ../config.h debug-private.h
 testppd.64.o: testppd.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 testppd.64.o: testppd.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 testppd.64.o: testppd.c  language-private.h ../cups/transcode.h thread-private.h
-testpwg.64.o: testpwg.c  ppd-private.h ../cups/ppd.h cups.h array.h versioning.h file.h
-testpwg.64.o: testpwg.c  pwg-private.h ../cups/cups.h ipp.h http.h language.h
+testpwg.64.o: testpwg.c  ppd-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
+testpwg.64.o: testpwg.c  array.h language.h ../cups/ppd.h cups.h pwg-private.h
 testsnmp.64.o: testsnmp.c  cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h
-testsnmp.64.o: testsnmp.c  language.h array.h string-private.h ../config.h debug-private.h
+testsnmp.64.o: testsnmp.c  array.h language.h string-private.h ../config.h debug-private.h
 testsnmp.64.o: testsnmp.c  ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h
 testsnmp.64.o: testsnmp.c  ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h
 testsnmp.64.o: testsnmp.c  language-private.h ../cups/transcode.h thread-private.h
index d0121a71ec7785e381ff50e764176697c5c021c2..68efcfd44fb5b0cb452e29cdf0a6efeddd0a312f 100644 (file)
@@ -240,7 +240,7 @@ cupsAdminCreateWindowsPPD(
     }
     else if (jcloption && !strncmp(line, "*OrderDependency:", 17))
     {
-      for (ptr = line + 17; *ptr && isspace(*ptr & 255); ptr ++);
+      for (ptr = line + 17; _cups_isspace(*ptr); ptr ++);
 
       ptr = strchr(ptr, ' ');
 
@@ -1066,7 +1066,7 @@ cupsAdminGetServerSettings(
 
        while (*value)
        {
-         for (valptr = value; !isspace(*valptr & 255) && *valptr; valptr ++);
+         for (valptr = value; *valptr && !_cups_isspace(*valptr); valptr ++);
 
          if (*valptr)
            *valptr++ = '\0';
@@ -1077,7 +1077,7 @@ cupsAdminGetServerSettings(
            break;
          }
 
-          for (value = valptr; isspace(*value & 255); value ++);
+          for (value = valptr; _cups_isspace(*value); value ++);
        }
       }
       else if (!strcasecmp(line, "</Limit>"))
@@ -1460,7 +1460,7 @@ cupsAdminSetServerSettings(
   while (cupsFileGetConf(cupsd, line, sizeof(line), &value, &linenum))
   {
     if ((!strcasecmp(line, "Port") || !strcasecmp(line, "Listen")) &&
-        (remote_admin >= 0 || remote_any > 0 || share_printers >= 0))
+        (remote_admin >= 0 || remote_any >= 0 || share_printers >= 0))
     {
       if (!wrote_port_listen)
       {
@@ -1704,83 +1704,86 @@ cupsAdminSetServerSettings(
 
       cupsFilePuts(temp, "</Location>\n");
     }
-    else if (!strcasecmp(line, "<Limit") && in_default_policy)
+    else if (!strcasecmp(line, "<Limit"))
     {
-     /*
-      * See if the policy limit is for the Cancel-Job operation...
-      */
-
-      char     *valptr;                /* Pointer into value */
-
-
-      indent += 2;
-
-      if (!strcasecmp(value, "cancel-job") && user_cancel_any >= 0)
+      if (in_default_policy)
       {
        /*
-       * Don't write anything for this limit section...
+       * See if the policy limit is for the Cancel-Job operation...
        */
-
-       in_cancel_job = 2;
-      }
-      else
-      {
-       cupsFilePrintf(temp, "  %s", line);
-
-       while (*value)
+  
+       char    *valptr;                /* Pointer into value */
+  
+  
+       if (!strcasecmp(value, "cancel-job") && user_cancel_any >= 0)
        {
-         for (valptr = value; !isspace(*valptr & 255) && *valptr; valptr ++);
-
-         if (*valptr)
-           *valptr++ = '\0';
-
-          if (!strcasecmp(value, "cancel-job") && user_cancel_any >= 0)
+        /*
+         * Don't write anything for this limit section...
+         */
+  
+         in_cancel_job = 2;
+       }
+       else
+       {
+         cupsFilePrintf(temp, "%*s%s", indent, "", line);
+  
+         while (*value)
          {
-          /*
-           * Write everything except for this definition...
-           */
-
-           in_cancel_job = 1;
+           for (valptr = value; *valptr && !_cups_isspace(*valptr); valptr ++);
+  
+           if (*valptr)
+             *valptr++ = '\0';
+  
+           if (!strcasecmp(value, "cancel-job") && user_cancel_any >= 0)
+           {
+            /*
+             * Write everything except for this definition...
+             */
+  
+             in_cancel_job = 1;
+           }
+           else
+             cupsFilePrintf(temp, " %s", value);
+  
+           for (value = valptr; _cups_isspace(*value); value ++);
          }
-         else
-           cupsFilePrintf(temp, " %s", value);
-
-          for (value = valptr; isspace(*value & 255); value ++);
+  
+         cupsFilePuts(temp, ">\n");
        }
-
-       cupsFilePuts(temp, ">\n");
       }
+      else
+        cupsFilePrintf(temp, "%*s%s %s>\n", indent, "", line, value);
+
+      indent += 2;
     }
     else if (!strcasecmp(line, "</Limit>") && in_cancel_job)
     {
       indent -= 2;
 
       if (in_cancel_job == 1)
-        cupsFilePuts(temp, "  </Limit>\n");
+       cupsFilePuts(temp, "  </Limit>\n");
 
       wrote_policy = 1;
 
       if (!user_cancel_any)
        cupsFilePuts(temp, "  # Only the owner or an administrator can cancel "
-                          "a job...\n"
-                          "  <Limit Cancel-Job>\n"
-                          "    Order deny,allow\n"
-                          "    Require user @OWNER "
+                          "a job...\n"
+                          "  <Limit Cancel-Job>\n"
+                          "    Order deny,allow\n"
+                          "    Require user @OWNER "
                           CUPS_DEFAULT_PRINTOPERATOR_AUTH "\n"
                           "  </Limit>\n");
 
       in_cancel_job = 0;
     }
     else if ((((in_admin_location || in_conf_location || in_root_location) &&
-               remote_admin >= 0) ||
+               (remote_admin >= 0 || remote_any >= 0)) ||
               (in_root_location && share_printers >= 0)) &&
              (!strcasecmp(line, "Allow") || !strcasecmp(line, "Deny") ||
              !strcasecmp(line, "Order")))
       continue;
     else if (in_cancel_job == 2)
       continue;
-    else if (!strcasecmp(line, "<Limit")  && value)
-      cupsFilePrintf(temp, "  %s %s>\n", line, value);
     else if (line[0] == '<')
     {
       if (value)
index fb65106f288c3abdcfeba15ec95855c4bb83a955..60d5918aa7f6c333e1a386c3968ec044e1426d80 100644 (file)
@@ -36,7 +36,7 @@
        Programming: <a href='api-raster.html' target='_top'>Raster API</a><br>
        Programming: <a href='postscript-driver.html' target='_top'>Developing PostScript Printer Drivers</a><br>
        Programming: <a href='raster-driver.html' target='_top'>Developing Raster Printer Drivers</a><br>
-       Specifications: <a href='spec-design' target='_top'>CUPS Design Description</a></td>
+       Specifications: <a href='spec-design.html' target='_top'>CUPS Design Description</a></td>
 </tr>
 </tbody>
 </table></div>
index d8dff2094469a95fe6a5c432c4a791d7cc4843c0..4e6fab68df0e336fc4c81fb59c8c8d65f005cc0a 100644 (file)
@@ -166,7 +166,7 @@ _ppdNormalizeMakeAndModel(
   * Skip leading whitespace...
   */
 
-  while (isspace(*make_and_model & 255))
+  while (_cups_isspace(*make_and_model))
     make_and_model ++;
 
  /*
@@ -321,7 +321,7 @@ _ppdNormalizeMakeAndModel(
   */
 
   for (bufptr = buffer + strlen(buffer) - 1;
-       bufptr >= buffer && isspace(*bufptr & 255);
+       bufptr >= buffer && _cups_isspace(*bufptr);
        bufptr --);
 
   bufptr[1] = '\0';
index b496ddeffa14e3b45affc977379c845a9687ae35..4d7facf4e1535e065dd9a275c9d1a3d36e10c6eb 100644 (file)
@@ -166,12 +166,6 @@ cupsDoAuthentication(
       return (-1);
     }
 
-    if (!password[0])
-    {
-      http->status = HTTP_AUTHORIZATION_CANCELED;
-      return (-1);
-    }
-
     snprintf(http->userpass, sizeof(http->userpass), "%s:%s", cupsUser(),
              password);
   }
@@ -247,7 +241,7 @@ cupsDoAuthentication(
     authorization = httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE);
 
     authorization += 9;
-    while (*authorization && isspace(*authorization & 255))
+    while (*authorization && _cups_isspace(*authorization))
       authorization ++;
 
     if (*authorization)
index 7e7a722688a6eaf98c291885e5329d96bbddf3b8..95c7b28ace1344c6d84ae80a4188050de4612646 100644 (file)
@@ -289,25 +289,25 @@ cupsResolveConflicts(
 
         for (resval = resolver->value; *resval && !changed;)
        {
-         while (isspace(*resval & 255))
+         while (_cups_isspace(*resval))
            resval ++;
 
          if (*resval != '*')
            break;
 
          for (resval ++, resptr = resoption;
-              *resval && !isspace(*resval & 255);
+              *resval && !_cups_isspace(*resval);
               resval ++)
             if (resptr < (resoption + sizeof(resoption) - 1))
              *resptr++ = *resval;
 
           *resptr = '\0';
 
-         while (isspace(*resval & 255))
+         while (_cups_isspace(*resval))
            resval ++;
 
          for (resptr = reschoice;
-              *resval && !isspace(*resval & 255);
+              *resval && !_cups_isspace(*resval);
               resval ++)
             if (resptr < (reschoice + sizeof(reschoice) - 1))
              *resptr++ = *resval;
@@ -886,20 +886,20 @@ ppd_load_constraints(ppd_file_t *ppd)     /* I - PPD file */
       * Extract "*Option Choice" or just "*Option"...
       */
 
-      for (vptr ++, ptr = option; *vptr && !isspace(*vptr & 255); vptr ++)
+      for (vptr ++, ptr = option; *vptr && !_cups_isspace(*vptr); vptr ++)
        if (ptr < (option + sizeof(option) - 1))
          *ptr++ = *vptr;
 
       *ptr = '\0';
 
-      while (isspace(*vptr & 255))
+      while (_cups_isspace(*vptr))
        vptr ++;
 
       if (*vptr == '*')
        choice[0] = '\0';
       else
       {
-       for (ptr = choice; *vptr && !isspace(*vptr & 255); vptr ++)
+       for (ptr = choice; *vptr && !_cups_isspace(*vptr); vptr ++)
          if (ptr < (choice + sizeof(choice) - 1))
            *ptr++ = *vptr;
 
index 051d3c4a907f82e9c3d55ea41a98e95c3c52b481..87c396d81891363c8a735d2391bd9976b1bb559f 100644 (file)
@@ -131,6 +131,17 @@ typedef struct _cups_globals_s             /**** CUPS global state data ****/
                        servername[256];/* Server hostname */
   cups_password_cb2_t  password_cb;    /* Password callback */
   void                 *password_data; /* Password user data */
+  http_tls_credentials_t tls_credentials;
+                                       /* Default client credentials */
+  cups_client_cert_cb_t        client_cert_cb; /* Client certificate callback */
+  void                 *client_cert_data;
+                                       /* Client certificate user data */
+  cups_server_cert_cb_t        server_cert_cb; /* Server certificate callback */
+  void                 *server_cert_data;
+                                       /* Server certificate user data */
+  int                  any_root,       /* Allow any root */
+                       expired_certs,  /* Allow expired certs */
+                       expired_root;   /* Allow expired root */
 
   /* util.c */
   char                 def_printer[256];
index d21f2bd40e14e20a0466b8c7030177ab6b0e8aab..f1ad1fb6348aade58c9daaaf28d4d013cab9ee9e 100644 (file)
@@ -169,6 +169,15 @@ typedef struct cups_job_s          /**** Job ****/
   time_t       processing_time;        /* Time the job was processed */
 } cups_job_t;
 
+typedef int (*cups_client_cert_cb_t)(http_t *http, void *tls,
+                                    cups_array_t *distinguished_names, 
+                                    void *user_data);
+                                       /**** Client credentials callback @since CUPS 1.5@ ****/
+
+typedef int (*cups_server_cert_cb_t)(http_t *http, void *tls,
+                                    cups_array_t *certs, void *user_data);
+                                       /**** Server credentials callback @since CUPS 1.5@ ****/
+
 
 /*
  * Functions...
@@ -317,6 +326,14 @@ extern http_status_t       cupsStartDocument(http_t *http, const char *name,
 extern http_status_t   cupsWriteRequestData(http_t *http, const char *buffer,
                                             size_t length) _CUPS_API_1_4;
 
+/**** New in CUPS 1.5 ****/
+extern void            cupsSetClientCertCB(cups_client_cert_cb_t cb,
+                                           void *user_data) _CUPS_API_1_5;
+extern int             cupsSetCredentials(cups_array_t *certs) _CUPS_API_1_5;
+extern void            cupsSetServerCertCB(cups_server_cert_cb_t cb,
+                                           void *user_data) _CUPS_API_1_5;
+
+
 #  ifdef __cplusplus
 }
 #  endif /* __cplusplus */
index 6d56f9b00138156a43217c7c5491d4a3b42d9786..c739fa68a0fd7797708864a91b505d3212ac7b7b 100644 (file)
@@ -54,14 +54,30 @@ extern "C" {
  * 7 = static functions
  * 8 = return values for static functions
  * 9 = progress for static functions
+ *
+ * The DEBUG_set macro allows an application to programmatically enable (or
+ * disable) debug logging.  The arguments correspond to the CUPS_DEBUG_LOG,
+ * CUPS_DEBUG_LEVEL, and CUPS_DEBUG_FILTER environment variables.
  */
 
 #  ifdef DEBUG
+#    ifdef WIN32
+#      ifdef LIBCUPS2_EXPORTS
+#        define DLLExport __declspec(dllexport)
+#      else
+#        define DLLExport
+#      endif /* LIBCUPS2_EXPORTS */
+#    else
+#      define DLLExport
+#    endif /* WIN32 */
 #    define DEBUG_puts(x) _cups_debug_puts(x)
 #    define DEBUG_printf(x) _cups_debug_printf x
+#    define DEBUG_set(logfile,level,filter) _cups_debug_set(logfile,level,filter,1)
 #  else
+#    define DLLExport
 #    define DEBUG_puts(x)
 #    define DEBUG_printf(x)
+#    define DEBUG_set(logfile,level,filter)
 #  endif /* DEBUG */
 
 
@@ -71,12 +87,15 @@ extern "C" {
 
 extern int     _cups_debug_fd;
 extern int     _cups_debug_level;
-extern void    _cups_debug_printf(const char *format, ...)
+extern void    DLLExport _cups_debug_printf(const char *format, ...)
 #ifdef __GNUC__
 __attribute__ ((__format__ (__printf__, 1, 2)))
 #endif /* __GNUC__ */
 ;
-extern void    _cups_debug_puts(const char *s);
+extern void    DLLExport _cups_debug_puts(const char *s);
+extern void    DLLExport _cups_debug_set(const char *logfile,
+                                         const char *level, const char *filter,
+                                         int force);
 
 #  ifdef __cplusplus
 }
index c119c67418e0b752aa445349d4671267e68567f1..29d6b4821f44d36512b1586f091be96ab3b9ee59 100644 (file)
@@ -18,6 +18,7 @@
  *   debug_vsnprintf()    - Format a string into a fixed size buffer.
  *   _cups_debug_printf() - Write a formatted line to the log.
  *   _cups_debug_puts()   - Write a single line to the log.
+ *   _cups_debug_set()    - Enable or disable debug logging.
  */
 
 /*
 #include "cups-private.h"
 #include "thread-private.h"
 #ifdef WIN32
+#  include <sys/timeb.h>
+#  include <time.h>
 #  include <io.h>
+#  define getpid (int)GetCurrentProcessId
+static int                             /* O  - 0 on success, -1 on failure */
+gettimeofday(struct timeval    *tv,    /* I  - Timeval struct */
+             void              *tz)    /* I  - Timezone */
+{   
+  struct _timeb timebuffer;            /* Time buffer struct */
+  _ftime(&timebuffer);
+  tv->tv_sec  = (long)timebuffer.time;
+  tv->tv_usec = timebuffer.millitm * 1000;  
+  return 0;
+}
 #else
 #  include <sys/time.h>
 #  include <unistd.h>
 #endif /* WIN32 */
 #include <fcntl.h>
-#ifndef WIN32
-#  include <regex.h>
-#endif /* WIN32 */
+#include <regex.h>
 
 
 /*
@@ -53,10 +65,8 @@ int                  _cups_debug_level = 1;
  * Local globals...
  */
 
-#  ifndef WIN32
 static regex_t         *debug_filter = NULL;
                                        /* Filter expression for messages */
-#  endif /* !WIN32 */
 static int             debug_init = 0; /* Did we initialize debugging? */
 static _cups_mutex_t   debug_mutex = _CUPS_MUTEX_INITIALIZER;
                                        /* Mutex to control initialization */
@@ -396,7 +406,7 @@ debug_vsnprintf(char       *buffer, /* O - Output buffer */
  * '_cups_debug_printf()' - Write a formatted line to the log.
  */
 
-void
+void DLLExport
 _cups_debug_printf(const char *format, /* I - Printf-style format string */
                    ...)                        /* I - Additional arguments as needed */
 {
@@ -405,11 +415,6 @@ _cups_debug_printf(const char *format,     /* I - Printf-style format string */
   char                 buffer[2048];   /* Output buffer */
   size_t               bytes;          /* Number of bytes in buffer */
   int                  level;          /* Log level in message */
-  const char           *cups_debug_filter,
-                                       /* CUPS_DEBUG_FILTER environment variable */
-                       *cups_debug_level,
-                                       /* CUPS_DEBUG_LEVEL environment variable */
-                       *cups_debug_log;/* CUPS_DEBUG_LOG environment variable */
 
 
  /*
@@ -417,52 +422,8 @@ _cups_debug_printf(const char *format,     /* I - Printf-style format string */
   */
 
   if (!debug_init)
-  {
-   /*
-    * Get a lock on the debug initializer, then re-check in case another
-    * thread already did it...
-    */
-
-    _cupsMutexLock(&debug_mutex);
-
-    if (!debug_init)
-    {
-      if ((cups_debug_log = getenv("CUPS_DEBUG_LOG")) == NULL)
-       _cups_debug_fd = -1;
-      else if (!strcmp(cups_debug_log, "-"))
-       _cups_debug_fd = 2;
-      else
-      {
-       snprintf(buffer, sizeof(buffer), cups_debug_log, getpid());
-
-       if (buffer[0] == '+')
-         _cups_debug_fd = open(buffer + 1, O_WRONLY | O_APPEND | O_CREAT, 0644);
-       else
-         _cups_debug_fd = open(buffer, O_WRONLY | O_TRUNC | O_CREAT, 0644);
-      }
-
-      if ((cups_debug_level = getenv("CUPS_DEBUG_LEVEL")) != NULL)
-       _cups_debug_level = atoi(cups_debug_level);
-
-      if ((cups_debug_filter = getenv("CUPS_DEBUG_FILTER")) != NULL)
-      {
-        if ((debug_filter = (regex_t *)calloc(1, sizeof(regex_t))) == NULL)
-         fputs("Unable to allocate memory for CUPS_DEBUG_FILTER - results not "
-               "filtered!\n", stderr);
-       else if (regcomp(debug_filter, cups_debug_filter, REG_EXTENDED))
-       {
-         fputs("Bad regular expression in CUPS_DEBUG_FILTER - results not "
-               "filtered!\n", stderr);
-         free(debug_filter);
-         debug_filter = NULL;
-       }
-      }
-
-      debug_init = 1;
-    }
-
-    _cupsMutexUnlock(&debug_mutex);
-  }
+    _cups_debug_set(getenv("CUPS_DEBUG_LOG"), getenv("CUPS_DEBUG_LEVEL"),
+                    getenv("CUPS_DEBUG_FILTER"), 0);
 
   if (_cups_debug_fd < 0)
     return;
@@ -525,11 +486,12 @@ _cups_debug_printf(const char *format,    /* I - Printf-style format string */
  * '_cups_debug_puts()' - Write a single line to the log.
  */
 
-void
+void DLLExport
 _cups_debug_puts(const char *s)                /* I - String to output */
 {
   char format[4];                      /* C%s */
 
+
   format[0] = *s++;
   format[1] = '%';
   format[2] = 's';
@@ -537,6 +499,82 @@ _cups_debug_puts(const char *s)            /* I - String to output */
 
   _cups_debug_printf(format, s);
 }
+
+
+/*
+ * '_cups_debug_set()' - Enable or disable debug logging.
+ */
+
+void DLLExport
+_cups_debug_set(const char *logfile,   /* I - Log file or NULL */
+                const char *level,     /* I - Log level or NULL */
+               const char *filter,     /* I - Filter string or NULL */
+               int        force)       /* I - Force initialization */
+{
+  _cupsMutexLock(&debug_mutex);
+
+  if (!debug_init || force)
+  {
+   /*
+    * Restore debug settings to defaults...
+    */
+
+    if (_cups_debug_fd != -1)
+    {
+      close(_cups_debug_fd);
+      _cups_debug_fd = -1;
+    }
+
+    if (debug_filter)
+    {
+      regfree((regex_t *)debug_filter);
+      debug_filter = NULL;
+    }
+
+    _cups_debug_level = 1;
+
+   /*
+    * Open logs, set log levels, etc.
+    */
+
+    if (!logfile)
+      _cups_debug_fd = -1;
+    else if (!strcmp(logfile, "-"))
+      _cups_debug_fd = 2;
+    else
+    {
+      char     buffer[1024];           /* Filename buffer */
+
+      snprintf(buffer, sizeof(buffer), logfile, getpid());
+
+      if (buffer[0] == '+')
+       _cups_debug_fd = open(buffer + 1, O_WRONLY | O_APPEND | O_CREAT, 0644);
+      else
+       _cups_debug_fd = open(buffer, O_WRONLY | O_TRUNC | O_CREAT, 0644);
+    }
+
+    if (level)
+      _cups_debug_level = atoi(level);
+
+    if (filter)
+    {
+      if ((debug_filter = (regex_t *)calloc(1, sizeof(regex_t))) == NULL)
+       fputs("Unable to allocate memory for CUPS_DEBUG_FILTER - results not "
+             "filtered!\n", stderr);
+      else if (regcomp(debug_filter, filter, REG_EXTENDED))
+      {
+       fputs("Bad regular expression in CUPS_DEBUG_FILTER - results not "
+             "filtered!\n", stderr);
+       free(debug_filter);
+       debug_filter = NULL;
+      }
+    }
+
+    debug_init = 1;
+  }
+
+  _cupsMutexUnlock(&debug_mutex);
+}
 #endif /* DEBUG */
 
 
index 98cba04d393abc883cbeec2a09772c90515b582a..551dc73418fd6a5571579ba7ec54a2ead5923cad 100644 (file)
@@ -502,7 +502,19 @@ cupsGetNamedDest(http_t     *http, /* I - Connection to server or @code CUPS_HTT
     set_as_default = 1;
     name           = _cupsUserDefault(defname, sizeof(defname));
 
-    if (!name && home)
+    if (name)
+    {
+      char     *ptr;                   /* Temporary pointer... */
+
+      if ((ptr = strchr(defname, '/')) != NULL)
+      {
+        *ptr++   = '\0';
+       instance = ptr;
+      }
+      else
+        instance = NULL;
+    }
+    else if (home)
     {
      /*
       * No default in the environment, try the user's lpoptions files...
index 67349595b437b3567ba4cb1fb808cc14022f2edd..94a2a9b5b9e80e0f78bb0b4485e720a326690255 100644 (file)
@@ -200,7 +200,7 @@ cupsDirRead(cups_dir_t *dp)         /* I - Directory pointer */
   dp->entry.fileinfo.st_atime = _cups_dir_time(entry.ftLastAccessTime);
   dp->entry.fileinfo.st_ctime = _cups_dir_time(entry.ftCreationTime);
   dp->entry.fileinfo.st_mtime = _cups_dir_time(entry.ftLastWriteTime);
-  dp->entry.fileinfo.st_size  = entry.nFileSizeLow + (entry.nFileSizeHigh << 32);
+  dp->entry.fileinfo.st_size  = entry.nFileSizeLow + ((unsigned long long)entry.nFileSizeHigh << 32);
 
  /*
   * Return the entry...
index 60da1f9a1492c2805c20880338c7da83bfcc2fb8..438f4cd455b74c3b5860cfcee3d0a2e5910a4ebc 100644 (file)
@@ -479,7 +479,8 @@ ppdEmitJCL(ppd_file_t *ppd,         /* I - PPD file record */
       */
 
       for (title += 7; *title && isdigit(*title & 255); title ++);
-      for (; *title && isspace(*title & 255); title ++);
+      while (_cups_isspace(*title))
+        title ++;
 
       if ((ptr = strstr(title, " - ")) != NULL)
       {
index dfce906aa91e95ad04c86dc6301b95c27658800d..392f57295f602695271487a0020214cfed7ae608 100644 (file)
@@ -120,6 +120,7 @@ static const _ipp_option_t ipp_options[] =
   { 0, "penwidth",             IPP_TAG_INTEGER,        IPP_TAG_JOB },
   { 0, "penwidth-default",     IPP_TAG_INTEGER,        IPP_TAG_PRINTER },
   { 0, "port-monitor",         IPP_TAG_NAME,           IPP_TAG_PRINTER },
+  { 0, "ppd-name",             IPP_TAG_NAME,           IPP_TAG_PRINTER },
   { 0, "ppi",                  IPP_TAG_INTEGER,        IPP_TAG_JOB },
   { 0, "ppi-default",          IPP_TAG_INTEGER,        IPP_TAG_PRINTER },
   { 0, "prettyprint",          IPP_TAG_BOOLEAN,        IPP_TAG_JOB },
index 68fb118928b1f7da71e38b52e519a1cb554bb019..b788b72393e7b32461b44d399f901ec10dd0cde5 100644 (file)
@@ -494,7 +494,7 @@ cupsFileGetConf(cups_file_t *fp,    /* I  - CUPS file */
         // Strip the comment and any trailing whitespace...
        while (ptr > buf)
        {
-         if (!isspace(ptr[-1] & 255))
+         if (!_cups_isspace(ptr[-1]))
            break;
 
          ptr --;
@@ -508,7 +508,7 @@ cupsFileGetConf(cups_file_t *fp,    /* I  - CUPS file */
     * Strip leading whitespace...
     */
 
-    for (ptr = buf; isspace(*ptr & 255); ptr ++);
+    for (ptr = buf; _cups_isspace(*ptr); ptr ++);
 
     if (ptr > buf)
       _cups_strcpy(buf, ptr);
@@ -524,7 +524,7 @@ cupsFileGetConf(cups_file_t *fp,    /* I  - CUPS file */
       */
 
       for (ptr = buf; *ptr; ptr ++)
-        if (isspace(*ptr & 255))
+        if (_cups_isspace(*ptr))
          break;
 
       if (*ptr)
@@ -533,7 +533,7 @@ cupsFileGetConf(cups_file_t *fp,    /* I  - CUPS file */
         * Have a value, skip any other spaces...
        */
 
-        while (isspace(*ptr & 255))
+        while (_cups_isspace(*ptr))
          *ptr++ = '\0';
 
         if (*ptr)
@@ -557,7 +557,7 @@ cupsFileGetConf(cups_file_t *fp,    /* I  - CUPS file */
          return (buf);
        }
 
-        while (ptr > *value && isspace(*ptr & 255))
+        while (ptr > *value && _cups_isspace(*ptr))
          *ptr-- = '\0';
       }
 
index 3d678d427ad08bffb0a5336c0602ae0d19fa9af3..00f74c316c07f0d2ca8692de3335bfbd40d87a1c 100644 (file)
@@ -202,8 +202,11 @@ cups_globals_alloc(void)
   */
 
   memset(cg, 0, sizeof(_cups_globals_t));
-  cg->encryption  = (http_encryption_t)-1;
-  cg->password_cb = (cups_password_cb2_t)_cupsGetPassword;
+  cg->encryption    = (http_encryption_t)-1;
+  cg->password_cb   = (cups_password_cb2_t)_cupsGetPassword;
+  cg->any_root      = 1;
+  cg->expired_certs = 1;
+  cg->expired_root  = 1;
 
  /*
   * Then set directories as appropriate...
@@ -316,13 +319,13 @@ cups_globals_free(_cups_globals_t *cg)    /* I - Pointer to global data */
 
   httpClose(cg->http);
 
+  _httpFreeCredentials(cg->tls_credentials);
+
   cupsFileClose(cg->stdio_files[0]);
   cupsFileClose(cg->stdio_files[1]);
   cupsFileClose(cg->stdio_files[2]);
 
-#  ifndef CUPS_LITE
   cupsFreeOptions(cg->cupsd_num_settings, cg->cupsd_settings);
-#  endif /* !CUPS_LITE */
 
   free(cg);
 }
index ddf8079b4d9f58d1b921807e5b430a29f754bb92..14406427dde3cfd2fa6986271d3ec6045bc03f06 100644 (file)
@@ -102,6 +102,16 @@ httpAddrConnect(
     setsockopt(*sock, SOL_SOCKET, SO_NOSIGPIPE, &val, sizeof(val));
 #endif /* SO_NOSIGPIPE */
 
+#ifdef __APPLE__
+   /*
+    * Use a 30-second read timeout when connecting to limit the amount of time
+    * we block...
+    */
+
+    val = 30;
+    setsockopt(*sock, SOL_SOCKET, SO_RCVTIMEO, &val, sizeof(val));
+#endif /* __APPLE__ */
+
    /*
     * Using TCP_NODELAY improves responsiveness, especially on systems
     * with a slow loopback interface...
@@ -154,6 +164,9 @@ httpAddrConnect(
     addrlist = addrlist->next;
   }
 
+  if (!addrlist)
+    _cupsSetError(HTTP_SERVICE_UNAVAILABLE, _("Unable to connect to server"), 1);
+
   return (addrlist);
 }
 
index 78ebdf930f9b89da0e6967749aafe1901fbaa556..0700530bdf84775c9f90031caf99ef4a5850bbd4 100644 (file)
@@ -90,7 +90,8 @@ typedef int socklen_t;
 #    include <openssl/rand.h>
 #    include <openssl/ssl.h>
 
-typedef SSL http_tls_t;
+typedef SSL  *http_tls_t;
+typedef void *http_tls_credentials_t;
 
 extern BIO_METHOD *_httpBIOMethods(void);
 
@@ -99,13 +100,11 @@ extern BIO_METHOD *_httpBIOMethods(void);
  * The GNU TLS library is more of a "bare metal" SSL/TLS library...
  */
 #    include <gnutls/gnutls.h>
+#    include <gnutls/x509.h>
 #    include <gcrypt.h>
 
-typedef struct
-{
-  gnutls_session       session;        /* GNU TLS session object */
-  void                 *credentials;   /* GNU TLS credentials object */
-} http_tls_t;
+typedef gnutls_session http_tls_t;
+typedef void *http_tls_credentials_t;
 
 extern ssize_t _httpReadGNUTLS(gnutls_transport_ptr ptr, void *data,
                                size_t length);
@@ -118,13 +117,43 @@ extern ssize_t    _httpWriteGNUTLS(gnutls_transport_ptr ptr, const void *data,
  * for its IO and protocol management...
  */
 
+#    include <CoreFoundation/CoreFoundation.h>
+#    include <Security/Security.h>
 #    include <Security/SecureTransport.h>
-
-typedef struct                         /**** CDSA connection information ****/
-{
-  SSLContextRef                session;        /* CDSA session object */
-  CFArrayRef           certsArray;     /* Certificates array */
-} http_tls_t;
+#    include <Security/SecItem.h>
+#    ifdef HAVE_SECBASEPRIV_H
+#      include <Security/SecBasePriv.h>
+#    elif defined(HAVE_CSSMERRORSTRING) /* Declare prototype for function in that header... */
+extern const char *cssmErrorString(int error);
+#    endif /* HAVE_SECBASEPRIV_H */
+#    ifdef HAVE_SECCERTIFICATE_H
+#      include <Security/SecCertificate.h>
+#      include <Security/SecIdentity.h>
+#    endif /* HAVE_SECCERTIFICATE_H */
+#    ifdef HAVE_SECITEMPRIV_H
+#      include <Security/SecItemPriv.h>
+#    else /* Declare constants from that header... */
+extern const CFTypeRef kSecClassCertificate;
+extern const CFTypeRef kSecClassIdentity;
+#    endif /* HAVE_SECITEMPRIV_H */
+#    ifdef HAVE_SECIDENTITYSEARCHPRIV_H
+#      include <Security/SecIdentitySearchPriv.h>
+#    elif defined(HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY) /* Declare prototype for function in that header... */
+extern OSStatus SecIdentitySearchCreateWithPolicy(SecPolicyRef policy,
+                               CFStringRef idString, CSSM_KEYUSE keyUsage,
+                               CFTypeRef keychainOrArray,
+                               Boolean returnOnlyValidIdentities,
+                               SecIdentitySearchRef* searchRef);
+#    endif /* HAVE_SECIDENTITYSEARCHPRIV_H */
+#    ifdef HAVE_SECPOLICYPRIV_H
+#      include <Security/SecPolicyPriv.h>
+#    elif defined(HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY) /* Declare prototype for function in that header... */
+extern OSStatus SecPolicySetValue(SecPolicyRef policyRef,
+                                  const CSSM_DATA *value);
+#    endif /* HAVE_SECPOLICYPRIV_H */
+
+typedef SSLContextRef  http_tls_t;
+typedef CFArrayRef     http_tls_credentials_t;
 
 extern OSStatus        _httpReadCDSA(SSLConnectionRef connection, void *data,
                              size_t *dataLength);
@@ -133,6 +162,10 @@ extern OSStatus    _httpWriteCDSA(SSLConnectionRef connection, const void *data,
 
 #  elif defined(HAVE_SSPISSL)
 #    include "sspi-private.h"
+typedef _sspi_struct_t * http_tls_t;
+typedef void *http_tls_credentials_t;
+#  else
+typedef void *http_tls_t;
 #  endif /* HAVE_LIBSSL */
 
 
@@ -162,7 +195,7 @@ struct _http_s                              /**** HTTP connection structure. ****/
   char                 nonce[HTTP_MAX_VALUE];
                                        /* Nonce value */
   int                  nonce_count;    /* Nonce count */
-  void                 *tls;           /* TLS state information */
+  http_tls_t           tls;            /* TLS state information */
   http_encryption_t    encryption;     /* Encryption requirements */
   /**** New in CUPS 1.1.19 ****/
   fd_set               *input_set;     /* select() set for httpWait() @deprecated@ */
@@ -193,6 +226,9 @@ struct _http_s                              /**** HTTP connection structure. ****/
 #  ifdef HAVE_AUTHORIZATION_H
   AuthorizationRef     auth_ref;       /* Authorization ref */
 #  endif /* HAVE_AUTHORIZATION_H */
+  /**** New in CUPS 1.5 ****/
+  http_tls_credentials_t tls_credentials;
+                                       /* TLS credentials */
 };
 
 
@@ -267,11 +303,14 @@ extern void       _cups_freeifaddrs(struct ifaddrs *addrs);
  */
 
 extern int             _httpAddrPort(http_addr_t *addr);
+extern http_tls_credentials_t
+                       _httpConvertCredentials(cups_array_t *credentials);
 extern http_t          *_httpCreate(const char *host, int port,
                                     http_encryption_t encryption);
 extern void            _httpDisconnect(http_t *http);
 extern char            *_httpEncodeURI(char *dst, const char *src,
                                        size_t dstsize);
+extern void            _httpFreeCredentials(http_tls_credentials_t credentials);
 extern ssize_t         _httpPeek(http_t *http, char *buffer, size_t length);
 extern const char      *_httpResolveURI(const char *uri, char *resolved_uri,
                                         size_t resolved_size, int log);
index 5c1dce5d8544f20470529c7d1bd7d45526e69730..92c66e1fbf6a6a562852b39ff27761776f95ba15 100644 (file)
@@ -297,7 +297,7 @@ httpAssembleURI(
       * Otherwise, just copy the host string...
       */
 
-      ptr = http_copy_encode(ptr, host, end, ":/?#[]@\\", NULL,
+      ptr = http_copy_encode(ptr, host, end, ":/?#[]@\\\"", NULL,
                              encoding & HTTP_URI_CODING_HOSTNAME);
 
       if (!ptr)
@@ -920,7 +920,9 @@ httpSeparateURI(
 
     for (ptr = scheme, end = scheme + schemelen - 1;
          *uri && *uri != ':' && ptr < end;)
-      if (isalnum(*uri & 255) || *uri == '-' || *uri == '+' || *uri == '.')
+      if (strchr("ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+                 "abcdefghijklmnopqrstuvwxyz"
+                "0123456789-+.", *uri) != NULL)
         *ptr++ = *uri++;
       else
         break;
@@ -944,7 +946,7 @@ httpSeparateURI(
     *port = 80;
   else if (!strcmp(scheme, "https"))
     *port = 443;
-  else if (!strcmp(scheme, "ipp"))
+  else if (!strcmp(scheme, "ipp") || !strcmp(scheme, "ipps"))
     *port = 631;
   else if (!strcasecmp(scheme, "lpd"))
     *port = 515;
@@ -1247,6 +1249,9 @@ httpStatus(http_status_t status)  /* I - HTTP status code */
     case HTTP_SERVER_ERROR :
         s = _("Internal Server Error");
        break;
+    case HTTP_PKI_ERROR :
+        s = _("SSL/TLS Negotiation Error");
+       break;
 
     default :
         s = _("Unknown");
index 6df51abc68b58fc7242378437c0d302b2b31f400..defa388594edc3ec11287089cb70379c8a0e246f 100644 (file)
  *
  * Contents:
  *
- *   _httpBIOMethods()    - Get the OpenSSL BIO methods for HTTP connections.
- *   httpBlocking()       - Set blocking/non-blocking behavior on a connection.
- *   httpCheck()          - Check to see if there is a pending response from the
- *                          server.
- *   httpClearCookie()    - Clear the cookie value(s).
- *   httpClearFields()    - Clear HTTP request fields.
- *   httpClose()          - Close an HTTP connection.
- *   httpConnect()        - Connect to a HTTP server.
- *   httpConnectEncrypt() - Connect to a HTTP server using encryption.
- *   _httpCreate()        - Create an unconnected HTTP connection.
- *   httpDelete()         - Send a DELETE request to the server.
- *   _httpDisconnect()    - Disconnect a HTTP connection.
- *   httpEncryption()     - Set the required encryption on the link.
- *   httpError()          - Get the last error on a connection.
- *   httpFlush()          - Flush data from a HTTP connection.
- *   httpFlushWrite()     - Flush data in write buffer.
- *   httpGet()            - Send a GET request to the server.
- *   httpGetAuthString()  - Get the current authorization string.
- *   httpGetBlocking()    - Get the blocking/non-block state of a connection.
- *   httpGetCookie()      - Get any cookie data from the response.
- *   httpGetFd()          - Get the file descriptor associated with a
- *                          connection.
- *   httpGetField()       - Get a field value from a request/response.
- *   httpGetLength()      - Get the amount of data remaining from the
- *                          content-length or transfer-encoding fields.
- *   httpGetLength2()     - Get the amount of data remaining from the
- *                          content-length or transfer-encoding fields.
- *   httpGetStatus()      - Get the status of the last HTTP request.
- *   httpGetSubField()    - Get a sub-field value.
- *   httpGetSubField2()   - Get a sub-field value.
- *   httpGets()           - Get a line of text from a HTTP connection.
- *   httpHead()           - Send a HEAD request to the server.
- *   httpInitialize()     - Initialize the HTTP interface library and set the
- *                          default HTTP proxy (if any).
- *   httpOptions()        - Send an OPTIONS request to the server.
- *   _httpPeek()          - Peek at data from a HTTP connection.
- *   httpPost()           - Send a POST request to the server.
- *   httpPrintf()         - Print a formatted string to a HTTP connection.
- *   httpPut()            - Send a PUT request to the server.
- *   httpRead()           - Read data from a HTTP connection.
- *   httpRead2()          - Read data from a HTTP connection.
- *   _httpReadCDSA()      - Read function for the CDSA library.
- *   _httpReadGNUTLS()    - Read function for the GNU TLS library.
- *   httpReconnect()      - Reconnect to a HTTP server.
- *   httpSetAuthString()  - Set the current authorization string.
- *   httpSetCookie()      - Set the cookie value(s).
- *   httpSetExpect()      - Set the Expect: header in a request.
- *   httpSetField()       - Set the value of an HTTP header.
- *   httpSetLength()      - Set the content-length and content-encoding.
- *   httpTrace()          - Send an TRACE request to the server.
- *   httpUpdate()         - Update the current HTTP state for incoming data.
- *   _httpWait()          - Wait for data available on a connection (no flush).
- *   httpWait()           - Wait for data available on a connection.
- *   httpWrite()          - Write data to a HTTP connection.
- *   httpWrite2()         - Write data to a HTTP connection.
- *   _httpWriteCDSA()     - Write function for the CDSA library.
- *   _httpWriteGNUTLS()   - Write function for the GNU TLS library.
- *   http_bio_ctrl()      - Control the HTTP connection.
- *   http_bio_free()      - Free OpenSSL data.
- *   http_bio_new()       - Initialize an OpenSSL BIO structure.
- *   http_bio_puts()      - Send a string for OpenSSL.
- *   http_bio_read()      - Read data for OpenSSL.
- *   http_bio_write()     - Write data for OpenSSL.
- *   http_debug_hex()     - Do a hex dump of a buffer.
- *   http_field()         - Return the field index for a field name.
- *   http_read_ssl()      - Read from a SSL/TLS connection.
- *   http_locking_cb()    - Lock/unlock a thread's mutex.
- *   http_send()          - Send a request with all fields and the trailing
- *                          blank line.
- *   http_setup_ssl()     - Set up SSL/TLS support on a connection.
- *   http_shutdown_ssl()  - Shut down SSL/TLS on a connection.
- *   http_threadid_cb()   - Return the current thread ID.
- *   http_upgrade()       - Force upgrade to TLS encryption.
- *   http_write()         - Write a buffer to a HTTP connection.
- *   http_write_chunk()   - Write a chunked buffer.
- *   http_write_ssl()     - Write to a SSL/TLS connection.
+ *   httpAddCredential()       - Allocates and adds a single credential to an
+ *                               array.
+ *   _httpBIOMethods()         - Get the OpenSSL BIO methods for HTTP
+ *                               connections.
+ *   httpBlocking()            - Set blocking/non-blocking behavior on a
+ *                               connection.
+ *   httpCheck()               - Check to see if there is a pending response
+ *                               from the server.
+ *   httpClearCookie()         - Clear the cookie value(s).
+ *   httpClearFields()         - Clear HTTP request fields.
+ *   httpClose()               - Close an HTTP connection.
+ *   httpConnect()             - Connect to a HTTP server.
+ *   httpConnectEncrypt()      - Connect to a HTTP server using encryption.
+ *   httpCopyCredentials()     - Copy the credentials associated with an
+ *                               encrypted connection.
+ *   _httpConvertCredentials() - Convert credentials to the internal format.
+ *   _httpCreate()             - Create an unconnected HTTP connection.
+ *   httpDelete()              - Send a DELETE request to the server.
+ *   _httpDisconnect()         - Disconnect a HTTP connection.
+ *   httpEncryption()          - Set the required encryption on the link.
+ *   httpError()               - Get the last error on a connection.
+ *   httpFlush()               - Flush data from a HTTP connection.
+ *   httpFlushWrite()          - Flush data in write buffer.
+ *   _httpFreeCredentials()    - Free internal credentials.
+ *   httpFreeCredentials()     - Free an array of credentials.
+ *   httpGet()                 - Send a GET request to the server.
+ *   httpGetAuthString()       - Get the current authorization string.
+ *   httpGetBlocking()         - Get the blocking/non-block state of a
+ *                               connection.
+ *   httpGetCookie()           - Get any cookie data from the response.
+ *   httpGetFd()               - Get the file descriptor associated with a
+ *                               connection.
+ *   httpGetField()            - Get a field value from a request/response.
+ *   httpGetLength()           - Get the amount of data remaining from the
+ *                               content-length or transfer-encoding fields.
+ *   httpGetLength2()          - Get the amount of data remaining from the
+ *                               content-length or transfer-encoding fields.
+ *   httpGetStatus()           - Get the status of the last HTTP request.
+ *   httpGetSubField()         - Get a sub-field value.
+ *   httpGetSubField2()        - Get a sub-field value.
+ *   httpGets()                - Get a line of text from a HTTP connection.
+ *   httpHead()                - Send a HEAD request to the server.
+ *   httpInitialize()          - Initialize the HTTP interface library and set
+ *                               the default HTTP proxy (if any).
+ *   httpOptions()             - Send an OPTIONS request to the server.
+ *   _httpPeek()               - Peek at data from a HTTP connection.
+ *   httpPost()                - Send a POST request to the server.
+ *   httpPrintf()              - Print a formatted string to a HTTP connection.
+ *   httpPut()                 - Send a PUT request to the server.
+ *   httpRead()                - Read data from a HTTP connection.
+ *   httpRead2()               - Read data from a HTTP connection.
+ *   _httpReadCDSA()           - Read function for the CDSA library.
+ *   _httpReadGNUTLS()         - Read function for the GNU TLS library.
+ *   httpReconnect()           - Reconnect to a HTTP server.
+ *   httpSetAuthString()       - Set the current authorization string.
+ *   httpSetCredentials()      - Set the credentials associated with an
+ *                               encrypted connection.
+ *   httpSetCookie()           - Set the cookie value(s).
+ *   httpSetExpect()           - Set the Expect: header in a request.
+ *   httpSetField()            - Set the value of an HTTP header.
+ *   httpSetLength()           - Set the content-length and content-encoding.
+ *   httpTrace()               - Send an TRACE request to the server.
+ *   httpUpdate()              - Update the current HTTP state for incoming
+ *                               data.
+ *   _httpWait()               - Wait for data available on a connection (no
+ *                               flush).
+ *   httpWait()                - Wait for data available on a connection.
+ *   httpWrite()               - Write data to a HTTP connection.
+ *   httpWrite2()              - Write data to a HTTP connection.
+ *   _httpWriteCDSA()          - Write function for the CDSA library.
+ *   _httpWriteGNUTLS()        - Write function for the GNU TLS library.
+ *   http_bio_ctrl()           - Control the HTTP connection.
+ *   http_bio_free()           - Free OpenSSL data.
+ *   http_bio_new()            - Initialize an OpenSSL BIO structure.
+ *   http_bio_puts()           - Send a string for OpenSSL.
+ *   http_bio_read()           - Read data for OpenSSL.
+ *   http_bio_write()          - Write data for OpenSSL.
+ *   http_debug_hex()          - Do a hex dump of a buffer.
+ *   http_field()              - Return the field index for a field name.
+ *   http_read_ssl()           - Read from a SSL/TLS connection.
+ *   http_locking_cb()         - Lock/unlock a thread's mutex.
+ *   http_send()               - Send a request with all fields and the trailing
+ *                               blank line.
+ *   http_set_credentials()    - Set the SSL/TLS credentials.
+ *   http_setup_ssl()          - Set up SSL/TLS support on a connection.
+ *   http_shutdown_ssl()       - Shut down SSL/TLS on a connection.
+ *   http_threadid_cb()        - Return the current thread ID.
+ *   http_upgrade()            - Force upgrade to TLS encryption.
+ *   http_write()              - Write a buffer to a HTTP connection.
+ *   http_write_chunk()        - Write a chunked buffer.
+ *   http_write_ssl()          - Write to a SSL/TLS connection.
  */
 
 /*
@@ -142,6 +157,7 @@ static int          http_write_chunk(http_t *http, const char *buffer,
                                         int length);
 #ifdef HAVE_SSL
 static int             http_read_ssl(http_t *http, char *buf, int len);
+static int             http_set_credentials(http_t *http);
 static int             http_setup_ssl(http_t *http);
 static void            http_shutdown_ssl(http_t *http);
 static int             http_upgrade(http_t *http);
@@ -242,8 +258,45 @@ static BIO_METHOD  http_bio_methods =
                          http_bio_free,
                          NULL,
                        };
+#endif /* HAVE_SSL && HAVE_LIBSSL */
 
 
+/*
+ * 'httpAddCredential()' - Allocates and adds a single credential to an array.
+ *
+ * Use @code cupsArrayNew(NULL, NULL)@ to create a credentials array.
+ *
+ * @since CUPS 1.5@
+ */
+
+int                                    /* O - 0 on success, -1 on error */
+httpAddCredential(
+    cups_array_t *credentials,         /* I - Credentials array */
+    const void   *data,                        /* I - PEM-encoded X.509 data */
+    size_t       datalen)              /* I - Length of data */
+{
+  http_credential_t    *credential;    /* Credential data */
+
+
+  if ((credential = malloc(sizeof(http_credential_t))) != NULL)
+  {
+    credential->datalen = datalen;
+
+    if ((credential->data = malloc(datalen)) != NULL)
+    {
+      memcpy(credential->data, data, datalen);
+      cupsArrayAdd(credentials, credential);
+      return (0);
+    }
+
+    free(credential);
+  }
+
+  return (-1);
+}
+
+
+#if defined(HAVE_SSL) && defined(HAVE_LIBSSL)
 /*
  * '_httpBIOMethods()' - Get the OpenSSL BIO methods for HTTP connections.
  */
@@ -442,6 +495,129 @@ httpConnectEncrypt(
 }
 
 
+/*
+ * 'httpCopyCredentials()' - Copy the credentials associated with an encrypted
+ *                          connection.
+ *
+ * @since CUPS 1.5@
+ */
+
+int                                    /* O - Status of call (0 = success) */
+httpCopyCredentials(
+    http_t      *http,                 /* I - Connection to server */
+    cups_array_t **credentials)                /* O - Array of credentials */
+{
+#  ifdef HAVE_LIBSSL
+#  elif defined(HAVE_GNUTLS)
+#  elif defined(HAVE_CDSASSL)
+  OSStatus             error;          /* Error code */
+  CFIndex              count;          /* Number of credentials */
+  CFArrayRef           peerCerts;      /* Peer certificates */
+  SecCertificateRef    secCert;        /* Certificate reference */
+  CFDataRef            data;           /* Certificate data */
+  int                  i;              /* Looping var */
+#  elif defined(HAVE_SSPISSL)
+#  endif /* HAVE_LIBSSL */
+
+
+  if (credentials)
+    *credentials = NULL;
+
+  if (!http || !http->tls || !credentials)
+    return (-1);
+
+#  ifdef HAVE_LIBSSL
+  return (-1);
+
+#  elif defined(HAVE_GNUTLS)
+  return (-1);
+
+#  elif defined(HAVE_CDSASSL)
+  if (!(error = SSLCopyPeerCertificates(http->tls, &peerCerts)) && peerCerts)
+  {
+    if ((*credentials = cupsArrayNew(NULL, NULL)) != NULL)
+    {
+      for (i = 0, count = CFArrayGetCount(peerCerts); i < count; i++)
+      {
+       secCert = (SecCertificateRef)CFArrayGetValueAtIndex(peerCerts, i);
+       if ((data = SecCertificateCopyData(secCert)))
+       {
+         httpAddCredential(*credentials, CFDataGetBytePtr(data),
+                           CFDataGetLength(data));
+         CFRelease(data);
+       }
+      }
+    }
+
+    CFRelease(peerCerts);
+  }
+
+  return (error);
+
+#  elif defined(HAVE_SSPISSL)
+  return (-1);
+#  endif /* HAVE_LIBSSL */
+}
+
+
+/*
+ * '_httpConvertCredentials()' - Convert credentials to the internal format.
+ */
+
+http_tls_credentials_t                 /* O - Internal credentials */
+_httpConvertCredentials(
+    cups_array_t *credentials)         /* I - Array of credentials */
+{
+  if (!credentials)
+    return (NULL);
+
+#  ifdef HAVE_LIBSSL
+  return (NULL);
+
+#  elif defined(HAVE_GNUTLS)
+  return (NULL);
+
+#  elif defined(HAVE_CDSASSL)
+  CFMutableArrayRef    peerCerts;      /* Peer credentials reference */
+  SecCertificateRef    secCert;        /* Certificate reference */
+  CFDataRef            data;           /* Credential data reference */
+  http_credential_t    *credential;    /* Credential data */
+
+
+  if ((peerCerts = CFArrayCreateMutable(kCFAllocatorDefault,
+                                       cupsArrayCount(credentials),
+                                       &kCFTypeArrayCallBacks)) == NULL)
+    return (NULL);
+
+  for (credential = (http_credential_t *)cupsArrayFirst(credentials);
+       credential;
+       credential = (http_credential_t *)cupsArrayNext(credentials))
+  {
+    if ((data = CFDataCreate(kCFAllocatorDefault, credential->data, 
+                            credential->datalen)))
+    {
+      if ((secCert = SecCertificateCreateWithData(kCFAllocatorDefault, data))
+              != NULL)
+      {
+       CFArrayAppendValue(peerCerts, secCert);
+       CFRelease(secCert);
+      }
+
+      CFRelease(data);
+    }
+  }
+
+  return (peerCerts);
+
+#  elif defined(HAVE_SSPISSL)
+  return (NULL);
+
+#  else
+  return (NULL);
+#  endif /* HAVE_LIBSSL */
+}
+
+
 /*
  * '_httpCreate()' - Create an unconnected HTTP connection.
  */
@@ -687,6 +863,57 @@ httpFlushWrite(http_t *http)               /* I - Connection to server */
 }
 
 
+/*
+ * '_httpFreeCredentials()' - Free internal credentials.
+ */
+
+void
+_httpFreeCredentials(
+    http_tls_credentials_t credentials)        /* I - Internal credentials */
+{
+  if (!credentials)
+    return;
+
+#ifdef HAVE_LIBSSL
+  (void)credentials;
+
+#elif defined(HAVE_GNUTLS)
+  (void)credentials;
+
+#elif defined(HAVE_CDSASSL)
+  CFRelease(credentials);
+
+#elif defined(HAVE_SSPISSL)
+  (void)credentials;
+
+#endif /* HAVE_LIBSSL */
+}
+
+
+/*
+ * 'httpFreeCredentials()' - Free an array of credentials.
+ */
+
+void
+httpFreeCredentials(
+    cups_array_t *credentials)         /* I - Array of credentials */
+{
+  http_credential_t    *credential;    /* Credential */
+
+
+  for (credential = (http_credential_t *)cupsArrayFirst(credentials);
+       credential;
+       credential = (http_credential_t *)cupsArrayNext(credentials))
+  {
+    cupsArrayRemove(credentials, credential);
+    free((void *)credential->data);
+    free(credential);
+  }
+
+  cupsArrayDelete(credentials);
+}
+
+
 /*
  * 'httpGet()' - Send a GET request to the server.
  */
@@ -941,7 +1168,7 @@ httpGetSubField2(http_t       *http,       /* I - Connection to server */
     * Skip leading whitespace...
     */
 
-    while (isspace(*fptr & 255))
+    while (_cups_isspace(*fptr))
       fptr ++;
 
     if (*fptr == ',')
@@ -955,7 +1182,7 @@ httpGetSubField2(http_t       *http,       /* I - Connection to server */
     */
 
     for (ptr = temp;
-         *fptr && *fptr != '=' && !isspace(*fptr & 255) &&
+         *fptr && *fptr != '=' && !_cups_isspace(*fptr) &&
             ptr < (temp + sizeof(temp) - 1);
          *ptr++ = *fptr++);
 
@@ -967,7 +1194,7 @@ httpGetSubField2(http_t       *http,       /* I - Connection to server */
     * Skip trailing chars up to the '='...
     */
 
-    while (isspace(*fptr & 255))
+    while (_cups_isspace(*fptr))
       fptr ++;
 
     if (!*fptr)
@@ -982,7 +1209,7 @@ httpGetSubField2(http_t       *http,       /* I - Connection to server */
 
     fptr ++;
 
-    while (isspace(*fptr & 255))
+    while (_cups_isspace(*fptr))
       fptr ++;
 
     if (*fptr == '\"')
@@ -1010,12 +1237,12 @@ httpGetSubField2(http_t       *http,    /* I - Connection to server */
       */
 
       for (ptr = value;
-           *fptr && !isspace(*fptr & 255) && *fptr != ',' && ptr < end;
+           *fptr && !_cups_isspace(*fptr) && *fptr != ',' && ptr < end;
           *ptr++ = *fptr++);
 
       *ptr = '\0';
 
-      while (*fptr && !isspace(*fptr & 255) && *fptr != ',')
+      while (*fptr && !_cups_isspace(*fptr) && *fptr != ',')
         fptr ++;
     }
 
@@ -2084,6 +2311,28 @@ httpSetAuthString(http_t     *http,      /* I - Connection to server */
 }
 
 
+/*
+ * 'httpSetCredentials()' - Set the credentials associated with an encrypted
+ *                         connection.
+ *
+ * @since CUPS 1.5@
+ */
+
+int                                            /* O - Status of call (0 = success) */
+httpSetCredentials(http_t      *http,          /* I - Connection to server */
+                  cups_array_t *credentials)   /* I - Array of credentials */
+{
+  if (!http || cupsArrayCount(credentials) < 1)
+    return (-1);
+
+  _httpFreeCredentials(http->tls_credentials);
+
+  http->tls_credentials = _httpConvertCredentials(credentials);
+
+  return (http->tls_credentials ? 0 : -1);
+}
+
+
 /*
  * 'httpSetCookie()' - Set the cookie value(s).
  *
@@ -2351,7 +2600,7 @@ httpUpdate(http_t *http)          /* I - Connection to server */
       */
 
       *value++ = '\0';
-      while (isspace(*value & 255))
+      while (_cups_isspace(*value))
         value ++;
 
      /*
@@ -2450,14 +2699,14 @@ _httpWait(http_t *http,                 /* I - Connection to server */
   if (http->tls && usessl)
   {
 #  ifdef HAVE_LIBSSL
-    if (SSL_pending((SSL *)(http->tls)))
+    if (SSL_pending(http->tls))
     {
       DEBUG_puts("5_httpWait: Return 1 since there is pending SSL data.");
       return (1);
     }
 
 #  elif defined(HAVE_GNUTLS)
-    if (gnutls_record_check_pending(((http_tls_t *)(http->tls))->session))
+    if (gnutls_record_check_pending(http->tls))
     {
       DEBUG_puts("5_httpWait: Return 1 since there is pending SSL data.");
       return (1);
@@ -2466,7 +2715,7 @@ _httpWait(http_t *http,                   /* I - Connection to server */
 #  elif defined(HAVE_CDSASSL)
     size_t bytes;                      /* Bytes that are available */
 
-    if (!SSLGetBufferedReadSize(((http_tls_t *)(http->tls))->session, &bytes) &&
+    if (!SSLGetBufferedReadSize(http->tls, &bytes) &&
         bytes > 0)
     {
       DEBUG_puts("5_httpWait: Return 1 since there is pending SSL data.");
@@ -3007,7 +3256,7 @@ http_read_ssl(http_t *http,               /* I - Connection to server */
   ssize_t      result;                 /* Return value */
 
 
-  result = gnutls_record_recv(((http_tls_t *)(http->tls))->session, buf, len);
+  result = gnutls_record_recv(http->tls, buf, len);
 
   if (result < 0 && !errno)
   {
@@ -3041,7 +3290,7 @@ http_read_ssl(http_t *http,               /* I - Connection to server */
   size_t       processed;              /* Number of bytes processed */
 
 
-  error = SSLRead(((http_tls_t *)http->tls)->session, buf, len, &processed);
+  error = SSLRead(http->tls, buf, len, &processed);
 
   switch (error)
   {
@@ -3248,6 +3497,111 @@ http_send(http_t       *http,   /* I - Connection to server */
 
 
 #ifdef HAVE_SSL
+/*
+ * 'http_set_credentials()' - Set the SSL/TLS credentials.
+ */
+
+static int                             /* O - Status of connection */
+http_set_credentials(http_t *http)     /* I - Connection to server */
+{
+  _cups_globals_t *cg = _cupsGlobals();        /* Pointer to library globals */
+#  ifdef HAVE_CDSASSL
+  OSStatus             error = 0;      /* Error code */
+  http_tls_credentials_t credentials = NULL;
+                                       /* TLS credentials */
+#  endif /* HAVE_CDSASSL */
+
+
+  DEBUG_printf(("7http_set_credentials(%p)", http));
+
+#  ifdef HAVE_LIBSSL
+  return (-1);
+
+#  elif defined(HAVE_GNUTLS)
+  return (-1);
+
+#  elif defined(HAVE_CDSASSL)
+ /*
+  * Prefer connection specific credentials...
+  */
+
+  if ((credentials = http->tls_credentials) == NULL)
+    credentials = cg->tls_credentials;
+
+#    if HAVE_SECPOLICYCREATESSL
+ /*
+  * Otherwise root around in the user's keychain to see if one can be found...
+  */
+
+  if (!credentials)
+  {
+    CFDictionaryRef    query;          /* Query dictionary */
+    CFTypeRef          matches = NULL; /* Matching credentials */
+    CFArrayRef         dn_array = NULL;/* Distinguished names array */
+    CFTypeRef          keys[]   = { kSecClass,
+                                    kSecMatchLimit,
+                                    kSecReturnRef };
+                                       /* Keys for dictionary */
+    CFTypeRef          values[] = { kSecClassCertificate,
+                                    kSecMatchLimitOne,
+                                    kCFBooleanTrue };
+                                       /* Values for dictionary */
+
+   /*
+    * Get the names associated with the server.
+    */
+
+    if ((error = SSLCopyDistinguishedNames(http->tls, &dn_array)) != noErr)
+    {
+      DEBUG_printf(("4http_set_credentials: SSLCopyDistinguishedNames, error=%d",
+                    (int)error));
+      return (error);
+    }
+
+   /*
+    * Create a query which will return all identities that can sign and match
+    * the passed in policy.
+    */
+
+    query = CFDictionaryCreate(NULL,
+                              (const void**)(&keys[0]),
+                              (const void**)(&values[0]),
+                              sizeof(keys) / sizeof(keys[0]),
+                              &kCFTypeDictionaryKeyCallBacks,
+                              &kCFTypeDictionaryValueCallBacks);
+    if (query)
+    {
+      error = SecItemCopyMatching(query, &matches);
+      DEBUG_printf(("4http_set_credentials: SecItemCopyMatching, error=%d",
+                   (int)error));
+      CFRelease(query);
+    }
+
+    if (matches)
+      CFRelease(matches);
+
+    if (dn_array)
+      CFRelease(dn_array);
+  }
+#    endif /* HAVE_SECPOLICYCREATESSL */
+
+  if (credentials)
+  {
+    error = SSLSetCertificate(http->tls, credentials);
+    DEBUG_printf(("4http_set_credentials: SSLSetCertificate, error=%d",
+                 (int)error));
+  }
+  else
+    DEBUG_puts("4http_set_credentials: No credentials to set.");
+
+  return (error);
+
+#  elif defined(HAVE_SSPISSL)
+  return (-1);
+#  endif /* HAVE_LIBSSL */
+}
+
+
 /*
  * 'http_setup_ssl()' - Set up SSL/TLS support on a connection.
  */
@@ -3255,27 +3609,46 @@ http_send(http_t       *http,   /* I - Connection to server */
 static int                             /* O - Status of connection */
 http_setup_ssl(http_t *http)           /* I - Connection to server */
 {
+  _cups_globals_t      *cg = _cupsGlobals();
+                                       /* Pointer to library globals */
+  int                  any_root;       /* Allow any root */
+
 #  ifdef HAVE_LIBSSL
   SSL_CTX      *context;               /* Context for encryption */
-  SSL          *conn;                  /* Connection for encryption */
   BIO          *bio;                   /* BIO data */
 #  elif defined(HAVE_GNUTLS)
-  http_tls_t   *conn;                  /* TLS session object */
   gnutls_certificate_client_credentials *credentials;
                                        /* TLS credentials */
 #  elif defined(HAVE_CDSASSL)
   OSStatus     error;                  /* Error code */
-  http_tls_t   *conn;                  /* CDSA connection information */
+  const char   *message = NULL;        /* Error message */
+  cups_array_t *credentials;           /* Credentials array */
+  char         *hostname;              /* Hostname */
+  cups_array_t *names;                 /* CUPS distinguished names */
+  CFArrayRef   dn_array;               /* CF distinguished names array */
+  CFIndex      count;                  /* Number of credentials */
+  CFDataRef    data;                   /* Certificate data */
+  int          i;                      /* Looping var */
+  http_credential_t
+               *credential;            /* Credential data */
 #  elif defined(HAVE_SSPISSL)
   TCHAR                username[256];          /* Username returned from GetUserName() */
   TCHAR                commonName[256];        /* Common name for certificate */
   DWORD                dwSize;                 /* 32 bit size */
-  _sspi_struct_t *conn;                        /* SSPI connection information */
 #  endif /* HAVE_LIBSSL */
 
 
   DEBUG_printf(("7http_setup_ssl(http=%p)", http));
 
+ /*
+  * Always allow self-signed certificates for the local loopback address...
+  */
+
+  if (httpAddrLocalhost(http->hostaddr))
+    any_root = 1;
+  else
+    any_root = cg->any_root;
+
 #  ifdef HAVE_LIBSSL
   context = SSL_CTX_new(SSLv23_client_method());
 
@@ -3284,10 +3657,10 @@ http_setup_ssl(http_t *http)            /* I - Connection to server */
   bio = BIO_new(_httpBIOMethods());
   BIO_ctrl(bio, BIO_C_SET_FILE_PTR, 0, (char *)http);
 
-  conn = SSL_new(context);
-  SSL_set_bio(conn, bio, bio);
+  http->tls = SSL_new(context);
+  SSL_set_bio(http->tls_credentials, bio, bio);
 
-  if (SSL_connect(conn) != 1)
+  if (SSL_connect(http->tls) != 1)
   {
 #    ifdef DEBUG
     unsigned long      error;  /* Error code */
@@ -3297,7 +3670,8 @@ http_setup_ssl(http_t *http)              /* I - Connection to server */
 #    endif /* DEBUG */
 
     SSL_CTX_free(context);
-    SSL_free(conn);
+    SSL_free(http->tls);
+    http->tls = NULL;
 
 #    ifdef WIN32
     http->error  = WSAGetLastError();
@@ -3310,20 +3684,10 @@ http_setup_ssl(http_t *http)            /* I - Connection to server */
   }
 
 #  elif defined(HAVE_GNUTLS)
-  if ((conn = (http_tls_t *)malloc(sizeof(http_tls_t))) == NULL)
-  {
-    http->error  = errno;
-    http->status = HTTP_ERROR;
-
-    return (-1);
-  }
-
   credentials = (gnutls_certificate_client_credentials *)
                     malloc(sizeof(gnutls_certificate_client_credentials));
   if (credentials == NULL)
   {
-    free(conn);
-
     http->error = errno;
     http->status = HTTP_ERROR;
 
@@ -3332,107 +3696,298 @@ http_setup_ssl(http_t *http)          /* I - Connection to server */
 
   gnutls_certificate_allocate_credentials(credentials);
 
-  gnutls_init(&(conn->session), GNUTLS_CLIENT);
-  gnutls_set_default_priority(conn->session);
-  gnutls_credentials_set(conn->session, GNUTLS_CRD_CERTIFICATE, *credentials);
-  gnutls_transport_set_ptr(conn->session, (gnutls_transport_ptr)http);
-  gnutls_transport_set_pull_function(conn->session, _httpReadGNUTLS);
-  gnutls_transport_set_push_function(conn->session, _httpWriteGNUTLS);
+  gnutls_init(&http->tls, GNUTLS_CLIENT);
+  gnutls_set_default_priority(http->tls);
+  gnutls_credentials_set(http->tls, GNUTLS_CRD_CERTIFICATE, *credentials);
+  gnutls_transport_set_ptr(http->tls, (gnutls_transport_ptr)http);
+  gnutls_transport_set_pull_function(http->tls, _httpReadGNUTLS);
+  gnutls_transport_set_push_function(http->tls, _httpWriteGNUTLS);
 
-  if ((gnutls_handshake(conn->session)) != GNUTLS_E_SUCCESS)
+  if ((gnutls_handshake(http->tls)) != GNUTLS_E_SUCCESS)
   {
     http->error  = errno;
     http->status = HTTP_ERROR;
 
-    gnutls_deinit(conn->session);
+    gnutls_deinit(http->tls);
     gnutls_certificate_free_credentials(*credentials);
     free(credentials);
-    free(conn);
+    http->tls = NULL;
 
     return (-1);
   }
 
-  conn->credentials = credentials;
+  http->tls_credentials = credentials;
 
 #  elif defined(HAVE_CDSASSL)
-  conn = (http_tls_t *)calloc(1, sizeof(http_tls_t));
-
-  if (conn == NULL)
-    return (-1);
-
-  if ((error = SSLNewContext(false, &conn->session)))
+  if ((error = SSLNewContext(false, &http->tls)))
   {
     http->error  = error;
     http->status = HTTP_ERROR;
 
-    free(conn);
     return (-1);
   }
 
- /*
-  * Use a union to resolve warnings about int/pointer size mismatches...
-  */
+  error = SSLSetConnection(http->tls, http);
+  DEBUG_printf(("4http_setup_ssl: SSLSetConnection, error=%d", (int)error));
+
+  if (!error)
+  {
+    error = SSLSetIOFuncs(http->tls, _httpReadCDSA, _httpWriteCDSA);
+    DEBUG_printf(("4http_setup_ssl: SSLSetIOFuncs, error=%d", (int)error));
+  }
+
+  if (!error)
+  {
+    error = SSLSetProtocolVersionEnabled(http->tls, kSSLProtocol2, false);
+    DEBUG_printf(("4http_setup_ssl: SSLSetProtocolVersionEnabled, error=%d",
+                  (int)error));
+  }
 
-  error = SSLSetConnection(conn->session, http);
+  if (!error)
+  {
+    error = SSLSetAllowsAnyRoot(http->tls, any_root);
+    DEBUG_printf(("4http_setup_ssl: SSLSetAllowsAnyRoot(%d), error=%d",
+                  any_root, (int)error));
+  }
 
   if (!error)
-    error = SSLSetIOFuncs(conn->session, _httpReadCDSA, _httpWriteCDSA);
+  {
+    error = SSLSetAllowsExpiredCerts(http->tls, cg->expired_certs);
+    DEBUG_printf(("4http_setup_ssl: SSLSetAllowsExpiredCerts(%d), error=%d",
+                  cg->expired_certs, (int)error));
+  }
 
   if (!error)
-    error = SSLSetAllowsExpiredCerts(conn->session, true);
+  {
+    error = SSLSetAllowsExpiredRoots(http->tls, cg->expired_root);
+    DEBUG_printf(("4http_setup_ssl: SSLSetAllowsExpiredRoots(%d), error=%d",
+                  cg->expired_root, (int)error));
+  }
 
   if (!error)
-    error = SSLSetAllowsAnyRoot(conn->session, true);
+  {
+    if (cg->client_cert_cb)
+    {
+      error = SSLSetSessionOption(http->tls,
+                                 kSSLSessionOptionBreakOnCertRequested, true);
+      DEBUG_printf(("4http_setup_ssl: kSSLSessionOptionBreakOnCertRequested, "
+                    "error=%d", (int)error));
+    }
+    else
+    {
+      error = http_set_credentials(http);
+      DEBUG_printf(("4http_setup_ssl: http_set_credentials, error=%d",
+                    (int)error));
+    }
+  }
+
+ /*
+  * If there's a server certificate callback installed let it evaluate the
+  * certificate(s) during the handshake...
+  */
+
+  if (!error && cg->server_cert_cb != NULL)
+  {
+    error = SSLSetEnableCertVerify(http->tls, false);
+    DEBUG_printf(("4http_setup_ssl: SSLSetEnableCertVerify, error=%d",
+                  (int)error));
+
+    if (!error)
+    {
+      error = SSLSetSessionOption(http->tls,
+                                 kSSLSessionOptionBreakOnServerAuth, true);
+      DEBUG_printf(("4http_setup_ssl: kSSLSessionOptionBreakOnServerAuth, "
+                    "error=%d", (int)error));
+    }
+  }
 
   if (!error)
-    error = SSLSetProtocolVersionEnabled(conn->session, kSSLProtocol2, false);
+  {
+    hostname = httpAddrLocalhost(http->hostaddr) ? "localhost" : http->hostname;
+    error    = SSLSetPeerDomainName(http->tls, hostname, strlen(hostname));
+
+    DEBUG_printf(("4http_setup_ssl: SSLSetPeerDomainName, error=%d",
+                  (int)error));
+  }
 
   if (!error)
   {
-    while ((error = SSLHandshake(conn->session)) == errSSLWouldBlock)
-      usleep(1000);
+    int done = 0;                      /* Are we done yet? */
+
+    while (!error && !done)
+    {
+      error = SSLHandshake(http->tls);
+
+      DEBUG_printf(("4_httpWait: SSLHandshake returned %d.", (int)error));
+
+      switch (error)
+      {
+       case noErr :
+           done = 1;
+           break;
+
+       case errSSLWouldBlock :
+           usleep(1000);
+           break;
+
+       case errSSLServerAuthCompleted :
+           error = 0;
+           if (cg->server_cert_cb)
+           {
+             error = httpCopyCredentials(http, &credentials);
+             if (!error)
+             {
+               error = (cg->server_cert_cb)(http, http->tls, credentials,
+                                            cg->server_cert_data);
+               httpFreeCredentials(credentials);
+             }
+
+             DEBUG_printf(("4_httpWait: Server certificate callback returned "
+                           "%d.", (int)error));
+           }
+           break;
+
+       case errSSLClientCertRequested :
+           error = 0;
+
+           if (cg->client_cert_cb)
+           {
+             names = NULL;
+             if (!(error = SSLCopyDistinguishedNames(http->tls, &dn_array)) && 
+                 dn_array)
+             {
+               if ((names = cupsArrayNew(NULL, NULL)) != NULL)
+               {
+                 for (i = 0, count = CFArrayGetCount(dn_array); i < count; i++)
+                 {
+                   data = (CFDataRef)CFArrayGetValueAtIndex(dn_array, i);
+
+                   if ((credential = malloc(sizeof(*credential))))
+                   {
+                     credential->datalen = CFDataGetLength(data);
+                     if ((credential->data = malloc(credential->datalen)))
+                     {
+                       memcpy((void *)credential->data, CFDataGetBytePtr(data), 
+                              credential->datalen);
+                       cupsArrayAdd(names, credential);
+                     }
+                   }
+                 }
+               }
+
+               CFRelease(dn_array);
+             }
+
+             if (!error)
+             {
+               error = (cg->client_cert_cb)(http, http->tls, names, 
+                                            cg->client_cert_data);
+
+               DEBUG_printf(("4_httpWait: Client certificate callback "
+                             "returned %d.", (int)error));
+             }
+
+             httpFreeCredentials(names);
+           }
+           break;
+
+       case errSSLUnknownRootCert :
+           message = _("Unable to establish a secure connection to host "
+                       "(untrusted certificate).");
+           break;
+
+       case errSSLNoRootCert :
+           message = _("Unable to establish a secure connection to host "
+                       "(self-signed certificate).");
+           break;
+
+       case errSSLCertExpired :
+           message = _("Unable to establish a secure connection to host "
+                       "(expired certificate).");
+           break;
+
+       case errSSLCertNotYetValid :
+           message = _("Unable to establish a secure connection to host "
+                       "(certificate not yet valid).");
+           break;
+
+       case errSSLHostNameMismatch :
+           message = _("Unable to establish a secure connection to host "
+                       "(host name mismatch).");
+           break;
+
+       case errSSLXCertChainInvalid :
+           message = _("Unable to establish a secure connection to host "
+                       "(certificate chain invalid).");
+           break;
+
+       case errSSLConnectionRefused :
+           message = _("Unable to establish a secure connection to host "
+                       "(peer dropped connection before responding).");
+           break;
+
+       default :
+           break;
+      }
+    }
   }
 
   if (error)
   {
     http->error  = error;
     http->status = HTTP_ERROR;
+    errno        = ECONNREFUSED;
+
+    SSLDisposeContext(http->tls);
+    http->tls = NULL;
 
-    SSLDisposeContext(conn->session);
+   /*
+    * If an error string wasn't set by the callbacks use a generic one...
+    */
+
+    if (!message)
+#ifdef HAVE_CSSMERRORSTRING
+      message = cssmErrorString(error);
+#else
+      message = _("Unable to establish a secure connection to host.");
+#endif /* HAVE_CSSMERRORSTRING */
 
-    free(conn);
+    _cupsSetError(IPP_PKI_ERROR, message, 1);
 
     return (-1);
   }
+
 #  elif defined(HAVE_SSPISSL)
-  conn = _sspiAlloc();
+  http->tls = _sspiAlloc();
 
-  if (!conn)
+  if (!http->tls)
     return (-1);
 
-  conn->sock = http->fd;
-  dwSize     = sizeof(username) / sizeof(TCHAR);
+  http->tls->sock = http->fd;
+  dwSize          = sizeof(username) / sizeof(TCHAR);
   GetUserName(username, &dwSize);
   _sntprintf_s(commonName, sizeof(commonName) / sizeof(TCHAR),
                sizeof(commonName) / sizeof(TCHAR), TEXT("CN=%s"), username);
 
-  if (!_sspiGetCredentials(conn, L"ClientContainer", commonName, FALSE))
+  if (!_sspiGetCredentials(http->tls_credentials, L"ClientContainer",
+                           commonName, FALSE))
   {
-    _sspiFree(conn);
+    _sspiFree(http->tls_credentials);
+    http->tls_credentials = NULL;
     return (-1);
   }
 
-  _sspiSetAllowsAnyRoot(conn, TRUE);
-  _sspiSetAllowsExpiredCerts(conn, TRUE);
+  _sspiSetAllowsAnyRoot(http->tls_credentials, TRUE);
+  _sspiSetAllowsExpiredCerts(http->tls_credentials, TRUE);
 
-  if (!_sspiConnect(conn, http->hostname))
+  if (!_sspiConnect(http->tls_credentials, http->hostname))
   {
-    _sspiFree(conn);
+    _sspiFree(http->tls_credentials);
+    http->tls_credentials = NULL;
     return (-1);
   }
 #  endif /* HAVE_CDSASSL */
 
-  http->tls = conn;
   return (0);
 }
 #endif /* HAVE_SSL */
@@ -3448,54 +4003,39 @@ http_shutdown_ssl(http_t *http)         /* I - Connection to server */
 {
 #  ifdef HAVE_LIBSSL
   SSL_CTX      *context;               /* Context for encryption */
-  SSL          *conn;                  /* Connection for encryption */
 
+  context = SSL_get_SSL_CTX(http->tls_credentials);
 
-  conn    = (SSL *)(http->tls);
-  context = SSL_get_SSL_CTX(conn);
-
-  SSL_shutdown(conn);
+  SSL_shutdown(http->tls_credentials);
   SSL_CTX_free(context);
-  SSL_free(conn);
+  SSL_free(http->tls_credentials);
 
 #  elif defined(HAVE_GNUTLS)
-  http_tls_t      *conn;               /* Encryption session */
   gnutls_certificate_client_credentials *credentials;
                                        /* TLS credentials */
 
+  credentials = (gnutls_certificate_client_credentials *)(http->tls_credentials);
 
-  conn = (http_tls_t *)(http->tls);
-  credentials = (gnutls_certificate_client_credentials *)(conn->credentials);
-
-  gnutls_bye(conn->session, GNUTLS_SHUT_RDWR);
-  gnutls_deinit(conn->session);
+  gnutls_bye(http->tls, GNUTLS_SHUT_RDWR);
+  gnutls_deinit(http->tls);
   gnutls_certificate_free_credentials(*credentials);
   free(credentials);
-  free(conn);
 
 #  elif defined(HAVE_CDSASSL)
-  http_tls_t      *conn;               /* CDSA connection information */
-
-
-  conn = (http_tls_t *)(http->tls);
-
-  while (SSLClose(conn->session) == errSSLWouldBlock)
+  while (SSLClose(http->tls) == errSSLWouldBlock)
     usleep(1000);
 
-  SSLDisposeContext(conn->session);
+  SSLDisposeContext(http->tls);
 
-  if (conn->certsArray)
-    CFRelease(conn->certsArray);
+  if (http->tls_credentials)
+    CFRelease(http->tls_credentials);
 
-  free(conn);
 #  elif defined(HAVE_SSPISSL)
-  _sspi_struct_t  *conn;               /* SSPI connection information */
-
-  conn = (_sspi_struct_t*)(http->tls);
-  _sspiFree(conn);
+  _sspiFree(http->tls_credentials);
 #  endif /* HAVE_LIBSSL */
 
-  http->tls = NULL;
+  http->tls             = NULL;
+  http->tls_credentials = NULL;
 }
 #endif /* HAVE_SSL */
 
@@ -3554,7 +4094,7 @@ http_upgrade(http_t *http)                /* I - Connection to server */
 
   httpClearFields(http);
   httpSetField(http, HTTP_FIELD_CONNECTION, "upgrade");
-  httpSetField(http, HTTP_FIELD_UPGRADE, "TLS/1.0, SSL/2.0, SSL/3.0");
+  httpSetField(http, HTTP_FIELD_UPGRADE, "TLS/1.2, TLS/1.1, TLS/1.0, SSL/3.0");
 
   if ((ret = httpOptions(http, "*")) == 0)
   {
@@ -3735,7 +4275,7 @@ http_write_ssl(http_t     *http,  /* I - Connection to server */
   result = SSL_write((SSL *)(http->tls), buf, len);
 
 #  elif defined(HAVE_GNUTLS)
-  result = gnutls_record_send(((http_tls_t *)(http->tls))->session, buf, len);
+  result = gnutls_record_send(http->tls, buf, len);
 
   if (result < 0 && !errno)
   {
@@ -3766,7 +4306,7 @@ http_write_ssl(http_t     *http,  /* I - Connection to server */
   size_t       processed;              /* Number of bytes processed */
 
 
-  error = SSLWrite(((http_tls_t *)http->tls)->session, buf, len, &processed);
+  error = SSLWrite(http->tls, buf, len, &processed);
 
   switch (error)
   {
index 85a2c8b43b0af2fbaa965627909eeed03ed3a249..8dc79096c85626c60cd0702c97163004a30682e8 100644 (file)
@@ -1,10 +1,9 @@
 /*
  * "$Id: http.h 7026 2007-10-19 00:57:45Z mike $"
  *
- *   Hyper-Text Transport Protocol definitions for the Common UNIX Printing
- *   System (CUPS).
+ *   Hyper-Text Transport Protocol definitions for CUPS.
  *
- *   Copyright 2007-2009 by Apple Inc.
+ *   Copyright 2007-2010 by Apple Inc.
  *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -24,6 +23,7 @@
  */
 
 #  include "versioning.h"
+#  include "array.h"
 #  include <string.h>
 #  include <time.h>
 #  include <sys/types.h>
@@ -250,11 +250,11 @@ typedef enum http_status_e                /**** HTTP status codes ****/
   HTTP_GATEWAY_TIMEOUT,                        /* Gateway connection timed out */
   HTTP_NOT_SUPPORTED,                  /* HTTP version not supported */
 
-  HTTP_AUTHORIZATION_CANCELED = 1000   /* User canceled authorization */
-
+  HTTP_AUTHORIZATION_CANCELED = 1000,  /* User canceled authorization @since CUPS 1.4@ */
+  HTTP_PKI_ERROR                       /* Error negotiating a secure connection @since CUPS 1.5@ */
 } http_status_t;
 
-typedef enum http_uri_status_e         /**** URI separation status @since CUPS1.2@ ****/
+typedef enum http_uri_status_e         /**** URI separation status @since CUPS 1.2@ ****/
 {
   HTTP_URI_OVERFLOW = -8,              /* URI buffer for httpAssembleURI is too small */
   HTTP_URI_BAD_ARGUMENTS = -7,         /* Bad arguments to function (error) */
@@ -317,6 +317,12 @@ typedef struct http_addrlist_s             /**** Socket address list, which is
 
 typedef struct _http_s http_t;         /**** HTTP connection type ****/
 
+typedef struct http_credential_s       /**** Credential data @since CUPS 1.5@ ****/
+{
+  void         *data;                  /* Pointer to credential data */
+  size_t       datalen;                /* Credential length */
+} http_credential_t;
+
 
 /*
  * Prototypes...
@@ -440,6 +446,17 @@ extern char                *httpGetAuthString(http_t *http) _CUPS_API_1_3;
 extern void            httpSetAuthString(http_t *http, const char *scheme,
                                          const char *data) _CUPS_API_1_3;
 
+/**** New in CUPS 1.5 ****/
+extern int             httpAddCredential(cups_array_t *credentials,
+                                         const void *data, size_t datalen)
+                                         _CUPS_API_1_5;
+extern int             httpCopyCredentials(http_t *http, 
+                                           cups_array_t **credentials) 
+                                           _CUPS_API_1_5;
+extern void            httpFreeCredentials(cups_array_t *certs) _CUPS_API_1_5;
+extern int             httpSetCredentials(http_t *http, cups_array_t *certs)
+                                          _CUPS_API_1_5;
+
 /*
  * C++ magic...
  */
index 05103dcdca0a5f0adec56d5fa6c60b4592a3d33f..c1b556fe8ee4710693789cbb418aba47dbff87ef 100644 (file)
@@ -90,6 +90,12 @@ static const char * const ipp_status_oks[] = /* "OK" status codes */
                  "server-error-job-canceled",
                  "server-error-multiple-document-jobs-not-supported",
                  "server-error-printer-is-deactivated"
+               },
+               * const ipp_status_1000s[] =            /* CUPS internal */
+               {
+                 "cups-authorization-canceled",
+                 "cups-pki-error",
+                 "cups-upgrade-required"
                };
 static char    * const ipp_std_ops[] =
                {
@@ -331,7 +337,7 @@ _ippAttrString(ipp_attribute_t *attr,       /* I - Attribute */
   {
     if (val > attr->values)
     {
-      if (bufptr < bufend)
+      if (buffer && bufptr < bufend)
         *bufptr++ = ',';
       else
         bufptr ++;
@@ -346,7 +352,7 @@ _ippAttrString(ipp_attribute_t *attr,       /* I - Attribute */
           {
             ptr = printer_states[val->integer - IPP_PRINTER_IDLE];
 
-            if (bufptr < bufend)
+            if (buffer && bufptr < bufend)
               strlcpy(bufptr, ptr, bufend - bufptr + 1);
 
             bufptr += strlen(ptr);
@@ -358,7 +364,7 @@ _ippAttrString(ipp_attribute_t *attr,       /* I - Attribute */
           {
             ptr = job_states[val->integer - IPP_JOB_PENDING];
 
-            if (bufptr < bufend)
+            if (buffer && bufptr < bufend)
               strlcpy(bufptr, ptr, bufend - bufptr + 1);
 
             bufptr += strlen(ptr);
@@ -366,14 +372,14 @@ _ippAttrString(ipp_attribute_t *attr,     /* I - Attribute */
           }
 
       case IPP_TAG_INTEGER :
-          if (bufptr < bufend)
+          if (buffer && bufptr < bufend)
             bufptr += snprintf(bufptr, bufend - bufptr + 1, "%d", val->integer);
           else
             bufptr += snprintf(temp, sizeof(temp), "%d", val->integer);
           break;
 
       case IPP_TAG_BOOLEAN :
-          if (bufptr < bufend)
+          if (buffer && bufptr < bufend)
             strlcpy(bufptr, val->boolean ? "true" : "false",
                     bufend - bufptr + 1);
 
@@ -381,7 +387,7 @@ _ippAttrString(ipp_attribute_t *attr,       /* I - Attribute */
           break;
 
       case IPP_TAG_RANGE :
-          if (bufptr < bufend)
+          if (buffer && bufptr < bufend)
             bufptr += snprintf(bufptr, bufend - bufptr + 1, "%d-%d",
                                val->range.lower, val->range.upper);
           else
@@ -390,7 +396,7 @@ _ippAttrString(ipp_attribute_t *attr,       /* I - Attribute */
           break;
 
       case IPP_TAG_RESOLUTION :
-          if (bufptr < bufend)
+          if (buffer && bufptr < bufend)
             bufptr += snprintf(bufptr, bufend - bufptr + 1, "%dx%d%s",
                                val->resolution.xres, val->resolution.yres,
                                val->resolution.units == IPP_RES_PER_INCH ?
@@ -419,7 +425,7 @@ _ippAttrString(ipp_attribute_t *attr,       /* I - Attribute */
                       val->date[5], val->date[6], val->date[8], val->date[9],
                       val->date[10]);
 
-            if (bufptr < bufend)
+            if (buffer && bufptr < bufend)
               strlcpy(bufptr, temp, bufend - bufptr + 1);
 
             bufptr += strlen(temp);
@@ -435,23 +441,26 @@ _ippAttrString(ipp_attribute_t *attr,     /* I - Attribute */
       case IPP_TAG_LANGUAGE :
       case IPP_TAG_TEXTLANG :
       case IPP_TAG_NAMELANG :
+         if (!val->string.text)
+           break;
+
           for (ptr = val->string.text; *ptr; ptr ++)
           {
             if (*ptr == '\\' || *ptr == '\"')
             {
-              if (bufptr < bufend)
+              if (buffer && bufptr < bufend)
                 *bufptr = '\\';
               bufptr ++;
             }
 
-            if (bufptr < bufend)
+            if (buffer && bufptr < bufend)
               *bufptr = *ptr;
             bufptr ++;
           }
           break;
 
       case IPP_TAG_BEGIN_COLLECTION :
-          if (bufptr < bufend)
+          if (buffer && bufptr < bufend)
             bufptr += ipp_col_string(val->collection, bufptr,
                                      bufend - bufptr + 1);
           else
@@ -461,19 +470,19 @@ _ippAttrString(ipp_attribute_t *attr,     /* I - Attribute */
       case IPP_TAG_STRING :
           for (ptr = val->string.text; *ptr; ptr ++)
           {
-            if (*ptr == '\\' || isspace(*ptr & 255))
+            if (*ptr == '\\' || _cups_isspace(*ptr))
             {
-              if (bufptr < bufend)
+              if (buffer && bufptr < bufend)
                 *bufptr = '\\';
               bufptr ++;
 
-              if (bufptr < bufend)
+              if (buffer && bufptr < bufend)
                 *bufptr = *ptr;
               bufptr ++;
             }
             else if (!isprint(*ptr & 255))
             {
-              if (bufptr < bufend)
+              if (buffer && bufptr < bufend)
                 bufptr += snprintf(bufptr, bufend - bufptr + 1, "\\%03o",
                                    *ptr & 255);
               else
@@ -482,7 +491,7 @@ _ippAttrString(ipp_attribute_t *attr,       /* I - Attribute */
             }
             else
             {
-              if (bufptr < bufend)
+              if (buffer && bufptr < bufend)
                 *bufptr = *ptr;
               bufptr ++;
             }
@@ -491,14 +500,14 @@ _ippAttrString(ipp_attribute_t *attr,     /* I - Attribute */
 
       default :
           ptr = ippTagString(attr->value_tag);
-          if (bufptr < bufend)
+          if (buffer && bufptr < bufend)
             strlcpy(bufptr, ptr, bufend - bufptr + 1);
           bufptr += strlen(ptr);
           break;
     }
   }
 
-  if (bufptr < bufend)
+  if (buffer && bufptr < bufend)
     *bufptr = '\0';
   else if (bufend)
     *bufend = '\0';
@@ -531,6 +540,8 @@ ippErrorString(ipp_status_t error)  /* I - Error status */
     return (ipp_status_400s[error - IPP_BAD_REQUEST]);
   else if (error >= IPP_INTERNAL_ERROR && error <= IPP_PRINTER_IS_DEACTIVATED)
     return (ipp_status_500s[error - IPP_INTERNAL_ERROR]);
+  else if (error >= IPP_AUTHORIZATION_CANCELED && error <= IPP_UPGRADE_REQUIRED)
+    return (ipp_status_1000s[error - IPP_AUTHORIZATION_CANCELED]);
 
  /*
   * No, build an "unknown-xxxx" error string...
@@ -572,6 +583,10 @@ ippErrorValue(const char *name)            /* I - Name */
     if (!strcasecmp(name, ipp_status_500s[i]))
       return ((ipp_status_t)(i + 0x500));
 
+  for (i = 0; i < (sizeof(ipp_status_1000s) / sizeof(ipp_status_1000s[0])); i ++)
+    if (!strcasecmp(name, ipp_status_1000s[i]))
+      return ((ipp_status_t)(i + 0x1000));
+
   return ((ipp_status_t)-1);
 }
 
index 4f3dd5eec74cd4989b1952de00185be7f7592e66..e639d8ee845a5641a38bfc2e37e75532a6e3ef8b 100644 (file)
@@ -310,7 +310,11 @@ typedef enum ipp_status_e          /**** IPP status codes ****/
   IPP_PRINTER_BUSY,                    /* server-error-busy */
   IPP_ERROR_JOB_CANCELED,              /* server-error-job-canceled */
   IPP_MULTIPLE_JOBS_NOT_SUPPORTED,     /* server-error-multiple-document-jobs-not-supported */
-  IPP_PRINTER_IS_DEACTIVATED           /* server-error-printer-is-deactivated */
+  IPP_PRINTER_IS_DEACTIVATED,          /* server-error-printer-is-deactivated */
+
+  IPP_AUTHORIZATION_CANCELED = 0x1000, /* Authorization canceled by user @since CUPS 1.4@ */
+  IPP_PKI_ERROR,                       /* Error negotiating a secure connection @since CUPS 1.5@ */
+  IPP_UPGRADE_REQUIRED                 /* TLS upgrade required */
 } ipp_status_t;
 #define IPP_ERROR_JOB_CANCELLED IPP_ERROR_JOB_CANCELED
 
index 38f8e5ae0cbda55f180a58cb753f9a3863cbed00..a4b2507c023c957ca30998ee52056e552210d463 100644 (file)
@@ -492,7 +492,7 @@ cupsLangGet(const char *language)   /* I - Language or locale */
        */
 
        for (ptr = charset, csptr ++; *csptr; csptr ++)
-         if (ptr < (charset + sizeof(charset) - 1) && isalnum(*csptr & 255))
+         if (ptr < (charset + sizeof(charset) - 1) && _cups_isalnum(*csptr))
            *ptr++ = *csptr;
 
         *ptr = '\0';
@@ -552,7 +552,7 @@ cupsLangGet(const char *language)   /* I - Language or locale */
     */
 
     for (ptr = charset; *csptr; csptr ++)
-      if (isalnum(*csptr & 255) && ptr < (charset + sizeof(charset) - 1))
+      if (_cups_isalnum(*csptr) && ptr < (charset + sizeof(charset) - 1))
         *ptr++ = *csptr;
 
     *ptr = '\0';
@@ -619,7 +619,7 @@ cupsLangGet(const char *language)   /* I - Language or locale */
       */
 
       for (language ++, ptr = charset; *language; language ++)
-        if (isalnum(*language & 255) && ptr < (charset + sizeof(charset) - 1))
+        if (_cups_isalnum(*language) && ptr < (charset + sizeof(charset) - 1))
           *ptr++ = toupper(*language & 255);
 
       *ptr = '\0';
index 722a8ad9535b57cd16f8fa28d92b654b35633042..a34c70032013420afc845d89e2afa33dc71d9697 100644 (file)
@@ -1,5 +1,5 @@
 LIBRARY libcups2\r
-VERSION 2.8\r
+VERSION 2.9\r
 EXPORTS\r
 _cupsGetPassword\r
 _cupsGlobals\r
@@ -154,6 +154,7 @@ cupsRemoveOption
 cupsResolveConflicts\r
 cupsSendRequest\r
 cupsServer\r
+cupsSetCredentials\r
 cupsSetDests\r
 cupsSetDests2\r
 cupsSetEncryption\r
@@ -168,6 +169,7 @@ cupsUTF8ToCharset
 cupsUTF8ToUTF32\r
 cupsUser\r
 cupsWriteRequestData\r
+httpAddCredential\r
 httpAddrAny\r
 httpAddrConnect\r
 httpAddrEqual\r
@@ -186,6 +188,7 @@ httpClearFields
 httpClose\r
 httpConnect\r
 httpConnectEncrypt\r
+httpCopyCredentials\r
 httpDecode64\r
 httpDecode64_2\r
 httpDelete\r
@@ -195,6 +198,7 @@ httpEncryption
 httpError\r
 httpFlush\r
 httpFlushWrite\r
+httpFreeCredentials\r
 httpGet\r
 httpGetBlocking\r
 httpGetCookie\r
@@ -227,6 +231,7 @@ httpSeparate
 httpSeparate2\r
 httpSeparateURI\r
 httpSetCookie\r
+httpSetCredentials\r
 httpSetExpect\r
 httpSetField\r
 httpSetLength\r
index cd165a10c0c0230588433816494088f4157a7a38..25b068a9820250dcc6ea4f31a96b41454f0ab264 100644 (file)
@@ -387,7 +387,7 @@ ppdLocalizeIPPReason(
 
        valptr += 5;
 
-        while (*valptr && !isspace(*valptr & 255) && bufptr < bufend)
+        while (*valptr && !_cups_isspace(*valptr) && bufptr < bufend)
        {
          if (*valptr == '%' && isxdigit(valptr[1] & 255) &&
              isxdigit(valptr[2] & 255))
@@ -425,7 +425,7 @@ ppdLocalizeIPPReason(
         * Skip this URI...
        */
 
-        while (*valptr && !isspace(*valptr & 255))
+        while (*valptr && !_cups_isspace(*valptr))
           valptr++;
       }
 
@@ -433,7 +433,7 @@ ppdLocalizeIPPReason(
       * Skip whitespace...
       */
 
-      while (isspace(*valptr & 255))
+      while (_cups_isspace(*valptr))
        valptr ++;
     }
 
@@ -461,7 +461,7 @@ ppdLocalizeIPPReason(
         * Copy URI...
        */
 
-        while (*valptr && !isspace(*valptr & 255) && bufptr < bufend)
+        while (*valptr && !_cups_isspace(*valptr) && bufptr < bufend)
          *bufptr++ = *valptr++;
 
        *bufptr = '\0';
@@ -474,7 +474,7 @@ ppdLocalizeIPPReason(
         * Skip this URI...
        */
 
-       while (*valptr && !isspace(*valptr & 255))
+       while (*valptr && !_cups_isspace(*valptr))
          valptr++;
       }
 
@@ -482,7 +482,7 @@ ppdLocalizeIPPReason(
       * Skip whitespace...
       */
 
-      while (isspace(*valptr & 255))
+      while (_cups_isspace(*valptr))
        valptr ++;
     }
 
@@ -596,7 +596,7 @@ _ppdGetLanguages(ppd_file_t *ppd)   /* I - PPD file */
     * Skip leading whitespace...
     */
 
-    while (isspace(*ptr & 255))
+    while (_cups_isspace(*ptr))
       ptr ++;
 
     if (!*ptr)
@@ -606,7 +606,7 @@ _ppdGetLanguages(ppd_file_t *ppd)   /* I - PPD file */
     * Find the end of this language name...
     */
 
-    for (start = ptr; *ptr && !isspace(*ptr & 255); ptr ++);
+    for (start = ptr; *ptr && !_cups_isspace(*ptr); ptr ++);
 
     if (*ptr)
       *ptr++ = '\0';
index 648e8f28b9e120924a0c36428b0fe722188ae2da..21d41d176d646750467bdad412f7dd3742c70e07 100644 (file)
@@ -461,7 +461,10 @@ ppdMarkDefaults(ppd_file_t *ppd)   /* I - PPD file record */
   for (c = (ppd_choice_t *)cupsArrayFirst(ppd->marked);
        c;
        c = (ppd_choice_t *)cupsArrayNext(ppd->marked))
+  {
     cupsArrayRemove(ppd->marked, c);
+    c->marked = 0;
+  }
 
  /*
   * Then repopulate it with the defaults...
@@ -560,7 +563,7 @@ _ppdParseOptions(
     cups_option_t **options,           /* IO - Options */
     _ppd_parse_t  which)               /* I  - What to parse */
 {
-  char option[PPD_MAX_NAME + 1],       /* Current option/property */
+  char option[PPD_MAX_NAME * 2 + 1],   /* Current option/property */
        choice[PPD_MAX_NAME],           /* Current choice/value */
        *ptr;                           /* Pointer into option or choice */
 
@@ -579,7 +582,7 @@ _ppdParseOptions(
     * Skip leading whitespace...
     */
 
-    while (isspace(*s & 255))
+    while (_cups_isspace(*s))
       s ++;
 
    /*
@@ -587,10 +590,10 @@ _ppdParseOptions(
     */
 
     ptr = option;
-    while (*s && !isspace(*s & 255) && ptr < (option + sizeof(option) - 1))
+    while (*s && !_cups_isspace(*s) && ptr < (option + sizeof(option) - 1))
       *ptr++ = *s++;
 
-    if (ptr == s || !isspace(*s & 255))
+    if (ptr == s || !_cups_isspace(*s))
       break;
 
     *ptr = '\0';
@@ -599,17 +602,17 @@ _ppdParseOptions(
     * Get the choice...
     */
 
-    while (isspace(*s & 255))
+    while (_cups_isspace(*s))
       s ++;
 
     if (!*s)
       break;
 
     ptr = choice;
-    while (*s && !isspace(*s & 255) && ptr < (choice + sizeof(choice) - 1))
+    while (*s && !_cups_isspace(*s) && ptr < (choice + sizeof(choice) - 1))
       *ptr++ = *s++;
 
-    if (!isspace(*s & 255) && *s)
+    if (*s && !_cups_isspace(*s))
       break;
 
     *ptr = '\0';
index db82637ea5c04d57c17926520038c0d7680ce54b..01845c75fbae48c1906b9080728e237ddbacf31a 100644 (file)
@@ -30,9 +30,7 @@
  * Include necessary headers...
  */
 
-#include "cups.h"
-#include "string-private.h"
-#include "debug-private.h"
+#include "cups-private.h"
 
 
 /*
@@ -283,7 +281,7 @@ cupsParseOptions(
   * Skip leading spaces...
   */
 
-  while (isspace(*ptr & 255))
+  while (_cups_isspace(*ptr))
     ptr ++;
 
  /*
@@ -297,7 +295,7 @@ cupsParseOptions(
     */
 
     name = ptr;
-    while (!isspace(*ptr & 255) && *ptr != '=' && *ptr)
+    while (!strchr("\f\n\r\t\v =", *ptr) && *ptr)
       ptr ++;
 
    /*
@@ -311,7 +309,7 @@ cupsParseOptions(
     * Skip trailing spaces...
     */
 
-    while (isspace(*ptr & 255))
+    while (_cups_isspace(*ptr))
       *ptr++ = '\0';
 
     if ((sep = *ptr) == '=')
@@ -340,7 +338,7 @@ cupsParseOptions(
 
     value = ptr;
 
-    while (*ptr && !isspace(*ptr & 255))
+    while (*ptr && !_cups_isspace(*ptr))
     {
       if (*ptr == ',')
         ptr ++;
@@ -395,7 +393,7 @@ cupsParseOptions(
        * Normal space-delimited string...
        */
 
-       while (!isspace(*ptr & 255) && *ptr)
+       while (*ptr && !_cups_isspace(*ptr))
        {
          if (*ptr == '\\' && ptr[1])
            _cups_strcpy(ptr, ptr + 1);
@@ -414,7 +412,7 @@ cupsParseOptions(
     * Skip trailing whitespace...
     */
 
-    while (isspace(*ptr & 255))
+    while (_cups_isspace(*ptr))
       ptr ++;
 
    /*
@@ -539,7 +537,7 @@ _cupsGet1284Values(
   num_values = 0;
   while (*device_id)
   {
-    while (isspace(*device_id & 255))
+    while (_cups_isspace(*device_id))
       device_id ++;
 
     if (!*device_id)
@@ -552,13 +550,13 @@ _cupsGet1284Values(
     if (!*device_id)
       break;
 
-    while (ptr > key && isspace(ptr[-1] & 255))
+    while (ptr > key && _cups_isspace(ptr[-1]))
       ptr --;
 
     *ptr = '\0';
     device_id ++;
 
-    while (isspace(*device_id & 255))
+    while (_cups_isspace(*device_id))
       device_id ++;
 
     if (!*device_id)
@@ -571,7 +569,7 @@ _cupsGet1284Values(
     if (!*device_id)
       break;
 
-    while (ptr > value && isspace(ptr[-1] & 255))
+    while (ptr > value && _cups_isspace(ptr[-1]))
       ptr --;
 
     *ptr = '\0';
index d240a407ef9c1d2ea2032fea49a8f65104b5ff26..e8214661653d67149154142df10fa3f21fd17945 100644 (file)
@@ -136,10 +136,10 @@ ppdPageSize(ppd_file_t *ppd,              /* I - PPD file record */
       if ((coption = ppdFindCustomOption(ppd, "PageSize")) != NULL)
       {
         if ((cparam = ppdFindCustomParam(coption, "Width")) != NULL)
-         cparam->current.custom_points = w;
+         cparam->current.custom_points = (float)w;
 
         if ((cparam = ppdFindCustomParam(coption, "Height")) != NULL)
-         cparam->current.custom_points = l;
+         cparam->current.custom_points = (float)l;
       }
 
      /*
index b5a769b490f1be65487153eb609d76a24b7a6b08..d44c1ca0403b10f2821eb9b71ae60ede3b693d4d 100644 (file)
@@ -148,7 +148,6 @@ extern const char   *_pwgGetSource(_pwg_t *pwg, const char *input_slot);
 extern const char      *_pwgGetType(_pwg_t *pwg, const char *media_type);
 extern const char      *_pwgInputSlotForSource(const char *media_source,
                                                char *name, size_t namesize);
-extern _pwg_media_t    *_pwgMediaForPPD(const char *ppd);
 extern const char      *_pwgMediaTypeForType(const char *media_type,
                                              char *name, size_t namesize);
 extern const char      *_pwgPageSizeForMedia(_pwg_media_t *media,
index f360134e0004aa8096f7cd399e75d5dde6e0fb27..bfcb2ff1cba703987be83318c9fbaaa8f8d45cfc 100644 (file)
@@ -663,6 +663,8 @@ ppdOpen2(cups_file_t *fp)           /* I - File to read from */
 
       goto error;
     }
+    else if (!string)
+      continue;
 
    /*
     * Certain main keywords (as defined by the PPD spec) may be used
@@ -1255,7 +1257,7 @@ ppdOpen2(cups_file_t *fp)         /* I - File to read from */
       if (name[0] == '*')
         _cups_strcpy(name, name + 1); /* Eliminate leading asterisk */
 
-      for (i = (int)strlen(name) - 1; i > 0 && isspace(name[i] & 255); i --)
+      for (i = (int)strlen(name) - 1; i > 0 && _cups_isspace(name[i]); i --)
         name[i] = '\0'; /* Eliminate trailing spaces */
 
       DEBUG_printf(("2ppdOpen2: OpenUI of %s in group %s...", name,
@@ -2355,7 +2357,7 @@ ppd_decode(char *string)          /* I - String to decode */
       inptr ++;
       while (isxdigit(*inptr & 255))
       {
-       if (isalpha(*inptr))
+       if (_cups_isalpha(*inptr))
          *outptr = (tolower(*inptr) - 'a' + 10) << 4;
        else
          *outptr = (*inptr - '0') << 4;
@@ -2365,7 +2367,7 @@ ppd_decode(char *string)          /* I - String to decode */
         if (!isxdigit(*inptr & 255))
          break;
 
-       if (isalpha(*inptr))
+       if (_cups_isalpha(*inptr))
          *outptr |= tolower(*inptr) - 'a' + 10;
        else
          *outptr |= *inptr - '0';
@@ -2996,7 +2998,7 @@ ppd_read(cups_file_t    *fp,              /* I - File to read from */
       */
 
       for (lineptr = line->buffer; *lineptr; lineptr ++)
-        if (!isspace(*lineptr & 255))
+        if (*lineptr && !_cups_isspace(*lineptr))
          break;
 
       if (*lineptr)
@@ -3016,7 +3018,7 @@ ppd_read(cups_file_t    *fp,              /* I - File to read from */
 
     keyptr = keyword;
 
-    while (*lineptr != '\0' && *lineptr != ':' && !isspace(*lineptr & 255))
+    while (*lineptr && *lineptr != ':' && !_cups_isspace(*lineptr))
     {
       if (*lineptr <= ' ' || *lineptr > 126 || *lineptr == '/' ||
           (keyptr - keyword) >= (PPD_MAX_NAME - 1))
@@ -3035,18 +3037,18 @@ ppd_read(cups_file_t    *fp,            /* I - File to read from */
 
     mask |= PPD_KEYWORD;
 
-    if (isspace(*lineptr & 255))
+    if (_cups_isspace(*lineptr))
     {
      /*
       * Get an option name...
       */
 
-      while (isspace(*lineptr & 255))
+      while (_cups_isspace(*lineptr))
         lineptr ++;
 
       optptr = option;
 
-      while (*lineptr != '\0' && !isspace(*lineptr & 255) && *lineptr != ':' &&
+      while (*lineptr && !_cups_isspace(*lineptr) && *lineptr != ':' &&
              *lineptr != '/')
       {
        if (*lineptr <= ' ' || *lineptr > 126 ||
@@ -3061,13 +3063,13 @@ ppd_read(cups_file_t    *fp,            /* I - File to read from */
 
       *optptr = '\0';
 
-      if (isspace(*lineptr & 255) && cg->ppd_conform == PPD_CONFORM_STRICT)
+      if (_cups_isspace(*lineptr) && cg->ppd_conform == PPD_CONFORM_STRICT)
       {
         cg->ppd_status = PPD_ILLEGAL_WHITESPACE;
        return (0);
       }
 
-      while (isspace(*lineptr & 255))
+      while (_cups_isspace(*lineptr))
        lineptr ++;
 
       mask |= PPD_OPTION;
@@ -3107,13 +3109,13 @@ ppd_read(cups_file_t    *fp,            /* I - File to read from */
       }
     }
 
-    if (isspace(*lineptr & 255) && cg->ppd_conform == PPD_CONFORM_STRICT)
+    if (_cups_isspace(*lineptr) && cg->ppd_conform == PPD_CONFORM_STRICT)
     {
       cg->ppd_status = PPD_ILLEGAL_WHITESPACE;
       return (0);
     }
 
-    while (isspace(*lineptr & 255))
+    while (_cups_isspace(*lineptr))
       lineptr ++;
 
     if (*lineptr == ':')
@@ -3123,11 +3125,11 @@ ppd_read(cups_file_t    *fp,            /* I - File to read from */
       */
 
       lineptr ++;
-      while (isspace(*lineptr & 255))
+      while (_cups_isspace(*lineptr))
         lineptr ++;
 
       strptr = lineptr + strlen(lineptr) - 1;
-      while (strptr >= lineptr && isspace(*strptr & 255))
+      while (strptr >= lineptr && _cups_isspace(*strptr))
         *strptr-- = '\0';
 
       if (*strptr == '\"')
index 909c90a8e3273fe4155fe2b8846c749d3cee8a81..8e00ca0317ee8e1cbf5d1320d9078046239cd338 100644 (file)
@@ -60,26 +60,26 @@ static int  pwg_compare_ppd(_pwg_media_t *a, _pwg_media_t *b);
 static _pwg_media_t const cups_pwg_media[] =
 {                                      /* Media size lookup table */
   /* North American Standard Sheet Media Sizes */
-  _PWG_MEDIA_IN("na_index-3x5_3x5in", NULL, NULL, 3, 5),
+  _PWG_MEDIA_IN("na_index-3x5_3x5in", NULL, "3x5", 3, 5),
   _PWG_MEDIA_IN("na_personal_3.625x6.5in", NULL, "EnvPersonal", 3.625, 6.5),
   _PWG_MEDIA_IN("na_monarch_3.875x7.5in", "monarch-envelope", "EnvMonarch", 3.875, 7.5),
   _PWG_MEDIA_IN("na_number-9_3.875x8.875in", "na-number-9-envelope", "Env9", 3.875, 8.875),
-  _PWG_MEDIA_IN("na_index-4x6_4x6in", NULL, NULL, 4, 6),
+  _PWG_MEDIA_IN("na_index-4x6_4x6in", NULL, "4x6", 4, 6),
   _PWG_MEDIA_IN("na_number-10_4.125x9.5in", "na-number-10-envelope", "Env10", 4.125, 9.5),
   _PWG_MEDIA_IN("na_a2_4.375x5.75in", NULL, NULL, 4.375, 5.75),
   _PWG_MEDIA_IN("na_number-11_4.5x10.375in", NULL, "Env11", 4.5, 10.375),
   _PWG_MEDIA_IN("na_number-12_4.75x11in", NULL, "Env12", 4.75, 11),
-  _PWG_MEDIA_IN("na_5x7_5x7in", NULL, NULL, 5, 7),
-  _PWG_MEDIA_IN("na_index-5x8_5x8in", NULL, NULL, 5, 8),
+  _PWG_MEDIA_IN("na_5x7_5x7in", NULL, "5x7", 5, 7),
+  _PWG_MEDIA_IN("na_index-5x8_5x8in", NULL, "5x8", 5, 8),
   _PWG_MEDIA_IN("na_number-14_5x11.5in", NULL, "Env14", 5, 11.5),
   _PWG_MEDIA_IN("na_invoice_5.5x8.5in", "invoice", "Statement", 5.5, 8.5),
   _PWG_MEDIA_IN("na_index-4x6-ext_6x8in", NULL, NULL, 6, 8),
-  _PWG_MEDIA_IN("na_6x9_6x9in", "na-6x9-envelope", NULL, 6, 9),
-  _PWG_MEDIA_IN("na_c5_6.5x9.5in", NULL, NULL, 6.5, 9.5),
+  _PWG_MEDIA_IN("na_6x9_6x9in", "na-6x9-envelope", "6x9", 6, 9),
+  _PWG_MEDIA_IN("na_c5_6.5x9.5in", NULL, "6.5x9.5", 6.5, 9.5),
   _PWG_MEDIA_IN("na_7x9_7x9in", "na-7x9-envelope", "7x9", 7, 9),
   _PWG_MEDIA_IN("na_executive_7.25x10.5in", "executive", "Executive", 7.25, 10.5),
   _PWG_MEDIA_IN("na_govt-letter_8x10in", "na-8x10", "8x10", 8, 10),
-  _PWG_MEDIA_IN("na_govt-legal_8x13in", NULL, NULL, 8, 13),
+  _PWG_MEDIA_IN("na_govt-legal_8x13in", NULL, "8x13", 8, 13),
   _PWG_MEDIA_IN("na_quarto_8.5x10.83in", "quarto", "Quarto", 8.5, 10.83),
   _PWG_MEDIA_IN("na_letter_8.5x11in", "na-letter", "Letter", 8.5, 11),
   _PWG_MEDIA_IN("na_fanfold-eur_8.5x12in", NULL, "FanFoldGerman", 8.5, 12),
@@ -94,15 +94,15 @@ static _pwg_media_t const cups_pwg_media[] =
   _PWG_MEDIA_IN("na_10x11_10x11in", NULL, "10x11", 10, 11),
   _PWG_MEDIA_IN("na_10x13_10x13in", "na-10x13-envelope", "10x13", 10, 13),
   _PWG_MEDIA_IN("na_10x14_10x14in", "na-10x14-envelope", "10x14", 10, 14),
-  _PWG_MEDIA_IN("na_10x15_10x15in", "na-10x15-envelope", NULL, 10, 15),
-  _PWG_MEDIA_IN("na_11x12_11x12in", NULL, NULL, 11, 12),
-  _PWG_MEDIA_IN("na_edp_11x14in", NULL, NULL, 11, 14),
+  _PWG_MEDIA_IN("na_10x15_10x15in", "na-10x15-envelope", "10x15", 10, 15),
+  _PWG_MEDIA_IN("na_11x12_11x12in", NULL, "11x12", 11, 12),
+  _PWG_MEDIA_IN("na_edp_11x14in", NULL, "11x14", 11, 14),
   _PWG_MEDIA_IN("na_fanfold-us_11x14.875in", NULL, NULL, 11, 14.875),
-  _PWG_MEDIA_IN("na_11x15_11x15in", NULL, NULL, 11, 15),
+  _PWG_MEDIA_IN("na_11x15_11x15in", NULL, "11x15", 11, 15),
   _PWG_MEDIA_IN("na_ledger_11x17in", "tabloid", "Tabloid", 11, 17),
   _PWG_MEDIA_IN("na_eur-edp_12x14in", NULL, NULL, 12, 14),
   _PWG_MEDIA_IN("na_arch-b_12x18in", "arch-b", "ARCHB", 12, 18),
-  _PWG_MEDIA_IN("na_12x19_12x19in", NULL, NULL, 12, 19),
+  _PWG_MEDIA_IN("na_12x19_12x19in", NULL, "12x19", 12, 19),
   _PWG_MEDIA_IN("na_b-plus_12x19.17in", NULL, "SuperB", 12, 19.17),
   _PWG_MEDIA_IN("na_super-b_13x19in", "super-b", NULL, 13, 19),
   _PWG_MEDIA_IN("na_c_17x22in", "c", "AnsiC", 17, 22),
@@ -113,7 +113,7 @@ static _pwg_media_t const cups_pwg_media[] =
   _PWG_MEDIA_IN("na_wide-format_30x42in", NULL, NULL, 30, 42),
   _PWG_MEDIA_IN("na_e_34x44in", "e", "AnsiE", 34, 44),
   _PWG_MEDIA_IN("na_arch-e_36x48in", "arch-e", "ARCHE", 36, 48),
-  _PWG_MEDIA_IN("na_f_44x68in", NULL, NULL, 44, 68),
+  _PWG_MEDIA_IN("na_f_44x68in", NULL, "AnsiF", 44, 68),
 
   /* Chinese Standard Sheet Media Inch Sizes */
   _PWG_MEDIA_IN("roc_16k_7.75x10.75in", NULL, NULL, 7.75, 10.75),
@@ -353,8 +353,8 @@ _pwgInitSize(_pwg_size_t *size,             /* I - Size to initialize */
     */
 
     if ((media_size = ippFindAttribute(media_col->values[0].collection,
-                                            "media-size",
-                                           IPP_TAG_BEGIN_COLLECTION)) != NULL)
+                                      "media-size",
+                                      IPP_TAG_BEGIN_COLLECTION)) != NULL)
     {
      /*
       * Got media-size, look for x-dimension and y-dimension member
@@ -417,12 +417,42 @@ _pwgInitSize(_pwg_size_t *size,           /* I - Size to initialize */
   else
   {
     if ((media = ippFindAttribute(job, "media", IPP_TAG_NAME)) == NULL)
-      media = ippFindAttribute(job, "media", IPP_TAG_KEYWORD);
+      if ((media = ippFindAttribute(job, "media", IPP_TAG_KEYWORD)) == NULL)
+        if ((media = ippFindAttribute(job, "PageSize", IPP_TAG_NAME)) == NULL)
+         media = ippFindAttribute(job, "PageRegion", IPP_TAG_NAME);
 
     if (media)
     {
-      if ((pwg = _pwgMediaForPWG(media->values[0].string.text)) == NULL)
-       pwg = _pwgMediaForLegacy(media->values[0].string.text);
+      const char *name = media->values[0].string.text;
+                                       /* Name string */
+
+      if ((pwg = _pwgMediaForPWG(name)) == NULL)
+      {
+       /*
+        * Not a PWG name, try a legacy name...
+       */
+
+       if ((pwg = _pwgMediaForLegacy(name)) == NULL)
+       {
+        /*
+         * Not a legacy name, try a PPD name...
+         */
+
+         const char    *suffix;        /* Suffix on media string */
+
+         pwg = _pwgMediaForPPD(name);
+         if (pwg && 
+             (suffix = name + strlen(name) - 10 /* .FullBleed */) > name &&
+             !strcasecmp(suffix, ".FullBleed"))
+         {
+          /*
+           * Indicate that margins are set with the default values of 0.
+           */
+
+           *margins_set = 1;
+         }
+       }
+      }
 
       if (pwg)
       {
@@ -501,7 +531,8 @@ _pwgMediaForLegacy(
 _pwg_media_t *                         /* O - Matching size or NULL */
 _pwgMediaForPPD(const char *ppd)       /* I - PPD size name */
 {
-  _pwg_media_t key;                    /* Search key */
+  _pwg_media_t key,                    /* Search key */
+               *size;                  /* Matching size */
   _cups_globals_t *cg = _cupsGlobals();        /* Global data */
 
 
@@ -518,8 +549,7 @@ _pwgMediaForPPD(const char *ppd)    /* I - PPD size name */
 
   if (!cg->ppd_size_lut)
   {
-    int                        i;              /* Looping var */
-    _pwg_media_t       *size;          /* Current size */
+    int        i;                              /* Looping var */
 
     cg->ppd_size_lut = cupsArrayNew((cups_array_func_t)pwg_compare_ppd, NULL);
 
@@ -536,7 +566,96 @@ _pwgMediaForPPD(const char *ppd)   /* I - PPD size name */
   */
 
   key.ppd = ppd;
-  return ((_pwg_media_t *)cupsArrayFind(cg->ppd_size_lut, &key));
+  if ((size = (_pwg_media_t *)cupsArrayFind(cg->ppd_size_lut, &key)) == NULL)
+  {
+   /*
+    * See if the name is of the form:
+    *
+    *   [Custom.]WIDTHxLENGTH[.FullBleed]    - Size in points/inches [borderless]
+    *   [Custom.]WIDTHxLENGTHcm[.FullBleed]  - Size in centimeters [borderless]
+    *   [Custom.]WIDTHxLENGTHft[.FullBleed]  - Size in feet [borderless]
+    *   [Custom.]WIDTHxLENGTHin[.FullBleed]  - Size in inches [borderless]
+    *   [Custom.]WIDTHxLENGTHm[.FullBleed]   - Size in meters [borderless]
+    *   [Custom.]WIDTHxLENGTHmm[.FullBleed]  - Size in millimeters [borderless]
+    *   [Custom.]WIDTHxLENGTHpt[.FullBleed]  - Size in points [borderless]
+    */
+
+    double             w, l,           /* Width and length of page */
+                       factor;         /* Unit scaling factor */
+    char               *ptr;           /* Pointer into name */
+    struct lconv       *loc;           /* Locale data */
+    int                        custom;         /* Custom page size? */
+
+    if (!strncasecmp(ppd, "Custom.", 7))
+    {
+      custom = 1;
+      factor = 2540.0 / 72.0;
+      ptr    = (char *)ppd + 7;
+    }
+    else
+    {
+      custom = 0;
+      factor = 2540.0;
+      ptr    = (char *)ppd;
+    }
+
+    loc = localeconv();
+    w   = _cupsStrScand(ptr, &ptr, loc);
+
+    if (ptr && ptr > ppd && *ptr == 'x')
+    {
+      l = _cupsStrScand(ptr + 1, &ptr, loc);
+
+      if (ptr &&
+         (!*ptr ||
+          !strcasecmp(ptr, "FullBleed") ||
+          !strcasecmp(ptr, ".FullBleed") ||
+          !strcasecmp(ptr, "cm") ||
+          !strcasecmp(ptr, "cm.FullBleed") ||
+          !strcasecmp(ptr, "ft") ||
+          !strcasecmp(ptr, "ft.FullBleed") ||
+          !strcasecmp(ptr, "in") ||
+          !strcasecmp(ptr, "in.FullBleed") ||
+          !strcasecmp(ptr, "m") ||
+          !strcasecmp(ptr, "m.FullBleed") ||
+          !strcasecmp(ptr, "mm") ||
+          !strcasecmp(ptr, "mm.FullBleed") ||
+          !strcasecmp(ptr, "pt") ||
+          !strcasecmp(ptr, "pt.FullBleed")))
+      {
+       size = &(cg->pwg_media);
+
+       if (!strncasecmp(ptr, "cm", 2))
+         factor = 1000.0;
+       else if (!strncasecmp(ptr, "ft", 2))
+         factor = 2540.0 * 12.0;
+       else if (!strncasecmp(ptr, "in", 2))
+         factor = 2540.0;
+       else if (!strncasecmp(ptr, "mm", 2))
+         factor = 100.0;
+       else if (*ptr == 'm' || *ptr == 'M')
+         factor = 100000.0;
+       else if (!strncasecmp(ptr, "pt", 2))
+         factor = 2540.0 / 72.0;
+
+       /*
+       * Not a standard size; convert it to a PWG custom name of the form:
+       *
+       *     [oe|om]_WIDTHxHEIGHTuu_WIDTHxHEIGHTuu
+       */
+
+       size->width  = (int)(w * factor);
+       size->length = (int)(l * factor);
+       size->pwg    = cg->pwg_name;
+
+       _pwgGenerateSize(cg->pwg_name, sizeof(cg->pwg_name),
+                        custom ? "custom" : NULL, custom ? ppd + 7 : NULL,
+                        size->width, size->length);
+      }
+    }
+  }
+
+  return (size);
 }
 
 
@@ -547,7 +666,9 @@ _pwgMediaForPPD(const char *ppd)    /* I - PPD size name */
 _pwg_media_t *                         /* O - Matching size or NULL */
 _pwgMediaForPWG(const char *pwg)       /* I - PWG size name */
 {
-  _pwg_media_t key;                    /* Search key */
+  char         *ptr;                   /* Pointer into name */
+  _pwg_media_t key,                    /* Search key */
+               *size;                  /* Matching size */
   _cups_globals_t *cg = _cupsGlobals();        /* Global data */
 
 
@@ -564,8 +685,7 @@ _pwgMediaForPWG(const char *pwg)    /* I - PWG size name */
 
   if (!cg->pwg_size_lut)
   {
-    int                        i;              /* Looping var */
-    _pwg_media_t       *size;          /* Current size */
+    int        i;                              /* Looping var */
 
     cg->pwg_size_lut = cupsArrayNew((cups_array_func_t)pwg_compare_pwg, NULL);
 
@@ -581,7 +701,50 @@ _pwgMediaForPWG(const char *pwg)   /* I - PWG size name */
   */
 
   key.pwg = pwg;
-  return ((_pwg_media_t *)cupsArrayFind(cg->pwg_size_lut, &key));
+  if ((size = (_pwg_media_t *)cupsArrayFind(cg->pwg_size_lut, &key)) == NULL &&
+      (ptr = (char *)strchr(pwg, '_')) != NULL &&
+      (ptr = (char *)strchr(ptr + 1, '_')) != NULL)
+  {
+   /*
+    * Try decoding the self-describing name of the form:
+    *
+    * class_name_WWWxHHHin
+    * class_name_WWWxHHHmm
+    */
+
+    double             w, l;           /* Width and length of page */
+    struct lconv       *loc;           /* Locale data */
+
+    ptr ++;
+    loc = localeconv();
+    w   = _cupsStrScand(ptr, &ptr, loc);
+
+    if (ptr && *ptr == 'x')
+    {
+      l = _cupsStrScand(ptr + 1, &ptr, loc);
+
+      if (ptr && (!strcmp(ptr, "in") || !strcmp(ptr, "mm")))
+      {
+       size = &(cg->pwg_media);
+
+       if (!strcmp(ptr, "mm"))
+       {
+         size->width  = (int)(w * 100);
+         size->length = (int)(l * 100);
+       }
+       else
+       {
+         size->width  = (int)(w * 2540);
+         size->length = (int)(l * 2540);
+       }
+
+        strlcpy(cg->pwg_name, pwg, sizeof(cg->pwg_name));
+       size->pwg = cg->pwg_name;
+      }
+    }
+  }
+
+  return (size);
 }
 
 
index 071eb7b175d6e1fa4a4fad209236ffc348ea11a4..9cd27f6e2d5c2674448045889a0576061b03abd2 100644 (file)
 #include <math.h>
 
 
+/*
+ * Macro to test for two almost-equal PWG measurements.
+ */
+
+#define _PWG_EQUIVALENT(x, y)  (abs((x)-(y)) < 2)
+
+
 /*
  * Local functions...
  */
@@ -62,7 +69,7 @@ static void   pwg_unppdize_name(const char *ppd, char *name, size_t namesize);
 _pwg_t *                               /* O - PWG mapping data */
 _pwgCreateWithPPD(ppd_file_t *ppd)     /* I - PPD file */
 {
-  int                  i, j;           /* Looping vars */
+  int                  i, j, k;        /* Looping vars */
   _pwg_t               *pwg;           /* PWG mapping data */
   ppd_option_t         *input_slot,    /* InputSlot option */
                        *media_type,    /* MediaType option */
@@ -85,6 +92,19 @@ _pwgCreateWithPPD(ppd_file_t *ppd)   /* I - PPD file */
   _pwg_output_mode_t   pwg_output_mode;/* output-mode index */
   _pwg_print_quality_t pwg_print_quality;
                                        /* print-quality index */
+  int                  similar;        /* Are the old and new size similar? */
+  _pwg_size_t           *old_size;     /* Current old size */
+  int                  old_imageable,  /* Old imageable length in 2540ths */
+                       old_borderless; /* Old borderless state */
+  int                  new_width,      /* New width in 2540ths */
+                       new_length,     /* New length in 2540ths */
+                       new_left,       /* New left margin in 2540ths */
+                       new_bottom,     /* New bottom margin in 2540ths */
+                       new_right,      /* New right margin in 2540ths */
+                       new_top,        /* New top margin in 2540ths */
+                       new_imageable,  /* New imageable length in 2540ths */
+                       new_borderless; /* New borderless state */
+  _pwg_size_t           *new_size;     /* New size to add, if any */
 
 
   DEBUG_printf(("_pwgCreateWithPPD(ppd=%p)", ppd));
@@ -133,7 +153,7 @@ _pwgCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
 
     if (!strcasecmp(ppd_size->name, "Custom"))
       continue;
-
+       
    /*
     * Convert the PPD size name to the corresponding PWG keyword name.
     */
@@ -162,6 +182,7 @@ _pwgCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
     }
     else
     {
+
      /*
       * Not a standard name; convert it to a PWG vendor name of the form:
       *
@@ -177,20 +198,71 @@ _pwgCreateWithPPD(ppd_file_t *ppd)        /* I - PPD file */
     }
 
    /*
-    * Save this size...
+    * If we have a similar paper with non-zero margins then we only
+    * want to keep it if it has a larger imageable area length.
     */
 
-    pwg_size->map.ppd = _cupsStrAlloc(ppd_size->name);
-    pwg_size->map.pwg = _cupsStrAlloc(pwg_name);
-    pwg_size->width   = _PWG_FROMPTS(ppd_size->width);
-    pwg_size->length  = _PWG_FROMPTS(ppd_size->length);
-    pwg_size->left    = _PWG_FROMPTS(ppd_size->left);
-    pwg_size->bottom  = _PWG_FROMPTS(ppd_size->bottom);
-    pwg_size->right   = _PWG_FROMPTS(ppd_size->width - ppd_size->right);
-    pwg_size->top     = _PWG_FROMPTS(ppd_size->length - ppd_size->top);
-
-    pwg->num_sizes ++;
-    pwg_size ++;
+    new_width      = _PWG_FROMPTS(ppd_size->width);
+    new_length     = _PWG_FROMPTS(ppd_size->length);
+    new_left       = _PWG_FROMPTS(ppd_size->left);
+    new_bottom     = _PWG_FROMPTS(ppd_size->bottom);
+    new_right      = _PWG_FROMPTS(ppd_size->width - ppd_size->right);
+    new_top        = _PWG_FROMPTS(ppd_size->length - ppd_size->top);
+    new_imageable  = new_length - new_top - new_bottom;
+    new_borderless = new_bottom == 0 && new_top == 0 &&
+                     new_left == 0 && new_right == 0;
+
+    for (k = pwg->num_sizes, similar = 0, old_size = pwg->sizes, new_size = NULL;
+         k > 0 && !similar;
+         k --, old_size ++)
+    {
+      old_imageable  = old_size->length - old_size->top - old_size->bottom;
+      old_borderless = old_size->left == 0 && old_size->bottom == 0 &&
+                      old_size->right == 0 && old_size->top == 0;
+
+      similar = old_borderless == new_borderless &&
+                _PWG_EQUIVALENT(old_size->width, new_width) &&
+               _PWG_EQUIVALENT(old_size->length, new_length);
+
+      if (similar && new_imageable > old_imageable)
+      {
+       /*
+       * The new paper has a larger imageable area so it will replace
+       * the older paper.
+       */
+
+       new_size = old_size;
+       _cupsStrFree(old_size->map.ppd);
+       _cupsStrFree(old_size->map.pwg);
+      }
+    }
+
+    if (!similar)
+    {
+     /*
+      * The paper was unique enough to deserve its own entry so add it to the
+      * end.
+      */
+
+      new_size = pwg_size ++;
+      pwg->num_sizes ++;
+    } 
+
+    if (new_size)
+    {
+     /*
+      * Save this size...
+      */
+
+      new_size->map.ppd = _cupsStrAlloc(ppd_size->name);
+      new_size->map.pwg = _cupsStrAlloc(pwg_name);
+      new_size->width   = new_width;
+      new_size->length  = new_length;
+      new_size->left    = new_left;
+      new_size->bottom  = new_bottom;
+      new_size->right   = new_right;
+      new_size->top     = new_top;
+    }
   }
 
   if (ppd->variable_sizes)
@@ -387,7 +459,9 @@ _pwgCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
 
     const char *quality,               /* com.apple.print.preset.quality value */
                *output_mode,           /* com.apple.print.preset.output-mode value */
-               *color_model_val;       /* ColorModel choice */
+               *color_model_val,       /* ColorModel choice */
+               *graphics_type,         /* com.apple.print.preset.graphicsType value */
+               *paper_coating;         /* com.apple.print.preset.media-front-coating value */
 
 
     do
@@ -409,6 +483,31 @@ _pwgCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
        else
          pwg_print_quality = _PWG_PRINT_QUALITY_NORMAL;
 
+       /*
+       * Ignore graphicsType "Photo" presets that are not high quality.
+       */
+
+       graphics_type = cupsGetOption("com.apple.print.preset.graphicsType",
+                                     num_options, options);
+
+       if (pwg_print_quality != _PWG_PRINT_QUALITY_HIGH && graphics_type &&
+           !strcmp(graphics_type, "Photo"))
+         continue;
+
+       /*
+       * Ignore presets for normal and draft quality where the coating
+       * isn't "none" or "autodetect".
+       */
+
+       paper_coating = cupsGetOption(
+                           "com.apple.print.preset.media-front-coating",
+                           num_options, options);
+
+        if (pwg_print_quality != _PWG_PRINT_QUALITY_HIGH && paper_coating &&
+           strcmp(paper_coating, "none") &&
+           strcmp(paper_coating, "autodetect"))                
+         continue;
+
        /*
         * Get the output mode for this preset...
        */
@@ -804,6 +903,7 @@ _pwgGetPageSize(_pwg_t     *pwg,    /* I - PWG mapping data */
                dtop,                   /* Difference in top margins */
                dmin,                   /* Minimum difference */
                dclosest;               /* Closest difference */
+  const char   *ppd_name;              /* PPD media name */
 
 
  /*
@@ -816,6 +916,36 @@ _pwgGetPageSize(_pwg_t     *pwg,   /* I - PWG mapping data */
   if (exact)
     *exact = 0;
 
+  ppd_name = keyword;
+
+  if (job)
+  {
+   /*
+    * Try getting the PPD media name from the job attributes...
+    */
+
+    ipp_attribute_t    *attr;          /* Job attribute */
+
+    if ((attr = ippFindAttribute(job, "PageSize", IPP_TAG_ZERO)) == NULL)
+      if ((attr = ippFindAttribute(job, "PageRegion", IPP_TAG_ZERO)) == NULL)
+        attr = ippFindAttribute(job, "media", IPP_TAG_ZERO);
+
+    if (attr && (attr->value_tag == IPP_TAG_NAME ||
+                 attr->value_tag == IPP_TAG_KEYWORD))
+      ppd_name = attr->values[0].string.text;
+  }
+
+  if (ppd_name)
+  {
+   /*
+    * Try looking up the named PPD size first...
+    */
+
+    for (i = pwg->num_sizes, size = pwg->sizes; i > 0; i --, size ++)
+      if (!strcasecmp(ppd_name, size->map.ppd))
+        return (ppd_name);
+  }
+
   if (job && !keyword)
   {
    /*
@@ -837,7 +967,8 @@ _pwgGetPageSize(_pwg_t     *pwg,    /* I - PWG mapping data */
 
     if ((media = _pwgMediaForPWG(keyword)) == NULL)
       if ((media = _pwgMediaForLegacy(keyword)) == NULL)
-        return (NULL);
+        if ((media = _pwgMediaForPPD(keyword)) == NULL)
+         return (NULL);
 
     jobsize.width  = media->width;
     jobsize.length = media->length;
@@ -1223,7 +1354,7 @@ _pwgPageSizeForMedia(
   else if (!media->pwg || !strncmp(media->pwg, "custom_", 7) ||
            (sizeptr = strchr(media->pwg, '_')) == NULL ||
           (dimptr = strchr(sizeptr + 1, '_')) == NULL ||
-          (dimptr - sizeptr) > namesize)
+          (size_t)(dimptr - sizeptr) > namesize)
   {
    /*
     * Use a name of the form "wNNNhNNN"...
@@ -1263,7 +1394,7 @@ pwg_ppdize_name(const char *ipp,  /* I - IPP keyword */
 
   for (ptr = name + 1, end = name + namesize - 1; *ipp && ptr < end;)
   {
-    if (*ipp == '-' && isalpha(ipp[1] & 255))
+    if (*ipp == '-' && _cups_isalpha(ipp[1]))
     {
       ipp ++;
       *ptr++ = toupper(*ipp++ & 255);
@@ -1291,13 +1422,13 @@ pwg_unppdize_name(const char *ppd,      /* I - PPD keyword */
 
   for (ptr = name, end = name + namesize - 1; *ppd && ptr < end; ppd ++)
   {
-    if (isalnum(*ppd & 255) || *ppd == '-' || *ppd == '.')
+    if (_cups_isalnum(*ppd) || *ppd == '-')
       *ptr++ = tolower(*ppd & 255);
-    else if (*ppd == '_')
+    else if (*ppd == '_' || *ppd == '.')
       *ptr++ = '-';
 
-    if (!isupper(*ppd & 255) && isalnum(*ppd & 255) &&
-       isupper(ppd[1] & 255) && ptr < end)
+    if (!_cups_isupper(*ppd) && _cups_isalnum(*ppd) &&
+       _cups_isupper(ppd[1]) && ptr < end)
       *ptr++ = '-';
   }
 
index 33a0790aff4fe8a8c56051411009eea85537f01c..41849b48ccddbc6720bf04e553299a840a833452 100644 (file)
@@ -86,6 +86,7 @@ extern void           _pwgGenerateSize(char *keyword, size_t keysize,
 extern int             _pwgInitSize(_pwg_size_t *size, ipp_t *job,
                                     int *margins_set);
 extern _pwg_media_t    *_pwgMediaForLegacy(const char *legacy);
+extern _pwg_media_t    *_pwgMediaForPPD(const char *ppd);
 extern _pwg_media_t    *_pwgMediaForPWG(const char *pwg);
 extern _pwg_media_t    *_pwgMediaForSize(int width, int length);
 
index 4285eeb872842d8e8b2ac41be9e177f038407a90..3320131fbc8203ac8ec7816e7f0ce2acc0b43b5e 100644 (file)
@@ -438,7 +438,7 @@ cupsGetResponse(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
       DEBUG_puts("2cupsGetResponse: Need authorization...");
 
       if (!cupsDoAuthentication(http, "POST", resource))
-       httpReconnect(http);
+        httpReconnect(http);
       else
         status = HTTP_AUTHORIZATION_CANCELED;
     }
@@ -969,10 +969,13 @@ _cupsSetHTTPError(http_status_t status)   /* I - HTTP status code */
        break;
 
     case HTTP_UNAUTHORIZED :
-    case HTTP_AUTHORIZATION_CANCELED :
        _cupsSetError(IPP_NOT_AUTHORIZED, httpStatus(status), 0);
        break;
 
+    case HTTP_AUTHORIZATION_CANCELED :
+       _cupsSetError(IPP_AUTHORIZATION_CANCELED, httpStatus(status), 0);
+       break;
+
     case HTTP_FORBIDDEN :
        _cupsSetError(IPP_FORBIDDEN, httpStatus(status), 0);
        break;
@@ -993,6 +996,14 @@ _cupsSetHTTPError(http_status_t status)    /* I - HTTP status code */
        _cupsSetError(IPP_VERSION_NOT_SUPPORTED, httpStatus(status), 0);
        break;
 
+    case HTTP_UPGRADE_REQUIRED :
+       _cupsSetError(IPP_UPGRADE_REQUIRED, httpStatus(status), 0);
+        break;
+
+    case HTTP_PKI_ERROR :
+       _cupsSetError(IPP_PKI_ERROR, httpStatus(status), 0);
+        break;
+
     default :
        DEBUG_printf(("4_cupsSetHTTPError: HTTP error %d mapped to "
                      "IPP_SERVICE_UNAVAILABLE!", status));
index d542d89afe7166748ef7155800d2882237a66cf6..9c3acd324b9dd15df0d58b120bb40bed022d1b86 100644 (file)
@@ -79,6 +79,62 @@ typedef struct _cups_sp_item_s               /**** String Pool Item ****/
 } _cups_sp_item_t;
 
 
+/*
+ * Replacements for the ctype macros that are not affected by locale, since we
+ * really only care about testing for ASCII characters when parsing files, etc.
+ * These are used only within libcups since the rest of CUPS doesn't call
+ * setlocale() for LC_CTYPE and doesn't have to worry about third-party
+ * libraries doing so (and if they do that is a bug: NetSNMP, I'm looking at
+ * you!)
+ *
+ * The _CUPS_INLINE definition controls whether we get an inline function body,
+ * and external function body, or an external definition.
+ */
+
+#  if defined(__GNUC__) || __STDC_VERSION__ >= 199901L
+#    define _CUPS_INLINE static inline
+#  elif defined(_MSC_VER)
+#    define _CUPS_INLINE static __inline
+#  elif defined(_CUPS_STRING_C_)
+#    define _CUPS_INLINE
+#  endif /* __GNUC__ || __STDC_VERSION__ */
+
+#  ifdef _CUPS_INLINE
+_CUPS_INLINE int                       /* O - 1 on match, 0 otherwise */
+_cups_isalnum(int ch)                  /* I - Character to test */
+{
+  return ((ch >= '0' && ch <= '9') ||
+          (ch >= 'A' && ch <= 'Z') ||
+          (ch >= 'a' && ch <= 'z'));
+}
+
+_CUPS_INLINE int                       /* O - 1 on match, 0 otherwise */
+_cups_isalpha(int ch)                  /* I - Character to test */
+{
+  return ((ch >= 'A' && ch <= 'Z') ||
+          (ch >= 'a' && ch <= 'z'));
+}
+
+_CUPS_INLINE int                       /* O - 1 on match, 0 otherwise */
+_cups_isspace(int ch)                  /* I - Character to test */
+{
+  return (ch == ' ' || ch == '\f' || ch == '\n' || ch == '\r' || ch == '\t' ||
+          ch == '\v');
+}
+
+_CUPS_INLINE int                       /* O - 1 on match, 0 otherwise */
+_cups_isupper(int ch)                  /* I - Character to test */
+{
+  return (ch >= 'A' && ch <= 'Z');
+}
+#  else
+extern int _cups_isalnum(int ch);
+extern int _cups_isalpha(int ch);
+extern int _cups_isspace(int ch);
+extern int _cups_isupper(int ch);
+#  endif /* _CUPS_INLINE */
+
+
 /*
  * Prototypes...
  */
index 96f6728a84dec6cdf967948653711838f9c2d763..f40f5f5fb5c9ae6af8398756b026366005e06749 100644 (file)
@@ -36,6 +36,7 @@
  * Include necessary headers...
  */
 
+#define _CUPS_STRING_C_
 #include "string-private.h"
 #include "debug-private.h"
 #include "thread-private.h"
@@ -401,7 +402,7 @@ _cupsStrScand(const char   *buf,    /* I - Pointer to number */
   * Skip leading whitespace...
   */
 
-  while (isspace(*buf & 255))
+  while (_cups_isspace(*buf))
     buf ++;
 
  /*
index 74da14b64b4767c447c6b63d509c0d3db93ff53b..fd0858dea55757f1cadcb7bc860cb79cdea2868a 100644 (file)
@@ -469,7 +469,7 @@ read_write_tests(int compression)   /* I - Use compression? */
   * Initialize the write buffer with random data...
   */
 
-  CUPS_SRAND(time(NULL));
+  CUPS_SRAND((unsigned)time(NULL));
 
   for (i = 0; i < (int)sizeof(writebuf); i ++)
     writebuf[i] = CUPS_RAND();
index b4213d9907753124c72dc7f1eabcbeac59078832..ccb7c19dd210391f814c74cc7c478604451f7771 100644 (file)
@@ -93,6 +93,8 @@ static uri_test_t     uri_tests[] =   /* URI test data */
                            "http", "", "server", "/admin?DEVICE_URI=usb://HP/Photosmart%25202600%2520series?serial=MY53OK70V10400", 80, 0 },
                          { HTTP_URI_OK, "lpd://Acme%20Laser%20(01%3A23%3A45).local._tcp._printer/",
                            "lpd", "", "Acme Laser (01:23:45).local._tcp._printer", "/", 515, 0 },
+                         { HTTP_URI_OK, "ipp://HP%20Officejet%204500%20G510n-z%20%40%20Will's%20MacBook%20Pro%2015%22._ipp._tcp.local./",
+                           "ipp", "", "HP Officejet 4500 G510n-z @ Will's MacBook Pro 15\"._ipp._tcp.local.", "/", 631, 0 },
 
                          /* Missing scheme */
                          { HTTP_URI_MISSING_SCHEME, "/path/to/file/index.html",
index 051d734cda0c565277572b190d033569cb1f6743..c77033613425c5c060788164ce9261dfac1266e7 100644 (file)
@@ -94,6 +94,101 @@ main(int  argc,                             /* I - Number of command-line args */
     puts("PASS");
   }
 
+  fputs("_pwgMediaForPWG(\"iso_a4_210x297mm\"): ", stdout);
+  if ((pwgmedia = _pwgMediaForPWG("iso_a4_210x297mm")) == NULL)
+  {
+    puts("FAIL (not found)");
+    status ++;
+  }
+  else if (strcmp(pwgmedia->pwg, "iso_a4_210x297mm"))
+  {
+    printf("FAIL (%s)\n", pwgmedia->pwg);
+    status ++;
+  }
+  else if (pwgmedia->width != 21000 || pwgmedia->length != 29700)
+  {
+    printf("FAIL (%dx%d)\n", pwgmedia->width, pwgmedia->length);
+    status ++;
+  }
+  else
+    puts("PASS");
+
+  fputs("_pwgMediaForLegacy(\"na-letter\"): ", stdout);
+  if ((pwgmedia = _pwgMediaForLegacy("na-letter")) == NULL)
+  {
+    puts("FAIL (not found)");
+    status ++;
+  }
+  else if (strcmp(pwgmedia->pwg, "na_letter_8.5x11in"))
+  {
+    printf("FAIL (%s)\n", pwgmedia->pwg);
+    status ++;
+  }
+  else if (pwgmedia->width != 21590 || pwgmedia->length != 27940)
+  {
+    printf("FAIL (%dx%d)\n", pwgmedia->width, pwgmedia->length);
+    status ++;
+  }
+  else
+    puts("PASS");
+
+  fputs("_pwgMediaForPPD(\"4x6\"): ", stdout);
+  if ((pwgmedia = _pwgMediaForPPD("4x6")) == NULL)
+  {
+    puts("FAIL (not found)");
+    status ++;
+  }
+  else if (strcmp(pwgmedia->pwg, "na_index-4x6_4x6in"))
+  {
+    printf("FAIL (%s)\n", pwgmedia->pwg);
+    status ++;
+  }
+  else if (pwgmedia->width != 10160 || pwgmedia->length != 15240)
+  {
+    printf("FAIL (%dx%d)\n", pwgmedia->width, pwgmedia->length);
+    status ++;
+  }
+  else
+    puts("PASS");
+
+  fputs("_pwgMediaForPPD(\"10x15cm\"): ", stdout);
+  if ((pwgmedia = _pwgMediaForPPD("10x15cm")) == NULL)
+  {
+    puts("FAIL (not found)");
+    status ++;
+  }
+  else if (strcmp(pwgmedia->pwg, "om_100x150mm_100x150mm"))
+  {
+    printf("FAIL (%s)\n", pwgmedia->pwg);
+    status ++;
+  }
+  else if (pwgmedia->width != 10000 || pwgmedia->length != 15000)
+  {
+    printf("FAIL (%dx%d)\n", pwgmedia->width, pwgmedia->length);
+    status ++;
+  }
+  else
+    puts("PASS");
+
+  fputs("_pwgMediaForPPD(\"Custom.10x15cm\"): ", stdout);
+  if ((pwgmedia = _pwgMediaForPPD("Custom.10x15cm")) == NULL)
+  {
+    puts("FAIL (not found)");
+    status ++;
+  }
+  else if (strcmp(pwgmedia->pwg, "custom_10x15cm_100x150mm"))
+  {
+    printf("FAIL (%s)\n", pwgmedia->pwg);
+    status ++;
+  }
+  else if (pwgmedia->width != 10000 || pwgmedia->length != 15000)
+  {
+    printf("FAIL (%dx%d)\n", pwgmedia->width, pwgmedia->length);
+    status ++;
+  }
+  else
+    puts("PASS");
+
   fputs("_pwgMediaForSize(29700, 42000): ", stdout);
   if ((pwgmedia = _pwgMediaForSize(29700, 42000)) == NULL)
   {
index f437dfe09c6acfa6232f0dd7a61d7ce4caa0235b..a24c8a851c66b68b350ade7f99fef8e127bd813c 100644 (file)
@@ -88,8 +88,10 @@ cupsCharsetToUTF8(
     const cups_encoding_t encoding)    /* I - Encoding */
 {
   cups_utf8_t  *destptr;               /* Pointer into UTF-8 buffer */
+#ifdef HAVE_ICONV_H 
   size_t       srclen,                 /* Length of source string */
                outBytesLeft;           /* Bytes remaining in output buffer */
+#endif /* HAVE_ICONV_H */
 
 
  /*
@@ -206,8 +208,10 @@ cupsUTF8ToCharset(
     const cups_encoding_t encoding)    /* I - Encoding */
 {
   char         *destptr;               /* Pointer into destination */
+#ifdef HAVE_ICONV_H 
   size_t       srclen,                 /* Length of source string */
                outBytesLeft;           /* Bytes remaining in output buffer */
+#endif /* HAVE_ICONV_H */
 
 
  /*
index 4a774c7d8e237772d1ddf945e5928014696fd2f0..abee546c3b236ea54503103a5cbf3097b2978e99 100644 (file)
  *                             password callback.
  *   cupsServer()            - Return the hostname/address of the current
  *                             server.
+ *   cupsSetClientCertCB()   - Set the client certificate callback.
  *   cupsSetEncryption()     - Set the encryption preference.
  *   cupsSetPasswordCB()     - Set the password callback for CUPS.
  *   cupsSetPasswordCB2()    - Set the advanced password callback for CUPS.
  *   cupsSetServer()         - Set the default server name and port.
+ *   cupsSetServerCertCB()   - Set the server certificate callback.
  *   cupsSetUser()           - Set the default user name.
  *   cupsUser()              - Return the current user's name.
  *   _cupsGetPassword()      - Get a password from the user.
 static void    cups_read_client_conf(cups_file_t *fp,
                                      _cups_globals_t *cg,
                                      const char *cups_encryption,
-                                     const char *cups_server);
+                                     const char *cups_server,
+                                     const char *cups_anyroot,
+                                     const char *cups_expiredroot,
+                                     const char *cups_expiredcerts);
 
 
 /*
@@ -167,6 +172,59 @@ cupsServer(void)
 }
 
 
+/*
+ * 'cupsSetClientCertCB()' - Set the client certificate callback.
+ *
+ * Pass @code NULL@ to restore the default callback.
+ *
+ * Note: The current certificate callback is tracked separately for each thread
+ * in a program. Multi-threaded programs that override the callback need to do
+ * so in each thread for the same callback to be used.
+ *
+ * @since CUPS 1.5@
+ */
+
+void
+cupsSetClientCertCB(
+    cups_client_cert_cb_t cb,          /* I - Callback function */
+    void                  *user_data)  /* I - User data pointer */
+{
+  _cups_globals_t *cg = _cupsGlobals();        /* Pointer to library globals */
+
+
+  cg->client_cert_cb   = cb;
+  cg->client_cert_data = user_data;
+}
+
+
+/*
+ * 'cupsSetCredentials()' - Set the default credentials to be used for SSL/TLS
+ *                         connections.
+ *
+ * Note: The default credentials are tracked separately for each thread in a
+ * program. Multi-threaded programs that override the setting need to do so in
+ * each thread for the same setting to be used.
+ *
+ * @since CUPS 1.5@
+ */
+
+int                                    /* O - Status of call (0 = success) */
+cupsSetCredentials(
+    cups_array_t *credentials)         /* I - Array of credentials */
+{
+  _cups_globals_t *cg = _cupsGlobals();        /* Pointer to library globals */
+
+
+  if (cupsArrayCount(credentials) < 1)
+    return (-1);
+
+  _httpFreeCredentials(cg->tls_credentials);
+  cg->tls_credentials = _httpConvertCredentials(credentials);
+
+  return (cg->tls_credentials ? 0 : -1);
+}
+
+
 /*
  * 'cupsSetEncryption()' - Set the encryption preference.
  *
@@ -305,6 +363,31 @@ cupsSetServer(const char *server)  /* I - Server name */
 }
 
 
+/*
+ * 'cupsSetServerCertCB()' - Set the server certificate callback.
+ *
+ * Pass @code NULL@ to restore the default callback.
+ *
+ * Note: The current credentials callback is tracked separately for each thread
+ * in a program. Multi-threaded programs that override the callback need to do
+ * so in each thread for the same callback to be used.
+ *
+ * @since CUPS 1.5@
+ */
+
+void
+cupsSetServerCertCB(
+    cups_server_cert_cb_t cb,          /* I - Callback function */
+    void                 *user_data)   /* I - User data pointer */
+{
+  _cups_globals_t *cg = _cupsGlobals();        /* Pointer to library globals */
+
+
+  cg->server_cert_cb   = cb;
+  cg->server_cert_data = user_data;
+}
+
+
 /*
  * 'cupsSetUser()' - Set the default user name.
  *
@@ -410,10 +493,17 @@ _cupsGetPassword(const char *prompt)      /* I - Prompt string */
 
 #else
  /*
-  * Use the standard getpass function to get a password from the console.
+  * Use the standard getpass function to get a password from the console.  An
+  * empty password is treated as canceling the authentication request.
   */
 
-  return (getpass(prompt));
+  const char   *password = getpass(prompt);
+                                       /* Password string */
+
+  if (!password || !password[0])
+    return (NULL);
+  else
+    return (password);
 #endif /* WIN32 */
 }
 
@@ -428,7 +518,10 @@ _cupsSetDefaults(void)
   cups_file_t  *fp;                    /* File */
   const char   *home,                  /* Home directory of user */
                *cups_encryption,       /* CUPS_ENCRYPTION env var */
-               *cups_server;           /* CUPS_SERVER env var */
+               *cups_server,           /* CUPS_SERVER env var */
+               *cups_anyroot,          /* CUPS_ANYROOT env var */
+               *cups_expiredroot,      /* CUPS_EXPIREDROOT env var */
+               *cups_expiredcerts;     /* CUPS_EXPIREDCERTS env var */
   char         filename[1024];         /* Filename */
   _cups_globals_t *cg = _cupsGlobals();        /* Pointer to library globals */
 
@@ -439,8 +532,11 @@ _cupsSetDefaults(void)
   * First collect environment variables...
   */
 
-  cups_encryption = getenv("CUPS_ENCRYPTION");
-  cups_server     = getenv("CUPS_SERVER");
+  cups_encryption   = getenv("CUPS_ENCRYPTION");
+  cups_server      = getenv("CUPS_SERVER");
+  cups_anyroot     = getenv("CUPS_ANYROOT");
+  cups_expiredroot  = getenv("CUPS_EXPIREDROOT");
+  cups_expiredcerts = getenv("CUPS_EXPIREDCERTS");
 
  /*
   * Then, if needed, the .cups/client.conf or .cupsrc file in the home
@@ -457,7 +553,10 @@ _cupsSetDefaults(void)
     snprintf(filename, sizeof(filename), "%s/.cups/client.conf", home);
     if ((fp = cupsFileOpen(filename, "r")) != NULL)
     {
-      cups_read_client_conf(fp, cg, cups_encryption, cups_server);
+      cups_read_client_conf(fp, cg, cups_encryption, cups_server,
+                           cups_anyroot, cups_expiredroot,
+                           cups_expiredcerts);
+
       cupsFileClose(fp);
     }
   }
@@ -472,7 +571,9 @@ _cupsSetDefaults(void)
     snprintf(filename, sizeof(filename), "%s/client.conf", cg->cups_serverroot);
     if ((fp = cupsFileOpen(filename, "r")) != NULL)
     {
-      cups_read_client_conf(fp, cg, cups_encryption, cups_server);
+      cups_read_client_conf(fp, cg, cups_encryption, cups_server,
+                           cups_anyroot, cups_expiredroot,
+                           cups_expiredcerts);
       cupsFileClose(fp);
     }
   }
@@ -536,13 +637,19 @@ cups_read_client_conf(
     cups_file_t     *fp,               /* I - File to read */
     _cups_globals_t *cg,               /* I - Global data */
     const char      *cups_encryption,  /* I - CUPS_ENCRYPTION env var */
-    const char      *cups_server)      /* I - CUPS_SERVER env var */
+    const char      *cups_server,      /* I - CUPS_SERVER env var */
+    const char     *cups_anyroot,      /* I - CUPS_ANYROOT env var */
+    const char     *cups_expiredroot,  /* I - CUPS_EXPIREDROOT env var */
+    const char     *cups_expiredcerts) /* I - CUPS_EXPIREDCERTS env var */
 {
   int  linenum;                        /* Current line number */
   char line[1024],                     /* Line from file */
         *value,                                /* Pointer into line */
        encryption[1024],               /* Encryption value */
-       server_name[1024];              /* ServerName value */
+       server_name[1024],              /* ServerName value */
+       any_root[1024],                 /* AllowAnyRoot value */
+       expired_root[1024],             /* AllowExpiredRoot value */
+       expired_certs[1024];            /* AllowExpiredCerts value */
 
 
  /*
@@ -564,6 +671,23 @@ cups_read_client_conf(
       strlcpy(server_name, value, sizeof(server_name));
       cups_server = server_name;
     }
+    else if (!cups_anyroot && !strcasecmp(line, "AllowAnyRoot") && value)
+    {
+      strlcpy(any_root, value, sizeof(any_root));
+      cups_anyroot = any_root;
+    }
+    else if (!cups_expiredroot && !strcasecmp(line, "AllowExpiredRoot") &&
+             value)
+    {
+      strlcpy(expired_root, value, sizeof(expired_root));
+      cups_expiredroot = expired_root;
+    }
+    else if (!cups_expiredcerts && !strcasecmp(line, "AllowExpiredCerts") &&
+             value)
+    {
+      strlcpy(expired_certs, value, sizeof(expired_certs));
+      cups_expiredcerts = expired_certs;
+    }
   }
 
  /*
@@ -613,6 +737,21 @@ cups_read_client_conf(
     if (!cg->ipp_port && value)
       cg->ipp_port = atoi(value);
   }
+
+  if (cups_anyroot)
+    cg->any_root = !strcasecmp(cups_anyroot, "yes") ||
+                  !strcasecmp(cups_anyroot, "on")  ||
+                  !strcasecmp(cups_anyroot, "true");
+
+  if (cups_expiredroot)
+    cg->expired_root  = !strcasecmp(cups_expiredroot, "yes") ||
+                       !strcasecmp(cups_expiredroot, "on")  ||
+                       !strcasecmp(cups_expiredroot, "true");
+
+  if (cups_expiredcerts)
+    cg->expired_certs = !strcasecmp(cups_expiredcerts, "yes") ||
+                       !strcasecmp(cups_expiredcerts, "on")  ||
+                       !strcasecmp(cups_expiredcerts, "true");
 }
 
 
index 323fea5a838d43dbb31416ff4295af103ba1dd87..92a0a52eb4f2afb391bf1f790430ef553c8eb41d 100644 (file)
@@ -20,8 +20,8 @@
 /*
  * This header defines several constants - _CUPS_DEPRECATED,
  * _CUPS_API_1_1, _CUPS_API_1_1_19, _CUPS_API_1_1_20, _CUPS_API_1_1_21,
- * _CUPS_API_1_2, _CUPS_API_1_3, _CUPS_API_1_4 - which add compiler-
- * specific attributes that flag functions that are deprecated or added
+ * _CUPS_API_1_2, _CUPS_API_1_3, _CUPS_API_1_4, _CUPS_API_1_5 - which add
+ * compiler-specific attributes that flag functions that are deprecated or added
  * in particular releases.
  *
  * On Mac OS X, the _CUPS_API_* constants are defined based on the values of
 #    ifndef AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
 #      define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER __attribute__((unavailable))
 #    endif /* !AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER */
+#    ifndef AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
+#      define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER __attribute__((unavailable))
+#    endif /* !AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER */
 #    define _CUPS_API_1_1_19 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 #    define _CUPS_API_1_1_20 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
 #    define _CUPS_API_1_1_21 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
 #    define _CUPS_API_1_2 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER
 #    define _CUPS_API_1_3 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER
 #    define _CUPS_API_1_4 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
-#    define _CUPS_API_1_5
+#    define _CUPS_API_1_5 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
 #  else
 #    define _CUPS_API_1_1_19
 #    define _CUPS_API_1_1_20
index 07350e3fca3f4f6e5d265b320768b14b1b15b4aa..15a79cb1f61091378bdeb504e71b4358be1d246f 100644 (file)
@@ -28,6 +28,7 @@ WEBIMAGES     =       \
                        images/color-wheel.png \
                        images/cups.png \
                        images/cups-icon.png \
+                       images/generic.png \
                        images/left.gif \
                        images/right.gif \
                        images/sel.gif \
index 7d12f2f0bea73075d7a68a2fb444f38f705fc130..20783b950c74793f2b41f12ac48adbb132d69fc2 100644 (file)
@@ -1,65 +1,65 @@
 # DO NOT DELETE
 
 commandtoescpx.o: ../cups/cups.h ../cups/file.h ../cups/versioning.h
-commandtoescpx.o: ../cups/ipp.h ../cups/http.h ../cups/language.h
-commandtoescpx.o: ../cups/array.h driver.h ../cups/raster.h ../cups/cups.h
+commandtoescpx.o: ../cups/ipp.h ../cups/http.h ../cups/array.h
+commandtoescpx.o: ../cups/language.h driver.h ../cups/raster.h ../cups/cups.h
 commandtoescpx.o: ../cups/ppd.h ../cups/string-private.h ../config.h
 commandtoescpx.o: ../data/escp.h
 commandtopclx.o: ../cups/cups.h ../cups/file.h ../cups/versioning.h
-commandtopclx.o: ../cups/ipp.h ../cups/http.h ../cups/language.h
-commandtopclx.o: ../cups/array.h driver.h ../cups/raster.h ../cups/cups.h
+commandtopclx.o: ../cups/ipp.h ../cups/http.h ../cups/array.h
+commandtopclx.o: ../cups/language.h driver.h ../cups/raster.h ../cups/cups.h
 commandtopclx.o: ../cups/ppd.h ../cups/string-private.h ../config.h
 commandtopclx.o: ../data/pcl.h
 rastertoescpx.o: driver.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-rastertoescpx.o: ../cups/ipp.h ../cups/http.h ../cups/language.h
-rastertoescpx.o: ../cups/array.h ../cups/raster.h ../cups/cups.h
+rastertoescpx.o: ../cups/ipp.h ../cups/http.h ../cups/array.h
+rastertoescpx.o: ../cups/language.h ../cups/raster.h ../cups/cups.h
 rastertoescpx.o: ../cups/ppd.h ../cups/language-private.h ../cups/transcode.h
 rastertoescpx.o: ../cups/string-private.h ../config.h ../data/escp.h
 rastertopclx.o: driver.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-rastertopclx.o: ../cups/ipp.h ../cups/http.h ../cups/language.h
-rastertopclx.o: ../cups/array.h ../cups/raster.h ../cups/cups.h ../cups/ppd.h
-rastertopclx.o: ../cups/language-private.h ../cups/transcode.h
+rastertopclx.o: ../cups/ipp.h ../cups/http.h ../cups/array.h
+rastertopclx.o: ../cups/language.h ../cups/raster.h ../cups/cups.h
+rastertopclx.o: ../cups/ppd.h ../cups/language-private.h ../cups/transcode.h
 rastertopclx.o: ../cups/string-private.h ../config.h pcl-common.h
 rastertopclx.o: ../data/pcl.h
 pcl-common.o: driver.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-pcl-common.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+pcl-common.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 pcl-common.o: ../cups/raster.h ../cups/cups.h ../cups/ppd.h pcl-common.h
 pcl-common.o: ../cups/string-private.h ../config.h ../data/pcl.h
 testcmyk.o: ../cups/string-private.h ../config.h driver.h ../cups/cups.h
 testcmyk.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-testcmyk.o: ../cups/language.h ../cups/array.h ../cups/raster.h
+testcmyk.o: ../cups/array.h ../cups/language.h ../cups/raster.h
 testcmyk.o: ../cups/cups.h ../cups/ppd.h
 testdither.o: driver.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-testdither.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+testdither.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 testdither.o: ../cups/raster.h ../cups/cups.h ../cups/ppd.h
 testdither.o: ../cups/string-private.h ../config.h
 testrgb.o: ../cups/string-private.h ../config.h driver.h ../cups/cups.h
 testrgb.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-testrgb.o: ../cups/language.h ../cups/array.h ../cups/raster.h ../cups/cups.h
+testrgb.o: ../cups/array.h ../cups/language.h ../cups/raster.h ../cups/cups.h
 testrgb.o: ../cups/ppd.h
 attr.o: driver.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-attr.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+attr.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 attr.o: ../cups/raster.h ../cups/cups.h ../cups/ppd.h
 attr.o: ../cups/string-private.h ../config.h
 check.o: driver.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-check.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+check.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 check.o: ../cups/raster.h ../cups/cups.h ../cups/ppd.h
 cmyk.o: driver.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-cmyk.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+cmyk.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 cmyk.o: ../cups/raster.h ../cups/cups.h ../cups/ppd.h
 cmyk.o: ../cups/string-private.h ../config.h
 dither.o: driver.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-dither.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+dither.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 dither.o: ../cups/raster.h ../cups/cups.h ../cups/ppd.h ../config.h
 lut.o: driver.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-lut.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+lut.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 lut.o: ../cups/raster.h ../cups/cups.h ../cups/ppd.h
 pack.o: driver.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-pack.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+pack.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 pack.o: ../cups/raster.h ../cups/cups.h ../cups/ppd.h
 rgb.o: driver.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-rgb.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+rgb.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 rgb.o: ../cups/raster.h ../cups/cups.h ../cups/ppd.h
 srgb.o: driver.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-srgb.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+srgb.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 srgb.o: ../cups/raster.h ../cups/cups.h ../cups/ppd.h
index c84e4072f0d118fed8445ac653aa38af6ed42d5c..ef7b6661fc557386c94bbc5de99283fd926951d9 100644 (file)
 
 image-bmp.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-bmp.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-image-bmp.o: ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+image-bmp.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 image-bmp.o: ../cups/debug-private.h ../cups/string-private.h ../config.h
 image-colorspace.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-colorspace.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h
-image-colorspace.o: ../cups/http.h ../cups/language.h ../cups/array.h
+image-colorspace.o: ../cups/http.h ../cups/array.h ../cups/language.h
 image-colorspace.o: ../cups/ppd.h ../cups/cups.h ../cups/debug-private.h
 image-colorspace.o: ../cups/string-private.h ../config.h
 image-gif.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-gif.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-image-gif.o: ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+image-gif.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 image-gif.o: ../cups/debug-private.h ../cups/string-private.h ../config.h
 image-jpeg.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-jpeg.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h
-image-jpeg.o: ../cups/http.h ../cups/language.h ../cups/array.h ../cups/ppd.h
+image-jpeg.o: ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h
 image-jpeg.o: ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h
 image-jpeg.o: ../config.h
 image-photocd.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-photocd.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h
-image-photocd.o: ../cups/http.h ../cups/language.h ../cups/array.h
+image-photocd.o: ../cups/http.h ../cups/array.h ../cups/language.h
 image-photocd.o: ../cups/ppd.h ../cups/cups.h ../cups/debug-private.h
 image-photocd.o: ../cups/string-private.h ../config.h
 image-pix.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-pix.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-image-pix.o: ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+image-pix.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 image-pix.o: ../cups/debug-private.h ../cups/string-private.h ../config.h
 image-png.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-png.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-image-png.o: ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+image-png.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 image-png.o: ../cups/debug-private.h ../cups/string-private.h ../config.h
 image-pnm.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-pnm.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-image-pnm.o: ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+image-pnm.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 image-pnm.o: ../cups/debug-private.h ../cups/string-private.h ../config.h
 image-sgi.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-sgi.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-image-sgi.o: ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+image-sgi.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 image-sgi.o: ../cups/debug-private.h ../cups/string-private.h ../config.h
 image-sgi.o: image-sgi.h
 image-sgilib.o: image-sgi.h
 image-sun.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-sun.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-image-sun.o: ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+image-sun.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 image-sun.o: ../cups/debug-private.h ../cups/string-private.h ../config.h
 image-tiff.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-tiff.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h
-image-tiff.o: ../cups/http.h ../cups/language.h ../cups/array.h ../cups/ppd.h
+image-tiff.o: ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h
 image-tiff.o: ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h
 image-tiff.o: ../config.h
 image-zoom.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-zoom.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h
-image-zoom.o: ../cups/http.h ../cups/language.h ../cups/array.h ../cups/ppd.h
+image-zoom.o: ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h
 image-zoom.o: ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h
 image-zoom.o: ../config.h
 image.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
 image.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-image.o: ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+image.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 image.o: ../cups/debug-private.h ../cups/string-private.h ../config.h
 error.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
 error.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-error.o: ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+error.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 error.o: ../cups/debug-private.h ../cups/string-private.h ../config.h
 interpret.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
 interpret.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-interpret.o: ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+interpret.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 interpret.o: ../cups/debug-private.h ../cups/string-private.h ../config.h
 raster.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
 raster.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-raster.o: ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+raster.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 raster.o: ../cups/debug-private.h ../cups/string-private.h ../config.h
 bannertops.o: pstext.h common.h ../cups/string-private.h ../config.h
 bannertops.o: ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
 bannertops.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-bannertops.o: ../cups/language.h ../cups/array.h ../cups/transcode.h image.h
+bannertops.o: ../cups/array.h ../cups/language.h ../cups/transcode.h image.h
 bannertops.o: ../cups/raster.h ../cups/ppd.h ../cups/language-private.h
 commandtops.o: ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
 commandtops.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-commandtops.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
+commandtops.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
 commandtops.o: ../config.h ../cups/sidechannel.h
 gziptoany.o: ../cups/cups-private.h ../cups/cups.h ../cups/string-private.h
 gziptoany.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
 gziptoany.o: ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-gziptoany.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+gziptoany.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 gziptoany.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
 gziptoany.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
 gziptoany.o: ../cups/language-private.h ../cups/transcode.h
 gziptoany.o: ../cups/thread-private.h
 imagetops.o: common.h ../cups/string-private.h ../config.h ../cups/cups.h
 imagetops.o: ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-imagetops.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+imagetops.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 imagetops.o: image.h ../cups/raster.h ../cups/ppd.h
 imagetops.o: ../cups/language-private.h ../cups/transcode.h
 imagetoraster.o: common.h ../cups/string-private.h ../config.h ../cups/cups.h
 imagetoraster.o: ../cups/ppd.h ../cups/cups.h ../cups/file.h
 imagetoraster.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-imagetoraster.o: ../cups/language.h ../cups/array.h image-private.h image.h
+imagetoraster.o: ../cups/array.h ../cups/language.h image-private.h image.h
 imagetoraster.o: ../cups/raster.h ../cups/ppd.h ../cups/debug-private.h
 imagetoraster.o: ../cups/language-private.h ../cups/transcode.h
 common.o: common.h ../cups/string-private.h ../config.h ../cups/cups.h
 common.o: ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-common.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+common.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 pdftops.o: ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
-pdftops.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-pdftops.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
-pdftops.o: ../config.h ../cups/language-private.h ../cups/transcode.h
+pdftops.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+pdftops.o: ../cups/language.h ../cups/string-private.h ../config.h
+pdftops.o: ../cups/language-private.h ../cups/transcode.h
 pstext.o: pstext.h common.h ../cups/string-private.h ../config.h
 pstext.o: ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
-pstext.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-pstext.o: ../cups/language.h ../cups/array.h ../cups/transcode.h
-pstext.o: ../cups/language-private.h
+pstext.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+pstext.o: ../cups/language.h ../cups/transcode.h ../cups/language-private.h
 pstops.o: common.h ../cups/string-private.h ../config.h ../cups/cups.h
 pstops.o: ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-pstops.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+pstops.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 pstops.o: ../cups/file.h ../cups/array.h ../cups/language-private.h
 pstops.o: ../cups/transcode.h
 rasterbench.o: ../config.h ../cups/raster.h ../cups/cups.h ../cups/file.h
 rasterbench.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-rasterbench.o: ../cups/language.h ../cups/array.h ../cups/ppd.h
+rasterbench.o: ../cups/array.h ../cups/language.h ../cups/ppd.h
 rastertoepson.o: ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
 rastertoepson.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-rastertoepson.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
+rastertoepson.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
 rastertoepson.o: ../config.h ../cups/language-private.h ../cups/transcode.h
 rastertoepson.o: ../cups/raster.h ../cups/ppd.h
 rastertohp.o: ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
 rastertohp.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-rastertohp.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
+rastertohp.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
 rastertohp.o: ../config.h ../cups/language-private.h ../cups/transcode.h
 rastertohp.o: ../cups/raster.h ../cups/ppd.h
 rastertolabel.o: ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
 rastertolabel.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-rastertolabel.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
+rastertolabel.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
 rastertolabel.o: ../config.h ../cups/language-private.h ../cups/transcode.h
 rastertolabel.o: ../cups/raster.h ../cups/ppd.h
 testimage.o: image.h ../cups/raster.h ../cups/cups.h ../cups/file.h
 testimage.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-testimage.o: ../cups/language.h ../cups/array.h ../cups/ppd.h
+testimage.o: ../cups/array.h ../cups/language.h ../cups/ppd.h
 testraster.o: image-private.h image.h ../cups/raster.h ../cups/cups.h
 testraster.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h
-testraster.o: ../cups/http.h ../cups/language.h ../cups/array.h ../cups/ppd.h
+testraster.o: ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h
 testraster.o: ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h
 testraster.o: ../config.h
 textcommon.o: textcommon.h common.h ../cups/string-private.h ../config.h
 textcommon.o: ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
 textcommon.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-textcommon.o: ../cups/language.h ../cups/array.h ../cups/language-private.h
+textcommon.o: ../cups/array.h ../cups/language.h ../cups/language-private.h
 textcommon.o: ../cups/transcode.h
 texttops.o: textcommon.h common.h ../cups/string-private.h ../config.h
 texttops.o: ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
-texttops.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-texttops.o: ../cups/language.h ../cups/array.h ../cups/language-private.h
-texttops.o: ../cups/transcode.h
+texttops.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+texttops.o: ../cups/language.h ../cups/language-private.h ../cups/transcode.h
 # DO NOT DELETE
 
 image-bmp.32.o: image-bmp.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-bmp.32.o: image-bmp.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-image-bmp.32.o: image-bmp.c  ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+image-bmp.32.o: image-bmp.c  ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 image-bmp.32.o: image-bmp.c  ../cups/debug-private.h ../cups/string-private.h ../config.h
 image-colorspace.32.o: image-colorspace.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-colorspace.32.o: image-colorspace.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h
-image-colorspace.32.o: image-colorspace.c  ../cups/http.h ../cups/language.h ../cups/array.h
+image-colorspace.32.o: image-colorspace.c  ../cups/http.h ../cups/array.h ../cups/language.h
 image-colorspace.32.o: image-colorspace.c  ../cups/ppd.h ../cups/cups.h ../cups/debug-private.h
 image-colorspace.32.o: image-colorspace.c  ../cups/string-private.h ../config.h
 image-gif.32.o: image-gif.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-gif.32.o: image-gif.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-image-gif.32.o: image-gif.c  ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+image-gif.32.o: image-gif.c  ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 image-gif.32.o: image-gif.c  ../cups/debug-private.h ../cups/string-private.h ../config.h
 image-jpeg.32.o: image-jpeg.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-jpeg.32.o: image-jpeg.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h
-image-jpeg.32.o: image-jpeg.c  ../cups/http.h ../cups/language.h ../cups/array.h ../cups/ppd.h
+image-jpeg.32.o: image-jpeg.c  ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h
 image-jpeg.32.o: image-jpeg.c  ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h
 image-jpeg.32.o: image-jpeg.c  ../config.h
 image-photocd.32.o: image-photocd.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-photocd.32.o: image-photocd.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h
-image-photocd.32.o: image-photocd.c  ../cups/http.h ../cups/language.h ../cups/array.h
+image-photocd.32.o: image-photocd.c  ../cups/http.h ../cups/array.h ../cups/language.h
 image-photocd.32.o: image-photocd.c  ../cups/ppd.h ../cups/cups.h ../cups/debug-private.h
 image-photocd.32.o: image-photocd.c  ../cups/string-private.h ../config.h
 image-pix.32.o: image-pix.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-pix.32.o: image-pix.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-image-pix.32.o: image-pix.c  ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+image-pix.32.o: image-pix.c  ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 image-pix.32.o: image-pix.c  ../cups/debug-private.h ../cups/string-private.h ../config.h
 image-png.32.o: image-png.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-png.32.o: image-png.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-image-png.32.o: image-png.c  ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+image-png.32.o: image-png.c  ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 image-png.32.o: image-png.c  ../cups/debug-private.h ../cups/string-private.h ../config.h
 image-pnm.32.o: image-pnm.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-pnm.32.o: image-pnm.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-image-pnm.32.o: image-pnm.c  ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+image-pnm.32.o: image-pnm.c  ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 image-pnm.32.o: image-pnm.c  ../cups/debug-private.h ../cups/string-private.h ../config.h
 image-sgi.32.o: image-sgi.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-sgi.32.o: image-sgi.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-image-sgi.32.o: image-sgi.c  ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+image-sgi.32.o: image-sgi.c  ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 image-sgi.32.o: image-sgi.c  ../cups/debug-private.h ../cups/string-private.h ../config.h
 image-sgi.32.o: image-sgi.c  image-sgi.h
 image-sgilib.32.o: image-sgilib.c  image-sgi.h
 image-sun.32.o: image-sun.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-sun.32.o: image-sun.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-image-sun.32.o: image-sun.c  ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+image-sun.32.o: image-sun.c  ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 image-sun.32.o: image-sun.c  ../cups/debug-private.h ../cups/string-private.h ../config.h
 image-tiff.32.o: image-tiff.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-tiff.32.o: image-tiff.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h
-image-tiff.32.o: image-tiff.c  ../cups/http.h ../cups/language.h ../cups/array.h ../cups/ppd.h
+image-tiff.32.o: image-tiff.c  ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h
 image-tiff.32.o: image-tiff.c  ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h
 image-tiff.32.o: image-tiff.c  ../config.h
 image-zoom.32.o: image-zoom.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-zoom.32.o: image-zoom.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h
-image-zoom.32.o: image-zoom.c  ../cups/http.h ../cups/language.h ../cups/array.h ../cups/ppd.h
+image-zoom.32.o: image-zoom.c  ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h
 image-zoom.32.o: image-zoom.c  ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h
 image-zoom.32.o: image-zoom.c  ../config.h
 image.32.o: image.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image.32.o: image.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-image.32.o: image.c  ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+image.32.o: image.c  ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 image.32.o: image.c  ../cups/debug-private.h ../cups/string-private.h ../config.h
 error.32.o: error.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 error.32.o: error.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-error.32.o: error.c  ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+error.32.o: error.c  ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 error.32.o: error.c  ../cups/debug-private.h ../cups/string-private.h ../config.h
 interpret.32.o: interpret.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 interpret.32.o: interpret.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-interpret.32.o: interpret.c  ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+interpret.32.o: interpret.c  ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 interpret.32.o: interpret.c  ../cups/debug-private.h ../cups/string-private.h ../config.h
 raster.32.o: raster.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 raster.32.o: raster.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-raster.32.o: raster.c  ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+raster.32.o: raster.c  ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 raster.32.o: raster.c  ../cups/debug-private.h ../cups/string-private.h ../config.h
 bannertops.32.o: bannertops.c  pstext.h common.h ../cups/string-private.h ../config.h
 bannertops.32.o: bannertops.c  ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
 bannertops.32.o: bannertops.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-bannertops.32.o: bannertops.c  ../cups/language.h ../cups/array.h ../cups/transcode.h image.h
+bannertops.32.o: bannertops.c  ../cups/array.h ../cups/language.h ../cups/transcode.h image.h
 bannertops.32.o: bannertops.c  ../cups/raster.h ../cups/ppd.h ../cups/language-private.h
 commandtops.32.o: commandtops.c  ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
 commandtops.32.o: commandtops.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-commandtops.32.o: commandtops.c  ../cups/language.h ../cups/array.h ../cups/string-private.h
+commandtops.32.o: commandtops.c  ../cups/array.h ../cups/language.h ../cups/string-private.h
 commandtops.32.o: commandtops.c  ../config.h ../cups/sidechannel.h
 gziptoany.32.o: gziptoany.c  ../cups/cups-private.h ../cups/cups.h ../cups/string-private.h
 gziptoany.32.o: gziptoany.c  ../config.h ../cups/debug-private.h ../cups/ppd-private.h
 gziptoany.32.o: gziptoany.c  ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-gziptoany.32.o: gziptoany.c  ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+gziptoany.32.o: gziptoany.c  ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 gziptoany.32.o: gziptoany.c  ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
 gziptoany.32.o: gziptoany.c  ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
 gziptoany.32.o: gziptoany.c  ../cups/language-private.h ../cups/transcode.h
 gziptoany.32.o: gziptoany.c  ../cups/thread-private.h
 imagetops.32.o: imagetops.c  common.h ../cups/string-private.h ../config.h ../cups/cups.h
 imagetops.32.o: imagetops.c  ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-imagetops.32.o: imagetops.c  ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+imagetops.32.o: imagetops.c  ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 imagetops.32.o: imagetops.c  image.h ../cups/raster.h ../cups/ppd.h
 imagetops.32.o: imagetops.c  ../cups/language-private.h ../cups/transcode.h
 imagetoraster.32.o: imagetoraster.c  common.h ../cups/string-private.h ../config.h ../cups/cups.h
 imagetoraster.32.o: imagetoraster.c  ../cups/ppd.h ../cups/cups.h ../cups/file.h
 imagetoraster.32.o: imagetoraster.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-imagetoraster.32.o: imagetoraster.c  ../cups/language.h ../cups/array.h image-private.h image.h
+imagetoraster.32.o: imagetoraster.c  ../cups/array.h ../cups/language.h image-private.h image.h
 imagetoraster.32.o: imagetoraster.c  ../cups/raster.h ../cups/ppd.h ../cups/debug-private.h
 imagetoraster.32.o: imagetoraster.c  ../cups/language-private.h ../cups/transcode.h
 common.32.o: common.c  common.h ../cups/string-private.h ../config.h ../cups/cups.h
 common.32.o: common.c  ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-common.32.o: common.c  ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+common.32.o: common.c  ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 pdftops.32.o: pdftops.c  ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
-pdftops.32.o: pdftops.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-pdftops.32.o: pdftops.c  ../cups/language.h ../cups/array.h ../cups/string-private.h
-pdftops.32.o: pdftops.c  ../config.h ../cups/language-private.h ../cups/transcode.h
+pdftops.32.o: pdftops.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+pdftops.32.o: pdftops.c  ../cups/language.h ../cups/string-private.h ../config.h
+pdftops.32.o: pdftops.c  ../cups/language-private.h ../cups/transcode.h
 pstext.32.o: pstext.c  pstext.h common.h ../cups/string-private.h ../config.h
 pstext.32.o: pstext.c  ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
-pstext.32.o: pstext.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-pstext.32.o: pstext.c  ../cups/language.h ../cups/array.h ../cups/transcode.h
-pstext.32.o: pstext.c  ../cups/language-private.h
+pstext.32.o: pstext.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+pstext.32.o: pstext.c  ../cups/language.h ../cups/transcode.h ../cups/language-private.h
 pstops.32.o: pstops.c  common.h ../cups/string-private.h ../config.h ../cups/cups.h
 pstops.32.o: pstops.c  ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-pstops.32.o: pstops.c  ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+pstops.32.o: pstops.c  ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 pstops.32.o: pstops.c  ../cups/file.h ../cups/array.h ../cups/language-private.h
 pstops.32.o: pstops.c  ../cups/transcode.h
 rasterbench.32.o: rasterbench.c  ../config.h ../cups/raster.h ../cups/cups.h ../cups/file.h
 rasterbench.32.o: rasterbench.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-rasterbench.32.o: rasterbench.c  ../cups/language.h ../cups/array.h ../cups/ppd.h
+rasterbench.32.o: rasterbench.c  ../cups/array.h ../cups/language.h ../cups/ppd.h
 rastertoepson.32.o: rastertoepson.c  ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
 rastertoepson.32.o: rastertoepson.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-rastertoepson.32.o: rastertoepson.c  ../cups/language.h ../cups/array.h ../cups/string-private.h
+rastertoepson.32.o: rastertoepson.c  ../cups/array.h ../cups/language.h ../cups/string-private.h
 rastertoepson.32.o: rastertoepson.c  ../config.h ../cups/language-private.h ../cups/transcode.h
 rastertoepson.32.o: rastertoepson.c  ../cups/raster.h ../cups/ppd.h
 rastertohp.32.o: rastertohp.c  ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
 rastertohp.32.o: rastertohp.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-rastertohp.32.o: rastertohp.c  ../cups/language.h ../cups/array.h ../cups/string-private.h
+rastertohp.32.o: rastertohp.c  ../cups/array.h ../cups/language.h ../cups/string-private.h
 rastertohp.32.o: rastertohp.c  ../config.h ../cups/language-private.h ../cups/transcode.h
 rastertohp.32.o: rastertohp.c  ../cups/raster.h ../cups/ppd.h
 rastertolabel.32.o: rastertolabel.c  ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
 rastertolabel.32.o: rastertolabel.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-rastertolabel.32.o: rastertolabel.c  ../cups/language.h ../cups/array.h ../cups/string-private.h
+rastertolabel.32.o: rastertolabel.c  ../cups/array.h ../cups/language.h ../cups/string-private.h
 rastertolabel.32.o: rastertolabel.c  ../config.h ../cups/language-private.h ../cups/transcode.h
 rastertolabel.32.o: rastertolabel.c  ../cups/raster.h ../cups/ppd.h
 testimage.32.o: testimage.c  image.h ../cups/raster.h ../cups/cups.h ../cups/file.h
 testimage.32.o: testimage.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-testimage.32.o: testimage.c  ../cups/language.h ../cups/array.h ../cups/ppd.h
+testimage.32.o: testimage.c  ../cups/array.h ../cups/language.h ../cups/ppd.h
 testraster.32.o: testraster.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 testraster.32.o: testraster.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h
-testraster.32.o: testraster.c  ../cups/http.h ../cups/language.h ../cups/array.h ../cups/ppd.h
+testraster.32.o: testraster.c  ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h
 testraster.32.o: testraster.c  ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h
 testraster.32.o: testraster.c  ../config.h
 textcommon.32.o: textcommon.c  textcommon.h common.h ../cups/string-private.h ../config.h
 textcommon.32.o: textcommon.c  ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
 textcommon.32.o: textcommon.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-textcommon.32.o: textcommon.c  ../cups/language.h ../cups/array.h ../cups/language-private.h
+textcommon.32.o: textcommon.c  ../cups/array.h ../cups/language.h ../cups/language-private.h
 textcommon.32.o: textcommon.c  ../cups/transcode.h
 texttops.32.o: texttops.c  textcommon.h common.h ../cups/string-private.h ../config.h
 texttops.32.o: texttops.c  ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
-texttops.32.o: texttops.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-texttops.32.o: texttops.c  ../cups/language.h ../cups/array.h ../cups/language-private.h
-texttops.32.o: texttops.c  ../cups/transcode.h
+texttops.32.o: texttops.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+texttops.32.o: texttops.c  ../cups/language.h ../cups/language-private.h ../cups/transcode.h
 # DO NOT DELETE
 
 image-bmp.64.o: image-bmp.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-bmp.64.o: image-bmp.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-image-bmp.64.o: image-bmp.c  ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+image-bmp.64.o: image-bmp.c  ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 image-bmp.64.o: image-bmp.c  ../cups/debug-private.h ../cups/string-private.h ../config.h
 image-colorspace.64.o: image-colorspace.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-colorspace.64.o: image-colorspace.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h
-image-colorspace.64.o: image-colorspace.c  ../cups/http.h ../cups/language.h ../cups/array.h
+image-colorspace.64.o: image-colorspace.c  ../cups/http.h ../cups/array.h ../cups/language.h
 image-colorspace.64.o: image-colorspace.c  ../cups/ppd.h ../cups/cups.h ../cups/debug-private.h
 image-colorspace.64.o: image-colorspace.c  ../cups/string-private.h ../config.h
 image-gif.64.o: image-gif.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-gif.64.o: image-gif.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-image-gif.64.o: image-gif.c  ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+image-gif.64.o: image-gif.c  ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 image-gif.64.o: image-gif.c  ../cups/debug-private.h ../cups/string-private.h ../config.h
 image-jpeg.64.o: image-jpeg.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-jpeg.64.o: image-jpeg.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h
-image-jpeg.64.o: image-jpeg.c  ../cups/http.h ../cups/language.h ../cups/array.h ../cups/ppd.h
+image-jpeg.64.o: image-jpeg.c  ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h
 image-jpeg.64.o: image-jpeg.c  ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h
 image-jpeg.64.o: image-jpeg.c  ../config.h
 image-photocd.64.o: image-photocd.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-photocd.64.o: image-photocd.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h
-image-photocd.64.o: image-photocd.c  ../cups/http.h ../cups/language.h ../cups/array.h
+image-photocd.64.o: image-photocd.c  ../cups/http.h ../cups/array.h ../cups/language.h
 image-photocd.64.o: image-photocd.c  ../cups/ppd.h ../cups/cups.h ../cups/debug-private.h
 image-photocd.64.o: image-photocd.c  ../cups/string-private.h ../config.h
 image-pix.64.o: image-pix.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-pix.64.o: image-pix.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-image-pix.64.o: image-pix.c  ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+image-pix.64.o: image-pix.c  ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 image-pix.64.o: image-pix.c  ../cups/debug-private.h ../cups/string-private.h ../config.h
 image-png.64.o: image-png.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-png.64.o: image-png.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-image-png.64.o: image-png.c  ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+image-png.64.o: image-png.c  ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 image-png.64.o: image-png.c  ../cups/debug-private.h ../cups/string-private.h ../config.h
 image-pnm.64.o: image-pnm.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-pnm.64.o: image-pnm.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-image-pnm.64.o: image-pnm.c  ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+image-pnm.64.o: image-pnm.c  ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 image-pnm.64.o: image-pnm.c  ../cups/debug-private.h ../cups/string-private.h ../config.h
 image-sgi.64.o: image-sgi.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-sgi.64.o: image-sgi.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-image-sgi.64.o: image-sgi.c  ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+image-sgi.64.o: image-sgi.c  ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 image-sgi.64.o: image-sgi.c  ../cups/debug-private.h ../cups/string-private.h ../config.h
 image-sgi.64.o: image-sgi.c  image-sgi.h
 image-sgilib.64.o: image-sgilib.c  image-sgi.h
 image-sun.64.o: image-sun.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-sun.64.o: image-sun.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-image-sun.64.o: image-sun.c  ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+image-sun.64.o: image-sun.c  ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 image-sun.64.o: image-sun.c  ../cups/debug-private.h ../cups/string-private.h ../config.h
 image-tiff.64.o: image-tiff.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-tiff.64.o: image-tiff.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h
-image-tiff.64.o: image-tiff.c  ../cups/http.h ../cups/language.h ../cups/array.h ../cups/ppd.h
+image-tiff.64.o: image-tiff.c  ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h
 image-tiff.64.o: image-tiff.c  ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h
 image-tiff.64.o: image-tiff.c  ../config.h
 image-zoom.64.o: image-zoom.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image-zoom.64.o: image-zoom.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h
-image-zoom.64.o: image-zoom.c  ../cups/http.h ../cups/language.h ../cups/array.h ../cups/ppd.h
+image-zoom.64.o: image-zoom.c  ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h
 image-zoom.64.o: image-zoom.c  ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h
 image-zoom.64.o: image-zoom.c  ../config.h
 image.64.o: image.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 image.64.o: image.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-image.64.o: image.c  ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+image.64.o: image.c  ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 image.64.o: image.c  ../cups/debug-private.h ../cups/string-private.h ../config.h
 error.64.o: error.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 error.64.o: error.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-error.64.o: error.c  ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+error.64.o: error.c  ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 error.64.o: error.c  ../cups/debug-private.h ../cups/string-private.h ../config.h
 interpret.64.o: interpret.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 interpret.64.o: interpret.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-interpret.64.o: interpret.c  ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+interpret.64.o: interpret.c  ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 interpret.64.o: interpret.c  ../cups/debug-private.h ../cups/string-private.h ../config.h
 raster.64.o: raster.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 raster.64.o: raster.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-raster.64.o: raster.c  ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h
+raster.64.o: raster.c  ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h
 raster.64.o: raster.c  ../cups/debug-private.h ../cups/string-private.h ../config.h
 bannertops.64.o: bannertops.c  pstext.h common.h ../cups/string-private.h ../config.h
 bannertops.64.o: bannertops.c  ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
 bannertops.64.o: bannertops.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-bannertops.64.o: bannertops.c  ../cups/language.h ../cups/array.h ../cups/transcode.h image.h
+bannertops.64.o: bannertops.c  ../cups/array.h ../cups/language.h ../cups/transcode.h image.h
 bannertops.64.o: bannertops.c  ../cups/raster.h ../cups/ppd.h ../cups/language-private.h
 commandtops.64.o: commandtops.c  ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
 commandtops.64.o: commandtops.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-commandtops.64.o: commandtops.c  ../cups/language.h ../cups/array.h ../cups/string-private.h
+commandtops.64.o: commandtops.c  ../cups/array.h ../cups/language.h ../cups/string-private.h
 commandtops.64.o: commandtops.c  ../config.h ../cups/sidechannel.h
 gziptoany.64.o: gziptoany.c  ../cups/cups-private.h ../cups/cups.h ../cups/string-private.h
 gziptoany.64.o: gziptoany.c  ../config.h ../cups/debug-private.h ../cups/ppd-private.h
 gziptoany.64.o: gziptoany.c  ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-gziptoany.64.o: gziptoany.c  ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+gziptoany.64.o: gziptoany.c  ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 gziptoany.64.o: gziptoany.c  ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
 gziptoany.64.o: gziptoany.c  ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
 gziptoany.64.o: gziptoany.c  ../cups/language-private.h ../cups/transcode.h
 gziptoany.64.o: gziptoany.c  ../cups/thread-private.h
 imagetops.64.o: imagetops.c  common.h ../cups/string-private.h ../config.h ../cups/cups.h
 imagetops.64.o: imagetops.c  ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-imagetops.64.o: imagetops.c  ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+imagetops.64.o: imagetops.c  ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 imagetops.64.o: imagetops.c  image.h ../cups/raster.h ../cups/ppd.h
 imagetops.64.o: imagetops.c  ../cups/language-private.h ../cups/transcode.h
 imagetoraster.64.o: imagetoraster.c  common.h ../cups/string-private.h ../config.h ../cups/cups.h
 imagetoraster.64.o: imagetoraster.c  ../cups/ppd.h ../cups/cups.h ../cups/file.h
 imagetoraster.64.o: imagetoraster.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-imagetoraster.64.o: imagetoraster.c  ../cups/language.h ../cups/array.h image-private.h image.h
+imagetoraster.64.o: imagetoraster.c  ../cups/array.h ../cups/language.h image-private.h image.h
 imagetoraster.64.o: imagetoraster.c  ../cups/raster.h ../cups/ppd.h ../cups/debug-private.h
 imagetoraster.64.o: imagetoraster.c  ../cups/language-private.h ../cups/transcode.h
 common.64.o: common.c  common.h ../cups/string-private.h ../config.h ../cups/cups.h
 common.64.o: common.c  ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-common.64.o: common.c  ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+common.64.o: common.c  ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 pdftops.64.o: pdftops.c  ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
-pdftops.64.o: pdftops.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-pdftops.64.o: pdftops.c  ../cups/language.h ../cups/array.h ../cups/string-private.h
-pdftops.64.o: pdftops.c  ../config.h ../cups/language-private.h ../cups/transcode.h
+pdftops.64.o: pdftops.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+pdftops.64.o: pdftops.c  ../cups/language.h ../cups/string-private.h ../config.h
+pdftops.64.o: pdftops.c  ../cups/language-private.h ../cups/transcode.h
 pstext.64.o: pstext.c  pstext.h common.h ../cups/string-private.h ../config.h
 pstext.64.o: pstext.c  ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
-pstext.64.o: pstext.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-pstext.64.o: pstext.c  ../cups/language.h ../cups/array.h ../cups/transcode.h
-pstext.64.o: pstext.c  ../cups/language-private.h
+pstext.64.o: pstext.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+pstext.64.o: pstext.c  ../cups/language.h ../cups/transcode.h ../cups/language-private.h
 pstops.64.o: pstops.c  common.h ../cups/string-private.h ../config.h ../cups/cups.h
 pstops.64.o: pstops.c  ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
-pstops.64.o: pstops.c  ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+pstops.64.o: pstops.c  ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 pstops.64.o: pstops.c  ../cups/file.h ../cups/array.h ../cups/language-private.h
 pstops.64.o: pstops.c  ../cups/transcode.h
 rasterbench.64.o: rasterbench.c  ../config.h ../cups/raster.h ../cups/cups.h ../cups/file.h
 rasterbench.64.o: rasterbench.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-rasterbench.64.o: rasterbench.c  ../cups/language.h ../cups/array.h ../cups/ppd.h
+rasterbench.64.o: rasterbench.c  ../cups/array.h ../cups/language.h ../cups/ppd.h
 rastertoepson.64.o: rastertoepson.c  ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
 rastertoepson.64.o: rastertoepson.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-rastertoepson.64.o: rastertoepson.c  ../cups/language.h ../cups/array.h ../cups/string-private.h
+rastertoepson.64.o: rastertoepson.c  ../cups/array.h ../cups/language.h ../cups/string-private.h
 rastertoepson.64.o: rastertoepson.c  ../config.h ../cups/language-private.h ../cups/transcode.h
 rastertoepson.64.o: rastertoepson.c  ../cups/raster.h ../cups/ppd.h
 rastertohp.64.o: rastertohp.c  ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
 rastertohp.64.o: rastertohp.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-rastertohp.64.o: rastertohp.c  ../cups/language.h ../cups/array.h ../cups/string-private.h
+rastertohp.64.o: rastertohp.c  ../cups/array.h ../cups/language.h ../cups/string-private.h
 rastertohp.64.o: rastertohp.c  ../config.h ../cups/language-private.h ../cups/transcode.h
 rastertohp.64.o: rastertohp.c  ../cups/raster.h ../cups/ppd.h
 rastertolabel.64.o: rastertolabel.c  ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
 rastertolabel.64.o: rastertolabel.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-rastertolabel.64.o: rastertolabel.c  ../cups/language.h ../cups/array.h ../cups/string-private.h
+rastertolabel.64.o: rastertolabel.c  ../cups/array.h ../cups/language.h ../cups/string-private.h
 rastertolabel.64.o: rastertolabel.c  ../config.h ../cups/language-private.h ../cups/transcode.h
 rastertolabel.64.o: rastertolabel.c  ../cups/raster.h ../cups/ppd.h
 testimage.64.o: testimage.c  image.h ../cups/raster.h ../cups/cups.h ../cups/file.h
 testimage.64.o: testimage.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-testimage.64.o: testimage.c  ../cups/language.h ../cups/array.h ../cups/ppd.h
+testimage.64.o: testimage.c  ../cups/array.h ../cups/language.h ../cups/ppd.h
 testraster.64.o: testraster.c  image-private.h image.h ../cups/raster.h ../cups/cups.h
 testraster.64.o: testraster.c  ../cups/file.h ../cups/versioning.h ../cups/ipp.h
-testraster.64.o: testraster.c  ../cups/http.h ../cups/language.h ../cups/array.h ../cups/ppd.h
+testraster.64.o: testraster.c  ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h
 testraster.64.o: testraster.c  ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h
 testraster.64.o: testraster.c  ../config.h
 textcommon.64.o: textcommon.c  textcommon.h common.h ../cups/string-private.h ../config.h
 textcommon.64.o: textcommon.c  ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
 textcommon.64.o: textcommon.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-textcommon.64.o: textcommon.c  ../cups/language.h ../cups/array.h ../cups/language-private.h
+textcommon.64.o: textcommon.c  ../cups/array.h ../cups/language.h ../cups/language-private.h
 textcommon.64.o: textcommon.c  ../cups/transcode.h
 texttops.64.o: texttops.c  textcommon.h common.h ../cups/string-private.h ../config.h
 texttops.64.o: texttops.c  ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h
-texttops.64.o: texttops.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-texttops.64.o: texttops.c  ../cups/language.h ../cups/array.h ../cups/language-private.h
-texttops.64.o: texttops.c  ../cups/transcode.h
+texttops.64.o: texttops.c  ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+texttops.64.o: texttops.c  ../cups/language.h ../cups/language-private.h ../cups/transcode.h
index 96e1e66cb0ff089ae610a64b0adad80ffc413db3..06e1f93d3c76b52823c166788549902f43b98d58 100644 (file)
@@ -2389,6 +2389,7 @@ set_pstops_options(
   ppd_attr_t   *attr;                  /* PPD attribute */
   ppd_option_t *option;                /* PPD option */
   ppd_choice_t *choice;                /* PPD choice */
+  const char   *content_type;          /* Original content type */
 
 
  /*
@@ -2415,6 +2416,18 @@ set_pstops_options(
   doc->new_bounding_box[2] = INT_MIN;
   doc->new_bounding_box[3] = INT_MIN;
 
+ /*
+  * See what the source content type is.  When printing PostScript content we
+  * want to do scaling and orientation, but otherwise we don't want to change
+  * anything...
+  */
+
+  if ((content_type = getenv("CONTENT_TYPE")) == NULL)
+    content_type = "application/postscript";
+
+  if (!strcasecmp(content_type, "application/postscript"))
+    Orientation = 0;
+
  /*
   * AP_FIRSTPAGE_* and the corresponding non-first-page options.
   */
@@ -2445,7 +2458,6 @@ set_pstops_options(
   if ((choice = ppdFindMarkedChoice(ppd, "PageSize")) != NULL)
     doc->page_size = choice->choice;
 
-
  /*
   * brightness
   */
@@ -2505,15 +2517,24 @@ set_pstops_options(
     doc->emit_jcl = 1;
 
  /*
-  * fitplot/fit-to-page
+  * fitplot/fit-to-page/ipp-attribute-fidelity
+  *
+  * (Only for original PostScript content)
   */
 
-  if ((val = cupsGetOption("fitplot", num_options, options)) != NULL &&
-      !strcasecmp(val, "true"))
-    doc->fitplot = 1;
-  else if ((val = cupsGetOption("fit-to-page", num_options, options)) != NULL &&
-           !strcasecmp(val, "true"))
-    doc->fitplot = 1;
+  if (!strcasecmp(content_type, "application/postscript"))
+  {
+    if ((val = cupsGetOption("fitplot", num_options, options)) != NULL &&
+       !strcasecmp(val, "true"))
+      doc->fitplot = 1;
+    else if ((val = cupsGetOption("fit-to-page", num_options, options)) != NULL &&
+            !strcasecmp(val, "true"))
+      doc->fitplot = 1;
+    else if ((val = cupsGetOption("ipp-attribute-fidelity", num_options,
+                                  options)) != NULL &&
+            !strcasecmp(val, "true"))
+      doc->fitplot = 1;
+  }
 
  /*
   * gamma
index da2e94cd3672fa00609bfe241ae78c67471b570f..45dd3faeccbd4e2003eb3aef939ed0f4ffb76348 100644 (file)
@@ -1,16 +1,16 @@
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
 checkpo.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-checkpo.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-checkpo.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
-checkpo.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
-checkpo.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
-checkpo.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
-checkpo.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
-checkpo.o: ../cups/transcode.h ../cups/thread-private.h
+checkpo.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+checkpo.o: ../cups/language.h ../cups/string-private.h ../config.h
+checkpo.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
+checkpo.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
+checkpo.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
+checkpo.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
+checkpo.o: ../cups/thread-private.h
 po2strings.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
 po2strings.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-po2strings.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
+po2strings.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
 po2strings.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
 po2strings.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
 po2strings.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
@@ -18,7 +18,7 @@ po2strings.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
 po2strings.o: ../cups/transcode.h ../cups/thread-private.h
 translate.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
 translate.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-translate.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
+translate.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
 translate.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
 translate.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
 translate.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
index 3eb02f3dc816c20498d2afe9bd07229e0ad823a0..15ae814d18182f44dda1611e289ab5fb4384c434 100644 (file)
@@ -238,7 +238,7 @@ matches.
 IF-DEFINED variable-name
 Makes the EXPECT conditions apply only if the specified variable is defined.
 .TP 5
-IF-UNDEFINED variable-name
+IF-NOT-DEFINED variable-name
 Makes the EXPECT conditions apply only if the specified variable is not
 defined.
 .TP 5
@@ -267,7 +267,7 @@ The following predicates are understood following the STATUS test directive:
 IF-DEFINED variable-name
 Makes the STATUS apply only if the specified variable is defined.
 .TP 5
-IF-UNDEFINED variable-name
+IF-NOT-DEFINED variable-name
 Makes the STATUS apply only if the specified variable is not defined.
 
 .SH OPERATION CODES
index 853b1e7575a996ec54c7543847f36286e52aaa72..5b183556ce01666025c981d1f2f5cb45b278d6cc 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   lp man page for the Common UNIX Printing System (CUPS).
 .\"
-.\"   Copyright 2007-2009 by Apple Inc.
+.\"   Copyright 2007-2010 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -12,7 +12,7 @@
 .\"   which should have been included with this file.  If this file is
 .\"   file is missing or damaged, see the license at "http://www.cups.org/".
 .\"
-.TH lp 1 "CUPS" "17 November 2008" "Apple Inc."
+.TH lp 1 "CUPS" "31 August 2010" "Apple Inc."
 .SH NAME
 lp - print files
 .SH SYNOPSIS
@@ -157,7 +157,6 @@ contain a list of numbers and ranges (#-#) separated by commas
 (e.g. 1,3-5,16). The page numbers refer to the output pages and
 not the document's original pages - options like "number-up" can
 affect the numbering of the pages.
-that are 
 .SH COMMON JOB OPTIONS
 Aside from the printer-specific options reported by the
 \fIlpoptions(1)\fR command, the following generic options are
@@ -258,7 +257,7 @@ is highest priority).
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2009 by Apple Inc.
+Copyright 2007-2010 by Apple Inc.
 .\"
 .\" End of "$Id: lp.man 7889 2008-08-29 22:03:35Z mike $".
 .\"
index cf34cd47418f75878e0106a056492eaf06a7cb7a..694f0b8175f14e56f2798050fb63531d8a56319f 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   lpadmin man page for the Common UNIX Printing System (CUPS).
 .\"
-.\"   Copyright 2007-2009 by Apple Inc.
+.\"   Copyright 2007-2010 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -12,7 +12,7 @@
 .\"   which should have been included with this file.  If this file is
 .\"   file is missing or damaged, see the license at "http://www.cups.org/".
 .\"
-.TH lpadmin 8 "CUPS" "3 November 2008" "Apple Inc."
+.TH lpadmin 8 "CUPS" "1 September 2010" "Apple Inc."
 .SH NAME
 lpadmin \- configure cups printers and classes
 .SH SYNOPSIS
@@ -30,7 +30,7 @@ lpadmin \- configure cups printers and classes
 ] [ -h
 .I server[:port]
 ] -p
-.I printer option(s)
+.I destination option(s)
 .br
 .B lpadmin
 [ -E ] [-U
@@ -55,7 +55,7 @@ destination unless the user specifies otherwise with the
 \fIlpoptions(1)\fR command.
 .LP
 The second form of the command (\fI-p\fR) configures the named
-printer.  The additional options are described below.
+printer or class.  The additional options are described below.
 .LP
 The third form of the command (\fI-x\fR) deletes the printer or
 class \fIdestination\fR. Any jobs that are pending for the
@@ -78,8 +78,9 @@ and is intended for providing support for legacy printer drivers.
 .TP 5
 -m model
 .br
-Sets a standard System V interface script or PPD file from the
-\fImodel\fR directory.
+Sets a standard System V interface script or PPD file for the printer from the
+\fImodel\fR directory or using one of the driver interfaces. Use the \fI-m\fR
+option with the \fIlpinfo(8)\fR command to get a list of supported models.
 .TP 5
 -o job-k-limit=value
 .br
@@ -105,13 +106,12 @@ Sets the default banner page(s) to use for print jobs.
 .TP 5
 -o name=value
 .br
-Sets a PPD option for the printer. PPD options can be
-listed using the \fI-l\fR option with the \fIlpoptions(1)\fR
-command.
+Sets a PPD option for the printer. PPD options can be listed using the \fI-l\fR
+option with the \fIlpoptions(1)\fR command.
 .TP 5
 -o name-default=value
 .br
-Sets a default server-side option for the printer. Any print-time
+Sets a default server-side option for the destination. Any print-time
 option can be defaulted, e.g. "-o cpi-default=17" to set the default
 "cpi" option value to 17.
 .TP 5
@@ -125,20 +125,21 @@ specified port monitor must be listed in the printer's PPD file.
 .br
 Sets the error policy to be used when the printer backend is 
 unable to send the job to the printer. The name must be one of 
-"abort-job", "retry-job" or "stop-printer". The default error 
-policy is "stop-printer".
+"abort-job", "retry-job", "retry-current-job", or "stop-printer". The default
+error policy is "stop-printer" for printers and "retry-current-job" for
+classes.
 .TP 5
 -o printer-is-shared=true/false
 .br
-Sets the printer to shared/published or unshared/unpublished.
-Shared/published printers are publically announced by the server
+Sets the destination to shared/published or unshared/unpublished.
+Shared/published destinations are publically announced by the server
 on the LAN based on the browsing configuration in
-\fBcupsd.conf\fR, while unshared/unpublished printers are not
+\fBcupsd.conf\fR, while unshared/unpublished destinations are not
 announced. The default value is "true".
 .TP 5
 -o printer-op-policy=name
 .br
-Sets the IPP operation policy associated with the printer. The
+Sets the IPP operation policy associated with the destination. The
 name must be defined in the \fBcupsd.conf\fR in a Policy section.
 The default operation policy is "default".
 .TP 5
@@ -155,7 +156,7 @@ resulting class becomes empty it is removed.
 .TP 5
 -u deny:none
 .br
-Sets user-level access control on a printer. Names starting with
+Sets user-level access control on a destination. Names starting with
 "@" are interpreted as UNIX groups. The latter two forms turn
 user-level access control off.
 .TP 5
@@ -163,21 +164,21 @@ user-level access control off.
 .br
 Sets the \fIdevice-uri\fR attribute of the printer queue.  If
 \fIdevice-uri\fR is a filename it is automatically converted to
-the form \fIfile:///file/name\fR. Use the \fIlpinfo(8)\fR command
-to get a list of supported device URIs and schemes.
+the form \fIfile:///file/name\fR. Use the \fI-v\fR option with the
+\fIlpinfo(8)\fR command to get a list of supported device URIs and schemes.
 .TP 5
 -D "info"
 .br
-Provides a textual description of the printer.
+Provides a textual description of the destination.
 .TP 5
 -E
 .br
-Enables the printer and accepts jobs; this is the same as running the
-\fIcupsaccept(8)\fR and \fIcupsenable(8)\fR programs on the printer.
+Enables the destination and accepts jobs; this is the same as running the
+\fIcupsaccept(8)\fR and \fIcupsenable(8)\fR programs on the destination.
 .TP 5
 -L "location"
 .br
-Provides a textual location of the printer.
+Provides a textual location of the destination.
 .TP 5
 -P ppd-file
 .br
@@ -201,7 +202,7 @@ System V or Solaris printing system configuration options.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2009 by Apple Inc.
+Copyright 2007-2010 by Apple Inc.
 .\"
 .\" End of "$Id: lpadmin.man 7600 2008-05-20 21:06:23Z mike $".
 .\"
index d5130c0b050f627d051cf6e1c089a6a13c100a6b..83791215b70889477cfa0e7b66f7e67818a28e19 100644 (file)
@@ -1,8 +1,8 @@
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
 bcp.o: ../cups/string-private.h ../config.h ../cups/cups.h ../cups/file.h
-bcp.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h
-bcp.o: ../cups/array.h ../cups/ppd.h ../cups/cups.h
+bcp.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+bcp.o: ../cups/language.h ../cups/ppd.h ../cups/cups.h
 tbcp.o: ../cups/string-private.h ../config.h ../cups/cups.h ../cups/file.h
-tbcp.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h
-tbcp.o: ../cups/array.h ../cups/ppd.h ../cups/cups.h
+tbcp.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+tbcp.o: ../cups/language.h ../cups/ppd.h ../cups/cups.h
index 85597442d0b308f1e6858ee03afd8e3468cc48cd..0915fde6e73248ede290f338525087f290bc32fe 100644 (file)
@@ -1,15 +1,15 @@
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
 dbus.o: ../cups/cups.h ../cups/file.h ../cups/versioning.h ../cups/ipp.h
-dbus.o: ../cups/http.h ../cups/language.h ../cups/array.h
+dbus.o: ../cups/http.h ../cups/array.h ../cups/language.h
 dbus.o: ../cups/string-private.h ../config.h
 mailto.o: ../cups/cups.h ../cups/file.h ../cups/versioning.h ../cups/ipp.h
-mailto.o: ../cups/http.h ../cups/language.h ../cups/array.h
+mailto.o: ../cups/http.h ../cups/array.h ../cups/language.h
 mailto.o: ../cups/language-private.h ../cups/transcode.h
 mailto.o: ../cups/string-private.h ../config.h
 rss.o: ../cups/cups.h ../cups/file.h ../cups/versioning.h ../cups/ipp.h
-rss.o: ../cups/http.h ../cups/language.h ../cups/array.h ../cups/language.h
+rss.o: ../cups/http.h ../cups/array.h ../cups/language.h ../cups/language.h
 rss.o: ../cups/string-private.h ../config.h ../cups/array.h
 testnotify.o: ../cups/cups.h ../cups/file.h ../cups/versioning.h
-testnotify.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+testnotify.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 testnotify.o: ../cups/language.h ../cups/string-private.h ../config.h
index 42c909e102885497dfd5ce23ac2be5f1312c2ca3..8d49d58439e69beefab2cf21be681986b083e102 100644 (file)
@@ -2,7 +2,7 @@
 
 ppdc-array.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h
 ppdc-array.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-ppdc-array.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+ppdc-array.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 ppdc-array.o: ../cups/string-private.h ../config.h ../cups/debug-private.h
 ppdc-array.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
 ppdc-array.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
@@ -11,7 +11,7 @@ ppdc-array.o: ../cups/language-private.h ../cups/transcode.h
 ppdc-array.o: ../cups/thread-private.h
 ppdc-attr.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h
 ppdc-attr.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-ppdc-attr.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+ppdc-attr.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 ppdc-attr.o: ../cups/string-private.h ../config.h ../cups/debug-private.h
 ppdc-attr.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
 ppdc-attr.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
@@ -20,8 +20,8 @@ ppdc-attr.o: ../cups/language-private.h ../cups/transcode.h
 ppdc-attr.o: ../cups/thread-private.h
 ppdc-catalog.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h
 ppdc-catalog.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-ppdc-catalog.o: ../cups/ipp.h ../cups/http.h ../cups/language.h
-ppdc-catalog.o: ../cups/array.h ../cups/string-private.h ../config.h
+ppdc-catalog.o: ../cups/ipp.h ../cups/http.h ../cups/array.h
+ppdc-catalog.o: ../cups/language.h ../cups/string-private.h ../config.h
 ppdc-catalog.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 ppdc-catalog.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 ppdc-catalog.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
@@ -29,8 +29,8 @@ ppdc-catalog.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
 ppdc-catalog.o: ../cups/thread-private.h
 ppdc-choice.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h
 ppdc-choice.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-ppdc-choice.o: ../cups/ipp.h ../cups/http.h ../cups/language.h
-ppdc-choice.o: ../cups/array.h ../cups/string-private.h ../config.h
+ppdc-choice.o: ../cups/ipp.h ../cups/http.h ../cups/array.h
+ppdc-choice.o: ../cups/language.h ../cups/string-private.h ../config.h
 ppdc-choice.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 ppdc-choice.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 ppdc-choice.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
@@ -38,8 +38,8 @@ ppdc-choice.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
 ppdc-choice.o: ../cups/thread-private.h
 ppdc-constraint.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h
 ppdc-constraint.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-ppdc-constraint.o: ../cups/ipp.h ../cups/http.h ../cups/language.h
-ppdc-constraint.o: ../cups/array.h ../cups/string-private.h ../config.h
+ppdc-constraint.o: ../cups/ipp.h ../cups/http.h ../cups/array.h
+ppdc-constraint.o: ../cups/language.h ../cups/string-private.h ../config.h
 ppdc-constraint.o: ../cups/debug-private.h ../cups/ppd-private.h
 ppdc-constraint.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
 ppdc-constraint.o: ../cups/http-private.h ../cups/http.h
@@ -48,8 +48,8 @@ ppdc-constraint.o: ../cups/language-private.h ../cups/transcode.h
 ppdc-constraint.o: ../cups/thread-private.h
 ppdc-driver.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h
 ppdc-driver.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-ppdc-driver.o: ../cups/ipp.h ../cups/http.h ../cups/language.h
-ppdc-driver.o: ../cups/array.h ../cups/string-private.h ../config.h
+ppdc-driver.o: ../cups/ipp.h ../cups/http.h ../cups/array.h
+ppdc-driver.o: ../cups/language.h ../cups/string-private.h ../config.h
 ppdc-driver.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 ppdc-driver.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 ppdc-driver.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
@@ -57,7 +57,7 @@ ppdc-driver.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
 ppdc-driver.o: ../cups/thread-private.h
 ppdc-file.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h
 ppdc-file.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-ppdc-file.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+ppdc-file.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 ppdc-file.o: ../cups/string-private.h ../config.h ../cups/debug-private.h
 ppdc-file.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
 ppdc-file.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
@@ -66,8 +66,8 @@ ppdc-file.o: ../cups/language-private.h ../cups/transcode.h
 ppdc-file.o: ../cups/thread-private.h
 ppdc-filter.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h
 ppdc-filter.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-ppdc-filter.o: ../cups/ipp.h ../cups/http.h ../cups/language.h
-ppdc-filter.o: ../cups/array.h ../cups/string-private.h ../config.h
+ppdc-filter.o: ../cups/ipp.h ../cups/http.h ../cups/array.h
+ppdc-filter.o: ../cups/language.h ../cups/string-private.h ../config.h
 ppdc-filter.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 ppdc-filter.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 ppdc-filter.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
@@ -75,7 +75,7 @@ ppdc-filter.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
 ppdc-filter.o: ../cups/thread-private.h
 ppdc-font.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h
 ppdc-font.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-ppdc-font.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+ppdc-font.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 ppdc-font.o: ../cups/string-private.h ../config.h ../cups/debug-private.h
 ppdc-font.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
 ppdc-font.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
@@ -84,7 +84,7 @@ ppdc-font.o: ../cups/language-private.h ../cups/transcode.h
 ppdc-font.o: ../cups/thread-private.h
 ppdc-group.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h
 ppdc-group.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-ppdc-group.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+ppdc-group.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 ppdc-group.o: ../cups/string-private.h ../config.h ../cups/debug-private.h
 ppdc-group.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
 ppdc-group.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
@@ -93,8 +93,8 @@ ppdc-group.o: ../cups/language-private.h ../cups/transcode.h
 ppdc-group.o: ../cups/thread-private.h
 ppdc-import.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h
 ppdc-import.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-ppdc-import.o: ../cups/ipp.h ../cups/http.h ../cups/language.h
-ppdc-import.o: ../cups/array.h ../cups/string-private.h ../config.h
+ppdc-import.o: ../cups/ipp.h ../cups/http.h ../cups/array.h
+ppdc-import.o: ../cups/language.h ../cups/string-private.h ../config.h
 ppdc-import.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 ppdc-import.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 ppdc-import.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
@@ -102,8 +102,8 @@ ppdc-import.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
 ppdc-import.o: ../cups/thread-private.h
 ppdc-mediasize.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h
 ppdc-mediasize.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-ppdc-mediasize.o: ../cups/ipp.h ../cups/http.h ../cups/language.h
-ppdc-mediasize.o: ../cups/array.h ../cups/string-private.h ../config.h
+ppdc-mediasize.o: ../cups/ipp.h ../cups/http.h ../cups/array.h
+ppdc-mediasize.o: ../cups/language.h ../cups/string-private.h ../config.h
 ppdc-mediasize.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 ppdc-mediasize.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 ppdc-mediasize.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
@@ -111,8 +111,8 @@ ppdc-mediasize.o: ../cups/ipp.h ../cups/language-private.h
 ppdc-mediasize.o: ../cups/transcode.h ../cups/thread-private.h
 ppdc-message.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h
 ppdc-message.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-ppdc-message.o: ../cups/ipp.h ../cups/http.h ../cups/language.h
-ppdc-message.o: ../cups/array.h ../cups/string-private.h ../config.h
+ppdc-message.o: ../cups/ipp.h ../cups/http.h ../cups/array.h
+ppdc-message.o: ../cups/language.h ../cups/string-private.h ../config.h
 ppdc-message.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 ppdc-message.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 ppdc-message.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
@@ -120,8 +120,8 @@ ppdc-message.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
 ppdc-message.o: ../cups/thread-private.h
 ppdc-option.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h
 ppdc-option.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-ppdc-option.o: ../cups/ipp.h ../cups/http.h ../cups/language.h
-ppdc-option.o: ../cups/array.h ../cups/string-private.h ../config.h
+ppdc-option.o: ../cups/ipp.h ../cups/http.h ../cups/array.h
+ppdc-option.o: ../cups/language.h ../cups/string-private.h ../config.h
 ppdc-option.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 ppdc-option.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 ppdc-option.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
@@ -129,8 +129,8 @@ ppdc-option.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
 ppdc-option.o: ../cups/thread-private.h
 ppdc-profile.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h
 ppdc-profile.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-ppdc-profile.o: ../cups/ipp.h ../cups/http.h ../cups/language.h
-ppdc-profile.o: ../cups/array.h ../cups/string-private.h ../config.h
+ppdc-profile.o: ../cups/ipp.h ../cups/http.h ../cups/array.h
+ppdc-profile.o: ../cups/language.h ../cups/string-private.h ../config.h
 ppdc-profile.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 ppdc-profile.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 ppdc-profile.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
@@ -138,8 +138,8 @@ ppdc-profile.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
 ppdc-profile.o: ../cups/thread-private.h
 ppdc-shared.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h
 ppdc-shared.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-ppdc-shared.o: ../cups/ipp.h ../cups/http.h ../cups/language.h
-ppdc-shared.o: ../cups/array.h ../cups/string-private.h ../config.h
+ppdc-shared.o: ../cups/ipp.h ../cups/http.h ../cups/array.h
+ppdc-shared.o: ../cups/language.h ../cups/string-private.h ../config.h
 ppdc-shared.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 ppdc-shared.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 ppdc-shared.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
@@ -147,8 +147,8 @@ ppdc-shared.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
 ppdc-shared.o: ../cups/thread-private.h
 ppdc-source.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h
 ppdc-source.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-ppdc-source.o: ../cups/ipp.h ../cups/http.h ../cups/language.h
-ppdc-source.o: ../cups/array.h ../cups/string-private.h ../config.h
+ppdc-source.o: ../cups/ipp.h ../cups/http.h ../cups/array.h
+ppdc-source.o: ../cups/language.h ../cups/string-private.h ../config.h
 ppdc-source.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 ppdc-source.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 ppdc-source.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
@@ -158,8 +158,8 @@ ppdc-source.o: ../data/epson.h ../data/escp.h ../data/hp.h ../data/label.h
 ppdc-source.o: ../data/pcl.h
 ppdc-string.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h
 ppdc-string.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-ppdc-string.o: ../cups/ipp.h ../cups/http.h ../cups/language.h
-ppdc-string.o: ../cups/array.h ../cups/string-private.h ../config.h
+ppdc-string.o: ../cups/ipp.h ../cups/http.h ../cups/array.h
+ppdc-string.o: ../cups/language.h ../cups/string-private.h ../config.h
 ppdc-string.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 ppdc-string.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 ppdc-string.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
@@ -167,8 +167,8 @@ ppdc-string.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
 ppdc-string.o: ../cups/thread-private.h
 ppdc-variable.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h
 ppdc-variable.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-ppdc-variable.o: ../cups/ipp.h ../cups/http.h ../cups/language.h
-ppdc-variable.o: ../cups/array.h ../cups/string-private.h ../config.h
+ppdc-variable.o: ../cups/ipp.h ../cups/http.h ../cups/array.h
+ppdc-variable.o: ../cups/language.h ../cups/string-private.h ../config.h
 ppdc-variable.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 ppdc-variable.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 ppdc-variable.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
@@ -176,7 +176,7 @@ ppdc-variable.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
 ppdc-variable.o: ../cups/thread-private.h
 genstrings.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h
 genstrings.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-genstrings.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+genstrings.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 genstrings.o: ../cups/string-private.h ../config.h ../cups/debug-private.h
 genstrings.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
 genstrings.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
@@ -185,7 +185,7 @@ genstrings.o: ../cups/language-private.h ../cups/transcode.h
 genstrings.o: ../cups/thread-private.h
 ppdc.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h
 ppdc.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h
-ppdc.o: ../cups/http.h ../cups/language.h ../cups/array.h
+ppdc.o: ../cups/http.h ../cups/array.h ../cups/language.h
 ppdc.o: ../cups/string-private.h ../config.h ../cups/debug-private.h
 ppdc.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
 ppdc.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
@@ -194,7 +194,7 @@ ppdc.o: ../cups/language-private.h ../cups/transcode.h
 ppdc.o: ../cups/thread-private.h
 ppdhtml.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h
 ppdhtml.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h
-ppdhtml.o: ../cups/http.h ../cups/language.h ../cups/array.h
+ppdhtml.o: ../cups/http.h ../cups/array.h ../cups/language.h
 ppdhtml.o: ../cups/string-private.h ../config.h ../cups/debug-private.h
 ppdhtml.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
 ppdhtml.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
@@ -203,7 +203,7 @@ ppdhtml.o: ../cups/language-private.h ../cups/transcode.h
 ppdhtml.o: ../cups/thread-private.h
 ppdi.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h
 ppdi.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h
-ppdi.o: ../cups/http.h ../cups/language.h ../cups/array.h
+ppdi.o: ../cups/http.h ../cups/array.h ../cups/language.h
 ppdi.o: ../cups/string-private.h ../config.h ../cups/debug-private.h
 ppdi.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
 ppdi.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
@@ -211,17 +211,16 @@ ppdi.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
 ppdi.o: ../cups/language-private.h ../cups/transcode.h
 ppdi.o: ../cups/thread-private.h
 ppdmerge.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-ppdmerge.o: ../cups/ipp.h ../cups/http.h ../cups/versioning.h
-ppdmerge.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
-ppdmerge.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
-ppdmerge.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
-ppdmerge.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
-ppdmerge.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
-ppdmerge.o: ../cups/transcode.h ../cups/thread-private.h
-ppdmerge.o: ../cups/ppd-private.h ../cups/array.h
+ppdmerge.o: ../cups/ipp.h ../cups/http.h ../cups/versioning.h ../cups/array.h
+ppdmerge.o: ../cups/language.h ../cups/string-private.h ../config.h
+ppdmerge.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
+ppdmerge.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
+ppdmerge.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
+ppdmerge.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
+ppdmerge.o: ../cups/thread-private.h ../cups/ppd-private.h ../cups/array.h
 ppdpo.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h
 ppdpo.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h
-ppdpo.o: ../cups/http.h ../cups/language.h ../cups/array.h
+ppdpo.o: ../cups/http.h ../cups/array.h ../cups/language.h
 ppdpo.o: ../cups/string-private.h ../config.h ../cups/debug-private.h
 ppdpo.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
 ppdpo.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
@@ -230,8 +229,8 @@ ppdpo.o: ../cups/language-private.h ../cups/transcode.h
 ppdpo.o: ../cups/thread-private.h
 testcatalog.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h
 testcatalog.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-testcatalog.o: ../cups/ipp.h ../cups/http.h ../cups/language.h
-testcatalog.o: ../cups/array.h ../cups/string-private.h ../config.h
+testcatalog.o: ../cups/ipp.h ../cups/http.h ../cups/array.h
+testcatalog.o: ../cups/language.h ../cups/string-private.h ../config.h
 testcatalog.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 testcatalog.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 testcatalog.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
index 9d86f98dc8822fe1a2dd197a0ce4abefacf0f8a9..d1e099d3956e9f7ec6328510e66b2f352ab7e160 100644 (file)
@@ -1,8 +1,8 @@
 # DO NOT DELETE
 
 auth.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-auth.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h
-auth.o: ../cups/array.h ../cups/string-private.h ../config.h
+auth.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+auth.o: ../cups/language.h ../cups/string-private.h ../config.h
 auth.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 auth.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 auth.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
@@ -12,19 +12,19 @@ auth.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
 auth.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h
 auth.o: network.h subscriptions.h
 banners.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-banners.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-banners.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
-banners.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
-banners.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
-banners.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
-banners.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
-banners.o: ../cups/transcode.h ../cups/thread-private.h mime.h
-banners.o: ../cups/array.h ../cups/file.h sysman.h statbuf.h cert.h auth.h
-banners.o: client.h policy.h printers.h ../cups/pwg-private.h classes.h job.h
-banners.o: conf.h banners.h dirsvc.h network.h subscriptions.h ../cups/dir.h
+banners.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+banners.o: ../cups/language.h ../cups/string-private.h ../config.h
+banners.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
+banners.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
+banners.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
+banners.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
+banners.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h
+banners.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
+banners.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h
+banners.o: network.h subscriptions.h ../cups/dir.h
 cert.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-cert.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h
-cert.o: ../cups/array.h ../cups/string-private.h ../config.h
+cert.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+cert.o: ../cups/language.h ../cups/string-private.h ../config.h
 cert.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 cert.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 cert.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
@@ -34,30 +34,30 @@ cert.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
 cert.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h
 cert.o: network.h subscriptions.h
 classes.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-classes.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-classes.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
-classes.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
-classes.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
-classes.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
-classes.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
-classes.o: ../cups/transcode.h ../cups/thread-private.h mime.h
-classes.o: ../cups/array.h ../cups/file.h sysman.h statbuf.h cert.h auth.h
-classes.o: client.h policy.h printers.h ../cups/pwg-private.h classes.h job.h
-classes.o: conf.h banners.h dirsvc.h network.h subscriptions.h
+classes.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+classes.o: ../cups/language.h ../cups/string-private.h ../config.h
+classes.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
+classes.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
+classes.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
+classes.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
+classes.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h
+classes.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
+classes.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h
+classes.o: network.h subscriptions.h
 client.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-client.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-client.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
-client.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
-client.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
-client.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
-client.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
-client.o: ../cups/transcode.h ../cups/thread-private.h mime.h ../cups/array.h
-client.o: ../cups/file.h sysman.h statbuf.h cert.h auth.h client.h policy.h
-client.o: printers.h ../cups/pwg-private.h classes.h job.h conf.h banners.h
-client.o: dirsvc.h network.h subscriptions.h
+client.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+client.o: ../cups/language.h ../cups/string-private.h ../config.h
+client.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
+client.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
+client.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
+client.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
+client.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h
+client.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
+client.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h
+client.o: network.h subscriptions.h
 conf.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-conf.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h
-conf.o: ../cups/array.h ../cups/string-private.h ../config.h
+conf.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+conf.o: ../cups/language.h ../cups/string-private.h ../config.h
 conf.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 conf.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 conf.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
@@ -67,19 +67,19 @@ conf.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
 conf.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h
 conf.o: network.h subscriptions.h
 dirsvc.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-dirsvc.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-dirsvc.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
-dirsvc.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
-dirsvc.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
-dirsvc.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
-dirsvc.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
-dirsvc.o: ../cups/transcode.h ../cups/thread-private.h mime.h ../cups/array.h
-dirsvc.o: ../cups/file.h sysman.h statbuf.h cert.h auth.h client.h policy.h
-dirsvc.o: printers.h ../cups/pwg-private.h classes.h job.h conf.h banners.h
-dirsvc.o: dirsvc.h network.h subscriptions.h
+dirsvc.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+dirsvc.o: ../cups/language.h ../cups/string-private.h ../config.h
+dirsvc.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
+dirsvc.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
+dirsvc.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
+dirsvc.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
+dirsvc.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h
+dirsvc.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
+dirsvc.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h
+dirsvc.o: network.h subscriptions.h
 env.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-env.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h
-env.o: ../cups/array.h ../cups/string-private.h ../config.h
+env.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+env.o: ../cups/language.h ../cups/string-private.h ../config.h
 env.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 env.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 env.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
@@ -89,8 +89,8 @@ env.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
 env.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h
 env.o: network.h subscriptions.h
 main.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-main.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h
-main.o: ../cups/array.h ../cups/string-private.h ../config.h
+main.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+main.o: ../cups/language.h ../cups/string-private.h ../config.h
 main.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 main.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 main.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
@@ -100,8 +100,8 @@ main.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
 main.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h
 main.o: network.h subscriptions.h ../cups/dir.h
 ipp.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-ipp.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h
-ipp.o: ../cups/array.h ../cups/string-private.h ../config.h
+ipp.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+ipp.o: ../cups/language.h ../cups/string-private.h ../config.h
 ipp.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 ipp.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 ipp.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
@@ -111,19 +111,19 @@ ipp.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
 ipp.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h
 ipp.o: network.h subscriptions.h ../cups/ppd-private.h
 listen.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-listen.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-listen.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
-listen.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
-listen.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
-listen.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
-listen.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
-listen.o: ../cups/transcode.h ../cups/thread-private.h mime.h ../cups/array.h
-listen.o: ../cups/file.h sysman.h statbuf.h cert.h auth.h client.h policy.h
-listen.o: printers.h ../cups/pwg-private.h classes.h job.h conf.h banners.h
-listen.o: dirsvc.h network.h subscriptions.h
+listen.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+listen.o: ../cups/language.h ../cups/string-private.h ../config.h
+listen.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
+listen.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
+listen.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
+listen.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
+listen.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h
+listen.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
+listen.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h
+listen.o: network.h subscriptions.h
 job.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-job.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h
-job.o: ../cups/array.h ../cups/string-private.h ../config.h
+job.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+job.o: ../cups/language.h ../cups/string-private.h ../config.h
 job.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 job.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 job.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
@@ -133,8 +133,8 @@ job.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
 job.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h
 job.o: network.h subscriptions.h ../cups/backend.h ../cups/dir.h
 log.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-log.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h
-log.o: ../cups/array.h ../cups/string-private.h ../config.h
+log.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+log.o: ../cups/language.h ../cups/string-private.h ../config.h
 log.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 log.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 log.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
@@ -146,8 +146,8 @@ log.o: network.h subscriptions.h
 network.o: ../cups/http-private.h ../config.h ../cups/http.h
 network.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h cupsd.h
 network.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-network.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-network.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
+network.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+network.o: ../cups/language.h ../cups/string-private.h
 network.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 network.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 network.o: ../cups/language-private.h ../cups/transcode.h
@@ -156,53 +156,52 @@ network.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
 network.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h
 network.o: network.h subscriptions.h
 policy.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-policy.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-policy.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
-policy.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
-policy.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
-policy.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
-policy.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
-policy.o: ../cups/transcode.h ../cups/thread-private.h mime.h ../cups/array.h
-policy.o: ../cups/file.h sysman.h statbuf.h cert.h auth.h client.h policy.h
-policy.o: printers.h ../cups/pwg-private.h classes.h job.h conf.h banners.h
-policy.o: dirsvc.h network.h subscriptions.h
+policy.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+policy.o: ../cups/language.h ../cups/string-private.h ../config.h
+policy.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
+policy.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
+policy.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
+policy.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
+policy.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h
+policy.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
+policy.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h
+policy.o: network.h subscriptions.h
 printers.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-printers.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-printers.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
-printers.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
-printers.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
-printers.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
-printers.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
-printers.o: ../cups/transcode.h ../cups/thread-private.h mime.h
-printers.o: ../cups/array.h ../cups/file.h sysman.h statbuf.h cert.h auth.h
-printers.o: client.h policy.h printers.h ../cups/pwg-private.h classes.h
-printers.o: job.h conf.h banners.h dirsvc.h network.h subscriptions.h
-printers.o: ../cups/dir.h
+printers.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+printers.o: ../cups/language.h ../cups/string-private.h ../config.h
+printers.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
+printers.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
+printers.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
+printers.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
+printers.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h
+printers.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
+printers.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h
+printers.o: network.h subscriptions.h ../cups/dir.h
 process.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-process.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-process.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
-process.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
-process.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
-process.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
-process.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
-process.o: ../cups/transcode.h ../cups/thread-private.h mime.h
-process.o: ../cups/array.h ../cups/file.h sysman.h statbuf.h cert.h auth.h
-process.o: client.h policy.h printers.h ../cups/pwg-private.h classes.h job.h
-process.o: conf.h banners.h dirsvc.h network.h subscriptions.h
+process.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+process.o: ../cups/language.h ../cups/string-private.h ../config.h
+process.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
+process.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
+process.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
+process.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
+process.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h
+process.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
+process.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h
+process.o: network.h subscriptions.h
 quotas.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-quotas.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-quotas.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
-quotas.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
-quotas.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
-quotas.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
-quotas.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
-quotas.o: ../cups/transcode.h ../cups/thread-private.h mime.h ../cups/array.h
-quotas.o: ../cups/file.h sysman.h statbuf.h cert.h auth.h client.h policy.h
-quotas.o: printers.h ../cups/pwg-private.h classes.h job.h conf.h banners.h
-quotas.o: dirsvc.h network.h subscriptions.h
+quotas.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+quotas.o: ../cups/language.h ../cups/string-private.h ../config.h
+quotas.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
+quotas.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
+quotas.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
+quotas.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
+quotas.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h
+quotas.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
+quotas.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h
+quotas.o: network.h subscriptions.h
 removefile.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
 removefile.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-removefile.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
+removefile.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
 removefile.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
 removefile.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
 removefile.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
@@ -212,42 +211,42 @@ removefile.o: ../cups/array.h ../cups/file.h sysman.h statbuf.h cert.h auth.h
 removefile.o: client.h policy.h printers.h ../cups/pwg-private.h classes.h
 removefile.o: job.h conf.h banners.h dirsvc.h network.h subscriptions.h
 select.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-select.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-select.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
-select.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
-select.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
-select.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
-select.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
-select.o: ../cups/transcode.h ../cups/thread-private.h mime.h ../cups/array.h
-select.o: ../cups/file.h sysman.h statbuf.h cert.h auth.h client.h policy.h
-select.o: printers.h ../cups/pwg-private.h classes.h job.h conf.h banners.h
-select.o: dirsvc.h network.h subscriptions.h
+select.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+select.o: ../cups/language.h ../cups/string-private.h ../config.h
+select.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
+select.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
+select.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
+select.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
+select.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h
+select.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
+select.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h
+select.o: network.h subscriptions.h
 server.o: ../cups/http-private.h ../config.h ../cups/http.h
 server.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h cupsd.h
 server.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-server.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-server.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
-server.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
-server.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
+server.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+server.o: ../cups/language.h ../cups/string-private.h ../cups/debug-private.h
+server.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
+server.o: ../cups/pwg-private.h ../cups/http-private.h
 server.o: ../cups/language-private.h ../cups/transcode.h
 server.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h
 server.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
 server.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h
 server.o: network.h subscriptions.h
 statbuf.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-statbuf.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-statbuf.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
-statbuf.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
-statbuf.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
-statbuf.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
-statbuf.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
-statbuf.o: ../cups/transcode.h ../cups/thread-private.h mime.h
-statbuf.o: ../cups/array.h ../cups/file.h sysman.h statbuf.h cert.h auth.h
-statbuf.o: client.h policy.h printers.h ../cups/pwg-private.h classes.h job.h
-statbuf.o: conf.h banners.h dirsvc.h network.h subscriptions.h
+statbuf.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+statbuf.o: ../cups/language.h ../cups/string-private.h ../config.h
+statbuf.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
+statbuf.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
+statbuf.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
+statbuf.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
+statbuf.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h
+statbuf.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
+statbuf.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h
+statbuf.o: network.h subscriptions.h
 subscriptions.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
 subscriptions.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-subscriptions.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
+subscriptions.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
 subscriptions.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
 subscriptions.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
 subscriptions.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
@@ -258,16 +257,16 @@ subscriptions.o: ../cups/file.h sysman.h statbuf.h cert.h auth.h client.h
 subscriptions.o: policy.h printers.h ../cups/pwg-private.h classes.h job.h
 subscriptions.o: conf.h banners.h dirsvc.h network.h subscriptions.h
 sysman.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-sysman.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-sysman.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
-sysman.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
-sysman.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
-sysman.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
-sysman.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
-sysman.o: ../cups/transcode.h ../cups/thread-private.h mime.h ../cups/array.h
-sysman.o: ../cups/file.h sysman.h statbuf.h cert.h auth.h client.h policy.h
-sysman.o: printers.h ../cups/pwg-private.h classes.h job.h conf.h banners.h
-sysman.o: dirsvc.h network.h subscriptions.h
+sysman.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+sysman.o: ../cups/language.h ../cups/string-private.h ../config.h
+sysman.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
+sysman.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
+sysman.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
+sysman.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
+sysman.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h
+sysman.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h
+sysman.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h
+sysman.o: network.h subscriptions.h
 filter.o: ../cups/string-private.h ../config.h ../cups/debug-private.h mime.h
 filter.o: ../cups/array.h ../cups/ipp.h ../cups/file.h
 mime.o: ../cups/string-private.h ../config.h ../cups/debug-private.h
@@ -277,7 +276,7 @@ type.o: ../cups/string-private.h ../config.h ../cups/debug-private.h mime.h
 type.o: ../cups/array.h ../cups/ipp.h ../cups/file.h
 cupsfilter.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
 cupsfilter.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-cupsfilter.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
+cupsfilter.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
 cupsfilter.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
 cupsfilter.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
 cupsfilter.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
@@ -286,48 +285,48 @@ cupsfilter.o: ../cups/transcode.h ../cups/thread-private.h mime.h
 cupsfilter.o: ../cups/array.h ../cups/file.h
 cups-deviced.o: util.h ../cups/file-private.h ../cups/cups-private.h
 cups-deviced.o: ../cups/cups.h ../cups/file.h ../cups/versioning.h
-cups-deviced.o: ../cups/ipp.h ../cups/http.h ../cups/language.h
-cups-deviced.o: ../cups/array.h ../cups/string-private.h ../config.h
+cups-deviced.o: ../cups/ipp.h ../cups/http.h ../cups/array.h
+cups-deviced.o: ../cups/language.h ../cups/string-private.h ../config.h
 cups-deviced.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 cups-deviced.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 cups-deviced.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
 cups-deviced.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
 cups-deviced.o: ../cups/thread-private.h ../cups/array.h ../cups/dir.h
 cups-lpd.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-cups-lpd.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-cups-lpd.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
-cups-lpd.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
-cups-lpd.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
-cups-lpd.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
-cups-lpd.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
-cups-lpd.o: ../cups/transcode.h ../cups/thread-private.h
+cups-lpd.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+cups-lpd.o: ../cups/language.h ../cups/string-private.h ../config.h
+cups-lpd.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
+cups-lpd.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
+cups-lpd.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
+cups-lpd.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
+cups-lpd.o: ../cups/thread-private.h
 cups-polld.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
 cups-polld.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-cups-polld.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
+cups-polld.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
 cups-polld.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
 cups-polld.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
 cups-polld.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
 cups-polld.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
 cups-polld.o: ../cups/transcode.h ../cups/thread-private.h
 testdirsvc.o: ../cups/cups.h ../cups/file.h ../cups/versioning.h
-testdirsvc.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h
+testdirsvc.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
 testdirsvc.o: ../cups/string-private.h ../config.h
 testlpd.o: ../cups/cups.h ../cups/file.h ../cups/versioning.h ../cups/ipp.h
-testlpd.o: ../cups/http.h ../cups/language.h ../cups/array.h
+testlpd.o: ../cups/http.h ../cups/array.h ../cups/language.h
 testlpd.o: ../cups/string-private.h ../config.h
 testmime.o: ../cups/string-private.h ../config.h ../cups/dir.h
 testmime.o: ../cups/versioning.h mime.h ../cups/array.h ../cups/ipp.h
 testmime.o: ../cups/file.h
 testspeed.o: ../cups/string-private.h ../config.h ../cups/cups.h
 testspeed.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-testspeed.o: ../cups/language.h ../cups/array.h ../cups/language.h
+testspeed.o: ../cups/array.h ../cups/language.h ../cups/language.h
 testspeed.o: ../cups/debug-private.h
 testsub.o: ../cups/cups.h ../cups/file.h ../cups/versioning.h ../cups/ipp.h
-testsub.o: ../cups/http.h ../cups/language.h ../cups/array.h
+testsub.o: ../cups/http.h ../cups/array.h ../cups/language.h
 testsub.o: ../cups/debug-private.h ../cups/string-private.h ../config.h
 util.o: util.h ../cups/file-private.h ../cups/cups-private.h ../cups/cups.h
 util.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-util.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
+util.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
 util.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
 util.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
 util.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
@@ -335,8 +334,8 @@ util.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
 util.o: ../cups/transcode.h ../cups/thread-private.h
 cups-driverd.o: util.h ../cups/file-private.h ../cups/cups-private.h
 cups-driverd.o: ../cups/cups.h ../cups/file.h ../cups/versioning.h
-cups-driverd.o: ../cups/ipp.h ../cups/http.h ../cups/language.h
-cups-driverd.o: ../cups/array.h ../cups/string-private.h ../config.h
+cups-driverd.o: ../cups/ipp.h ../cups/http.h ../cups/array.h
+cups-driverd.o: ../cups/language.h ../cups/string-private.h ../config.h
 cups-driverd.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 cups-driverd.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 cups-driverd.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
index 73a0c98c4493330eff9506a7171bcc7bd0e09b5e..497997d6f2e4c912d84131b20728ce7dd5871782 100644 (file)
@@ -993,6 +993,24 @@ cupsdAuthorize(cupsd_client_t *con)        /* I - Client connection */
                    "cupsdAuthorize: Copying credentials for UID %d...",
                    CUPSD_UCRED_UID(peercred));
 
+    if (!KerberosInitialized)
+    {
+     /*
+      * Setup a Kerberos context for the scheduler to use...
+      */
+
+      KerberosInitialized = 1;
+
+      if (krb5_init_context(&KerberosContext))
+      {
+       KerberosContext = NULL;
+
+       cupsdLogMessage(CUPSD_LOG_ERROR,
+                       "Unable to initialize Kerberos context");
+       return;
+      }
+    }
+
     krb5_ipc_client_set_target_uid(CUPSD_UCRED_UID(peercred));
 
     if ((error = krb5_cc_default(KerberosContext, &peerccache)) != 0)
index fca0d18b179eb2870328478c400f5b5a465be5d1..72b5dbff0d50e4f0ed9da594e58270aaccd432c0 100644 (file)
@@ -41,6 +41,7 @@ cupsd_printer_t *                     /* O - New class */
 cupsdAddClass(const char *name)                /* I - Name of class */
 {
   cupsd_printer_t      *c;             /* New class */
+  char                 uri[1024];      /* Class URI */
 
 
  /*
@@ -55,8 +56,10 @@ cupsdAddClass(const char *name)              /* I - Name of class */
 
     c->type = CUPS_PRINTER_CLASS;
 
-    cupsdSetStringf(&c->uri, "ipp://%s:%d/classes/%s", ServerName, RemotePort,
-                    name);
+    httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
+                    ServerName, RemotePort, "/classes/%s", name);
+    cupsdSetString(&c->uri, uri);
+
     cupsdSetString(&c->error_policy, "retry-current-job");
   }
 
@@ -722,7 +725,7 @@ cupsdSaveAllClasses(void)
   */
 
   fchown(cupsFileNumber(fp), RunUser, Group);
-  fchmod(cupsFileNumber(fp), 0600);
+  fchmod(cupsFileNumber(fp), ConfigFilePerm);
 
  /*
   * Write a small header to the file...
index 631bc9eee4e19f40bb3a490b6f80407b8024ef36..298fdfe301204344e0b2a28684ce0dea66b4e450 100644 (file)
 
 #include "cupsd.h"
 
-#ifdef HAVE_CDSASSL
-#  include <Security/Security.h>
-#  include <Security/SecItem.h>
-#  ifdef HAVE_SECITEMPRIV_H
-#    include <Security/SecItemPriv.h>
-#  else /* Declare constant from that header... */
-extern const CFTypeRef kSecClassIdentity;
-#  endif /* HAVE_SECITEMPRIV_H */
-#  ifdef HAVE_SECIDENTITYSEARCHPRIV_H
-#    include <Security/SecIdentitySearchPriv.h>
-#  else /* Declare prototype for function in that header... */
-extern OSStatus SecIdentitySearchCreateWithPolicy(SecPolicyRef policy,
-                               CFStringRef idString, CSSM_KEYUSE keyUsage,
-                               CFTypeRef keychainOrArray,
-                               Boolean returnOnlyValidIdentities,
-                               SecIdentitySearchRef* searchRef);
-#  endif /* HAVE_SECIDENTITYSEARCHPRIV_H */
-#  ifdef HAVE_SECPOLICYPRIV_H
-#    include <Security/SecPolicyPriv.h>
-#  else /* Declare prototype for function in that header... */
-extern OSStatus SecPolicySetValue(SecPolicyRef policyRef,
-                                  const CSSM_DATA *value);
-#  endif /* HAVE_SECPOLICYPRIV_H */
-#  ifdef HAVE_SECBASEPRIV_H
-#    include <Security/SecBasePriv.h>
-#  else /* Declare prototype for function in that header... */
-extern const char *cssmErrorString(int error);
-#  endif /* HAVE_SECBASEPRIV_H */
-#endif /* HAVE_CDSASSL */
-
-#ifdef HAVE_GNUTLS
-#  include <gnutls/x509.h>
-#endif /* HAVE_GNUTLS */
-
 #ifdef HAVE_TCPD_H
 #  include <tcpd.h>
 #endif /* HAVE_TCPD_H */
@@ -538,15 +504,12 @@ cupsdCloseClient(cupsd_client_t *con)     /* I - Client to close */
   int          partial;                /* Do partial close for SSL? */
 #ifdef HAVE_LIBSSL
   SSL_CTX      *context;               /* Context for encryption */
-  SSL          *conn;                  /* Connection for encryption */
   unsigned long        error;                  /* Error code */
 #elif defined(HAVE_GNUTLS)
-  http_tls_t   *conn;                  /* TLS connection information */
   int          error;                  /* Error code */
   gnutls_certificate_server_credentials *credentials;
                                        /* TLS credentials */
 #  elif defined(HAVE_CDSASSL)
-  http_tls_t   *conn;                  /* CDSA connection information */
 #endif /* HAVE_LIBSSL */
 
 
@@ -570,10 +533,9 @@ cupsdCloseClient(cupsd_client_t *con)      /* I - Client to close */
     partial = 1;
 
 #  ifdef HAVE_LIBSSL
-    conn    = (SSL *)(con->http.tls);
-    context = SSL_get_SSL_CTX(conn);
+    context = SSL_get_SSL_CTX(con->http.tls);
 
-    switch (SSL_shutdown(conn))
+    switch (SSL_shutdown(con->http.tls))
     {
       case 1 :
           cupsdLogMessage(CUPSD_LOG_DEBUG,
@@ -590,13 +552,12 @@ cupsdCloseClient(cupsd_client_t *con)     /* I - Client to close */
     }
 
     SSL_CTX_free(context);
-    SSL_free(conn);
+    SSL_free(con->http.tls);
 
 #  elif defined(HAVE_GNUTLS)
-    conn        = (http_tls_t *)(con->http.tls);
-    credentials = (gnutls_certificate_server_credentials *)(conn->credentials);
+    credentials = (gnutls_certificate_server_credentials *)(con->http.tls_credentials);
 
-    error = gnutls_bye(conn->session, GNUTLS_SHUT_WR);
+    error = gnutls_bye(con->http.tls, GNUTLS_SHUT_WR);
     switch (error)
     {
       case GNUTLS_E_SUCCESS:
@@ -609,23 +570,19 @@ cupsdCloseClient(cupsd_client_t *con)     /* I - Client to close */
        break;
     }
 
-    gnutls_deinit(conn->session);
+    gnutls_deinit(con->http.tls);
     gnutls_certificate_free_credentials(*credentials);
     free(credentials);
-    free(conn);
 
 #  elif defined(HAVE_CDSASSL)
-    conn = (http_tls_t *)(con->http.tls);
-
-    while (SSLClose(conn->session) == errSSLWouldBlock)
+    while (SSLClose(con->http.tls) == errSSLWouldBlock)
       usleep(1000);
 
-    SSLDisposeContext(conn->session);
+    SSLDisposeContext(con->http.tls);
 
-    if (conn->certsArray)
-      CFRelease(conn->certsArray);
+    if (con->http.tls_credentials)
+      CFRelease(con->http.tls_credentials);
 
-    free(conn);
 #  endif /* HAVE_LIBSSL */
 
     con->http.tls = NULL;
@@ -1382,6 +1339,35 @@ cupsdReadClient(cupsd_client_t *con)     /* I - Client to read from */
                break;
              }
            }
+            else if ((!strncmp(con->uri, "/printers/", 10) ||
+                     !strncmp(con->uri, "/classes/", 9)) &&
+                    !strcmp(con->uri + strlen(con->uri) - 4, ".png"))
+           {
+            /*
+             * Send icon file - get the real queue name since queue names are
+             * not case sensitive but filenames can be...
+             */
+
+             con->uri[strlen(con->uri) - 4] = '\0';    /* Drop ".png" */
+
+              if (!strncmp(con->uri, "/printers/", 10))
+                p = cupsdFindPrinter(con->uri + 10);
+              else
+                p = cupsdFindClass(con->uri + 9);
+
+              if (p)
+               snprintf(con->uri, sizeof(con->uri), "/icons/%s.png", p->name);
+             else
+             {
+               if (!cupsdSendError(con, HTTP_NOT_FOUND, CUPSD_AUTH_NONE))
+               {
+                 cupsdCloseClient(con);
+                 return;
+               }
+
+               break;
+             }
+           }
 
            if ((!strncmp(con->uri, "/admin", 6) &&
                 strncmp(con->uri, "/admin/conf/", 12) &&
@@ -3091,13 +3077,12 @@ data_ready(cupsd_client_t *con)         /* I - Client */
     if (SSL_pending((SSL *)(con->http.tls)))
       return (1);
 #  elif defined(HAVE_GNUTLS)
-    if (gnutls_record_check_pending(((http_tls_t *)(con->http.tls))->session))
+    if (gnutls_record_check_pending(con->http.tls))
       return (1);
 #  elif defined(HAVE_CDSASSL)
     size_t bytes;                      /* Bytes that are available */
 
-    if (!SSLGetBufferedReadSize(((http_tls_t *)(con->http.tls))->session,
-                                &bytes) && bytes > 0)
+    if (!SSLGetBufferedReadSize(con->http.tls, &bytes) && bytes > 0)
       return (1);
 #  endif /* HAVE_LIBSSL */
   }
@@ -3117,7 +3102,6 @@ encrypt_client(cupsd_client_t *con)       /* I - Client to encrypt */
 {
 #  ifdef HAVE_LIBSSL
   SSL_CTX      *context;               /* Context for encryption */
-  SSL          *conn;                  /* Connection for encryption */
   BIO          *bio;                   /* BIO data */
   unsigned long        error;                  /* Error code */
 
@@ -3154,10 +3138,10 @@ encrypt_client(cupsd_client_t *con)     /* I - Client to encrypt */
   bio = BIO_new(_httpBIOMethods());
   BIO_ctrl(bio, BIO_C_SET_FILE_PTR, 0, (char *)HTTP(con));
 
-  conn = SSL_new(context);
-  SSL_set_bio(conn, bio, bio);
+  con->http.tls = SSL_new(context);
+  SSL_set_bio(con->http.tls, bio, bio);
 
-  if (SSL_accept(conn) != 1)
+  if (SSL_accept(con->http.tls) != 1)
   {
     cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to encrypt connection from %s!",
                     con->http.hostname);
@@ -3166,18 +3150,17 @@ encrypt_client(cupsd_client_t *con)     /* I - Client to encrypt */
       cupsdLogMessage(CUPSD_LOG_ERROR, "%s", ERR_error_string(error, NULL));
 
     SSL_CTX_free(context);
-    SSL_free(conn);
+    SSL_free(con->http.tls);
+    con->http.tls = NULL;
     return (0);
   }
 
   cupsdLogMessage(CUPSD_LOG_DEBUG, "Connection from %s now encrypted.",
                   con->http.hostname);
 
-  con->http.tls = conn;
   return (1);
 
 #  elif defined(HAVE_GNUTLS)
-  http_tls_t   *conn;                  /* TLS session object */
   int          error;                  /* Error code */
   gnutls_certificate_server_credentials *credentials;
                                        /* TLS credentials */
@@ -3204,11 +3187,6 @@ encrypt_client(cupsd_client_t *con)      /* I - Client to encrypt */
   * Create the SSL object and perform the SSL handshake...
   */
 
-  conn = (http_tls_t *)malloc(sizeof(http_tls_t));
-
-  if (conn == NULL)
-    return (0);
-
   credentials = (gnutls_certificate_server_credentials *)
                     malloc(sizeof(gnutls_certificate_server_credentials));
   if (credentials == NULL)
@@ -3217,7 +3195,6 @@ encrypt_client(cupsd_client_t *con)       /* I - Client to encrypt */
                     "Unable to encrypt connection from %s - %s",
                     con->http.hostname, strerror(errno));
 
-    free(conn);
     return (0);
   }
 
@@ -3225,14 +3202,14 @@ encrypt_client(cupsd_client_t *con)     /* I - Client to encrypt */
   gnutls_certificate_set_x509_key_file(*credentials, ServerCertificate,
                                       ServerKey, GNUTLS_X509_FMT_PEM);
 
-  gnutls_init(&(conn->session), GNUTLS_SERVER);
-  gnutls_set_default_priority(conn->session);
-  gnutls_credentials_set(conn->session, GNUTLS_CRD_CERTIFICATE, *credentials);
-  gnutls_transport_set_ptr(conn->session, (gnutls_transport_ptr)HTTP(con));
-  gnutls_transport_set_pull_function(conn->session, _httpReadGNUTLS);
-  gnutls_transport_set_push_function(conn->session, _httpWriteGNUTLS);
+  gnutls_init(&con->http.tls), GNUTLS_SERVER);
+  gnutls_set_default_priority(con->http.tls);
+  gnutls_credentials_set(con->http.tls, GNUTLS_CRD_CERTIFICATE, *credentials);
+  gnutls_transport_set_ptr(con->http.tls, (gnutls_transport_ptr)HTTP(con));
+  gnutls_transport_set_pull_function(con->http.tls, _httpReadGNUTLS);
+  gnutls_transport_set_push_function(con->http.tls, _httpWriteGNUTLS);
 
-  error = gnutls_handshake(conn->session);
+  error = gnutls_handshake(con->http.tls);
 
   if (error != GNUTLS_E_SUCCESS)
   {
@@ -3240,9 +3217,9 @@ encrypt_client(cupsd_client_t *con)       /* I - Client to encrypt */
                     "Unable to encrypt connection from %s - %s",
                     con->http.hostname, gnutls_strerror(error));
 
-    gnutls_deinit(conn->session);
+    gnutls_deinit(con->http.tls);
     gnutls_certificate_free_credentials(*credentials);
-    free(conn);
+    con->http.tls = NULL;
     free(credentials);
     return (0);
   }
@@ -3250,36 +3227,30 @@ encrypt_client(cupsd_client_t *con)     /* I - Client to encrypt */
   cupsdLogMessage(CUPSD_LOG_DEBUG, "Connection from %s now encrypted.",
                   con->http.hostname);
 
-  conn->credentials = credentials;
-  con->http.tls = conn;
+  con->http.tls_credentials = credentials;
   return (1);
 
 #  elif defined(HAVE_CDSASSL)
   OSStatus     error;                  /* Error code */
-  http_tls_t   *conn;                  /* CDSA connection information */
 
 
   cupsdLogMessage(CUPSD_LOG_DEBUG2, "encrypt_client(con=%p(%d))", con,
                   con->http.fd);
 
-  if ((conn = (http_tls_t *)malloc(sizeof(http_tls_t))) == NULL)
-    return (0);
-
-  error            = 0;
-  conn->session    = NULL;
-  conn->certsArray = get_cdsa_certificate(con);
+  error                     = 0;
+  con->http.tls_credentials = get_cdsa_certificate(con);
 
-  if (!conn->certsArray)
+  if (!con->http.tls_credentials)
   {
    /*
     * No keychain (yet), make a self-signed certificate...
     */
 
     if (make_certificate(con))
-      conn->certsArray = get_cdsa_certificate(con);
+      con->http.tls_credentials = get_cdsa_certificate(con);
   }
 
-  if (!conn->certsArray)
+  if (!con->http.tls_credentials)
   {
     cupsdLogMessage(CUPSD_LOG_ERROR,
                    "Could not find signing key in keychain \"%s\"",
@@ -3288,25 +3259,25 @@ encrypt_client(cupsd_client_t *con)     /* I - Client to encrypt */
   }
 
   if (!error)
-    error = SSLNewContext(true, &conn->session);
+    error = SSLNewContext(true, &con->http.tls);
 
   if (!error)
-    error = SSLSetIOFuncs(conn->session, _httpReadCDSA, _httpWriteCDSA);
+    error = SSLSetIOFuncs(con->http.tls, _httpReadCDSA, _httpWriteCDSA);
 
   if (!error)
-    error = SSLSetProtocolVersionEnabled(conn->session, kSSLProtocol2, false);
+    error = SSLSetProtocolVersionEnabled(con->http.tls, kSSLProtocol2, false);
 
   if (!error)
-    error = SSLSetConnection(conn->session, HTTP(con));
+    error = SSLSetConnection(con->http.tls, HTTP(con));
 
   if (!error)
-    error = SSLSetAllowsExpiredCerts(conn->session, true);
+    error = SSLSetAllowsExpiredCerts(con->http.tls, true);
 
   if (!error)
-    error = SSLSetAllowsAnyRoot(conn->session, true);
+    error = SSLSetAllowsAnyRoot(con->http.tls, true);
 
   if (!error)
-    error = SSLSetCertificate(conn->session, conn->certsArray);
+    error = SSLSetCertificate(con->http.tls, con->http.tls_credentials);
 
   if (!error)
   {
@@ -3314,7 +3285,7 @@ encrypt_client(cupsd_client_t *con)       /* I - Client to encrypt */
     * Perform SSL/TLS handshake
     */
 
-    while ((error = SSLHandshake(conn->session)) == errSSLWouldBlock)
+    while ((error = SSLHandshake(con->http.tls)) == errSSLWouldBlock)
       usleep(1000);
   }
 
@@ -3327,13 +3298,17 @@ encrypt_client(cupsd_client_t *con)     /* I - Client to encrypt */
     con->http.error  = error;
     con->http.status = HTTP_ERROR;
 
-    if (conn->session)
-      SSLDisposeContext(conn->session);
-
-    if (conn->certsArray)
-      CFRelease(conn->certsArray);
+    if (con->http.tls)
+    {
+      SSLDisposeContext(con->http.tls);
+      con->http.tls = NULL;
+    }
 
-    free(conn);
+    if (con->http.tls_credentials)
+    {
+      CFRelease(con->http.tls_credentials);
+      con->http.tls_credentials = NULL;
+    }
 
     return (0);
   }
@@ -3341,7 +3316,16 @@ encrypt_client(cupsd_client_t *con)      /* I - Client to encrypt */
   cupsdLogMessage(CUPSD_LOG_DEBUG, "Connection from %s now encrypted.",
                   con->http.hostname);
 
-  con->http.tls = conn;
+  CFArrayRef           peerCerts;      /* Peer certificates */
+
+  if (!(error = SSLCopyPeerCertificates(con->http.tls, &peerCerts)) && peerCerts)
+  {
+    cupsdLogMessage(CUPSD_LOG_DEBUG, "Received %d peer certificates!",
+                   (int)CFArrayGetCount(peerCerts));
+  }
+  else
+    cupsdLogMessage(CUPSD_LOG_DEBUG, "Received NO peer certificates!");
+
   return (1);
 
 #  endif /* HAVE_LIBSSL */
@@ -3354,9 +3338,9 @@ encrypt_client(cupsd_client_t *con)       /* I - Client to encrypt */
  * 'get_cdsa_certificate()' - Get a SSL/TLS certificate from the System keychain.
  */
 
-static CFArrayRef                      /* O - Array of certificates */
+static CFArrayRef                              /* O - Array of certificates */
 get_cdsa_certificate(
-    cupsd_client_t *con)               /* I - Client connection */
+    cupsd_client_t *con)                       /* I - Client connection */
 {
   OSStatus             err;            /* Error info */
   SecKeychainRef       keychain = NULL;/* Keychain reference */
@@ -3462,7 +3446,7 @@ get_cdsa_certificate(
 
 #  elif defined(HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY)
  /*
-  * Use a policy to search for valid certificates who's common name matches the
+  * Use a policy to search for valid certificates whose common name matches the
   * servername...
   */
 
@@ -3588,7 +3572,6 @@ get_cdsa_certificate(
     CFRelease(policy);
   if (query)
     CFRelease(query);
-
 #  elif defined(HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY)
   if (policy)
     CFRelease(policy);
@@ -3623,8 +3606,14 @@ get_file(cupsd_client_t *con,            /* I  - Client connection */
 
   language[0] = '\0';
 
-  if (!strncmp(con->uri, "/ppd/", 5))
+  if (!strncmp(con->uri, "/ppd/", 5) && !strchr(con->uri + 5, '/'))
     snprintf(filename, len, "%s%s", ServerRoot, con->uri);
+  else if (!strncmp(con->uri, "/icons/", 7) && !strchr(con->uri + 7, '/'))
+  {
+    snprintf(filename, len, "%s/%s", CacheDir, con->uri + 7);
+    if (access(filename, F_OK) < 0)
+      snprintf(filename, len, "%s/images/generic.png", DocumentRoot);
+  }
   else if (!strncmp(con->uri, "/rss/", 5) && !strchr(con->uri + 5, '/'))
     snprintf(filename, len, "%s/rss/%s", CacheDir, con->uri + 5);
   else if (!strncmp(con->uri, "/admin/conf/", 12))
@@ -3657,7 +3646,9 @@ get_file(cupsd_client_t *con,             /* I  - Client connection */
   */
 
   if ((status = stat(filename, filestats)) != 0 && language[0] &&
+      strncmp(con->uri, "/icons/", 7) &&
       strncmp(con->uri, "/ppd/", 5) &&
+      strncmp(con->uri, "/rss/", 5) &&
       strncmp(con->uri, "/admin/conf/", 12) &&
       strncmp(con->uri, "/admin/log/", 11))
   {
@@ -4517,7 +4508,7 @@ make_certificate(cupsd_client_t *con)     /* I - Client connection */
     return (0);
   }
 
-  cupsFilePrintf(fp, "%s\nr\n\ny\nb\ns\ny\n%s\n\n\n\n\n%s\ny\n", 
+  cupsFilePrintf(fp, "%s\nr\n\ny\nb\ns\ny\n%s\n\n\n\n\n%s\ny\n",
                 con->servername, con->servername, ServerAdmin);
   cupsFileClose(fp);
 
index 73e4d3bf0b08be783e8cdcbb6cc7dd323ad2e35d..1c5ce2560f2c744aa1a8ea9d9a33a8eaba60d543 100644 (file)
@@ -153,8 +153,10 @@ VAR int                    MaxFDs          VALUE(0);
 
 VAR time_t             ReloadTime      VALUE(0);
                                        /* Time of reload request... */
-VAR int                        NeedReload      VALUE(RELOAD_ALL);
+VAR int                        NeedReload      VALUE(RELOAD_ALL),
                                        /* Need to load configuration? */
+                       DoingShutdown   VALUE(0);
+                                       /* Shutting down the scheduler? */
 VAR void               *DefaultProfile VALUE(0);
                                        /* Default security profile */
 
index 51ee11378cd6982a91d077166aa4418dad7f8209..581ab6763ef9579be5b48f0b7830b8d60718dd32 100644 (file)
@@ -2347,8 +2347,8 @@ dnssdBuildTxtRecord(
     int             for_lpd)           /* I - 1 = LPD, 0 = IPP */
 {
   int          i;                      /* Looping var */
-  char         adminurl_str[256],      /* URL for th admin page */
-               type_str[32],           /* Type to string buffer */
+  char         adminurl_str[256],      /* URL for the admin page */
+               type_str[32],           /* Type to string buffer */
                state_str[32],          /* State to string buffer */
                rp_str[1024],           /* Queue name string buffer */
                air_str[1024],          /* auth-info-required string buffer */
index 897c2f46d3e4e1ac4ef65358c5f5919cec4b9ee8..f711b8bd0ad27e1679b33f8f641f1770df637e7a 100644 (file)
@@ -2943,11 +2943,11 @@ add_printer(cupsd_client_t  *con,       /* I - Client connection */
 
     char cache_name[1024];             /* Cache filename for printer attrs */
 
-    snprintf(cache_name, sizeof(cache_name), "%s/%s.ipp3", CacheDir,
+    snprintf(cache_name, sizeof(cache_name), "%s/%s.ipp4", CacheDir,
              printer->name);
     unlink(cache_name);
 
-    snprintf(cache_name, sizeof(cache_name), "%s/%s.pwg2", CacheDir,
+    snprintf(cache_name, sizeof(cache_name), "%s/%s.pwg3", CacheDir,
              printer->name);
     unlink(cache_name);
 
@@ -5664,6 +5664,8 @@ copy_printer_attrs(
 {
   char                 printer_uri[HTTP_MAX_URI];
                                        /* Printer URI */
+  char                 printer_icons[HTTP_MAX_URI];
+                                       /* Printer icons */
   time_t               curtime;        /* Current time */
   int                  i;              /* Looping var */
   ipp_attribute_t      *history;       /* History collection */
@@ -5763,6 +5765,16 @@ copy_printer_attrs(
                    sizeof(errors) / sizeof(errors[0]), NULL, errors);
   }
 
+  if (!ra || cupsArrayFind(ra, "printer-icons"))
+  {
+    httpAssembleURIf(HTTP_URI_CODING_ALL, printer_icons, sizeof(printer_icons),
+                     "http", NULL, con->servername, con->serverport,
+                    "/icons/%s.png", printer->name);
+    ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_URI, "printer-icons",
+                 NULL, printer_icons);
+    cupsdLogMessage(CUPSD_LOG_DEBUG2, "printer-icons=\"%s\"", printer_icons);
+  }
+
   if (!ra || cupsArrayFind(ra, "printer-is-accepting-jobs"))
     ippAddBoolean(con->response, IPP_TAG_PRINTER, "printer-is-accepting-jobs",
                   printer->accepting);
@@ -6656,10 +6668,13 @@ delete_printer(cupsd_client_t  *con,    /* I - Client connection */
            printer->name);
   unlink(filename);
 
-  snprintf(filename, sizeof(filename), "%s/%s.ipp3", CacheDir, printer->name);
+  snprintf(filename, sizeof(filename), "%s/%s.ipp4", CacheDir, printer->name);
+  unlink(filename);
+
+  snprintf(filename, sizeof(filename), "%s/%s.png", CacheDir, printer->name);
   unlink(filename);
 
-  snprintf(filename, sizeof(filename), "%s/%s.pwg2", CacheDir, printer->name);
+  snprintf(filename, sizeof(filename), "%s/%s.pwg3", CacheDir, printer->name);
   unlink(filename);
 
 #ifdef __APPLE__
index 62b6345409e6b13d6979f06c3196fda45a0656c4..cc395d3111ea91b64f049c01111d6db6eeda6d3f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * "$Id: job.c 7902 2008-09-03 14:20:17Z mike $"
  *
- *   Job management routines for the Common UNIX Printing System (CUPS).
+ *   Job management routines for the CUPS scheduler.
  *
  *   Copyright 2007-2010 by Apple Inc.
  *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
@@ -348,7 +348,7 @@ cupsdCheckJobs(void)
     */
 
     if (job->state_value == IPP_JOB_PENDING && !NeedReload && !Sleeping &&
-        !job->printer)
+        !DoingShutdown && !job->printer)
     {
       printer = cupsdFindDest(job->dest);
       pclass  = NULL;
@@ -2856,7 +2856,7 @@ finalize_job(cupsd_job_t *job,            /* I - Job */
 
              job->tries ++;
 
-             if (job->tries >= JobRetryLimit)
+             if (job->tries > JobRetryLimit && JobRetryLimit > 0)
              {
               /*
                * Too many tries...
@@ -3049,8 +3049,17 @@ get_options(cupsd_job_t *job,            /* I - Job */
   num_pwgppds = 0;
   pwgppds     = NULL;
 
-  if (pwg)
+  if (pwg &&
+      !ippFindAttribute(job->attrs,
+                        "com.apple.print.DocumentTicket.PMSpoolFormat",
+                       IPP_TAG_ZERO) &&
+      (ippFindAttribute(job->attrs, "output-mode", IPP_TAG_ZERO) ||
+       ippFindAttribute(job->attrs, "print-quality", IPP_TAG_ZERO)))
   {
+   /*
+    * Map output-mode and print-quality to a preset...
+    */
+
     if ((attr = ippFindAttribute(job->attrs, "output-mode",
                                 IPP_TAG_KEYWORD)) != NULL &&
        !strcmp(attr->values[0].string.text, "monochrome"))
@@ -3101,7 +3110,10 @@ get_options(cupsd_job_t *job,            /* I - Job */
                                      &pwgppds);
       }
     }
+  }
 
+  if (pwg)
+  {
     if (pwg->sides_option &&
         !ippFindAttribute(job->attrs, pwg->sides_option, IPP_TAG_ZERO) &&
        (attr = ippFindAttribute(job->attrs, "sides", IPP_TAG_KEYWORD)) != NULL)
index 8248c526c57fe1a499bc235b99a49b13f3fc65a8..1c0bdf4f88c78660fdc172b609acf76addfd6f57 100644 (file)
@@ -706,6 +706,8 @@ main(int  argc,                             /* I - Number of command-line args */
        * Shutdown the server...
        */
 
+        DoingShutdown = 1;
+
        cupsdStopServer();
 
        /*
@@ -736,6 +738,8 @@ main(int  argc,                             /* I - Number of command-line args */
         * Startup the server...
         */
 
+        DoingShutdown = 0;
+
         cupsdStartServer();
 
        /*
@@ -1111,6 +1115,8 @@ main(int  argc,                           /* I - Number of command-line args */
   * Close all network clients...
   */
 
+  DoingShutdown = 1;
+
   cupsdStopServer();
 
 #ifdef HAVE_LAUNCHD
index b0298c0ec382991293a4204f32b58202bd9a5bad..537d6e4f4121d8fa7ed19d25f0ea0b57162ea484 100644 (file)
 
 #include "cupsd.h"
 #include <cups/dir.h>
+#ifdef HAVE_APPLICATIONSERVICES_H
+#  include <ApplicationServices/ApplicationServices.h>
+#endif /* HAVE_APPLICATIONSERVICES_H */
+#ifdef HAVE_SYS_MOUNT_H
+#  include <sys/mount.h>
+#endif /* HAVE_SYS_MOUNT_H */
+#ifdef HAVE_SYS_STATFS_H
+#  include <sys/statfs.h>
+#endif /* HAVE_SYS_STATFS_H */
+#ifdef HAVE_SYS_STATVFS_H
+#  include <sys/statvfs.h>
+#endif /* HAVE_SYS_STATVFS_H */
+#ifdef HAVE_SYS_VFS_H
+#  include <sys/vfs.h>
+#endif /* HAVE_SYS_VFS_H */
 
 
 /*
@@ -97,6 +112,7 @@ cupsd_printer_t *                    /* O - New printer */
 cupsdAddPrinter(const char *name)      /* I - Name of printer */
 {
   cupsd_printer_t      *p;             /* New printer */
+  char                 uri[1024];      /* Printer URI */
 
 
  /*
@@ -120,8 +136,9 @@ cupsdAddPrinter(const char *name)   /* I - Name of printer */
   cupsdSetString(&p->info, name);
   cupsdSetString(&p->hostname, ServerName);
 
-  cupsdSetStringf(&p->uri, "ipp://%s:%d/printers/%s", ServerName, RemotePort,
-                  name);
+  httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
+                  ServerName, RemotePort, "/printers/%s", name);
+  cupsdSetString(&p->uri, uri);
   cupsdSetDeviceURI(p, "file:///dev/null");
 
   p->state      = IPP_PRINTER_STOPPED;
@@ -270,6 +287,14 @@ cupsdCreateCommonData(void)
   char                 filename[1024], /* Filename */
                        *notifier;      /* Current notifier */
   cupsd_policy_t       *p;             /* Current policy */
+  int                  k_supported;    /* Maximum file size supported */
+#ifdef HAVE_STATFS
+  struct statfs                spoolinfo;      /* FS info for spool directory */
+  double               spoolsize;      /* FS size */
+#elif defined(HAVE_STATVFS)
+  struct statvfs       spoolinfo;      /* FS info for spool directory */
+  double               spoolsize;      /* FS size */
+#endif /* HAVE_STATFS */
   static const int nups[] =            /* number-up-supported values */
                { 1, 2, 4, 6, 9, 16 };
   static const int orients[4] =/* orientation-requested-supported values */
@@ -419,6 +444,7 @@ cupsdCreateCommonData(void)
                  "multiple-document-handling",
                  "number-up",
                  "output-bin",
+                 "output-mode",
                  "orientation-requested",
                  "page-ranges",
                  "print-quality",
@@ -437,6 +463,7 @@ cupsdCreateCommonData(void)
                  "multiple-document-handling",
                  "number-up",
                  "output-bin",
+                 "output-mode",
                  "orientation-requested",
                  "page-ranges",
                  "print-quality",
@@ -449,17 +476,17 @@ cupsdCreateCommonData(void)
                  "printer-location"
                };
   static const char * const which_jobs[] =
-  {                                    /* which-jobs-supported values */
-    "completed",
-    "not-completed",
-    "aborted",
-    "all",
-    "canceled",
-    "pending",
-    "pending-held",
-    "processing",
-    "processing-stopped"
-  };
+               {                       /* which-jobs-supported values */
+                 "completed",
+                 "not-completed",
+                 "aborted",
+                 "all",
+                 "canceled",
+                 "pending",
+                 "pending-held",
+                 "processing",
+                 "processing-stopped"
+               };
 
 
   if (CommonData)
@@ -467,6 +494,34 @@ cupsdCreateCommonData(void)
 
   CommonData = ippNew();
 
+ /*
+  * Get the maximum spool size based on the size of the filesystem used for
+  * the RequestRoot directory.  If the host OS doesn't support the statfs call
+  * or the filesystem is larger than 2TiB, always report INT_MAX.
+  */
+
+#ifdef HAVE_STATFS
+  if (statfs(RequestRoot, &spoolinfo))
+    k_supported = INT_MAX;
+  else if ((spoolsize = (double)spoolinfo.f_bsize * spoolinfo.f_blocks / 1024) >
+               INT_MAX)
+    k_supported = INT_MAX;
+  else
+    k_supported = (int)spoolsize;
+
+#elif defined(HAVE_STATVFS)
+  if (statvfs(RequestRoot, &spoolinfo))
+    k_supported = INT_MAX;
+  else if ((spoolsize = (double)spoolinfo.f_frsize * spoolinfo.f_blocks / 1024) >
+               INT_MAX)
+    k_supported = INT_MAX;
+  else
+    k_supported = (int)spoolsize;
+
+#else
+  k_supported = INT_MAX;
+#endif /* HAVE_STATFS */
+
  /*
   * This list of attributes is sorted to improve performance when the
   * client provides a requested-attributes attribute...
@@ -521,6 +576,10 @@ cupsdCreateCommonData(void)
   /* job-ids-supported */
   ippAddBoolean(CommonData, IPP_TAG_PRINTER, "job-ids-supported", 1);
 
+  /* job-k-octets-supported */
+  ippAddInteger(CommonData, IPP_TAG_PRINTER, IPP_TAG_INTEGER,
+                "job-k-octets-supported", k_supported);
+
   /* job-priority-supported */
   ippAddInteger(CommonData, IPP_TAG_PRINTER, IPP_TAG_INTEGER,
                 "job-priority-supported", 100);
@@ -663,9 +722,9 @@ cupsdCreateCommonData(void)
   /* page-ranges-supported */
   ippAddBoolean(CommonData, IPP_TAG_PRINTER, "page-ranges-supported", 1);
 
-  /* pdf-override-supported */
+  /* pdl-override-supported */
   ippAddString(CommonData, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_COPY,
-               "pdl-override-supported", NULL, "not-attempted");
+               "pdl-override-supported", NULL, "attempted");
 
   /* printer-op-policy-supported */
   attr = ippAddStrings(CommonData, IPP_TAG_PRINTER, IPP_TAG_NAME | IPP_TAG_COPY,
@@ -1564,7 +1623,7 @@ cupsdSaveAllPrinters(void)
   */
 
   fchown(cupsFileNumber(fp), getuid(), Group);
-  fchmod(cupsFileNumber(fp), 0600);
+  fchmod(cupsFileNumber(fp), ConfigFilePerm & 0600);
 
  /*
   * Write a small header to the file...
@@ -3633,12 +3692,11 @@ add_printer_filter(
     if (!RunUser)
     {
      /*
-      * Only use filters that are owned by root and do not have group or world
-      * write permissions.
+      * Only use filters that are owned by root and do not have world write
+      * permissions.
       */
 
-      if (fileinfo.st_uid ||
-          (fileinfo.st_mode & (S_ISUID | S_IWGRP | S_IWOTH)) != 0)
+      if (fileinfo.st_uid || (fileinfo.st_mode & (S_ISUID | S_IWOTH)) != 0)
       {
        if (fileinfo.st_uid)
          snprintf(p->state_message, sizeof(p->state_message),
@@ -3665,7 +3723,7 @@ add_printer_filter(
 
        if (!stat(filename, &fileinfo) &&
            (fileinfo.st_uid ||
-            (fileinfo.st_mode & (S_ISUID | S_IWGRP | S_IWOTH)) != 0))
+            (fileinfo.st_mode & (S_ISUID | S_IWOTH)) != 0))
        {
          if (fileinfo.st_uid)
            snprintf(p->state_message, sizeof(p->state_message),
@@ -4002,11 +4060,11 @@ load_ppd(cupsd_printer_t *p)            /* I - Printer */
   * Check to see if the cache is up-to-date...
   */
 
-  snprintf(cache_name, sizeof(cache_name), "%s/%s.ipp3", CacheDir, p->name);
+  snprintf(cache_name, sizeof(cache_name), "%s/%s.ipp4", CacheDir, p->name);
   if (stat(cache_name, &cache_info))
     cache_info.st_mtime = 0;
 
-  snprintf(pwg_name, sizeof(pwg_name), "%s/%s.pwg2", CacheDir, p->name);
+  snprintf(pwg_name, sizeof(pwg_name), "%s/%s.pwg3", CacheDir, p->name);
   if (stat(pwg_name, &pwg_info))
     pwg_info.st_mtime = 0;
 
@@ -4490,8 +4548,9 @@ load_ppd(cupsd_printer_t *p)              /* I - Printer */
     else if (((ppd_attr = ppdFindAttr(ppd, "DefaultOutputOrder",
                                      NULL)) != NULL &&
              !strcasecmp(ppd_attr->value, "Reverse")) ||
-            (!ppd_attr && ppd->manufacturer && /* EPSON "compatibility heuristic" */
-             !strcasecmp(ppd->manufacturer, "epson")))
+            (!ppd_attr && ppd->manufacturer && /* "Compatibility heuristic" */
+             (!strcasecmp(ppd->manufacturer, "epson") ||
+              !strcasecmp(ppd->manufacturer, "lexmark"))))
     {
      /*
       * Report that this printer has a single output bin that leaves pages face
@@ -4511,6 +4570,31 @@ load_ppd(cupsd_printer_t *p)             /* I - Printer */
                   "output-bin-default", NULL, "face-down");
     }
 
+   /*
+    * output-mode...
+    */
+
+    if (ppd->color_device)
+    {
+      static const char * const output_modes[] =
+      {
+        "monochrome",
+       "color"
+      };
+
+      ippAddStrings(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
+                    "output-mode-supported", 2, NULL, output_modes);
+      ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
+                   "output-mode-default", NULL, "color");
+    }
+    else
+    {
+      ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
+                   "output-mode-supported", NULL, "monochrome");
+      ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
+                   "output-mode-default", NULL, "monochrome");
+    }
+
    /*
     * Printer resolutions...
     */
@@ -4544,7 +4628,7 @@ load_ppd(cupsd_printer_t *p)              /* I - Printer */
          cupsdLogMessage(CUPSD_LOG_WARN,
                          "Bad resolution \"%s\" for printer %s.",
                          choice->choice, p->name);
-         xdpi = ydpi = 72;
+         xdpi = ydpi = 300;
        }
 
         attr->values[i].resolution.xres  = xdpi;
@@ -4578,7 +4662,7 @@ load_ppd(cupsd_printer_t *p)              /* I - Printer */
        cupsdLogMessage(CUPSD_LOG_WARN,
                        "Bad default resolution \"%s\" for printer %s.",
                        ppd_attr->value, p->name);
-       xdpi = ydpi = 72;
+       xdpi = ydpi = 300;
       }
 
       ippAddResolution(p->ppd_attrs, IPP_TAG_PRINTER,
@@ -4596,16 +4680,18 @@ load_ppd(cupsd_printer_t *p)            /* I - Printer */
 
       ippAddResolution(p->ppd_attrs, IPP_TAG_PRINTER,
                       "printer-resolution-default", IPP_RES_PER_INCH,
-                      72, 72);
+                      300, 300);
       ippAddResolution(p->ppd_attrs, IPP_TAG_PRINTER,
                       "printer-resolution-supported", IPP_RES_PER_INCH,
-                      72, 72);
+                      300, 300);
     }
 
    /*
     * Duplexing, etc...
     */
 
+    ppdMarkDefaults(ppd);
+
     if ((duplex = ppdFindOption(ppd, "Duplex")) == NULL)
       if ((duplex = ppdFindOption(ppd, "EFDuplex")) == NULL)
        if ((duplex = ppdFindOption(ppd, "EFDuplexing")) == NULL)
@@ -4867,6 +4953,129 @@ load_ppd(cupsd_printer_t *p)            /* I - Printer */
     if (ppdFindAttr(ppd, "APRemoteQueueID", NULL))
       p->type |= CUPS_PRINTER_REMOTE;
 
+#ifdef HAVE_APPLICATIONSERVICES_H
+   /*
+    * Convert the file referenced in APPrinterIconPath to a 128x128 PNG
+    * and save it as cacheDir/printername.png
+    */
+
+    if ((ppd_attr = ppdFindAttr(ppd, "APPrinterIconPath", NULL)) != NULL &&
+        ppd_attr->value)
+    {
+      CGImageRef       imageRef = NULL;/* Current icon image */
+      CGImageRef       biggestIconRef = NULL;
+                                       /* Biggest icon image */
+      CGImageRef       closestTo128IconRef = NULL;
+                                       /* Icon image closest to and >= 128 */
+      CGImageSourceRef sourceRef;      /* The file's image source */
+      char             outPath[HTTP_MAX_URI];
+                                       /* The path to the PNG file */
+      CFURLRef         outUrl;         /* The URL made from the outPath */
+      CFURLRef         icnsFileUrl;    /* The URL of the original ICNS icon file */
+      CGImageDestinationRef destRef;   /* The image destination to write */
+      size_t           bytesPerRow;    /* The bytes per row used for resizing */
+      CGContextRef     context;        /* The CG context used for resizing */
+
+      snprintf(outPath, sizeof(outPath), "%s/%s.png", CacheDir, p->name);
+      outUrl      = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault,
+                                                            (UInt8 *)outPath,
+                                                           strlen(outPath),
+                                                           FALSE);
+      icnsFileUrl = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault,
+                                                           (UInt8 *)ppd_attr->value,
+                                                           strlen(ppd_attr->value),
+                                                           FALSE);
+      if (outUrl && icnsFileUrl)
+      {
+        sourceRef = CGImageSourceCreateWithURL(icnsFileUrl, NULL);
+        if (sourceRef)
+        {
+          for (i = 0; i < CGImageSourceGetCount(sourceRef); i ++)
+          {
+            imageRef = CGImageSourceCreateImageAtIndex(sourceRef, i, NULL);
+            if (imageRef &&
+                CGImageGetWidth(imageRef) == CGImageGetHeight(imageRef))
+            {
+             /*
+              * Loop through remembering the icon closest to 128 but >= 128
+              * and then remember the largest icon.
+              */
+
+              if (CGImageGetWidth(imageRef) >= 128 &&
+                 (!closestTo128IconRef ||
+                  CGImageGetWidth(imageRef) <
+                      CGImageGetWidth(closestTo128IconRef)))
+              {
+                CGImageRelease(closestTo128IconRef);
+                CGImageRetain(imageRef);
+                closestTo128IconRef = imageRef;
+              }
+
+              if (!biggestIconRef ||
+                 CGImageGetWidth(imageRef) > CGImageGetWidth(biggestIconRef))
+              {
+                CGImageRelease(biggestIconRef);
+                CGImageRetain(imageRef);
+                biggestIconRef = imageRef;
+              }
+
+              CGImageRelease(imageRef);
+            }
+          }
+
+          if (biggestIconRef)
+          {
+           /*
+            * If biggestIconRef is NULL, we found no icons. Otherwise we first
+            * want the closest to 128, but if none are larger than 128, we want
+            * the largest icon available.
+            */
+
+            imageRef = closestTo128IconRef ? closestTo128IconRef :
+                                             biggestIconRef;
+            CGImageRetain(imageRef);
+            CGImageRelease(biggestIconRef);
+            CGImageRelease(closestTo128IconRef);
+            destRef = CGImageDestinationCreateWithURL(outUrl, kUTTypePNG, 1,
+                                                      NULL);
+            if (destRef)
+            {
+              if (CGImageGetWidth(imageRef) != 128)
+              {
+                bytesPerRow = CGImageGetBytesPerRow(imageRef) /
+                              CGImageGetWidth(imageRef) * 128;
+                context     = CGBitmapContextCreate(NULL, 128, 128,
+                                                   CGImageGetBitsPerComponent(imageRef),
+                                                   bytesPerRow,
+                                                   CGImageGetColorSpace(imageRef),
+                                                   kCGImageAlphaPremultipliedFirst);
+                if (context)
+                {
+                  CGContextDrawImage(context, CGRectMake(0, 0, 128, 128),
+                                    imageRef);
+                  CGImageRelease(imageRef);
+                  imageRef = CGBitmapContextCreateImage(context);
+                  CGContextRelease(context);
+                }
+              }
+
+              CGImageDestinationAddImage(destRef, imageRef, NULL);
+              CGImageDestinationFinalize(destRef);
+              CFRelease(destRef);
+            }
+
+            CGImageRelease(imageRef);
+          }
+
+          CFRelease(sourceRef);
+          CFRelease(icnsFileUrl);
+        }
+
+        CFRelease(outUrl);
+      }
+    }
+#endif /* HAVE_APPLICATIONSERVICES_H */
+
    /*
     * Close the PPD and set the type...
     */
index 69da9f1987b9cc3f0fe36529e5e3b6bf30c1213c..153ba2746e05925e419174db66bbdf04ccc5e1f0 100644 (file)
@@ -137,6 +137,13 @@ cupsdCreateProfile(int job_id)             /* I - Job ID or 0 for none */
                 " #\"^/System/\""
                 "))\n",
                 root, root);
+  /* Specifically allow applications to stat RequestRoot */
+  cupsFilePrintf(fp,
+                 "(allow file-read-metadata\n"
+                 "  (regex"
+                " #\"^%s$\""           /* RequestRoot */
+                "))\n",
+                request);
   cupsFilePrintf(fp,
                  "(allow file-write* file-read-data file-read-metadata\n"
                  "  (regex"
index 7775c994a657cbbb24bea3e7d447e7c1a0773908..d3c60c70f7fefc53565c36c0a6bf759bef0ea29a 100644 (file)
@@ -2,6 +2,6 @@
 
 phpcups.o: ../../cups/string-private.h ../../config.h phpcups.h
 phpcups.o: ../../cups/cups.h ../../cups/file.h ../../cups/versioning.h
-phpcups.o: ../../cups/ipp.h ../../cups/http.h ../../cups/language.h
-phpcups.o: ../../cups/array.h ../../cups/language.h
+phpcups.o: ../../cups/ipp.h ../../cups/http.h ../../cups/array.h
+phpcups.o: ../../cups/language.h ../../cups/language.h
 phpcups.o: ../../cups/debug-private.h
index eca4275ebd3ae9ae082d233e801f2f8c411a056f..a7aa88c31ad0780a01d81540e51638178c595962 100644 (file)
@@ -1,16 +1,16 @@
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
 cancel.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-cancel.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-cancel.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
-cancel.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
-cancel.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
-cancel.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
-cancel.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
-cancel.o: ../cups/transcode.h ../cups/thread-private.h
+cancel.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+cancel.o: ../cups/language.h ../cups/string-private.h ../config.h
+cancel.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
+cancel.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
+cancel.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
+cancel.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
+cancel.o: ../cups/thread-private.h
 cupsaccept.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
 cupsaccept.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-cupsaccept.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
+cupsaccept.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
 cupsaccept.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
 cupsaccept.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
 cupsaccept.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
@@ -18,7 +18,7 @@ cupsaccept.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
 cupsaccept.o: ../cups/transcode.h ../cups/thread-private.h
 cupsaddsmb.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
 cupsaddsmb.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-cupsaddsmb.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
+cupsaddsmb.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
 cupsaddsmb.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
 cupsaddsmb.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
 cupsaddsmb.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
@@ -26,16 +26,16 @@ cupsaddsmb.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
 cupsaddsmb.o: ../cups/transcode.h ../cups/thread-private.h
 cupsaddsmb.o: ../cups/adminutil.h
 cupsctl.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-cupsctl.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-cupsctl.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
-cupsctl.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
-cupsctl.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
-cupsctl.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
-cupsctl.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
-cupsctl.o: ../cups/transcode.h ../cups/thread-private.h ../cups/adminutil.h
+cupsctl.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+cupsctl.o: ../cups/language.h ../cups/string-private.h ../config.h
+cupsctl.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
+cupsctl.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
+cupsctl.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
+cupsctl.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
+cupsctl.o: ../cups/thread-private.h ../cups/adminutil.h
 cupstestdsc.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
 cupstestdsc.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-cupstestdsc.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
+cupstestdsc.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
 cupstestdsc.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
 cupstestdsc.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
 cupstestdsc.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
@@ -43,7 +43,7 @@ cupstestdsc.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
 cupstestdsc.o: ../cups/transcode.h ../cups/thread-private.h
 cupstestppd.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
 cupstestppd.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-cupstestppd.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
+cupstestppd.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
 cupstestppd.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
 cupstestppd.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
 cupstestppd.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
@@ -51,59 +51,58 @@ cupstestppd.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
 cupstestppd.o: ../cups/transcode.h ../cups/thread-private.h ../cups/dir.h
 cupstestppd.o: ../cups/ppd-private.h ../cups/raster.h ../cups/ppd.h
 lp.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-lp.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h
-lp.o: ../cups/array.h ../cups/string-private.h ../config.h
+lp.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+lp.o: ../cups/language.h ../cups/string-private.h ../config.h
 lp.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
 lp.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
 lp.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
 lp.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
 lp.o: ../cups/thread-private.h
 lpadmin.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-lpadmin.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-lpadmin.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
-lpadmin.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
-lpadmin.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
-lpadmin.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
-lpadmin.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
-lpadmin.o: ../cups/transcode.h ../cups/thread-private.h
+lpadmin.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+lpadmin.o: ../cups/language.h ../cups/string-private.h ../config.h
+lpadmin.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
+lpadmin.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
+lpadmin.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
+lpadmin.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
+lpadmin.o: ../cups/thread-private.h
 lpinfo.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-lpinfo.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-lpinfo.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
-lpinfo.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
-lpinfo.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
-lpinfo.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
-lpinfo.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
-lpinfo.o: ../cups/transcode.h ../cups/thread-private.h
+lpinfo.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+lpinfo.o: ../cups/language.h ../cups/string-private.h ../config.h
+lpinfo.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
+lpinfo.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
+lpinfo.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
+lpinfo.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
+lpinfo.o: ../cups/thread-private.h
 lpmove.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-lpmove.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-lpmove.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
-lpmove.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
-lpmove.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
-lpmove.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
-lpmove.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
-lpmove.o: ../cups/transcode.h ../cups/thread-private.h
+lpmove.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+lpmove.o: ../cups/language.h ../cups/string-private.h ../config.h
+lpmove.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
+lpmove.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
+lpmove.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
+lpmove.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
+lpmove.o: ../cups/thread-private.h
 lpoptions.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
 lpoptions.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-lpoptions.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
+lpoptions.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
 lpoptions.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
 lpoptions.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
 lpoptions.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
 lpoptions.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
 lpoptions.o: ../cups/transcode.h ../cups/thread-private.h
 lppasswd.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-lppasswd.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-lppasswd.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
-lppasswd.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
-lppasswd.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
-lppasswd.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
-lppasswd.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
-lppasswd.o: ../cups/transcode.h ../cups/thread-private.h
-lppasswd.o: ../cups/md5-private.h
+lppasswd.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+lppasswd.o: ../cups/language.h ../cups/string-private.h ../config.h
+lppasswd.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
+lppasswd.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
+lppasswd.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
+lppasswd.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
+lppasswd.o: ../cups/thread-private.h ../cups/md5-private.h
 lpstat.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-lpstat.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-lpstat.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
-lpstat.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
-lpstat.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
-lpstat.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
-lpstat.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
-lpstat.o: ../cups/transcode.h ../cups/thread-private.h
+lpstat.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+lpstat.o: ../cups/language.h ../cups/string-private.h ../config.h
+lpstat.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
+lpstat.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
+lpstat.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
+lpstat.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
+lpstat.o: ../cups/thread-private.h
index 32b90b929c361b386773b2595d8af640907c4ef8..955202ddbd8452b786ed01390a31429b7d6875fe 100644 (file)
@@ -219,6 +219,7 @@ export_dest(http_t     *http,               /* I - Connection to server */
   int          status;                 /* Status of export */
   char         ppdfile[1024],          /* PPD file for printer drivers */
                prompt[1024];           /* Password prompt */
+  int          tries;                  /* Number of tries */
 
 
  /*
@@ -238,7 +239,7 @@ export_dest(http_t     *http,               /* I - Connection to server */
   * Try to export it...
   */
 
-  for (status = 0; !status;)
+  for (status = 0, tries = 0; !status && tries < 3; tries ++)
   {
    /*
     * Get the password, as needed...
index cc0e2d6203ba65c08c19ba59b6412d371ba5aeab..aad224184eb077dffff499a3b1f2e9fbfe654cb1 100644 (file)
  *   main()                      - Parse options and configure the scheduler.
  *   add_printer_to_class()      - Add a printer to a class.
  *   default_printer()           - Set the default printing destination.
- *   delete_printer()            - Delete a printer from the system...
+ *   delete_printer()            - Delete a printer from the system.
  *   delete_printer_from_class() - Delete a printer from a class.
- *   enable_printer()            - Enable a printer...
- *   set_printer_device()        - Set the device-uri attribute.
- *   set_printer_file()          - Set the interface script or PPD file.
- *   set_printer_info()          - Set the printer description string.
- *   set_printer_location()      - Set the printer location string.
- *   set_printer_model()         - Set the driver model file.
- *   set_printer_options()       - Set the printer options.
+ *   enable_printer()            - Enable a printer.
+ *   set_printer_options()       - Set the printer options and/or file.
  *   validate_name()             - Make sure the printer name only contains
- *                                 valid chars...
+ *                                 valid chars.
  */
 
 /*
  */
 
 #include <cups/cups-private.h>
-#ifdef HAVE_LIBZ
-#  include <zlib.h>
-#endif /* HAVE_LIBZ */
 
 
 /*
  * Local functions...
  */
 
-static int     add_printer_to_class(http_t *, char *, char *);
-static int     default_printer(http_t *, char *);
-static int     delete_printer(http_t *, char *);
-static int     delete_printer_from_class(http_t *, char *, char *);
-static int     enable_printer(http_t *, char *);
-static char    *get_line(char *, int, FILE *fp);
-static int     set_printer_device(http_t *, char *, char *);
-static int     set_printer_file(http_t *, char *, char *);
-static int     set_printer_info(http_t *, char *, char *);
-static int     set_printer_location(http_t *, char *, char *);
-static int     set_printer_model(http_t *, char *, char *);
-static int     set_printer_options(http_t *, char *, int, cups_option_t *);
-static int     validate_name(const char *);
+static int     add_printer_to_class(http_t *http, char *printer, char *pclass);
+static int     default_printer(http_t *http, char *printer);
+static int     delete_printer(http_t *http, char *printer);
+static int     delete_printer_from_class(http_t *http, char *printer,
+                                         char *pclass);
+static int     enable_printer(http_t *http, char *printer);
+static int     set_printer_options(http_t *http, char *printer,
+                                   int num_options, cups_option_t *options,
+                                   char *file);
+static int     validate_name(const char *name);
 
 
 /*
@@ -74,6 +63,7 @@ main(int  argc,                       /* I - Number of command-line arguments */
                *val;           /* Pointer to allow/deny value */
   int          num_options;    /* Number of options */
   cups_option_t        *options;       /* Options */
+  char         *file;          /* New PPD file/interface script */
 
 
   _cupsSetLocale(argv);
@@ -82,6 +72,7 @@ main(int  argc,                       /* I - Number of command-line arguments */
   printer     = NULL;
   num_options = 0;
   options     = NULL;
+  file        = NULL;
 
   for (i = 1; i < argc; i ++)
     if (argv[i][0] == '-')
@@ -212,34 +203,8 @@ main(int  argc,                    /* I - Number of command-line arguments */
            break;
 
         case 'i' : /* Use the specified interface script */
-           if (!http)
-           {
-              http = httpConnectEncrypt(cupsServer(), ippPort(),
-                                       cupsEncryption());
-
-             if (http == NULL)
-             {
-               _cupsLangPrintf(stderr,
-                               _("lpadmin: Unable to connect to server: %s\n"),
-                               strerror(errno));
-               return (1);
-             }
-            }
-
-           if (printer == NULL)
-           {
-             _cupsLangPuts(stderr,
-                           _("lpadmin: Unable to set the interface script:\n"
-                             "         You must specify a printer name "
-                             "first\n"));
-             return (1);
-           }
-
            if (argv[i][2])
-           {
-             if (set_printer_file(http, printer, argv[i] + 2))
-               return (1);
-            }
+             file = argv[i] + 2;
            else
            {
              i ++;
@@ -252,8 +217,7 @@ main(int  argc,                     /* I - Number of command-line arguments */
                return (1);
              }
 
-             if (set_printer_file(http, printer, argv[i]))
-               return (1);
+             file = argv[i];
            }
            break;
 
@@ -292,35 +256,9 @@ main(int  argc,                    /* I - Number of command-line arguments */
             break;
 
         case 'm' : /* Use the specified standard script/PPD file */
-           if (!http)
-           {
-              http = httpConnectEncrypt(cupsServer(), ippPort(),
-                                       cupsEncryption());
-
-             if (http == NULL)
-             {
-               _cupsLangPrintf(stderr,
-                               _("lpadmin: Unable to connect to server: %s\n"),
-                               strerror(errno));
-               return (1);
-             }
-            }
-
-           if (printer == NULL)
-           {
-             _cupsLangPuts(stderr,
-                           _("lpadmin: Unable to set the interface script or "
-                             "PPD file:\n"
-                             "         You must specify a printer name "
-                             "first\n"));
-             return (1);
-           }
-
            if (argv[i][2])
-           {
-             if (set_printer_model(http, printer, argv[i] + 2))
-               return (1);
-           }
+             num_options = cupsAddOption("ppd-name", argv[i] + 2, num_options,
+                                         &options);
            else
            {
              i ++;
@@ -333,8 +271,8 @@ main(int  argc,                     /* I - Number of command-line arguments */
                return (1);
              }
 
-             if (set_printer_model(http, printer, argv[i]))
-               return (1);
+             num_options = cupsAddOption("ppd-name", argv[i], num_options,
+                                         &options);
            }
            break;
 
@@ -358,20 +296,6 @@ main(int  argc,                    /* I - Number of command-line arguments */
            break;
 
         case 'p' : /* Add/modify a printer */
-           if (!http)
-           {
-              http = httpConnectEncrypt(cupsServer(), ippPort(),
-                                       cupsEncryption());
-
-             if (http == NULL)
-             {
-               _cupsLangPrintf(stderr,
-                               _("lpadmin: Unable to connect to server: %s\n"),
-                               strerror(errno));
-               return (1);
-             }
-            }
-
            if (argv[i][2])
              printer = argv[i] + 2;
            else
@@ -505,34 +429,9 @@ main(int  argc,                    /* I - Number of command-line arguments */
            break;
 
         case 'v' : /* Set the device-uri attribute */
-           if (!http)
-           {
-              http = httpConnectEncrypt(cupsServer(), ippPort(),
-                                       cupsEncryption());
-
-             if (http == NULL)
-             {
-               _cupsLangPrintf(stderr,
-                               _("lpadmin: Unable to connect to server: %s\n"),
-                               strerror(errno));
-               return (1);
-             }
-            }
-
-           if (printer == NULL)
-           {
-             _cupsLangPuts(stderr,
-                           _("lpadmin: Unable to set the device URI:\n"
-                             "         You must specify a printer name "
-                             "first\n"));
-             return (1);
-           }
-
            if (argv[i][2])
-           {
-             if (set_printer_device(http, printer, argv[i] + 2))
-               return (1);
-            }
+             num_options = cupsAddOption("device-uri", argv[i] + 2,
+                                         num_options, &options);
            else
            {
              i ++;
@@ -545,8 +444,8 @@ main(int  argc,                     /* I - Number of command-line arguments */
                return (1);
              }
 
-             if (set_printer_device(http, printer, argv[i]))
-               return (1);
+             num_options = cupsAddOption("device-uri", argv[i],
+                                         num_options, &options);
            }
            break;
 
@@ -597,35 +496,9 @@ main(int  argc,                    /* I - Number of command-line arguments */
            break;
 
         case 'D' : /* Set the printer-info attribute */
-           if (!http)
-           {
-              http = httpConnectEncrypt(cupsServer(), ippPort(),
-                                       cupsEncryption());
-
-             if (http == NULL)
-             {
-               _cupsLangPrintf(stderr,
-                               _("lpadmin: Unable to connect to server: %s\n"),
-                               strerror(errno));
-               return (1);
-             }
-            }
-
-           if (printer == NULL)
-           {
-             _cupsLangPuts(stderr,
-                           _("lpadmin: Unable to set the printer "
-                             "description:\n"
-                             "         You must specify a printer name "
-                             "first\n"));
-             return (1);
-           }
-
            if (argv[i][2])
-           {
-             if (set_printer_info(http, printer, argv[i] + 2))
-               return (1);
-           }
+             num_options = cupsAddOption("printer-info", argv[i] + 2,
+                                         num_options, &options);
            else
            {
              i ++;
@@ -638,8 +511,8 @@ main(int  argc,                     /* I - Number of command-line arguments */
                return (1);
              }
 
-             if (set_printer_info(http, printer, argv[i]))
-               return (1);
+             num_options = cupsAddOption("printer-info", argv[i],
+                                         num_options, &options);
            }
            break;
 
@@ -659,34 +532,9 @@ main(int  argc,                    /* I - Number of command-line arguments */
            break;
            
         case 'L' : /* Set the printer-location attribute */
-           if (!http)
-           {
-              http = httpConnectEncrypt(cupsServer(), ippPort(),
-                                       cupsEncryption());
-
-             if (http == NULL)
-             {
-               _cupsLangPrintf(stderr,
-                               _("lpadmin: Unable to connect to server: %s\n"),
-                               strerror(errno));
-               return (1);
-             }
-            }
-
-           if (printer == NULL)
-           {
-             _cupsLangPuts(stderr,
-                           _("lpadmin: Unable to set the printer location:\n"
-                             "         You must specify a printer name "
-                             "first\n"));
-             return (1);
-           }
-
            if (argv[i][2])
-           {
-             if (set_printer_location(http, printer, argv[i] + 2))
-               return (1);
-            }
+             num_options = cupsAddOption("printer-location", argv[i] + 2,
+                                         num_options, &options);
            else
            {
              i ++;
@@ -699,40 +547,14 @@ main(int  argc,                   /* I - Number of command-line arguments */
                return (1);
              }
 
-             if (set_printer_location(http, printer, argv[i]))
-               return (1);
+             num_options = cupsAddOption("printer-location", argv[i],
+                                         num_options, &options);
            }
            break;
 
         case 'P' : /* Use the specified PPD file */
-           if (!http)
-           {
-              http = httpConnectEncrypt(cupsServer(), ippPort(),
-                                       cupsEncryption());
-
-             if (http == NULL)
-             {
-               _cupsLangPrintf(stderr,
-                               _("lpadmin: Unable to connect to server: %s\n"),
-                               strerror(errno));
-               return (1);
-             }
-            }
-
-           if (printer == NULL)
-           {
-             _cupsLangPuts(stderr,
-                           _("lpadmin: Unable to set the PPD file:\n"
-                             "         You must specify a printer name "
-                             "first\n"));
-             return (1);
-           }
-
            if (argv[i][2])
-           {
-             if (set_printer_file(http, printer, argv[i] + 2))
-               return (1);
-           }
+             file = argv[i] + 2;
            else
            {
              i ++;
@@ -744,8 +566,7 @@ main(int  argc,                     /* I - Number of command-line arguments */
                return (1);
              }
 
-             if (set_printer_file(http, printer, argv[i]))
-               return (1);
+             file = argv[i];
            }
            break;
 
@@ -765,7 +586,7 @@ main(int  argc,                     /* I - Number of command-line arguments */
   * Set options as needed...
   */
 
-  if (num_options)
+  if (num_options || file)
   {
     if (!http)
     {
@@ -788,7 +609,7 @@ main(int  argc,                     /* I - Number of command-line arguments */
       return (1);
     }
 
-    if (set_printer_options(http, printer, num_options, options))
+    if (set_printer_options(http, printer, num_options, options, file))
       return (1);
   }
 
@@ -1281,429 +1102,6 @@ enable_printer(http_t *http,            /* I - Server connection */
 }
 
 
-/*
- * 'get_line()' - Get a line that is terminated by a LF, CR, or CR LF.
- */
-
-static char *                          /* O - Pointer to buf or NULL on EOF */
-get_line(char *buf,                    /* I - Line buffer */
-         int  length,                  /* I - Length of buffer */
-        FILE *fp)                      /* I - File to read from */
-{
-  char *bufptr;                        /* Pointer into buffer */
-  int  ch;                             /* Character from file */
-
-
-  length --;
-  bufptr = buf;
-
-  while ((ch = getc(fp)) != EOF)
-  {
-    if (ch == '\n')
-      break;
-    else if (ch == '\r')
-    {
-     /*
-      * Look for LF...
-      */
-
-      ch = getc(fp);
-      if (ch != '\n' && ch != EOF)
-        ungetc(ch, fp);
-
-      break;
-    }
-
-    *bufptr++ = ch;
-    length --;
-    if (length == 0)
-      break;
-  }
-
-  *bufptr = '\0';
-
-  if (ch == EOF)
-    return (NULL);
-  else
-    return (buf);
-}
-
-
-/*
- * 'set_printer_device()' - Set the device-uri attribute.
- */
-
-static int                             /* O - 0 on success, 1 on fail */
-set_printer_device(http_t *http,       /* I - Server connection */
-                   char   *printer,    /* I - Printer */
-                  char   *device)      /* I - New device URI */
-{
-  ipp_t                *request,               /* IPP Request */
-               *response;              /* IPP Response */
-  char         uri[HTTP_MAX_URI];      /* URI for printer/class */
-
-
-  DEBUG_printf(("set_printer_device(%p, \"%s\", \"%s\")\n", http, printer,
-                device));
-
- /*
-  * Build a CUPS_ADD_PRINTER request, which requires the following
-  * attributes:
-  *
-  *    attributes-charset
-  *    attributes-natural-language
-  *    printer-uri
-  */
-
-  request = ippNewRequest(CUPS_ADD_PRINTER);
-
-  httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
-                   "localhost", 0, "/printers/%s", printer);
-  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
-               "printer-uri", NULL, uri);
-
- /*
-  * Add the device URI...
-  */
-
-  if (device[0] == '/')
-  {
-   /*
-    * Convert filename to URI...
-    */
-
-    snprintf(uri, sizeof(uri), "file://%s", device);
-    ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_URI, "device-uri", NULL,
-                 uri);
-  }
-  else
-    ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_URI, "device-uri", NULL,
-                 device);
-
- /*
-  * Do the request and get back a response...
-  */
-
-  if ((response = cupsDoRequest(http, request, "/admin/")) == NULL)
-  {
-    _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString());
-
-    return (1);
-  }
-  else if (response->request.status.status_code > IPP_OK_CONFLICT)
-  {
-    _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString());
-
-    ippDelete(response);
-
-    return (1);
-  }
-  else
-  {
-    ippDelete(response);
-
-    return (0);
-  }
-}
-
-
-/*
- * 'set_printer_file()' - Set the interface script or PPD file.
- */
-
-static int                             /* O - 0 on success, 1 on fail */
-set_printer_file(http_t *http,         /* I - Server connection */
-                 char   *printer,      /* I - Printer */
-                char   *file)          /* I - PPD file or interface script */
-{
-  ipp_t                *request,               /* IPP Request */
-               *response;              /* IPP Response */
-  char         uri[HTTP_MAX_URI];      /* URI for printer/class */
-#ifdef HAVE_LIBZ
-  char         tempfile[1024];         /* Temporary filename */
-  int          fd;                     /* Temporary file */
-  gzFile       *gz;                    /* GZIP'd file */
-  char         buffer[8192];           /* Copy buffer */
-  int          bytes;                  /* Bytes in buffer */
-
-
-  DEBUG_printf(("set_printer_file(%p, \"%s\", \"%s\")\n", http, printer,
-                file));
-
- /*
-  * See if the file is gzip'd; if so, unzip it to a temporary file and
-  * send the uncompressed file.
-  */
-
-  if (!strcmp(file + strlen(file) - 3, ".gz"))
-  {
-   /*
-    * Yes, the file is compressed; uncompress to a temp file...
-    */
-
-    if ((fd = cupsTempFd(tempfile, sizeof(tempfile))) < 0)
-    {
-      _cupsLangPrintError(_("ERROR: Unable to create temporary file"));
-      return (1);
-    }
-
-    if ((gz = gzopen(file, "rb")) == NULL)
-    {
-      _cupsLangPrintf(stderr,
-                      _("lpadmin: Unable to open file \"%s\": %s\n"),
-                     file, strerror(errno));
-      close(fd);
-      unlink(tempfile);
-      return (1);
-    }
-
-    while ((bytes = gzread(gz, buffer, sizeof(buffer))) > 0)
-      write(fd, buffer, bytes);
-
-    close(fd);
-    gzclose(gz);
-
-    file = tempfile;
-  }
-#endif /* HAVE_LIBZ */
-
- /*
-  * Build a CUPS_ADD_PRINTER request, which requires the following
-  * attributes:
-  *
-  *    attributes-charset
-  *    attributes-natural-language
-  *    printer-uri
-  */
-
-  request = ippNewRequest(CUPS_ADD_PRINTER);
-
-  httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
-                   "localhost", 0, "/printers/%s", printer);
-  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
-               "printer-uri", NULL, uri);
-
- /*
-  * Do the request and get back a response...
-  */
-
-  response = cupsDoFileRequest(http, request, "/admin/", file);
-  ippDelete(response);
-
-#ifdef HAVE_LIBZ
- /*
-  * Remove the temporary file as needed...
-  */
-
-  if (file == tempfile)
-    unlink(tempfile);
-#endif /* HAVE_LIBZ */
-
-  if (cupsLastError() > IPP_OK_CONFLICT)
-  {
-    _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString());
-
-    return (1);
-  }
-  else
-    return (0);
-}
-
-
-/*
- * 'set_printer_info()' - Set the printer description string.
- */
-
-static int                             /* O - 0 on success, 1 on fail */
-set_printer_info(http_t *http,         /* I - Server connection */
-                 char   *printer,      /* I - Printer */
-                char   *info)          /* I - New description string */
-{
-  ipp_t                *request,               /* IPP Request */
-               *response;              /* IPP Response */
-  char         uri[HTTP_MAX_URI];      /* URI for printer/class */
-
-
-  DEBUG_printf(("set_printer_info(%p, \"%s\", \"%s\")\n", http, printer,
-                info));
-
- /*
-  * Build a CUPS_ADD_PRINTER request, which requires the following
-  * attributes:
-  *
-  *    attributes-charset
-  *    attributes-natural-language
-  *    printer-uri
-  */
-
-  request = ippNewRequest(CUPS_ADD_PRINTER);
-
-  httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
-                   "localhost", 0, "/printers/%s", printer);
-  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
-               "printer-uri", NULL, uri);
-
- /*
-  * Add the info string...
-  */
-
-  ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-info", NULL,
-               info);
-
- /*
-  * Do the request and get back a response...
-  */
-
-  if ((response = cupsDoRequest(http, request, "/admin/")) == NULL)
-  {
-    _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString());
-    return (1);
-  }
-  else if (response->request.status.status_code > IPP_OK_CONFLICT)
-  {
-    _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString());
-
-    ippDelete(response);
-
-    return (1);
-  }
-  else
-  {
-    ippDelete(response);
-
-    return (0);
-  }
-}
-
-
-/*
- * 'set_printer_location()' - Set the printer location string.
- */
-
-static int                             /* O - 0 on success, 1 on fail */
-set_printer_location(http_t *http,     /* I - Server connection */
-                     char   *printer,  /* I - Printer */
-                    char   *location)  /* I - New location string */
-{
-  ipp_t                *request,               /* IPP Request */
-               *response;              /* IPP Response */
-  char         uri[HTTP_MAX_URI];      /* URI for printer/class */
-
-
-  DEBUG_printf(("set_printer_location(%p, \"%s\", \"%s\")\n", http, printer,
-                location));
-
- /*
-  * Build a CUPS_ADD_PRINTER request, which requires the following
-  * attributes:
-  *
-  *    attributes-charset
-  *    attributes-natural-language
-  *    printer-uri
-  */
-
-  request = ippNewRequest(CUPS_ADD_PRINTER);
-
-  httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
-                   "localhost", 0, "/printers/%s", printer);
-  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
-               "printer-uri", NULL, uri);
-
- /*
-  * Add the location string...
-  */
-
-  ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-location", NULL,
-               location);
-
- /*
-  * Do the request and get back a response...
-  */
-
-  if ((response = cupsDoRequest(http, request, "/admin/")) == NULL)
-  {
-    _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString());
-
-    return (1);
-  }
-  else if (response->request.status.status_code > IPP_OK_CONFLICT)
-  {
-    _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString());
-
-    ippDelete(response);
-
-    return (1);
-  }
-  else
-  {
-    ippDelete(response);
-
-    return (0);
-  }
-}
-
-
-/*
- * 'set_printer_model()' - Set the driver model file.
- */
-
-static int                             /* O - 0 on success, 1 on fail */
-set_printer_model(http_t *http,                /* I - Server connection */
-                  char   *printer,     /* I - Printer */
-                 char   *model)        /* I - Driver model file */
-{
-  ipp_t                *request,               /* IPP Request */
-               *response;              /* IPP Response */
-  char         uri[HTTP_MAX_URI];      /* URI for printer/class */
-
-
- /*
-  * Build a CUPS_ADD_PRINTER request, which requires the following
-  * attributes:
-  *
-  *    attributes-charset
-  *    attributes-natural-language
-  *    printer-uri
-  *    ppd-name
-  */
-
-  request = ippNewRequest(CUPS_ADD_PRINTER);
-
-  httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
-                   "localhost", 0, "/printers/%s", printer);
-  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
-               "printer-uri", NULL, uri);
-
-  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
-               "ppd-name", NULL, model);
-
- /*
-  * Do the request and get back a response...
-  */
-
-  if ((response = cupsDoRequest(http, request, "/admin/")) == NULL)
-  {
-    _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString());
-
-    return (1);
-  }
-  else if (response->request.status.status_code > IPP_OK_CONFLICT)
-  {
-    _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString());
-
-    ippDelete(response);
-
-    return (1);
-  }
-  else
-  {
-    ippDelete(response);
-
-    return (0);
-  }
-}
-
-
 /*
  * 'set_printer_options()' - Set the printer options.
  */
@@ -1713,7 +1111,8 @@ set_printer_options(
     http_t        *http,               /* I - Server connection */
     char          *printer,            /* I - Printer */
     int           num_options,         /* I - Number of options */
-    cups_option_t *options)            /* I - Options */
+    cups_option_t *options,            /* I - Options */
+    char          *file)               /* I - PPD file/interface script */
 {
   ipp_t                *request,               /* IPP Request */
                *response;              /* IPP Response */
@@ -1728,14 +1127,15 @@ set_printer_options(
                keyword[1024],          /* Keyword from Default line */
                *keyptr,                /* Pointer into keyword... */
                tempfile[1024];         /* Temporary filename */
-  FILE         *in,                    /* PPD file */
+  cups_file_t  *in,                    /* PPD file */
                *out;                   /* Temporary file */
-  int          outfd;                  /* Temporary file descriptor */
-  const char   *protocol;              /* Old protocol option */
+  const char   *protocol,              /* Old protocol option */
+               *customval;             /* Custom option value */
 
 
-  DEBUG_printf(("set_printer_options(%p, \"%s\", %d, %p)\n", http, printer,
-                num_options, options));
+  DEBUG_printf(("set_printer_options(http=%p, printer=\"%s\", num_options=%d, "
+                "options=%p, file=\"%s\")\n", http, printer, num_options,
+               options, file));
 
   httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
                    "localhost", 0, "/printers/%s", printer);
@@ -1754,7 +1154,6 @@ set_printer_options(
 
   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
                "printer-uri", NULL, uri);
-
   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
                "requested-attributes", NULL, "printer-type");
 
@@ -1762,7 +1161,7 @@ set_printer_options(
   * Do the request...
   */
 
-  op = CUPS_ADD_PRINTER;
+  op = CUPS_ADD_MODIFY_PRINTER;
 
   if ((response = cupsDoRequest(http, request, "/")) != NULL)
   {
@@ -1775,7 +1174,7 @@ set_printer_options(
     {
       if (attr->values[0].integer & (CUPS_PRINTER_CLASS | CUPS_PRINTER_IMPLICIT))
       {
-        op = CUPS_ADD_CLASS;
+        op = CUPS_ADD_MODIFY_CLASS;
        httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
                         "localhost", 0, "/classes/%s", printer);
       }
@@ -1785,8 +1184,8 @@ set_printer_options(
   }
 
  /*
-  * Build a CUPS_ADD_PRINTER or CUPS_ADD_CLASS request, which requires
-  * the following attributes:
+  * Build a CUPS_ADD_MODIFY_PRINTER or CUPS_ADD_MODIFY_CLASS request, which
+  * requires the following attributes:
   *
   *    attributes-charset
   *    attributes-natural-language
@@ -1798,6 +1197,8 @@ set_printer_options(
 
   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
                "printer-uri", NULL, uri);
+  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
+               "requesting-user-name", NULL, cupsUser());
 
  /*
   * Add the options...
@@ -1815,7 +1216,9 @@ set_printer_options(
                    NULL, "tbcp");
   }
 
-  if (op == CUPS_ADD_PRINTER)
+  if (file)
+    ppdfile = file;
+  else if (op == CUPS_ADD_MODIFY_PRINTER)
     ppdfile = cupsGetPPD(printer);
   else
     ppdfile = NULL;
@@ -1830,33 +1233,34 @@ set_printer_options(
     ppdMarkDefaults(ppd);
     cupsMarkOptions(ppd, num_options, options);
 
-    if ((outfd = cupsTempFd(tempfile, sizeof(tempfile))) < 0)
+    if ((out = cupsTempFile2(tempfile, sizeof(tempfile))) < 0)
     {
       _cupsLangPrintError(_("ERROR: Unable to create temporary file"));
       ippDelete(request);
-      unlink(ppdfile);
+      if (ppdfile != file)
+        unlink(ppdfile);
       return (1);
     }
 
-    if ((in = fopen(ppdfile, "rb")) == NULL)
+    if ((in = cupsFileOpen(ppdfile, "r")) == NULL)
     {
       _cupsLangPrintf(stderr,
                       _("lpadmin: Unable to open PPD file \"%s\" - %s\n"),
                      ppdfile, strerror(errno));
       ippDelete(request);
-      unlink(ppdfile);
-      close(outfd);
+      if (ppdfile != file)
+       unlink(ppdfile);
+      cupsFileClose(out);
       unlink(tempfile);
       return (1);
     }
 
-    out        = fdopen(outfd, "wb");
     ppdchanged = 0;
 
-    while (get_line(line, sizeof(line), in) != NULL)
+    while (cupsFileGets(in, line, sizeof(line)))
     {
       if (strncmp(line, "*Default", 8))
-        fprintf(out, "%s\n", line);
+        cupsFilePrintf(out, "%s\n", line);
       else
       {
        /*
@@ -1886,17 +1290,27 @@ set_printer_options(
 
         if (choice && strcmp(choice->choice, keyptr))
        {
-         fprintf(out, "*Default%s: %s\n", keyword, choice->choice);
-         ppdchanged = 1;
+         if (strcmp(choice->choice, "Custom"))
+         {
+           cupsFilePrintf(out, "*Default%s: %s\n", keyword, choice->choice);
+           ppdchanged = 1;
+         }
+         else if ((customval = cupsGetOption(keyword, num_options,
+                                             options)) != NULL)
+         {
+           cupsFilePrintf(out, "*Default%s: %s\n", keyword, customval);
+           ppdchanged = 1;
+         }
+         else
+           cupsFilePrintf(out, "%s\n", line);
        }
        else
-         fprintf(out, "%s\n", line);
+         cupsFilePrintf(out, "%s\n", line);
       }
     }
 
-    fclose(in);
-    fclose(out);
-    close(outfd);
+    cupsFileClose(in);
+    cupsFileClose(out);
     ppdClose(ppd);
 
    /*
@@ -1904,14 +1318,15 @@ set_printer_options(
     */
 
     ippDelete(cupsDoFileRequest(http, request, "/admin/",
-                                ppdchanged ? tempfile : NULL));
+                                ppdchanged ? tempfile : file));
 
    /*
     * Clean up temp files... (TODO: catch signals in case we CTRL-C during
     * lpadmin)
     */
 
-    unlink(ppdfile);
+    if (ppdfile != file)
+      unlink(ppdfile);
     unlink(tempfile);
   }
   else
index 212cd89f426349c396e84f880898ab125779c4bf..d278b2f2d0bc45bd9066d23efc5426a0cc1d4076 100644 (file)
@@ -1529,7 +1529,8 @@ show_printers(const char  *printers,      /* I - Destinations */
                };
   static const char *jattrs[] =                /* Attributes we need for jobs... */
                {
-                 "job-id"
+                 "job-id",
+                 "job-state"
                };
 
 
index 264a019bfaf2b403ac36c63d799698cf724f41f1..2753bb919b9b18322ab1998f8f730bac38050dfd 100644 (file)
@@ -1,6 +1,6 @@
 <DIV CLASS="indent">
 
-<H2 CLASS="title">>Klasse hinzuf&uuml;gen</H2>
+<H2 CLASS="title">Klasse hinzuf&uuml;gen</H2>
 
 <FORM METHOD="POST" ACTION="/admin">
 <INPUT TYPE="HIDDEN" NAME="org.cups.sid" VALUE="{$org.cups.sid}">
index cef109ca9d80046cc4211f3805726a779dbb38db..86b08b2f68883e4cdc8f7edf8dd891b81326e05b 100644 (file)
@@ -2,7 +2,7 @@
 <INPUT TYPE="HIDDEN" NAME="org.cups.sid" VALUE="{$org.cups.sid}">
 <INPUT TYPE="HIDDEN" NAME="OP" VALUE="add-rss-subscription">
 
-<H2 CLASS="title">>RSS Subskription hinzuf&uuml;gen</H2>
+<H2 CLASS="title">RSS Subskription hinzuf&uuml;gen</H2>
 
 <TABLE SUMMARY="Forumlar zum Hinzufügen einer RSS Subskription">
 <TR>
index fd1d5d954339fbc134d4c0c3d9313cbd10cfa98d..a462ae0b08e8de321d028a3cce42363b68cf6429 100644 (file)
@@ -1,4 +1,4 @@
-<FORM ACTION="{THIS_URL}" METHOD="GET">
+<FORM ACTION="/{SECTION}/{?SEARCH_DEST}" METHOD="GET">
 {WHICH_JOBS?<INPUT TYPE="HIDDEN" NAME="WHICH_JOBS" VALUE="{WHICH_JOBS}">:}
 {ORDER?<INPUT TYPE="HIDDEN" NAME="ORDER" VALUE="{ORDER}">:}
 
index e927e7ca88cfa0d5f98cee8f278498fe08f4cfc6..58b267a9c03d5d36c09ff03dfc739acf434cfe1c 100644 (file)
@@ -6,7 +6,7 @@
 {iscustom=1?<TABLE NAME="paramtable" id="{keyword}-params">{[params]
 <TR><TH CLASS="sublabel">{paramtext}:</TH>
 <TD>{params=Units?<SELECT NAME="{keyword}.{params}">
-<OPTION VALUE="pt"{paramvalue=pt? SELECTED:}>ポイント/OPTION>
+<OPTION VALUE="pt"{paramvalue=pt? SELECTED:}>ポイント</OPTION>
 <OPTION VALUE="mm"{paramvalue=mm? SELECTED:}>ミリメートル</OPTION>
 <OPTION VALUE="cm"{paramvalue=cm? SELECTED:}>センチメートル</OPTION>
 <OPTION VALUE="in"{paramvalue=in? SELECTED:}>インチ</OPTION>
index d128d7d50328d4fbbb4f8326d594bf2ae8db2c8a..58e5b85d13cc25f99d7c70bf5173731718816b4d 100644 (file)
@@ -6,7 +6,7 @@
 <INPUT TYPE="HIDDEN" NAME="org.cups.sid" VALUE="{$org.cups.sid}">
 <INPUT TYPE="HIDDEN" NAME="PRINTER_NAME" VALUE="{printer_name}">
 <INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
-{HAVE_AUTOCONFIGURE?<INPUT TYPE="SUBMIT" NAME="AUTOCONFIGURE" VALUE="Zakolejkuj drukarkę do domyślnych opcji">:}
+{HAVE_AUTOCONFIGURE?<INPUT TYPE="SUBMIT" NAME="AUTOCONFIGURE" VALUE="Pobierz domyślne ustawienia drukarki">:}
 
 <SCRIPT TYPE="text/javascript"><!--
 function update_paramtable(option)
index 1487c3aa5a721d90a42433cbc69863c775a62be9..ac77ec7fcc9937a2d05732556e11672aa3962f95 100644 (file)
@@ -1,11 +1,11 @@
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
 ipptool.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
-ipptool.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
-ipptool.o: ../cups/language.h ../cups/array.h ../cups/string-private.h
-ipptool.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
-ipptool.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
-ipptool.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
-ipptool.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
-ipptool.o: ../cups/transcode.h ../cups/thread-private.h
-ipptool.o: ../cups/file-private.h ../cups/cups-private.h
+ipptool.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
+ipptool.o: ../cups/language.h ../cups/string-private.h ../config.h
+ipptool.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
+ipptool.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
+ipptool.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
+ipptool.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
+ipptool.o: ../cups/thread-private.h ../cups/file-private.h
+ipptool.o: ../cups/cups-private.h
index fb1caf8491784dd2efe5419a85f6d75aeeafbe15..eb547fb0162c9c1c177dcf34719ecb0ad6e40e19 100644 (file)
 #
 # Required by: RFC 2911 section 3.2.6
 {
+       # Skip this test when doing authenticated printing since we'll always
+       # use the authenticated username over the requesting-user-name value.
+       SKIP-IF-DEFINED uriuser
+
        NAME "3.2.6: Get-Jobs Operation (my-jobs different user)"
        OPERATION Get-Jobs
        GROUP operation-attributes-tag
index 9f746dcb0e0aab26994102424eb15e2fc4511f64..6d9dffa6b04eb04fd4ab3bedb9b51fa8738d1161 100644 (file)
 INCLUDE "ipp-1.1.test"
 
 
+# Regular expression for PWG media size names (eek!)
+DEFINE MEDIA_REGEX "/^((custom|na|asme|roc|oe)_[a-z0-9][-a-z0-9]*_([1-9][0-9]*(\.[0-9]*[1-9])?|0\.[0-9]*[1-9])x([1-9][0-9]*(\.[0-9]*[1-9])?|0\.[0-9]*[1-9])in|(custom|iso|jis|jpn|prc|om)_[a-z0-9][-a-z0-9]*_([1-9][0-9]*(\.[0-9]*[1-9])?|0\.[0-9]*[1-9])x([1-9][0-9]*(\.[0-9]*[1-9])?|0\.[0-9]*[1-9])mm)$$/"
+
+
 # Test required printer description attribute support.
 #
 # Required by: PWG 5100.10 section 6.2
@@ -38,13 +42,16 @@ INCLUDE "ipp-1.1.test"
 
        STATUS successful-ok
 
+       # Figure out capabilities
+       EXPECT color-supported OF-TYPE boolean IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE true DEFINE-MATCH PRINTER_IS_COLOR
+
        # Job template attributes
        EXPECT copies-default OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE >0
        EXPECT copies-supported OF-TYPE rangeOfInteger IN-GROUP printer-attributes-tag
        EXPECT finishings-default OF-TYPE enum IN-GROUP printer-attributes-tag
        EXPECT finishings-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 3
-       EXPECT media-default OF-TYPE keyword|name IN-GROUP printer-attributes-tag COUNT 1
-       EXPECT media-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag
+       EXPECT media-default OF-TYPE keyword|name IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "$MEDIA_REGEX"
+       EXPECT media-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag WITH-VALUE "$MEDIA_REGEX"
        EXPECT orientation-requested-default OF-TYPE enum,no-value IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE no-value,3,4,5,6
        EXPECT orientation-requested-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 3,4,5,6
        EXPECT output-bin-default OF-TYPE keyword|name IN-GROUP printer-attributes-tag COUNT 1
@@ -59,7 +66,8 @@ INCLUDE "ipp-1.1.test"
        # Printer description attributes
        EXPECT color-supported OF-TYPE boolean IN-GROUP printer-attributes-tag COUNT 1
        EXPECT pages-per-minute OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1
-       EXPECT pages-per-minute-color OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1
+       EXPECT pages-per-minute-color OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1 IF-DEFINED PRINTER_IS_COLOR
+       EXPECT !pages-per-minute-color IF-NOT-DEFINED PRINTER_IS_COLOR
        EXPECT printer-info OF-TYPE text IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "/^.{0,127}$$/"
        EXPECT printer-location OF-TYPE text IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "/^.{0,127}$$/"
        EXPECT printer-make-and-model OF-TYPE text IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "/^.{0,127}$$/"
index e52cb25e7ddce8664cd4b5d5d0ea701d4a8d4e78..98126947e1ad2201b5dc27d1361d47e9f9fbe6d4 100644 (file)
@@ -14,7 +14,7 @@
 #
 # Usage:
 #
-#   ./ipptool -V 2.1 -f filename -t printer-uri ipp-2.1.test
+#   ./ipptool -V 2.1 {-d PRINTER_IS_COLOR=1} -f filename -t printer-uri ipp-2.1.test
 #
 
 # Do all of the IPP/1.1 and IPP/2.0 tests as an IPP/2.1 client
index ac8ee886415186a6198af2e79c4dcdeadfd421ce..330c5212de33846345f6242723b56d48a8f6c7d1 100644 (file)
  *   get_variable()      - Get the value of a variable.
  *   iso_date()          - Return an ISO 8601 date/time string for the given IPP
  *                         dateTime value.
+ *   password_cb()       - Password callback for authenticated tests.
  *   print_attr()        - Print an attribute on the screen.
  *   print_col()         - Print a collection attribute on the screen.
  *   print_csv()         - Print a line of CSV text.
  *   print_fatal_error() - Print a fatal error message.
- *   print_line()        - Print a line of formatted text.
+ *   print_line()        - Print a line of formatted or CSV text.
  *   print_test_error()  - Print a test error message.
  *   print_xml_header()  - Print a standard XML plist header.
  *   print_xml_string()  - Print an XML string with escaping.
@@ -81,7 +82,7 @@ typedef struct _cups_expect_s         /**** Expected attribute info ****/
                *of_type,               /* Type name */
                *same_count_as,         /* Parallel attribute name */
                *if_defined,            /* Only required if variable defined */
-               *if_undefined,          /* Only required if variable is not defined */
+               *if_not_defined,        /* Only required if variable is not defined */
                *with_value,            /* Attribute must include this value */
                *define_match,          /* Variable to define on match */
                *define_no_match,       /* Variable to define on no-match */
@@ -95,7 +96,7 @@ typedef struct _cups_status_s         /**** Status info ****/
 {
   ipp_status_t status;                 /* Expected status code */
   char         *if_defined,            /* Only if variable is defined */
-               *if_undefined;          /* Only if variable is not defined */
+               *if_not_defined;        /* Only if variable is not defined */
 } _cups_status_t;
 
 typedef struct _cups_var_s             /**** Variable ****/
@@ -130,6 +131,7 @@ int         IgnoreErrors = 0,       /* Ignore errors? */
                Verbosity = 0,          /* Show all attributes? */
                Version = 11,           /* Default IPP version */
                XMLHeader = 0;          /* 1 if header is written */
+char           *Password = NULL;       /* Password from URI */
 const char * const URIStatusStrings[] =        /* URI status strings */
 {
   "URI too large",
@@ -167,6 +169,7 @@ static char *get_token(FILE *fp, char *buf, int buflen,
                           int *linenum);
 static char    *get_variable(_cups_vars_t *vars, const char *name);
 static char    *iso_date(ipp_uchar_t *date);
+static const char *password_cb(const char *prompt);
 static void    print_attr(ipp_attribute_t *attr);
 static void    print_col(ipp_t *col);
 static void    print_csv(ipp_attribute_t *attr, int num_displayed,
@@ -190,7 +193,8 @@ static void set_variable(_cups_vars_t *vars, const char *name,
                             const char *value);
 static void    usage(void);
 static int     validate_attr(ipp_attribute_t *attr, int print);
-static int      with_value(char *value, int regex, ipp_attribute_t *attr);
+static int      with_value(char *value, int regex, ipp_attribute_t *attr,
+                          int report);
 
 
 /*
@@ -428,9 +432,12 @@ main(int  argc,                            /* I - Number of command-line args */
        }
       }
     }
-    else if (!strncmp(argv[i], "ipp://", 6) ||
-             !strncmp(argv[i], "http://", 7) ||
-             !strncmp(argv[i], "https://", 8))
+    else if (!strncmp(argv[i], "ipp://", 6) || !strncmp(argv[i], "http://", 7)
+#ifdef HAVE_SSL
+            || !strncmp(argv[i], "ipps://", 7)
+            || !strncmp(argv[i], "https://", 8)
+#endif /* HAVE_SSL */
+            )
     {
      /*
       * Set URI...
@@ -442,6 +449,11 @@ main(int  argc,                            /* I - Number of command-line args */
         usage();
       }
 
+#ifdef HAVE_SSL
+      if (!strncmp(argv[i], "ipps://", 7) || !strncmp(argv[i], "https://", 8))
+        vars.encryption = HTTP_ENCRYPT_ALWAYS;
+#endif /* HAVE_SSL */
+
       vars.uri   = argv[i];
       uri_status = httpSeparateURI(HTTP_URI_CODING_ALL, vars.uri,
                                    vars.scheme, sizeof(vars.scheme),
@@ -457,12 +469,14 @@ main(int  argc,                           /* I - Number of command-line args */
         return (1);
       }
 
-      if (strcmp(vars.scheme, "http") && strcmp(vars.scheme, "https") &&
-          strcmp(vars.scheme, "ipp"))
+      if (vars.userpass[0])
       {
-        _cupsLangPuts(stderr, _("ipptool: Only http, https, and ipp URIs are "
-                               "supported."));
-       return (1);
+        if ((Password = strchr(vars.userpass, ':')) != NULL)
+         *Password++ = '\0';
+
+        cupsSetUser(vars.userpass);
+       cupsSetPasswordCB(password_cb);
+       set_variable(&vars, "uriuser", vars.userpass);
       }
     }
     else
@@ -855,7 +869,7 @@ do_tests(_cups_vars_t *vars,                /* I - Variables */
           strcasecmp(token, "DEFINE-NO-MATCH") &&
           strcasecmp(token, "DEFINE-VALUE") &&
           strcasecmp(token, "IF-DEFINED") &&
-          strcasecmp(token, "IF-UNDEFINED") &&
+          strcasecmp(token, "IF-NOT-DEFINED") &&
           strcasecmp(token, "IN-GROUP") &&
           strcasecmp(token, "OF-TYPE") &&
           strcasecmp(token, "SAME-COUNT-AS") &&
@@ -863,7 +877,7 @@ do_tests(_cups_vars_t *vars,                /* I - Variables */
         last_expect = NULL;
 
       if (strcasecmp(token, "IF-DEFINED") &&
-          strcasecmp(token, "IF-UNDEFINED"))
+          strcasecmp(token, "IF-NOT-DEFINED"))
         last_status = NULL;
 
       if (!strcmp(token, "}"))
@@ -1197,7 +1211,12 @@ do_tests(_cups_vars_t *vars,             /* I - Variables */
          goto test_exit;
        }
        else
+       {
+         if (Output == _CUPS_OUTPUT_TEST)
+           printf("    [%d second delay]\n", delay);
+
          sleep(delay);
+       }
       }
       else if (!strcasecmp(token, "ATTR"))
       {
@@ -1431,7 +1450,7 @@ do_tests(_cups_vars_t *vars,              /* I - Variables */
        num_statuses ++;
 
        last_status->if_defined   = NULL;
-       last_status->if_undefined = NULL;
+       last_status->if_not_defined = NULL;
       }
       else if (!strcasecmp(token, "EXPECT"))
       {
@@ -1642,22 +1661,22 @@ do_tests(_cups_vars_t *vars,            /* I - Variables */
          goto test_exit;
        }
       }
-      else if (!strcasecmp(token, "IF-UNDEFINED"))
+      else if (!strcasecmp(token, "IF-NOT-DEFINED"))
       {
        if (!get_token(fp, token, sizeof(token), &linenum))
        {
-         print_fatal_error("Missing IF-UNDEFINED name on line %d.", linenum);
+         print_fatal_error("Missing IF-NOT-DEFINED name on line %d.", linenum);
          pass = 0;
          goto test_exit;
        }
 
        if (last_expect)
-         last_expect->if_undefined = strdup(token);
+         last_expect->if_not_defined = strdup(token);
        else if (last_status)
-         last_status->if_undefined = strdup(token);
+         last_status->if_not_defined = strdup(token);
        else
        {
-         print_fatal_error("IF-UNDEFINED without a preceding EXPECT or STATUS "
+         print_fatal_error("IF-NOT-DEFINED without a preceding EXPECT or STATUS "
                            "on line %d.", linenum);
          pass = 0;
          goto test_exit;
@@ -1665,7 +1684,7 @@ do_tests(_cups_vars_t *vars,              /* I - Variables */
       }
       else if (!strcasecmp(token, "WITH-VALUE"))
       {
-       if (!get_token(fp, token, sizeof(token), &linenum))
+       if (!get_token(fp, temp, sizeof(temp), &linenum))
        {
          print_fatal_error("Missing WITH-VALUE value on line %d.", linenum);
          pass = 0;
@@ -1674,7 +1693,14 @@ do_tests(_cups_vars_t *vars,             /* I - Variables */
 
         if (last_expect)
        {
+        /*
+         * Expand any variables in the value and then save it.
+         */
+
+         expand_variables(vars, token, temp, sizeof(token));
+
          tokenptr = token + strlen(token) - 1;
+
          if (token[0] == '/' && tokenptr > token && *tokenptr == '/')
          {
           /*
@@ -1782,13 +1808,13 @@ do_tests(_cups_vars_t *vars,            /* I - Variables */
        puts("<key>Successful</key>");
        puts("<true />");
        puts("<key>StatusCode</key>");
-       print_xml_string("string", "skipped");
+       print_xml_string("string", "skip");
        puts("<key>ResponseAttributes</key>");
        puts("<dict>");
        puts("</dict>");
       }
       else if (Output == _CUPS_OUTPUT_TEST)
-       puts("SKIPPED]");
+       puts("SKIP]");
 
       goto skip_error;
     }
@@ -1846,9 +1872,12 @@ do_tests(_cups_vars_t *vars,             /* I - Variables */
       if (http->version != HTTP_1_1)
         prev_pass = pass = 0;
 
-      if (response->request.status.version[0] != (version / 10) ||
-         response->request.status.version[1] != (version % 10) ||
-         response->request.status.request_id != request_id)
+      if (response->request.status.request_id != request_id)
+        prev_pass = pass = 0;
+
+      if (version &&
+          (response->request.status.version[0] != (version / 10) ||
+          response->request.status.version[1] != (version % 10)))
         prev_pass = pass = 0;
 
       if ((attrptr = ippFindAttribute(response, "job-id",
@@ -1929,8 +1958,8 @@ do_tests(_cups_vars_t *vars,              /* I - Variables */
            !get_variable(vars, statuses[i].if_defined))
          continue;
 
-        if (statuses[i].if_undefined &&
-           get_variable(vars, statuses[i].if_undefined))
+        if (statuses[i].if_not_defined &&
+           get_variable(vars, statuses[i].if_not_defined))
          continue;
 
         if (response->request.status.status_code == statuses[i].status)
@@ -1946,7 +1975,8 @@ do_tests(_cups_vars_t *vars,              /* I - Variables */
           if (expect->if_defined && !get_variable(vars, expect->if_defined))
             continue;
 
-          if (expect->if_undefined && get_variable(vars, expect->if_undefined))
+          if (expect->if_not_defined &&
+             get_variable(vars, expect->if_not_defined))
             continue;
 
           found = ippFindAttribute(response, expect->name, IPP_TAG_ZERO);
@@ -1966,7 +1996,7 @@ do_tests(_cups_vars_t *vars,              /* I - Variables */
           }
 
           if (found &&
-             !with_value(expect->with_value, expect->with_regex, found))
+             !with_value(expect->with_value, expect->with_regex, found, 0))
           {
            if (expect->define_no_match)
              set_variable(vars, expect->define_no_match, "1");
@@ -2135,8 +2165,9 @@ do_tests(_cups_vars_t *vars,              /* I - Variables */
                         cupsLastErrorString());
       else
       {
-       if (response->request.status.version[0] != (version / 10) ||
-           response->request.status.version[1] != (version % 10))
+       if (version &&
+           (response->request.status.version[0] != (version / 10) ||
+            response->request.status.version[1] != (version % 10)))
           print_test_error("Bad version %d.%d in response - expected %d.%d "
                           "(RFC 2911 section 3.1.8).",
                           response->request.status.version[0],
@@ -2253,8 +2284,8 @@ do_tests(_cups_vars_t *vars,              /* I - Variables */
              !get_variable(vars, statuses[i].if_defined))
            continue;
 
-         if (statuses[i].if_undefined &&
-             get_variable(vars, statuses[i].if_undefined))
+         if (statuses[i].if_not_defined &&
+             get_variable(vars, statuses[i].if_not_defined))
            continue;
 
          if (response->request.status.status_code == statuses[i].status)
@@ -2276,7 +2307,8 @@ do_tests(_cups_vars_t *vars,              /* I - Variables */
          if (expect->if_defined && !get_variable(vars, expect->if_defined))
            continue;
 
-         if (expect->if_undefined && get_variable(vars, expect->if_undefined))
+         if (expect->if_not_defined &&
+             get_variable(vars, expect->if_not_defined))
            continue;
 
          found = ippFindAttribute(response, expect->name, IPP_TAG_ZERO);
@@ -2297,7 +2329,7 @@ do_tests(_cups_vars_t *vars,              /* I - Variables */
                               expect->name, ippTagString(expect->in_group),
                               ippTagString(found->group_tag));
 
-           if (!with_value(expect->with_value, expect->with_regex, found))
+           if (!with_value(expect->with_value, expect->with_regex, found, 0))
            {
              if (expect->with_regex)
                print_test_error("EXPECTED: %s WITH-VALUE /%s/",
@@ -2305,6 +2337,8 @@ do_tests(_cups_vars_t *vars,              /* I - Variables */
              else
                print_test_error("EXPECTED: %s WITH-VALUE \"%s\"",
                                 expect->name, expect->with_value);
+
+             with_value(expect->with_value, expect->with_regex, found, 1);
            }
 
            if (expect->count > 0 && found->num_values != expect->count)
@@ -2347,8 +2381,8 @@ do_tests(_cups_vars_t *vars,              /* I - Variables */
     {
       if (statuses[i].if_defined)
         free(statuses[i].if_defined);
-      if (statuses[i].if_undefined)
-        free(statuses[i].if_undefined);
+      if (statuses[i].if_not_defined)
+        free(statuses[i].if_not_defined);
     }
     num_statuses = 0;
 
@@ -2361,8 +2395,8 @@ do_tests(_cups_vars_t *vars,              /* I - Variables */
         free(expect->same_count_as);
       if (expect->if_defined)
         free(expect->if_defined);
-      if (expect->if_undefined)
-        free(expect->if_undefined);
+      if (expect->if_not_defined)
+        free(expect->if_not_defined);
       if (expect->with_value)
         free(expect->with_value);
       if (expect->define_match)
@@ -2395,8 +2429,8 @@ do_tests(_cups_vars_t *vars,              /* I - Variables */
   {
     if (statuses[i].if_defined)
       free(statuses[i].if_defined);
-    if (statuses[i].if_undefined)
-      free(statuses[i].if_undefined);
+    if (statuses[i].if_not_defined)
+      free(statuses[i].if_not_defined);
   }
 
   for (i = num_expects, expect = expects; i > 0; i --, expect ++)
@@ -2408,8 +2442,8 @@ do_tests(_cups_vars_t *vars,              /* I - Variables */
       free(expect->same_count_as);
     if (expect->if_defined)
       free(expect->if_defined);
-    if (expect->if_undefined)
-      free(expect->if_undefined);
+    if (expect->if_not_defined)
+      free(expect->if_not_defined);
     if (expect->with_value)
       free(expect->with_value);
     if (expect->define_match)
@@ -3034,6 +3068,19 @@ iso_date(ipp_uchar_t *date)              /* I - IPP (RFC 1903) date/time value */
 }
 
 
+/*
+ * 'password_cb()' - Password callback for authenticated tests.
+ */
+
+static const char *                    /* O - Password */
+password_cb(const char *prompt)                /* I - Prompt (unused) */
+{
+  (void)prompt;
+
+  return (Password);
+}
+
+
 /*
  * 'print_attr()' - Print an attribute on the screen.
  */
@@ -4401,7 +4448,8 @@ validate_attr(ipp_attribute_t *attr,      /* I - Attribute to validate */
 static int                             /* O - 1 on match, 0 on non-match */
 with_value(char            *value,     /* I - Value string */
            int             regex,      /* I - Value is a regular expression */
-           ipp_attribute_t *attr)      /* I - Attribute to compare */
+           ipp_attribute_t *attr,      /* I - Attribute to compare */
+          int             report)      /* I - 1 = report failures */
 {
   int  i;                              /* Looping var */
   char *valptr;                        /* Pointer into value */
@@ -4470,6 +4518,12 @@ with_value(char            *value,       /* I - Value string */
            }
          }
         }
+
+       if (report)
+       {
+         for (i = 0; i < attr->num_values; i ++)
+           print_test_error("GOT: %s=%d", attr->name, attr->values[i].integer);
+       }
        break;
 
     case IPP_TAG_BOOLEAN :
@@ -4478,6 +4532,13 @@ with_value(char            *value,       /* I - Value string */
           if (!strcmp(value, "true") == attr->values[i].boolean)
            return (1);
        }
+
+       if (report)
+       {
+         for (i = 0; i < attr->num_values; i ++)
+           print_test_error("GOT: %s=%s", attr->name,
+                            attr->values[i].boolean ? "true" : "false");
+       }
        break;
 
     case IPP_TAG_NOVALUE :
@@ -4519,7 +4580,13 @@ with_value(char            *value,       /* I - Value string */
          for (i = 0; i < attr->num_values; i ++)
          {
            if (regexec(&re, attr->values[i].string.text, 0, NULL, 0))
-             break;
+           {
+             if (report)
+               print_test_error("GOT: %s=\"%s\"", attr->name,
+                                attr->values[i].string.text);
+             else
+               break;
+           }
          }
 
          regfree(&re);
@@ -4538,6 +4605,13 @@ with_value(char            *value,       /* I - Value string */
            if (!strcmp(value, attr->values[i].string.text))
              return (1);
          }
+
+         if (report)
+         {
+           for (i = 0; i < attr->num_values; i ++)
+             print_test_error("GOT: %s=\"%s\"", attr->name,
+                              attr->values[i].string.text);
+         }
        }
        break;
 
index 373825ab3cabe7dcd6f9963ac90214aa18d35d66..ed4f73b5d1c442fe7d5ae0099a25dcc3daafe2e3 100644 (file)
                        MEMBER integer x-dimension 10160
                        MEMBER integer y-dimension 15240
                }
+
+               # Borderless
+               MEMBER integer media-left-margin 0
+               MEMBER integer media-right-margin 0
+               MEMBER integer media-top-margin 0
+               MEMBER integer media-bottom-margin 0
        }
 
        FILE $filename
diff --git a/test/print-uri.test b/test/print-uri.test
new file mode 100644 (file)
index 0000000..aaa7d39
--- /dev/null
@@ -0,0 +1,27 @@
+# Print a file using Print-URI
+{
+       # The name of the test...
+       NAME "Print file using Print-URI"
+
+       # The operation to use
+       OPERATION Print-URI
+
+       # Attributes, starting in the operation group...
+       GROUP operation-attributes-tag
+       ATTR charset attributes-charset utf-8
+       ATTR language attributes-natural-language en
+       ATTR uri printer-uri $uri
+       ATTR name requesting-user-name $user
+       ATTR uri document-uri file://$filename
+
+       GROUP job-attributes-tag
+       ATTR integer copies 1
+
+       # What statuses are OK?
+       STATUS successful-ok
+       STATUS successful-ok-ignored-or-substituted-attributes
+
+       # What attributes do we expect?
+       EXPECT job-id
+       EXPECT job-uri
+}
index 013e4283bb4e83da9438d87bd7c4572ca355e8b1..1d0973b9dc16dfd4c0714024ac24adf52aa8aca1 100755 (executable)
@@ -651,7 +651,7 @@ fi
 
 # Requests logged
 count=`wc -l /tmp/cups-$user/log/access_log | awk '{print $1}'`
-expected=`expr 39 + 18 + $pjobs \* 8 + $pprinters \* $pjobs \* 4`
+expected=`expr 37 + 18 + $pjobs \* 8 + $pprinters \* $pjobs \* 4`
 if test $count != $expected; then
        echo "FAIL: $count requests logged, expected $expected."
        echo "<P>FAIL: $count requests logged, expected $expected.</P>" >>$strfile
index e08ea40cd42a09c91bf4e5c5f6298d48157b9c22..00eebe22808e45f129cfbb64aae6dbd3502d1a2b 100644 (file)
@@ -24,8 +24,8 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdarg.h>
-#include <ctype.h>
 #include <io.h>
+#include <direct.h>
 
 
 /*
 #define close          _close
 #define fileno         _fileno
 #define lseek          _lseek
+#define mkdir(d,p)     _mkdir(d)
 #define open           _open
 #define read           _read
+#define rmdir          _rmdir
 #define snprintf       _snprintf
 #define strdup         _strdup
 #define unlink         _unlink
index 919fe3f641cd9ec96fb417da0f7a86312d130524..0b88dcf1ed87c58f11a4306c831db4a5aa461d64 100644 (file)
@@ -71,7 +71,7 @@ regmatch_t pmatch[];
 int eflags;
 {
        register char *endp;
-       register int i;
+       register size_t i;
        struct match mv;
        register struct match *m = &mv;
        register char *dp;
index dc4860110995a274b63299c9deff341cedcfced2..5df5d53fc15586821ba70b09de9addf57389ed2f 100644 (file)
@@ -1054,7 +1054,7 @@ freeset(p, cs)
 register struct parse *p;
 register cset *cs;
 {
-       register int i;
+       register size_t i;
        register cset *top = &p->g->sets[p->g->ncsets];
        register size_t css = (size_t)p->g->csetsize;
 
@@ -1080,7 +1080,7 @@ register struct parse *p;
 register cset *cs;
 {
        register uch h = cs->hash;
-       register int i;
+       register size_t i;
        register cset *top = &p->g->sets[p->g->ncsets];
        register cset *cs2;
        register size_t css = (size_t)p->g->csetsize;
@@ -1113,7 +1113,7 @@ firstch(p, cs)
 register struct parse *p;
 register cset *cs;
 {
-       register int i;
+       register size_t i;
        register size_t css = (size_t)p->g->csetsize;
 
        for (i = 0; i < css; i++)
@@ -1132,7 +1132,7 @@ nch(p, cs)
 register struct parse *p;
 register cset *cs;
 {
-       register int i;
+       register size_t i;
        register size_t css = (size_t)p->g->csetsize;
        register int n = 0;