aboutsummaryrefslogtreecommitdiffstats
path: root/cups/dest-options.c
diff options
context:
space:
mode:
Diffstat (limited to 'cups/dest-options.c')
-rw-r--r--cups/dest-options.c90
1 files changed, 86 insertions, 4 deletions
diff --git a/cups/dest-options.c b/cups/dest-options.c
index bf9020ba..51705a50 100644
--- a/cups/dest-options.c
+++ b/cups/dest-options.c
@@ -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
@@ -73,7 +73,7 @@ cupsCheckDestSupported(
cups_dest_t *dest, /* I - Destination */
cups_dinfo_t *dinfo, /* I - Destination information */
const char *option, /* I - Option */
- const char *value) /* I - Value */
+ const char *value) /* I - Value or @code NULL@ */
{
int i; /* Looping var */
char temp[1024]; /* Temporary string */
@@ -86,10 +86,17 @@ cupsCheckDestSupported(
/*
+ * Get the default connection as needed...
+ */
+
+ if (!http)
+ http = _cupsConnect();
+
+ /*
* Range check input...
*/
- if (!http || !dest || !dinfo || !option || !value)
+ if (!http || !dest || !dinfo || !option)
return (0);
/*
@@ -107,7 +114,10 @@ cupsCheckDestSupported(
if (!attr)
return (0);
- /*
+ if (!value)
+ return (1);
+
+/*
* Compare values...
*/
@@ -316,6 +326,13 @@ cupsCopyDestConflicts(
*resolved = NULL;
/*
+ * Get the default connection as needed...
+ */
+
+ if (!http)
+ http = _cupsConnect();
+
+ /*
* Range check input...
*/
@@ -575,6 +592,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...
*/
@@ -686,6 +710,13 @@ cupsFindDestDefault(
/*
+ * Get the default connection as needed...
+ */
+
+ if (!http)
+ http = _cupsConnect();
+
+ /*
* Range check input...
*/
@@ -727,6 +758,13 @@ cupsFindDestReady(
/*
+ * Get the default connection as needed...
+ */
+
+ if (!http)
+ http = _cupsConnect();
+
+ /*
* Range check input...
*/
@@ -770,6 +808,13 @@ cupsFindDestSupported(
/*
+ * Get the default connection as needed...
+ */
+
+ if (!http)
+ http = _cupsConnect();
+
+ /*
* Range check input...
*/
@@ -791,6 +836,8 @@ cupsFindDestSupported(
/*
* 'cupsFreeDestInfo()' - Free destination information obtained using
* @link cupsCopyDestInfo@.
+ *
+ * @since CUPS 1.6/macOS 10.8@
*/
void
@@ -852,6 +899,13 @@ cupsGetDestMediaByIndex(
/*
+ * Get the default connection as needed...
+ */
+
+ if (!http)
+ http = _cupsConnect();
+
+ /*
* Range check input...
*/
@@ -940,6 +994,13 @@ cupsGetDestMediaByName(
/*
+ * Get the default connection as needed...
+ */
+
+ if (!http)
+ http = _cupsConnect();
+
+ /*
* Range check input...
*/
@@ -1008,6 +1069,13 @@ cupsGetDestMediaBySize(
/*
+ * Get the default connection as needed...
+ */
+
+ if (!http)
+ http = _cupsConnect();
+
+ /*
* Range check input...
*/
@@ -1059,6 +1127,13 @@ cupsGetDestMediaCount(
unsigned flags) /* I - Media flags */
{
/*
+ * Get the default connection as needed...
+ */
+
+ if (!http)
+ http = _cupsConnect();
+
+ /*
* Range check input...
*/
@@ -1104,6 +1179,13 @@ cupsGetDestMediaDefault(
/*
+ * Get the default connection as needed...
+ */
+
+ if (!http)
+ http = _cupsConnect();
+
+ /*
* Range check input...
*/