/*
- * "$Id$"
- *
* Destination option/media support for CUPS.
*
- * Copyright 2012-2014 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
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* 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/".
+ * missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*/
*
* Returns 1 if supported, 0 otherwise.
*
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
*/
int /* O - 1 if supported, 0 otherwise */
_ipp_value_t *attrval; /* Current attribute value */
+ /*
+ * Get the default connection as needed...
+ */
+
+ if (!http)
+ http = _cupsConnect();
+
/*
* Range check input...
*/
* If cupsCopyDestConflicts returns 1 but "num_resolved" and "resolved" are set
* to 0 and @code NULL@, respectively, then the conflict cannot be resolved.
*
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
*/
int /* O - 1 if there is a conflict, 0 if none, -1 on error */
if (resolved)
*resolved = NULL;
+ /*
+ * Get the default connection as needed...
+ */
+
+ if (!http)
+ http = _cupsConnect();
+
/*
* Range check input...
*/
* The caller is responsible for calling @link cupsFreeDestInfo@ on the return
* value. @code NULL@ is returned on error.
*
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
*/
cups_dinfo_t * /* O - Destination information */
};
- DEBUG_printf(("cupsCopyDestSupported(http=%p, dest=%p(%s))", http, dest,
- dest ? dest->name : ""));
+ 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...
* @code ippGetResolution@, @code ippGetString@, and @code ippGetValueTag@
* functions to inspect the default value(s) as needed.
*
- * @since CUPS 1.7/OS X 10.9@
+ * @since CUPS 1.7/macOS 10.9@
*/
ipp_attribute_t * /* O - Default attribute or @code NULL@ for none */
char name[IPP_MAX_NAME]; /* Attribute name */
+ /*
+ * Get the default connection as needed...
+ */
+
+ if (!http)
+ http = _cupsConnect();
+
/*
* Range check input...
*/
return (ippFindAttribute(dinfo->attrs, name, IPP_TAG_ZERO));
}
+
/*
* 'cupsFindDestReady()' - Find the default value(s) for the given option.
*
* @code ippGetResolution@, @code ippGetString@, and @code ippGetValueTag@
* functions to inspect the default value(s) as needed.
*
- * @since CUPS 1.7/OS X 10.9@
+ * @since CUPS 1.7/macOS 10.9@
*/
ipp_attribute_t * /* O - Default attribute or @code NULL@ for none */
char name[IPP_MAX_NAME]; /* Attribute name */
+ /*
+ * Get the default connection as needed...
+ */
+
+ if (!http)
+ http = _cupsConnect();
+
/*
* Range check input...
*/
return (ippFindAttribute(dinfo->ready_attrs, name, IPP_TAG_ZERO));
}
+
/*
* 'cupsFindDestSupported()' - Find the default value(s) for the given option.
*
* @code ippGetResolution@, @code ippGetString@, and @code ippGetValueTag@
* functions to inspect the default value(s) as needed.
*
- * @since CUPS 1.7/OS X 10.9@
+ * @since CUPS 1.7/macOS 10.9@
*/
ipp_attribute_t * /* O - Default attribute or @code NULL@ for none */
char name[IPP_MAX_NAME]; /* Attribute name */
+ /*
+ * Get the default connection as needed...
+ */
+
+ if (!http)
+ http = _cupsConnect();
+
/*
* Range check input...
*/
/*
* 'cupsFreeDestInfo()' - Free destination information obtained using
* @link cupsCopyDestInfo@.
+ *
+ * @since CUPS 1.6/macOS 10.8@
*/
void
* example, passing @code CUPS_MEDIA_FLAGS_BORDERLESS@ will get the Nth
* borderless size supported by the printer.
*
- * @since CUPS 1.7/OS X 10.9@
+ * @since CUPS 1.7/macOS 10.9@
*/
int /* O - 1 on success, 0 on failure */
pwg_media_t *pwg; /* PWG media name for size */
+ /*
+ * Get the default connection as needed...
+ */
+
+ if (!http)
+ http = _cupsConnect();
+
/*
* Range check input...
*/
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
return (0);
}
-
+
if (nsize->size_name)
strlcpy(size->media, nsize->size_name, sizeof(size->media));
else if (nsize->key)
*
* Returns 1 when there is a match and 0 if there is not a match.
*
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
*/
int /* O - 1 on match, 0 on failure */
pwg_media_t *pwg; /* PWG media info */
+ /*
+ * Get the default connection as needed...
+ */
+
+ if (!http)
+ http = _cupsConnect();
+
/*
* Range check input...
*/
*
* Returns 1 when there is a match and 0 if there is not a match.
*
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
*/
int /* O - 1 on match, 0 on failure */
pwg_media_t *pwg; /* PWG media info */
+ /*
+ * Get the default connection as needed...
+ */
+
+ if (!http)
+ http = _cupsConnect();
+
/*
* Range check input...
*/
* counted. For example, passing @code CUPS_MEDIA_FLAGS_BORDERLESS@ will return
* the number of borderless sizes.
*
- * @since CUPS 1.7/OS X 10.9@
+ * @since CUPS 1.7/macOS 10.9@
*/
int /* O - Number of sizes */
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...
*/
* example, passing @code CUPS_MEDIA_FLAGS_BORDERLESS@ will return the default
* borderless size, typically US Letter or A4, but sometimes 4x6 photo media.
*
- * @since CUPS 1.7/OS X 10.9@
+ * @since CUPS 1.7/macOS 10.9@
*/
int /* O - 1 on success, 0 on failure */
const char *media; /* Default media size */
+ /*
+ * Get the default connection as needed...
+ */
+
+ if (!http)
+ http = _cupsConnect();
+
/*
* Range check input...
*/
*first; /* First entry this size */
- DEBUG_printf(("3cups_create_cached(http=%p, dinfo=%p, flags=%u)", http, dinfo, flags));
+ DEBUG_printf(("3cups_create_cached(http=%p, dinfo=%p, flags=%u)", (void *)http, (void *)dinfo, flags));
if (dinfo->cached_db)
cupsArrayDelete(dinfo->cached_db);
mdb;
mdb = (_cups_media_db_t *)cupsArrayNext(db))
{
- DEBUG_printf(("4cups_create_cached: %p key=\"%s\", type=\"%s\", %dx%d, B%d L%d R%d T%d", mdb, mdb->key, mdb->type, mdb->width, mdb->length, mdb->bottom, mdb->left, mdb->right, mdb->top));
+ DEBUG_printf(("4cups_create_cached: %p key=\"%s\", type=\"%s\", %dx%d, B%d L%d R%d T%d", (void *)mdb, mdb->key, mdb->type, mdb->width, mdb->length, mdb->bottom, mdb->left, mdb->right, mdb->top));
if (flags & CUPS_MEDIA_FLAGS_BORDERLESS)
{
if (!mdb->left && !mdb->right && !mdb->top && !mdb->bottom)
{
- DEBUG_printf(("4cups_create_cached: add %p", mdb));
+ DEBUG_printf(("4cups_create_cached: add %p", (void *)mdb));
cupsArrayAdd(dinfo->cached_db, mdb);
}
}
{
if (first->width != mdb->width || first->length != mdb->length)
{
- DEBUG_printf(("4cups_create_cached: add %p", first));
+ DEBUG_printf(("4cups_create_cached: add %p", (void *)first));
cupsArrayAdd(dinfo->cached_db, first);
first = mdb;
}
}
else
{
- DEBUG_printf(("4cups_create_cached: add %p", mdb));
+ DEBUG_printf(("4cups_create_cached: add %p", (void *)mdb));
cupsArrayAdd(dinfo->cached_db, mdb);
}
}
if (flags & CUPS_MEDIA_FLAGS_DUPLEX)
{
- DEBUG_printf(("4cups_create_cached: add %p", first));
+ DEBUG_printf(("4cups_create_cached: add %p", (void *)first));
cupsArrayAdd(dinfo->cached_db, first);
}
}
dinfo->ready_time = time(NULL);
}
-
-
-/*
- * End of "$Id$".
- */