/*
* Printing utilities for CUPS.
*
- * Copyright 2007-2017 by Apple Inc.
- * Copyright 1997-2006 by Easy Software Products.
+ * Copyright © 2007-2018 by Apple Inc.
+ * Copyright © 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
#endif /* WIN32 || __EMX__ */
-/*
- * Enumeration data and callback...
- */
-
-typedef struct _cups_createdata_s
-{
- const char *name; /* Destination name */
- cups_dest_t *dest; /* Matching destination */
-} _cups_createdata_t;
-
-static int cups_create_cb(_cups_createdata_t *data, unsigned flags, cups_dest_t *dest);
-
-
/*
* 'cupsCancelJob()' - Cancel a print job on the default server.
*
*
* Use the @link cupsLastError@ and @link cupsLastErrorString@ functions to get
* the cause of any failure.
+ *
+ * @exclude all@
*/
int /* O - 1 on success, 0 on failure */
* Use the @link cupsLastError@ and @link cupsLastErrorString@ functions to get
* the cause of any failure.
*
- * @since CUPS 1.4/macOS 10.6@
+ * @since CUPS 1.4/macOS 10.6@ @exclude all@
*/
ipp_status_t /* O - IPP status */
* print, use the @link cupsPrintFile2@ or @link cupsPrintFiles2@ function
* instead.
*
- * @since CUPS 1.4/macOS 10.6@
+ * @since CUPS 1.4/macOS 10.6@ @exclude all@
*/
int /* O - Job ID or 0 on error */
{
int job_id = 0; /* job-id value */
ipp_status_t status; /* Create-Job status */
- _cups_createdata_t data; /* Enumeration data */
+ cups_dest_t *dest; /* Destination */
cups_dinfo_t *info; /* Destination information */
* Lookup the destination...
*/
- data.name = name;
- data.dest = NULL;
-
- cupsEnumDests(0, 1000, NULL, 0, CUPS_PRINTER_3D, (cups_dest_cb_t)cups_create_cb, &data);
-
- if (!data.dest)
+ if ((dest = cupsGetNamedDest(http, name, NULL)) == NULL)
{
DEBUG_puts("1cupsCreateJob: Destination not found.");
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(ENOENT), 0);
*/
DEBUG_puts("1cupsCreateJob: Querying destination info.");
- if ((info = cupsCopyDestInfo(http, data.dest)) == NULL)
+ if ((info = cupsCopyDestInfo(http, dest)) == NULL)
{
DEBUG_puts("1cupsCreateJob: Query failed.");
- cupsFreeDests(1, data.dest);
+ cupsFreeDests(1, dest);
return (0);
}
- status = cupsCreateDestJob(http, data.dest, info, &job_id, title, num_options, options);
+ status = cupsCreateDestJob(http, dest, info, &job_id, title, num_options, options);
DEBUG_printf(("1cupsCreateJob: cupsCreateDestJob returned %04x (%s)", status, ippErrorString(status)));
cupsFreeDestInfo(info);
- cupsFreeDests(1, data.dest);
+ cupsFreeDests(1, dest);
/*
* Return the job...
*
* The document must have been started using @link cupsStartDocument@.
*
- * @since CUPS 1.4/macOS 10.6@
+ * @since CUPS 1.4/macOS 10.6@ @exclude all@
*/
ipp_status_t /* O - Status of document submission */
* This function is deprecated and no longer returns a list of printer
* classes - use @link cupsGetDests@ instead.
*
- * @deprecated@
+ * @deprecated@ @exclude all@
*/
int /* O - Number of classes */
* Applications should use the @link cupsGetDests@ and @link cupsGetDest@
* functions to get the user-defined default printer, as this function does
* not support the lpoptions-defined default printer.
+ *
+ * @exclude all@
*/
const char * /* O - Default printer or @code NULL@ */
* functions to get the user-defined default printer, as this function does
* not support the lpoptions-defined default printer.
*
- * @since CUPS 1.1.21/macOS 10.4@
+ * @since CUPS 1.1.21/macOS 10.4@ @exclude all@
*/
const char * /* O - Default printer or @code NULL@ */
* of state, while @code CUPS_WHICHJOBS_ACTIVE@ returns jobs that are
* pending, processing, or held and @code CUPS_WHICHJOBS_COMPLETED@ returns
* jobs that are stopped, canceled, aborted, or completed.
+ *
+ * @exclude all@
*/
int /* O - Number of jobs */
* This function is deprecated and no longer returns a list of printers - use
* @link cupsGetDests@ instead.
*
- * @deprecated@
+ * @deprecated@ @exclude all@
*/
int /* O - Number of printers */
/*
* 'cupsPrintFile()' - Print a file to a printer or class on the default server.
+ *
+ * @exclude all@
*/
int /* O - Job ID or 0 on error */
* 'cupsPrintFile2()' - Print a file to a printer or class on the specified
* server.
*
- * @since CUPS 1.1.21/macOS 10.4@
+ * @since CUPS 1.1.21/macOS 10.4@ @exclude all@
*/
int /* O - Job ID or 0 on error */
/*
* 'cupsPrintFiles()' - Print one or more files to a printer or class on the
* default server.
+ *
+ * @exclude all@
*/
int /* O - Job ID or 0 on error */
* 'cupsPrintFiles2()' - Print one or more files to a printer or class on the
* specified server.
*
- * @since CUPS 1.1.21/macOS 10.4@
+ * @since CUPS 1.1.21/macOS 10.4@ @exclude all@
*/
int /* O - Job ID or 0 on error */
* @code CUPS_FORMAT_TEXT@ are provided for the "format" argument, although
* any supported MIME type string can be supplied.
*
- * @since CUPS 1.4/macOS 10.6@
+ * @since CUPS 1.4/macOS 10.6@ @exclude all@
*/
http_status_t /* O - HTTP status of request */
return (status);
}
-
-/*
- * 'cups_create_cb()' - Find the destination for printing.
- */
-
-static int /* O - 0 on match */
-cups_create_cb(
- _cups_createdata_t *data, /* I - Data from cupsCreateJob call */
- unsigned flags, /* I - Enumeration flags */
- cups_dest_t *dest) /* I - Destination */
-{
- DEBUG_printf(("2cups_create_cb(data=%p(%s), flags=%08x, dest=%p(%s))", data, data->name, flags, dest, dest->name));
-
- (void)flags;
-
- if (dest->instance || strcasecmp(data->name, dest->name))
- return (1);
-
- cupsCopyDest(dest, 0, &data->dest);
-
- return (0);
-}