]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/dest-options.c
Re-implement cupsGetDests and cupsCreateJob using cupsEnumDests (Issue #4993)
[thirdparty/cups.git] / cups / dest-options.c
index bf9020bac6e31eb0fb0b86fca5674ead69961fa7..2832055a46e98b8685013f21a9ae99095d23d99e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Destination option/media support for CUPS.
  *
- * Copyright 2012-2016 by Apple Inc.
+ * Copyright 2012-2017 by Apple Inc.
  *
  * These coded instructions, statements, and computer programs are the
  * property of Apple Inc. and are protected by Federal copyright
@@ -85,6 +85,13 @@ cupsCheckDestSupported(
   _ipp_value_t         *attrval;       /* Current attribute value */
 
 
+ /*
+  * Get the default connection as needed...
+  */
+
+  if (!http)
+    http = _cupsConnect();
+
  /*
   * Range check input...
   */
@@ -315,6 +322,13 @@ cupsCopyDestConflicts(
   if (resolved)
     *resolved = NULL;
 
+ /*
+  * Get the default connection as needed...
+  */
+
+  if (!http)
+    http = _cupsConnect();
+
  /*
   * Range check input...
   */
@@ -574,6 +588,13 @@ cupsCopyDestInfo(
 
   DEBUG_printf(("cupsCopyDestSupported(http=%p, dest=%p(%s))", (void *)http, (void *)dest, dest ? dest->name : ""));
 
+ /*
+  * Get the default connection as needed...
+  */
+
+  if (!http)
+    http = _cupsConnect();
+
  /*
   * Range check input...
   */
@@ -685,6 +706,13 @@ cupsFindDestDefault(
   char name[IPP_MAX_NAME];             /* Attribute name */
 
 
+ /*
+  * Get the default connection as needed...
+  */
+
+  if (!http)
+    http = _cupsConnect();
+
  /*
   * Range check input...
   */
@@ -726,6 +754,13 @@ cupsFindDestReady(
   char name[IPP_MAX_NAME];             /* Attribute name */
 
 
+ /*
+  * Get the default connection as needed...
+  */
+
+  if (!http)
+    http = _cupsConnect();
+
  /*
   * Range check input...
   */
@@ -769,6 +804,13 @@ cupsFindDestSupported(
   char name[IPP_MAX_NAME];             /* Attribute name */
 
 
+ /*
+  * Get the default connection as needed...
+  */
+
+  if (!http)
+    http = _cupsConnect();
+
  /*
   * Range check input...
   */
@@ -851,6 +893,13 @@ cupsGetDestMediaByIndex(
   pwg_media_t          *pwg;           /* PWG media name for size */
 
 
+ /*
+  * Get the default connection as needed...
+  */
+
+  if (!http)
+    http = _cupsConnect();
+
  /*
   * Range check input...
   */
@@ -939,6 +988,13 @@ cupsGetDestMediaByName(
   pwg_media_t          *pwg;           /* PWG media info */
 
 
+ /*
+  * Get the default connection as needed...
+  */
+
+  if (!http)
+    http = _cupsConnect();
+
  /*
   * Range check input...
   */
@@ -1007,6 +1063,13 @@ cupsGetDestMediaBySize(
   pwg_media_t          *pwg;           /* PWG media info */
 
 
+ /*
+  * Get the default connection as needed...
+  */
+
+  if (!http)
+    http = _cupsConnect();
+
  /*
   * Range check input...
   */
@@ -1058,6 +1121,13 @@ cupsGetDestMediaCount(
     cups_dinfo_t *dinfo,               /* I - Destination information */
     unsigned     flags)                        /* I - Media flags */
 {
+ /*
+  * Get the default connection as needed...
+  */
+
+  if (!http)
+    http = _cupsConnect();
+
  /*
   * Range check input...
   */
@@ -1103,6 +1173,13 @@ cupsGetDestMediaDefault(
   const char   *media;                 /* Default media size */
 
 
+ /*
+  * Get the default connection as needed...
+  */
+
+  if (!http)
+    http = _cupsConnect();
+
  /*
   * Range check input...
   */